private Amazon.WorkMailMessageFlow.Model.PutRawMessageContentResponse CallAWSServiceOperation(IAmazonWorkMailMessageFlow client, Amazon.WorkMailMessageFlow.Model.PutRawMessageContentRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon WorkMail Message Flow", "PutRawMessageContent"); try { #if DESKTOP return(client.PutRawMessageContent(request)); #elif CORECLR return(client.PutRawMessageContentAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.WorkMailMessageFlow.Model.PutRawMessageContentRequest(); // populate Content var requestContentIsNull = true; request.Content = new Amazon.WorkMailMessageFlow.Model.RawMessageContent(); Amazon.WorkMailMessageFlow.Model.S3Reference requestContent_content_S3Reference = null; // populate S3Reference var requestContent_content_S3ReferenceIsNull = true; requestContent_content_S3Reference = new Amazon.WorkMailMessageFlow.Model.S3Reference(); System.String requestContent_content_S3Reference_s3Reference_Bucket = null; if (cmdletContext.S3Reference_Bucket != null) { requestContent_content_S3Reference_s3Reference_Bucket = cmdletContext.S3Reference_Bucket; } if (requestContent_content_S3Reference_s3Reference_Bucket != null) { requestContent_content_S3Reference.Bucket = requestContent_content_S3Reference_s3Reference_Bucket; requestContent_content_S3ReferenceIsNull = false; } System.String requestContent_content_S3Reference_s3Reference_Key = null; if (cmdletContext.S3Reference_Key != null) { requestContent_content_S3Reference_s3Reference_Key = cmdletContext.S3Reference_Key; } if (requestContent_content_S3Reference_s3Reference_Key != null) { requestContent_content_S3Reference.Key = requestContent_content_S3Reference_s3Reference_Key; requestContent_content_S3ReferenceIsNull = false; } System.String requestContent_content_S3Reference_s3Reference_ObjectVersion = null; if (cmdletContext.S3Reference_ObjectVersion != null) { requestContent_content_S3Reference_s3Reference_ObjectVersion = cmdletContext.S3Reference_ObjectVersion; } if (requestContent_content_S3Reference_s3Reference_ObjectVersion != null) { requestContent_content_S3Reference.ObjectVersion = requestContent_content_S3Reference_s3Reference_ObjectVersion; requestContent_content_S3ReferenceIsNull = false; } // determine if requestContent_content_S3Reference should be set to null if (requestContent_content_S3ReferenceIsNull) { requestContent_content_S3Reference = null; } if (requestContent_content_S3Reference != null) { request.Content.S3Reference = requestContent_content_S3Reference; requestContentIsNull = false; } // determine if request.Content should be set to null if (requestContentIsNull) { request.Content = null; } if (cmdletContext.MessageId != null) { request.MessageId = cmdletContext.MessageId; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }