/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            UpdateAccessKeyResponse response = new UpdateAccessKeyResponse();

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

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

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

            return(response);
        }
Пример #2
0
        private static void UpdateAccessKey(String UAccessKeyId, String Status, String UserName = "")
        {
            if (String.IsNullOrEmpty(Token))
            {
                stsClient = new AmazonIdentityManagementServiceClient(AccessKeyId, SecretKey, iamconfig);
            }
            else
            {
                stsClient = new AmazonIdentityManagementServiceClient(AccessKeyId, SecretKey, Token, iamconfig);
            }

            UpdateAccessKeyRequest req = new UpdateAccessKeyRequest(UAccessKeyId, Status);

            if (!String.IsNullOrEmpty(UserName))
            {
                req.UserName = UserName;
            }

            try
            {
                UpdateAccessKeyResponse response = stsClient.UpdateAccessKey(req);
                Console.WriteLine("User updated");
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error occured while creating user. " + ex.ToString());
            }
        }
Пример #3
0
        public static UpdateAccessKeyResponse Unmarshall(UnmarshallerContext context)
        {
            UpdateAccessKeyResponse updateAccessKeyResponse = new UpdateAccessKeyResponse();

            updateAccessKeyResponse.HttpResponse = context.HttpResponse;
            updateAccessKeyResponse.RequestId    = context.StringValue("UpdateAccessKey.RequestId");

            return(updateAccessKeyResponse);
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            UpdateAccessKeyResponse response = new UpdateAccessKeyResponse();

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


            return(response);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, UpdateAccessKeyResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

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

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                }
            }

            return;
        }