Exemplo n.º 1
0
        public async Task <Address> PatchAdminAddress(string addressID, Address patch, VerifiedUserContext user)
        {
            var current = await new OrderCloudClientWithContext(user).AdminAddresses.GetAsync <Address>(addressID);
            var patched = PatchHelper.PatchObject(patch, current);

            await ValidateAddress(patched);

            return(await new OrderCloudClientWithContext(user).AdminAddresses.PatchAsync(addressID, patch as PartialAddress));
        }
Exemplo n.º 2
0
        public async Task PatchMeAddress(string addressID, BuyerAddress patch, VerifiedUserContext user)
        {
            var current = await new OrderCloudClientWithContext(user).Me.GetAddressAsync <BuyerAddress>(addressID);
            var patched = PatchHelper.PatchObject(patch, current);

            await ValidateAddress(patched);

            await new OrderCloudClientWithContext(user).Me.PatchAddressAsync(addressID, (PartialBuyerAddress)patch);
        }
Exemplo n.º 3
0
        public async Task <Address> PatchAdminAddress(string addressID, Address patch, VerifiedUserContext user)
        {
            var current = await _oc.AdminAddresses.GetAsync <Address>(addressID, user.AccessToken);

            var patched = PatchHelper.PatchObject(patch, current);

            await ValidateAddress(patched);

            return(await _oc.AdminAddresses.PatchAsync(addressID, patch as PartialAddress, user.AccessToken));
        }
Exemplo n.º 4
0
        public async Task PatchMeAddress(string addressID, BuyerAddress patch, VerifiedUserContext user)
        {
            var current = await _oc.Me.GetAddressAsync <BuyerAddress>(addressID, user.AccessToken);

            var patched = PatchHelper.PatchObject(patch, current);

            await ValidateAddress(patched);

            await _oc.Me.PatchAddressAsync(addressID, (PartialBuyerAddress)patch, user.AccessToken);
        }
Exemplo n.º 5
0
        public async Task <Address> PatchAdminAddress(string addressID, Address patch, DecodedToken decodedToken)
        {
            var current = await _oc.AdminAddresses.GetAsync <Address>(addressID, decodedToken.AccessToken);

            var patched = PatchHelper.PatchObject(patch, current);

            await ValidateAddress(patched);

            return(await _oc.AdminAddresses.PatchAsync(addressID, patch as PartialAddress, decodedToken.AccessToken));
        }
Exemplo n.º 6
0
        public async Task PatchMeAddress(string addressID, BuyerAddress patch, DecodedToken decodedToken)
        {
            var current = await _oc.Me.GetAddressAsync <BuyerAddress>(addressID, decodedToken.AccessToken);

            var patched = PatchHelper.PatchObject(patch, current);

            await ValidateAddress(patched);

            await _oc.Me.PatchAddressAsync(addressID, (PartialBuyerAddress)patch, decodedToken.AccessToken);
        }