/*
* 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 license-manager-linux-subscriptions-2018-05-10.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.LicenseManagerLinuxSubscriptions.Model;
using Amazon.LicenseManagerLinuxSubscriptions.Model.Internal.MarshallTransformations;
using Amazon.LicenseManagerLinuxSubscriptions.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.LicenseManagerLinuxSubscriptions
{
///
/// Implementation for accessing LicenseManagerLinuxSubscriptions
///
/// With License Manager, you can discover and track your commercial Linux subscriptions
/// on running Amazon EC2 instances.
///
public partial class AmazonLicenseManagerLinuxSubscriptionsClient : AmazonServiceClient, IAmazonLicenseManagerLinuxSubscriptions
{
private static IServiceMetadata serviceMetadata = new AmazonLicenseManagerLinuxSubscriptionsMetadata();
#region Constructors
///
/// Constructs AmazonLicenseManagerLinuxSubscriptionsClient 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 AmazonLicenseManagerLinuxSubscriptionsClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonLicenseManagerLinuxSubscriptionsConfig()) { }
///
/// Constructs AmazonLicenseManagerLinuxSubscriptionsClient 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 AmazonLicenseManagerLinuxSubscriptionsClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonLicenseManagerLinuxSubscriptionsConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonLicenseManagerLinuxSubscriptionsClient 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 AmazonLicenseManagerLinuxSubscriptionsClient Configuration Object
public AmazonLicenseManagerLinuxSubscriptionsClient(AmazonLicenseManagerLinuxSubscriptionsConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// Constructs AmazonLicenseManagerLinuxSubscriptionsClient with AWS Credentials
///
/// AWS Credentials
public AmazonLicenseManagerLinuxSubscriptionsClient(AWSCredentials credentials)
: this(credentials, new AmazonLicenseManagerLinuxSubscriptionsConfig())
{
}
///
/// Constructs AmazonLicenseManagerLinuxSubscriptionsClient with AWS Credentials
///
/// AWS Credentials
/// The region to connect.
public AmazonLicenseManagerLinuxSubscriptionsClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonLicenseManagerLinuxSubscriptionsConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonLicenseManagerLinuxSubscriptionsClient with AWS Credentials and an
/// AmazonLicenseManagerLinuxSubscriptionsClient Configuration object.
///
/// AWS Credentials
/// The AmazonLicenseManagerLinuxSubscriptionsClient Configuration Object
public AmazonLicenseManagerLinuxSubscriptionsClient(AWSCredentials credentials, AmazonLicenseManagerLinuxSubscriptionsConfig clientConfig)
: base(credentials, clientConfig)
{
}
///
/// Constructs AmazonLicenseManagerLinuxSubscriptionsClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
public AmazonLicenseManagerLinuxSubscriptionsClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonLicenseManagerLinuxSubscriptionsConfig())
{
}
///
/// Constructs AmazonLicenseManagerLinuxSubscriptionsClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The region to connect.
public AmazonLicenseManagerLinuxSubscriptionsClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonLicenseManagerLinuxSubscriptionsConfig() {RegionEndpoint=region})
{
}
///
/// Constructs AmazonLicenseManagerLinuxSubscriptionsClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonLicenseManagerLinuxSubscriptionsClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The AmazonLicenseManagerLinuxSubscriptionsClient Configuration Object
public AmazonLicenseManagerLinuxSubscriptionsClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonLicenseManagerLinuxSubscriptionsConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
///
/// Constructs AmazonLicenseManagerLinuxSubscriptionsClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
public AmazonLicenseManagerLinuxSubscriptionsClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonLicenseManagerLinuxSubscriptionsConfig())
{
}
///
/// Constructs AmazonLicenseManagerLinuxSubscriptionsClient 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 AmazonLicenseManagerLinuxSubscriptionsClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonLicenseManagerLinuxSubscriptionsConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonLicenseManagerLinuxSubscriptionsClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonLicenseManagerLinuxSubscriptionsClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The AmazonLicenseManagerLinuxSubscriptionsClient Configuration Object
public AmazonLicenseManagerLinuxSubscriptionsClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonLicenseManagerLinuxSubscriptionsConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
{
}
#endregion
#if AWS_ASYNC_ENUMERABLES_API
private ILicenseManagerLinuxSubscriptionsPaginatorFactory _paginators;
///
/// Paginators for the service
///
public ILicenseManagerLinuxSubscriptionsPaginatorFactory Paginators
{
get
{
if (this._paginators == null)
{
this._paginators = new LicenseManagerLinuxSubscriptionsPaginatorFactory(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 AmazonLicenseManagerLinuxSubscriptionsEndpointResolver());
}
///
/// 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 GetServiceSettings
internal virtual GetServiceSettingsResponse GetServiceSettings(GetServiceSettingsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetServiceSettingsRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetServiceSettingsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Lists the Linux subscriptions service settings.
///
/// Container for the necessary parameters to execute the GetServiceSettings service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetServiceSettings service method, as returned by LicenseManagerLinuxSubscriptions.
///
/// An exception occurred with the service.
///
///
/// The request was denied due to request throttling.
///
///
/// The provided input is not valid. Try your request again.
///
/// REST API Reference for GetServiceSettings Operation
public virtual Task GetServiceSettingsAsync(GetServiceSettingsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = GetServiceSettingsRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetServiceSettingsResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListLinuxSubscriptionInstances
internal virtual ListLinuxSubscriptionInstancesResponse ListLinuxSubscriptionInstances(ListLinuxSubscriptionInstancesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListLinuxSubscriptionInstancesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListLinuxSubscriptionInstancesResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Lists the running Amazon EC2 instances that were discovered with commercial Linux
/// subscriptions.
///
/// Container for the necessary parameters to execute the ListLinuxSubscriptionInstances service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListLinuxSubscriptionInstances service method, as returned by LicenseManagerLinuxSubscriptions.
///
/// An exception occurred with the service.
///
///
/// The request was denied due to request throttling.
///
///
/// The provided input is not valid. Try your request again.
///
/// REST API Reference for ListLinuxSubscriptionInstances Operation
public virtual Task ListLinuxSubscriptionInstancesAsync(ListLinuxSubscriptionInstancesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListLinuxSubscriptionInstancesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListLinuxSubscriptionInstancesResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListLinuxSubscriptions
internal virtual ListLinuxSubscriptionsResponse ListLinuxSubscriptions(ListLinuxSubscriptionsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListLinuxSubscriptionsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListLinuxSubscriptionsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Lists the Linux subscriptions that have been discovered. If you have linked your organization,
/// the returned results will include data aggregated across your accounts in Organizations.
///
/// Container for the necessary parameters to execute the ListLinuxSubscriptions service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListLinuxSubscriptions service method, as returned by LicenseManagerLinuxSubscriptions.
///
/// An exception occurred with the service.
///
///
/// The request was denied due to request throttling.
///
///
/// The provided input is not valid. Try your request again.
///
/// REST API Reference for ListLinuxSubscriptions Operation
public virtual Task ListLinuxSubscriptionsAsync(ListLinuxSubscriptionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListLinuxSubscriptionsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListLinuxSubscriptionsResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region UpdateServiceSettings
internal virtual UpdateServiceSettingsResponse UpdateServiceSettings(UpdateServiceSettingsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateServiceSettingsRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateServiceSettingsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Updates the service settings for Linux subscriptions.
///
/// Container for the necessary parameters to execute the UpdateServiceSettings service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the UpdateServiceSettings service method, as returned by LicenseManagerLinuxSubscriptions.
///
/// An exception occurred with the service.
///
///
/// The request was denied due to request throttling.
///
///
/// The provided input is not valid. Try your request again.
///
/// REST API Reference for UpdateServiceSettings Operation
public virtual Task UpdateServiceSettingsAsync(UpdateServiceSettingsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateServiceSettingsRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateServiceSettingsResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
}
}