/*
* 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 personalize-events-2018-03-22.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.PersonalizeEvents.Model;
using Amazon.PersonalizeEvents.Model.Internal.MarshallTransformations;
using Amazon.PersonalizeEvents.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.PersonalizeEvents
{
///
/// Implementation for accessing PersonalizeEvents
///
/// Amazon Personalize can consume real-time user event data, such as stream or
/// click data, and use it for model training either alone or combined with historical
/// data. For more information see Recording
/// Events.
///
public partial class AmazonPersonalizeEventsClient : AmazonServiceClient, IAmazonPersonalizeEvents
{
private static IServiceMetadata serviceMetadata = new AmazonPersonalizeEventsMetadata();
#region Constructors
///
/// Constructs AmazonPersonalizeEventsClient 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 AmazonPersonalizeEventsClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonPersonalizeEventsConfig()) { }
///
/// Constructs AmazonPersonalizeEventsClient 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 AmazonPersonalizeEventsClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonPersonalizeEventsConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonPersonalizeEventsClient 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 AmazonPersonalizeEventsClient Configuration Object
public AmazonPersonalizeEventsClient(AmazonPersonalizeEventsConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// Constructs AmazonPersonalizeEventsClient with AWS Credentials
///
/// AWS Credentials
public AmazonPersonalizeEventsClient(AWSCredentials credentials)
: this(credentials, new AmazonPersonalizeEventsConfig())
{
}
///
/// Constructs AmazonPersonalizeEventsClient with AWS Credentials
///
/// AWS Credentials
/// The region to connect.
public AmazonPersonalizeEventsClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonPersonalizeEventsConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonPersonalizeEventsClient with AWS Credentials and an
/// AmazonPersonalizeEventsClient Configuration object.
///
/// AWS Credentials
/// The AmazonPersonalizeEventsClient Configuration Object
public AmazonPersonalizeEventsClient(AWSCredentials credentials, AmazonPersonalizeEventsConfig clientConfig)
: base(credentials, clientConfig)
{
}
///
/// Constructs AmazonPersonalizeEventsClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
public AmazonPersonalizeEventsClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonPersonalizeEventsConfig())
{
}
///
/// Constructs AmazonPersonalizeEventsClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The region to connect.
public AmazonPersonalizeEventsClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonPersonalizeEventsConfig() {RegionEndpoint=region})
{
}
///
/// Constructs AmazonPersonalizeEventsClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonPersonalizeEventsClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The AmazonPersonalizeEventsClient Configuration Object
public AmazonPersonalizeEventsClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonPersonalizeEventsConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
///
/// Constructs AmazonPersonalizeEventsClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
public AmazonPersonalizeEventsClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonPersonalizeEventsConfig())
{
}
///
/// Constructs AmazonPersonalizeEventsClient 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 AmazonPersonalizeEventsClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonPersonalizeEventsConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonPersonalizeEventsClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonPersonalizeEventsClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The AmazonPersonalizeEventsClient Configuration Object
public AmazonPersonalizeEventsClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonPersonalizeEventsConfig 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 AmazonPersonalizeEventsEndpointResolver());
}
///
/// 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);
}
///
/// Records user interaction event data. For more information see Recording
/// Events.
///
/// 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 PersonalizeEvents.
///
/// Provide a valid value for the field or parameter.
///
/// REST API Reference for PutEvents Operation
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
#region PutItems
internal virtual PutItemsResponse PutItems(PutItemsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = PutItemsRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutItemsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Adds one or more items to an Items dataset. For more information see Importing
/// Items Incrementally.
///
/// Container for the necessary parameters to execute the PutItems service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the PutItems service method, as returned by PersonalizeEvents.
///
/// Provide a valid value for the field or parameter.
///
///
/// The specified resource is in use.
///
///
/// Could not find the specified resource.
///
/// REST API Reference for PutItems Operation
public virtual Task PutItemsAsync(PutItemsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = PutItemsRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutItemsResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region PutUsers
internal virtual PutUsersResponse PutUsers(PutUsersRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = PutUsersRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutUsersResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Adds one or more users to a Users dataset. For more information see Importing
/// Users Incrementally.
///
/// Container for the necessary parameters to execute the PutUsers service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the PutUsers service method, as returned by PersonalizeEvents.
///
/// Provide a valid value for the field or parameter.
///
///
/// The specified resource is in use.
///
///
/// Could not find the specified resource.
///
/// REST API Reference for PutUsers Operation
public virtual Task PutUsersAsync(PutUsersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = PutUsersRequestMarshaller.Instance;
options.ResponseUnmarshaller = PutUsersResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
}
}