Skip to content

set_platform_application_attributes async

set_platform_application_attributes(
    platform_application_arn: String,
    attributes: MapStringToString,
    *,
    config_overrides: Optional[AsyncSNSClientConfig] = None,
) -> None

Sets the attributes of the platform application object for the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging). For more information, see Using Amazon SNS Mobile Push Notifications. For information on configuring attributes for message delivery status, see Using Amazon SNS Application Attributes for Message Delivery Status.

Parameters:

  • platform_application_arn (String) –

    PlatformApplicationArn for SetPlatformApplicationAttributes action.

  • attributes (MapStringToString) –

    A map of the platform application attributes. Attributes in this map include the following:

    • PlatformCredential – The credential received from the notification service.

      • For ADM, PlatformCredentialis client secret.

      • For Apple Services using certificate credentials, PlatformCredential is private key.

      • For Apple Services using token credentials, PlatformCredential is signing key.

      • For GCM (Firebase Cloud Messaging) using key credentials, there is no PlatformPrincipal. The PlatformCredential is API key.

      • For GCM (Firebase Cloud Messaging) using token credentials, there is no PlatformPrincipal. The PlatformCredential is a JSON formatted private key file. When using the Amazon Web Services CLI, the file must be in string format and special characters must be ignored. To format the file correctly, Amazon SNS recommends using the following command: SERVICE_JSON=`jq @json <<< cat service.json`.

    • PlatformPrincipal – The principal received from the notification service.

      • For ADM, PlatformPrincipalis client id.

      • For Apple Services using certificate credentials, PlatformPrincipal is SSL certificate.

      • For Apple Services using token credentials, PlatformPrincipal is signing key ID.

      • For GCM (Firebase Cloud Messaging), there is no PlatformPrincipal.

    • EventEndpointCreated – Topic ARN to which EndpointCreated event notifications are sent.

    • EventEndpointDeleted – Topic ARN to which EndpointDeleted event notifications are sent.

    • EventEndpointUpdated – Topic ARN to which EndpointUpdate event notifications are sent.

    • EventDeliveryFailure – Topic ARN to which DeliveryFailure event notifications are sent upon Direct Publish delivery failure (permanent) to one of the application's endpoints.

    • SuccessFeedbackRoleArn – IAM role ARN used to give Amazon SNS write access to use CloudWatch Logs on your behalf.

    • FailureFeedbackRoleArn – IAM role ARN used to give Amazon SNS write access to use CloudWatch Logs on your behalf.

    • SuccessFeedbackSampleRate – Sample rate percentage (0-100) of successfully delivered messages.

    The following attributes only apply to APNs token-based authentication:

    • ApplePlatformTeamID – The identifier that's assigned to your Apple developer account team.

    • ApplePlatformBundleID – The bundle identifier that's assigned to your iOS app.

Raises:

Source code in docs_src/capo_sns/_services/async_sns.py
async def set_platform_application_attributes(
    self,
    platform_application_arn: "capo_sns.types.string.String",
    attributes: "capo_sns.types.map_string_to_string.MapStringToString",
    *,
    config_overrides: Optional[AsyncSNSClientConfig] = None,
) -> None:
    """<p>Sets the attributes of the platform application object for the supported push notification services, such as APNS and GCM (Firebase Cloud Messaging). For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html">Using Amazon SNS Mobile Push Notifications</a>. For information on configuring attributes for message delivery status, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html">Using Amazon SNS Application Attributes for Message Delivery Status</a>. </p>

    Args:
        platform_application_arn: <p> <code>PlatformApplicationArn</code> for <code>SetPlatformApplicationAttributes</code> action.</p>
        attributes: <p>A map of the platform application attributes. Attributes in this map include the following:</p> <ul> <li> <p> <code>PlatformCredential</code> – The credential received from the notification service.</p> <ul> <li> <p>For ADM, <code>PlatformCredential</code>is client secret.</p> </li> <li> <p>For Apple Services using certificate credentials, <code>PlatformCredential</code> is private key.</p> </li> <li> <p>For Apple Services using token credentials, <code>PlatformCredential</code> is signing key.</p> </li> <li> <p>For GCM (Firebase Cloud Messaging) using key credentials, there is no <code>PlatformPrincipal</code>. The <code>PlatformCredential</code> is <code>API key</code>.</p> </li> <li> <p>For GCM (Firebase Cloud Messaging) using token credentials, there is no <code>PlatformPrincipal</code>. The <code>PlatformCredential</code> is a JSON formatted private key file. When using the Amazon Web Services CLI, the file must be in string format and special characters must be ignored. To format the file correctly, Amazon SNS recommends using the following command: <code>SERVICE_JSON=`jq @json <<< cat service.json`</code>.</p> </li> </ul> </li> </ul> <ul> <li> <p> <code>PlatformPrincipal</code> – The principal received from the notification service.</p> <ul> <li> <p>For ADM, <code>PlatformPrincipal</code>is client id.</p> </li> <li> <p>For Apple Services using certificate credentials, <code>PlatformPrincipal</code> is SSL certificate.</p> </li> <li> <p>For Apple Services using token credentials, <code>PlatformPrincipal</code> is signing key ID.</p> </li> <li> <p>For GCM (Firebase Cloud Messaging), there is no <code>PlatformPrincipal</code>. </p> </li> </ul> </li> </ul> <ul> <li> <p> <code>EventEndpointCreated</code> – Topic ARN to which <code>EndpointCreated</code> event notifications are sent.</p> </li> <li> <p> <code>EventEndpointDeleted</code> – Topic ARN to which <code>EndpointDeleted</code> event notifications are sent.</p> </li> <li> <p> <code>EventEndpointUpdated</code> – Topic ARN to which <code>EndpointUpdate</code> event notifications are sent.</p> </li> <li> <p> <code>EventDeliveryFailure</code> – Topic ARN to which <code>DeliveryFailure</code> event notifications are sent upon Direct Publish delivery failure (permanent) to one of the application's endpoints.</p> </li> <li> <p> <code>SuccessFeedbackRoleArn</code> – IAM role ARN used to give Amazon SNS write access to use CloudWatch Logs on your behalf.</p> </li> <li> <p> <code>FailureFeedbackRoleArn</code> – IAM role ARN used to give Amazon SNS write access to use CloudWatch Logs on your behalf.</p> </li> <li> <p> <code>SuccessFeedbackSampleRate</code> – Sample rate percentage (0-100) of successfully delivered messages.</p> </li> </ul> <p>The following attributes only apply to <code>APNs</code> token-based authentication:</p> <ul> <li> <p> <code>ApplePlatformTeamID</code> – The identifier that's assigned to your Apple developer account team.</p> </li> <li> <p> <code>ApplePlatformBundleID</code> – The bundle identifier that's assigned to your iOS app.</p> </li> </ul>

    Raises:
        capo_sns.errors.authorization_error_exception.AuthorizationErrorException: <p>Indicates that the user has been denied access to the requested resource.</p>
        capo_sns.errors.internal_error_exception.InternalErrorException: <p>Indicates an internal service error.</p>
        capo_sns.errors.invalid_parameter_exception.InvalidParameterException: <p>Indicates that a request parameter does not comply with the associated constraints.</p>
        capo_sns.errors.not_found_exception.NotFoundException: <p>Indicates that the requested resource does not exist.</p>
        capo_sns.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sns.types.set_platform_application_attributes_input.SetPlatformApplicationAttributesInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_sns._operations.amazon_simple_notification_service.set_platform_application_attributes

        (
            output,
            http_response,
        ) = await capo_sns._operations.amazon_simple_notification_service.set_platform_application_attributes.async_set_platform_application_attributes(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SetPlatformApplicationAttributes")
    )
    input_: capo_sns.types.set_platform_application_attributes_input.SetPlatformApplicationAttributesInput = {
        "platform_application_arn": platform_application_arn,
        "attributes": attributes,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output