Ejemplo n.º 1
0
        /// <summary>
        /// Updates the state of the plan add-on.
        /// </summary>
        /// <param name="planId">The plan id.</param>
        /// <param name="addOnId">The add-on id.</param>
        /// <param name="newState">The new state.</param>
        public Task <PlanAddOnReference> UpdatePlanAddOnStateAsync(string planId, string addOnId, PlanState newState)
        {
            var input = new PlanAddOnReference()
            {
                AddOnId = addOnId
            };

            Uri requestUri = this.CreateRequestUri(string.Format(CultureInfo.InvariantCulture, RelativePaths.PlanAddOn, planId, addOnId));

            return(this.SendAsync <PlanAddOnReference, PlanAddOnReference>(this.CreateRequestUri(RelativePaths.PlanAddOns), HttpMethod.Put, input));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds the add-on to subscription.
        /// </summary>
        /// <param name="subscriptionId">The subscription id.</param>
        /// <param name="addOn">The add on.</param>
        /// <returns>async task</returns>
        public Task <PlanAddOnReference> SubscribeToAddOn(string subscriptionId, PlanAddOnReference addOn)
        {
            Uri requestUri = this.CreateRequestUri(string.Format(CultureInfo.InvariantCulture, RelativePaths.SubscriptionAddOns, subscriptionId));

            return(this.SendAsync <PlanAddOnReference, PlanAddOnReference>(requestUri, HttpMethod.Post, addOn));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds the add-on to plan.
        /// </summary>
        /// <param name="planId">The plan id.</param>
        /// <param name="addOn">The add on to add.</param>
        public Task <PlanAddOnReference> LinkAddOnToPlanAsync(string planId, PlanAddOnReference addOn)
        {
            Uri requestUri = this.CreateRequestUri(string.Format(CultureInfo.InvariantCulture, RelativePaths.PlanAddOns, planId));

            return(this.SendAsync <PlanAddOnReference, PlanAddOnReference>(requestUri, HttpMethod.Post, addOn));
        }