private Amazon.Pinpoint.Model.CreateExportJobResponse CallAWSServiceOperation(IAmazonPinpoint client, Amazon.Pinpoint.Model.CreateExportJobRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Pinpoint", "CreateExportJob");
     try
     {
         #if DESKTOP
         return(client.CreateExportJob(request));
         #elif CORECLR
         return(client.CreateExportJobAsync(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.Pinpoint.Model.CreateExportJobRequest();

            if (cmdletContext.ApplicationId != null)
            {
                request.ApplicationId = cmdletContext.ApplicationId;
            }

            // populate ExportJobRequest
            var requestExportJobRequestIsNull = true;

            request.ExportJobRequest = new Amazon.Pinpoint.Model.ExportJobRequest();
            System.String requestExportJobRequest_exportJobRequest_RoleArn = null;
            if (cmdletContext.ExportJobRequest_RoleArn != null)
            {
                requestExportJobRequest_exportJobRequest_RoleArn = cmdletContext.ExportJobRequest_RoleArn;
            }
            if (requestExportJobRequest_exportJobRequest_RoleArn != null)
            {
                request.ExportJobRequest.RoleArn = requestExportJobRequest_exportJobRequest_RoleArn;
                requestExportJobRequestIsNull    = false;
            }
            System.String requestExportJobRequest_exportJobRequest_S3UrlPrefix = null;
            if (cmdletContext.ExportJobRequest_S3UrlPrefix != null)
            {
                requestExportJobRequest_exportJobRequest_S3UrlPrefix = cmdletContext.ExportJobRequest_S3UrlPrefix;
            }
            if (requestExportJobRequest_exportJobRequest_S3UrlPrefix != null)
            {
                request.ExportJobRequest.S3UrlPrefix = requestExportJobRequest_exportJobRequest_S3UrlPrefix;
                requestExportJobRequestIsNull        = false;
            }
            System.String requestExportJobRequest_exportJobRequest_SegmentId = null;
            if (cmdletContext.ExportJobRequest_SegmentId != null)
            {
                requestExportJobRequest_exportJobRequest_SegmentId = cmdletContext.ExportJobRequest_SegmentId;
            }
            if (requestExportJobRequest_exportJobRequest_SegmentId != null)
            {
                request.ExportJobRequest.SegmentId = requestExportJobRequest_exportJobRequest_SegmentId;
                requestExportJobRequestIsNull      = false;
            }
            System.Int32?requestExportJobRequest_exportJobRequest_SegmentVersion = null;
            if (cmdletContext.ExportJobRequest_SegmentVersion != null)
            {
                requestExportJobRequest_exportJobRequest_SegmentVersion = cmdletContext.ExportJobRequest_SegmentVersion.Value;
            }
            if (requestExportJobRequest_exportJobRequest_SegmentVersion != null)
            {
                request.ExportJobRequest.SegmentVersion = requestExportJobRequest_exportJobRequest_SegmentVersion.Value;
                requestExportJobRequestIsNull           = false;
            }
            // determine if request.ExportJobRequest should be set to null
            if (requestExportJobRequestIsNull)
            {
                request.ExportJobRequest = 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);
        }