/* * 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 bearer-token-auth-test-2022-03-21.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.BearerTokenAuthTest.Model; using Amazon.BearerTokenAuthTest.Model.Internal.MarshallTransformations; using Amazon.BearerTokenAuthTest.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.BearerTokenAuthTest { /// /// Implementation for accessing BearerTokenAuthTest /// /// /// public partial class AmazonBearerTokenAuthTestClient : AmazonServiceClient, IAmazonBearerTokenAuthTest { private static IServiceMetadata serviceMetadata = new AmazonBearerTokenAuthTestMetadata(); #region Constructors /// /// Constructs AmazonBearerTokenAuthTestClient 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 AmazonBearerTokenAuthTestClient() : base(FallbackCredentialsFactory.GetCredentials(fallbackToAnonymous: true), new AmazonBearerTokenAuthTestConfig()) { } /// /// Constructs AmazonBearerTokenAuthTestClient 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 AmazonBearerTokenAuthTestClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(fallbackToAnonymous: true), new AmazonBearerTokenAuthTestConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonBearerTokenAuthTestClient 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 AmazonBearerTokenAuthTestClient Configuration Object public AmazonBearerTokenAuthTestClient(AmazonBearerTokenAuthTestConfig config) : base(FallbackCredentialsFactory.GetCredentials(config, fallbackToAnonymous: true), config){} /// /// Constructs AmazonBearerTokenAuthTestClient with AWS Credentials /// /// AWS Credentials public AmazonBearerTokenAuthTestClient(AWSCredentials credentials) : this(credentials, new AmazonBearerTokenAuthTestConfig()) { } /// /// Constructs AmazonBearerTokenAuthTestClient with AWS Credentials /// /// AWS Credentials /// The region to connect. public AmazonBearerTokenAuthTestClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonBearerTokenAuthTestConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonBearerTokenAuthTestClient with AWS Credentials and an /// AmazonBearerTokenAuthTestClient Configuration object. /// /// AWS Credentials /// The AmazonBearerTokenAuthTestClient Configuration Object public AmazonBearerTokenAuthTestClient(AWSCredentials credentials, AmazonBearerTokenAuthTestConfig clientConfig) : base(credentials, clientConfig) { } /// /// Constructs AmazonBearerTokenAuthTestClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key public AmazonBearerTokenAuthTestClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonBearerTokenAuthTestConfig()) { } /// /// Constructs AmazonBearerTokenAuthTestClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// The region to connect. public AmazonBearerTokenAuthTestClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonBearerTokenAuthTestConfig() {RegionEndpoint=region}) { } /// /// Constructs AmazonBearerTokenAuthTestClient with AWS Access Key ID, AWS Secret Key and an /// AmazonBearerTokenAuthTestClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// The AmazonBearerTokenAuthTestClient Configuration Object public AmazonBearerTokenAuthTestClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonBearerTokenAuthTestConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// /// Constructs AmazonBearerTokenAuthTestClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token public AmazonBearerTokenAuthTestClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonBearerTokenAuthTestConfig()) { } /// /// Constructs AmazonBearerTokenAuthTestClient 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 AmazonBearerTokenAuthTestClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonBearerTokenAuthTestConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonBearerTokenAuthTestClient with AWS Access Key ID, AWS Secret Key and an /// AmazonBearerTokenAuthTestClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The AmazonBearerTokenAuthTestClient Configuration Object public AmazonBearerTokenAuthTestClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonBearerTokenAuthTestConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig) { } #endregion #region Overrides /// /// Creates the signer for the service. /// protected override AbstractAWSSigner CreateSigner() { return new BearerTokenSigner(); } /// /// 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 InheritBearerAuthOperation /// /// Request that inherits the bearer signature version set at the Service /// /// Container for the necessary parameters to execute the InheritBearerAuthOperation service method. /// /// The response from the InheritBearerAuthOperation service method, as returned by BearerTokenAuthTest. /// REST API Reference for InheritBearerAuthOperation Operation public virtual InheritBearerAuthOperationResponse InheritBearerAuthOperation(InheritBearerAuthOperationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = InheritBearerAuthOperationRequestMarshaller.Instance; options.ResponseUnmarshaller = InheritBearerAuthOperationResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Request that inherits the bearer signature version set at the Service /// /// Container for the necessary parameters to execute the InheritBearerAuthOperation service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the InheritBearerAuthOperation service method, as returned by BearerTokenAuthTest. /// REST API Reference for InheritBearerAuthOperation Operation public virtual Task InheritBearerAuthOperationAsync(InheritBearerAuthOperationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = InheritBearerAuthOperationRequestMarshaller.Instance; options.ResponseUnmarshaller = InheritBearerAuthOperationResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region OverrideAuthToSigV4Operation /// /// An operation that overrides auth to Sigv4. /// /// Container for the necessary parameters to execute the OverrideAuthToSigV4Operation service method. /// /// The response from the OverrideAuthToSigV4Operation service method, as returned by BearerTokenAuthTest. /// REST API Reference for OverrideAuthToSigV4Operation Operation public virtual OverrideAuthToSigV4OperationResponse OverrideAuthToSigV4Operation(OverrideAuthToSigV4OperationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = OverrideAuthToSigV4OperationRequestMarshaller.Instance; options.ResponseUnmarshaller = OverrideAuthToSigV4OperationResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// An operation that overrides auth to Sigv4. /// /// Container for the necessary parameters to execute the OverrideAuthToSigV4Operation service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the OverrideAuthToSigV4Operation service method, as returned by BearerTokenAuthTest. /// REST API Reference for OverrideAuthToSigV4Operation Operation public virtual Task OverrideAuthToSigV4OperationAsync(OverrideAuthToSigV4OperationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = OverrideAuthToSigV4OperationRequestMarshaller.Instance; options.ResponseUnmarshaller = OverrideAuthToSigV4OperationResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion } }