Exemple #1
0
        public void Test_Hooks_Update()
        {
            try
            {
                HookDTO    hook    = this.GetJohnsHook();
                HookPutDTO hookPut = new HookPutDTO();
                hookPut.Status = hook.Status;
                hookPut.Url    = String.Format("http://test{0}.com", DateTime.Now.Ticks);

                HookDTO saveHook = this.Api.Hooks.Update(hookPut, hook.Id);

                Assert.AreEqual(saveHook.Id, hook.Id);
                Assert.AreEqual(hookPut.Url, saveHook.Url);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
        public async Task <HookDTO> Update(HookPutDTO hook, string hookId)
        {
            var targetUrl = $"{_baseUrl}/hooks/{hookId}";

            return(await UpdateEntity <HookDTO, HookPutDTO>(targetUrl, hook));
        }
 /// <summary>Saves a hook.</summary>
 /// <param name="hook">Hook instance to save.</param>
 /// <param name="hookId">Hook identifier.</param>
 /// <returns>Hook instance returned from API.</returns>
 public async Task <HookDTO> Update(HookPutDTO hook, String hookId)
 {
     return(await this.UpdateObject <HookDTO, HookPutDTO>(MethodKey.HooksSave, hook, hookId));
 }
 /// <summary>Saves a hook.</summary>
 /// <param name="hook">Hook instance to save.</param>
 /// <param name="hookId">Hook identifier.</param>
 /// <returns>Hook instance returned from API.</returns>
 public HookDTO Update(HookPutDTO hook, String hookId)
 {
     return(this.UpdateObject <HookDTO, HookPutDTO>(MethodKey.HooksSave, hook, hookId));
 }