"""Generated client library for recommender 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.recommender.v1alpha1 import recommender_v1alpha1_messages as messages


class RecommenderV1alpha1(base_api.BaseApiClient):
  """Generated client library for service recommender version v1alpha1."""

  MESSAGES_MODULE = messages
  BASE_URL = u'https://recommender.googleapis.com/'
  MTLS_BASE_URL = u''

  _PACKAGE = u'recommender'
  _SCOPES = [u'https://www.googleapis.com/auth/cloud-platform']
  _VERSION = u'v1alpha1'
  _CLIENT_ID = '1042881264118.apps.googleusercontent.com'
  _CLIENT_SECRET = 'x_Tw5K8nnjoRAqULM9PFAC2b'
  _USER_AGENT = 'x_Tw5K8nnjoRAqULM9PFAC2b'
  _CLIENT_CLASS_NAME = u'RecommenderV1alpha1'
  _URL_VERSION = u'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 recommender handle."""
    url = url or self.BASE_URL
    super(RecommenderV1alpha1, 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.projects_locations_recommenders_recommendations = self.ProjectsLocationsRecommendersRecommendationsService(self)
    self.projects_locations_recommenders = self.ProjectsLocationsRecommendersService(self)
    self.projects_locations = self.ProjectsLocationsService(self)
    self.projects_rules = self.ProjectsRulesService(self)
    self.projects = self.ProjectsService(self)

  class ProjectsLocationsRecommendersRecommendationsService(base_api.BaseApiService):
    """Service class for the projects_locations_recommenders_recommendations resource."""

    _NAME = u'projects_locations_recommenders_recommendations'

    def __init__(self, client):
      super(RecommenderV1alpha1.ProjectsLocationsRecommendersRecommendationsService, self).__init__(client)
      self._upload_configs = {
          }

    def CreateRule(self, request, global_params=None):
      r"""Create a Rule from the recommendation.
Check recommender.*.list and recommender.rule.create IAM permissions.

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

    CreateRule.method_config = lambda: base_api.ApiMethodInfo(
        flat_path=u'v1alpha1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:createRule',
        http_method=u'POST',
        method_id=u'recommender.projects.locations.recommenders.recommendations.createRule',
        ordered_params=[u'name'],
        path_params=[u'name'],
        query_params=[],
        relative_path=u'v1alpha1/{+name}:createRule',
        request_field=u'googleCloudRecommenderV1alpha1CreateRecommendationRuleRequest',
        request_type_name=u'RecommenderProjectsLocationsRecommendersRecommendationsCreateRuleRequest',
        response_type_name=u'GoogleCloudRecommenderV1alpha1Rule',
        supports_download=False,
    )

    def Get(self, request, global_params=None):
      r"""Gets the requested recommendation and requires the recommendation.*.get.
IAM permission.

      Args:
        request: (RecommenderProjectsLocationsRecommendersRecommendationsGetRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (GoogleCloudRecommenderV1alpha1Recommendation) 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=u'v1alpha1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}',
        http_method=u'GET',
        method_id=u'recommender.projects.locations.recommenders.recommendations.get',
        ordered_params=[u'name'],
        path_params=[u'name'],
        query_params=[],
        relative_path=u'v1alpha1/{+name}',
        request_field='',
        request_type_name=u'RecommenderProjectsLocationsRecommendersRecommendationsGetRequest',
        response_type_name=u'GoogleCloudRecommenderV1alpha1Recommendation',
        supports_download=False,
    )

    def List(self, request, global_params=None):
      r"""Lists recommendations for a Cloud project and requires the.
recommendation.*.list IAM permission.

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

    List.method_config = lambda: base_api.ApiMethodInfo(
        flat_path=u'v1alpha1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations',
        http_method=u'GET',
        method_id=u'recommender.projects.locations.recommenders.recommendations.list',
        ordered_params=[u'parent'],
        path_params=[u'parent'],
        query_params=[u'filter', u'pageSize', u'pageToken'],
        relative_path=u'v1alpha1/{+parent}/recommendations',
        request_field='',
        request_type_name=u'RecommenderProjectsLocationsRecommendersRecommendationsListRequest',
        response_type_name=u'GoogleCloudRecommenderV1alpha1ListRecommendationsResponse',
        supports_download=False,
    )

    def MarkActive(self, request, global_params=None):
      r"""Mark the Recommendation State as Active. Users can use this method to.
indicate to the Recommender API that a DISMISSED recommendation has to
be marked back as ACTIVE.

MarkActive can be applied to recommendations in DISMISSED state.

recommendation.*.update IAM permission is required to make this change.

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

    MarkActive.method_config = lambda: base_api.ApiMethodInfo(
        flat_path=u'v1alpha1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markActive',
        http_method=u'POST',
        method_id=u'recommender.projects.locations.recommenders.recommendations.markActive',
        ordered_params=[u'name'],
        path_params=[u'name'],
        query_params=[],
        relative_path=u'v1alpha1/{+name}:markActive',
        request_field=u'googleCloudRecommenderV1alpha1MarkActiveRequest',
        request_type_name=u'RecommenderProjectsLocationsRecommendersRecommendationsMarkActiveRequest',
        response_type_name=u'GoogleCloudRecommenderV1alpha1Recommendation',
        supports_download=False,
    )

    def MarkClaimed(self, request, global_params=None):
      r"""Mark the Recommendation State as Claimed. Users can use this method to.
indicate to the Recommender API that they are starting to apply the
recommendation themselves. This stops the recommendation content from being
updated.

MarkClaimed can be applied to recommendations in CLAIMED, or ACTIVE state.

recommendation.*.update IAM permission is required to make this change.

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

    MarkClaimed.method_config = lambda: base_api.ApiMethodInfo(
        flat_path=u'v1alpha1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markClaimed',
        http_method=u'POST',
        method_id=u'recommender.projects.locations.recommenders.recommendations.markClaimed',
        ordered_params=[u'name'],
        path_params=[u'name'],
        query_params=[],
        relative_path=u'v1alpha1/{+name}:markClaimed',
        request_field=u'googleCloudRecommenderV1alpha1MarkClaimedRequest',
        request_type_name=u'RecommenderProjectsLocationsRecommendersRecommendationsMarkClaimedRequest',
        response_type_name=u'GoogleCloudRecommenderV1alpha1Recommendation',
        supports_download=False,
    )

    def MarkFailed(self, request, global_params=None):
      r"""Mark the Recommendation State as Failed. Users can use this method to.
indicate to the Recommender API that they have applied the recommendation
themselves, and the operation failed. This stops the recommendation content
from being updated.

MarkFailed can be applied to recommendations in ACTIVE, CLAIMED, SUCCEEDED,
or FAILED state.

recommendation.*.update IAM permission is required to make this change.

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

    MarkFailed.method_config = lambda: base_api.ApiMethodInfo(
        flat_path=u'v1alpha1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markFailed',
        http_method=u'POST',
        method_id=u'recommender.projects.locations.recommenders.recommendations.markFailed',
        ordered_params=[u'name'],
        path_params=[u'name'],
        query_params=[],
        relative_path=u'v1alpha1/{+name}:markFailed',
        request_field=u'googleCloudRecommenderV1alpha1MarkFailedRequest',
        request_type_name=u'RecommenderProjectsLocationsRecommendersRecommendationsMarkFailedRequest',
        response_type_name=u'GoogleCloudRecommenderV1alpha1Recommendation',
        supports_download=False,
    )

    def MarkSucceeded(self, request, global_params=None):
      r"""Mark the Recommendation State as Succeeded. Users can use this method to.
indicate to the Recommender API that they have applied the recommendation
themselves, and the operation was successful. This stops the recommendation
content from being updated.

MarkSucceeded can be applied to recommendations in ACTIVE, CLAIMED,
SUCCEEDED, or FAILED state.

recommendation.*.update IAM permission is required to make this change.

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

    MarkSucceeded.method_config = lambda: base_api.ApiMethodInfo(
        flat_path=u'v1alpha1/projects/{projectsId}/locations/{locationsId}/recommenders/{recommendersId}/recommendations/{recommendationsId}:markSucceeded',
        http_method=u'POST',
        method_id=u'recommender.projects.locations.recommenders.recommendations.markSucceeded',
        ordered_params=[u'name'],
        path_params=[u'name'],
        query_params=[],
        relative_path=u'v1alpha1/{+name}:markSucceeded',
        request_field=u'googleCloudRecommenderV1alpha1MarkSucceededRequest',
        request_type_name=u'RecommenderProjectsLocationsRecommendersRecommendationsMarkSucceededRequest',
        response_type_name=u'GoogleCloudRecommenderV1alpha1Recommendation',
        supports_download=False,
    )

  class ProjectsLocationsRecommendersService(base_api.BaseApiService):
    """Service class for the projects_locations_recommenders resource."""

    _NAME = u'projects_locations_recommenders'

    def __init__(self, client):
      super(RecommenderV1alpha1.ProjectsLocationsRecommendersService, self).__init__(client)
      self._upload_configs = {
          }

  class ProjectsLocationsService(base_api.BaseApiService):
    """Service class for the projects_locations resource."""

    _NAME = u'projects_locations'

    def __init__(self, client):
      super(RecommenderV1alpha1.ProjectsLocationsService, self).__init__(client)
      self._upload_configs = {
          }

  class ProjectsRulesService(base_api.BaseApiService):
    """Service class for the projects_rules resource."""

    _NAME = u'projects_rules'

    def __init__(self, client):
      super(RecommenderV1alpha1.ProjectsRulesService, self).__init__(client)
      self._upload_configs = {
          }

    def Apply(self, request, global_params=None):
      r"""Apply a rule. This will set the specified state on all matching.
recommendations. This is a long running operation.
Checks recommender.rule.list and recommender.*.update IAM permissions.

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

    Apply.method_config = lambda: base_api.ApiMethodInfo(
        flat_path=u'v1alpha1/projects/{projectsId}/rules/{rulesId}:apply',
        http_method=u'POST',
        method_id=u'recommender.projects.rules.apply',
        ordered_params=[u'name'],
        path_params=[u'name'],
        query_params=[],
        relative_path=u'v1alpha1/{+name}:apply',
        request_field='',
        request_type_name=u'RecommenderProjectsRulesApplyRequest',
        response_type_name=u'GoogleLongrunningOperation',
        supports_download=False,
    )

    def Delete(self, request, global_params=None):
      r"""Deleting a Rule. Deleting a rule does not affect recommendations.
Check recommender.rule.delete IAM permission.

      Args:
        request: (RecommenderProjectsRulesDeleteRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (GoogleProtobufEmpty) 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=u'v1alpha1/projects/{projectsId}/rules/{rulesId}',
        http_method=u'DELETE',
        method_id=u'recommender.projects.rules.delete',
        ordered_params=[u'name'],
        path_params=[u'name'],
        query_params=[],
        relative_path=u'v1alpha1/{+name}',
        request_field='',
        request_type_name=u'RecommenderProjectsRulesDeleteRequest',
        response_type_name=u'GoogleProtobufEmpty',
        supports_download=False,
    )

    def Get(self, request, global_params=None):
      r"""Get a Rule.
Check recommender.rule.list IAM permission.

      Args:
        request: (RecommenderProjectsRulesGetRequest) input message
        global_params: (StandardQueryParameters, default: None) global arguments
      Returns:
        (GoogleCloudRecommenderV1alpha1Rule) 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=u'v1alpha1/projects/{projectsId}/rules/{rulesId}',
        http_method=u'GET',
        method_id=u'recommender.projects.rules.get',
        ordered_params=[u'name'],
        path_params=[u'name'],
        query_params=[],
        relative_path=u'v1alpha1/{+name}',
        request_field='',
        request_type_name=u'RecommenderProjectsRulesGetRequest',
        response_type_name=u'GoogleCloudRecommenderV1alpha1Rule',
        supports_download=False,
    )

    def List(self, request, global_params=None):
      r"""List Rules.
Check recommender.rule.list IAM permission.

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

    List.method_config = lambda: base_api.ApiMethodInfo(
        flat_path=u'v1alpha1/projects/{projectsId}/rules',
        http_method=u'GET',
        method_id=u'recommender.projects.rules.list',
        ordered_params=[u'parent'],
        path_params=[u'parent'],
        query_params=[u'pageSize', u'pageToken'],
        relative_path=u'v1alpha1/{+parent}/rules',
        request_field='',
        request_type_name=u'RecommenderProjectsRulesListRequest',
        response_type_name=u'GoogleCloudRecommenderV1alpha1ListRulesResponse',
        supports_download=False,
    )

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

    _NAME = u'projects'

    def __init__(self, client):
      super(RecommenderV1alpha1.ProjectsService, self).__init__(client)
      self._upload_configs = {
          }
