public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.CodeGuruProfiler.Model.UpdateProfilingGroupRequest(); // populate AgentOrchestrationConfig var requestAgentOrchestrationConfigIsNull = true; request.AgentOrchestrationConfig = new Amazon.CodeGuruProfiler.Model.AgentOrchestrationConfig(); System.Boolean?requestAgentOrchestrationConfig_agentOrchestrationConfig_ProfilingEnabled = null; if (cmdletContext.AgentOrchestrationConfig_ProfilingEnabled != null) { requestAgentOrchestrationConfig_agentOrchestrationConfig_ProfilingEnabled = cmdletContext.AgentOrchestrationConfig_ProfilingEnabled.Value; } if (requestAgentOrchestrationConfig_agentOrchestrationConfig_ProfilingEnabled != null) { request.AgentOrchestrationConfig.ProfilingEnabled = requestAgentOrchestrationConfig_agentOrchestrationConfig_ProfilingEnabled.Value; requestAgentOrchestrationConfigIsNull = false; } // determine if request.AgentOrchestrationConfig should be set to null if (requestAgentOrchestrationConfigIsNull) { request.AgentOrchestrationConfig = null; } if (cmdletContext.ProfilingGroupName != null) { request.ProfilingGroupName = cmdletContext.ProfilingGroupName; } 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); }
private Amazon.CodeGuruProfiler.Model.UpdateProfilingGroupResponse CallAWSServiceOperation(IAmazonCodeGuruProfiler client, Amazon.CodeGuruProfiler.Model.UpdateProfilingGroupRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CodeGuru Profiler", "UpdateProfilingGroup"); try { #if DESKTOP return(client.UpdateProfilingGroup(request)); #elif CORECLR return(client.UpdateProfilingGroupAsync(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; } }