Ejemplo n.º 1
0
 private Amazon.QLDB.Model.ExportJournalToS3Response CallAWSServiceOperation(IAmazonQLDB client, Amazon.QLDB.Model.ExportJournalToS3Request request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon QLDB", "ExportJournalToS3");
     try
     {
         #if DESKTOP
         return(client.ExportJournalToS3(request));
         #elif CORECLR
         return(client.ExportJournalToS3Async(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.QLDB.Model.ExportJournalToS3Request();

            if (cmdletContext.ExclusiveEndTime != null)
            {
                request.ExclusiveEndTime = cmdletContext.ExclusiveEndTime.Value;
            }
            if (cmdletContext.InclusiveStartTime != null)
            {
                request.InclusiveStartTime = cmdletContext.InclusiveStartTime.Value;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.RoleArn != null)
            {
                request.RoleArn = cmdletContext.RoleArn;
            }

            // populate S3ExportConfiguration
            var requestS3ExportConfigurationIsNull = true;

            request.S3ExportConfiguration = new Amazon.QLDB.Model.S3ExportConfiguration();
            System.String requestS3ExportConfiguration_s3ExportConfiguration_Bucket = null;
            if (cmdletContext.S3ExportConfiguration_Bucket != null)
            {
                requestS3ExportConfiguration_s3ExportConfiguration_Bucket = cmdletContext.S3ExportConfiguration_Bucket;
            }
            if (requestS3ExportConfiguration_s3ExportConfiguration_Bucket != null)
            {
                request.S3ExportConfiguration.Bucket = requestS3ExportConfiguration_s3ExportConfiguration_Bucket;
                requestS3ExportConfigurationIsNull   = false;
            }
            System.String requestS3ExportConfiguration_s3ExportConfiguration_Prefix = null;
            if (cmdletContext.S3ExportConfiguration_Prefix != null)
            {
                requestS3ExportConfiguration_s3ExportConfiguration_Prefix = cmdletContext.S3ExportConfiguration_Prefix;
            }
            if (requestS3ExportConfiguration_s3ExportConfiguration_Prefix != null)
            {
                request.S3ExportConfiguration.Prefix = requestS3ExportConfiguration_s3ExportConfiguration_Prefix;
                requestS3ExportConfigurationIsNull   = false;
            }
            Amazon.QLDB.Model.S3EncryptionConfiguration requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration = null;

            // populate EncryptionConfiguration
            var requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfigurationIsNull = true;

            requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration = new Amazon.QLDB.Model.S3EncryptionConfiguration();
            System.String requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration_encryptionConfiguration_KmsKeyArn = null;
            if (cmdletContext.EncryptionConfiguration_KmsKeyArn != null)
            {
                requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration_encryptionConfiguration_KmsKeyArn = cmdletContext.EncryptionConfiguration_KmsKeyArn;
            }
            if (requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration_encryptionConfiguration_KmsKeyArn != null)
            {
                requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration.KmsKeyArn = requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration_encryptionConfiguration_KmsKeyArn;
                requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfigurationIsNull     = false;
            }
            Amazon.QLDB.S3ObjectEncryptionType requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration_encryptionConfiguration_ObjectEncryptionType = null;
            if (cmdletContext.EncryptionConfiguration_ObjectEncryptionType != null)
            {
                requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration_encryptionConfiguration_ObjectEncryptionType = cmdletContext.EncryptionConfiguration_ObjectEncryptionType;
            }
            if (requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration_encryptionConfiguration_ObjectEncryptionType != null)
            {
                requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration.ObjectEncryptionType = requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration_encryptionConfiguration_ObjectEncryptionType;
                requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfigurationIsNull = false;
            }
            // determine if requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration should be set to null
            if (requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfigurationIsNull)
            {
                requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration = null;
            }
            if (requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration != null)
            {
                request.S3ExportConfiguration.EncryptionConfiguration = requestS3ExportConfiguration_s3ExportConfiguration_EncryptionConfiguration;
                requestS3ExportConfigurationIsNull = false;
            }
            // determine if request.S3ExportConfiguration should be set to null
            if (requestS3ExportConfigurationIsNull)
            {
                request.S3ExportConfiguration = 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);
        }