Exemple #1
0
        public static DescribeSnapshotsResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeSnapshotsResponse describeSnapshotsResponse = new DescribeSnapshotsResponse();

            describeSnapshotsResponse.HttpResponse = context.HttpResponse;
            describeSnapshotsResponse.RequestId    = context.StringValue("DescribeSnapshots.RequestId");
            describeSnapshotsResponse.TotalCount   = context.IntegerValue("DescribeSnapshots.TotalCount");
            describeSnapshotsResponse.PageNumber   = context.IntegerValue("DescribeSnapshots.PageNumber");
            describeSnapshotsResponse.PageSize     = context.IntegerValue("DescribeSnapshots.PageSize");

            List <DescribeSnapshotsResponse.DescribeSnapshots_Snapshot> describeSnapshotsResponse_snapshots = new List <DescribeSnapshotsResponse.DescribeSnapshots_Snapshot>();

            for (int i = 0; i < context.Length("DescribeSnapshots.Snapshots.Length"); i++)
            {
                DescribeSnapshotsResponse.DescribeSnapshots_Snapshot snapshot = new DescribeSnapshotsResponse.DescribeSnapshots_Snapshot();
                snapshot.SnapshotId        = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].SnapshotId");
                snapshot.SnapshotName      = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].SnapshotName");
                snapshot.Progress          = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].Progress");
                snapshot.ProductCode       = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].ProductCode");
                snapshot.SourceDiskId      = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].SourceDiskId");
                snapshot.SourceDiskType    = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].SourceDiskType");
                snapshot.Encrypted         = context.BooleanValue("DescribeSnapshots.Snapshots[" + i + "].Encrypted");
                snapshot.SourceDiskSize    = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].SourceDiskSize");
                snapshot.Description       = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].Description");
                snapshot.CreationTime      = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].CreationTime");
                snapshot.Status            = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].Status");
                snapshot.Usage             = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].Usage");
                snapshot.SourceStorageType = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].SourceStorageType");

                List <DescribeSnapshotsResponse.DescribeSnapshots_Snapshot.DescribeSnapshots_Tag> snapshot_tags = new List <DescribeSnapshotsResponse.DescribeSnapshots_Snapshot.DescribeSnapshots_Tag>();
                for (int j = 0; j < context.Length("DescribeSnapshots.Snapshots[" + i + "].Tags.Length"); j++)
                {
                    DescribeSnapshotsResponse.DescribeSnapshots_Snapshot.DescribeSnapshots_Tag tag = new DescribeSnapshotsResponse.DescribeSnapshots_Snapshot.DescribeSnapshots_Tag();
                    tag.TagKey   = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].Tags[" + j + "].TagKey");
                    tag.TagValue = context.StringValue("DescribeSnapshots.Snapshots[" + i + "].Tags[" + j + "].TagValue");

                    snapshot_tags.Add(tag);
                }
                snapshot.Tags = snapshot_tags;

                describeSnapshotsResponse_snapshots.Add(snapshot);
            }
            describeSnapshotsResponse.Snapshots = describeSnapshotsResponse_snapshots;

            return(describeSnapshotsResponse);
        }
        public static DescribeSnapshotsResponse Unmarshall(UnmarshallerContext _ctx)
        {
            DescribeSnapshotsResponse describeSnapshotsResponse = new DescribeSnapshotsResponse();

            describeSnapshotsResponse.HttpResponse = _ctx.HttpResponse;
            describeSnapshotsResponse.RequestId    = _ctx.StringValue("DescribeSnapshots.RequestId");
            describeSnapshotsResponse.TotalCount   = _ctx.IntegerValue("DescribeSnapshots.TotalCount");
            describeSnapshotsResponse.PageNumber   = _ctx.IntegerValue("DescribeSnapshots.PageNumber");
            describeSnapshotsResponse.PageSize     = _ctx.IntegerValue("DescribeSnapshots.PageSize");

            List <DescribeSnapshotsResponse.DescribeSnapshots_Snapshot> describeSnapshotsResponse_snapshots = new List <DescribeSnapshotsResponse.DescribeSnapshots_Snapshot>();

            for (int i = 0; i < _ctx.Length("DescribeSnapshots.Snapshots.Length"); i++)
            {
                DescribeSnapshotsResponse.DescribeSnapshots_Snapshot snapshot = new DescribeSnapshotsResponse.DescribeSnapshots_Snapshot();
                snapshot.SnapshotId        = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].SnapshotId");
                snapshot.SnapshotSN        = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].SnapshotSN");
                snapshot.SnapshotName      = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].SnapshotName");
                snapshot.Progress          = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].Progress");
                snapshot.ProductCode       = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].ProductCode");
                snapshot.SourceDiskId      = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].SourceDiskId");
                snapshot.SourceDiskType    = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].SourceDiskType");
                snapshot.RetentionDays     = _ctx.IntegerValue("DescribeSnapshots.Snapshots[" + i + "].RetentionDays");
                snapshot.Encrypted         = _ctx.BooleanValue("DescribeSnapshots.Snapshots[" + i + "].Encrypted");
                snapshot.SourceDiskSize    = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].SourceDiskSize");
                snapshot.Description       = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].Description");
                snapshot.CreationTime      = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].CreationTime");
                snapshot.LastModifiedTime  = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].LastModifiedTime");
                snapshot.Status            = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].Status");
                snapshot.Usage             = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].Usage");
                snapshot.SourceStorageType = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].SourceStorageType");
                snapshot.RemainTime        = _ctx.IntegerValue("DescribeSnapshots.Snapshots[" + i + "].RemainTime");
                snapshot.ResourceGroupId   = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].ResourceGroupId");
                snapshot.KMSKeyId          = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].KMSKeyId");
                snapshot.Category          = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].Category");
                snapshot.SnapshotType      = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].SnapshotType");

                List <DescribeSnapshotsResponse.DescribeSnapshots_Snapshot.DescribeSnapshots_Tag> snapshot_tags = new List <DescribeSnapshotsResponse.DescribeSnapshots_Snapshot.DescribeSnapshots_Tag>();
                for (int j = 0; j < _ctx.Length("DescribeSnapshots.Snapshots[" + i + "].Tags.Length"); j++)
                {
                    DescribeSnapshotsResponse.DescribeSnapshots_Snapshot.DescribeSnapshots_Tag tag = new DescribeSnapshotsResponse.DescribeSnapshots_Snapshot.DescribeSnapshots_Tag();
                    tag.TagKey   = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].Tags[" + j + "].TagKey");
                    tag.TagValue = _ctx.StringValue("DescribeSnapshots.Snapshots[" + i + "].Tags[" + j + "].TagValue");

                    snapshot_tags.Add(tag);
                }
                snapshot.Tags = snapshot_tags;

                describeSnapshotsResponse_snapshots.Add(snapshot);
            }
            describeSnapshotsResponse.Snapshots = describeSnapshotsResponse_snapshots;

            return(describeSnapshotsResponse);
        }