public static RetrieveWebhookResponse CreateFromResponse(Response response)
        {
            var result = new RetrieveWebhookResponse();

            LeftRight.SetValuesToMatch(result, response);

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

            result.Webhook = ListWebhookResponse.ConvertToAWebhook(results);

            return(result);
        }
Exemple #2
0
        public async Task <RetrieveWebhookResponse> Retrieve(string id)
        {
            var request = new Request
            {
                Url    = $"/api/{client.Version}/webhooks/{id}",
                Method = "GET"
            };

            var response = await requestSender.Send(request);

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

            return(RetrieveWebhookResponse.CreateFromResponse(response));
        }