Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient.SetEndpointAttributes C# (CSharp) Method

SetEndpointAttributes() public method

Sets the attributes for an endpoint for a device on one of the supported push notification services, such as GCM and APNS. For more information, see Using Amazon SNS Mobile Push Notifications.
/// Indicates that the user has been denied access to the requested resource. /// /// Indicates an internal service error. /// /// Indicates that a request parameter does not comply with the associated constraints. /// /// Indicates that the requested resource does not exist. ///
public SetEndpointAttributes ( SetEndpointAttributesRequest request ) : SetEndpointAttributesResponse
request SetEndpointAttributesRequest Container for the necessary parameters to execute the SetEndpointAttributes service method.
return SetEndpointAttributesResponse
        public SetEndpointAttributesResponse SetEndpointAttributes(SetEndpointAttributesRequest request)
        {
            var marshaller = new SetEndpointAttributesRequestMarshaller();
            var unmarshaller = SetEndpointAttributesResponseUnmarshaller.Instance;

            return Invoke<SetEndpointAttributesRequest,SetEndpointAttributesResponse>(request, marshaller, unmarshaller);
        }

Usage Example

        public void SetEndpointAttribute(string endpointarn, string key, string value)
        {
            try
            {

                var endpoint = GetEndpoint(string.Empty, endpointarn);

                if (string.IsNullOrEmpty(endpoint)) throw new ArgumentNullException("endpointarn");

                Dictionary<string, string> attributes = (Dictionary<string, string>) GetEndpointAttributes(endpointarn);

                attributes[key] = value;

                using (var snsclient = new AmazonSimpleNotificationServiceClient(_accesskey, _secretkey))
                {
                    var result = snsclient.SetEndpointAttributes(new SetEndpointAttributesRequest()
                    {
                        EndpointArn = endpointarn,
                        Attributes = attributes
                    });

                }
            }
            catch (Exception ex)
            {
                throw new Exception("SetEndpointAttribute " + ex.Message);
            }
        }
All Usage Examples Of Amazon.SimpleNotificationService.AmazonSimpleNotificationServiceClient::SetEndpointAttributes
AmazonSimpleNotificationServiceClient