private Amazon.IoTEvents.Model.PutLoggingOptionsResponse CallAWSServiceOperation(IAmazonIoTEvents client, Amazon.IoTEvents.Model.PutLoggingOptionsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS IoT Events", "PutLoggingOptions");
     try
     {
         #if DESKTOP
         return(client.PutLoggingOptions(request));
         #elif CORECLR
         return(client.PutLoggingOptionsAsync(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.IoTEvents.Model.PutLoggingOptionsRequest();


            // populate LoggingOptions
            var requestLoggingOptionsIsNull = true;

            request.LoggingOptions = new Amazon.IoTEvents.Model.LoggingOptions();
            List <Amazon.IoTEvents.Model.DetectorDebugOption> requestLoggingOptions_loggingOptions_DetectorDebugOption = null;

            if (cmdletContext.LoggingOptions_DetectorDebugOption != null)
            {
                requestLoggingOptions_loggingOptions_DetectorDebugOption = cmdletContext.LoggingOptions_DetectorDebugOption;
            }
            if (requestLoggingOptions_loggingOptions_DetectorDebugOption != null)
            {
                request.LoggingOptions.DetectorDebugOptions = requestLoggingOptions_loggingOptions_DetectorDebugOption;
                requestLoggingOptionsIsNull = false;
            }
            System.Boolean?requestLoggingOptions_loggingOptions_Enabled = null;
            if (cmdletContext.LoggingOptions_Enabled != null)
            {
                requestLoggingOptions_loggingOptions_Enabled = cmdletContext.LoggingOptions_Enabled.Value;
            }
            if (requestLoggingOptions_loggingOptions_Enabled != null)
            {
                request.LoggingOptions.Enabled = requestLoggingOptions_loggingOptions_Enabled.Value;
                requestLoggingOptionsIsNull    = false;
            }
            Amazon.IoTEvents.LoggingLevel requestLoggingOptions_loggingOptions_Level = null;
            if (cmdletContext.LoggingOptions_Level != null)
            {
                requestLoggingOptions_loggingOptions_Level = cmdletContext.LoggingOptions_Level;
            }
            if (requestLoggingOptions_loggingOptions_Level != null)
            {
                request.LoggingOptions.Level = requestLoggingOptions_loggingOptions_Level;
                requestLoggingOptionsIsNull  = false;
            }
            System.String requestLoggingOptions_loggingOptions_RoleArn = null;
            if (cmdletContext.LoggingOptions_RoleArn != null)
            {
                requestLoggingOptions_loggingOptions_RoleArn = cmdletContext.LoggingOptions_RoleArn;
            }
            if (requestLoggingOptions_loggingOptions_RoleArn != null)
            {
                request.LoggingOptions.RoleArn = requestLoggingOptions_loggingOptions_RoleArn;
                requestLoggingOptionsIsNull    = false;
            }
            // determine if request.LoggingOptions should be set to null
            if (requestLoggingOptionsIsNull)
            {
                request.LoggingOptions = 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);
        }