private Amazon.CloudWatchEvidently.Model.UpdateLaunchResponse CallAWSServiceOperation(IAmazonCloudWatchEvidently client, Amazon.CloudWatchEvidently.Model.UpdateLaunchRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudWatch Evidently", "UpdateLaunch"); try { #if DESKTOP return(client.UpdateLaunch(request)); #elif CORECLR return(client.UpdateLaunchAsync(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.UpdateLaunchRequest(); if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.Group != null) { request.Groups = cmdletContext.Group; } if (cmdletContext.Launch != null) { request.Launch = cmdletContext.Launch; } if (cmdletContext.MetricMonitor != null) { request.MetricMonitors = cmdletContext.MetricMonitor; } 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; } 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); }