/* * 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 rest-json-test-2016-04-12.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.RestJsonTest.Model; using Amazon.RestJsonTest.Model.Internal.MarshallTransformations; using Amazon.RestJsonTest.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.RestJsonTest { /// /// Implementation for accessing RestJsonTest /// /// /// public partial class AmazonRestJsonTestClient : AmazonServiceClient, IAmazonRestJsonTest { private static IServiceMetadata serviceMetadata = new AmazonRestJsonTestMetadata(); #region Constructors /// /// Constructs AmazonRestJsonTestClient 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 AmazonRestJsonTestClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonRestJsonTestConfig()) { } /// /// Constructs AmazonRestJsonTestClient 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 AmazonRestJsonTestClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonRestJsonTestConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonRestJsonTestClient 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 AmazonRestJsonTestClient Configuration Object public AmazonRestJsonTestClient(AmazonRestJsonTestConfig config) : base(FallbackCredentialsFactory.GetCredentials(config), config){} /// /// Constructs AmazonRestJsonTestClient with AWS Credentials /// /// AWS Credentials public AmazonRestJsonTestClient(AWSCredentials credentials) : this(credentials, new AmazonRestJsonTestConfig()) { } /// /// Constructs AmazonRestJsonTestClient with AWS Credentials /// /// AWS Credentials /// The region to connect. public AmazonRestJsonTestClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonRestJsonTestConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonRestJsonTestClient with AWS Credentials and an /// AmazonRestJsonTestClient Configuration object. /// /// AWS Credentials /// The AmazonRestJsonTestClient Configuration Object public AmazonRestJsonTestClient(AWSCredentials credentials, AmazonRestJsonTestConfig clientConfig) : base(credentials, clientConfig) { } /// /// Constructs AmazonRestJsonTestClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key public AmazonRestJsonTestClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonRestJsonTestConfig()) { } /// /// Constructs AmazonRestJsonTestClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// The region to connect. public AmazonRestJsonTestClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonRestJsonTestConfig() {RegionEndpoint=region}) { } /// /// Constructs AmazonRestJsonTestClient with AWS Access Key ID, AWS Secret Key and an /// AmazonRestJsonTestClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// The AmazonRestJsonTestClient Configuration Object public AmazonRestJsonTestClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonRestJsonTestConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// /// Constructs AmazonRestJsonTestClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token public AmazonRestJsonTestClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonRestJsonTestConfig()) { } /// /// Constructs AmazonRestJsonTestClient 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 AmazonRestJsonTestClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonRestJsonTestConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonRestJsonTestClient with AWS Access Key ID, AWS Secret Key and an /// AmazonRestJsonTestClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The AmazonRestJsonTestClient Configuration Object public AmazonRestJsonTestClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonRestJsonTestConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig) { } #endregion #region Overrides /// /// Creates the signer for the service. /// protected override AbstractAWSSigner CreateSigner() { return new AWS4Signer(); } /// /// 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 NoPayload internal virtual NoPayloadResponse NoPayload(NoPayloadRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = NoPayloadRequestMarshaller.Instance; options.ResponseUnmarshaller = NoPayloadResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Request without a body /// /// Container for the necessary parameters to execute the NoPayload service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the NoPayload service method, as returned by RestJsonTest. /// REST API Reference for NoPayload Operation public virtual Task NoPayloadAsync(NoPayloadRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = NoPayloadRequestMarshaller.Instance; options.ResponseUnmarshaller = NoPayloadResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region TestBlobPayload internal virtual TestBlobPayloadResponse TestBlobPayload(TestBlobPayloadRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = TestBlobPayloadRequestMarshaller.Instance; options.ResponseUnmarshaller = TestBlobPayloadResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Post a test blob payload request. /// /// Container for the necessary parameters to execute the TestBlobPayload service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the TestBlobPayload service method, as returned by RestJsonTest. /// REST API Reference for TestBlobPayload Operation public virtual Task TestBlobPayloadAsync(TestBlobPayloadRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = TestBlobPayloadRequestMarshaller.Instance; options.ResponseUnmarshaller = TestBlobPayloadResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region TestBody internal virtual TestBodyResponse TestBody(TestBodyRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = TestBodyRequestMarshaller.Instance; options.ResponseUnmarshaller = TestBodyResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Post a test body request. /// /// Container for the necessary parameters to execute the TestBody service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the TestBody service method, as returned by RestJsonTest. /// REST API Reference for TestBody Operation public virtual Task TestBodyAsync(TestBodyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = TestBodyRequestMarshaller.Instance; options.ResponseUnmarshaller = TestBodyResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region TestPayload internal virtual TestPayloadResponse TestPayload(TestPayloadRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = TestPayloadRequestMarshaller.Instance; options.ResponseUnmarshaller = TestPayloadResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Post a test payload request. /// /// Container for the necessary parameters to execute the TestPayload service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the TestPayload service method, as returned by RestJsonTest. /// REST API Reference for TestPayload Operation public virtual Task TestPayloadAsync(TestPayloadRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = TestPayloadRequestMarshaller.Instance; options.ResponseUnmarshaller = TestPayloadResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion } }