示例#1
0
        /// <summary>
        /// Update a Flow.
        /// </summary>
        /// <param name="options"> Update Flow parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Flow </returns>
        public static FlowResource Update(UpdateFlowOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
示例#2
0
        /// <summary>
        /// Update a Flow.
        /// </summary>
        /// <param name="options"> Update Flow parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Flow </returns>
        public static async System.Threading.Tasks.Task <FlowResource> UpdateAsync(UpdateFlowOptions options,
                                                                                   ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
示例#3
0
 private static Request BuildUpdateRequest(UpdateFlowOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Studio,
                "/v2/Flows/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
示例#4
0
        /// <summary>
        /// Update a Flow.
        /// </summary>
        /// <param name="pathSid"> The SID that identifies the resource to fetch </param>
        /// <param name="status"> The status of the Flow </param>
        /// <param name="friendlyName"> The string that you assigned to describe the Flow </param>
        /// <param name="definition"> JSON representation of flow definition </param>
        /// <param name="commitMessage"> Description on change made in the revision </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Flow </returns>
        public static async System.Threading.Tasks.Task <FlowResource> UpdateAsync(string pathSid,
                                                                                   FlowResource.StatusEnum status,
                                                                                   string friendlyName      = null,
                                                                                   object definition        = null,
                                                                                   string commitMessage     = null,
                                                                                   ITwilioRestClient client = null)
        {
            var options = new UpdateFlowOptions(pathSid, status)
            {
                FriendlyName = friendlyName, Definition = definition, CommitMessage = commitMessage
            };

            return(await UpdateAsync(options, client));
        }
示例#5
0
        /// <summary>
        /// Update a Flow.
        /// </summary>
        /// <param name="pathSid"> The SID that identifies the resource to fetch </param>
        /// <param name="status"> The status of the Flow </param>
        /// <param name="friendlyName"> The string that you assigned to describe the Flow </param>
        /// <param name="definition"> JSON representation of flow definition </param>
        /// <param name="commitMessage"> Description on change made in the revision </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Flow </returns>
        public static FlowResource Update(string pathSid,
                                          FlowResource.StatusEnum status,
                                          string friendlyName      = null,
                                          object definition        = null,
                                          string commitMessage     = null,
                                          ITwilioRestClient client = null)
        {
            var options = new UpdateFlowOptions(pathSid, status)
            {
                FriendlyName = friendlyName, Definition = definition, CommitMessage = commitMessage
            };

            return(Update(options, client));
        }