/* * 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 sms-voice-2018-09-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.PinpointSMSVoice.Model; using Amazon.PinpointSMSVoice.Model.Internal.MarshallTransformations; using Amazon.PinpointSMSVoice.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.PinpointSMSVoice { /// /// Implementation for accessing PinpointSMSVoice /// /// Pinpoint SMS and Voice Messaging public facing APIs /// public partial class AmazonPinpointSMSVoiceClient : AmazonServiceClient, IAmazonPinpointSMSVoice { private static IServiceMetadata serviceMetadata = new AmazonPinpointSMSVoiceMetadata(); #region Constructors /// /// Constructs AmazonPinpointSMSVoiceClient 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 AmazonPinpointSMSVoiceClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonPinpointSMSVoiceConfig()) { } /// /// Constructs AmazonPinpointSMSVoiceClient 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 AmazonPinpointSMSVoiceClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonPinpointSMSVoiceConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonPinpointSMSVoiceClient 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 AmazonPinpointSMSVoiceClient Configuration Object public AmazonPinpointSMSVoiceClient(AmazonPinpointSMSVoiceConfig config) : base(FallbackCredentialsFactory.GetCredentials(config), config){} /// /// Constructs AmazonPinpointSMSVoiceClient with AWS Credentials /// /// AWS Credentials public AmazonPinpointSMSVoiceClient(AWSCredentials credentials) : this(credentials, new AmazonPinpointSMSVoiceConfig()) { } /// /// Constructs AmazonPinpointSMSVoiceClient with AWS Credentials /// /// AWS Credentials /// The region to connect. public AmazonPinpointSMSVoiceClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonPinpointSMSVoiceConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonPinpointSMSVoiceClient with AWS Credentials and an /// AmazonPinpointSMSVoiceClient Configuration object. /// /// AWS Credentials /// The AmazonPinpointSMSVoiceClient Configuration Object public AmazonPinpointSMSVoiceClient(AWSCredentials credentials, AmazonPinpointSMSVoiceConfig clientConfig) : base(credentials, clientConfig) { } /// /// Constructs AmazonPinpointSMSVoiceClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key public AmazonPinpointSMSVoiceClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonPinpointSMSVoiceConfig()) { } /// /// Constructs AmazonPinpointSMSVoiceClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// The region to connect. public AmazonPinpointSMSVoiceClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonPinpointSMSVoiceConfig() {RegionEndpoint=region}) { } /// /// Constructs AmazonPinpointSMSVoiceClient with AWS Access Key ID, AWS Secret Key and an /// AmazonPinpointSMSVoiceClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// The AmazonPinpointSMSVoiceClient Configuration Object public AmazonPinpointSMSVoiceClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonPinpointSMSVoiceConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// /// Constructs AmazonPinpointSMSVoiceClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token public AmazonPinpointSMSVoiceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonPinpointSMSVoiceConfig()) { } /// /// Constructs AmazonPinpointSMSVoiceClient 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 AmazonPinpointSMSVoiceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonPinpointSMSVoiceConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonPinpointSMSVoiceClient with AWS Access Key ID, AWS Secret Key and an /// AmazonPinpointSMSVoiceClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The AmazonPinpointSMSVoiceClient Configuration Object public AmazonPinpointSMSVoiceClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonPinpointSMSVoiceConfig 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 AmazonPinpointSMSVoiceEndpointResolver()); } /// /// 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 CreateConfigurationSet internal virtual CreateConfigurationSetResponse CreateConfigurationSet(CreateConfigurationSetRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateConfigurationSetRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateConfigurationSetResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Create a new configuration set. After you create the configuration set, you can add /// one or more event destinations to it. /// /// Container for the necessary parameters to execute the CreateConfigurationSet service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the CreateConfigurationSet service method, as returned by PinpointSMSVoice. /// /// The resource specified in your request already exists. /// /// /// The input you provided is invalid. /// /// /// The API encountered an unexpected error and couldn't complete the request. You might /// be able to successfully issue the request again in the future. /// /// /// There are too many instances of the specified resource type. /// /// /// You've issued too many requests to the resource. Wait a few minutes, and then try /// again. /// /// REST API Reference for CreateConfigurationSet Operation public virtual Task CreateConfigurationSetAsync(CreateConfigurationSetRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateConfigurationSetRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateConfigurationSetResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region CreateConfigurationSetEventDestination internal virtual CreateConfigurationSetEventDestinationResponse CreateConfigurationSetEventDestination(CreateConfigurationSetEventDestinationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateConfigurationSetEventDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateConfigurationSetEventDestinationResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Create a new event destination in a configuration set. /// /// Container for the necessary parameters to execute the CreateConfigurationSetEventDestination service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the CreateConfigurationSetEventDestination service method, as returned by PinpointSMSVoice. /// /// The resource specified in your request already exists. /// /// /// The input you provided is invalid. /// /// /// The API encountered an unexpected error and couldn't complete the request. You might /// be able to successfully issue the request again in the future. /// /// /// There are too many instances of the specified resource type. /// /// /// The resource you attempted to access doesn't exist. /// /// /// You've issued too many requests to the resource. Wait a few minutes, and then try /// again. /// /// REST API Reference for CreateConfigurationSetEventDestination Operation public virtual Task CreateConfigurationSetEventDestinationAsync(CreateConfigurationSetEventDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateConfigurationSetEventDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateConfigurationSetEventDestinationResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region DeleteConfigurationSet internal virtual DeleteConfigurationSetResponse DeleteConfigurationSet(DeleteConfigurationSetRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteConfigurationSetRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteConfigurationSetResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Deletes an existing configuration set. /// /// Container for the necessary parameters to execute the DeleteConfigurationSet service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the DeleteConfigurationSet service method, as returned by PinpointSMSVoice. /// /// The input you provided is invalid. /// /// /// The API encountered an unexpected error and couldn't complete the request. You might /// be able to successfully issue the request again in the future. /// /// /// The resource you attempted to access doesn't exist. /// /// /// You've issued too many requests to the resource. Wait a few minutes, and then try /// again. /// /// REST API Reference for DeleteConfigurationSet Operation public virtual Task DeleteConfigurationSetAsync(DeleteConfigurationSetRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteConfigurationSetRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteConfigurationSetResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region DeleteConfigurationSetEventDestination internal virtual DeleteConfigurationSetEventDestinationResponse DeleteConfigurationSetEventDestination(DeleteConfigurationSetEventDestinationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteConfigurationSetEventDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteConfigurationSetEventDestinationResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Deletes an event destination in a configuration set. /// /// Container for the necessary parameters to execute the DeleteConfigurationSetEventDestination service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the DeleteConfigurationSetEventDestination service method, as returned by PinpointSMSVoice. /// /// The input you provided is invalid. /// /// /// The API encountered an unexpected error and couldn't complete the request. You might /// be able to successfully issue the request again in the future. /// /// /// The resource you attempted to access doesn't exist. /// /// /// You've issued too many requests to the resource. Wait a few minutes, and then try /// again. /// /// REST API Reference for DeleteConfigurationSetEventDestination Operation public virtual Task DeleteConfigurationSetEventDestinationAsync(DeleteConfigurationSetEventDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteConfigurationSetEventDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteConfigurationSetEventDestinationResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region GetConfigurationSetEventDestinations internal virtual GetConfigurationSetEventDestinationsResponse GetConfigurationSetEventDestinations(GetConfigurationSetEventDestinationsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetConfigurationSetEventDestinationsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetConfigurationSetEventDestinationsResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Obtain information about an event destination, including the types of events it reports, /// the Amazon Resource Name (ARN) of the destination, and the name of the event destination. /// /// Container for the necessary parameters to execute the GetConfigurationSetEventDestinations service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the GetConfigurationSetEventDestinations service method, as returned by PinpointSMSVoice. /// /// The input you provided is invalid. /// /// /// The API encountered an unexpected error and couldn't complete the request. You might /// be able to successfully issue the request again in the future. /// /// /// The resource you attempted to access doesn't exist. /// /// /// You've issued too many requests to the resource. Wait a few minutes, and then try /// again. /// /// REST API Reference for GetConfigurationSetEventDestinations Operation public virtual Task GetConfigurationSetEventDestinationsAsync(GetConfigurationSetEventDestinationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetConfigurationSetEventDestinationsRequestMarshaller.Instance; options.ResponseUnmarshaller = GetConfigurationSetEventDestinationsResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region ListConfigurationSets internal virtual ListConfigurationSetsResponse ListConfigurationSets(ListConfigurationSetsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListConfigurationSetsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListConfigurationSetsResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// List all of the configuration sets associated with your Amazon Pinpoint account in /// the current region. /// /// Container for the necessary parameters to execute the ListConfigurationSets service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the ListConfigurationSets service method, as returned by PinpointSMSVoice. /// /// The input you provided is invalid. /// /// /// The API encountered an unexpected error and couldn't complete the request. You might /// be able to successfully issue the request again in the future. /// /// /// You've issued too many requests to the resource. Wait a few minutes, and then try /// again. /// /// REST API Reference for ListConfigurationSets Operation public virtual Task ListConfigurationSetsAsync(ListConfigurationSetsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListConfigurationSetsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListConfigurationSetsResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region SendVoiceMessage internal virtual SendVoiceMessageResponse SendVoiceMessage(SendVoiceMessageRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = SendVoiceMessageRequestMarshaller.Instance; options.ResponseUnmarshaller = SendVoiceMessageResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Create a new voice message and send it to a recipient's phone number. /// /// Container for the necessary parameters to execute the SendVoiceMessage service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the SendVoiceMessage service method, as returned by PinpointSMSVoice. /// /// The input you provided is invalid. /// /// /// The API encountered an unexpected error and couldn't complete the request. You might /// be able to successfully issue the request again in the future. /// /// /// You've issued too many requests to the resource. Wait a few minutes, and then try /// again. /// /// REST API Reference for SendVoiceMessage Operation public virtual Task SendVoiceMessageAsync(SendVoiceMessageRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = SendVoiceMessageRequestMarshaller.Instance; options.ResponseUnmarshaller = SendVoiceMessageResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region UpdateConfigurationSetEventDestination internal virtual UpdateConfigurationSetEventDestinationResponse UpdateConfigurationSetEventDestination(UpdateConfigurationSetEventDestinationRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateConfigurationSetEventDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateConfigurationSetEventDestinationResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Update an event destination in a configuration set. An event destination is a location /// that you publish information about your voice calls to. For example, you can log an /// event to an Amazon CloudWatch destination when a call fails. /// /// Container for the necessary parameters to execute the UpdateConfigurationSetEventDestination service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the UpdateConfigurationSetEventDestination service method, as returned by PinpointSMSVoice. /// /// The input you provided is invalid. /// /// /// The API encountered an unexpected error and couldn't complete the request. You might /// be able to successfully issue the request again in the future. /// /// /// The resource you attempted to access doesn't exist. /// /// /// You've issued too many requests to the resource. Wait a few minutes, and then try /// again. /// /// REST API Reference for UpdateConfigurationSetEventDestination Operation public virtual Task UpdateConfigurationSetEventDestinationAsync(UpdateConfigurationSetEventDestinationRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateConfigurationSetEventDestinationRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateConfigurationSetEventDestinationResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion } }