コード例 #1
0
        public Task UpdateSubscriptionCoAdminsAsync(string subscriptionId, string[] coAdminNames)
        {
            var subscription = new Subscription
            {
                CoAdminNames = new List<string>(coAdminNames)
            };

            Uri requestUri = this.CreateRequestUri(string.Format(CultureInfo.InvariantCulture, RelativePaths.Subscription, subscriptionId));
            return this.SendAsync(requestUri, new HttpMethod(Constants.HttpMethods.Patch), subscription);
        }
コード例 #2
0
        /// <summary>
        /// Updates the specified subscription.
        /// </summary>
        /// <param name="subscriptionId">The subscription id.</param>
        /// <param name="friendlyName">The friendly name.</param>
        /// <returns>Async task.</returns>
        public Task UpdateSubscriptionFriendlyNameAsync(string subscriptionId, string friendlyName)
        {
            var subscription = new Subscription
            {
                SubscriptionID = subscriptionId,
                SubscriptionName = friendlyName,
                CoAdminNames = null // null means won't change for PATCH
            };

            Uri requestUri = this.CreateRequestUri(string.Format(CultureInfo.InvariantCulture, RelativePaths.Subscription, subscriptionId));
            return this.SendAsync(requestUri, new HttpMethod(Constants.HttpMethods.Patch), subscription);
        }