private Amazon.CostExplorer.Model.CreateAnomalyMonitorResponse CallAWSServiceOperation(IAmazonCostExplorer client, Amazon.CostExplorer.Model.CreateAnomalyMonitorRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Cost Explorer", "CreateAnomalyMonitor");
     try
     {
         #if DESKTOP
         return(client.CreateAnomalyMonitor(request));
         #elif CORECLR
         return(client.CreateAnomalyMonitorAsync(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.CostExplorer.Model.CreateAnomalyMonitorRequest();


            // populate AnomalyMonitor
            var requestAnomalyMonitorIsNull = true;

            request.AnomalyMonitor = new Amazon.CostExplorer.Model.AnomalyMonitor();
            System.String requestAnomalyMonitor_anomalyMonitor_CreationDate = null;
            if (cmdletContext.AnomalyMonitor_CreationDate != null)
            {
                requestAnomalyMonitor_anomalyMonitor_CreationDate = cmdletContext.AnomalyMonitor_CreationDate;
            }
            if (requestAnomalyMonitor_anomalyMonitor_CreationDate != null)
            {
                request.AnomalyMonitor.CreationDate = requestAnomalyMonitor_anomalyMonitor_CreationDate;
                requestAnomalyMonitorIsNull         = false;
            }
            System.Int32?requestAnomalyMonitor_anomalyMonitor_DimensionalValueCount = null;
            if (cmdletContext.AnomalyMonitor_DimensionalValueCount != null)
            {
                requestAnomalyMonitor_anomalyMonitor_DimensionalValueCount = cmdletContext.AnomalyMonitor_DimensionalValueCount.Value;
            }
            if (requestAnomalyMonitor_anomalyMonitor_DimensionalValueCount != null)
            {
                request.AnomalyMonitor.DimensionalValueCount = requestAnomalyMonitor_anomalyMonitor_DimensionalValueCount.Value;
                requestAnomalyMonitorIsNull = false;
            }
            System.String requestAnomalyMonitor_anomalyMonitor_LastEvaluatedDate = null;
            if (cmdletContext.AnomalyMonitor_LastEvaluatedDate != null)
            {
                requestAnomalyMonitor_anomalyMonitor_LastEvaluatedDate = cmdletContext.AnomalyMonitor_LastEvaluatedDate;
            }
            if (requestAnomalyMonitor_anomalyMonitor_LastEvaluatedDate != null)
            {
                request.AnomalyMonitor.LastEvaluatedDate = requestAnomalyMonitor_anomalyMonitor_LastEvaluatedDate;
                requestAnomalyMonitorIsNull = false;
            }
            System.String requestAnomalyMonitor_anomalyMonitor_LastUpdatedDate = null;
            if (cmdletContext.AnomalyMonitor_LastUpdatedDate != null)
            {
                requestAnomalyMonitor_anomalyMonitor_LastUpdatedDate = cmdletContext.AnomalyMonitor_LastUpdatedDate;
            }
            if (requestAnomalyMonitor_anomalyMonitor_LastUpdatedDate != null)
            {
                request.AnomalyMonitor.LastUpdatedDate = requestAnomalyMonitor_anomalyMonitor_LastUpdatedDate;
                requestAnomalyMonitorIsNull            = false;
            }
            System.String requestAnomalyMonitor_anomalyMonitor_MonitorArn = null;
            if (cmdletContext.AnomalyMonitor_MonitorArn != null)
            {
                requestAnomalyMonitor_anomalyMonitor_MonitorArn = cmdletContext.AnomalyMonitor_MonitorArn;
            }
            if (requestAnomalyMonitor_anomalyMonitor_MonitorArn != null)
            {
                request.AnomalyMonitor.MonitorArn = requestAnomalyMonitor_anomalyMonitor_MonitorArn;
                requestAnomalyMonitorIsNull       = false;
            }
            Amazon.CostExplorer.MonitorDimension requestAnomalyMonitor_anomalyMonitor_MonitorDimension = null;
            if (cmdletContext.AnomalyMonitor_MonitorDimension != null)
            {
                requestAnomalyMonitor_anomalyMonitor_MonitorDimension = cmdletContext.AnomalyMonitor_MonitorDimension;
            }
            if (requestAnomalyMonitor_anomalyMonitor_MonitorDimension != null)
            {
                request.AnomalyMonitor.MonitorDimension = requestAnomalyMonitor_anomalyMonitor_MonitorDimension;
                requestAnomalyMonitorIsNull             = false;
            }
            System.String requestAnomalyMonitor_anomalyMonitor_MonitorName = null;
            if (cmdletContext.AnomalyMonitor_MonitorName != null)
            {
                requestAnomalyMonitor_anomalyMonitor_MonitorName = cmdletContext.AnomalyMonitor_MonitorName;
            }
            if (requestAnomalyMonitor_anomalyMonitor_MonitorName != null)
            {
                request.AnomalyMonitor.MonitorName = requestAnomalyMonitor_anomalyMonitor_MonitorName;
                requestAnomalyMonitorIsNull        = false;
            }
            Amazon.CostExplorer.Model.Expression requestAnomalyMonitor_anomalyMonitor_MonitorSpecification = null;
            if (cmdletContext.AnomalyMonitor_MonitorSpecification != null)
            {
                requestAnomalyMonitor_anomalyMonitor_MonitorSpecification = cmdletContext.AnomalyMonitor_MonitorSpecification;
            }
            if (requestAnomalyMonitor_anomalyMonitor_MonitorSpecification != null)
            {
                request.AnomalyMonitor.MonitorSpecification = requestAnomalyMonitor_anomalyMonitor_MonitorSpecification;
                requestAnomalyMonitorIsNull = false;
            }
            Amazon.CostExplorer.MonitorType requestAnomalyMonitor_anomalyMonitor_MonitorType = null;
            if (cmdletContext.AnomalyMonitor_MonitorType != null)
            {
                requestAnomalyMonitor_anomalyMonitor_MonitorType = cmdletContext.AnomalyMonitor_MonitorType;
            }
            if (requestAnomalyMonitor_anomalyMonitor_MonitorType != null)
            {
                request.AnomalyMonitor.MonitorType = requestAnomalyMonitor_anomalyMonitor_MonitorType;
                requestAnomalyMonitorIsNull        = false;
            }
            // determine if request.AnomalyMonitor should be set to null
            if (requestAnomalyMonitorIsNull)
            {
                request.AnomalyMonitor = 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);
        }