Ejemplo n.º 1
0
 private Amazon.Proton.Model.UpdateAccountSettingsResponse CallAWSServiceOperation(IAmazonProton client, Amazon.Proton.Model.UpdateAccountSettingsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Proton", "UpdateAccountSettings");
     try
     {
         #if DESKTOP
         return(client.UpdateAccountSettings(request));
         #elif CORECLR
         return(client.UpdateAccountSettingsAsync(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;
     }
 }
Ejemplo n.º 2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Proton.Model.UpdateAccountSettingsRequest();


            // populate PipelineProvisioningRepository
            var requestPipelineProvisioningRepositoryIsNull = true;

            request.PipelineProvisioningRepository = new Amazon.Proton.Model.RepositoryBranchInput();
            System.String requestPipelineProvisioningRepository_pipelineProvisioningRepository_Branch = null;
            if (cmdletContext.PipelineProvisioningRepository_Branch != null)
            {
                requestPipelineProvisioningRepository_pipelineProvisioningRepository_Branch = cmdletContext.PipelineProvisioningRepository_Branch;
            }
            if (requestPipelineProvisioningRepository_pipelineProvisioningRepository_Branch != null)
            {
                request.PipelineProvisioningRepository.Branch = requestPipelineProvisioningRepository_pipelineProvisioningRepository_Branch;
                requestPipelineProvisioningRepositoryIsNull   = false;
            }
            System.String requestPipelineProvisioningRepository_pipelineProvisioningRepository_Name = null;
            if (cmdletContext.PipelineProvisioningRepository_Name != null)
            {
                requestPipelineProvisioningRepository_pipelineProvisioningRepository_Name = cmdletContext.PipelineProvisioningRepository_Name;
            }
            if (requestPipelineProvisioningRepository_pipelineProvisioningRepository_Name != null)
            {
                request.PipelineProvisioningRepository.Name = requestPipelineProvisioningRepository_pipelineProvisioningRepository_Name;
                requestPipelineProvisioningRepositoryIsNull = false;
            }
            Amazon.Proton.RepositoryProvider requestPipelineProvisioningRepository_pipelineProvisioningRepository_Provider = null;
            if (cmdletContext.PipelineProvisioningRepository_Provider != null)
            {
                requestPipelineProvisioningRepository_pipelineProvisioningRepository_Provider = cmdletContext.PipelineProvisioningRepository_Provider;
            }
            if (requestPipelineProvisioningRepository_pipelineProvisioningRepository_Provider != null)
            {
                request.PipelineProvisioningRepository.Provider = requestPipelineProvisioningRepository_pipelineProvisioningRepository_Provider;
                requestPipelineProvisioningRepositoryIsNull     = false;
            }
            // determine if request.PipelineProvisioningRepository should be set to null
            if (requestPipelineProvisioningRepositoryIsNull)
            {
                request.PipelineProvisioningRepository = null;
            }
            if (cmdletContext.PipelineServiceRoleArn != null)
            {
                request.PipelineServiceRoleArn = cmdletContext.PipelineServiceRoleArn;
            }

            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);
        }