The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.
The transport to use, or a Callable that constructs and returns a new transport to use. If a Callable is given, it will be called with the same set of initialization arguments as used in the IamCheckerTransport constructor. If set to None, a transport is chosen automatically.
Custom options for the client. 1. The api_endpoint property can be used to override the default endpoint provided by the client when transport is not explicitly provided. Only if this property is not set and transport was not explicitly provided, the endpoint is determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment variable, which have one of the following values: "always" (always use the default mTLS endpoint), "never" (always use the default regular endpoint) and "auto" (auto-switch to the default mTLS endpoint if client certificate is present; this is the default value). 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "true", then the client_cert_source property can be used to provide a client certificate for mTLS transport. If not provided, the default SSL client certificate will be used if present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not set, no client certificate will be used. 3. The universe_domain property can be used to override the default "googleapis.com" universe. Note that api_endpoint property still takes precedence; and universe_domain is currently not supported for mTLS.
client_info
google.api_core.gapic_v1.client_info.ClientInfo
The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you're developing your own client library.
Exceptions
Type
Description
google.auth.exceptions.MutualTlsChannelError
If mutual TLS transport creation failed for any reason.
Return the API endpoint and client cert source for mutual TLS.
The client cert source is determined in the following order:
(1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not "true", the
client cert source is None.
(2) if client_options.client_cert_source is provided, use the provided one; if the
default client cert source exists, use the default one; otherwise the client cert
source is None.
The API endpoint is determined in the following order:
(1) if client_options.api_endpoint if provided, use the provided one.
(2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "always", use the
default mTLS endpoint; if the environment variable is "never", use the default API
endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
use the default API endpoint.
Checks whether a principal has a specific permission
for a specific resource, and explains why the principal
does or does not have that permission.
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import policytroubleshooter_v1
async def sample_troubleshoot_iam_policy():
# Create a client
client = policytroubleshooter_v1.IamCheckerAsyncClient()
# Initialize request argument(s)
request = policytroubleshooter_v1.TroubleshootIamPolicyRequest(
)
# Make the request
response = await client.troubleshoot_iam_policy(request=request)
# Handle the response
print(response)
The request object. Request for TroubleshootIamPolicy.
retry
google.api_core.retry_async.AsyncRetry
Designation of what errors, if any, should be retried.
timeout
float
The timeout for this request.
metadata
Sequence[Tuple[str, Union[str, bytes]]]
Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class IamCheckerAsyncClient (1.13.3)\n\nVersion latestkeyboard_arrow_down\n\n- [1.13.3 (latest)](/python/docs/reference/policytroubleshooter/latest/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.13.1](/python/docs/reference/policytroubleshooter/1.13.1/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.12.1](/python/docs/reference/policytroubleshooter/1.12.1/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.11.5](/python/docs/reference/policytroubleshooter/1.11.5/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.10.0](/python/docs/reference/policytroubleshooter/1.10.0/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.9.0](/python/docs/reference/policytroubleshooter/1.9.0/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.8.2](/python/docs/reference/policytroubleshooter/1.8.2/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.7.1](/python/docs/reference/policytroubleshooter/1.7.1/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.6.0](/python/docs/reference/policytroubleshooter/1.6.0/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.5.4](/python/docs/reference/policytroubleshooter/1.5.4/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.4.2](/python/docs/reference/policytroubleshooter/1.4.2/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.3.1](/python/docs/reference/policytroubleshooter/1.3.1/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.2.0](/python/docs/reference/policytroubleshooter/1.2.0/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.1.3](/python/docs/reference/policytroubleshooter/1.1.3/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [1.0.0](/python/docs/reference/policytroubleshooter/1.0.0/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [0.2.0](/python/docs/reference/policytroubleshooter/0.2.0/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient)\n- [0.1.0](/python/docs/reference/policytroubleshooter/0.1.0/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient) \n\n IamCheckerAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.policytroubleshooter_v1.services.iam_checker.transports.base.IamCheckerTransport, typing.Callable[[...], google.cloud.policytroubleshooter_v1.services.iam_checker.transports.base.IamCheckerTransport]]] = 'grpc_asyncio', client_options: typing.Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = \u003cgoogle.api_core.gapic_v1.client_info.ClientInfo object\u003e)\n\nIAM Policy Troubleshooter service.\n\nThis service helps you troubleshoot access issues for Google\nCloud resources.\n\nProperties\n----------\n\n### api_endpoint\n\nReturn the API endpoint used by the client instance.\n\n### transport\n\nReturns the transport used by the client instance.\n\n### universe_domain\n\nReturn the universe domain used by the client instance.\n\nMethods\n-------\n\n### IamCheckerAsyncClient\n\n IamCheckerAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.policytroubleshooter_v1.services.iam_checker.transports.base.IamCheckerTransport, typing.Callable[[...], google.cloud.policytroubleshooter_v1.services.iam_checker.transports.base.IamCheckerTransport]]] = 'grpc_asyncio', client_options: typing.Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = \u003cgoogle.api_core.gapic_v1.client_info.ClientInfo object\u003e)\n\nInstantiates the iam checker async client.\n\n### common_billing_account_path\n\n common_billing_account_path(billing_account: str) -\u003e str\n\nReturns a fully-qualified billing_account string.\n\n### common_folder_path\n\n common_folder_path(folder: str) -\u003e str\n\nReturns a fully-qualified folder string.\n\n### common_location_path\n\n common_location_path(project: str, location: str) -\u003e str\n\nReturns a fully-qualified location string.\n\n### common_organization_path\n\n common_organization_path(organization: str) -\u003e str\n\nReturns a fully-qualified organization string.\n\n### common_project_path\n\n common_project_path(project: str) -\u003e str\n\nReturns a fully-qualified project string.\n\n### from_service_account_file\n\n from_service_account_file(filename: str, *args, **kwargs)\n\nCreates an instance of this client using the provided credentials\nfile.\n\n### from_service_account_info\n\n from_service_account_info(info: dict, *args, **kwargs)\n\nCreates an instance of this client using the provided credentials\ninfo.\n\n### from_service_account_json\n\n from_service_account_json(filename: str, *args, **kwargs)\n\nCreates an instance of this client using the provided credentials\nfile.\n\n### get_mtls_endpoint_and_cert_source\n\n get_mtls_endpoint_and_cert_source(\n client_options: typing.Optional[\n google.api_core.client_options.ClientOptions\n ] = None,\n )\n\nReturn the API endpoint and client cert source for mutual TLS.\n\nThe client cert source is determined in the following order:\n(1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not \"true\", the\nclient cert source is None.\n(2) if `client_options.client_cert_source` is provided, use the provided one; if the\ndefault client cert source exists, use the default one; otherwise the client cert\nsource is None.\n\nThe API endpoint is determined in the following order:\n(1) if `client_options.api_endpoint` if provided, use the provided one.\n(2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is \"always\", use the\ndefault mTLS endpoint; if the environment variable is \"never\", use the default API\nendpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise\nuse the default API endpoint.\n\nMore details can be found at \u003chttps://google.aip.dev/auth/4114\u003e.\n\n### get_transport_class\n\n get_transport_class(\n label: typing.Optional[str] = None,\n ) -\u003e typing.Type[\n google.cloud.policytroubleshooter_v1.services.iam_checker.transports.base.IamCheckerTransport\n ]\n\nReturns an appropriate transport class.\n\n### parse_common_billing_account_path\n\n parse_common_billing_account_path(path: str) -\u003e typing.Dict[str, str]\n\nParse a billing_account path into its component segments.\n\n### parse_common_folder_path\n\n parse_common_folder_path(path: str) -\u003e typing.Dict[str, str]\n\nParse a folder path into its component segments.\n\n### parse_common_location_path\n\n parse_common_location_path(path: str) -\u003e typing.Dict[str, str]\n\nParse a location path into its component segments.\n\n### parse_common_organization_path\n\n parse_common_organization_path(path: str) -\u003e typing.Dict[str, str]\n\nParse a organization path into its component segments.\n\n### parse_common_project_path\n\n parse_common_project_path(path: str) -\u003e typing.Dict[str, str]\n\nParse a project path into its component segments.\n\n### troubleshoot_iam_policy\n\n troubleshoot_iam_policy(\n request: typing.Optional[\n typing.Union[\n google.cloud.policytroubleshooter_v1.types.checker.TroubleshootIamPolicyRequest,\n dict,\n ]\n ] = None,\n *,\n retry: typing.Optional[\n typing.Union[\n google.api_core.retry.retry_unary_async.AsyncRetry,\n google.api_core.gapic_v1.method._MethodDefault,\n ]\n ] = _MethodDefault._DEFAULT_VALUE,\n timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,\n metadata: typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]] = ()\n ) -\u003e google.cloud.policytroubleshooter_v1.types.checker.TroubleshootIamPolicyResponse\n\nChecks whether a principal has a specific permission\nfor a specific resource, and explains why the principal\ndoes or does not have that permission. \n\n # This snippet has been automatically generated and should be regarded as a\n # code template only.\n # It will require modifications to work:\n # - It may require correct/in-range values for request initialization.\n # - It may require specifying regional endpoints when creating the service\n # client as shown in:\n # https://googleapis.dev/python/google-api-core/latest/client_options.html\n from google.cloud import https://cloud.google.com/python/docs/reference/policytroubleshooter/latest/\n\n async def sample_troubleshoot_iam_policy():\n # Create a client\n client = https://cloud.google.com/python/docs/reference/policytroubleshooter/latest/.https://cloud.google.com/python/docs/reference/policytroubleshooter/latest/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient.html()\n\n # Initialize request argument(s)\n request = https://cloud.google.com/python/docs/reference/policytroubleshooter/latest/.TroubleshootIamPolicyRequest(\n )\n\n # Make the request\n response = await client.https://cloud.google.com/python/docs/reference/policytroubleshooter/latest/google.cloud.policytroubleshooter_v1.services.iam_checker.IamCheckerAsyncClient.html#google_cloud_policytroubleshooter_v1_services_iam_checker_IamCheckerAsyncClient_troubleshoot_iam_policy(request=request)\n\n # Handle the response\n print(response)"]]