"""Generated client library for labelmanager version v1alpha1."""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.py import base_api
from googlecloudsdk.third_party.apis.labelmanager.v1alpha1 import labelmanager_v1alpha1_messages as messages


class LabelmanagerV1alpha1(base_api.BaseApiClient):
  """Generated client library for service labelmanager version v1alpha1."""

  MESSAGES_MODULE = messages
  BASE_URL = 'https://labelmanager.googleapis.com/'
  MTLS_BASE_URL = 'https://labelmanager.mtls.googleapis.com/'

  _PACKAGE = 'labelmanager'
  _SCOPES = ['https://www.googleapis.com/auth/cloud-platform']
  _VERSION = 'v1alpha1'
  _CLIENT_ID = '1042881264118.apps.googleusercontent.com'
  _CLIENT_SECRET = 'x_Tw5K8nnjoRAqULM9PFAC2b'
  _USER_AGENT = 'google-cloud-sdk'
  _CLIENT_CLASS_NAME = 'LabelmanagerV1alpha1'
  _URL_VERSION = 'v1alpha1'
  _API_KEY = None

  def __init__(self, url='', credentials=None,
               get_credentials=True, http=None, model=None,
               log_request=False, log_response=False,
               credentials_args=None, default_global_params=None,
               additional_http_headers=None, response_encoding=None):
    """Create a new labelmanager handle."""
    url = url or self.BASE_URL
    super(LabelmanagerV1alpha1, self).__init__(
        url, credentials=credentials,
        get_credentials=get_credentials, http=http, model=model,
        log_request=log_request, log_response=log_response,
        credentials_args=credentials_args,
        default_global_params=default_global_params,
        additional_http_headers=additional_http_headers,
        response_encoding=response_encoding)
    self.labelBindings = self.LabelBindingsService(self)
    self.labelKeys = self.LabelKeysService(self)
    self.labelValues = self.LabelValuesService(self)
    self.operations = self.OperationsService(self)

  class LabelBindingsService(base_api.BaseApiService):
    """Service class for the labelBindings resource."""

    _NAME = 'labelBindings'

    def __init__(self, client):
      super(LabelmanagerV1alpha1.LabelBindingsService, self).__init__(client)
      self._upload_configs = {
          }

    def Create(self, request, global_params=None):
      r"""Creates a LabelBinding between a LabelValue and a cloud resource.
(currently Project, Folder, or Organization).

      Args:
        request: (LabelBinding) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Operation) The response message.
      """
      config = self.GetMethodConfig('Create')
      return self._RunMethod(
          config, request, global_params=global_params)

    Create.method_config = lambda: base_api.ApiMethodInfo(
        http_method='POST',
        method_id='labelmanager.labelBindings.create',
        ordered_params=[],
        path_params=[],
        query_params=[],
        relative_path='v1alpha1/labelBindings',
        request_field='<request>',
        request_type_name='LabelBinding',
        response_type_name='Operation',
        supports_download=False,
    )

    def Delete(self, request, global_params=None):
      r"""Deletes a LabelBinding.

      Args:
        request: (LabelmanagerLabelBindingsDeleteRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Operation) The response message.
      """
      config = self.GetMethodConfig('Delete')
      return self._RunMethod(
          config, request, global_params=global_params)

    Delete.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/labelBindings/{labelBindingsId}',
        http_method='DELETE',
        method_id='labelmanager.labelBindings.delete',
        ordered_params=['name'],
        path_params=['name'],
        query_params=[],
        relative_path='v1alpha1/{+name}',
        request_field='',
        request_type_name='LabelmanagerLabelBindingsDeleteRequest',
        response_type_name='Operation',
        supports_download=False,
    )

    def List(self, request, global_params=None):
      r"""Lists the LabelBindings for the given LabelValue or cloud resource.
(currently Project, Folder, or Organization) determined by the given
filter.

List LabelBindings for LabelValue with id 123 will map to:
/v1alpha1/labelBindings?filter=labelValue:labelValues/123
List LabelBindings for Project resource with id 456 will map to:
/v1alpha1/labelBindings?filter=resource://cloudresourcemanager.googleapis.com/projects/456
because the full resource name is required.

For additional details see:
https://cloud.google.com/apis/design/resource_names#full_resource_name.

      Args:
        request: (LabelmanagerLabelBindingsListRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (ListLabelBindingsResponse) The response message.
      """
      config = self.GetMethodConfig('List')
      return self._RunMethod(
          config, request, global_params=global_params)

    List.method_config = lambda: base_api.ApiMethodInfo(
        http_method='GET',
        method_id='labelmanager.labelBindings.list',
        ordered_params=[],
        path_params=[],
        query_params=['filter', 'pageSize', 'pageToken'],
        relative_path='v1alpha1/labelBindings',
        request_field='',
        request_type_name='LabelmanagerLabelBindingsListRequest',
        response_type_name='ListLabelBindingsResponse',
        supports_download=False,
    )

  class LabelKeysService(base_api.BaseApiService):
    """Service class for the labelKeys resource."""

    _NAME = 'labelKeys'

    def __init__(self, client):
      super(LabelmanagerV1alpha1.LabelKeysService, self).__init__(client)
      self._upload_configs = {
          }

    def Create(self, request, global_params=None):
      r"""Creates a new LabelKey. If another request with the same parameters is.
sent while the original request is in process, the second request
will receive an error. A maximum of 300 LabelKeys (with any lifecycle
state) can exist under a parent at any given time.

      Args:
        request: (LabelKey) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Operation) The response message.
      """
      config = self.GetMethodConfig('Create')
      return self._RunMethod(
          config, request, global_params=global_params)

    Create.method_config = lambda: base_api.ApiMethodInfo(
        http_method='POST',
        method_id='labelmanager.labelKeys.create',
        ordered_params=[],
        path_params=[],
        query_params=[],
        relative_path='v1alpha1/labelKeys',
        request_field='<request>',
        request_type_name='LabelKey',
        response_type_name='Operation',
        supports_download=False,
    )

    def Delete(self, request, global_params=None):
      r"""Requests deletion of a LabelKey. The LabelKey is moved into the.
DELETE_REQUESTED state
immediately, and is deleted approximately 30 days later. The LabelKey
cannot be deleted if it has any child LabelValues in the
ACTIVE state.

      Args:
        request: (LabelmanagerLabelKeysDeleteRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Operation) The response message.
      """
      config = self.GetMethodConfig('Delete')
      return self._RunMethod(
          config, request, global_params=global_params)

    Delete.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/labelKeys/{labelKeysId}',
        http_method='DELETE',
        method_id='labelmanager.labelKeys.delete',
        ordered_params=['name'],
        path_params=['name'],
        query_params=[],
        relative_path='v1alpha1/{+name}',
        request_field='',
        request_type_name='LabelmanagerLabelKeysDeleteRequest',
        response_type_name='Operation',
        supports_download=False,
    )

    def Get(self, request, global_params=None):
      r"""Retrieves a LabelKey. This method will return PERMISSION_DENIED if the.
key does not exist or the user does not have permission to view it.

      Args:
        request: (LabelmanagerLabelKeysGetRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (LabelKey) The response message.
      """
      config = self.GetMethodConfig('Get')
      return self._RunMethod(
          config, request, global_params=global_params)

    Get.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/labelKeys/{labelKeysId}',
        http_method='GET',
        method_id='labelmanager.labelKeys.get',
        ordered_params=['name'],
        path_params=['name'],
        query_params=[],
        relative_path='v1alpha1/{+name}',
        request_field='',
        request_type_name='LabelmanagerLabelKeysGetRequest',
        response_type_name='LabelKey',
        supports_download=False,
    )

    def GetIamPolicy(self, request, global_params=None):
      r"""Gets the access control policy for a resource.
Returns an empty policy if the resource exists and does not have a policy
set.

      Args:
        request: (LabelmanagerLabelKeysGetIamPolicyRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Policy) The response message.
      """
      config = self.GetMethodConfig('GetIamPolicy')
      return self._RunMethod(
          config, request, global_params=global_params)

    GetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/labelKeys/{labelKeysId}:getIamPolicy',
        http_method='GET',
        method_id='labelmanager.labelKeys.getIamPolicy',
        ordered_params=['resource'],
        path_params=['resource'],
        query_params=['options_requestedPolicyVersion'],
        relative_path='v1alpha1/{+resource}:getIamPolicy',
        request_field='',
        request_type_name='LabelmanagerLabelKeysGetIamPolicyRequest',
        response_type_name='Policy',
        supports_download=False,
    )

    def List(self, request, global_params=None):
      r"""Lists all LabelKeys for a parent resource.

      Args:
        request: (LabelmanagerLabelKeysListRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (ListLabelKeysResponse) The response message.
      """
      config = self.GetMethodConfig('List')
      return self._RunMethod(
          config, request, global_params=global_params)

    List.method_config = lambda: base_api.ApiMethodInfo(
        http_method='GET',
        method_id='labelmanager.labelKeys.list',
        ordered_params=[],
        path_params=[],
        query_params=['pageSize', 'pageToken', 'parent', 'showDeleted'],
        relative_path='v1alpha1/labelKeys',
        request_field='',
        request_type_name='LabelmanagerLabelKeysListRequest',
        response_type_name='ListLabelKeysResponse',
        supports_download=False,
    )

    def Patch(self, request, global_params=None):
      r"""Updates the attributes of the LabelKey resource.

      Args:
        request: (LabelmanagerLabelKeysPatchRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Operation) The response message.
      """
      config = self.GetMethodConfig('Patch')
      return self._RunMethod(
          config, request, global_params=global_params)

    Patch.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/labelKeys/{labelKeysId}',
        http_method='PATCH',
        method_id='labelmanager.labelKeys.patch',
        ordered_params=['name'],
        path_params=['name'],
        query_params=['updateMask'],
        relative_path='v1alpha1/{+name}',
        request_field='labelKey',
        request_type_name='LabelmanagerLabelKeysPatchRequest',
        response_type_name='Operation',
        supports_download=False,
    )

    def SetIamPolicy(self, request, global_params=None):
      r"""Sets the access control policy on the specified resource. Replaces any.
existing policy.

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.

      Args:
        request: (LabelmanagerLabelKeysSetIamPolicyRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Policy) The response message.
      """
      config = self.GetMethodConfig('SetIamPolicy')
      return self._RunMethod(
          config, request, global_params=global_params)

    SetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/labelKeys/{labelKeysId}:setIamPolicy',
        http_method='POST',
        method_id='labelmanager.labelKeys.setIamPolicy',
        ordered_params=['resource'],
        path_params=['resource'],
        query_params=[],
        relative_path='v1alpha1/{+resource}:setIamPolicy',
        request_field='setIamPolicyRequest',
        request_type_name='LabelmanagerLabelKeysSetIamPolicyRequest',
        response_type_name='Policy',
        supports_download=False,
    )

    def TestIamPermissions(self, request, global_params=None):
      r"""Returns permissions that a caller has on the specified resource.
If the resource does not exist, this will return an empty set of
permissions, not a `NOT_FOUND` error.

Note: This operation is designed to be used for building permission-aware
UIs and command-line tools, not for authorization checking. This operation
may "fail open" without warning.

      Args:
        request: (LabelmanagerLabelKeysTestIamPermissionsRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (TestIamPermissionsResponse) The response message.
      """
      config = self.GetMethodConfig('TestIamPermissions')
      return self._RunMethod(
          config, request, global_params=global_params)

    TestIamPermissions.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/labelKeys/{labelKeysId}:testIamPermissions',
        http_method='POST',
        method_id='labelmanager.labelKeys.testIamPermissions',
        ordered_params=['resource'],
        path_params=['resource'],
        query_params=[],
        relative_path='v1alpha1/{+resource}:testIamPermissions',
        request_field='testIamPermissionsRequest',
        request_type_name='LabelmanagerLabelKeysTestIamPermissionsRequest',
        response_type_name='TestIamPermissionsResponse',
        supports_download=False,
    )

    def Undelete(self, request, global_params=None):
      r"""Cancels the deletion request for a LabelKey. This method may only be.
called on a LabelKey in the
DELETE_REQUESTED state.
In order to succeed, the LabelKey's parent must be in the active state.

      Args:
        request: (LabelmanagerLabelKeysUndeleteRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Operation) The response message.
      """
      config = self.GetMethodConfig('Undelete')
      return self._RunMethod(
          config, request, global_params=global_params)

    Undelete.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/labelKeys/{labelKeysId}:undelete',
        http_method='POST',
        method_id='labelmanager.labelKeys.undelete',
        ordered_params=['name'],
        path_params=['name'],
        query_params=[],
        relative_path='v1alpha1/{+name}:undelete',
        request_field='undeleteLabelKeyRequest',
        request_type_name='LabelmanagerLabelKeysUndeleteRequest',
        response_type_name='Operation',
        supports_download=False,
    )

  class LabelValuesService(base_api.BaseApiService):
    """Service class for the labelValues resource."""

    _NAME = 'labelValues'

    def __init__(self, client):
      super(LabelmanagerV1alpha1.LabelValuesService, self).__init__(client)
      self._upload_configs = {
          }

    def Create(self, request, global_params=None):
      r"""Creates a LabelValue as a child of the specified LabelKey. If a another.
request with the same parameters is sent while the original request is in
process the second request will receive an error. A maximum of 300
LabelValues (with any lifecycle state) can exist under a LabelKey at any
given time.

      Args:
        request: (LabelValue) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Operation) The response message.
      """
      config = self.GetMethodConfig('Create')
      return self._RunMethod(
          config, request, global_params=global_params)

    Create.method_config = lambda: base_api.ApiMethodInfo(
        http_method='POST',
        method_id='labelmanager.labelValues.create',
        ordered_params=[],
        path_params=[],
        query_params=[],
        relative_path='v1alpha1/labelValues',
        request_field='<request>',
        request_type_name='LabelValue',
        response_type_name='Operation',
        supports_download=False,
    )

    def Delete(self, request, global_params=None):
      r"""Requests deletion of a LabelValue. The LabelValue is moved into the.
DELETE_REQUESTED state
immediately, and is deleted approximately 30 days later. The LabelValue
cannot have any bindings when it is deleted.

      Args:
        request: (LabelmanagerLabelValuesDeleteRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Operation) The response message.
      """
      config = self.GetMethodConfig('Delete')
      return self._RunMethod(
          config, request, global_params=global_params)

    Delete.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/labelValues/{labelValuesId}',
        http_method='DELETE',
        method_id='labelmanager.labelValues.delete',
        ordered_params=['name'],
        path_params=['name'],
        query_params=[],
        relative_path='v1alpha1/{+name}',
        request_field='',
        request_type_name='LabelmanagerLabelValuesDeleteRequest',
        response_type_name='Operation',
        supports_download=False,
    )

    def Get(self, request, global_params=None):
      r"""Retrieves LabelValue. This method will return PERMISSION_DENIED if the.
LabelValue does not exist or the user does not have permission to view it.

      Args:
        request: (LabelmanagerLabelValuesGetRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (LabelValue) The response message.
      """
      config = self.GetMethodConfig('Get')
      return self._RunMethod(
          config, request, global_params=global_params)

    Get.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/labelValues/{labelValuesId}',
        http_method='GET',
        method_id='labelmanager.labelValues.get',
        ordered_params=['name'],
        path_params=['name'],
        query_params=[],
        relative_path='v1alpha1/{+name}',
        request_field='',
        request_type_name='LabelmanagerLabelValuesGetRequest',
        response_type_name='LabelValue',
        supports_download=False,
    )

    def List(self, request, global_params=None):
      r"""Lists all LabelValues for a specific LabelKey.

      Args:
        request: (LabelmanagerLabelValuesListRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (ListLabelValuesResponse) The response message.
      """
      config = self.GetMethodConfig('List')
      return self._RunMethod(
          config, request, global_params=global_params)

    List.method_config = lambda: base_api.ApiMethodInfo(
        http_method='GET',
        method_id='labelmanager.labelValues.list',
        ordered_params=[],
        path_params=[],
        query_params=['pageSize', 'pageToken', 'parent', 'showDeleted'],
        relative_path='v1alpha1/labelValues',
        request_field='',
        request_type_name='LabelmanagerLabelValuesListRequest',
        response_type_name='ListLabelValuesResponse',
        supports_download=False,
    )

    def Patch(self, request, global_params=None):
      r"""Updates the attributes of the LabelValue resource.

      Args:
        request: (LabelmanagerLabelValuesPatchRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Operation) The response message.
      """
      config = self.GetMethodConfig('Patch')
      return self._RunMethod(
          config, request, global_params=global_params)

    Patch.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/labelValues/{labelValuesId}',
        http_method='PATCH',
        method_id='labelmanager.labelValues.patch',
        ordered_params=['name'],
        path_params=['name'],
        query_params=['updateMask'],
        relative_path='v1alpha1/{+name}',
        request_field='labelValue',
        request_type_name='LabelmanagerLabelValuesPatchRequest',
        response_type_name='Operation',
        supports_download=False,
    )

    def Undelete(self, request, global_params=None):
      r"""Cancels the deletion request for a LabelValue. This method may only be.
called on a LabelValue in the
DELETE_REQUESTED state.
In order to succeed, the LabelValue's parent must be in the
ACTIVE state.

      Args:
        request: (LabelmanagerLabelValuesUndeleteRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Operation) The response message.
      """
      config = self.GetMethodConfig('Undelete')
      return self._RunMethod(
          config, request, global_params=global_params)

    Undelete.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/labelValues/{labelValuesId}:undelete',
        http_method='POST',
        method_id='labelmanager.labelValues.undelete',
        ordered_params=['name'],
        path_params=['name'],
        query_params=[],
        relative_path='v1alpha1/{+name}:undelete',
        request_field='undeleteLabelValueRequest',
        request_type_name='LabelmanagerLabelValuesUndeleteRequest',
        response_type_name='Operation',
        supports_download=False,
    )

  class OperationsService(base_api.BaseApiService):
    """Service class for the operations resource."""

    _NAME = 'operations'

    def __init__(self, client):
      super(LabelmanagerV1alpha1.OperationsService, self).__init__(client)
      self._upload_configs = {
          }

    def Get(self, request, global_params=None):
      r"""Gets the latest state of a long-running operation.  Clients can use this.
method to poll the operation result at intervals as recommended by the API
service.

      Args:
        request: (LabelmanagerOperationsGetRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (Operation) The response message.
      """
      config = self.GetMethodConfig('Get')
      return self._RunMethod(
          config, request, global_params=global_params)

    Get.method_config = lambda: base_api.ApiMethodInfo(
        flat_path='v1alpha1/operations/{operationsId}',
        http_method='GET',
        method_id='labelmanager.operations.get',
        ordered_params=['name'],
        path_params=['name'],
        query_params=[],
        relative_path='v1alpha1/{+name}',
        request_field='',
        request_type_name='LabelmanagerOperationsGetRequest',
        response_type_name='Operation',
        supports_download=False,
    )
