Container for the parameters to the CreateImportJob operation. Creates or updates an import job.
Inheritance: AmazonPinpointRequest
 private Amazon.Pinpoint.Model.CreateImportJobResponse CallAWSServiceOperation(IAmazonPinpoint client, Amazon.Pinpoint.Model.CreateImportJobRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Pinpoint", "CreateImportJob");
     try
     {
         #if DESKTOP
         return(client.CreateImportJob(request));
         #elif CORECLR
         return(client.CreateImportJobAsync(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.CreateImportJobRequest();

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

            // populate ImportJobRequest
            var requestImportJobRequestIsNull = true;

            request.ImportJobRequest = new Amazon.Pinpoint.Model.ImportJobRequest();
            System.Boolean?requestImportJobRequest_importJobRequest_DefineSegment = null;
            if (cmdletContext.ImportJobRequest_DefineSegment != null)
            {
                requestImportJobRequest_importJobRequest_DefineSegment = cmdletContext.ImportJobRequest_DefineSegment.Value;
            }
            if (requestImportJobRequest_importJobRequest_DefineSegment != null)
            {
                request.ImportJobRequest.DefineSegment = requestImportJobRequest_importJobRequest_DefineSegment.Value;
                requestImportJobRequestIsNull          = false;
            }
            System.String requestImportJobRequest_importJobRequest_ExternalId = null;
            if (cmdletContext.ImportJobRequest_ExternalId != null)
            {
                requestImportJobRequest_importJobRequest_ExternalId = cmdletContext.ImportJobRequest_ExternalId;
            }
            if (requestImportJobRequest_importJobRequest_ExternalId != null)
            {
                request.ImportJobRequest.ExternalId = requestImportJobRequest_importJobRequest_ExternalId;
                requestImportJobRequestIsNull       = false;
            }
            Amazon.Pinpoint.Format requestImportJobRequest_importJobRequest_Format = null;
            if (cmdletContext.ImportJobRequest_Format != null)
            {
                requestImportJobRequest_importJobRequest_Format = cmdletContext.ImportJobRequest_Format;
            }
            if (requestImportJobRequest_importJobRequest_Format != null)
            {
                request.ImportJobRequest.Format = requestImportJobRequest_importJobRequest_Format;
                requestImportJobRequestIsNull   = false;
            }
            System.Boolean?requestImportJobRequest_importJobRequest_RegisterEndpoint = null;
            if (cmdletContext.ImportJobRequest_RegisterEndpoint != null)
            {
                requestImportJobRequest_importJobRequest_RegisterEndpoint = cmdletContext.ImportJobRequest_RegisterEndpoint.Value;
            }
            if (requestImportJobRequest_importJobRequest_RegisterEndpoint != null)
            {
                request.ImportJobRequest.RegisterEndpoints = requestImportJobRequest_importJobRequest_RegisterEndpoint.Value;
                requestImportJobRequestIsNull = false;
            }
            System.String requestImportJobRequest_importJobRequest_RoleArn = null;
            if (cmdletContext.ImportJobRequest_RoleArn != null)
            {
                requestImportJobRequest_importJobRequest_RoleArn = cmdletContext.ImportJobRequest_RoleArn;
            }
            if (requestImportJobRequest_importJobRequest_RoleArn != null)
            {
                request.ImportJobRequest.RoleArn = requestImportJobRequest_importJobRequest_RoleArn;
                requestImportJobRequestIsNull    = false;
            }
            System.String requestImportJobRequest_importJobRequest_S3Url = null;
            if (cmdletContext.ImportJobRequest_S3Url != null)
            {
                requestImportJobRequest_importJobRequest_S3Url = cmdletContext.ImportJobRequest_S3Url;
            }
            if (requestImportJobRequest_importJobRequest_S3Url != null)
            {
                request.ImportJobRequest.S3Url = requestImportJobRequest_importJobRequest_S3Url;
                requestImportJobRequestIsNull  = false;
            }
            System.String requestImportJobRequest_importJobRequest_SegmentId = null;
            if (cmdletContext.ImportJobRequest_SegmentId != null)
            {
                requestImportJobRequest_importJobRequest_SegmentId = cmdletContext.ImportJobRequest_SegmentId;
            }
            if (requestImportJobRequest_importJobRequest_SegmentId != null)
            {
                request.ImportJobRequest.SegmentId = requestImportJobRequest_importJobRequest_SegmentId;
                requestImportJobRequestIsNull      = false;
            }
            System.String requestImportJobRequest_importJobRequest_SegmentName = null;
            if (cmdletContext.ImportJobRequest_SegmentName != null)
            {
                requestImportJobRequest_importJobRequest_SegmentName = cmdletContext.ImportJobRequest_SegmentName;
            }
            if (requestImportJobRequest_importJobRequest_SegmentName != null)
            {
                request.ImportJobRequest.SegmentName = requestImportJobRequest_importJobRequest_SegmentName;
                requestImportJobRequestIsNull        = false;
            }
            // determine if request.ImportJobRequest should be set to null
            if (requestImportJobRequestIsNull)
            {
                request.ImportJobRequest = 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);
        }
        /// <summary>
        /// Creates or updates an import job.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateImportJob service method.</param>
        /// 
        /// <returns>The response from the CreateImportJob service method, as returned by Pinpoint.</returns>
        /// <exception cref="Amazon.Pinpoint.Model.BadRequestException">
        /// 
        /// </exception>
        /// <exception cref="Amazon.Pinpoint.Model.ForbiddenException">
        /// 
        /// </exception>
        /// <exception cref="Amazon.Pinpoint.Model.InternalServerErrorException">
        /// 
        /// </exception>
        /// <exception cref="Amazon.Pinpoint.Model.MethodNotAllowedException">
        /// 
        /// </exception>
        /// <exception cref="Amazon.Pinpoint.Model.NotFoundException">
        /// 
        /// </exception>
        /// <exception cref="Amazon.Pinpoint.Model.TooManyRequestsException">
        /// 
        /// </exception>
        public CreateImportJobResponse CreateImportJob(CreateImportJobRequest request)
        {
            var marshaller = new CreateImportJobRequestMarshaller();
            var unmarshaller = CreateImportJobResponseUnmarshaller.Instance;

            return Invoke<CreateImportJobRequest,CreateImportJobResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateImportJob operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateImportJob operation on AmazonPinpointClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateImportJob
        ///         operation.</returns>
        public IAsyncResult BeginCreateImportJob(CreateImportJobRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateImportJobRequestMarshaller();
            var unmarshaller = CreateImportJobResponseUnmarshaller.Instance;

            return BeginInvoke<CreateImportJobRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateImportJob operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateImportJob operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<CreateImportJobResponse> CreateImportJobAsync(CreateImportJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateImportJobRequestMarshaller();
            var unmarshaller = CreateImportJobResponseUnmarshaller.Instance;

            return InvokeAsync<CreateImportJobRequest,CreateImportJobResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }