Generates (or retrieves) IdentityID. Supplying multiple logins will create an implicit linked account.
This is a public API. You do not need any credentials to call this API.
Parameters:
-
account_id
(Optional[AccountId], default:
None
)
–
A standard Amazon Web Services account ID (9+ digits).
-
identity_pool_id
(IdentityPoolId)
–
An identity pool ID in the format REGION:GUID.
-
logins
(Optional[LoginsMap], default:
None
)
–
A set of optional name-value pairs that map provider names to provider tokens. The available provider names for Logins are as follows:
-
Facebook: graph.facebook.com
-
Amazon Cognito user pool: cognito-idp..amazonaws.com/, for example, cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789.
-
Google: accounts.google.com
-
Amazon: www.amazon.com
-
Twitter: api.twitter.com
-
Digits: www.digits.com
Raises:
Source code in docs_src/capo_cognito_identity/_services/cognito_identity.py
| def get_id(
self,
identity_pool_id: "capo_cognito_identity.types.identity_pool_id.IdentityPoolId",
*,
config_overrides: Optional[CognitoIdentityClientConfig] = None,
account_id: Optional["capo_cognito_identity.types.account_id.AccountId"] = None,
logins: Optional["capo_cognito_identity.types.logins_map.LoginsMap"] = None,
) -> "capo_cognito_identity.types.get_id_response.GetIdResponse":
"""<p>Generates (or retrieves) IdentityID. Supplying multiple logins will create an implicit linked account.</p> <p>This is a public API. You do not need any credentials to call this API.</p>
Args:
account_id: <p>A standard Amazon Web Services account ID (9+ digits).</p>
identity_pool_id: <p>An identity pool ID in the format REGION:GUID.</p>
logins: <p>A set of optional name-value pairs that map provider names to provider tokens. The available provider names for <code>Logins</code> are as follows:</p> <ul> <li> <p>Facebook: <code>graph.facebook.com</code> </p> </li> <li> <p>Amazon Cognito user pool: <code>cognito-idp.<region>.amazonaws.com/<YOUR_USER_POOL_ID></code>, for example, <code>cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789</code>. </p> </li> <li> <p>Google: <code>accounts.google.com</code> </p> </li> <li> <p>Amazon: <code>www.amazon.com</code> </p> </li> <li> <p>Twitter: <code>api.twitter.com</code> </p> </li> <li> <p>Digits: <code>www.digits.com</code> </p> </li> </ul>
Raises:
capo_cognito_identity.errors.external_service_exception.ExternalServiceException: <p>An exception thrown when a dependent service such as Facebook or Twitter is not responding</p>
capo_cognito_identity.errors.internal_error_exception.InternalErrorException: <p>Thrown when the service encounters an error during processing the request.</p>
capo_cognito_identity.errors.invalid_parameter_exception.InvalidParameterException: <p>Thrown for missing or bad input parameter(s).</p>
capo_cognito_identity.errors.limit_exceeded_exception.LimitExceededException: <p>Thrown when the total number of user pools has exceeded a preset limit.</p>
capo_cognito_identity.errors.not_authorized_exception.NotAuthorizedException: <p>Thrown when a user is not authorized to access the requested resource.</p>
capo_cognito_identity.errors.resource_conflict_exception.ResourceConflictException: <p>Thrown when a user tries to use a login which is already linked to another account.</p>
capo_cognito_identity.errors.resource_not_found_exception.ResourceNotFoundException: <p>Thrown when the requested resource (for example, a dataset or record) does not exist.</p>
capo_cognito_identity.errors.too_many_requests_exception.TooManyRequestsException: <p>Thrown when a request is throttled.</p>
capo_cognito_identity.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cognito_identity.types.get_id_input.GetIdInput]",
) -> OperationResponse[
"capo_cognito_identity.types.get_id_response.GetIdResponse"
]:
import capo_cognito_identity._operations.aws_cognito_identity_service.get_id
output, http_response = (
capo_cognito_identity._operations.aws_cognito_identity_service.get_id.get_id(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_cognito_identity.types.get_id_input.GetIdInput",
) -> dict[str, Any]:
import capo_cognito_identity.types.get_id_input
return capo_cognito_identity.types.get_id_input.redact_sensitive(input_)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetId", redact_input=_redact_input)
)
input_: capo_cognito_identity.types.get_id_input.GetIdInput = {
"identity_pool_id": identity_pool_id
}
if account_id is not None:
input_["account_id"] = account_id
if logins is not None:
input_["logins"] = logins
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|