public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.RDS.Model.StartDBInstanceAutomatedBackupsReplicationRequest(); if (cmdletContext.SourceRegion != null) { request.SourceRegion = cmdletContext.SourceRegion; } if (cmdletContext.BackupRetentionPeriod != null) { request.BackupRetentionPeriod = cmdletContext.BackupRetentionPeriod.Value; } if (cmdletContext.KmsKeyId != null) { request.KmsKeyId = cmdletContext.KmsKeyId; } if (cmdletContext.PreSignedUrl != null) { request.PreSignedUrl = cmdletContext.PreSignedUrl; } if (cmdletContext.SourceDBInstanceArn != null) { request.SourceDBInstanceArn = cmdletContext.SourceDBInstanceArn; } 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); }
private Amazon.RDS.Model.StartDBInstanceAutomatedBackupsReplicationResponse CallAWSServiceOperation(IAmazonRDS client, Amazon.RDS.Model.StartDBInstanceAutomatedBackupsReplicationRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Relational Database Service", "StartDBInstanceAutomatedBackupsReplication"); try { #if DESKTOP return(client.StartDBInstanceAutomatedBackupsReplication(request)); #elif CORECLR return(client.StartDBInstanceAutomatedBackupsReplicationAsync(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; } }