Struct aws_sdk_sns::client::fluent_builders::CreatePlatformEndpoint
source · pub struct CreatePlatformEndpoint { /* private fields */ }
Expand description
Fluent builder constructing a request to CreatePlatformEndpoint
.
Creates an endpoint for a device and mobile app on one of the supported push notification services, such as GCM (Firebase Cloud Messaging) and APNS. CreatePlatformEndpoint
requires the PlatformApplicationArn
that is returned from CreatePlatformApplication
. You can use the returned EndpointArn
to send a message to a mobile app or by the Subscribe
action for subscription to a topic. The CreatePlatformEndpoint
action is idempotent, so if the requester already owns an endpoint with the same device token and attributes, that endpoint's ARN is returned without creating a new endpoint. For more information, see Using Amazon SNS Mobile Push Notifications.
When using CreatePlatformEndpoint
with Baidu, two attributes must be provided: ChannelId and UserId. The token field must also contain the ChannelId. For more information, see Creating an Amazon SNS Endpoint for Baidu.
Implementations§
source§impl CreatePlatformEndpoint
impl CreatePlatformEndpoint
sourcepub async fn customize(
self
) -> Result<CustomizableOperation<CreatePlatformEndpoint, AwsResponseRetryClassifier>, SdkError<CreatePlatformEndpointError>>
pub async fn customize(
self
) -> Result<CustomizableOperation<CreatePlatformEndpoint, AwsResponseRetryClassifier>, SdkError<CreatePlatformEndpointError>>
Consume this builder, creating a customizable operation that can be modified before being sent. The operation’s inner http::Request can be modified as well.
sourcepub async fn send(
self
) -> Result<CreatePlatformEndpointOutput, SdkError<CreatePlatformEndpointError>>
pub async fn send(
self
) -> Result<CreatePlatformEndpointOutput, SdkError<CreatePlatformEndpointError>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn platform_application_arn(self, input: impl Into<String>) -> Self
pub fn platform_application_arn(self, input: impl Into<String>) -> Self
PlatformApplicationArn returned from CreatePlatformApplication is used to create a an endpoint.
sourcepub fn set_platform_application_arn(self, input: Option<String>) -> Self
pub fn set_platform_application_arn(self, input: Option<String>) -> Self
PlatformApplicationArn returned from CreatePlatformApplication is used to create a an endpoint.
sourcepub fn token(self, input: impl Into<String>) -> Self
pub fn token(self, input: impl Into<String>) -> Self
Unique identifier created by the notification service for an app on a device. The specific name for Token will vary, depending on which notification service is being used. For example, when using APNS as the notification service, you need the device token. Alternatively, when using GCM (Firebase Cloud Messaging) or ADM, the device token equivalent is called the registration ID.
sourcepub fn set_token(self, input: Option<String>) -> Self
pub fn set_token(self, input: Option<String>) -> Self
Unique identifier created by the notification service for an app on a device. The specific name for Token will vary, depending on which notification service is being used. For example, when using APNS as the notification service, you need the device token. Alternatively, when using GCM (Firebase Cloud Messaging) or ADM, the device token equivalent is called the registration ID.
sourcepub fn custom_user_data(self, input: impl Into<String>) -> Self
pub fn custom_user_data(self, input: impl Into<String>) -> Self
Arbitrary user data to associate with the endpoint. Amazon SNS does not use this data. The data must be in UTF-8 format and less than 2KB.
sourcepub fn set_custom_user_data(self, input: Option<String>) -> Self
pub fn set_custom_user_data(self, input: Option<String>) -> Self
Arbitrary user data to associate with the endpoint. Amazon SNS does not use this data. The data must be in UTF-8 format and less than 2KB.
sourcepub fn attributes(self, k: impl Into<String>, v: impl Into<String>) -> Self
pub fn attributes(self, k: impl Into<String>, v: impl Into<String>) -> Self
Adds a key-value pair to Attributes
.
To override the contents of this collection use set_attributes
.
For a list of attributes, see SetEndpointAttributes.
sourcepub fn set_attributes(self, input: Option<HashMap<String, String>>) -> Self
pub fn set_attributes(self, input: Option<HashMap<String, String>>) -> Self
For a list of attributes, see SetEndpointAttributes.
Trait Implementations§
source§impl Clone for CreatePlatformEndpoint
impl Clone for CreatePlatformEndpoint
source§fn clone(&self) -> CreatePlatformEndpoint
fn clone(&self) -> CreatePlatformEndpoint
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more