/* * 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 ep2-host-label-2022-08-24.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.Ep2hostlabel.Model; using Amazon.Ep2hostlabel.Model.Internal.MarshallTransformations; using Amazon.Ep2hostlabel.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.Ep2hostlabel { /// /// Implementation for accessing Ep2hostlabel /// /// /// public partial class AmazonEp2hostlabelClient : AmazonServiceClient, IAmazonEp2hostlabel { private static IServiceMetadata serviceMetadata = new AmazonEp2hostlabelMetadata(); #region Constructors /// /// Constructs AmazonEp2hostlabelClient 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 AmazonEp2hostlabelClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonEp2hostlabelConfig()) { } /// /// Constructs AmazonEp2hostlabelClient 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 AmazonEp2hostlabelClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonEp2hostlabelConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonEp2hostlabelClient 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 AmazonEp2hostlabelClient Configuration Object public AmazonEp2hostlabelClient(AmazonEp2hostlabelConfig config) : base(FallbackCredentialsFactory.GetCredentials(config), config){} /// /// Constructs AmazonEp2hostlabelClient with AWS Credentials /// /// AWS Credentials public AmazonEp2hostlabelClient(AWSCredentials credentials) : this(credentials, new AmazonEp2hostlabelConfig()) { } /// /// Constructs AmazonEp2hostlabelClient with AWS Credentials /// /// AWS Credentials /// The region to connect. public AmazonEp2hostlabelClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonEp2hostlabelConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonEp2hostlabelClient with AWS Credentials and an /// AmazonEp2hostlabelClient Configuration object. /// /// AWS Credentials /// The AmazonEp2hostlabelClient Configuration Object public AmazonEp2hostlabelClient(AWSCredentials credentials, AmazonEp2hostlabelConfig clientConfig) : base(credentials, clientConfig) { } /// /// Constructs AmazonEp2hostlabelClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key public AmazonEp2hostlabelClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonEp2hostlabelConfig()) { } /// /// Constructs AmazonEp2hostlabelClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// The region to connect. public AmazonEp2hostlabelClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonEp2hostlabelConfig() {RegionEndpoint=region}) { } /// /// Constructs AmazonEp2hostlabelClient with AWS Access Key ID, AWS Secret Key and an /// AmazonEp2hostlabelClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// The AmazonEp2hostlabelClient Configuration Object public AmazonEp2hostlabelClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonEp2hostlabelConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// /// Constructs AmazonEp2hostlabelClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token public AmazonEp2hostlabelClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonEp2hostlabelConfig()) { } /// /// Constructs AmazonEp2hostlabelClient 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 AmazonEp2hostlabelClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonEp2hostlabelConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonEp2hostlabelClient with AWS Access Key ID, AWS Secret Key and an /// AmazonEp2hostlabelClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The AmazonEp2hostlabelClient Configuration Object public AmazonEp2hostlabelClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonEp2hostlabelConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig) { } #endregion #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 AmazonEp2hostlabelEndpointResolver()); } /// /// 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 MyOperation internal virtual MyOperationResponse MyOperation(MyOperationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = MyOperationRequestMarshaller.Instance; options.ResponseUnmarshaller = MyOperationResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// /// /// Container for the necessary parameters to execute the MyOperation service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the MyOperation service method, as returned by Ep2hostlabel. /// REST API Reference for MyOperation Operation public virtual Task MyOperationAsync(MyOperationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = MyOperationRequestMarshaller.Instance; options.ResponseUnmarshaller = MyOperationResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion } }