/* * 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 apigatewaymanagementapi-2018-11-29.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.ApiGatewayManagementApi.Model; using Amazon.ApiGatewayManagementApi.Model.Internal.MarshallTransformations; using Amazon.ApiGatewayManagementApi.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.ApiGatewayManagementApi { /// /// Implementation for accessing ApiGatewayManagementApi /// /// The Amazon API Gateway Management API allows you to directly manage runtime aspects /// of your deployed APIs. To use it, you must explicitly set the SDK's endpoint to point /// to the endpoint of your deployed API. The endpoint will be of the form https://{api-id}.execute-api.{region}.amazonaws.com/{stage}, /// or will be the endpoint corresponding to your API's custom domain and base path, if /// applicable. /// public partial class AmazonApiGatewayManagementApiClient : AmazonServiceClient, IAmazonApiGatewayManagementApi { private static IServiceMetadata serviceMetadata = new AmazonApiGatewayManagementApiMetadata(); #region Constructors /// /// Constructs AmazonApiGatewayManagementApiClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// public AmazonApiGatewayManagementApiClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonApiGatewayManagementApiConfig()) { } /// /// Constructs AmazonApiGatewayManagementApiClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// /// The region to connect. public AmazonApiGatewayManagementApiClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonApiGatewayManagementApiConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonApiGatewayManagementApiClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// /// The AmazonApiGatewayManagementApiClient Configuration Object public AmazonApiGatewayManagementApiClient(AmazonApiGatewayManagementApiConfig config) : base(FallbackCredentialsFactory.GetCredentials(config), config){} /// /// Constructs AmazonApiGatewayManagementApiClient with AWS Credentials /// /// AWS Credentials public AmazonApiGatewayManagementApiClient(AWSCredentials credentials) : this(credentials, new AmazonApiGatewayManagementApiConfig()) { } /// /// Constructs AmazonApiGatewayManagementApiClient with AWS Credentials /// /// AWS Credentials /// The region to connect. public AmazonApiGatewayManagementApiClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonApiGatewayManagementApiConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonApiGatewayManagementApiClient with AWS Credentials and an /// AmazonApiGatewayManagementApiClient Configuration object. /// /// AWS Credentials /// The AmazonApiGatewayManagementApiClient Configuration Object public AmazonApiGatewayManagementApiClient(AWSCredentials credentials, AmazonApiGatewayManagementApiConfig clientConfig) : base(credentials, clientConfig) { } /// /// Constructs AmazonApiGatewayManagementApiClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key public AmazonApiGatewayManagementApiClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonApiGatewayManagementApiConfig()) { } /// /// Constructs AmazonApiGatewayManagementApiClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// The region to connect. public AmazonApiGatewayManagementApiClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonApiGatewayManagementApiConfig() {RegionEndpoint=region}) { } /// /// Constructs AmazonApiGatewayManagementApiClient with AWS Access Key ID, AWS Secret Key and an /// AmazonApiGatewayManagementApiClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// The AmazonApiGatewayManagementApiClient Configuration Object public AmazonApiGatewayManagementApiClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonApiGatewayManagementApiConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// /// Constructs AmazonApiGatewayManagementApiClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token public AmazonApiGatewayManagementApiClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonApiGatewayManagementApiConfig()) { } /// /// Constructs AmazonApiGatewayManagementApiClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The region to connect. public AmazonApiGatewayManagementApiClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonApiGatewayManagementApiConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonApiGatewayManagementApiClient with AWS Access Key ID, AWS Secret Key and an /// AmazonApiGatewayManagementApiClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The AmazonApiGatewayManagementApiClient Configuration Object public AmazonApiGatewayManagementApiClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonApiGatewayManagementApiConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig) { } #endregion #region Overrides /// /// Creates the signer for the service. /// protected override AbstractAWSSigner CreateSigner() { return new AWS4Signer(); } /// /// Customize the pipeline /// /// protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline) { pipeline.RemoveHandler(); pipeline.AddHandlerAfter(new AmazonApiGatewayManagementApiEndpointResolver()); } /// /// 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 DeleteConnection /// /// Delete the connection with the provided id. /// /// Container for the necessary parameters to execute the DeleteConnection service method. /// /// The response from the DeleteConnection service method, as returned by ApiGatewayManagementApi. /// /// The caller is not authorized to invoke this operation. /// /// /// The connection with the provided id no longer exists. /// /// /// The client is sending more than the allowed number of requests per unit of time or /// the WebSocket client side buffer is full. /// /// REST API Reference for DeleteConnection Operation public virtual DeleteConnectionResponse DeleteConnection(DeleteConnectionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteConnectionResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Delete the connection with the provided id. /// /// Container for the necessary parameters to execute the DeleteConnection service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the DeleteConnection service method, as returned by ApiGatewayManagementApi. /// /// The caller is not authorized to invoke this operation. /// /// /// The connection with the provided id no longer exists. /// /// /// The client is sending more than the allowed number of requests per unit of time or /// the WebSocket client side buffer is full. /// /// REST API Reference for DeleteConnection Operation public virtual Task DeleteConnectionAsync(DeleteConnectionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteConnectionResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region GetConnection /// /// Get information about the connection with the provided id. /// /// Container for the necessary parameters to execute the GetConnection service method. /// /// The response from the GetConnection service method, as returned by ApiGatewayManagementApi. /// /// The caller is not authorized to invoke this operation. /// /// /// The connection with the provided id no longer exists. /// /// /// The client is sending more than the allowed number of requests per unit of time or /// the WebSocket client side buffer is full. /// /// REST API Reference for GetConnection Operation public virtual GetConnectionResponse GetConnection(GetConnectionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = GetConnectionResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Get information about the connection with the provided id. /// /// Container for the necessary parameters to execute the GetConnection service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the GetConnection service method, as returned by ApiGatewayManagementApi. /// /// The caller is not authorized to invoke this operation. /// /// /// The connection with the provided id no longer exists. /// /// /// The client is sending more than the allowed number of requests per unit of time or /// the WebSocket client side buffer is full. /// /// REST API Reference for GetConnection Operation public virtual Task GetConnectionAsync(GetConnectionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = GetConnectionResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region PostToConnection /// /// Sends the provided data to the specified connection. /// /// Container for the necessary parameters to execute the PostToConnection service method. /// /// The response from the PostToConnection service method, as returned by ApiGatewayManagementApi. /// /// The caller is not authorized to invoke this operation. /// /// /// The connection with the provided id no longer exists. /// /// /// The client is sending more than the allowed number of requests per unit of time or /// the WebSocket client side buffer is full. /// /// /// The data has exceeded the maximum size allowed. /// /// REST API Reference for PostToConnection Operation public virtual PostToConnectionResponse PostToConnection(PostToConnectionRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PostToConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = PostToConnectionResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Sends the provided data to the specified connection. /// /// Container for the necessary parameters to execute the PostToConnection service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the PostToConnection service method, as returned by ApiGatewayManagementApi. /// /// The caller is not authorized to invoke this operation. /// /// /// The connection with the provided id no longer exists. /// /// /// The client is sending more than the allowed number of requests per unit of time or /// the WebSocket client side buffer is full. /// /// /// The data has exceeded the maximum size allowed. /// /// REST API Reference for PostToConnection Operation public virtual Task PostToConnectionAsync(PostToConnectionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PostToConnectionRequestMarshaller.Instance; options.ResponseUnmarshaller = PostToConnectionResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion } }