Configures the branding settings for a user pool style. This operation is the programmatic option for the configuration of a style in the branding editor.
Provides values for UI customization in a Settings JSON object and image files in an Assets array.
This operation has a 2-megabyte request-size limit and include the CSS settings and image assets for your app client. Your branding settings might exceed 2MB in size. Amazon Cognito doesn't require that you pass all parameters in one request and preserves existing style settings that you don't specify. If your request is larger than 2MB, separate it into multiple requests, each with a size smaller than the limit.
Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.
Learn more
Parameters:
-
user_pool_id
(Optional[UserPoolIdType], default:
None
)
–
The ID of the user pool that contains the managed login branding style that you want to update.
-
managed_login_branding_id
(Optional[ManagedLoginBrandingIdType], default:
None
)
–
The ID of the managed login branding style that you want to update.
-
use_cognito_provided_values
(Optional[BooleanType], default:
None
)
–
When true, applies the default branding style options. This option reverts to default style options that are managed by Amazon Cognito. You can modify them later in the branding editor.
When you specify true for this option, you must also omit values for Settings and Assets in the request.
-
settings
(Optional[Document], default:
None
)
–
A JSON file, encoded as a Document type, with the the settings that you want to apply to your style.
The following components are not currently implemented and reserved for future use:
-
assets
(Optional[AssetListType], default:
None
)
–
An array of image files that you want to apply to roles like backgrounds, logos, and icons. Each object must also indicate whether it is for dark mode, light mode, or browser-adaptive mode.
Raises:
-
ConcurrentModificationException
–
This exception is thrown if two or more modifications are happening concurrently.
-
InternalErrorException
–
This exception is thrown when Amazon Cognito encounters an internal error.
-
InvalidParameterException
–
This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
-
NotAuthorizedException
–
This exception is thrown when a user isn't authorized.
-
OperationNotEnabledException
–
This exception is thrown when an operation is not available in the current region or for the current user pool configuration. This can occur when attempting to perform operations that are not supported in secondary replica regions.
-
ResourceNotFoundException
–
This exception is thrown when the Amazon Cognito service can't find the requested resource.
-
TooManyRequestsException
–
This exception is thrown when the user has made too many requests for a given operation.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_cognito_identity_provider/_services/async_cognito_identity_provider.py
| async def update_managed_login_branding(
self,
*,
config_overrides: Optional[AsyncCognitoIdentityProviderClientConfig] = None,
user_pool_id: Optional[
"capo_cognito_identity_provider.types.user_pool_id_type.UserPoolIdType"
] = None,
managed_login_branding_id: Optional[
"capo_cognito_identity_provider.types.managed_login_branding_id_type.ManagedLoginBrandingIdType"
] = None,
use_cognito_provided_values: Optional[
"capo_cognito_identity_provider.types.boolean_type.BooleanType"
] = None,
settings: Optional[
"capo_cognito_identity_provider.types.document.Document"
] = None,
assets: Optional[
"capo_cognito_identity_provider.types.asset_list_type.AssetListType"
] = None,
) -> "capo_cognito_identity_provider.types.update_managed_login_branding_response.UpdateManagedLoginBrandingResponse":
"""<p>Configures the branding settings for a user pool style. This operation is the programmatic option for the configuration of a style in the branding editor.</p> <p>Provides values for UI customization in a <code>Settings</code> JSON object and image files in an <code>Assets</code> array.</p> <p> This operation has a 2-megabyte request-size limit and include the CSS settings and image assets for your app client. Your branding settings might exceed 2MB in size. Amazon Cognito doesn't require that you pass all parameters in one request and preserves existing style settings that you don't specify. If your request is larger than 2MB, separate it into multiple requests, each with a size smaller than the limit.</p> <note> <p>Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.</p> <p class="title"> <b>Learn more</b> </p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html">Signing Amazon Web Services API Requests</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pools-API-operations.html">Using the Amazon Cognito user pools API and user pool endpoints</a> </p> </li> </ul> </note>
Args:
user_pool_id: <p>The ID of the user pool that contains the managed login branding style that you want to update.</p>
managed_login_branding_id: <p>The ID of the managed login branding style that you want to update.</p>
use_cognito_provided_values: <p>When <code>true</code>, applies the default branding style options. This option reverts to default style options that are managed by Amazon Cognito. You can modify them later in the branding editor.</p> <p>When you specify <code>true</code> for this option, you must also omit values for <code>Settings</code> and <code>Assets</code> in the request.</p>
settings: <p>A JSON file, encoded as a <code>Document</code> type, with the the settings that you want to apply to your style.</p> <p>The following components are not currently implemented and reserved for future use:</p> <ul> <li> <p> <code>signUp</code> </p> </li> <li> <p> <code>instructions</code> </p> </li> <li> <p> <code>sessionTimerDisplay</code> </p> </li> <li> <p> <code>languageSelector</code> (for localization, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-managed-login.html#managed-login-localization">Managed login localization)</a> </p> </li> </ul>
assets: <p>An array of image files that you want to apply to roles like backgrounds, logos, and icons. Each object must also indicate whether it is for dark mode, light mode, or browser-adaptive mode.</p>
Raises:
capo_cognito_identity_provider.errors.concurrent_modification_exception.ConcurrentModificationException: <p>This exception is thrown if two or more modifications are happening concurrently.</p>
capo_cognito_identity_provider.errors.internal_error_exception.InternalErrorException: <p>This exception is thrown when Amazon Cognito encounters an internal error.</p>
capo_cognito_identity_provider.errors.invalid_parameter_exception.InvalidParameterException: <p>This exception is thrown when the Amazon Cognito service encounters an invalid parameter.</p>
capo_cognito_identity_provider.errors.not_authorized_exception.NotAuthorizedException: <p>This exception is thrown when a user isn't authorized.</p>
capo_cognito_identity_provider.errors.operation_not_enabled_exception.OperationNotEnabledException: <p>This exception is thrown when an operation is not available in the current region or for the current user pool configuration. This can occur when attempting to perform operations that are not supported in secondary replica regions.</p>
capo_cognito_identity_provider.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when the Amazon Cognito service can't find the requested resource.</p>
capo_cognito_identity_provider.errors.too_many_requests_exception.TooManyRequestsException: <p>This exception is thrown when the user has made too many requests for a given operation.</p>
capo_cognito_identity_provider.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cognito_identity_provider.types.update_managed_login_branding_request.UpdateManagedLoginBrandingRequest]",
) -> AsyncOperationResponse[
"capo_cognito_identity_provider.types.update_managed_login_branding_response.UpdateManagedLoginBrandingResponse"
]:
import capo_cognito_identity_provider._operations.aws_cognito_identity_provider_service.update_managed_login_branding
(
output,
http_response,
) = await capo_cognito_identity_provider._operations.aws_cognito_identity_provider_service.update_managed_login_branding.async_update_managed_login_branding(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateManagedLoginBranding")
)
input_: capo_cognito_identity_provider.types.update_managed_login_branding_request.UpdateManagedLoginBrandingRequest = {}
if user_pool_id is not None:
input_["user_pool_id"] = user_pool_id
if managed_login_branding_id is not None:
input_["managed_login_branding_id"] = managed_login_branding_id
if use_cognito_provided_values is not None:
input_["use_cognito_provided_values"] = use_cognito_provided_values
if settings is not None:
input_["settings"] = settings
if assets is not None:
input_["assets"] = assets
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|