/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the iot-data-2015-05-28.normal.json service model. */ using System; using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using System.Net; using Amazon.IotData.Model; using Amazon.IotData.Model.Internal.MarshallTransformations; using Amazon.IotData.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.IotData { /// /// Implementation for accessing IotData /// /// IoT data /// /// IoT data enables secure, bi-directional communication between Internet-connected things /// (such as sensors, actuators, embedded devices, or smart appliances) and the Amazon /// Web Services cloud. It implements a broker for applications and things to publish /// messages over HTTP (Publish) and retrieve, update, and delete shadows. A shadow is /// a persistent representation of your things and their state in the Amazon Web Services /// cloud. /// /// /// /// Find the endpoint address for actions in IoT data by running this CLI command: /// /// /// /// aws iot describe-endpoint --endpoint-type iot:Data-ATS /// /// /// /// The service name used by Amazon /// Web ServicesSignature Version 4 to sign requests is: iotdevicegateway. /// /// public partial class AmazonIotDataClient : AmazonServiceClient, IAmazonIotData { private static IServiceMetadata serviceMetadata = new AmazonIotDataMetadata(); #if AWS_ASYNC_ENUMERABLES_API private IIotDataPaginatorFactory _paginators; /// /// Paginators for the service /// public IIotDataPaginatorFactory Paginators { get { if (this._paginators == null) { this._paginators = new IotDataPaginatorFactory(this); } return this._paginators; } } #endif #region Overrides /// /// Creates the signer for the service. /// protected override AbstractAWSSigner CreateSigner() { return new AWS4Signer(); } /// /// Customizes the runtime pipeline. /// /// Runtime pipeline for the current client. protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline) { pipeline.RemoveHandler(); pipeline.AddHandlerAfter(new AmazonIotDataEndpointResolver()); } /// /// Capture metadata for the service. /// protected override IServiceMetadata ServiceMetadata { get { return serviceMetadata; } } #endregion #region Dispose /// /// Disposes the service client. /// protected override void Dispose(bool disposing) { base.Dispose(disposing); } #endregion #region DeleteThingShadow internal virtual DeleteThingShadowResponse DeleteThingShadow(DeleteThingShadowRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteThingShadowRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteThingShadowResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Deletes the shadow for the specified thing. /// /// /// /// Requires permission to access the DeleteThingShadow /// action. /// /// /// /// For more information, see DeleteThingShadow /// in the IoT Developer Guide. /// /// /// Container for the necessary parameters to execute the DeleteThingShadow service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the DeleteThingShadow service method, as returned by IotData. /// /// An unexpected error has occurred. /// /// /// The request is not valid. /// /// /// The specified combination of HTTP verb and URI is not supported. /// /// /// The specified resource does not exist. /// /// /// The service is temporarily unavailable. /// /// /// The rate exceeds the limit. /// /// /// You are not authorized to perform this operation. /// /// /// The document encoding is not supported. /// /// REST API Reference for DeleteThingShadow Operation public virtual Task DeleteThingShadowAsync(DeleteThingShadowRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteThingShadowRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteThingShadowResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region GetRetainedMessage internal virtual GetRetainedMessageResponse GetRetainedMessage(GetRetainedMessageRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetRetainedMessageRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRetainedMessageResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Gets the details of a single retained message for the specified topic. /// /// /// /// This action returns the message payload of the retained message, which can incur messaging /// costs. To list only the topic names of the retained messages, call ListRetainedMessages. /// /// /// /// Requires permission to access the GetRetainedMessage /// action. /// /// /// /// For more information about messaging costs, see Amazon /// Web Services IoT Core pricing - Messaging. /// /// /// Container for the necessary parameters to execute the GetRetainedMessage service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the GetRetainedMessage service method, as returned by IotData. /// /// An unexpected error has occurred. /// /// /// The request is not valid. /// /// /// The specified combination of HTTP verb and URI is not supported. /// /// /// The specified resource does not exist. /// /// /// The service is temporarily unavailable. /// /// /// The rate exceeds the limit. /// /// /// You are not authorized to perform this operation. /// /// REST API Reference for GetRetainedMessage Operation public virtual Task GetRetainedMessageAsync(GetRetainedMessageRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetRetainedMessageRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRetainedMessageResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region GetThingShadow internal virtual GetThingShadowResponse GetThingShadow(GetThingShadowRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetThingShadowRequestMarshaller.Instance; options.ResponseUnmarshaller = GetThingShadowResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Gets the shadow for the specified thing. /// /// /// /// Requires permission to access the GetThingShadow /// action. /// /// /// /// For more information, see GetThingShadow /// in the IoT Developer Guide. /// /// /// Container for the necessary parameters to execute the GetThingShadow service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the GetThingShadow service method, as returned by IotData. /// /// An unexpected error has occurred. /// /// /// The request is not valid. /// /// /// The specified combination of HTTP verb and URI is not supported. /// /// /// The specified resource does not exist. /// /// /// The service is temporarily unavailable. /// /// /// The rate exceeds the limit. /// /// /// You are not authorized to perform this operation. /// /// /// The document encoding is not supported. /// /// REST API Reference for GetThingShadow Operation public virtual Task GetThingShadowAsync(GetThingShadowRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetThingShadowRequestMarshaller.Instance; options.ResponseUnmarshaller = GetThingShadowResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region ListNamedShadowsForThing internal virtual ListNamedShadowsForThingResponse ListNamedShadowsForThing(ListNamedShadowsForThingRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListNamedShadowsForThingRequestMarshaller.Instance; options.ResponseUnmarshaller = ListNamedShadowsForThingResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Lists the shadows for the specified thing. /// /// /// /// Requires permission to access the ListNamedShadowsForThing /// action. /// /// /// Container for the necessary parameters to execute the ListNamedShadowsForThing service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the ListNamedShadowsForThing service method, as returned by IotData. /// /// An unexpected error has occurred. /// /// /// The request is not valid. /// /// /// The specified combination of HTTP verb and URI is not supported. /// /// /// The specified resource does not exist. /// /// /// The service is temporarily unavailable. /// /// /// The rate exceeds the limit. /// /// /// You are not authorized to perform this operation. /// /// REST API Reference for ListNamedShadowsForThing Operation public virtual Task ListNamedShadowsForThingAsync(ListNamedShadowsForThingRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListNamedShadowsForThingRequestMarshaller.Instance; options.ResponseUnmarshaller = ListNamedShadowsForThingResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region ListRetainedMessages internal virtual ListRetainedMessagesResponse ListRetainedMessages(ListRetainedMessagesRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListRetainedMessagesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListRetainedMessagesResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Lists summary information about the retained messages stored for the account. /// /// /// /// This action returns only the topic names of the retained messages. It doesn't return /// any message payloads. Although this action doesn't return a message payload, it can /// still incur messaging costs. /// /// /// /// To get the message payload of a retained message, call GetRetainedMessage /// with the topic name of the retained message. /// /// /// /// Requires permission to access the ListRetainedMessages /// action. /// /// /// /// For more information about messaging costs, see Amazon /// Web Services IoT Core pricing - Messaging. /// /// /// Container for the necessary parameters to execute the ListRetainedMessages service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the ListRetainedMessages service method, as returned by IotData. /// /// An unexpected error has occurred. /// /// /// The request is not valid. /// /// /// The specified combination of HTTP verb and URI is not supported. /// /// /// The service is temporarily unavailable. /// /// /// The rate exceeds the limit. /// /// /// You are not authorized to perform this operation. /// /// REST API Reference for ListRetainedMessages Operation public virtual Task ListRetainedMessagesAsync(ListRetainedMessagesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListRetainedMessagesRequestMarshaller.Instance; options.ResponseUnmarshaller = ListRetainedMessagesResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region Publish internal virtual PublishResponse Publish(PublishRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PublishRequestMarshaller.Instance; options.ResponseUnmarshaller = PublishResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Publishes an MQTT message. /// /// /// /// Requires permission to access the Publish /// action. /// /// /// /// For more information about MQTT messages, see MQTT /// Protocol in the IoT Developer Guide. /// /// /// /// For more information about messaging costs, see Amazon /// Web Services IoT Core pricing - Messaging. /// /// /// Container for the necessary parameters to execute the Publish service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the Publish service method, as returned by IotData. /// /// An unexpected error has occurred. /// /// /// The request is not valid. /// /// /// The specified combination of HTTP verb and URI is not supported. /// /// /// The rate exceeds the limit. /// /// /// You are not authorized to perform this operation. /// /// REST API Reference for Publish Operation public virtual Task PublishAsync(PublishRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PublishRequestMarshaller.Instance; options.ResponseUnmarshaller = PublishResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region UpdateThingShadow internal virtual UpdateThingShadowResponse UpdateThingShadow(UpdateThingShadowRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateThingShadowRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateThingShadowResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Updates the shadow for the specified thing. /// /// /// /// Requires permission to access the UpdateThingShadow /// action. /// /// /// /// For more information, see UpdateThingShadow /// in the IoT Developer Guide. /// /// /// Container for the necessary parameters to execute the UpdateThingShadow service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the UpdateThingShadow service method, as returned by IotData. /// /// The specified version does not match the version of the document. /// /// /// An unexpected error has occurred. /// /// /// The request is not valid. /// /// /// The specified combination of HTTP verb and URI is not supported. /// /// /// The payload exceeds the maximum size allowed. /// /// /// The service is temporarily unavailable. /// /// /// The rate exceeds the limit. /// /// /// You are not authorized to perform this operation. /// /// /// The document encoding is not supported. /// /// REST API Reference for UpdateThingShadow Operation public virtual Task UpdateThingShadowAsync(UpdateThingShadowRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateThingShadowRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateThingShadowResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion } }