internal CreateTableResponse CreateTable(CreateTableRequest request)
        {
            var marshaller   = new CreateTableRequestMarshaller();
            var unmarshaller = CreateTableResponseUnmarshaller.Instance;

            return(Invoke <CreateTableRequest, CreateTableResponse>(request, marshaller, unmarshaller));
        }
        public void CreateTableMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <CreateTableRequest>();
            var marshaller = new CreateTableRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest     = UTF8Encoding.UTF8.GetString(internalRequest.Content);

            Comparer.CompareObjectToJson <CreateTableRequest>(request, jsonRequest);

            var webResponse = new WebResponseData
            {
                Headers =
                {
                    { "x-amzn-RequestId", Guid.NewGuid().ToString() },
                    { "x-amz-crc32",      "0"                       }
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("CreateTable").ResponseStructure).Execute();

            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = CreateTableResponseUnmarshaller.Instance.Unmarshall(context)
                           as CreateTableResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Пример #3
0
        /// <summary>
        /// <para>The <i>CreateTable</i> operation adds a new table to your account. In an AWS account, table names must be unique within each region.
        /// That is, you can have two tables with same name if you create the tables in different regions.</para> <para> <i>CreateTable</i> is an
        /// asynchronous operation. Upon receiving a <i>CreateTable</i> request, DynamoDB immediately returns a response with a <i>TableStatus</i> of
        /// <c>CREATING</c> . After the table is created, DynamoDB sets the <i>TableStatus</i> to <c>ACTIVE</c> . You can perform read and write
        /// operations only on an <c>ACTIVE</c> table. </para> <para>If you want to create multiple tables with secondary indexes on them, you must
        /// create them sequentially. Only one table with secondary indexes can be in the <c>CREATING</c> state at any given time.</para> <para>You can
        /// use the <i>DescribeTable</i> API to check the table status.</para>
        /// </summary>
        ///
        /// <param name="createTableRequest">Container for the necessary parameters to execute the CreateTable service method on
        /// AmazonDynamoDBv2.</param>
        ///
        /// <returns>The response from the CreateTable service method, as returned by AmazonDynamoDBv2.</returns>
        ///
        /// <exception cref="T:Amazon.DynamoDBv2.Model.ResourceInUseException" />
        /// <exception cref="T:Amazon.DynamoDBv2.Model.LimitExceededException" />
        /// <exception cref="T:Amazon.DynamoDBv2.Model.InternalServerErrorException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        public Task <CreateTableResponse> CreateTableAsync(CreateTableRequest createTableRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new CreateTableRequestMarshaller();
            var unmarshaller = CreateTableResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, CreateTableRequest, CreateTableResponse>(createTableRequest, marshaller, unmarshaller, signer, cancellationToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateTable operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the CreateTable 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 <CreateTableResponse> CreateTableAsync(CreateTableRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new CreateTableRequestMarshaller();
            var unmarshaller = CreateTableResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateTableRequest, CreateTableResponse>(request, marshaller,
                                                                         unmarshaller, cancellationToken));
        }
Пример #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateTable operation.
        /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateTable operation.</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>void</returns>
        public void CreateTableAsync(CreateTableRequest request, AmazonServiceCallback callback, object state)
        {
            if (!AmazonInitializer.IsInitialized)
            {
                throw new Exception("AWSPrefab is not added to the scene");
            }

            ThreadPool.QueueUserWorkItem(new WaitCallback(delegate
            {
                var marshaller   = new CreateTableRequestMarshaller();
                var unmarshaller = CreateTableResponseUnmarshaller.Instance;
                Invoke(request, callback, state, marshaller, unmarshaller, signer);
            }));
            return;
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateTable operation.
        /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateTable 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<CreateTableResponse> CreateTableAsync(CreateTableRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateTableRequestMarshaller();
            var unmarshaller = CreateTableResponseUnmarshaller.Instance;

            return InvokeAsync<CreateTableRequest,CreateTableResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        internal CreateTableResponse CreateTable(CreateTableRequest request)
        {
            var marshaller = new CreateTableRequestMarshaller();
            var unmarshaller = CreateTableResponseUnmarshaller.Instance;

            return Invoke<CreateTableRequest,CreateTableResponse>(request, marshaller, unmarshaller);
        }
Пример #8
0
        public void CreateTableMarshallTest()
        {
            var request = InstantiateClassGenerator.Execute<CreateTableRequest>();
            var marshaller = new CreateTableRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content);                        
            Comparer.CompareObjectToJson<CreateTableRequest>(request,jsonRequest);

            var webResponse = new WebResponseData
            {
                Headers = {
                    {"x-amzn-RequestId", Guid.NewGuid().ToString()},
                    {"x-amz-crc32","0"}
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("CreateTable").ResponseStructure).Execute();
            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = CreateTableResponseUnmarshaller.Instance.Unmarshall(context)
                as CreateTableResponse;
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
 IAsyncResult invokeCreateTable(CreateTableRequest createTableRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new CreateTableRequestMarshaller().Marshall(createTableRequest);
     var unmarshaller = CreateTableResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
        /// <summary>
        /// <para>The <i>CreateTable</i> operation adds a new table to your account. In an AWS account, table names must be unique within each region.
        /// That is, you can have two tables with same name if you create the tables in different regions.</para> <para> <i>CreateTable</i> is an
        /// asynchronous operation. Upon receiving a <i>CreateTable</i> request, DynamoDB immediately returns a response with a <i>TableStatus</i> of
        /// <c>CREATING</c> . After the table is created, DynamoDB sets the <i>TableStatus</i> to <c>ACTIVE</c> . You can perform read and write
        /// operations only on an <c>ACTIVE</c> table. </para> <para>If you want to create multiple tables with secondary indexes on them, you must
        /// create them sequentially. Only one table with secondary indexes can be in the <c>CREATING</c> state at any given time.</para> <para>You can
        /// use the <i>DescribeTable</i> API to check the table status.</para>
        /// </summary>
        /// 
        /// <param name="createTableRequest">Container for the necessary parameters to execute the CreateTable service method on
        /// AmazonDynamoDBv2.</param>
        /// 
        /// <returns>The response from the CreateTable service method, as returned by AmazonDynamoDBv2.</returns>
        /// 
        /// <exception cref="T:Amazon.DynamoDBv2.Model.ResourceInUseException" />
        /// <exception cref="T:Amazon.DynamoDBv2.Model.LimitExceededException" />
        /// <exception cref="T:Amazon.DynamoDBv2.Model.InternalServerErrorException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<CreateTableResponse> CreateTableAsync(CreateTableRequest createTableRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateTableRequestMarshaller();
            var unmarshaller = CreateTableResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, CreateTableRequest, CreateTableResponse>(createTableRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the CreateTable operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateTable operation on AmazonDynamoDBClient.</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 EndCreateTable
        ///         operation.</returns>
        public IAsyncResult BeginCreateTable(CreateTableRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new CreateTableRequestMarshaller();
            var unmarshaller = CreateTableResponseUnmarshaller.Instance;

            return BeginInvoke<CreateTableRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
 /// <summary>
 /// <para> The CreateTable operation adds a new table to your account. The table name must be unique among those associated with the AWS Account
 /// issuing the request, and the AWS Region that receives the request (e.g. us-east-1). The CreateTable operation triggers an asynchronous
 /// workflow to begin creating the table. Amazon DynamoDB immediately returns the state of the table (CREATING) until the table is in the ACTIVE
 /// state. Once the table is in the ACTIVE state, you can perform data plane operations. </para>
 /// </summary>
 /// 
 /// <param name="createTableRequest">Container for the necessary parameters to execute the CreateTable service method on AmazonDynamoDB.</param>
 /// 
 /// <returns>The response from the CreateTable service method, as returned by AmazonDynamoDB.</returns>
 /// 
 /// <exception cref="ResourceInUseException"/>
 /// <exception cref="LimitExceededException"/>
 /// <exception cref="InternalServerErrorException"/>
 public CreateTableResponse CreateTable(CreateTableRequest createTableRequest)
 {
     IRequest<CreateTableRequest> request = new CreateTableRequestMarshaller().Marshall(createTableRequest);
     CreateTableResponse response = Invoke<CreateTableRequest, CreateTableResponse> (request, this.signer, CreateTableResponseUnmarshaller.GetInstance());
     return response;
 }
Пример #13
0
        /// <summary>
        /// Initiates the asynchronous execution of the CreateTable operation.
        /// <seealso cref="Amazon.DynamoDBv2.IAmazonDynamoDB.CreateTable"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the CreateTable 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 async Task<CreateTableResponse> CreateTableAsync(CreateTableRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new CreateTableRequestMarshaller();
            var unmarshaller = CreateTableResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, CreateTableRequest, CreateTableResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
 /// <summary>
 /// Initiates the asynchronous execution of the CreateTable operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the CreateTable operation on AmazonDynamoDBClient.</param>
 /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
 /// <param name="options">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>
 public void CreateTableAsync(CreateTableRequest request, AmazonServiceCallback<CreateTableRequest, CreateTableResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new CreateTableRequestMarshaller();
     var unmarshaller = CreateTableResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<CreateTableRequest,CreateTableResponse> responseObject 
                     = new AmazonServiceResult<CreateTableRequest,CreateTableResponse>((CreateTableRequest)req, (CreateTableResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<CreateTableRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }