/* * 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.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(); } /// /// Customize the pipeline /// /// 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 /// /// Records user interaction event data. For more information see Recording /// Events. /// /// Container for the necessary parameters to execute the PutEvents service method. /// /// 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 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 AmazonPersonalizeEventsClient. /// An AsyncCallback 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. /// /// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndPutEvents /// operation. /// REST API Reference for PutEvents Operation public virtual IAsyncResult BeginPutEvents(PutEventsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = PutEventsRequestMarshaller.Instance; options.ResponseUnmarshaller = PutEventsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// /// Finishes the asynchronous execution of the PutEvents operation. /// /// /// The IAsyncResult returned by the call to BeginPutEvents. /// /// Returns a PutEventsResult from PersonalizeEvents. /// REST API Reference for PutEvents Operation public virtual PutEventsResponse EndPutEvents(IAsyncResult asyncResult) { return EndInvoke(asyncResult); } #endregion #region PutItems /// /// 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. /// /// 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 PutItemsResponse PutItems(PutItemsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutItemsRequestMarshaller.Instance; options.ResponseUnmarshaller = PutItemsResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Initiates the asynchronous execution of the PutItems operation. /// /// /// Container for the necessary parameters to execute the PutItems operation on AmazonPersonalizeEventsClient. /// An AsyncCallback 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. /// /// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndPutItems /// operation. /// REST API Reference for PutItems Operation public virtual IAsyncResult BeginPutItems(PutItemsRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = PutItemsRequestMarshaller.Instance; options.ResponseUnmarshaller = PutItemsResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// /// Finishes the asynchronous execution of the PutItems operation. /// /// /// The IAsyncResult returned by the call to BeginPutItems. /// /// Returns a PutItemsResult from PersonalizeEvents. /// REST API Reference for PutItems Operation public virtual PutItemsResponse EndPutItems(IAsyncResult asyncResult) { return EndInvoke(asyncResult); } #endregion #region PutUsers /// /// 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. /// /// 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 PutUsersResponse PutUsers(PutUsersRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutUsersRequestMarshaller.Instance; options.ResponseUnmarshaller = PutUsersResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Initiates the asynchronous execution of the PutUsers operation. /// /// /// Container for the necessary parameters to execute the PutUsers operation on AmazonPersonalizeEventsClient. /// An AsyncCallback 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. /// /// An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndPutUsers /// operation. /// REST API Reference for PutUsers Operation public virtual IAsyncResult BeginPutUsers(PutUsersRequest request, AsyncCallback callback, object state) { var options = new InvokeOptions(); options.RequestMarshaller = PutUsersRequestMarshaller.Instance; options.ResponseUnmarshaller = PutUsersResponseUnmarshaller.Instance; return BeginInvoke(request, options, callback, state); } /// /// Finishes the asynchronous execution of the PutUsers operation. /// /// /// The IAsyncResult returned by the call to BeginPutUsers. /// /// Returns a PutUsersResult from PersonalizeEvents. /// REST API Reference for PutUsers Operation public virtual PutUsersResponse EndPutUsers(IAsyncResult asyncResult) { return EndInvoke(asyncResult); } #endregion } }