/*
* 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 mobileanalytics-2014-06-05.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.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 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 AmazonMobileAnalyticsClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonMobileAnalyticsConfig()) { }
///
/// Constructs AmazonMobileAnalyticsClient 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 AmazonMobileAnalyticsClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonMobileAnalyticsConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonMobileAnalyticsClient 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 AmazonMobileAnalyticsClient Configuration Object
public AmazonMobileAnalyticsClient(AmazonMobileAnalyticsConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// 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();
}
///
/// Customize the pipeline
///
///
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.RemoveHandler();
pipeline.AddHandlerAfter(new AmazonMobileAnalyticsEndpointResolver());
}
///
/// 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
///
/// The PutEvents operation records one or more events. You can have up to 1,500 unique
/// custom events per app, any combination of up to 40 attributes and metrics per custom
/// event, and any number of attribute or metric values.
///
/// Container for the necessary parameters to execute the PutEvents service method.
///
/// The response from the PutEvents service method, as returned by MobileAnalytics.
///
/// An exception object returned when a request fails.
///
public virtual PutEventsResponse PutEvents(PutEventsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = PutEventsRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutEventsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// The PutEvents operation records one or more events. You can have up to 1,500 unique
/// custom events per app, any combination of up to 40 attributes and metrics per custom
/// event, and any number of attribute or metric values.
///
/// Container for the necessary parameters to execute the PutEvents service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the PutEvents service method, as returned by MobileAnalytics.
///
/// An exception object returned when a request fails.
///
public virtual Task PutEventsAsync(PutEventsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = PutEventsRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutEventsResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
}
}