public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.MemoryDB.Model.BatchUpdateClusterRequest(); if (cmdletContext.ClusterName != null) { request.ClusterNames = cmdletContext.ClusterName; } // populate ServiceUpdate var requestServiceUpdateIsNull = true; request.ServiceUpdate = new Amazon.MemoryDB.Model.ServiceUpdateRequest(); System.String requestServiceUpdate_serviceUpdate_ServiceUpdateNameToApply = null; if (cmdletContext.ServiceUpdate_ServiceUpdateNameToApply != null) { requestServiceUpdate_serviceUpdate_ServiceUpdateNameToApply = cmdletContext.ServiceUpdate_ServiceUpdateNameToApply; } if (requestServiceUpdate_serviceUpdate_ServiceUpdateNameToApply != null) { request.ServiceUpdate.ServiceUpdateNameToApply = requestServiceUpdate_serviceUpdate_ServiceUpdateNameToApply; requestServiceUpdateIsNull = false; } // determine if request.ServiceUpdate should be set to null if (requestServiceUpdateIsNull) { request.ServiceUpdate = 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); }
private Amazon.MemoryDB.Model.BatchUpdateClusterResponse CallAWSServiceOperation(IAmazonMemoryDB client, Amazon.MemoryDB.Model.BatchUpdateClusterRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon MemoryDB", "BatchUpdateCluster"); try { #if DESKTOP return(client.BatchUpdateCluster(request)); #elif CORECLR return(client.BatchUpdateClusterAsync(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; } }