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

            return(FromJson(response.Content));
        }
示例#2
0
        /// <summary>
        /// Create a Flow.
        /// </summary>
        /// <param name="options"> Create 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> CreateAsync(CreateFlowOptions options,
                                                                                   ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
示例#3
0
 private static Request BuildCreateRequest(CreateFlowOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Studio,
                "/v2/Flows",
                postParams: options.GetParams()
                ));
 }
示例#4
0
        /// <summary>
        /// Create a Flow.
        /// </summary>
        /// <param name="friendlyName"> The string that you assigned to describe the Flow </param>
        /// <param name="status"> The status of 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 Create(string friendlyName,
                                          FlowResource.StatusEnum status,
                                          object definition,
                                          string commitMessage     = null,
                                          ITwilioRestClient client = null)
        {
            var options = new CreateFlowOptions(friendlyName, status, definition)
            {
                CommitMessage = commitMessage
            };

            return(Create(options, client));
        }
示例#5
0
        /// <summary>
        /// Create a Flow.
        /// </summary>
        /// <param name="friendlyName"> The string that you assigned to describe the Flow </param>
        /// <param name="status"> The status of 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> CreateAsync(string friendlyName,
                                                                                   FlowResource.StatusEnum status,
                                                                                   object definition,
                                                                                   string commitMessage     = null,
                                                                                   ITwilioRestClient client = null)
        {
            var options = new CreateFlowOptions(friendlyName, status, definition)
            {
                CommitMessage = commitMessage
            };

            return(await CreateAsync(options, client));
        }