1"""Generated client library for policytroubleshooter version v2alpha1."""
2# NOTE: This file is autogenerated and should not be edited by hand.
3
4from __future__ import absolute_import
5
6from apitools.base.py import base_api
7from googlecloudsdk.third_party.apis.policytroubleshooter.v2alpha1 import policytroubleshooter_v2alpha1_messages as messages
8
9
10class PolicytroubleshooterV2alpha1(base_api.BaseApiClient):
11  """Generated client library for service policytroubleshooter version v2alpha1."""
12
13  MESSAGES_MODULE = messages
14  BASE_URL = 'https://policytroubleshooter.googleapis.com/'
15  MTLS_BASE_URL = 'https://policytroubleshooter.mtls.googleapis.com/'
16
17  _PACKAGE = 'policytroubleshooter'
18  _SCOPES = ['https://www.googleapis.com/auth/cloud-platform']
19  _VERSION = 'v2alpha1'
20  _CLIENT_ID = '1042881264118.apps.googleusercontent.com'
21  _CLIENT_SECRET = 'x_Tw5K8nnjoRAqULM9PFAC2b'
22  _USER_AGENT = 'google-cloud-sdk'
23  _CLIENT_CLASS_NAME = 'PolicytroubleshooterV2alpha1'
24  _URL_VERSION = 'v2alpha1'
25  _API_KEY = None
26
27  def __init__(self, url='', credentials=None,
28               get_credentials=True, http=None, model=None,
29               log_request=False, log_response=False,
30               credentials_args=None, default_global_params=None,
31               additional_http_headers=None, response_encoding=None):
32    """Create a new policytroubleshooter handle."""
33    url = url or self.BASE_URL
34    super(PolicytroubleshooterV2alpha1, self).__init__(
35        url, credentials=credentials,
36        get_credentials=get_credentials, http=http, model=model,
37        log_request=log_request, log_response=log_response,
38        credentials_args=credentials_args,
39        default_global_params=default_global_params,
40        additional_http_headers=additional_http_headers,
41        response_encoding=response_encoding)
42    self.iam = self.IamService(self)
43
44  class IamService(base_api.BaseApiService):
45    """Service class for the iam resource."""
46
47    _NAME = 'iam'
48
49    def __init__(self, client):
50      super(PolicytroubleshooterV2alpha1.IamService, self).__init__(client)
51      self._upload_configs = {
52          }
53
54    def Troubleshoot(self, request, global_params=None):
55      r"""Checks whether a member has a specific permission for a specific resource,.
56and explains why the member does or does not have that permission.
57
58      Args:
59        request: (GoogleCloudPolicytroubleshooterV2alpha1TroubleshootIamPolicyRequest) input message
60        global_params: (StandardQueryParameters, default: None) global arguments
61      Returns:
62        (GoogleCloudPolicytroubleshooterV2alpha1TroubleshootIamPolicyResponse) The response message.
63      """
64      config = self.GetMethodConfig('Troubleshoot')
65      return self._RunMethod(
66          config, request, global_params=global_params)
67
68    Troubleshoot.method_config = lambda: base_api.ApiMethodInfo(
69        http_method='POST',
70        method_id='policytroubleshooter.iam.troubleshoot',
71        ordered_params=[],
72        path_params=[],
73        query_params=[],
74        relative_path='v2alpha1/iam:troubleshoot',
75        request_field='<request>',
76        request_type_name='GoogleCloudPolicytroubleshooterV2alpha1TroubleshootIamPolicyRequest',
77        response_type_name='GoogleCloudPolicytroubleshooterV2alpha1TroubleshootIamPolicyResponse',
78        supports_download=False,
79    )
80