public static DescribeLedgerResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeLedgerResponse describeLedgerResponse = new DescribeLedgerResponse();

            describeLedgerResponse.HttpResponse = context.HttpResponse;
            describeLedgerResponse.RequestId    = context.StringValue("DescribeLedger.RequestId");

            DescribeLedgerResponse.DescribeLedger_Ledger ledger = new DescribeLedgerResponse.DescribeLedger_Ledger();
            ledger.LedgerId          = context.StringValue("DescribeLedger.Ledger.LedgerId");
            ledger.LedgerName        = context.StringValue("DescribeLedger.Ledger.LedgerName");
            ledger.LedgerDescription = context.StringValue("DescribeLedger.Ledger.LedgerDescription");
            ledger.LedgerType        = context.StringValue("DescribeLedger.Ledger.LedgerType");
            ledger.OwnerAliUid       = context.StringValue("DescribeLedger.Ledger.OwnerAliUid");
            ledger.RegionId          = context.StringValue("DescribeLedger.Ledger.RegionId");
            ledger.ZoneId            = context.StringValue("DescribeLedger.Ledger.ZoneId");
            ledger.CreateTime        = context.StringValue("DescribeLedger.Ledger.CreateTime");
            ledger.UpdateTime        = context.StringValue("DescribeLedger.Ledger.UpdateTime");
            ledger.LedgerStatus      = context.StringValue("DescribeLedger.Ledger.LedgerStatus");
            ledger.JournalCount      = context.LongValue("DescribeLedger.Ledger.JournalCount");
            ledger.MemberCount       = context.LongValue("DescribeLedger.Ledger.MemberCount");
            ledger.TimeAnchorCount   = context.LongValue("DescribeLedger.Ledger.TimeAnchorCount");

            DescribeLedgerResponse.DescribeLedger_Ledger.DescribeLedger_LastTimeAnchor lastTimeAnchor = new DescribeLedgerResponse.DescribeLedger_Ledger.DescribeLedger_LastTimeAnchor();
            lastTimeAnchor.JournalId        = context.StringValue("DescribeLedger.Ledger.LastTimeAnchor.JournalId");
            lastTimeAnchor.LedgerDigest     = context.StringValue("DescribeLedger.Ledger.LastTimeAnchor.LedgerDigest");
            lastTimeAnchor.LedgerDigestType = context.StringValue("DescribeLedger.Ledger.LastTimeAnchor.LedgerDigestType");
            lastTimeAnchor.LedgerVersion    = context.StringValue("DescribeLedger.Ledger.LastTimeAnchor.LedgerVersion");
            lastTimeAnchor.Proof            = context.StringValue("DescribeLedger.Ledger.LastTimeAnchor.Proof");
            lastTimeAnchor.TimeStamp        = context.StringValue("DescribeLedger.Ledger.LastTimeAnchor.TimeStamp");
            ledger.LastTimeAnchor           = lastTimeAnchor;
            describeLedgerResponse.Ledger   = ledger;

            return(describeLedgerResponse);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeLedgerResponse response = new DescribeLedgerResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Arn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Arn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("CreationDateTime", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.CreationDateTime = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("DeletionProtection", targetDepth))
                {
                    var unmarshaller = BoolUnmarshaller.Instance;
                    response.DeletionProtection = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("EncryptionDescription", targetDepth))
                {
                    var unmarshaller = LedgerEncryptionDescriptionUnmarshaller.Instance;
                    response.EncryptionDescription = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Name", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Name = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("PermissionsMode", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.PermissionsMode = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("State", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.State = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Exemplo n.º 3
0
        private async Task CheckIfLedgerActiveAsync()
        {
            Console.WriteLine("Waiting for ledger to become active.");
            LedgerState ledgerState = LedgerState.CREATING;

            do
            {
                DescribeLedgerResponse describeResponse = await qldbClient.DescribeLedgerAsync(new DescribeLedgerRequest
                {
                    Name = LedgerName
                });

                ledgerState = describeResponse.State;
            }while (ledgerState != LedgerState.ACTIVE);
            Console.WriteLine("Ledger is active.");
        }