Exemplo n.º 1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Workflow parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Workflow </returns>
        public static WorkflowResource Create(CreateWorkflowOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="pathWorkspaceSid"> The workspace_sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="configuration"> The configuration </param>
        /// <param name="assignmentCallbackUrl"> The assignment_callback_url </param>
        /// <param name="fallbackAssignmentCallbackUrl"> The fallback_assignment_callback_url </param>
        /// <param name="taskReservationTimeout"> The task_reservation_timeout </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Workflow </returns>
        public static async System.Threading.Tasks.Task <WorkflowResource> CreateAsync(string pathWorkspaceSid, string friendlyName, string configuration, Uri assignmentCallbackUrl = null, Uri fallbackAssignmentCallbackUrl = null, int?taskReservationTimeout = null, ITwilioRestClient client = null)
        {
            var options = new CreateWorkflowOptions(pathWorkspaceSid, friendlyName, configuration)
            {
                AssignmentCallbackUrl = assignmentCallbackUrl, FallbackAssignmentCallbackUrl = fallbackAssignmentCallbackUrl, TaskReservationTimeout = taskReservationTimeout
            };

            return(await CreateAsync(options, client));
        }
 private static Request BuildCreateRequest(CreateWorkflowOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/Workflows",
                postParams: options.GetParams()
                ));
 }
Exemplo n.º 4
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Workflow parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Workflow </returns>
        public static async System.Threading.Tasks.Task <WorkflowResource> CreateAsync(CreateWorkflowOptions options,
                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }