public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.AuditManager.Model.CreateAssessmentRequest(); // populate AssessmentReportsDestination var requestAssessmentReportsDestinationIsNull = true; request.AssessmentReportsDestination = new Amazon.AuditManager.Model.AssessmentReportsDestination(); System.String requestAssessmentReportsDestination_assessmentReportsDestination_Destination = null; if (cmdletContext.AssessmentReportsDestination_Destination != null) { requestAssessmentReportsDestination_assessmentReportsDestination_Destination = cmdletContext.AssessmentReportsDestination_Destination; } if (requestAssessmentReportsDestination_assessmentReportsDestination_Destination != null) { request.AssessmentReportsDestination.Destination = requestAssessmentReportsDestination_assessmentReportsDestination_Destination; requestAssessmentReportsDestinationIsNull = false; } Amazon.AuditManager.AssessmentReportDestinationType requestAssessmentReportsDestination_assessmentReportsDestination_DestinationType = null; if (cmdletContext.AssessmentReportsDestination_DestinationType != null) { requestAssessmentReportsDestination_assessmentReportsDestination_DestinationType = cmdletContext.AssessmentReportsDestination_DestinationType; } if (requestAssessmentReportsDestination_assessmentReportsDestination_DestinationType != null) { request.AssessmentReportsDestination.DestinationType = requestAssessmentReportsDestination_assessmentReportsDestination_DestinationType; requestAssessmentReportsDestinationIsNull = false; } // determine if request.AssessmentReportsDestination should be set to null if (requestAssessmentReportsDestinationIsNull) { request.AssessmentReportsDestination = null; } if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.FrameworkId != null) { request.FrameworkId = cmdletContext.FrameworkId; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } if (cmdletContext.Role != null) { request.Roles = cmdletContext.Role; } // populate Scope var requestScopeIsNull = true; request.Scope = new Amazon.AuditManager.Model.Scope(); List <Amazon.AuditManager.Model.AWSAccount> requestScope_scope_AwsAccount = null; if (cmdletContext.Scope_AwsAccount != null) { requestScope_scope_AwsAccount = cmdletContext.Scope_AwsAccount; } if (requestScope_scope_AwsAccount != null) { request.Scope.AwsAccounts = requestScope_scope_AwsAccount; requestScopeIsNull = false; } List <Amazon.AuditManager.Model.AWSService> requestScope_scope_AwsService = null; if (cmdletContext.Scope_AwsService != null) { requestScope_scope_AwsService = cmdletContext.Scope_AwsService; } if (requestScope_scope_AwsService != null) { request.Scope.AwsServices = requestScope_scope_AwsService; requestScopeIsNull = false; } // determine if request.Scope should be set to null if (requestScopeIsNull) { request.Scope = 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); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.AuditManager.Model.UpdateSettingsRequest(); // populate DefaultAssessmentReportsDestination var requestDefaultAssessmentReportsDestinationIsNull = true; request.DefaultAssessmentReportsDestination = new Amazon.AuditManager.Model.AssessmentReportsDestination(); System.String requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_Destination = null; if (cmdletContext.DefaultAssessmentReportsDestination_Destination != null) { requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_Destination = cmdletContext.DefaultAssessmentReportsDestination_Destination; } if (requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_Destination != null) { request.DefaultAssessmentReportsDestination.Destination = requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_Destination; requestDefaultAssessmentReportsDestinationIsNull = false; } Amazon.AuditManager.AssessmentReportDestinationType requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_DestinationType = null; if (cmdletContext.DefaultAssessmentReportsDestination_DestinationType != null) { requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_DestinationType = cmdletContext.DefaultAssessmentReportsDestination_DestinationType; } if (requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_DestinationType != null) { request.DefaultAssessmentReportsDestination.DestinationType = requestDefaultAssessmentReportsDestination_defaultAssessmentReportsDestination_DestinationType; requestDefaultAssessmentReportsDestinationIsNull = false; } // determine if request.DefaultAssessmentReportsDestination should be set to null if (requestDefaultAssessmentReportsDestinationIsNull) { request.DefaultAssessmentReportsDestination = null; } if (cmdletContext.DefaultProcessOwner != null) { request.DefaultProcessOwners = cmdletContext.DefaultProcessOwner; } if (cmdletContext.KmsKey != null) { request.KmsKey = cmdletContext.KmsKey; } if (cmdletContext.SnsTopic != null) { request.SnsTopic = cmdletContext.SnsTopic; } 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); }