/* * 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 workmailmessageflow-2019-05-01.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.WorkMailMessageFlow.Model; using Amazon.WorkMailMessageFlow.Model.Internal.MarshallTransformations; using Amazon.WorkMailMessageFlow.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.WorkMailMessageFlow { /// /// Implementation for accessing WorkMailMessageFlow /// /// The WorkMail Message Flow API provides access to email messages as they are being /// sent and received by a WorkMail organization. /// public partial class AmazonWorkMailMessageFlowClient : AmazonServiceClient, IAmazonWorkMailMessageFlow { private static IServiceMetadata serviceMetadata = new AmazonWorkMailMessageFlowMetadata(); #region Constructors /// /// Constructs AmazonWorkMailMessageFlowClient 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 AmazonWorkMailMessageFlowClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonWorkMailMessageFlowConfig()) { } /// /// Constructs AmazonWorkMailMessageFlowClient 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 AmazonWorkMailMessageFlowClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonWorkMailMessageFlowConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonWorkMailMessageFlowClient 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 AmazonWorkMailMessageFlowClient Configuration Object public AmazonWorkMailMessageFlowClient(AmazonWorkMailMessageFlowConfig config) : base(FallbackCredentialsFactory.GetCredentials(config), config){} /// /// Constructs AmazonWorkMailMessageFlowClient with AWS Credentials /// /// AWS Credentials public AmazonWorkMailMessageFlowClient(AWSCredentials credentials) : this(credentials, new AmazonWorkMailMessageFlowConfig()) { } /// /// Constructs AmazonWorkMailMessageFlowClient with AWS Credentials /// /// AWS Credentials /// The region to connect. public AmazonWorkMailMessageFlowClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonWorkMailMessageFlowConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonWorkMailMessageFlowClient with AWS Credentials and an /// AmazonWorkMailMessageFlowClient Configuration object. /// /// AWS Credentials /// The AmazonWorkMailMessageFlowClient Configuration Object public AmazonWorkMailMessageFlowClient(AWSCredentials credentials, AmazonWorkMailMessageFlowConfig clientConfig) : base(credentials, clientConfig) { } /// /// Constructs AmazonWorkMailMessageFlowClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key public AmazonWorkMailMessageFlowClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonWorkMailMessageFlowConfig()) { } /// /// Constructs AmazonWorkMailMessageFlowClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// The region to connect. public AmazonWorkMailMessageFlowClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonWorkMailMessageFlowConfig() {RegionEndpoint=region}) { } /// /// Constructs AmazonWorkMailMessageFlowClient with AWS Access Key ID, AWS Secret Key and an /// AmazonWorkMailMessageFlowClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// The AmazonWorkMailMessageFlowClient Configuration Object public AmazonWorkMailMessageFlowClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonWorkMailMessageFlowConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// /// Constructs AmazonWorkMailMessageFlowClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token public AmazonWorkMailMessageFlowClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonWorkMailMessageFlowConfig()) { } /// /// Constructs AmazonWorkMailMessageFlowClient 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 AmazonWorkMailMessageFlowClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonWorkMailMessageFlowConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonWorkMailMessageFlowClient with AWS Access Key ID, AWS Secret Key and an /// AmazonWorkMailMessageFlowClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The AmazonWorkMailMessageFlowClient Configuration Object public AmazonWorkMailMessageFlowClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonWorkMailMessageFlowConfig 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 AmazonWorkMailMessageFlowEndpointResolver()); } /// /// 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 GetRawMessageContent /// /// Retrieves the raw content of an in-transit email message, in MIME format. /// /// Container for the necessary parameters to execute the GetRawMessageContent service method. /// /// The response from the GetRawMessageContent service method, as returned by WorkMailMessageFlow. /// /// The requested email message is not found. /// /// REST API Reference for GetRawMessageContent Operation public virtual GetRawMessageContentResponse GetRawMessageContent(GetRawMessageContentRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetRawMessageContentRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRawMessageContentResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Retrieves the raw content of an in-transit email message, in MIME format. /// /// Container for the necessary parameters to execute the GetRawMessageContent service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the GetRawMessageContent service method, as returned by WorkMailMessageFlow. /// /// The requested email message is not found. /// /// REST API Reference for GetRawMessageContent Operation public virtual Task GetRawMessageContentAsync(GetRawMessageContentRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetRawMessageContentRequestMarshaller.Instance; options.ResponseUnmarshaller = GetRawMessageContentResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region PutRawMessageContent /// /// Updates the raw content of an in-transit email message, in MIME format. /// /// /// /// This example describes how to update in-transit email message. For more information /// and examples for using this API, see /// Updating message content with AWS Lambda. /// /// /// /// Updates to an in-transit message only appear when you call PutRawMessageContent /// from an AWS Lambda function configured with a synchronous /// Run Lambda rule. If you call PutRawMessageContent on a delivered /// or sent message, the message remains unchanged, even though GetRawMessageContent /// returns an updated message. /// /// /// /// Container for the necessary parameters to execute the PutRawMessageContent service method. /// /// The response from the PutRawMessageContent service method, as returned by WorkMailMessageFlow. /// /// WorkMail could not access the updated email content. Possible reasons: /// ///
  • /// /// You made the request in a region other than your S3 bucket region. /// ///
  • /// /// The S3 /// bucket owner is not the same as the calling AWS account. /// ///
  • /// /// You have an incomplete or missing S3 bucket policy. For more information about policies, /// see /// Updating message content with AWS Lambda in the WorkMail Administrator Guide. /// ///
///
/// /// The requested email is not eligible for update. This is usually the case for a redirected /// email. /// /// /// The requested email could not be updated due to an error in the MIME content. Check /// the error message for more information about what caused the error. /// /// /// The requested email message is not found. /// /// REST API Reference for PutRawMessageContent Operation public virtual PutRawMessageContentResponse PutRawMessageContent(PutRawMessageContentRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = PutRawMessageContentRequestMarshaller.Instance; options.ResponseUnmarshaller = PutRawMessageContentResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Updates the raw content of an in-transit email message, in MIME format. /// /// /// /// This example describes how to update in-transit email message. For more information /// and examples for using this API, see /// Updating message content with AWS Lambda. /// /// /// /// Updates to an in-transit message only appear when you call PutRawMessageContent /// from an AWS Lambda function configured with a synchronous /// Run Lambda rule. If you call PutRawMessageContent on a delivered /// or sent message, the message remains unchanged, even though GetRawMessageContent /// returns an updated message. /// /// /// /// Container for the necessary parameters to execute the PutRawMessageContent service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the PutRawMessageContent service method, as returned by WorkMailMessageFlow. /// /// WorkMail could not access the updated email content. Possible reasons: /// ///
  • /// /// You made the request in a region other than your S3 bucket region. /// ///
  • /// /// The S3 /// bucket owner is not the same as the calling AWS account. /// ///
  • /// /// You have an incomplete or missing S3 bucket policy. For more information about policies, /// see /// Updating message content with AWS Lambda in the WorkMail Administrator Guide. /// ///
///
/// /// The requested email is not eligible for update. This is usually the case for a redirected /// email. /// /// /// The requested email could not be updated due to an error in the MIME content. Check /// the error message for more information about what caused the error. /// /// /// The requested email message is not found. /// /// REST API Reference for PutRawMessageContent Operation public virtual Task PutRawMessageContentAsync(PutRawMessageContentRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = PutRawMessageContentRequestMarshaller.Instance; options.ResponseUnmarshaller = PutRawMessageContentResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion } }