public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CustomerProfiles.Model.UpdateDomainRequest();

            if (cmdletContext.DeadLetterQueueUrl != null)
            {
                request.DeadLetterQueueUrl = cmdletContext.DeadLetterQueueUrl;
            }
            if (cmdletContext.DefaultEncryptionKey != null)
            {
                request.DefaultEncryptionKey = cmdletContext.DefaultEncryptionKey;
            }
            if (cmdletContext.DefaultExpirationDay != null)
            {
                request.DefaultExpirationDays = cmdletContext.DefaultExpirationDay.Value;
            }
            if (cmdletContext.DomainName != null)
            {
                request.DomainName = cmdletContext.DomainName;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

            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);
        }
 private Amazon.CustomerProfiles.Model.UpdateDomainResponse CallAWSServiceOperation(IAmazonCustomerProfiles client, Amazon.CustomerProfiles.Model.UpdateDomainRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Connect Customer Profiles", "UpdateDomain");
     try
     {
         #if DESKTOP
         return(client.UpdateDomain(request));
         #elif CORECLR
         return(client.UpdateDomainAsync(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.CustomerProfiles.Model.UpdateDomainRequest();

            if (cmdletContext.DeadLetterQueueUrl != null)
            {
                request.DeadLetterQueueUrl = cmdletContext.DeadLetterQueueUrl;
            }
            if (cmdletContext.DefaultEncryptionKey != null)
            {
                request.DefaultEncryptionKey = cmdletContext.DefaultEncryptionKey;
            }
            if (cmdletContext.DefaultExpirationDay != null)
            {
                request.DefaultExpirationDays = cmdletContext.DefaultExpirationDay.Value;
            }
            if (cmdletContext.DomainName != null)
            {
                request.DomainName = cmdletContext.DomainName;
            }

            // populate Matching
            var requestMatchingIsNull = true;

            request.Matching = new Amazon.CustomerProfiles.Model.MatchingRequest();
            System.Boolean?requestMatching_matching_Enabled = null;
            if (cmdletContext.Matching_Enabled != null)
            {
                requestMatching_matching_Enabled = cmdletContext.Matching_Enabled.Value;
            }
            if (requestMatching_matching_Enabled != null)
            {
                request.Matching.Enabled = requestMatching_matching_Enabled.Value;
                requestMatchingIsNull    = false;
            }
            Amazon.CustomerProfiles.Model.ExportingConfig requestMatching_matching_ExportingConfig = null;

            // populate ExportingConfig
            var requestMatching_matching_ExportingConfigIsNull = true;

            requestMatching_matching_ExportingConfig = new Amazon.CustomerProfiles.Model.ExportingConfig();
            Amazon.CustomerProfiles.Model.S3ExportingConfig requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting = null;

            // populate S3Exporting
            var requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3ExportingIsNull = true;

            requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting = new Amazon.CustomerProfiles.Model.S3ExportingConfig();
            System.String requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting_s3Exporting_S3BucketName = null;
            if (cmdletContext.S3Exporting_S3BucketName != null)
            {
                requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting_s3Exporting_S3BucketName = cmdletContext.S3Exporting_S3BucketName;
            }
            if (requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting_s3Exporting_S3BucketName != null)
            {
                requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting.S3BucketName = requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting_s3Exporting_S3BucketName;
                requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3ExportingIsNull        = false;
            }
            System.String requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting_s3Exporting_S3KeyName = null;
            if (cmdletContext.S3Exporting_S3KeyName != null)
            {
                requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting_s3Exporting_S3KeyName = cmdletContext.S3Exporting_S3KeyName;
            }
            if (requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting_s3Exporting_S3KeyName != null)
            {
                requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting.S3KeyName = requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting_s3Exporting_S3KeyName;
                requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3ExportingIsNull     = false;
            }
            // determine if requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting should be set to null
            if (requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3ExportingIsNull)
            {
                requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting = null;
            }
            if (requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting != null)
            {
                requestMatching_matching_ExportingConfig.S3Exporting = requestMatching_matching_ExportingConfig_matching_ExportingConfig_S3Exporting;
                requestMatching_matching_ExportingConfigIsNull       = false;
            }
            // determine if requestMatching_matching_ExportingConfig should be set to null
            if (requestMatching_matching_ExportingConfigIsNull)
            {
                requestMatching_matching_ExportingConfig = null;
            }
            if (requestMatching_matching_ExportingConfig != null)
            {
                request.Matching.ExportingConfig = requestMatching_matching_ExportingConfig;
                requestMatchingIsNull            = false;
            }
            Amazon.CustomerProfiles.Model.JobSchedule requestMatching_matching_JobSchedule = null;

            // populate JobSchedule
            var requestMatching_matching_JobScheduleIsNull = true;

            requestMatching_matching_JobSchedule = new Amazon.CustomerProfiles.Model.JobSchedule();
            Amazon.CustomerProfiles.JobScheduleDayOfTheWeek requestMatching_matching_JobSchedule_jobSchedule_DayOfTheWeek = null;
            if (cmdletContext.JobSchedule_DayOfTheWeek != null)
            {
                requestMatching_matching_JobSchedule_jobSchedule_DayOfTheWeek = cmdletContext.JobSchedule_DayOfTheWeek;
            }
            if (requestMatching_matching_JobSchedule_jobSchedule_DayOfTheWeek != null)
            {
                requestMatching_matching_JobSchedule.DayOfTheWeek = requestMatching_matching_JobSchedule_jobSchedule_DayOfTheWeek;
                requestMatching_matching_JobScheduleIsNull        = false;
            }
            System.String requestMatching_matching_JobSchedule_jobSchedule_Time = null;
            if (cmdletContext.JobSchedule_Time != null)
            {
                requestMatching_matching_JobSchedule_jobSchedule_Time = cmdletContext.JobSchedule_Time;
            }
            if (requestMatching_matching_JobSchedule_jobSchedule_Time != null)
            {
                requestMatching_matching_JobSchedule.Time  = requestMatching_matching_JobSchedule_jobSchedule_Time;
                requestMatching_matching_JobScheduleIsNull = false;
            }
            // determine if requestMatching_matching_JobSchedule should be set to null
            if (requestMatching_matching_JobScheduleIsNull)
            {
                requestMatching_matching_JobSchedule = null;
            }
            if (requestMatching_matching_JobSchedule != null)
            {
                request.Matching.JobSchedule = requestMatching_matching_JobSchedule;
                requestMatchingIsNull        = false;
            }
            Amazon.CustomerProfiles.Model.AutoMerging requestMatching_matching_AutoMerging = null;

            // populate AutoMerging
            var requestMatching_matching_AutoMergingIsNull = true;

            requestMatching_matching_AutoMerging = new Amazon.CustomerProfiles.Model.AutoMerging();
            System.Boolean?requestMatching_matching_AutoMerging_autoMerging_Enabled = null;
            if (cmdletContext.AutoMerging_Enabled != null)
            {
                requestMatching_matching_AutoMerging_autoMerging_Enabled = cmdletContext.AutoMerging_Enabled.Value;
            }
            if (requestMatching_matching_AutoMerging_autoMerging_Enabled != null)
            {
                requestMatching_matching_AutoMerging.Enabled = requestMatching_matching_AutoMerging_autoMerging_Enabled.Value;
                requestMatching_matching_AutoMergingIsNull   = false;
            }
            Amazon.CustomerProfiles.Model.Consolidation requestMatching_matching_AutoMerging_matching_AutoMerging_Consolidation = null;

            // populate Consolidation
            var requestMatching_matching_AutoMerging_matching_AutoMerging_ConsolidationIsNull = true;

            requestMatching_matching_AutoMerging_matching_AutoMerging_Consolidation = new Amazon.CustomerProfiles.Model.Consolidation();
            List <List <System.String> > requestMatching_matching_AutoMerging_matching_AutoMerging_Consolidation_consolidation_MatchingAttributesList = null;

            if (cmdletContext.Consolidation_MatchingAttributesList != null)
            {
                requestMatching_matching_AutoMerging_matching_AutoMerging_Consolidation_consolidation_MatchingAttributesList = cmdletContext.Consolidation_MatchingAttributesList;
            }
            if (requestMatching_matching_AutoMerging_matching_AutoMerging_Consolidation_consolidation_MatchingAttributesList != null)
            {
                requestMatching_matching_AutoMerging_matching_AutoMerging_Consolidation.MatchingAttributesList = requestMatching_matching_AutoMerging_matching_AutoMerging_Consolidation_consolidation_MatchingAttributesList;
                requestMatching_matching_AutoMerging_matching_AutoMerging_ConsolidationIsNull = false;
            }
            // determine if requestMatching_matching_AutoMerging_matching_AutoMerging_Consolidation should be set to null
            if (requestMatching_matching_AutoMerging_matching_AutoMerging_ConsolidationIsNull)
            {
                requestMatching_matching_AutoMerging_matching_AutoMerging_Consolidation = null;
            }
            if (requestMatching_matching_AutoMerging_matching_AutoMerging_Consolidation != null)
            {
                requestMatching_matching_AutoMerging.Consolidation = requestMatching_matching_AutoMerging_matching_AutoMerging_Consolidation;
                requestMatching_matching_AutoMergingIsNull         = false;
            }
            Amazon.CustomerProfiles.Model.ConflictResolution requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution = null;

            // populate ConflictResolution
            var requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolutionIsNull = true;

            requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution = new Amazon.CustomerProfiles.Model.ConflictResolution();
            Amazon.CustomerProfiles.ConflictResolvingModel requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution_conflictResolution_ConflictResolvingModel = null;
            if (cmdletContext.ConflictResolution_ConflictResolvingModel != null)
            {
                requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution_conflictResolution_ConflictResolvingModel = cmdletContext.ConflictResolution_ConflictResolvingModel;
            }
            if (requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution_conflictResolution_ConflictResolvingModel != null)
            {
                requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution.ConflictResolvingModel = requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution_conflictResolution_ConflictResolvingModel;
                requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolutionIsNull = false;
            }
            System.String requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution_conflictResolution_SourceName = null;
            if (cmdletContext.ConflictResolution_SourceName != null)
            {
                requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution_conflictResolution_SourceName = cmdletContext.ConflictResolution_SourceName;
            }
            if (requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution_conflictResolution_SourceName != null)
            {
                requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution.SourceName = requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution_conflictResolution_SourceName;
                requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolutionIsNull      = false;
            }
            // determine if requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution should be set to null
            if (requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolutionIsNull)
            {
                requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution = null;
            }
            if (requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution != null)
            {
                requestMatching_matching_AutoMerging.ConflictResolution = requestMatching_matching_AutoMerging_matching_AutoMerging_ConflictResolution;
                requestMatching_matching_AutoMergingIsNull = false;
            }
            // determine if requestMatching_matching_AutoMerging should be set to null
            if (requestMatching_matching_AutoMergingIsNull)
            {
                requestMatching_matching_AutoMerging = null;
            }
            if (requestMatching_matching_AutoMerging != null)
            {
                request.Matching.AutoMerging = requestMatching_matching_AutoMerging;
                requestMatchingIsNull        = false;
            }
            // determine if request.Matching should be set to null
            if (requestMatchingIsNull)
            {
                request.Matching = null;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

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