/// <summary>
        /// Creates a new ledger in your AWS account.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateLedger service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the CreateLedger service method, as returned by QLDB.</returns>
        /// <exception cref="Amazon.QLDB.Model.InvalidParameterException">
        /// One or more parameters in the request aren't valid.
        /// </exception>
        /// <exception cref="Amazon.QLDB.Model.LimitExceededException">
        /// You have reached the limit on the maximum number of resources allowed.
        /// </exception>
        /// <exception cref="Amazon.QLDB.Model.ResourceAlreadyExistsException">
        /// The specified resource already exists.
        /// </exception>
        /// <exception cref="Amazon.QLDB.Model.ResourceInUseException">
        /// The specified resource can't be modified at this time.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/CreateLedger">REST API Reference for CreateLedger Operation</seealso>
        public virtual Task <CreateLedgerResponse> CreateLedgerAsync(CreateLedgerRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CreateLedgerRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CreateLedgerResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateLedgerResponse>(request, options, cancellationToken));
        }
        internal virtual CreateLedgerResponse CreateLedger(CreateLedgerRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CreateLedgerRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CreateLedgerResponseUnmarshaller.Instance;

            return(Invoke <CreateLedgerResponse>(request, options));
        }
Example #3
0
        public void RunCreateLedger()
        {
            CreateLedgerRequest ledgerRequest = new CreateLedgerRequest
            {
                Name            = this.ledgerName,
                PermissionsMode = PermissionsMode.ALLOW_ALL
            };

            this.amazonQldbClient.CreateLedgerAsync(ledgerRequest).GetAwaiter().GetResult();
            WaitForActive(this.ledgerName);
        }