Exemplo n.º 1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.DynamoDBv2.Model.UpdateContinuousBackupsRequest();


            // populate PointInTimeRecoverySpecification
            var requestPointInTimeRecoverySpecificationIsNull = true;

            request.PointInTimeRecoverySpecification = new Amazon.DynamoDBv2.Model.PointInTimeRecoverySpecification();
            System.Boolean?requestPointInTimeRecoverySpecification_pointInTimeRecoverySpecification_PointInTimeRecoveryEnabled = null;
            if (cmdletContext.PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled != null)
            {
                requestPointInTimeRecoverySpecification_pointInTimeRecoverySpecification_PointInTimeRecoveryEnabled = cmdletContext.PointInTimeRecoverySpecification_PointInTimeRecoveryEnabled.Value;
            }
            if (requestPointInTimeRecoverySpecification_pointInTimeRecoverySpecification_PointInTimeRecoveryEnabled != null)
            {
                request.PointInTimeRecoverySpecification.PointInTimeRecoveryEnabled = requestPointInTimeRecoverySpecification_pointInTimeRecoverySpecification_PointInTimeRecoveryEnabled.Value;
                requestPointInTimeRecoverySpecificationIsNull = false;
            }
            // determine if request.PointInTimeRecoverySpecification should be set to null
            if (requestPointInTimeRecoverySpecificationIsNull)
            {
                request.PointInTimeRecoverySpecification = null;
            }
            if (cmdletContext.TableName != null)
            {
                request.TableName = cmdletContext.TableName;
            }

            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);
        }
Exemplo n.º 2
0
 private Amazon.DynamoDBv2.Model.UpdateContinuousBackupsResponse CallAWSServiceOperation(IAmazonDynamoDB client, Amazon.DynamoDBv2.Model.UpdateContinuousBackupsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon DynamoDB", "UpdateContinuousBackups");
     try
     {
         #if DESKTOP
         return(client.UpdateContinuousBackups(request));
         #elif CORECLR
         return(client.UpdateContinuousBackupsAsync(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;
     }
 }