async def update_tenant( self, request: tenant_service.UpdateTenantRequest = None, *, tenant: gct_tenant.Tenant = None, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> gct_tenant.Tenant: r"""Updates specified tenant. Args: request (:class:`~.tenant_service.UpdateTenantRequest`): The request object. Request for updating a specified tenant. tenant (:class:`~.gct_tenant.Tenant`): Required. The tenant resource to replace the current resource in the system. This corresponds to the ``tenant`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: ~.gct_tenant.Tenant: A Tenant resource represents a tenant in the service. A tenant is a group or entity that shares common access with specific privileges for resources like profiles. Customer may create multiple tenants to provide data isolation for different groups. """ # Create or coerce a protobuf request object. # Sanity check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. if request is not None and any([tenant]): raise ValueError("If the `request` argument is set, then none of " "the individual field arguments should be set.") request = tenant_service.UpdateTenantRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if tenant is not None: request.tenant = tenant # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.update_tenant, default_timeout=30.0, client_info=_client_info, ) # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + (gapic_v1.routing_header.to_grpc_metadata( (("tenant.name", request.tenant.name), )), ) # Send the request. response = await rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response
def update_tenant( self, request: tenant_service.UpdateTenantRequest = None, *, tenant: gct_tenant.Tenant = None, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> gct_tenant.Tenant: r"""Updates specified tenant. Args: request (google.cloud.talent_v4beta1.types.UpdateTenantRequest): The request object. Request for updating a specified tenant. tenant (google.cloud.talent_v4beta1.types.Tenant): Required. The tenant resource to replace the current resource in the system. This corresponds to the ``tenant`` field on the ``request`` instance; if ``request`` is provided, this should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. Returns: google.cloud.talent_v4beta1.types.Tenant: A Tenant resource represents a tenant in the service. A tenant is a group or entity that shares common access with specific privileges for resources like profiles. Customer may create multiple tenants to provide data isolation for different groups. """ # Create or coerce a protobuf request object. # Sanity check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([tenant]) if request is not None and has_flattened_params: raise ValueError("If the `request` argument is set, then none of " "the individual field arguments should be set.") # Minor optimization to avoid making a copy if the user passes # in a tenant_service.UpdateTenantRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, tenant_service.UpdateTenantRequest): request = tenant_service.UpdateTenantRequest(request) # If we have keyword arguments corresponding to fields on the # request, apply these. if tenant is not None: request.tenant = tenant # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.update_tenant] # Certain fields should be provided within the metadata header; # add these here. metadata = tuple(metadata) + (gapic_v1.routing_header.to_grpc_metadata( (("tenant.name", request.tenant.name), )), ) # Send the request. response = rpc( request, retry=retry, timeout=timeout, metadata=metadata, ) # Done; return the response. return response