"""Generated client library for apheleia version v1beta1."""
# NOTE: This file is autogenerated and should not be edited by hand.

from googlecloudapis.apitools.base.py import base_api
from googlecloudapis.apheleia.v1beta1 import apheleia_v1beta1_messages as messages


class ApheleiaV1beta1(base_api.BaseApiClient):
  """Generated client library for service apheleia version v1beta1."""

  MESSAGES_MODULE = messages

  _PACKAGE = u'apheleia'
  _SCOPES = [u'https://www.googleapis.com/auth/cloud-platform']
  _VERSION = u'v1beta1'
  _CLIENT_ID = '1042881264118.apps.googleusercontent.com'
  _CLIENT_SECRET = 'x_Tw5K8nnjoRAqULM9PFAC2b'
  _USER_AGENT = ''
  _CLIENT_CLASS_NAME = u'ApheleiaV1beta1'
  _URL_VERSION = u'v1beta1'

  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):
    """Create a new apheleia handle."""
    url = url or u'https://apheleia.googleapis.com/'
    super(ApheleiaV1beta1, 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)
    self.projects_regions_functions = self.ProjectsRegionsFunctionsService(self)
    self.projects_regions = self.ProjectsRegionsService(self)
    self.projects = self.ProjectsService(self)

  class ProjectsRegionsFunctionsService(base_api.BaseApiService):
    """Service class for the projects_regions_functions resource."""

    _NAME = u'projects_regions_functions'

    def __init__(self, client):
      super(ApheleiaV1beta1.ProjectsRegionsFunctionsService, self).__init__(client)
      self._method_configs = {
          'Create': base_api.ApiMethodInfo(
              http_method=u'POST',
              method_id=u'apheleia.projects.regions.functions.create',
              ordered_params=[u'location'],
              path_params=[u'location'],
              query_params=[],
              relative_path=u'v1beta1/{+location}/functions',
              request_field=u'hostedFunction',
              request_type_name=u'ApheleiaProjectsRegionsFunctionsCreateRequest',
              response_type_name=u'Operation',
              supports_download=False,
          ),
          'Delete': base_api.ApiMethodInfo(
              http_method=u'DELETE',
              method_id=u'apheleia.projects.regions.functions.delete',
              ordered_params=[u'name'],
              path_params=[u'name'],
              query_params=[],
              relative_path=u'v1beta1/{+name}',
              request_field='',
              request_type_name=u'ApheleiaProjectsRegionsFunctionsDeleteRequest',
              response_type_name=u'Operation',
              supports_download=False,
          ),
          'Get': base_api.ApiMethodInfo(
              http_method=u'GET',
              method_id=u'apheleia.projects.regions.functions.get',
              ordered_params=[u'name'],
              path_params=[u'name'],
              query_params=[],
              relative_path=u'v1beta1/{+name}',
              request_field='',
              request_type_name=u'ApheleiaProjectsRegionsFunctionsGetRequest',
              response_type_name=u'HostedFunction',
              supports_download=False,
          ),
          'List': base_api.ApiMethodInfo(
              http_method=u'GET',
              method_id=u'apheleia.projects.regions.functions.list',
              ordered_params=[u'location'],
              path_params=[u'location'],
              query_params=[u'pageSize', u'pageToken'],
              relative_path=u'v1beta1/{+location}/functions',
              request_field='',
              request_type_name=u'ApheleiaProjectsRegionsFunctionsListRequest',
              response_type_name=u'ListFunctionsResponse',
              supports_download=False,
          ),
          'Update': base_api.ApiMethodInfo(
              http_method=u'PUT',
              method_id=u'apheleia.projects.regions.functions.update',
              ordered_params=[u'name'],
              path_params=[u'name'],
              query_params=[],
              relative_path=u'v1beta1/{+name}',
              request_field='<request>',
              request_type_name=u'HostedFunction',
              response_type_name=u'Operation',
              supports_download=False,
          ),
          }

      self._upload_configs = {
          }

    def Create(self, request, global_params=None):
      """Creates a new function. If a function with the given name already exists in.
the specified project, it will return ALREADY_EXISTS error.

Operation<response: HostedFunction>

      Args:
        request: (ApheleiaProjectsRegionsFunctionsCreateRequest) 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)

    def Delete(self, request, global_params=None):
      """Deletes a function with the given name from the specified project. If the.
given function is used by some trigger, the trigger will be updated to
remove this function.

Operation<response: Empty>

      Args:
        request: (ApheleiaProjectsRegionsFunctionsDeleteRequest) 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)

    def Get(self, request, global_params=None):
      """Returns a function with the given name from the requested project.

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

    def List(self, request, global_params=None):
      """Returns a list of all functions that belong to the requested project.

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

    def Update(self, request, global_params=None):
      """Updates existing function.

Operation<response: HostedFunction>

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

  class ProjectsRegionsService(base_api.BaseApiService):
    """Service class for the projects_regions resource."""

    _NAME = u'projects_regions'

    def __init__(self, client):
      super(ApheleiaV1beta1.ProjectsRegionsService, self).__init__(client)
      self._method_configs = {
          }

      self._upload_configs = {
          }

  class ProjectsService(base_api.BaseApiService):
    """Service class for the projects resource."""

    _NAME = u'projects'

    def __init__(self, client):
      super(ApheleiaV1beta1.ProjectsService, self).__init__(client)
      self._method_configs = {
          }

      self._upload_configs = {
          }
