private Amazon.AlexaForBusiness.Model.CreateBusinessReportScheduleResponse CallAWSServiceOperation(IAmazonAlexaForBusiness client, Amazon.AlexaForBusiness.Model.CreateBusinessReportScheduleRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Alexa For Business", "CreateBusinessReportSchedule"); try { #if DESKTOP return(client.CreateBusinessReportSchedule(request)); #elif CORECLR return(client.CreateBusinessReportScheduleAsync(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.AlexaForBusiness.Model.CreateBusinessReportScheduleRequest(); if (cmdletContext.ClientRequestToken != null) { request.ClientRequestToken = cmdletContext.ClientRequestToken; } // populate ContentRange var requestContentRangeIsNull = true; request.ContentRange = new Amazon.AlexaForBusiness.Model.BusinessReportContentRange(); Amazon.AlexaForBusiness.BusinessReportInterval requestContentRange_contentRange_Interval = null; if (cmdletContext.ContentRange_Interval != null) { requestContentRange_contentRange_Interval = cmdletContext.ContentRange_Interval; } if (requestContentRange_contentRange_Interval != null) { request.ContentRange.Interval = requestContentRange_contentRange_Interval; requestContentRangeIsNull = false; } // determine if request.ContentRange should be set to null if (requestContentRangeIsNull) { request.ContentRange = null; } if (cmdletContext.Format != null) { request.Format = cmdletContext.Format; } // populate Recurrence var requestRecurrenceIsNull = true; request.Recurrence = new Amazon.AlexaForBusiness.Model.BusinessReportRecurrence(); System.String requestRecurrence_recurrence_StartDate = null; if (cmdletContext.Recurrence_StartDate != null) { requestRecurrence_recurrence_StartDate = cmdletContext.Recurrence_StartDate; } if (requestRecurrence_recurrence_StartDate != null) { request.Recurrence.StartDate = requestRecurrence_recurrence_StartDate; requestRecurrenceIsNull = false; } // determine if request.Recurrence should be set to null if (requestRecurrenceIsNull) { request.Recurrence = null; } if (cmdletContext.S3BucketName != null) { request.S3BucketName = cmdletContext.S3BucketName; } if (cmdletContext.S3KeyPrefix != null) { request.S3KeyPrefix = cmdletContext.S3KeyPrefix; } if (cmdletContext.ScheduleName != null) { request.ScheduleName = cmdletContext.ScheduleName; } 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); }