1"""Generated client library for cloudasset version v1p1beta1."""
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.cloudasset.v1p1beta1 import cloudasset_v1p1beta1_messages as messages
8
9
10class CloudassetV1p1beta1(base_api.BaseApiClient):
11  """Generated client library for service cloudasset version v1p1beta1."""
12
13  MESSAGES_MODULE = messages
14  BASE_URL = 'https://cloudasset.googleapis.com/'
15  MTLS_BASE_URL = 'https://cloudasset.mtls.googleapis.com/'
16
17  _PACKAGE = 'cloudasset'
18  _SCOPES = ['https://www.googleapis.com/auth/cloud-platform']
19  _VERSION = 'v1p1beta1'
20  _CLIENT_ID = '1042881264118.apps.googleusercontent.com'
21  _CLIENT_SECRET = 'x_Tw5K8nnjoRAqULM9PFAC2b'
22  _USER_AGENT = 'google-cloud-sdk'
23  _CLIENT_CLASS_NAME = 'CloudassetV1p1beta1'
24  _URL_VERSION = 'v1p1beta1'
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 cloudasset handle."""
33    url = url or self.BASE_URL
34    super(CloudassetV1p1beta1, 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.iamPolicies = self.IamPoliciesService(self)
43    self.resources = self.ResourcesService(self)
44
45  class IamPoliciesService(base_api.BaseApiService):
46    """Service class for the iamPolicies resource."""
47
48    _NAME = 'iamPolicies'
49
50    def __init__(self, client):
51      super(CloudassetV1p1beta1.IamPoliciesService, self).__init__(client)
52      self._upload_configs = {
53          }
54
55    def SearchAll(self, request, global_params=None):
56      r"""Searches all the IAM policies within a given accessible CRM scope (project/folder/organization). This RPC gives callers especially administrators the ability to search all the IAM policies within a scope, even if they don't have `.getIamPolicy` permission of all the IAM policies. Callers should have `cloud.assets.SearchAllIamPolicies` permission on the requested scope, otherwise the request will be rejected.
57
58      Args:
59        request: (CloudassetIamPoliciesSearchAllRequest) input message
60        global_params: (StandardQueryParameters, default: None) global arguments
61      Returns:
62        (SearchAllIamPoliciesResponse) The response message.
63      """
64      config = self.GetMethodConfig('SearchAll')
65      return self._RunMethod(
66          config, request, global_params=global_params)
67
68    SearchAll.method_config = lambda: base_api.ApiMethodInfo(
69        flat_path='v1p1beta1/{v1p1beta1Id}/{v1p1beta1Id1}/iamPolicies:searchAll',
70        http_method='GET',
71        method_id='cloudasset.iamPolicies.searchAll',
72        ordered_params=['scope'],
73        path_params=['scope'],
74        query_params=['pageSize', 'pageToken', 'query'],
75        relative_path='v1p1beta1/{+scope}/iamPolicies:searchAll',
76        request_field='',
77        request_type_name='CloudassetIamPoliciesSearchAllRequest',
78        response_type_name='SearchAllIamPoliciesResponse',
79        supports_download=False,
80    )
81
82  class ResourcesService(base_api.BaseApiService):
83    """Service class for the resources resource."""
84
85    _NAME = 'resources'
86
87    def __init__(self, client):
88      super(CloudassetV1p1beta1.ResourcesService, self).__init__(client)
89      self._upload_configs = {
90          }
91
92    def SearchAll(self, request, global_params=None):
93      r"""Searches all the resources within a given accessible CRM scope (project/folder/organization). This RPC gives callers especially administrators the ability to search all the resources within a scope, even if they don't have `.get` permission of all the resources. Callers should have `cloud.assets.SearchAllResources` permission on the requested scope, otherwise the request will be rejected.
94
95      Args:
96        request: (CloudassetResourcesSearchAllRequest) input message
97        global_params: (StandardQueryParameters, default: None) global arguments
98      Returns:
99        (SearchAllResourcesResponse) The response message.
100      """
101      config = self.GetMethodConfig('SearchAll')
102      return self._RunMethod(
103          config, request, global_params=global_params)
104
105    SearchAll.method_config = lambda: base_api.ApiMethodInfo(
106        flat_path='v1p1beta1/{v1p1beta1Id}/{v1p1beta1Id1}/resources:searchAll',
107        http_method='GET',
108        method_id='cloudasset.resources.searchAll',
109        ordered_params=['scope'],
110        path_params=['scope'],
111        query_params=['assetTypes', 'orderBy', 'pageSize', 'pageToken', 'query'],
112        relative_path='v1p1beta1/{+scope}/resources:searchAll',
113        request_field='',
114        request_type_name='CloudassetResourcesSearchAllRequest',
115        response_type_name='SearchAllResourcesResponse',
116        supports_download=False,
117    )
118