Ejemplo n.º 1
0
        private void RunPreInvoke(AmazonWebServiceRequest request)
        {
            var credentials      = new BasicAWSCredentials(accessKey, secretKey);
            var handler          = new PreSignedUrlRequestHandler(credentials);
            var requestContext   = new RequestContext(false, new NullSigner());
            var responseContext  = new ResponseContext();
            var executionContext = new ExecutionContext(requestContext, responseContext);
            var marshaller       = new CopyDBClusterSnapshotRequestMarshaller();
            var clientConfig     = new AmazonDocDBConfig();

            clientConfig.RegionEndpoint    = clientRegion;
            requestContext.OriginalRequest = request;
            requestContext.Marshaller      = marshaller;
            requestContext.ClientConfig    = clientConfig;

            ReflectionHelpers.Invoke(handler, "PreInvoke", executionContext);
        }
Ejemplo n.º 2
0
        public void CopyDBClusterSnapshotMarshallTest()
        {
            var operation = service_model.FindOperation("CopyDBClusterSnapshot");

            var request         = InstantiateClassGenerator.Execute <CopyDBClusterSnapshotRequest>();
            var marshaller      = new CopyDBClusterSnapshotRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var validator       = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation);

            validator.Validate();


            var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute();
            var context         = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null);
            var response        = CopyDBClusterSnapshotResponseUnmarshaller.Instance.Unmarshall(context)
                                  as CopyDBClusterSnapshotResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initiates the asynchronous execution of the CopyDBClusterSnapshot operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CopyDBClusterSnapshot operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<CopyDBClusterSnapshotResponse> CopyDBClusterSnapshotAsync(CopyDBClusterSnapshotRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CopyDBClusterSnapshotRequestMarshaller();
            var unmarshaller = CopyDBClusterSnapshotResponseUnmarshaller.Instance;

            return InvokeAsync<CopyDBClusterSnapshotRequest,CopyDBClusterSnapshotResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a snapshot of a DB cluster. For more information on Amazon Aurora, see <a
        /// href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html">Aurora
        /// on Amazon RDS</a> in the <i>Amazon RDS User Guide.</i>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CopyDBClusterSnapshot service method.</param>
        /// 
        /// <returns>The response from the CopyDBClusterSnapshot service method, as returned by RDS.</returns>
        /// <exception cref="Amazon.RDS.Model.DBClusterSnapshotAlreadyExistsException">
        /// User already has a DB cluster snapshot with the given identifier.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.DBClusterSnapshotNotFoundException">
        /// <i>DBClusterSnapshotIdentifier</i> does not refer to an existing DB cluster snapshot.
        /// </exception>
        /// <exception cref="Amazon.RDS.Model.InvalidDBClusterStateException">
        /// The supplied value is not a valid DB cluster state.
        /// </exception>
        public CopyDBClusterSnapshotResponse CopyDBClusterSnapshot(CopyDBClusterSnapshotRequest request)
        {
            var marshaller = new CopyDBClusterSnapshotRequestMarshaller();
            var unmarshaller = CopyDBClusterSnapshotResponseUnmarshaller.Instance;

            return Invoke<CopyDBClusterSnapshotRequest,CopyDBClusterSnapshotResponse>(request, marshaller, unmarshaller);
        }
Ejemplo n.º 5
0
        public void CopyDBClusterSnapshotMarshallTest()
        {
            var operation = service_model.FindOperation("CopyDBClusterSnapshot");

            var request = InstantiateClassGenerator.Execute<CopyDBClusterSnapshotRequest>();
            var marshaller = new CopyDBClusterSnapshotRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation);
            validator.Validate();


            var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute();
            var context = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null);
            var response = CopyDBClusterSnapshotResponseUnmarshaller.Instance.Unmarshall(context)
                as CopyDBClusterSnapshotResponse;   
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);       
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initiates the asynchronous execution of the CopyDBClusterSnapshot operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CopyDBClusterSnapshot operation on AmazonRDSClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCopyDBClusterSnapshot
        ///         operation.</returns>
        public IAsyncResult BeginCopyDBClusterSnapshot(CopyDBClusterSnapshotRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CopyDBClusterSnapshotRequestMarshaller();
            var unmarshaller = CopyDBClusterSnapshotResponseUnmarshaller.Instance;

            return BeginInvoke<CopyDBClusterSnapshotRequest>(request, marshaller, unmarshaller,
                callback, state);
        }