/// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update CompositionHook parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of CompositionHook </returns>
        public static CompositionHookResource Update(UpdateCompositionHookOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Beispiel #2
0
 private static Request BuildUpdateRequest(UpdateCompositionHookOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Video,
                "/v1/CompositionHooks/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathSid"> A 34-character string that uniquely identifies this Composition Hook. </param>
        /// <param name="friendlyName"> Friendly name of the Composition Hook to be shown in the console. </param>
        /// <param name="enabled"> Boolean flag for activating the Composition Hook. </param>
        /// <param name="videoLayout"> The JSON video layout description. </param>
        /// <param name="audioSources"> A list of audio sources related to this Composition Hook. </param>
        /// <param name="audioSourcesExcluded"> A list of audio sources excluded related to this Composition Hook. </param>
        /// <param name="trim"> Boolean flag for clipping intervals that have no media. </param>
        /// <param name="format"> Container format of the Composition Hook media file. Any of the following: `mp4`, `webm`.
        ///              </param>
        /// <param name="resolution"> Pixel resolution of the composed video. </param>
        /// <param name="statusCallback"> A URL that Twilio sends asynchronous webhook requests to on every composition event.
        ///                      </param>
        /// <param name="statusCallbackMethod"> HTTP method Twilio should use when requesting the above URL. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CompositionHook </returns>
        public static async System.Threading.Tasks.Task <CompositionHookResource> UpdateAsync(string pathSid,
                                                                                              string friendlyName,
                                                                                              bool?enabled                       = null,
                                                                                              object videoLayout                 = null,
                                                                                              List <string> audioSources         = null,
                                                                                              List <string> audioSourcesExcluded = null,
                                                                                              bool?trim = null,
                                                                                              CompositionHookResource.FormatEnum format = null,
                                                                                              string resolution  = null,
                                                                                              Uri statusCallback = null,
                                                                                              Twilio.Http.HttpMethod statusCallbackMethod = null,
                                                                                              ITwilioRestClient client = null)
        {
            var options = new UpdateCompositionHookOptions(pathSid, friendlyName)
            {
                Enabled = enabled, VideoLayout = videoLayout, AudioSources = audioSources, AudioSourcesExcluded = audioSourcesExcluded, Trim = trim, Format = format, Resolution = resolution, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update CompositionHook parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CompositionHook </returns>
        public static async System.Threading.Tasks.Task <CompositionHookResource> UpdateAsync(UpdateCompositionHookOptions options,
                                                                                              ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }