private Amazon.SimpleSystemsManagement.Model.UpdatePatchBaselineResponse CallAWSServiceOperation(IAmazonSimpleSystemsManagement client, Amazon.SimpleSystemsManagement.Model.UpdatePatchBaselineRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Systems Manager", "UpdatePatchBaseline"); try { #if DESKTOP return(client.UpdatePatchBaseline(request)); #elif CORECLR return(client.UpdatePatchBaselineAsync(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.SimpleSystemsManagement.Model.UpdatePatchBaselineRequest(); // populate ApprovalRules var requestApprovalRulesIsNull = true; request.ApprovalRules = new Amazon.SimpleSystemsManagement.Model.PatchRuleGroup(); List <Amazon.SimpleSystemsManagement.Model.PatchRule> requestApprovalRules_approvalRules_PatchRule = null; if (cmdletContext.ApprovalRules_PatchRule != null) { requestApprovalRules_approvalRules_PatchRule = cmdletContext.ApprovalRules_PatchRule; } if (requestApprovalRules_approvalRules_PatchRule != null) { request.ApprovalRules.PatchRules = requestApprovalRules_approvalRules_PatchRule; requestApprovalRulesIsNull = false; } // determine if request.ApprovalRules should be set to null if (requestApprovalRulesIsNull) { request.ApprovalRules = null; } if (cmdletContext.ApprovedPatch != null) { request.ApprovedPatches = cmdletContext.ApprovedPatch; } if (cmdletContext.ApprovedPatchesComplianceLevel != null) { request.ApprovedPatchesComplianceLevel = cmdletContext.ApprovedPatchesComplianceLevel; } if (cmdletContext.ApprovedPatchesEnableNonSecurity != null) { request.ApprovedPatchesEnableNonSecurity = cmdletContext.ApprovedPatchesEnableNonSecurity.Value; } if (cmdletContext.BaselineId != null) { request.BaselineId = cmdletContext.BaselineId; } if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } // populate GlobalFilters var requestGlobalFiltersIsNull = true; request.GlobalFilters = new Amazon.SimpleSystemsManagement.Model.PatchFilterGroup(); List <Amazon.SimpleSystemsManagement.Model.PatchFilter> requestGlobalFilters_globalFilters_PatchFilter = null; if (cmdletContext.GlobalFilters_PatchFilter != null) { requestGlobalFilters_globalFilters_PatchFilter = cmdletContext.GlobalFilters_PatchFilter; } if (requestGlobalFilters_globalFilters_PatchFilter != null) { request.GlobalFilters.PatchFilters = requestGlobalFilters_globalFilters_PatchFilter; requestGlobalFiltersIsNull = false; } // determine if request.GlobalFilters should be set to null if (requestGlobalFiltersIsNull) { request.GlobalFilters = null; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } if (cmdletContext.RejectedPatch != null) { request.RejectedPatches = cmdletContext.RejectedPatch; } if (cmdletContext.RejectedPatchesAction != null) { request.RejectedPatchesAction = cmdletContext.RejectedPatchesAction; } if (cmdletContext.Replace != null) { request.Replace = cmdletContext.Replace.Value; } if (cmdletContext.Source != null) { request.Sources = cmdletContext.Source; } 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); }
/// <summary> /// Modifies an existing patch baseline. Fields not specified in the request are left /// unchanged. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdatePatchBaseline service method.</param> /// /// <returns>The response from the UpdatePatchBaseline service method, as returned by SimpleSystemsManagement.</returns> /// <exception cref="Amazon.SimpleSystemsManagement.Model.DoesNotExistException"> /// Error returned when the ID specified for a resource (e.g. a Maintenance Window) doesn’t /// exist. /// </exception> /// <exception cref="Amazon.SimpleSystemsManagement.Model.InternalServerErrorException"> /// An error occurred on the server side. /// </exception> public UpdatePatchBaselineResponse UpdatePatchBaseline(UpdatePatchBaselineRequest request) { var marshaller = new UpdatePatchBaselineRequestMarshaller(); var unmarshaller = UpdatePatchBaselineResponseUnmarshaller.Instance; return Invoke<UpdatePatchBaselineRequest,UpdatePatchBaselineResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the UpdatePatchBaseline operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdatePatchBaseline operation on AmazonSimpleSystemsManagementClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdatePatchBaseline /// operation.</returns> public IAsyncResult BeginUpdatePatchBaseline(UpdatePatchBaselineRequest request, AsyncCallback callback, object state) { var marshaller = new UpdatePatchBaselineRequestMarshaller(); var unmarshaller = UpdatePatchBaselineResponseUnmarshaller.Instance; return BeginInvoke<UpdatePatchBaselineRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the UpdatePatchBaseline operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdatePatchBaseline operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<UpdatePatchBaselineResponse> UpdatePatchBaselineAsync(UpdatePatchBaselineRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdatePatchBaselineRequestMarshaller(); var unmarshaller = UpdatePatchBaselineResponseUnmarshaller.Instance; return InvokeAsync<UpdatePatchBaselineRequest,UpdatePatchBaselineResponse>(request, marshaller, unmarshaller, cancellationToken); }