private Amazon.DynamoDBv2.Model.RestoreTableToPointInTimeResponse CallAWSServiceOperation(IAmazonDynamoDB client, Amazon.DynamoDBv2.Model.RestoreTableToPointInTimeRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon DynamoDB", "RestoreTableToPointInTime");
     try
     {
         #if DESKTOP
         return(client.RestoreTableToPointInTime(request));
         #elif CORECLR
         return(client.RestoreTableToPointInTimeAsync(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.DynamoDBv2.Model.RestoreTableToPointInTimeRequest();

            if (cmdletContext.BillingModeOverride != null)
            {
                request.BillingModeOverride = cmdletContext.BillingModeOverride;
            }
            if (cmdletContext.GlobalSecondaryIndexOverride != null)
            {
                request.GlobalSecondaryIndexOverride = cmdletContext.GlobalSecondaryIndexOverride;
            }
            if (cmdletContext.LocalSecondaryIndexOverride != null)
            {
                request.LocalSecondaryIndexOverride = cmdletContext.LocalSecondaryIndexOverride;
            }

            // populate ProvisionedThroughputOverride
            var requestProvisionedThroughputOverrideIsNull = true;

            request.ProvisionedThroughputOverride = new Amazon.DynamoDBv2.Model.ProvisionedThroughput();
            System.Int64?requestProvisionedThroughputOverride_provisionedThroughputOverride_ReadCapacityUnit = null;
            if (cmdletContext.ProvisionedThroughputOverride_ReadCapacityUnit != null)
            {
                requestProvisionedThroughputOverride_provisionedThroughputOverride_ReadCapacityUnit = cmdletContext.ProvisionedThroughputOverride_ReadCapacityUnit.Value;
            }
            if (requestProvisionedThroughputOverride_provisionedThroughputOverride_ReadCapacityUnit != null)
            {
                request.ProvisionedThroughputOverride.ReadCapacityUnits = requestProvisionedThroughputOverride_provisionedThroughputOverride_ReadCapacityUnit.Value;
                requestProvisionedThroughputOverrideIsNull = false;
            }
            System.Int64?requestProvisionedThroughputOverride_provisionedThroughputOverride_WriteCapacityUnit = null;
            if (cmdletContext.ProvisionedThroughputOverride_WriteCapacityUnit != null)
            {
                requestProvisionedThroughputOverride_provisionedThroughputOverride_WriteCapacityUnit = cmdletContext.ProvisionedThroughputOverride_WriteCapacityUnit.Value;
            }
            if (requestProvisionedThroughputOverride_provisionedThroughputOverride_WriteCapacityUnit != null)
            {
                request.ProvisionedThroughputOverride.WriteCapacityUnits = requestProvisionedThroughputOverride_provisionedThroughputOverride_WriteCapacityUnit.Value;
                requestProvisionedThroughputOverrideIsNull = false;
            }
            // determine if request.ProvisionedThroughputOverride should be set to null
            if (requestProvisionedThroughputOverrideIsNull)
            {
                request.ProvisionedThroughputOverride = null;
            }
            if (cmdletContext.RestoreDateTime != null)
            {
                request.RestoreDateTime = cmdletContext.RestoreDateTime.Value;
            }
            if (cmdletContext.SourceTableArn != null)
            {
                request.SourceTableArn = cmdletContext.SourceTableArn;
            }
            if (cmdletContext.SourceTableName != null)
            {
                request.SourceTableName = cmdletContext.SourceTableName;
            }

            // populate SSESpecificationOverride
            var requestSSESpecificationOverrideIsNull = true;

            request.SSESpecificationOverride = new Amazon.DynamoDBv2.Model.SSESpecification();
            System.Boolean?requestSSESpecificationOverride_sSESpecificationOverride_Enabled = null;
            if (cmdletContext.SSESpecificationOverride_Enabled != null)
            {
                requestSSESpecificationOverride_sSESpecificationOverride_Enabled = cmdletContext.SSESpecificationOverride_Enabled.Value;
            }
            if (requestSSESpecificationOverride_sSESpecificationOverride_Enabled != null)
            {
                request.SSESpecificationOverride.Enabled = requestSSESpecificationOverride_sSESpecificationOverride_Enabled.Value;
                requestSSESpecificationOverrideIsNull    = false;
            }
            System.String requestSSESpecificationOverride_sSESpecificationOverride_KMSMasterKeyId = null;
            if (cmdletContext.SSESpecificationOverride_KMSMasterKeyId != null)
            {
                requestSSESpecificationOverride_sSESpecificationOverride_KMSMasterKeyId = cmdletContext.SSESpecificationOverride_KMSMasterKeyId;
            }
            if (requestSSESpecificationOverride_sSESpecificationOverride_KMSMasterKeyId != null)
            {
                request.SSESpecificationOverride.KMSMasterKeyId = requestSSESpecificationOverride_sSESpecificationOverride_KMSMasterKeyId;
                requestSSESpecificationOverrideIsNull           = false;
            }
            Amazon.DynamoDBv2.SSEType requestSSESpecificationOverride_sSESpecificationOverride_SSEType = null;
            if (cmdletContext.SSESpecificationOverride_SSEType != null)
            {
                requestSSESpecificationOverride_sSESpecificationOverride_SSEType = cmdletContext.SSESpecificationOverride_SSEType;
            }
            if (requestSSESpecificationOverride_sSESpecificationOverride_SSEType != null)
            {
                request.SSESpecificationOverride.SSEType = requestSSESpecificationOverride_sSESpecificationOverride_SSEType;
                requestSSESpecificationOverrideIsNull    = false;
            }
            // determine if request.SSESpecificationOverride should be set to null
            if (requestSSESpecificationOverrideIsNull)
            {
                request.SSESpecificationOverride = null;
            }
            if (cmdletContext.TargetTableName != null)
            {
                request.TargetTableName = cmdletContext.TargetTableName;
            }
            if (cmdletContext.UseLatestRestorableTime != null)
            {
                request.UseLatestRestorableTime = cmdletContext.UseLatestRestorableTime.Value;
            }

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