1"""Generated client library for iam version v1."""
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.iam.v1 import iam_v1_messages as messages
8
9
10class IamV1(base_api.BaseApiClient):
11  """Generated client library for service iam version v1."""
12
13  MESSAGES_MODULE = messages
14  BASE_URL = 'https://iam.googleapis.com/'
15  MTLS_BASE_URL = 'https://iam.mtls.googleapis.com/'
16
17  _PACKAGE = 'iam'
18  _SCOPES = ['https://www.googleapis.com/auth/cloud-platform']
19  _VERSION = 'v1'
20  _CLIENT_ID = '1042881264118.apps.googleusercontent.com'
21  _CLIENT_SECRET = 'x_Tw5K8nnjoRAqULM9PFAC2b'
22  _USER_AGENT = 'google-cloud-sdk'
23  _CLIENT_CLASS_NAME = 'IamV1'
24  _URL_VERSION = 'v1'
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 iam handle."""
33    url = url or self.BASE_URL
34    super(IamV1, 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.organizations_roles = self.OrganizationsRolesService(self)
44    self.organizations = self.OrganizationsService(self)
45    self.permissions = self.PermissionsService(self)
46    self.projects_locations_workloadIdentityPools_operations = self.ProjectsLocationsWorkloadIdentityPoolsOperationsService(self)
47    self.projects_locations_workloadIdentityPools_providers_operations = self.ProjectsLocationsWorkloadIdentityPoolsProvidersOperationsService(self)
48    self.projects_locations_workloadIdentityPools_providers = self.ProjectsLocationsWorkloadIdentityPoolsProvidersService(self)
49    self.projects_locations_workloadIdentityPools = self.ProjectsLocationsWorkloadIdentityPoolsService(self)
50    self.projects_locations = self.ProjectsLocationsService(self)
51    self.projects_roles = self.ProjectsRolesService(self)
52    self.projects_serviceAccounts_identityBindings = self.ProjectsServiceAccountsIdentityBindingsService(self)
53    self.projects_serviceAccounts_keys = self.ProjectsServiceAccountsKeysService(self)
54    self.projects_serviceAccounts = self.ProjectsServiceAccountsService(self)
55    self.projects = self.ProjectsService(self)
56    self.roles = self.RolesService(self)
57
58  class IamPoliciesService(base_api.BaseApiService):
59    """Service class for the iamPolicies resource."""
60
61    _NAME = 'iamPolicies'
62
63    def __init__(self, client):
64      super(IamV1.IamPoliciesService, self).__init__(client)
65      self._upload_configs = {
66          }
67
68    def LintPolicy(self, request, global_params=None):
69      r"""Lints, or validates, an IAM policy. Currently checks the google.iam.v1.Binding.condition field, which contains a condition expression for a role binding. Successful calls to this method always return an HTTP `200 OK` status code, even if the linter detects an issue in the IAM policy.
70
71      Args:
72        request: (LintPolicyRequest) input message
73        global_params: (StandardQueryParameters, default: None) global arguments
74      Returns:
75        (LintPolicyResponse) The response message.
76      """
77      config = self.GetMethodConfig('LintPolicy')
78      return self._RunMethod(
79          config, request, global_params=global_params)
80
81    LintPolicy.method_config = lambda: base_api.ApiMethodInfo(
82        http_method='POST',
83        method_id='iam.iamPolicies.lintPolicy',
84        ordered_params=[],
85        path_params=[],
86        query_params=[],
87        relative_path='v1/iamPolicies:lintPolicy',
88        request_field='<request>',
89        request_type_name='LintPolicyRequest',
90        response_type_name='LintPolicyResponse',
91        supports_download=False,
92    )
93
94    def QueryAuditableServices(self, request, global_params=None):
95      r"""Returns a list of services that allow you to opt into audit logs that are not generated by default. To learn more about audit logs, see the [Logging documentation](https://cloud.google.com/logging/docs/audit).
96
97      Args:
98        request: (QueryAuditableServicesRequest) input message
99        global_params: (StandardQueryParameters, default: None) global arguments
100      Returns:
101        (QueryAuditableServicesResponse) The response message.
102      """
103      config = self.GetMethodConfig('QueryAuditableServices')
104      return self._RunMethod(
105          config, request, global_params=global_params)
106
107    QueryAuditableServices.method_config = lambda: base_api.ApiMethodInfo(
108        http_method='POST',
109        method_id='iam.iamPolicies.queryAuditableServices',
110        ordered_params=[],
111        path_params=[],
112        query_params=[],
113        relative_path='v1/iamPolicies:queryAuditableServices',
114        request_field='<request>',
115        request_type_name='QueryAuditableServicesRequest',
116        response_type_name='QueryAuditableServicesResponse',
117        supports_download=False,
118    )
119
120  class OrganizationsRolesService(base_api.BaseApiService):
121    """Service class for the organizations_roles resource."""
122
123    _NAME = 'organizations_roles'
124
125    def __init__(self, client):
126      super(IamV1.OrganizationsRolesService, self).__init__(client)
127      self._upload_configs = {
128          }
129
130    def Create(self, request, global_params=None):
131      r"""Creates a new custom Role.
132
133      Args:
134        request: (IamOrganizationsRolesCreateRequest) input message
135        global_params: (StandardQueryParameters, default: None) global arguments
136      Returns:
137        (Role) The response message.
138      """
139      config = self.GetMethodConfig('Create')
140      return self._RunMethod(
141          config, request, global_params=global_params)
142
143    Create.method_config = lambda: base_api.ApiMethodInfo(
144        flat_path='v1/organizations/{organizationsId}/roles',
145        http_method='POST',
146        method_id='iam.organizations.roles.create',
147        ordered_params=['parent'],
148        path_params=['parent'],
149        query_params=[],
150        relative_path='v1/{+parent}/roles',
151        request_field='createRoleRequest',
152        request_type_name='IamOrganizationsRolesCreateRequest',
153        response_type_name='Role',
154        supports_download=False,
155    )
156
157    def Delete(self, request, global_params=None):
158      r"""Deletes a custom Role. When you delete a custom role, the following changes occur immediately: * You cannot bind a member to the custom role in an IAM Policy. * Existing bindings to the custom role are not changed, but they have no effect. * By default, the response from ListRoles does not include the custom role. You have 7 days to undelete the custom role. After 7 days, the following changes occur: * The custom role is permanently deleted and cannot be recovered. * If an IAM policy contains a binding to the custom role, the binding is permanently removed.
159
160      Args:
161        request: (IamOrganizationsRolesDeleteRequest) input message
162        global_params: (StandardQueryParameters, default: None) global arguments
163      Returns:
164        (Role) The response message.
165      """
166      config = self.GetMethodConfig('Delete')
167      return self._RunMethod(
168          config, request, global_params=global_params)
169
170    Delete.method_config = lambda: base_api.ApiMethodInfo(
171        flat_path='v1/organizations/{organizationsId}/roles/{rolesId}',
172        http_method='DELETE',
173        method_id='iam.organizations.roles.delete',
174        ordered_params=['name'],
175        path_params=['name'],
176        query_params=['etag'],
177        relative_path='v1/{+name}',
178        request_field='',
179        request_type_name='IamOrganizationsRolesDeleteRequest',
180        response_type_name='Role',
181        supports_download=False,
182    )
183
184    def Get(self, request, global_params=None):
185      r"""Gets the definition of a Role.
186
187      Args:
188        request: (IamOrganizationsRolesGetRequest) input message
189        global_params: (StandardQueryParameters, default: None) global arguments
190      Returns:
191        (Role) The response message.
192      """
193      config = self.GetMethodConfig('Get')
194      return self._RunMethod(
195          config, request, global_params=global_params)
196
197    Get.method_config = lambda: base_api.ApiMethodInfo(
198        flat_path='v1/organizations/{organizationsId}/roles/{rolesId}',
199        http_method='GET',
200        method_id='iam.organizations.roles.get',
201        ordered_params=['name'],
202        path_params=['name'],
203        query_params=[],
204        relative_path='v1/{+name}',
205        request_field='',
206        request_type_name='IamOrganizationsRolesGetRequest',
207        response_type_name='Role',
208        supports_download=False,
209    )
210
211    def List(self, request, global_params=None):
212      r"""Lists every predefined Role that IAM supports, or every custom role that is defined for an organization or project.
213
214      Args:
215        request: (IamOrganizationsRolesListRequest) input message
216        global_params: (StandardQueryParameters, default: None) global arguments
217      Returns:
218        (ListRolesResponse) The response message.
219      """
220      config = self.GetMethodConfig('List')
221      return self._RunMethod(
222          config, request, global_params=global_params)
223
224    List.method_config = lambda: base_api.ApiMethodInfo(
225        flat_path='v1/organizations/{organizationsId}/roles',
226        http_method='GET',
227        method_id='iam.organizations.roles.list',
228        ordered_params=['parent'],
229        path_params=['parent'],
230        query_params=['pageSize', 'pageToken', 'showDeleted', 'view'],
231        relative_path='v1/{+parent}/roles',
232        request_field='',
233        request_type_name='IamOrganizationsRolesListRequest',
234        response_type_name='ListRolesResponse',
235        supports_download=False,
236    )
237
238    def Patch(self, request, global_params=None):
239      r"""Updates the definition of a custom Role.
240
241      Args:
242        request: (IamOrganizationsRolesPatchRequest) input message
243        global_params: (StandardQueryParameters, default: None) global arguments
244      Returns:
245        (Role) The response message.
246      """
247      config = self.GetMethodConfig('Patch')
248      return self._RunMethod(
249          config, request, global_params=global_params)
250
251    Patch.method_config = lambda: base_api.ApiMethodInfo(
252        flat_path='v1/organizations/{organizationsId}/roles/{rolesId}',
253        http_method='PATCH',
254        method_id='iam.organizations.roles.patch',
255        ordered_params=['name'],
256        path_params=['name'],
257        query_params=['updateMask'],
258        relative_path='v1/{+name}',
259        request_field='role',
260        request_type_name='IamOrganizationsRolesPatchRequest',
261        response_type_name='Role',
262        supports_download=False,
263    )
264
265    def Undelete(self, request, global_params=None):
266      r"""Undeletes a custom Role.
267
268      Args:
269        request: (IamOrganizationsRolesUndeleteRequest) input message
270        global_params: (StandardQueryParameters, default: None) global arguments
271      Returns:
272        (Role) The response message.
273      """
274      config = self.GetMethodConfig('Undelete')
275      return self._RunMethod(
276          config, request, global_params=global_params)
277
278    Undelete.method_config = lambda: base_api.ApiMethodInfo(
279        flat_path='v1/organizations/{organizationsId}/roles/{rolesId}:undelete',
280        http_method='POST',
281        method_id='iam.organizations.roles.undelete',
282        ordered_params=['name'],
283        path_params=['name'],
284        query_params=[],
285        relative_path='v1/{+name}:undelete',
286        request_field='undeleteRoleRequest',
287        request_type_name='IamOrganizationsRolesUndeleteRequest',
288        response_type_name='Role',
289        supports_download=False,
290    )
291
292  class OrganizationsService(base_api.BaseApiService):
293    """Service class for the organizations resource."""
294
295    _NAME = 'organizations'
296
297    def __init__(self, client):
298      super(IamV1.OrganizationsService, self).__init__(client)
299      self._upload_configs = {
300          }
301
302  class PermissionsService(base_api.BaseApiService):
303    """Service class for the permissions resource."""
304
305    _NAME = 'permissions'
306
307    def __init__(self, client):
308      super(IamV1.PermissionsService, self).__init__(client)
309      self._upload_configs = {
310          }
311
312    def QueryTestablePermissions(self, request, global_params=None):
313      r"""Lists every permission that you can test on a resource. A permission is testable if you can check whether a member has that permission on the resource.
314
315      Args:
316        request: (QueryTestablePermissionsRequest) input message
317        global_params: (StandardQueryParameters, default: None) global arguments
318      Returns:
319        (QueryTestablePermissionsResponse) The response message.
320      """
321      config = self.GetMethodConfig('QueryTestablePermissions')
322      return self._RunMethod(
323          config, request, global_params=global_params)
324
325    QueryTestablePermissions.method_config = lambda: base_api.ApiMethodInfo(
326        http_method='POST',
327        method_id='iam.permissions.queryTestablePermissions',
328        ordered_params=[],
329        path_params=[],
330        query_params=[],
331        relative_path='v1/permissions:queryTestablePermissions',
332        request_field='<request>',
333        request_type_name='QueryTestablePermissionsRequest',
334        response_type_name='QueryTestablePermissionsResponse',
335        supports_download=False,
336    )
337
338  class ProjectsLocationsWorkloadIdentityPoolsOperationsService(base_api.BaseApiService):
339    """Service class for the projects_locations_workloadIdentityPools_operations resource."""
340
341    _NAME = 'projects_locations_workloadIdentityPools_operations'
342
343    def __init__(self, client):
344      super(IamV1.ProjectsLocationsWorkloadIdentityPoolsOperationsService, self).__init__(client)
345      self._upload_configs = {
346          }
347
348    def Get(self, request, global_params=None):
349      r"""Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
350
351      Args:
352        request: (IamProjectsLocationsWorkloadIdentityPoolsOperationsGetRequest) input message
353        global_params: (StandardQueryParameters, default: None) global arguments
354      Returns:
355        (Operation) The response message.
356      """
357      config = self.GetMethodConfig('Get')
358      return self._RunMethod(
359          config, request, global_params=global_params)
360
361    Get.method_config = lambda: base_api.ApiMethodInfo(
362        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools/{workloadIdentityPoolsId}/operations/{operationsId}',
363        http_method='GET',
364        method_id='iam.projects.locations.workloadIdentityPools.operations.get',
365        ordered_params=['name'],
366        path_params=['name'],
367        query_params=[],
368        relative_path='v1/{+name}',
369        request_field='',
370        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsOperationsGetRequest',
371        response_type_name='Operation',
372        supports_download=False,
373    )
374
375  class ProjectsLocationsWorkloadIdentityPoolsProvidersOperationsService(base_api.BaseApiService):
376    """Service class for the projects_locations_workloadIdentityPools_providers_operations resource."""
377
378    _NAME = 'projects_locations_workloadIdentityPools_providers_operations'
379
380    def __init__(self, client):
381      super(IamV1.ProjectsLocationsWorkloadIdentityPoolsProvidersOperationsService, self).__init__(client)
382      self._upload_configs = {
383          }
384
385    def Get(self, request, global_params=None):
386      r"""Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
387
388      Args:
389        request: (IamProjectsLocationsWorkloadIdentityPoolsProvidersOperationsGetRequest) input message
390        global_params: (StandardQueryParameters, default: None) global arguments
391      Returns:
392        (Operation) The response message.
393      """
394      config = self.GetMethodConfig('Get')
395      return self._RunMethod(
396          config, request, global_params=global_params)
397
398    Get.method_config = lambda: base_api.ApiMethodInfo(
399        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools/{workloadIdentityPoolsId}/providers/{providersId}/operations/{operationsId}',
400        http_method='GET',
401        method_id='iam.projects.locations.workloadIdentityPools.providers.operations.get',
402        ordered_params=['name'],
403        path_params=['name'],
404        query_params=[],
405        relative_path='v1/{+name}',
406        request_field='',
407        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsProvidersOperationsGetRequest',
408        response_type_name='Operation',
409        supports_download=False,
410    )
411
412  class ProjectsLocationsWorkloadIdentityPoolsProvidersService(base_api.BaseApiService):
413    """Service class for the projects_locations_workloadIdentityPools_providers resource."""
414
415    _NAME = 'projects_locations_workloadIdentityPools_providers'
416
417    def __init__(self, client):
418      super(IamV1.ProjectsLocationsWorkloadIdentityPoolsProvidersService, self).__init__(client)
419      self._upload_configs = {
420          }
421
422    def Create(self, request, global_params=None):
423      r"""Creates a new WorkloadIdentityPoolProvider in a WorkloadIdentityPool. You cannot reuse the name of a deleted provider until 30 days after deletion.
424
425      Args:
426        request: (IamProjectsLocationsWorkloadIdentityPoolsProvidersCreateRequest) input message
427        global_params: (StandardQueryParameters, default: None) global arguments
428      Returns:
429        (Operation) The response message.
430      """
431      config = self.GetMethodConfig('Create')
432      return self._RunMethod(
433          config, request, global_params=global_params)
434
435    Create.method_config = lambda: base_api.ApiMethodInfo(
436        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools/{workloadIdentityPoolsId}/providers',
437        http_method='POST',
438        method_id='iam.projects.locations.workloadIdentityPools.providers.create',
439        ordered_params=['parent'],
440        path_params=['parent'],
441        query_params=['workloadIdentityPoolProviderId'],
442        relative_path='v1/{+parent}/providers',
443        request_field='workloadIdentityPoolProvider',
444        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsProvidersCreateRequest',
445        response_type_name='Operation',
446        supports_download=False,
447    )
448
449    def Delete(self, request, global_params=None):
450      r"""Deletes a WorkloadIdentityPoolProvider. Deleting a provider does not revoke credentials that have already been issued; they continue to grant access. You can undelete a provider for 30 days. After 30 days, deletion is permanent. You cannot update deleted providers. However, you can view and list them.
451
452      Args:
453        request: (IamProjectsLocationsWorkloadIdentityPoolsProvidersDeleteRequest) input message
454        global_params: (StandardQueryParameters, default: None) global arguments
455      Returns:
456        (Operation) The response message.
457      """
458      config = self.GetMethodConfig('Delete')
459      return self._RunMethod(
460          config, request, global_params=global_params)
461
462    Delete.method_config = lambda: base_api.ApiMethodInfo(
463        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools/{workloadIdentityPoolsId}/providers/{providersId}',
464        http_method='DELETE',
465        method_id='iam.projects.locations.workloadIdentityPools.providers.delete',
466        ordered_params=['name'],
467        path_params=['name'],
468        query_params=[],
469        relative_path='v1/{+name}',
470        request_field='',
471        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsProvidersDeleteRequest',
472        response_type_name='Operation',
473        supports_download=False,
474    )
475
476    def Get(self, request, global_params=None):
477      r"""Gets an individual WorkloadIdentityPoolProvider.
478
479      Args:
480        request: (IamProjectsLocationsWorkloadIdentityPoolsProvidersGetRequest) input message
481        global_params: (StandardQueryParameters, default: None) global arguments
482      Returns:
483        (WorkloadIdentityPoolProvider) The response message.
484      """
485      config = self.GetMethodConfig('Get')
486      return self._RunMethod(
487          config, request, global_params=global_params)
488
489    Get.method_config = lambda: base_api.ApiMethodInfo(
490        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools/{workloadIdentityPoolsId}/providers/{providersId}',
491        http_method='GET',
492        method_id='iam.projects.locations.workloadIdentityPools.providers.get',
493        ordered_params=['name'],
494        path_params=['name'],
495        query_params=[],
496        relative_path='v1/{+name}',
497        request_field='',
498        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsProvidersGetRequest',
499        response_type_name='WorkloadIdentityPoolProvider',
500        supports_download=False,
501    )
502
503    def List(self, request, global_params=None):
504      r"""Lists all non-deleted WorkloadIdentityPoolProviders in a WorkloadIdentityPool. If `show_deleted` is set to `true`, then deleted providers are also listed.
505
506      Args:
507        request: (IamProjectsLocationsWorkloadIdentityPoolsProvidersListRequest) input message
508        global_params: (StandardQueryParameters, default: None) global arguments
509      Returns:
510        (ListWorkloadIdentityPoolProvidersResponse) The response message.
511      """
512      config = self.GetMethodConfig('List')
513      return self._RunMethod(
514          config, request, global_params=global_params)
515
516    List.method_config = lambda: base_api.ApiMethodInfo(
517        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools/{workloadIdentityPoolsId}/providers',
518        http_method='GET',
519        method_id='iam.projects.locations.workloadIdentityPools.providers.list',
520        ordered_params=['parent'],
521        path_params=['parent'],
522        query_params=['pageSize', 'pageToken', 'showDeleted'],
523        relative_path='v1/{+parent}/providers',
524        request_field='',
525        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsProvidersListRequest',
526        response_type_name='ListWorkloadIdentityPoolProvidersResponse',
527        supports_download=False,
528    )
529
530    def Patch(self, request, global_params=None):
531      r"""Updates an existing WorkloadIdentityPoolProvider.
532
533      Args:
534        request: (IamProjectsLocationsWorkloadIdentityPoolsProvidersPatchRequest) input message
535        global_params: (StandardQueryParameters, default: None) global arguments
536      Returns:
537        (Operation) The response message.
538      """
539      config = self.GetMethodConfig('Patch')
540      return self._RunMethod(
541          config, request, global_params=global_params)
542
543    Patch.method_config = lambda: base_api.ApiMethodInfo(
544        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools/{workloadIdentityPoolsId}/providers/{providersId}',
545        http_method='PATCH',
546        method_id='iam.projects.locations.workloadIdentityPools.providers.patch',
547        ordered_params=['name'],
548        path_params=['name'],
549        query_params=['updateMask'],
550        relative_path='v1/{+name}',
551        request_field='workloadIdentityPoolProvider',
552        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsProvidersPatchRequest',
553        response_type_name='Operation',
554        supports_download=False,
555    )
556
557    def Undelete(self, request, global_params=None):
558      r"""Undeletes a WorkloadIdentityPoolProvider, as long as it was deleted fewer than 30 days ago.
559
560      Args:
561        request: (IamProjectsLocationsWorkloadIdentityPoolsProvidersUndeleteRequest) input message
562        global_params: (StandardQueryParameters, default: None) global arguments
563      Returns:
564        (Operation) The response message.
565      """
566      config = self.GetMethodConfig('Undelete')
567      return self._RunMethod(
568          config, request, global_params=global_params)
569
570    Undelete.method_config = lambda: base_api.ApiMethodInfo(
571        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools/{workloadIdentityPoolsId}/providers/{providersId}:undelete',
572        http_method='POST',
573        method_id='iam.projects.locations.workloadIdentityPools.providers.undelete',
574        ordered_params=['name'],
575        path_params=['name'],
576        query_params=[],
577        relative_path='v1/{+name}:undelete',
578        request_field='undeleteWorkloadIdentityPoolProviderRequest',
579        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsProvidersUndeleteRequest',
580        response_type_name='Operation',
581        supports_download=False,
582    )
583
584  class ProjectsLocationsWorkloadIdentityPoolsService(base_api.BaseApiService):
585    """Service class for the projects_locations_workloadIdentityPools resource."""
586
587    _NAME = 'projects_locations_workloadIdentityPools'
588
589    def __init__(self, client):
590      super(IamV1.ProjectsLocationsWorkloadIdentityPoolsService, self).__init__(client)
591      self._upload_configs = {
592          }
593
594    def Create(self, request, global_params=None):
595      r"""Creates a new WorkloadIdentityPool. You cannot reuse the name of a deleted pool until 30 days after deletion.
596
597      Args:
598        request: (IamProjectsLocationsWorkloadIdentityPoolsCreateRequest) input message
599        global_params: (StandardQueryParameters, default: None) global arguments
600      Returns:
601        (Operation) The response message.
602      """
603      config = self.GetMethodConfig('Create')
604      return self._RunMethod(
605          config, request, global_params=global_params)
606
607    Create.method_config = lambda: base_api.ApiMethodInfo(
608        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools',
609        http_method='POST',
610        method_id='iam.projects.locations.workloadIdentityPools.create',
611        ordered_params=['parent'],
612        path_params=['parent'],
613        query_params=['workloadIdentityPoolId'],
614        relative_path='v1/{+parent}/workloadIdentityPools',
615        request_field='workloadIdentityPool',
616        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsCreateRequest',
617        response_type_name='Operation',
618        supports_download=False,
619    )
620
621    def Delete(self, request, global_params=None):
622      r"""Deletes a WorkloadIdentityPool. You cannot use a deleted pool to exchange external credentials for Google Cloud credentials. However, deletion does not revoke credentials that have already been issued. Credentials issued for a deleted pool do not grant access to resources. If the pool is undeleted, and the credentials are not expired, they grant access again. You can undelete a pool for 30 days. After 30 days, deletion is permanent. You cannot update deleted pools. However, you can view and list them.
623
624      Args:
625        request: (IamProjectsLocationsWorkloadIdentityPoolsDeleteRequest) input message
626        global_params: (StandardQueryParameters, default: None) global arguments
627      Returns:
628        (Operation) The response message.
629      """
630      config = self.GetMethodConfig('Delete')
631      return self._RunMethod(
632          config, request, global_params=global_params)
633
634    Delete.method_config = lambda: base_api.ApiMethodInfo(
635        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools/{workloadIdentityPoolsId}',
636        http_method='DELETE',
637        method_id='iam.projects.locations.workloadIdentityPools.delete',
638        ordered_params=['name'],
639        path_params=['name'],
640        query_params=[],
641        relative_path='v1/{+name}',
642        request_field='',
643        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsDeleteRequest',
644        response_type_name='Operation',
645        supports_download=False,
646    )
647
648    def Get(self, request, global_params=None):
649      r"""Gets an individual WorkloadIdentityPool.
650
651      Args:
652        request: (IamProjectsLocationsWorkloadIdentityPoolsGetRequest) input message
653        global_params: (StandardQueryParameters, default: None) global arguments
654      Returns:
655        (WorkloadIdentityPool) The response message.
656      """
657      config = self.GetMethodConfig('Get')
658      return self._RunMethod(
659          config, request, global_params=global_params)
660
661    Get.method_config = lambda: base_api.ApiMethodInfo(
662        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools/{workloadIdentityPoolsId}',
663        http_method='GET',
664        method_id='iam.projects.locations.workloadIdentityPools.get',
665        ordered_params=['name'],
666        path_params=['name'],
667        query_params=[],
668        relative_path='v1/{+name}',
669        request_field='',
670        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsGetRequest',
671        response_type_name='WorkloadIdentityPool',
672        supports_download=False,
673    )
674
675    def List(self, request, global_params=None):
676      r"""Lists all non-deleted WorkloadIdentityPools in a project. If `show_deleted` is set to `true`, then deleted pools are also listed.
677
678      Args:
679        request: (IamProjectsLocationsWorkloadIdentityPoolsListRequest) input message
680        global_params: (StandardQueryParameters, default: None) global arguments
681      Returns:
682        (ListWorkloadIdentityPoolsResponse) The response message.
683      """
684      config = self.GetMethodConfig('List')
685      return self._RunMethod(
686          config, request, global_params=global_params)
687
688    List.method_config = lambda: base_api.ApiMethodInfo(
689        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools',
690        http_method='GET',
691        method_id='iam.projects.locations.workloadIdentityPools.list',
692        ordered_params=['parent'],
693        path_params=['parent'],
694        query_params=['pageSize', 'pageToken', 'showDeleted'],
695        relative_path='v1/{+parent}/workloadIdentityPools',
696        request_field='',
697        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsListRequest',
698        response_type_name='ListWorkloadIdentityPoolsResponse',
699        supports_download=False,
700    )
701
702    def Patch(self, request, global_params=None):
703      r"""Updates an existing WorkloadIdentityPool.
704
705      Args:
706        request: (IamProjectsLocationsWorkloadIdentityPoolsPatchRequest) input message
707        global_params: (StandardQueryParameters, default: None) global arguments
708      Returns:
709        (Operation) The response message.
710      """
711      config = self.GetMethodConfig('Patch')
712      return self._RunMethod(
713          config, request, global_params=global_params)
714
715    Patch.method_config = lambda: base_api.ApiMethodInfo(
716        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools/{workloadIdentityPoolsId}',
717        http_method='PATCH',
718        method_id='iam.projects.locations.workloadIdentityPools.patch',
719        ordered_params=['name'],
720        path_params=['name'],
721        query_params=['updateMask'],
722        relative_path='v1/{+name}',
723        request_field='workloadIdentityPool',
724        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsPatchRequest',
725        response_type_name='Operation',
726        supports_download=False,
727    )
728
729    def Undelete(self, request, global_params=None):
730      r"""Undeletes a WorkloadIdentityPool, as long as it was deleted fewer than 30 days ago.
731
732      Args:
733        request: (IamProjectsLocationsWorkloadIdentityPoolsUndeleteRequest) input message
734        global_params: (StandardQueryParameters, default: None) global arguments
735      Returns:
736        (Operation) The response message.
737      """
738      config = self.GetMethodConfig('Undelete')
739      return self._RunMethod(
740          config, request, global_params=global_params)
741
742    Undelete.method_config = lambda: base_api.ApiMethodInfo(
743        flat_path='v1/projects/{projectsId}/locations/{locationsId}/workloadIdentityPools/{workloadIdentityPoolsId}:undelete',
744        http_method='POST',
745        method_id='iam.projects.locations.workloadIdentityPools.undelete',
746        ordered_params=['name'],
747        path_params=['name'],
748        query_params=[],
749        relative_path='v1/{+name}:undelete',
750        request_field='undeleteWorkloadIdentityPoolRequest',
751        request_type_name='IamProjectsLocationsWorkloadIdentityPoolsUndeleteRequest',
752        response_type_name='Operation',
753        supports_download=False,
754    )
755
756  class ProjectsLocationsService(base_api.BaseApiService):
757    """Service class for the projects_locations resource."""
758
759    _NAME = 'projects_locations'
760
761    def __init__(self, client):
762      super(IamV1.ProjectsLocationsService, self).__init__(client)
763      self._upload_configs = {
764          }
765
766  class ProjectsRolesService(base_api.BaseApiService):
767    """Service class for the projects_roles resource."""
768
769    _NAME = 'projects_roles'
770
771    def __init__(self, client):
772      super(IamV1.ProjectsRolesService, self).__init__(client)
773      self._upload_configs = {
774          }
775
776    def Create(self, request, global_params=None):
777      r"""Creates a new custom Role.
778
779      Args:
780        request: (IamProjectsRolesCreateRequest) input message
781        global_params: (StandardQueryParameters, default: None) global arguments
782      Returns:
783        (Role) The response message.
784      """
785      config = self.GetMethodConfig('Create')
786      return self._RunMethod(
787          config, request, global_params=global_params)
788
789    Create.method_config = lambda: base_api.ApiMethodInfo(
790        flat_path='v1/projects/{projectsId}/roles',
791        http_method='POST',
792        method_id='iam.projects.roles.create',
793        ordered_params=['parent'],
794        path_params=['parent'],
795        query_params=[],
796        relative_path='v1/{+parent}/roles',
797        request_field='createRoleRequest',
798        request_type_name='IamProjectsRolesCreateRequest',
799        response_type_name='Role',
800        supports_download=False,
801    )
802
803    def Delete(self, request, global_params=None):
804      r"""Deletes a custom Role. When you delete a custom role, the following changes occur immediately: * You cannot bind a member to the custom role in an IAM Policy. * Existing bindings to the custom role are not changed, but they have no effect. * By default, the response from ListRoles does not include the custom role. You have 7 days to undelete the custom role. After 7 days, the following changes occur: * The custom role is permanently deleted and cannot be recovered. * If an IAM policy contains a binding to the custom role, the binding is permanently removed.
805
806      Args:
807        request: (IamProjectsRolesDeleteRequest) input message
808        global_params: (StandardQueryParameters, default: None) global arguments
809      Returns:
810        (Role) The response message.
811      """
812      config = self.GetMethodConfig('Delete')
813      return self._RunMethod(
814          config, request, global_params=global_params)
815
816    Delete.method_config = lambda: base_api.ApiMethodInfo(
817        flat_path='v1/projects/{projectsId}/roles/{rolesId}',
818        http_method='DELETE',
819        method_id='iam.projects.roles.delete',
820        ordered_params=['name'],
821        path_params=['name'],
822        query_params=['etag'],
823        relative_path='v1/{+name}',
824        request_field='',
825        request_type_name='IamProjectsRolesDeleteRequest',
826        response_type_name='Role',
827        supports_download=False,
828    )
829
830    def Get(self, request, global_params=None):
831      r"""Gets the definition of a Role.
832
833      Args:
834        request: (IamProjectsRolesGetRequest) input message
835        global_params: (StandardQueryParameters, default: None) global arguments
836      Returns:
837        (Role) The response message.
838      """
839      config = self.GetMethodConfig('Get')
840      return self._RunMethod(
841          config, request, global_params=global_params)
842
843    Get.method_config = lambda: base_api.ApiMethodInfo(
844        flat_path='v1/projects/{projectsId}/roles/{rolesId}',
845        http_method='GET',
846        method_id='iam.projects.roles.get',
847        ordered_params=['name'],
848        path_params=['name'],
849        query_params=[],
850        relative_path='v1/{+name}',
851        request_field='',
852        request_type_name='IamProjectsRolesGetRequest',
853        response_type_name='Role',
854        supports_download=False,
855    )
856
857    def List(self, request, global_params=None):
858      r"""Lists every predefined Role that IAM supports, or every custom role that is defined for an organization or project.
859
860      Args:
861        request: (IamProjectsRolesListRequest) input message
862        global_params: (StandardQueryParameters, default: None) global arguments
863      Returns:
864        (ListRolesResponse) The response message.
865      """
866      config = self.GetMethodConfig('List')
867      return self._RunMethod(
868          config, request, global_params=global_params)
869
870    List.method_config = lambda: base_api.ApiMethodInfo(
871        flat_path='v1/projects/{projectsId}/roles',
872        http_method='GET',
873        method_id='iam.projects.roles.list',
874        ordered_params=['parent'],
875        path_params=['parent'],
876        query_params=['pageSize', 'pageToken', 'showDeleted', 'view'],
877        relative_path='v1/{+parent}/roles',
878        request_field='',
879        request_type_name='IamProjectsRolesListRequest',
880        response_type_name='ListRolesResponse',
881        supports_download=False,
882    )
883
884    def Patch(self, request, global_params=None):
885      r"""Updates the definition of a custom Role.
886
887      Args:
888        request: (IamProjectsRolesPatchRequest) input message
889        global_params: (StandardQueryParameters, default: None) global arguments
890      Returns:
891        (Role) The response message.
892      """
893      config = self.GetMethodConfig('Patch')
894      return self._RunMethod(
895          config, request, global_params=global_params)
896
897    Patch.method_config = lambda: base_api.ApiMethodInfo(
898        flat_path='v1/projects/{projectsId}/roles/{rolesId}',
899        http_method='PATCH',
900        method_id='iam.projects.roles.patch',
901        ordered_params=['name'],
902        path_params=['name'],
903        query_params=['updateMask'],
904        relative_path='v1/{+name}',
905        request_field='role',
906        request_type_name='IamProjectsRolesPatchRequest',
907        response_type_name='Role',
908        supports_download=False,
909    )
910
911    def Undelete(self, request, global_params=None):
912      r"""Undeletes a custom Role.
913
914      Args:
915        request: (IamProjectsRolesUndeleteRequest) input message
916        global_params: (StandardQueryParameters, default: None) global arguments
917      Returns:
918        (Role) The response message.
919      """
920      config = self.GetMethodConfig('Undelete')
921      return self._RunMethod(
922          config, request, global_params=global_params)
923
924    Undelete.method_config = lambda: base_api.ApiMethodInfo(
925        flat_path='v1/projects/{projectsId}/roles/{rolesId}:undelete',
926        http_method='POST',
927        method_id='iam.projects.roles.undelete',
928        ordered_params=['name'],
929        path_params=['name'],
930        query_params=[],
931        relative_path='v1/{+name}:undelete',
932        request_field='undeleteRoleRequest',
933        request_type_name='IamProjectsRolesUndeleteRequest',
934        response_type_name='Role',
935        supports_download=False,
936    )
937
938  class ProjectsServiceAccountsIdentityBindingsService(base_api.BaseApiService):
939    """Service class for the projects_serviceAccounts_identityBindings resource."""
940
941    _NAME = 'projects_serviceAccounts_identityBindings'
942
943    def __init__(self, client):
944      super(IamV1.ProjectsServiceAccountsIdentityBindingsService, self).__init__(client)
945      self._upload_configs = {
946          }
947
948    def Create(self, request, global_params=None):
949      r"""Create method for the projects_serviceAccounts_identityBindings service.
950
951      Args:
952        request: (IamProjectsServiceAccountsIdentityBindingsCreateRequest) input message
953        global_params: (StandardQueryParameters, default: None) global arguments
954      Returns:
955        (ServiceAccountIdentityBinding) The response message.
956      """
957      config = self.GetMethodConfig('Create')
958      return self._RunMethod(
959          config, request, global_params=global_params)
960
961    Create.method_config = lambda: base_api.ApiMethodInfo(
962        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/identityBindings',
963        http_method='POST',
964        method_id='iam.projects.serviceAccounts.identityBindings.create',
965        ordered_params=['name'],
966        path_params=['name'],
967        query_params=[],
968        relative_path='v1/{+name}/identityBindings',
969        request_field='createServiceAccountIdentityBindingRequest',
970        request_type_name='IamProjectsServiceAccountsIdentityBindingsCreateRequest',
971        response_type_name='ServiceAccountIdentityBinding',
972        supports_download=False,
973    )
974
975    def Delete(self, request, global_params=None):
976      r"""Delete method for the projects_serviceAccounts_identityBindings service.
977
978      Args:
979        request: (IamProjectsServiceAccountsIdentityBindingsDeleteRequest) input message
980        global_params: (StandardQueryParameters, default: None) global arguments
981      Returns:
982        (Empty) The response message.
983      """
984      config = self.GetMethodConfig('Delete')
985      return self._RunMethod(
986          config, request, global_params=global_params)
987
988    Delete.method_config = lambda: base_api.ApiMethodInfo(
989        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/identityBindings/{identityBindingsId}',
990        http_method='DELETE',
991        method_id='iam.projects.serviceAccounts.identityBindings.delete',
992        ordered_params=['name'],
993        path_params=['name'],
994        query_params=[],
995        relative_path='v1/{+name}',
996        request_field='',
997        request_type_name='IamProjectsServiceAccountsIdentityBindingsDeleteRequest',
998        response_type_name='Empty',
999        supports_download=False,
1000    )
1001
1002    def Get(self, request, global_params=None):
1003      r"""Get method for the projects_serviceAccounts_identityBindings service.
1004
1005      Args:
1006        request: (IamProjectsServiceAccountsIdentityBindingsGetRequest) input message
1007        global_params: (StandardQueryParameters, default: None) global arguments
1008      Returns:
1009        (ServiceAccountIdentityBinding) The response message.
1010      """
1011      config = self.GetMethodConfig('Get')
1012      return self._RunMethod(
1013          config, request, global_params=global_params)
1014
1015    Get.method_config = lambda: base_api.ApiMethodInfo(
1016        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/identityBindings/{identityBindingsId}',
1017        http_method='GET',
1018        method_id='iam.projects.serviceAccounts.identityBindings.get',
1019        ordered_params=['name'],
1020        path_params=['name'],
1021        query_params=[],
1022        relative_path='v1/{+name}',
1023        request_field='',
1024        request_type_name='IamProjectsServiceAccountsIdentityBindingsGetRequest',
1025        response_type_name='ServiceAccountIdentityBinding',
1026        supports_download=False,
1027    )
1028
1029    def List(self, request, global_params=None):
1030      r"""List method for the projects_serviceAccounts_identityBindings service.
1031
1032      Args:
1033        request: (IamProjectsServiceAccountsIdentityBindingsListRequest) input message
1034        global_params: (StandardQueryParameters, default: None) global arguments
1035      Returns:
1036        (ListServiceAccountIdentityBindingsResponse) The response message.
1037      """
1038      config = self.GetMethodConfig('List')
1039      return self._RunMethod(
1040          config, request, global_params=global_params)
1041
1042    List.method_config = lambda: base_api.ApiMethodInfo(
1043        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/identityBindings',
1044        http_method='GET',
1045        method_id='iam.projects.serviceAccounts.identityBindings.list',
1046        ordered_params=['name'],
1047        path_params=['name'],
1048        query_params=[],
1049        relative_path='v1/{+name}/identityBindings',
1050        request_field='',
1051        request_type_name='IamProjectsServiceAccountsIdentityBindingsListRequest',
1052        response_type_name='ListServiceAccountIdentityBindingsResponse',
1053        supports_download=False,
1054    )
1055
1056  class ProjectsServiceAccountsKeysService(base_api.BaseApiService):
1057    """Service class for the projects_serviceAccounts_keys resource."""
1058
1059    _NAME = 'projects_serviceAccounts_keys'
1060
1061    def __init__(self, client):
1062      super(IamV1.ProjectsServiceAccountsKeysService, self).__init__(client)
1063      self._upload_configs = {
1064          }
1065
1066    def Create(self, request, global_params=None):
1067      r"""Creates a ServiceAccountKey.
1068
1069      Args:
1070        request: (IamProjectsServiceAccountsKeysCreateRequest) input message
1071        global_params: (StandardQueryParameters, default: None) global arguments
1072      Returns:
1073        (ServiceAccountKey) The response message.
1074      """
1075      config = self.GetMethodConfig('Create')
1076      return self._RunMethod(
1077          config, request, global_params=global_params)
1078
1079    Create.method_config = lambda: base_api.ApiMethodInfo(
1080        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys',
1081        http_method='POST',
1082        method_id='iam.projects.serviceAccounts.keys.create',
1083        ordered_params=['name'],
1084        path_params=['name'],
1085        query_params=[],
1086        relative_path='v1/{+name}/keys',
1087        request_field='createServiceAccountKeyRequest',
1088        request_type_name='IamProjectsServiceAccountsKeysCreateRequest',
1089        response_type_name='ServiceAccountKey',
1090        supports_download=False,
1091    )
1092
1093    def Delete(self, request, global_params=None):
1094      r"""Deletes a ServiceAccountKey. Deleting a service account key does not revoke short-lived credentials that have been issued based on the service account key.
1095
1096      Args:
1097        request: (IamProjectsServiceAccountsKeysDeleteRequest) input message
1098        global_params: (StandardQueryParameters, default: None) global arguments
1099      Returns:
1100        (Empty) The response message.
1101      """
1102      config = self.GetMethodConfig('Delete')
1103      return self._RunMethod(
1104          config, request, global_params=global_params)
1105
1106    Delete.method_config = lambda: base_api.ApiMethodInfo(
1107        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys/{keysId}',
1108        http_method='DELETE',
1109        method_id='iam.projects.serviceAccounts.keys.delete',
1110        ordered_params=['name'],
1111        path_params=['name'],
1112        query_params=[],
1113        relative_path='v1/{+name}',
1114        request_field='',
1115        request_type_name='IamProjectsServiceAccountsKeysDeleteRequest',
1116        response_type_name='Empty',
1117        supports_download=False,
1118    )
1119
1120    def Get(self, request, global_params=None):
1121      r"""Gets a ServiceAccountKey.
1122
1123      Args:
1124        request: (IamProjectsServiceAccountsKeysGetRequest) input message
1125        global_params: (StandardQueryParameters, default: None) global arguments
1126      Returns:
1127        (ServiceAccountKey) The response message.
1128      """
1129      config = self.GetMethodConfig('Get')
1130      return self._RunMethod(
1131          config, request, global_params=global_params)
1132
1133    Get.method_config = lambda: base_api.ApiMethodInfo(
1134        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys/{keysId}',
1135        http_method='GET',
1136        method_id='iam.projects.serviceAccounts.keys.get',
1137        ordered_params=['name'],
1138        path_params=['name'],
1139        query_params=['publicKeyType'],
1140        relative_path='v1/{+name}',
1141        request_field='',
1142        request_type_name='IamProjectsServiceAccountsKeysGetRequest',
1143        response_type_name='ServiceAccountKey',
1144        supports_download=False,
1145    )
1146
1147    def List(self, request, global_params=None):
1148      r"""Lists every ServiceAccountKey for a service account.
1149
1150      Args:
1151        request: (IamProjectsServiceAccountsKeysListRequest) input message
1152        global_params: (StandardQueryParameters, default: None) global arguments
1153      Returns:
1154        (ListServiceAccountKeysResponse) The response message.
1155      """
1156      config = self.GetMethodConfig('List')
1157      return self._RunMethod(
1158          config, request, global_params=global_params)
1159
1160    List.method_config = lambda: base_api.ApiMethodInfo(
1161        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys',
1162        http_method='GET',
1163        method_id='iam.projects.serviceAccounts.keys.list',
1164        ordered_params=['name'],
1165        path_params=['name'],
1166        query_params=['keyTypes'],
1167        relative_path='v1/{+name}/keys',
1168        request_field='',
1169        request_type_name='IamProjectsServiceAccountsKeysListRequest',
1170        response_type_name='ListServiceAccountKeysResponse',
1171        supports_download=False,
1172    )
1173
1174    def Upload(self, request, global_params=None):
1175      r"""Creates a ServiceAccountKey, using a public key that you provide.
1176
1177      Args:
1178        request: (IamProjectsServiceAccountsKeysUploadRequest) input message
1179        global_params: (StandardQueryParameters, default: None) global arguments
1180      Returns:
1181        (ServiceAccountKey) The response message.
1182      """
1183      config = self.GetMethodConfig('Upload')
1184      return self._RunMethod(
1185          config, request, global_params=global_params)
1186
1187    Upload.method_config = lambda: base_api.ApiMethodInfo(
1188        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}/keys:upload',
1189        http_method='POST',
1190        method_id='iam.projects.serviceAccounts.keys.upload',
1191        ordered_params=['name'],
1192        path_params=['name'],
1193        query_params=[],
1194        relative_path='v1/{+name}/keys:upload',
1195        request_field='uploadServiceAccountKeyRequest',
1196        request_type_name='IamProjectsServiceAccountsKeysUploadRequest',
1197        response_type_name='ServiceAccountKey',
1198        supports_download=False,
1199    )
1200
1201  class ProjectsServiceAccountsService(base_api.BaseApiService):
1202    """Service class for the projects_serviceAccounts resource."""
1203
1204    _NAME = 'projects_serviceAccounts'
1205
1206    def __init__(self, client):
1207      super(IamV1.ProjectsServiceAccountsService, self).__init__(client)
1208      self._upload_configs = {
1209          }
1210
1211    def Create(self, request, global_params=None):
1212      r"""Creates a ServiceAccount.
1213
1214      Args:
1215        request: (IamProjectsServiceAccountsCreateRequest) input message
1216        global_params: (StandardQueryParameters, default: None) global arguments
1217      Returns:
1218        (ServiceAccount) The response message.
1219      """
1220      config = self.GetMethodConfig('Create')
1221      return self._RunMethod(
1222          config, request, global_params=global_params)
1223
1224    Create.method_config = lambda: base_api.ApiMethodInfo(
1225        flat_path='v1/projects/{projectsId}/serviceAccounts',
1226        http_method='POST',
1227        method_id='iam.projects.serviceAccounts.create',
1228        ordered_params=['name'],
1229        path_params=['name'],
1230        query_params=[],
1231        relative_path='v1/{+name}/serviceAccounts',
1232        request_field='createServiceAccountRequest',
1233        request_type_name='IamProjectsServiceAccountsCreateRequest',
1234        response_type_name='ServiceAccount',
1235        supports_download=False,
1236    )
1237
1238    def Delete(self, request, global_params=None):
1239      r"""Deletes a ServiceAccount. **Warning:** After you delete a service account, you might not be able to undelete it. If you know that you need to re-enable the service account in the future, use DisableServiceAccount instead. If you delete a service account, IAM permanently removes the service account 30 days later. Google Cloud cannot recover the service account after it is permanently removed, even if you file a support request. To help avoid unplanned outages, we recommend that you disable the service account before you delete it. Use DisableServiceAccount to disable the service account, then wait at least 24 hours and watch for unintended consequences. If there are no unintended consequences, you can delete the service account.
1240
1241      Args:
1242        request: (IamProjectsServiceAccountsDeleteRequest) input message
1243        global_params: (StandardQueryParameters, default: None) global arguments
1244      Returns:
1245        (Empty) The response message.
1246      """
1247      config = self.GetMethodConfig('Delete')
1248      return self._RunMethod(
1249          config, request, global_params=global_params)
1250
1251    Delete.method_config = lambda: base_api.ApiMethodInfo(
1252        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}',
1253        http_method='DELETE',
1254        method_id='iam.projects.serviceAccounts.delete',
1255        ordered_params=['name'],
1256        path_params=['name'],
1257        query_params=[],
1258        relative_path='v1/{+name}',
1259        request_field='',
1260        request_type_name='IamProjectsServiceAccountsDeleteRequest',
1261        response_type_name='Empty',
1262        supports_download=False,
1263    )
1264
1265    def Disable(self, request, global_params=None):
1266      r"""Disables a ServiceAccount immediately. If an application uses the service account to authenticate, that application can no longer call Google APIs or access Google Cloud resources. Existing access tokens for the service account are rejected, and requests for new access tokens will fail. To re-enable the service account, use EnableServiceAccount. After you re-enable the service account, its existing access tokens will be accepted, and you can request new access tokens. To help avoid unplanned outages, we recommend that you disable the service account before you delete it. Use this method to disable the service account, then wait at least 24 hours and watch for unintended consequences. If there are no unintended consequences, you can delete the service account with DeleteServiceAccount.
1267
1268      Args:
1269        request: (IamProjectsServiceAccountsDisableRequest) input message
1270        global_params: (StandardQueryParameters, default: None) global arguments
1271      Returns:
1272        (Empty) The response message.
1273      """
1274      config = self.GetMethodConfig('Disable')
1275      return self._RunMethod(
1276          config, request, global_params=global_params)
1277
1278    Disable.method_config = lambda: base_api.ApiMethodInfo(
1279        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:disable',
1280        http_method='POST',
1281        method_id='iam.projects.serviceAccounts.disable',
1282        ordered_params=['name'],
1283        path_params=['name'],
1284        query_params=[],
1285        relative_path='v1/{+name}:disable',
1286        request_field='disableServiceAccountRequest',
1287        request_type_name='IamProjectsServiceAccountsDisableRequest',
1288        response_type_name='Empty',
1289        supports_download=False,
1290    )
1291
1292    def Enable(self, request, global_params=None):
1293      r"""Enables a ServiceAccount that was disabled by DisableServiceAccount. If the service account is already enabled, then this method has no effect. If the service account was disabled by other means-for example, if Google disabled the service account because it was compromised-you cannot use this method to enable the service account.
1294
1295      Args:
1296        request: (IamProjectsServiceAccountsEnableRequest) input message
1297        global_params: (StandardQueryParameters, default: None) global arguments
1298      Returns:
1299        (Empty) The response message.
1300      """
1301      config = self.GetMethodConfig('Enable')
1302      return self._RunMethod(
1303          config, request, global_params=global_params)
1304
1305    Enable.method_config = lambda: base_api.ApiMethodInfo(
1306        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:enable',
1307        http_method='POST',
1308        method_id='iam.projects.serviceAccounts.enable',
1309        ordered_params=['name'],
1310        path_params=['name'],
1311        query_params=[],
1312        relative_path='v1/{+name}:enable',
1313        request_field='enableServiceAccountRequest',
1314        request_type_name='IamProjectsServiceAccountsEnableRequest',
1315        response_type_name='Empty',
1316        supports_download=False,
1317    )
1318
1319    def Get(self, request, global_params=None):
1320      r"""Gets a ServiceAccount.
1321
1322      Args:
1323        request: (IamProjectsServiceAccountsGetRequest) input message
1324        global_params: (StandardQueryParameters, default: None) global arguments
1325      Returns:
1326        (ServiceAccount) The response message.
1327      """
1328      config = self.GetMethodConfig('Get')
1329      return self._RunMethod(
1330          config, request, global_params=global_params)
1331
1332    Get.method_config = lambda: base_api.ApiMethodInfo(
1333        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}',
1334        http_method='GET',
1335        method_id='iam.projects.serviceAccounts.get',
1336        ordered_params=['name'],
1337        path_params=['name'],
1338        query_params=[],
1339        relative_path='v1/{+name}',
1340        request_field='',
1341        request_type_name='IamProjectsServiceAccountsGetRequest',
1342        response_type_name='ServiceAccount',
1343        supports_download=False,
1344    )
1345
1346    def GetIamPolicy(self, request, global_params=None):
1347      r"""Gets the IAM policy that is attached to a ServiceAccount. This IAM policy specifies which members have access to the service account. This method does not tell you whether the service account has been granted any roles on other resources. To check whether a service account has role grants on a resource, use the `getIamPolicy` method for that resource. For example, to view the role grants for a project, call the Resource Manager API's [`projects.getIamPolicy`](https://cloud.google.com/resource-manager/reference/rest/v1/projects/getIamPolicy) method.
1348
1349      Args:
1350        request: (IamProjectsServiceAccountsGetIamPolicyRequest) input message
1351        global_params: (StandardQueryParameters, default: None) global arguments
1352      Returns:
1353        (Policy) The response message.
1354      """
1355      config = self.GetMethodConfig('GetIamPolicy')
1356      return self._RunMethod(
1357          config, request, global_params=global_params)
1358
1359    GetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
1360        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:getIamPolicy',
1361        http_method='POST',
1362        method_id='iam.projects.serviceAccounts.getIamPolicy',
1363        ordered_params=['resource'],
1364        path_params=['resource'],
1365        query_params=['options_requestedPolicyVersion'],
1366        relative_path='v1/{+resource}:getIamPolicy',
1367        request_field='',
1368        request_type_name='IamProjectsServiceAccountsGetIamPolicyRequest',
1369        response_type_name='Policy',
1370        supports_download=False,
1371    )
1372
1373    def List(self, request, global_params=None):
1374      r"""Lists every ServiceAccount that belongs to a specific project.
1375
1376      Args:
1377        request: (IamProjectsServiceAccountsListRequest) input message
1378        global_params: (StandardQueryParameters, default: None) global arguments
1379      Returns:
1380        (ListServiceAccountsResponse) The response message.
1381      """
1382      config = self.GetMethodConfig('List')
1383      return self._RunMethod(
1384          config, request, global_params=global_params)
1385
1386    List.method_config = lambda: base_api.ApiMethodInfo(
1387        flat_path='v1/projects/{projectsId}/serviceAccounts',
1388        http_method='GET',
1389        method_id='iam.projects.serviceAccounts.list',
1390        ordered_params=['name'],
1391        path_params=['name'],
1392        query_params=['pageSize', 'pageToken'],
1393        relative_path='v1/{+name}/serviceAccounts',
1394        request_field='',
1395        request_type_name='IamProjectsServiceAccountsListRequest',
1396        response_type_name='ListServiceAccountsResponse',
1397        supports_download=False,
1398    )
1399
1400    def Patch(self, request, global_params=None):
1401      r"""Patches a ServiceAccount.
1402
1403      Args:
1404        request: (IamProjectsServiceAccountsPatchRequest) input message
1405        global_params: (StandardQueryParameters, default: None) global arguments
1406      Returns:
1407        (ServiceAccount) The response message.
1408      """
1409      config = self.GetMethodConfig('Patch')
1410      return self._RunMethod(
1411          config, request, global_params=global_params)
1412
1413    Patch.method_config = lambda: base_api.ApiMethodInfo(
1414        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}',
1415        http_method='PATCH',
1416        method_id='iam.projects.serviceAccounts.patch',
1417        ordered_params=['name'],
1418        path_params=['name'],
1419        query_params=[],
1420        relative_path='v1/{+name}',
1421        request_field='patchServiceAccountRequest',
1422        request_type_name='IamProjectsServiceAccountsPatchRequest',
1423        response_type_name='ServiceAccount',
1424        supports_download=False,
1425    )
1426
1427    def SetIamPolicy(self, request, global_params=None):
1428      r"""Sets the IAM policy that is attached to a ServiceAccount. Use this method to grant or revoke access to the service account. For example, you could grant a member the ability to impersonate the service account. This method does not enable the service account to access other resources. To grant roles to a service account on a resource, follow these steps: 1. Call the resource's `getIamPolicy` method to get its current IAM policy. 2. Edit the policy so that it binds the service account to an IAM role for the resource. 3. Call the resource's `setIamPolicy` method to update its IAM policy. For detailed instructions, see [Granting roles to a service account for specific resources](https://cloud.google.com/iam/help/service-accounts/granting-access-to-service-accounts).
1429
1430      Args:
1431        request: (IamProjectsServiceAccountsSetIamPolicyRequest) input message
1432        global_params: (StandardQueryParameters, default: None) global arguments
1433      Returns:
1434        (Policy) The response message.
1435      """
1436      config = self.GetMethodConfig('SetIamPolicy')
1437      return self._RunMethod(
1438          config, request, global_params=global_params)
1439
1440    SetIamPolicy.method_config = lambda: base_api.ApiMethodInfo(
1441        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:setIamPolicy',
1442        http_method='POST',
1443        method_id='iam.projects.serviceAccounts.setIamPolicy',
1444        ordered_params=['resource'],
1445        path_params=['resource'],
1446        query_params=[],
1447        relative_path='v1/{+resource}:setIamPolicy',
1448        request_field='setIamPolicyRequest',
1449        request_type_name='IamProjectsServiceAccountsSetIamPolicyRequest',
1450        response_type_name='Policy',
1451        supports_download=False,
1452    )
1453
1454    def SignBlob(self, request, global_params=None):
1455      r"""**Note:** This method is deprecated. Use the [`signBlob`](https://cloud.google.com/iam/help/rest-credentials/v1/projects.serviceAccounts/signBlob) method in the IAM Service Account Credentials API instead. If you currently use this method, see the [migration guide](https://cloud.google.com/iam/help/credentials/migrate-api) for instructions. Signs a blob using the system-managed private key for a ServiceAccount.
1456
1457      Args:
1458        request: (IamProjectsServiceAccountsSignBlobRequest) input message
1459        global_params: (StandardQueryParameters, default: None) global arguments
1460      Returns:
1461        (SignBlobResponse) The response message.
1462      """
1463      config = self.GetMethodConfig('SignBlob')
1464      return self._RunMethod(
1465          config, request, global_params=global_params)
1466
1467    SignBlob.method_config = lambda: base_api.ApiMethodInfo(
1468        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signBlob',
1469        http_method='POST',
1470        method_id='iam.projects.serviceAccounts.signBlob',
1471        ordered_params=['name'],
1472        path_params=['name'],
1473        query_params=[],
1474        relative_path='v1/{+name}:signBlob',
1475        request_field='signBlobRequest',
1476        request_type_name='IamProjectsServiceAccountsSignBlobRequest',
1477        response_type_name='SignBlobResponse',
1478        supports_download=False,
1479    )
1480
1481    def SignJwt(self, request, global_params=None):
1482      r"""**Note:** This method is deprecated. Use the [`signJwt`](https://cloud.google.com/iam/help/rest-credentials/v1/projects.serviceAccounts/signJwt) method in the IAM Service Account Credentials API instead. If you currently use this method, see the [migration guide](https://cloud.google.com/iam/help/credentials/migrate-api) for instructions. Signs a JSON Web Token (JWT) using the system-managed private key for a ServiceAccount.
1483
1484      Args:
1485        request: (IamProjectsServiceAccountsSignJwtRequest) input message
1486        global_params: (StandardQueryParameters, default: None) global arguments
1487      Returns:
1488        (SignJwtResponse) The response message.
1489      """
1490      config = self.GetMethodConfig('SignJwt')
1491      return self._RunMethod(
1492          config, request, global_params=global_params)
1493
1494    SignJwt.method_config = lambda: base_api.ApiMethodInfo(
1495        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signJwt',
1496        http_method='POST',
1497        method_id='iam.projects.serviceAccounts.signJwt',
1498        ordered_params=['name'],
1499        path_params=['name'],
1500        query_params=[],
1501        relative_path='v1/{+name}:signJwt',
1502        request_field='signJwtRequest',
1503        request_type_name='IamProjectsServiceAccountsSignJwtRequest',
1504        response_type_name='SignJwtResponse',
1505        supports_download=False,
1506    )
1507
1508    def TestIamPermissions(self, request, global_params=None):
1509      r"""Tests whether the caller has the specified permissions on a ServiceAccount.
1510
1511      Args:
1512        request: (IamProjectsServiceAccountsTestIamPermissionsRequest) input message
1513        global_params: (StandardQueryParameters, default: None) global arguments
1514      Returns:
1515        (TestIamPermissionsResponse) The response message.
1516      """
1517      config = self.GetMethodConfig('TestIamPermissions')
1518      return self._RunMethod(
1519          config, request, global_params=global_params)
1520
1521    TestIamPermissions.method_config = lambda: base_api.ApiMethodInfo(
1522        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:testIamPermissions',
1523        http_method='POST',
1524        method_id='iam.projects.serviceAccounts.testIamPermissions',
1525        ordered_params=['resource'],
1526        path_params=['resource'],
1527        query_params=[],
1528        relative_path='v1/{+resource}:testIamPermissions',
1529        request_field='testIamPermissionsRequest',
1530        request_type_name='IamProjectsServiceAccountsTestIamPermissionsRequest',
1531        response_type_name='TestIamPermissionsResponse',
1532        supports_download=False,
1533    )
1534
1535    def Undelete(self, request, global_params=None):
1536      r"""Restores a deleted ServiceAccount. **Important:** It is not always possible to restore a deleted service account. Use this method only as a last resort. After you delete a service account, IAM permanently removes the service account 30 days later. There is no way to restore a deleted service account that has been permanently removed.
1537
1538      Args:
1539        request: (IamProjectsServiceAccountsUndeleteRequest) input message
1540        global_params: (StandardQueryParameters, default: None) global arguments
1541      Returns:
1542        (UndeleteServiceAccountResponse) The response message.
1543      """
1544      config = self.GetMethodConfig('Undelete')
1545      return self._RunMethod(
1546          config, request, global_params=global_params)
1547
1548    Undelete.method_config = lambda: base_api.ApiMethodInfo(
1549        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:undelete',
1550        http_method='POST',
1551        method_id='iam.projects.serviceAccounts.undelete',
1552        ordered_params=['name'],
1553        path_params=['name'],
1554        query_params=[],
1555        relative_path='v1/{+name}:undelete',
1556        request_field='undeleteServiceAccountRequest',
1557        request_type_name='IamProjectsServiceAccountsUndeleteRequest',
1558        response_type_name='UndeleteServiceAccountResponse',
1559        supports_download=False,
1560    )
1561
1562    def Update(self, request, global_params=None):
1563      r"""**Note:** We are in the process of deprecating this method. Use PatchServiceAccount instead. Updates a ServiceAccount. You can update only the `display_name` and `description` fields.
1564
1565      Args:
1566        request: (ServiceAccount) input message
1567        global_params: (StandardQueryParameters, default: None) global arguments
1568      Returns:
1569        (ServiceAccount) The response message.
1570      """
1571      config = self.GetMethodConfig('Update')
1572      return self._RunMethod(
1573          config, request, global_params=global_params)
1574
1575    Update.method_config = lambda: base_api.ApiMethodInfo(
1576        flat_path='v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}',
1577        http_method='PUT',
1578        method_id='iam.projects.serviceAccounts.update',
1579        ordered_params=['name'],
1580        path_params=['name'],
1581        query_params=[],
1582        relative_path='v1/{+name}',
1583        request_field='<request>',
1584        request_type_name='ServiceAccount',
1585        response_type_name='ServiceAccount',
1586        supports_download=False,
1587    )
1588
1589  class ProjectsService(base_api.BaseApiService):
1590    """Service class for the projects resource."""
1591
1592    _NAME = 'projects'
1593
1594    def __init__(self, client):
1595      super(IamV1.ProjectsService, self).__init__(client)
1596      self._upload_configs = {
1597          }
1598
1599  class RolesService(base_api.BaseApiService):
1600    """Service class for the roles resource."""
1601
1602    _NAME = 'roles'
1603
1604    def __init__(self, client):
1605      super(IamV1.RolesService, self).__init__(client)
1606      self._upload_configs = {
1607          }
1608
1609    def Get(self, request, global_params=None):
1610      r"""Gets the definition of a Role.
1611
1612      Args:
1613        request: (IamRolesGetRequest) input message
1614        global_params: (StandardQueryParameters, default: None) global arguments
1615      Returns:
1616        (Role) The response message.
1617      """
1618      config = self.GetMethodConfig('Get')
1619      return self._RunMethod(
1620          config, request, global_params=global_params)
1621
1622    Get.method_config = lambda: base_api.ApiMethodInfo(
1623        flat_path='v1/roles/{rolesId}',
1624        http_method='GET',
1625        method_id='iam.roles.get',
1626        ordered_params=['name'],
1627        path_params=['name'],
1628        query_params=[],
1629        relative_path='v1/{+name}',
1630        request_field='',
1631        request_type_name='IamRolesGetRequest',
1632        response_type_name='Role',
1633        supports_download=False,
1634    )
1635
1636    def List(self, request, global_params=None):
1637      r"""Lists every predefined Role that IAM supports, or every custom role that is defined for an organization or project.
1638
1639      Args:
1640        request: (IamRolesListRequest) input message
1641        global_params: (StandardQueryParameters, default: None) global arguments
1642      Returns:
1643        (ListRolesResponse) The response message.
1644      """
1645      config = self.GetMethodConfig('List')
1646      return self._RunMethod(
1647          config, request, global_params=global_params)
1648
1649    List.method_config = lambda: base_api.ApiMethodInfo(
1650        http_method='GET',
1651        method_id='iam.roles.list',
1652        ordered_params=[],
1653        path_params=[],
1654        query_params=['pageSize', 'pageToken', 'parent', 'showDeleted', 'view'],
1655        relative_path='v1/roles',
1656        request_field='',
1657        request_type_name='IamRolesListRequest',
1658        response_type_name='ListRolesResponse',
1659        supports_download=False,
1660    )
1661
1662    def QueryGrantableRoles(self, request, global_params=None):
1663      r"""Lists roles that can be granted on a Google Cloud resource. A role is grantable if the IAM policy for the resource can contain bindings to the role.
1664
1665      Args:
1666        request: (QueryGrantableRolesRequest) input message
1667        global_params: (StandardQueryParameters, default: None) global arguments
1668      Returns:
1669        (QueryGrantableRolesResponse) The response message.
1670      """
1671      config = self.GetMethodConfig('QueryGrantableRoles')
1672      return self._RunMethod(
1673          config, request, global_params=global_params)
1674
1675    QueryGrantableRoles.method_config = lambda: base_api.ApiMethodInfo(
1676        http_method='POST',
1677        method_id='iam.roles.queryGrantableRoles',
1678        ordered_params=[],
1679        path_params=[],
1680        query_params=[],
1681        relative_path='v1/roles:queryGrantableRoles',
1682        request_field='<request>',
1683        request_type_name='QueryGrantableRolesRequest',
1684        response_type_name='QueryGrantableRolesResponse',
1685        supports_download=False,
1686    )
1687