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
sourceimpl CreatePlatformEndpoint
impl CreatePlatformEndpoint
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
sourceimpl Clone for CreatePlatformEndpoint
impl Clone for CreatePlatformEndpoint
sourcefn clone(&self) -> CreatePlatformEndpoint
fn clone(&self) -> CreatePlatformEndpoint
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl !RefUnwindSafe for CreatePlatformEndpoint
impl Send for CreatePlatformEndpoint
impl Sync for CreatePlatformEndpoint
impl Unpin for CreatePlatformEndpoint
impl !UnwindSafe for CreatePlatformEndpoint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more