コード例 #1
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, CreateVirtualMFADeviceResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("VirtualMFADevice", targetDepth))
                    {
                        var unmarshaller = VirtualMFADeviceUnmarshaller.Instance;
                        response.VirtualMFADevice = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
            }

            return;
        }
コード例 #2
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            CreateVirtualMFADeviceResponse response = new CreateVirtualMFADeviceResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("CreateVirtualMFADeviceResult", 2))
                    {
                        UnmarshallResult(context, response);
                        continue;
                    }

                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            return(response);
        }
        public static CreateVirtualMFADeviceResponse Unmarshall(UnmarshallerContext context)
        {
            CreateVirtualMFADeviceResponse createVirtualMFADeviceResponse = new CreateVirtualMFADeviceResponse();

            createVirtualMFADeviceResponse.HttpResponse = context.HttpResponse;
            createVirtualMFADeviceResponse.RequestId    = context.StringValue("CreateVirtualMFADevice.RequestId");

            CreateVirtualMFADeviceResponse.CreateVirtualMFADevice_VirtualMFADevice virtualMFADevice = new CreateVirtualMFADeviceResponse.CreateVirtualMFADevice_VirtualMFADevice();
            virtualMFADevice.SerialNumber     = context.StringValue("CreateVirtualMFADevice.VirtualMFADevice.SerialNumber");
            virtualMFADevice.Base32StringSeed = context.StringValue("CreateVirtualMFADevice.VirtualMFADevice.Base32StringSeed");
            virtualMFADevice.QRCodePNG        = context.StringValue("CreateVirtualMFADevice.VirtualMFADevice.QRCodePNG");
            createVirtualMFADeviceResponse.VirtualMFADevice = virtualMFADevice;

            return(createVirtualMFADeviceResponse);
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            CreateVirtualMFADeviceResponse response = new CreateVirtualMFADeviceResponse();

            while (context.Read())
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("CreateVirtualMFADeviceResult", 2))
                    {
                        response.CreateVirtualMFADeviceResult = CreateVirtualMFADeviceResultUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context);
                    }
                }
            }


            return(response);
        }