private Amazon.CloudWatchEvidently.Model.CreateLaunchResponse CallAWSServiceOperation(IAmazonCloudWatchEvidently client, Amazon.CloudWatchEvidently.Model.CreateLaunchRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudWatch Evidently", "CreateLaunch"); try { #if DESKTOP return(client.CreateLaunch(request)); #elif CORECLR return(client.CreateLaunchAsync(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.CloudWatchEvidently.Model.CreateLaunchRequest(); if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.Group != null) { request.Groups = cmdletContext.Group; } if (cmdletContext.MetricMonitor != null) { request.MetricMonitors = cmdletContext.MetricMonitor; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } if (cmdletContext.Project != null) { request.Project = cmdletContext.Project; } if (cmdletContext.RandomizationSalt != null) { request.RandomizationSalt = cmdletContext.RandomizationSalt; } // populate ScheduledSplitsConfig var requestScheduledSplitsConfigIsNull = true; request.ScheduledSplitsConfig = new Amazon.CloudWatchEvidently.Model.ScheduledSplitsLaunchConfig(); List <Amazon.CloudWatchEvidently.Model.ScheduledSplitConfig> requestScheduledSplitsConfig_scheduledSplitsConfig_Step = null; if (cmdletContext.ScheduledSplitsConfig_Step != null) { requestScheduledSplitsConfig_scheduledSplitsConfig_Step = cmdletContext.ScheduledSplitsConfig_Step; } if (requestScheduledSplitsConfig_scheduledSplitsConfig_Step != null) { request.ScheduledSplitsConfig.Steps = requestScheduledSplitsConfig_scheduledSplitsConfig_Step; requestScheduledSplitsConfigIsNull = false; } // determine if request.ScheduledSplitsConfig should be set to null if (requestScheduledSplitsConfigIsNull) { request.ScheduledSplitsConfig = 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); }