Exemple #1
0
        /// <summary>
        /// Updates the given <see cref="ShopifyWebhook"/>. Id must not be null.
        /// </summary>
        /// <param name="webhook">The <see cref="ShopifyWebhook"/> to update.</param>
        /// <returns>The updated <see cref="ShopifyWebhook"/>.</returns>
        public virtual async Task <ShopifyWebhook> UpdateAsync(ShopifyWebhook webhook)
        {
            IRestRequest req = RequestEngine.CreateRequest($"webhooks/{webhook.Id.Value}.json", Method.PUT, "webhook");

            req.AddJsonBody(new { webhook });

            return(await RequestEngine.ExecuteRequestAsync <ShopifyWebhook>(_RestClient, req));
        }
Exemple #2
0
        /// <summary>
        /// Creates a new <see cref="ShopifyWebhook"/> on the store.
        /// </summary>
        /// <param name="webhook">A new <see cref="ShopifyWebhook"/>. Id should be set to null.</param>
        /// <returns>The new <see cref="ShopifyWebhook"/>.</returns>
        public virtual async Task <ShopifyWebhook> CreateAsync(ShopifyWebhook webhook)
        {
            IRestRequest req = RequestEngine.CreateRequest("webhooks.json", Method.POST, "webhook");

            //Build the request body
            req.AddJsonBody(new { webhook });

            return(await RequestEngine.ExecuteRequestAsync <ShopifyWebhook>(_RestClient, req));
        }
        /// <summary>
        /// Creates a new <see cref="ShopifyWebhook"/> on the store.
        /// </summary>
        /// <param name="webhook">A new <see cref="ShopifyWebhook"/>. Id should be set to null.</param>
        /// <returns>The new <see cref="ShopifyWebhook"/>.</returns>
        public async Task<ShopifyWebhook> CreateAsync(ShopifyWebhook webhook)
        {
            IRestRequest req = RequestEngine.CreateRequest("webhooks.json", Method.POST, "webhook");

            //Build the request body
            req.AddJsonBody(new { webhook });

            return await RequestEngine.ExecuteRequestAsync<ShopifyWebhook>(_RestClient, req);
        }
        /// <summary>
        /// Updates the given <see cref="ShopifyWebhook"/>. Id must not be null.
        /// </summary>
        /// <param name="webhook">The <see cref="ShopifyWebhook"/> to update.</param>
        /// <returns>The updated <see cref="ShopifyWebhook"/>.</returns>
        public async Task<ShopifyWebhook> UpdateAsync(ShopifyWebhook webhook)
        {
            IRestRequest req = RequestEngine.CreateRequest($"webhooks/{webhook.Id.Value}.json", Method.PUT, "webhook");

            req.AddJsonBody(new { webhook });

            return await RequestEngine.ExecuteRequestAsync<ShopifyWebhook>(_RestClient, req);
        }