private Amazon.DataExchange.Model.CreateEventActionResponse CallAWSServiceOperation(IAmazonDataExchange client, Amazon.DataExchange.Model.CreateEventActionRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Data Exchange", "CreateEventAction");
     try
     {
         #if DESKTOP
         return(client.CreateEventAction(request));
         #elif CORECLR
         return(client.CreateEventActionAsync(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.DataExchange.Model.CreateEventActionRequest();


            // populate Action
            var requestActionIsNull = true;

            request.Action = new Amazon.DataExchange.Model.Action();
            Amazon.DataExchange.Model.AutoExportRevisionToS3RequestDetails requestAction_action_ExportRevisionToS3 = null;

            // populate ExportRevisionToS3
            var requestAction_action_ExportRevisionToS3IsNull = true;

            requestAction_action_ExportRevisionToS3 = new Amazon.DataExchange.Model.AutoExportRevisionToS3RequestDetails();
            Amazon.DataExchange.Model.ExportServerSideEncryption requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption = null;

            // populate Encryption
            var requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_EncryptionIsNull = true;

            requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption = new Amazon.DataExchange.Model.ExportServerSideEncryption();
            System.String requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption_encryption_KmsKeyArn = null;
            if (cmdletContext.Encryption_KmsKeyArn != null)
            {
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption_encryption_KmsKeyArn = cmdletContext.Encryption_KmsKeyArn;
            }
            if (requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption_encryption_KmsKeyArn != null)
            {
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption.KmsKeyArn = requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption_encryption_KmsKeyArn;
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_EncryptionIsNull     = false;
            }
            Amazon.DataExchange.ServerSideEncryptionTypes requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption_encryption_Type = null;
            if (cmdletContext.Encryption_Type != null)
            {
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption_encryption_Type = cmdletContext.Encryption_Type;
            }
            if (requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption_encryption_Type != null)
            {
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption.Type  = requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption_encryption_Type;
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_EncryptionIsNull = false;
            }
            // determine if requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption should be set to null
            if (requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_EncryptionIsNull)
            {
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption = null;
            }
            if (requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption != null)
            {
                requestAction_action_ExportRevisionToS3.Encryption = requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_Encryption;
                requestAction_action_ExportRevisionToS3IsNull      = false;
            }
            Amazon.DataExchange.Model.AutoExportRevisionDestinationEntry requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination = null;

            // populate RevisionDestination
            var requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestinationIsNull = true;

            requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination = new Amazon.DataExchange.Model.AutoExportRevisionDestinationEntry();
            System.String requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination_revisionDestination_Bucket = null;
            if (cmdletContext.RevisionDestination_Bucket != null)
            {
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination_revisionDestination_Bucket = cmdletContext.RevisionDestination_Bucket;
            }
            if (requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination_revisionDestination_Bucket != null)
            {
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination.Bucket = requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination_revisionDestination_Bucket;
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestinationIsNull  = false;
            }
            System.String requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination_revisionDestination_KeyPattern = null;
            if (cmdletContext.RevisionDestination_KeyPattern != null)
            {
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination_revisionDestination_KeyPattern = cmdletContext.RevisionDestination_KeyPattern;
            }
            if (requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination_revisionDestination_KeyPattern != null)
            {
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination.KeyPattern = requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination_revisionDestination_KeyPattern;
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestinationIsNull      = false;
            }
            // determine if requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination should be set to null
            if (requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestinationIsNull)
            {
                requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination = null;
            }
            if (requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination != null)
            {
                requestAction_action_ExportRevisionToS3.RevisionDestination = requestAction_action_ExportRevisionToS3_action_ExportRevisionToS3_RevisionDestination;
                requestAction_action_ExportRevisionToS3IsNull = false;
            }
            // determine if requestAction_action_ExportRevisionToS3 should be set to null
            if (requestAction_action_ExportRevisionToS3IsNull)
            {
                requestAction_action_ExportRevisionToS3 = null;
            }
            if (requestAction_action_ExportRevisionToS3 != null)
            {
                request.Action.ExportRevisionToS3 = requestAction_action_ExportRevisionToS3;
                requestActionIsNull = false;
            }
            // determine if request.Action should be set to null
            if (requestActionIsNull)
            {
                request.Action = null;
            }

            // populate Event
            var requestEventIsNull = true;

            request.Event = new Amazon.DataExchange.Model.Event();
            Amazon.DataExchange.Model.RevisionPublished requestEvent_event_RevisionPublished = null;

            // populate RevisionPublished
            var requestEvent_event_RevisionPublishedIsNull = true;

            requestEvent_event_RevisionPublished = new Amazon.DataExchange.Model.RevisionPublished();
            System.String requestEvent_event_RevisionPublished_revisionPublished_DataSetId = null;
            if (cmdletContext.RevisionPublished_DataSetId != null)
            {
                requestEvent_event_RevisionPublished_revisionPublished_DataSetId = cmdletContext.RevisionPublished_DataSetId;
            }
            if (requestEvent_event_RevisionPublished_revisionPublished_DataSetId != null)
            {
                requestEvent_event_RevisionPublished.DataSetId = requestEvent_event_RevisionPublished_revisionPublished_DataSetId;
                requestEvent_event_RevisionPublishedIsNull     = false;
            }
            // determine if requestEvent_event_RevisionPublished should be set to null
            if (requestEvent_event_RevisionPublishedIsNull)
            {
                requestEvent_event_RevisionPublished = null;
            }
            if (requestEvent_event_RevisionPublished != null)
            {
                request.Event.RevisionPublished = requestEvent_event_RevisionPublished;
                requestEventIsNull = false;
            }
            // determine if request.Event should be set to null
            if (requestEventIsNull)
            {
                request.Event = null;
            }

            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);
        }