/*
 * 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 entitlement.marketplace-2017-01-11.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.MarketplaceEntitlementService.Model;
using Amazon.MarketplaceEntitlementService.Model.Internal.MarshallTransformations;
using Amazon.MarketplaceEntitlementService.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.MarketplaceEntitlementService
{
    /// 
    /// Implementation for accessing MarketplaceEntitlementService
    ///
    /// AWS Marketplace Entitlement Service 
    /// 
    /// This reference provides descriptions of the AWS Marketplace Entitlement Service API.
    /// 
    ///  
    /// 
    /// AWS Marketplace Entitlement Service is used to determine the entitlement of a customer
    /// to a given product. An entitlement represents capacity in a product owned by the customer.
    /// For example, a customer might own some number of users or seats in an SaaS application
    /// or some amount of data capacity in a multi-tenant database.
    /// 
    ///  
    /// 
    ///  Getting Entitlement Records 
    /// 
    ///   -  
    /// 
    ///  GetEntitlements- Gets the entitlements for a Marketplace product.
    /// 
    ///  
/// 
    public partial class AmazonMarketplaceEntitlementServiceClient : AmazonServiceClient, IAmazonMarketplaceEntitlementService
    {
        private static IServiceMetadata serviceMetadata = new AmazonMarketplaceEntitlementServiceMetadata();
        
        #region Constructors
        /// 
        /// Constructs AmazonMarketplaceEntitlementServiceClient 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 AmazonMarketplaceEntitlementServiceClient()
            : base(FallbackCredentialsFactory.GetCredentials(), new AmazonMarketplaceEntitlementServiceConfig()) { }
        /// 
        /// Constructs AmazonMarketplaceEntitlementServiceClient 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 AmazonMarketplaceEntitlementServiceClient(RegionEndpoint region)
            : base(FallbackCredentialsFactory.GetCredentials(), new AmazonMarketplaceEntitlementServiceConfig{RegionEndpoint = region}) { }
        /// 
        /// Constructs AmazonMarketplaceEntitlementServiceClient 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 AmazonMarketplaceEntitlementServiceClient Configuration Object
        public AmazonMarketplaceEntitlementServiceClient(AmazonMarketplaceEntitlementServiceConfig config)
            : base(FallbackCredentialsFactory.GetCredentials(config), config){}
        /// 
        /// Constructs AmazonMarketplaceEntitlementServiceClient with AWS Credentials
        /// 
        /// AWS Credentials
        public AmazonMarketplaceEntitlementServiceClient(AWSCredentials credentials)
            : this(credentials, new AmazonMarketplaceEntitlementServiceConfig())
        {
        }
        /// 
        /// Constructs AmazonMarketplaceEntitlementServiceClient with AWS Credentials
        /// 
        /// AWS Credentials
        /// The region to connect.
        public AmazonMarketplaceEntitlementServiceClient(AWSCredentials credentials, RegionEndpoint region)
            : this(credentials, new AmazonMarketplaceEntitlementServiceConfig{RegionEndpoint = region})
        {
        }
        /// 
        /// Constructs AmazonMarketplaceEntitlementServiceClient with AWS Credentials and an
        /// AmazonMarketplaceEntitlementServiceClient Configuration object.
        /// 
        /// AWS Credentials
        /// The AmazonMarketplaceEntitlementServiceClient Configuration Object
        public AmazonMarketplaceEntitlementServiceClient(AWSCredentials credentials, AmazonMarketplaceEntitlementServiceConfig clientConfig)
            : base(credentials, clientConfig)
        {
        }
        /// 
        /// Constructs AmazonMarketplaceEntitlementServiceClient with AWS Access Key ID and AWS Secret Key
        /// 
        /// AWS Access Key ID
        /// AWS Secret Access Key
        public AmazonMarketplaceEntitlementServiceClient(string awsAccessKeyId, string awsSecretAccessKey)
            : this(awsAccessKeyId, awsSecretAccessKey, new AmazonMarketplaceEntitlementServiceConfig())
        {
        }
        /// 
        /// Constructs AmazonMarketplaceEntitlementServiceClient with AWS Access Key ID and AWS Secret Key
        /// 
        /// AWS Access Key ID
        /// AWS Secret Access Key
        /// The region to connect.
        public AmazonMarketplaceEntitlementServiceClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
            : this(awsAccessKeyId, awsSecretAccessKey, new AmazonMarketplaceEntitlementServiceConfig() {RegionEndpoint=region})
        {
        }
        /// 
        /// Constructs AmazonMarketplaceEntitlementServiceClient with AWS Access Key ID, AWS Secret Key and an
        /// AmazonMarketplaceEntitlementServiceClient Configuration object. 
        /// 
        /// AWS Access Key ID
        /// AWS Secret Access Key
        /// The AmazonMarketplaceEntitlementServiceClient Configuration Object
        public AmazonMarketplaceEntitlementServiceClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonMarketplaceEntitlementServiceConfig clientConfig)
            : base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
        {
        }
        /// 
        /// Constructs AmazonMarketplaceEntitlementServiceClient with AWS Access Key ID and AWS Secret Key
        /// 
        /// AWS Access Key ID
        /// AWS Secret Access Key
        /// AWS Session Token
        public AmazonMarketplaceEntitlementServiceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
            : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonMarketplaceEntitlementServiceConfig())
        {
        }
        /// 
        /// Constructs AmazonMarketplaceEntitlementServiceClient 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 AmazonMarketplaceEntitlementServiceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
            : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonMarketplaceEntitlementServiceConfig{RegionEndpoint = region})
        {
        }
        /// 
        /// Constructs AmazonMarketplaceEntitlementServiceClient with AWS Access Key ID, AWS Secret Key and an
        /// AmazonMarketplaceEntitlementServiceClient Configuration object. 
        /// 
        /// AWS Access Key ID
        /// AWS Secret Access Key
        /// AWS Session Token
        /// The AmazonMarketplaceEntitlementServiceClient Configuration Object
        public AmazonMarketplaceEntitlementServiceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonMarketplaceEntitlementServiceConfig 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 AmazonMarketplaceEntitlementServiceEndpointResolver());
        }
        /// 
        /// 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  GetEntitlements
        internal virtual GetEntitlementsResponse GetEntitlements(GetEntitlementsRequest request)
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = GetEntitlementsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = GetEntitlementsResponseUnmarshaller.Instance;
            return Invoke(request, options);
        }
        /// 
        /// GetEntitlements retrieves entitlement values for a given product. The results can
        /// be filtered based on customer identifier or product dimensions.
        /// 
        /// Container for the necessary parameters to execute the GetEntitlements service method.
        /// 
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// 
        /// 
        /// The response from the GetEntitlements service method, as returned by MarketplaceEntitlementService.
        /// 
        /// An internal error has occurred. Retry your request. If the problem persists, post
        /// a message with details on the AWS forums.
        /// 
        /// 
        /// One or more parameters in your request was invalid.
        /// 
        /// 
        /// The calls to the GetEntitlements API are throttled.
        /// 
        /// REST API Reference for GetEntitlements Operation
        public virtual Task GetEntitlementsAsync(GetEntitlementsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = GetEntitlementsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = GetEntitlementsResponseUnmarshaller.Instance;
            return InvokeAsync(request, options, cancellationToken);
        }
        #endregion
        
    }
}