/// <summary> /// create /// </summary> /// <param name="friendlyName"> A string to describe the resource </param> /// <param name="chatServiceSid"> The SID of the chat service </param> /// <param name="channelType"> The channel type </param> /// <param name="contactIdentity"> The channel contact's Identity </param> /// <param name="enabled"> Whether the new FlexFlow is enabled </param> /// <param name="integrationType"> The integration type </param> /// <param name="integrationFlowSid"> The SID of the Flow </param> /// <param name="integrationUrl"> The External Webhook URL </param> /// <param name="integrationWorkspaceSid"> The Workspace SID for a new task </param> /// <param name="integrationWorkflowSid"> The Workflow SID for a new task </param> /// <param name="integrationChannel"> The task channel for a new task </param> /// <param name="integrationTimeout"> The task timeout in seconds for a new task </param> /// <param name="integrationPriority"> The task priority of a new task </param> /// <param name="integrationCreationOnMessage"> Whether to create a task when the first message arrives </param> /// <param name="longLived"> Reuse this chat channel for future interactions with a contact </param> /// <param name="janitorEnabled"> Remove active Proxy sessions if the corresponding Task is deleted </param> /// <param name="integrationRetryCount"> The number of times to retry the webhook if the first attempt fails </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of FlexFlow </returns> public static async System.Threading.Tasks.Task <FlexFlowResource> CreateAsync(string friendlyName, string chatServiceSid, FlexFlowResource.ChannelTypeEnum channelType, string contactIdentity = null, bool?enabled = null, FlexFlowResource.IntegrationTypeEnum integrationType = null, string integrationFlowSid = null, Uri integrationUrl = null, string integrationWorkspaceSid = null, string integrationWorkflowSid = null, string integrationChannel = null, int?integrationTimeout = null, int?integrationPriority = null, bool?integrationCreationOnMessage = null, bool?longLived = null, bool?janitorEnabled = null, int?integrationRetryCount = null, ITwilioRestClient client = null) { var options = new CreateFlexFlowOptions(friendlyName, chatServiceSid, channelType) { ContactIdentity = contactIdentity, Enabled = enabled, IntegrationType = integrationType, IntegrationFlowSid = integrationFlowSid, IntegrationUrl = integrationUrl, IntegrationWorkspaceSid = integrationWorkspaceSid, IntegrationWorkflowSid = integrationWorkflowSid, IntegrationChannel = integrationChannel, IntegrationTimeout = integrationTimeout, IntegrationPriority = integrationPriority, IntegrationCreationOnMessage = integrationCreationOnMessage, LongLived = longLived, JanitorEnabled = janitorEnabled, IntegrationRetryCount = integrationRetryCount }; return(await CreateAsync(options, client)); }
/// <summary> /// create /// </summary> /// <param name="options"> Create FlexFlow parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of FlexFlow </returns> public static FlexFlowResource Create(CreateFlexFlowOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildCreateRequest(CreateFlexFlowOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.FlexApi, "/v1/FlexFlows", postParams: options.GetParams() )); }
/// <summary> /// create /// </summary> /// <param name="friendlyName"> Human readable description of this FlexFlow </param> /// <param name="chatServiceSid"> Service Sid. </param> /// <param name="channelType"> Channel type </param> /// <param name="contactIdentity"> Channel contact Identity </param> /// <param name="enabled"> Boolean flag for enabling or disabling the FlexFlow </param> /// <param name="integrationType"> Integration type </param> /// <param name="integrationFlowSid"> Flow Sid. </param> /// <param name="integrationUrl"> External Webhook Url </param> /// <param name="integrationWorkspaceSid"> Workspace Sid for a new task </param> /// <param name="integrationWorkflowSid"> Workflow Sid for a new task </param> /// <param name="integrationChannel"> Task Channel for a new task </param> /// <param name="integrationTimeout"> Task timeout in seconds for a new task </param> /// <param name="integrationPriority"> Task priority for a new task </param> /// <param name="integrationCreationOnMessage"> Flag for task creation </param> /// <param name="longLived"> Long Lived flag for new Channel </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of FlexFlow </returns> public static FlexFlowResource Create(string friendlyName, string chatServiceSid, FlexFlowResource.ChannelTypeEnum channelType, string contactIdentity = null, bool?enabled = null, FlexFlowResource.IntegrationTypeEnum integrationType = null, string integrationFlowSid = null, Uri integrationUrl = null, string integrationWorkspaceSid = null, string integrationWorkflowSid = null, string integrationChannel = null, int?integrationTimeout = null, int?integrationPriority = null, bool?integrationCreationOnMessage = null, bool?longLived = null, ITwilioRestClient client = null) { var options = new CreateFlexFlowOptions(friendlyName, chatServiceSid, channelType) { ContactIdentity = contactIdentity, Enabled = enabled, IntegrationType = integrationType, IntegrationFlowSid = integrationFlowSid, IntegrationUrl = integrationUrl, IntegrationWorkspaceSid = integrationWorkspaceSid, IntegrationWorkflowSid = integrationWorkflowSid, IntegrationChannel = integrationChannel, IntegrationTimeout = integrationTimeout, IntegrationPriority = integrationPriority, IntegrationCreationOnMessage = integrationCreationOnMessage, LongLived = longLived }; return(Create(options, client)); }
/// <summary> /// create /// </summary> /// <param name="options"> Create FlexFlow parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of FlexFlow </returns> public static async System.Threading.Tasks.Task <FlexFlowResource> CreateAsync(CreateFlexFlowOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildCreateRequest(options, client)); return(FromJson(response.Content)); }