Example #1
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketAccelerateConfigurationResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.Read())
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Status", targetDepth))
                    {
                        response.Status = StringUnmarshaller.GetInstance().Unmarshall(context);
                    }
                }
                else if (context.IsEndElement && context.CurrentDepth < originalDepth)
                {
                    return;
                }
            }
            return;
        }
Example #2
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            GetBucketAccelerateConfigurationResponse getBucketAccelerateConfigurationResponse = new GetBucketAccelerateConfigurationResponse();

            while (context.Read())
            {
                if (context.get_IsStartElement())
                {
                    UnmarshallResult(context, getBucketAccelerateConfigurationResponse);
                }
            }
            return(getBucketAccelerateConfigurationResponse);
        }
Example #3
0
        public async Task PutGetBucketAccelerateConfiguration()
        {
            await CreateTempBucketAsync(async x =>
            {
                GetBucketAccelerateConfigurationResponse getResp = await BucketClient.GetBucketAccelerateConfigurationAsync(x).ConfigureAwait(false);
                Assert.True(getResp.IsSuccess);
                Assert.False(getResp.AccelerateEnabled);

                PutBucketAccelerateConfigurationResponse putResp = await BucketClient.PutBucketAccelerateConfigurationAsync(x, true).ConfigureAwait(false);
                Assert.True(putResp.IsSuccess);

                getResp = await BucketClient.GetBucketAccelerateConfigurationAsync(x).ConfigureAwait(false);
                Assert.True(getResp.IsSuccess);
                Assert.True(getResp.AccelerateEnabled);
            }).ConfigureAwait(false);
        }
Example #4
0
    public async Task PutGetBucketAccelerateConfiguration(S3Provider provider, string _, ISimpleClient client)
    {
        await CreateTempBucketAsync(provider, client, async x =>
        {
            GetBucketAccelerateConfigurationResponse getResp = await client.GetBucketAccelerateConfigurationAsync(x).ConfigureAwait(false);
            Assert.True(getResp.IsSuccess);
            Assert.False(getResp.AccelerateEnabled);

            PutBucketAccelerateConfigurationResponse putResp = await client.PutBucketAccelerateConfigurationAsync(x, true).ConfigureAwait(false);
            Assert.True(putResp.IsSuccess);

            getResp = await client.GetBucketAccelerateConfigurationAsync(x).ConfigureAwait(false);
            Assert.True(getResp.IsSuccess);
            Assert.True(getResp.AccelerateEnabled);
        }).ConfigureAwait(false);
    }
Example #5
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, GetBucketAccelerateConfigurationResponse response)
        {
            int currentDepth = context.get_CurrentDepth();
            int num          = currentDepth + 1;

            if (context.get_IsStartOfDocument())
            {
                num += 2;
            }
            while (context.Read())
            {
                if (context.get_IsStartElement() || context.get_IsAttribute())
                {
                    if (context.TestExpression("Status", num))
                    {
                        response.Status = StringUnmarshaller.GetInstance().Unmarshall(context);
                    }
                }
                else if (context.get_IsEndElement() && context.get_CurrentDepth() < currentDepth)
                {
                    break;
                }
            }
        }