1"""Generated client library for policytroubleshooter version v1beta."""
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.v1beta import policytroubleshooter_v1beta_messages as messages
8
9
10class PolicytroubleshooterV1beta(base_api.BaseApiClient):
11  """Generated client library for service policytroubleshooter version v1beta."""
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 = 'v1beta'
20  _CLIENT_ID = '1042881264118.apps.googleusercontent.com'
21  _CLIENT_SECRET = 'x_Tw5K8nnjoRAqULM9PFAC2b'
22  _USER_AGENT = 'google-cloud-sdk'
23  _CLIENT_CLASS_NAME = 'PolicytroubleshooterV1beta'
24  _URL_VERSION = 'v1beta'
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(PolicytroubleshooterV1beta, 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(PolicytroubleshooterV1beta.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, and explains why the member does or does not have that permission.
56
57      Args:
58        request: (GoogleCloudPolicytroubleshooterV1betaTroubleshootIamPolicyRequest) input message
59        global_params: (StandardQueryParameters, default: None) global arguments
60      Returns:
61        (GoogleCloudPolicytroubleshooterV1betaTroubleshootIamPolicyResponse) The response message.
62      """
63      config = self.GetMethodConfig('Troubleshoot')
64      return self._RunMethod(
65          config, request, global_params=global_params)
66
67    Troubleshoot.method_config = lambda: base_api.ApiMethodInfo(
68        http_method='POST',
69        method_id='policytroubleshooter.iam.troubleshoot',
70        ordered_params=[],
71        path_params=[],
72        query_params=[],
73        relative_path='v1beta/iam:troubleshoot',
74        request_field='<request>',
75        request_type_name='GoogleCloudPolicytroubleshooterV1betaTroubleshootIamPolicyRequest',
76        response_type_name='GoogleCloudPolicytroubleshooterV1betaTroubleshootIamPolicyResponse',
77        supports_download=False,
78    )
79