コード例 #1
0
        public async Task <UpdateSubaccountResponse> Update(SubaccountUpdate subaccount)
        {
            var request = new Request
            {
                Url    = $"api/{client.Version}/subaccounts/{subaccount.Id}",
                Method = "PUT JSON",
                Data   = new
                {
                    name   = subaccount.Name,
                    status = subaccount.Status.ToString().ToLowerInvariant()
                }
            };

            var response = await requestSender.Send(request);

            if (response.StatusCode != HttpStatusCode.OK)
            {
                throw new ResponseException(response);
            }

            var results = Jsonification.DeserializeObject <dynamic>(response.Content).results;

            return(new UpdateSubaccountResponse
            {
                ReasonPhrase = response.ReasonPhrase,
                StatusCode = response.StatusCode,
                Content = response.Content
            });
        }
コード例 #2
0
        public async Task<UpdateSubaccountResponse> Update(SubaccountUpdate subaccount)
        {
            var request = new Request
            {
                Url = $"api/{client.Version}/subaccounts/{subaccount.Id}",
                Method = "PUT JSON",
                Data = new
                {
                    name = subaccount.Name,
                    status = subaccount.Status.ToString().ToLowerInvariant()
                }
            };

            var response = await requestSender.Send(request);
            if (response.StatusCode != HttpStatusCode.OK) throw new ResponseException(response);

            var results = Jsonification.DeserializeObject<dynamic>(response.Content).results;

            return new UpdateSubaccountResponse
            {
                ReasonPhrase = response.ReasonPhrase,
                StatusCode = response.StatusCode,
                Content = response.Content
            };
        }