Esempio n. 1
0
    internal async Task <System.Net.HttpStatusCode> UpdateAttributes(UpdateUserAttributesRequest a)
    {
        AmazonCognitoIdentityProviderClient provider = new AmazonCognitoIdentityProviderClient(new Amazon.Runtime.AnonymousAWSCredentials());
        UpdateUserAttributesResponse        resp     = await provider.UpdateUserAttributesAsync(a);

        return(resp.HttpStatusCode);
    }
        /// <summary>
        /// Updates the user's attributes defined in the attributes parameter (one at a time)
        /// using an asynchronous call
        /// </summary>
        /// <param name="attributes">The attributes to be updated</param>
        public async Task <List <CodeDeliveryDetailsType> > UpdateAttributesAsync(IDictionary <string, string> attributes)
        {
            UpdateUserAttributesRequest updateUserAttributesRequest =
                CreateUpdateUserAttributesRequest(attributes);

            UpdateUserAttributesResponse response = await Provider.UpdateUserAttributesAsync(updateUserAttributesRequest).ConfigureAwait(false);

            //Update the local Attributes property
            foreach (KeyValuePair <string, string> entry in attributes)
            {
                Attributes[entry.Key] = entry.Value;
            }

            return(response.CodeDeliveryDetailsList);
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            UpdateUserAttributesResponse response = new UpdateUserAttributesResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("CodeDeliveryDetailsList", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <CodeDeliveryDetailsType, CodeDeliveryDetailsTypeUnmarshaller>(CodeDeliveryDetailsTypeUnmarshaller.Instance);
                    response.CodeDeliveryDetailsList = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }