fn publish(&self, input: PublishInput) -> RusotoFuture<PublishResponse, PublishError> {
        let mut request = SignedRequest::new("POST", "sns", &self.region, "/");
        let mut params = Params::new();

        params.put("Action", "Publish");
        params.put("Version", "2010-03-31");
        PublishInputSerializer::serialize(&mut params, "", &input);
        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
        request.set_content_type("application/x-www-form-urlencoded".to_owned());

        self.client.sign_and_dispatch(request, |response| {
            if !response.status.is_success() {
                return Box::new(
                    response
                        .buffer()
                        .from_err()
                        .and_then(|response| Err(PublishError::from_response(response))),
                );
            }

            Box::new(response.buffer().from_err().and_then(move |response| {
                let result;

                if response.body.is_empty() {
                    result = PublishResponse::default();
                } else {
                    let reader = EventReader::new_with_config(
                        response.body.as_ref(),
                        ParserConfig::new().trim_whitespace(true),
                    );
                    let mut stack = XmlResponse::new(reader.into_iter().peekable());
                    let _start_document = stack.next();
                    let actual_tag_name = peek_at_name(&mut stack)?;
                    start_element(&actual_tag_name, &mut stack)?;
                    result = PublishResponseDeserializer::deserialize("PublishResult", &mut stack)?;
                    skip_tree(&mut stack);
                    end_element(&actual_tag_name, &mut stack)?;
                }
                // parse non-payload
                Ok(result)
            }))
        })
    }
/// <p>Sends a message to an Amazon SNS topic or sends a text message (SMS message) directly to a phone number. </p> <p>If you send a message to a topic, Amazon SNS delivers the message to each endpoint that is subscribed to the topic. The format of the message depends on the notification protocol for each subscribed endpoint.</p> <p>When a <code>messageId</code> is returned, the message has been saved and Amazon SNS will attempt to deliver it shortly.</p> <p>To use the <code>Publish</code> action for sending a message to a mobile endpoint, such as an app on a Kindle device or mobile phone, you must specify the EndpointArn for the TargetArn parameter. The EndpointArn is returned when making a call with the <code>CreatePlatformEndpoint</code> action. </p> <p>For more information about formatting messages, see <a href="https://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-custommessage.html">Send Custom Platform-Specific Payloads in Messages to Mobile Devices</a>. </p>
Sends a message to an Amazon SNS topic or sends a text message (SMS message) directly to a phone number.  If you send a message to a topic, Amazon SNS delivers the message to each endpoint that is subscribed to the topic. The format of the message depends on the notification protocol for each subscribed endpoint. When a messageId is returned, the message has been saved and Amazon SNS will attempt to deliver it shortly. To use the Publish action for sending a message to a mobile endpoint, such as an app on a Kindle device or mobile phone, you must specify the EndpointArn for the TargetArn parameter. The EndpointArn is returned when making a call with the CreatePlatformEndpoint action.  For more information about formatting messages, see Send Custom Platform-Specific Payloads in Messages to Mobile Devices.
Sends a message to an Amazon SNS topic or sends a text message ( SMS message ) directly to a phone number . If you send a message to a topic Amazon SNS delivers the message to each endpoint that is subscribed to the topic . The format of the message depends on the notification protocol for each subscribed endpoint . When a messageId is returned the message has been saved and Amazon SNS will attempt to deliver it shortly . To use the Publish action for sending a message to a mobile endpoint such as an app on a Kindle device or mobile phone you must specify the EndpointArn for the TargetArn parameter . The EndpointArn is returned when making a call with the CreatePlatformEndpoint action . For more information about formatting messages see Send Custom Platform - Specific Payloads in Messages to Mobile Devices .
fn publish(&self, input: PublishInput) -> RusotoFuture<PublishResponse, PublishError> {
        let mut request = SignedRequest::new("POST", "sns", &self.region, "/");
        let mut params = Params::new();
        params.put("Action", "Publish");
        params.put("Version", "2010-03-31");
        PublishInputSerializer::serialize(&mut params, "", &input);
        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
        request.set_content_type("application/x-www-form-urlencoded".to_owned());
        self.client.sign_and_dispatch(request, |response| {
            if !response.status.is_success() {
                return Box::new(
                    response
                        .buffer()
                        .from_err()
                        .and_then(|response| Err(PublishError::from_response(response))),
                );
            }
            Box::new(response.buffer().from_err().and_then(move |response| {
                let result;
                if response.body.is_empty() {
                    result = PublishResponse::default();
                } else {
                    let reader = EventReader::new_with_config(
                        response.body.as_ref(),
                        ParserConfig::new().trim_whitespace(true),
                    );
                    let mut stack = XmlResponse::new(reader.into_iter().peekable());
                    let _start_document = stack.next();
                    let actual_tag_name = peek_at_name(&mut stack)?;
                    start_element(&actual_tag_name, &mut stack)?;
                    result = PublishResponseDeserializer::deserialize("PublishResult", &mut stack)?;
                    skip_tree(&mut stack);
                    end_element(&actual_tag_name, &mut stack)?;
                }
                // parse non-payload
                Ok(result)
            }))
        })
    }
fn publish ( & self , input : PublishInput ) -> RusotoFuture < PublishResponse , PublishError > { let mut request = SignedRequest :: new ( " " , " " , & self . region , " " ) ; let mut params = Params :: new ( ) ; params . put ( " " , " " ) ; params . put ( " " , " " ) ; PublishInputSerializer :: serialize ( & mut params , " " , & input ) ; request . set_payload ( Some ( serde_urlencoded :: to_string ( & params ) . unwrap ( ) ) ) ; request . set_content_type ( " " . to_owned ( ) ) ; self . client . sign_and_dispatch ( request , | response | { if ! response . status . is_success ( ) { return Box :: new ( response . buffer ( ) . from_err ( ) . and_then ( | response | Err ( PublishError :: from_response ( response ) ) ) , ) ; } Box :: new ( response . buffer ( ) . from_err ( ) . and_then ( move | response | { let result ; if response . body . is_empty ( ) { result = PublishResponse :: default ( ) ; } else { let reader = EventReader :: new_with_config ( response . body . as_ref ( ) , ParserConfig :: new ( ) . trim_whitespace ( true ) , ) ; let mut stack = XmlResponse :: new ( reader . into_iter ( ) . peekable ( ) ) ; let _start_document = stack . next ( ) ; let actual_tag_name = peek_at_name ( & mut stack ) ? ; start_element ( & actual_tag_name , & mut stack ) ? ; result = PublishResponseDeserializer :: deserialize ( " " , & mut stack ) ? ; skip_tree ( & mut stack ) ; end_element ( & actual_tag_name , & mut stack ) ? ; } // parse non-payload Ok ( result ) } ) ) } ) }
<p>Sends a message to an Amazon SNS topic or sends a text message (SMS message) directly to a phone number.
<p > Sends a message to an Amazon SNS topic or sends a text message ( SMS message ) directly to a phone number .
&self
input
PublishInput