/* * Copyright 2010-2014 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 mobileanalytics-2014-06-05.normal.json service model. */ using System; using System.Collections.Generic; using System.Net; using Amazon.MobileAnalytics.Model; using Amazon.MobileAnalytics.Model.Internal.MarshallTransformations; using Amazon.MobileAnalytics.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.MobileAnalytics { /// /// Implementation for accessing MobileAnalytics /// /// Amazon Mobile Analytics is a service for collecting, visualizing, and understanding /// app usage data at scale. /// public partial class AmazonMobileAnalyticsClient : AmazonServiceClient, IAmazonMobileAnalytics { private static IServiceMetadata serviceMetadata = new AmazonMobileAnalyticsMetadata(); #region Constructors /// /// Constructs AmazonMobileAnalyticsClient with AWS Credentials /// /// AWS Credentials public AmazonMobileAnalyticsClient(AWSCredentials credentials) : this(credentials, new AmazonMobileAnalyticsConfig()) { } /// /// Constructs AmazonMobileAnalyticsClient with AWS Credentials /// /// AWS Credentials /// The region to connect. public AmazonMobileAnalyticsClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonMobileAnalyticsConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonMobileAnalyticsClient with AWS Credentials and an /// AmazonMobileAnalyticsClient Configuration object. /// /// AWS Credentials /// The AmazonMobileAnalyticsClient Configuration Object public AmazonMobileAnalyticsClient(AWSCredentials credentials, AmazonMobileAnalyticsConfig clientConfig) : base(credentials, clientConfig) { } /// /// Constructs AmazonMobileAnalyticsClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key public AmazonMobileAnalyticsClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonMobileAnalyticsConfig()) { } /// /// Constructs AmazonMobileAnalyticsClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// The region to connect. public AmazonMobileAnalyticsClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonMobileAnalyticsConfig() {RegionEndpoint=region}) { } /// /// Constructs AmazonMobileAnalyticsClient with AWS Access Key ID, AWS Secret Key and an /// AmazonMobileAnalyticsClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// The AmazonMobileAnalyticsClient Configuration Object public AmazonMobileAnalyticsClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonMobileAnalyticsConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// /// Constructs AmazonMobileAnalyticsClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token public AmazonMobileAnalyticsClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonMobileAnalyticsConfig()) { } /// /// Constructs AmazonMobileAnalyticsClient 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 AmazonMobileAnalyticsClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonMobileAnalyticsConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonMobileAnalyticsClient with AWS Access Key ID, AWS Secret Key and an /// AmazonMobileAnalyticsClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The AmazonMobileAnalyticsClient Configuration Object public AmazonMobileAnalyticsClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonMobileAnalyticsConfig 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 PutEvents internal virtual PutEventsResponse PutEvents(PutEventsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutEventsRequestMarshaller.Instance; options.ResponseUnmarshaller = PutEventsResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Initiates the asynchronous execution of the PutEvents operation. /// /// /// Container for the necessary parameters to execute the PutEvents operation on AmazonMobileAnalyticsClient. /// An Action delegate that is invoked when the operation completes. /// A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property. public virtual void PutEventsAsync(PutEventsRequest request, AmazonServiceCallback callback, AsyncOptions options = null) { options = options == null?new AsyncOptions():options; var invokeOptions = new InvokeOptions(); invokeOptions.RequestMarshaller = PutEventsRequestMarshaller.Instance; invokeOptions.ResponseUnmarshaller = PutEventsResponseUnmarshaller.Instance; Action callbackHelper = null; if(callback !=null ) callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { AmazonServiceResult responseObject = new AmazonServiceResult((PutEventsRequest)req, (PutEventsResponse)res, ex , ao.State); callback(responseObject); }; BeginInvoke(request, invokeOptions, options, callbackHelper); } #endregion } }