/// <summary> /// create /// </summary> /// <param name="options"> Create Workspace parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Workspace </returns> public static WorkspaceResource Create(CreateWorkspaceOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// create /// </summary> /// /// <param name="friendlyName"> The friendly_name </param> /// <param name="eventCallbackUrl"> The event_callback_url </param> /// <param name="eventsFilter"> The events_filter </param> /// <param name="multiTaskEnabled"> The multi_task_enabled </param> /// <param name="template"> The template </param> /// <param name="prioritizeQueueOrder"> The prioritize_queue_order </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Workspace </returns> public static async System.Threading.Tasks.Task <WorkspaceResource> CreateAsync(string friendlyName, Uri eventCallbackUrl = null, string eventsFilter = null, bool?multiTaskEnabled = null, string template = null, WorkspaceResource.QueueOrderEnum prioritizeQueueOrder = null, ITwilioRestClient client = null) { var options = new CreateWorkspaceOptions(friendlyName) { EventCallbackUrl = eventCallbackUrl, EventsFilter = eventsFilter, MultiTaskEnabled = multiTaskEnabled, Template = template, PrioritizeQueueOrder = prioritizeQueueOrder }; return(await CreateAsync(options, client)); }
private static Request BuildCreateRequest(CreateWorkspaceOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Taskrouter, "/v1/Workspaces", postParams: options.GetParams() )); }
/// <summary> /// create /// </summary> /// <param name="options"> Create Workspace parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Workspace </returns> public static async System.Threading.Tasks.Task <WorkspaceResource> CreateAsync(CreateWorkspaceOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }