/// <summary>
        /// Create a new Service for Twilio Proxy
        /// </summary>
        /// <param name="friendlyName"> A human readable description of this resource. </param>
        /// <param name="defaultTtl"> Default TTL for a Session, in seconds. </param>
        /// <param name="callbackUrl"> URL Twilio will send callbacks to </param>
        /// <param name="geoMatchLevel"> Whether to find proxy numbers in the same areacode. </param>
        /// <param name="numberSelectionBehavior"> What behavior to use when choosing a proxy number. </param>
        /// <param name="interceptCallbackUrl"> A URL for Twilio call before each Interaction. </param>
        /// <param name="outOfSessionCallbackUrl"> A URL for Twilio call when a new Interaction has no Session. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Create(string friendlyName = null,
                                             int?defaultTtl      = null,
                                             Uri callbackUrl     = null,
                                             ServiceResource.GeoMatchLevelEnum geoMatchLevel = null,
                                             ServiceResource.NumberSelectionBehaviorEnum numberSelectionBehavior = null,
                                             Uri interceptCallbackUrl    = null,
                                             Uri outOfSessionCallbackUrl = null,
                                             ITwilioRestClient client    = null)
        {
            var options = new CreateServiceOptions()
            {
                FriendlyName = friendlyName, DefaultTtl = defaultTtl, CallbackUrl = callbackUrl, GeoMatchLevel = geoMatchLevel, NumberSelectionBehavior = numberSelectionBehavior, InterceptCallbackUrl = interceptCallbackUrl, OutOfSessionCallbackUrl = outOfSessionCallbackUrl
            };

            return(Create(options, client));
        }
Beispiel #2
0
        /// <summary>
        /// Create a new Service for Twilio Proxy
        /// </summary>
        /// <param name="uniqueName"> An application-defined string that uniquely identifies the resource </param>
        /// <param name="defaultTtl"> Default TTL for a Session, in seconds </param>
        /// <param name="callbackUrl"> The URL we should call when the interaction status changes </param>
        /// <param name="geoMatchLevel"> Where a proxy number must be located relative to the participant identifier </param>
        /// <param name="numberSelectionBehavior"> The preference for Proxy Number selection for the Service instance </param>
        /// <param name="interceptCallbackUrl"> The URL we call on each interaction </param>
        /// <param name="outOfSessionCallbackUrl"> The URL we call when an inbound call or SMS action occurs on a closed or
        ///                               non-existent Session </param>
        /// <param name="chatInstanceSid"> The SID of the Chat Service Instance </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Create(string uniqueName,
                                             int?defaultTtl  = null,
                                             Uri callbackUrl = null,
                                             ServiceResource.GeoMatchLevelEnum geoMatchLevel = null,
                                             ServiceResource.NumberSelectionBehaviorEnum numberSelectionBehavior = null,
                                             Uri interceptCallbackUrl    = null,
                                             Uri outOfSessionCallbackUrl = null,
                                             string chatInstanceSid      = null,
                                             ITwilioRestClient client    = null)
        {
            var options = new CreateServiceOptions(uniqueName)
            {
                DefaultTtl = defaultTtl, CallbackUrl = callbackUrl, GeoMatchLevel = geoMatchLevel, NumberSelectionBehavior = numberSelectionBehavior, InterceptCallbackUrl = interceptCallbackUrl, OutOfSessionCallbackUrl = outOfSessionCallbackUrl, ChatInstanceSid = chatInstanceSid
            };

            return(Create(options, client));
        }
        /// <summary>
        /// Update a specific Service.
        /// </summary>
        /// <param name="pathSid"> A string that uniquely identifies this Service. </param>
        /// <param name="uniqueName"> A human readable description of this resource. </param>
        /// <param name="defaultTtl"> Default TTL for Sessions in Service, in seconds. </param>
        /// <param name="callbackUrl"> URL Twilio will send callbacks to </param>
        /// <param name="geoMatchLevel"> Whether proxy number selected must be in the same area code as the participant
        ///                     identifier. </param>
        /// <param name="numberSelectionBehavior"> What behavior to use when choosing a proxy number. </param>
        /// <param name="interceptCallbackUrl"> A URL for Twilio call before each Interaction. </param>
        /// <param name="outOfSessionCallbackUrl"> A URL for Twilio call when a new Interaction has no Session. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Update(string pathSid,
                                             string uniqueName = null,
                                             int?defaultTtl    = null,
                                             Uri callbackUrl   = null,
                                             ServiceResource.GeoMatchLevelEnum geoMatchLevel = null,
                                             ServiceResource.NumberSelectionBehaviorEnum numberSelectionBehavior = null,
                                             Uri interceptCallbackUrl    = null,
                                             Uri outOfSessionCallbackUrl = null,
                                             ITwilioRestClient client    = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                UniqueName = uniqueName, DefaultTtl = defaultTtl, CallbackUrl = callbackUrl, GeoMatchLevel = geoMatchLevel, NumberSelectionBehavior = numberSelectionBehavior, InterceptCallbackUrl = interceptCallbackUrl, OutOfSessionCallbackUrl = outOfSessionCallbackUrl
            };

            return(Update(options, client));
        }
Beispiel #4
0
        /// <summary>
        /// Update a specific Service.
        /// </summary>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="uniqueName"> An application-defined string that uniquely identifies the resource </param>
        /// <param name="defaultTtl"> Default TTL for a Session, in seconds </param>
        /// <param name="callbackUrl"> The URL we should call when the interaction status changes </param>
        /// <param name="geoMatchLevel"> Where a proxy number must be located relative to the participant identifier </param>
        /// <param name="numberSelectionBehavior"> The preference for Proxy Number selection for the Service instance </param>
        /// <param name="interceptCallbackUrl"> The URL we call on each interaction </param>
        /// <param name="outOfSessionCallbackUrl"> The URL we call when an inbound call or SMS action occurs on a closed or
        ///                               non-existent Session </param>
        /// <param name="chatInstanceSid"> The SID of the Chat Service Instance </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Service </returns>
        public static async System.Threading.Tasks.Task <ServiceResource> UpdateAsync(string pathSid,
                                                                                      string uniqueName = null,
                                                                                      int?defaultTtl    = null,
                                                                                      Uri callbackUrl   = null,
                                                                                      ServiceResource.GeoMatchLevelEnum geoMatchLevel = null,
                                                                                      ServiceResource.NumberSelectionBehaviorEnum numberSelectionBehavior = null,
                                                                                      Uri interceptCallbackUrl    = null,
                                                                                      Uri outOfSessionCallbackUrl = null,
                                                                                      string chatInstanceSid      = null,
                                                                                      ITwilioRestClient client    = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                UniqueName = uniqueName, DefaultTtl = defaultTtl, CallbackUrl = callbackUrl, GeoMatchLevel = geoMatchLevel, NumberSelectionBehavior = numberSelectionBehavior, InterceptCallbackUrl = interceptCallbackUrl, OutOfSessionCallbackUrl = outOfSessionCallbackUrl, ChatInstanceSid = chatInstanceSid
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// Create a new Service for Twilio Proxy
        /// </summary>
        /// <param name="uniqueName"> The human-readable string that uniquely identifies this Service. </param>
        /// <param name="defaultTtl"> Default TTL for Sessions in Service, in seconds. </param>
        /// <param name="callbackUrl"> URL Twilio will send callbacks to </param>
        /// <param name="geoMatchLevel"> Whether proxy number selected must be in the same area code as the participant
        ///                     identifier. </param>
        /// <param name="numberSelectionBehavior"> What behavior to use when choosing a proxy number. </param>
        /// <param name="interceptCallbackUrl"> A URL for Twilio call before each Interaction. </param>
        /// <param name="outOfSessionCallbackUrl"> A URL for Twilio call when a new Interaction has no Session. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Service </returns>
        public static async System.Threading.Tasks.Task <ServiceResource> CreateAsync(string uniqueName,
                                                                                      int?defaultTtl  = null,
                                                                                      Uri callbackUrl = null,
                                                                                      ServiceResource.GeoMatchLevelEnum geoMatchLevel = null,
                                                                                      ServiceResource.NumberSelectionBehaviorEnum numberSelectionBehavior = null,
                                                                                      Uri interceptCallbackUrl    = null,
                                                                                      Uri outOfSessionCallbackUrl = null,
                                                                                      ITwilioRestClient client    = null)
        {
            var options = new CreateServiceOptions(uniqueName)
            {
                DefaultTtl = defaultTtl, CallbackUrl = callbackUrl, GeoMatchLevel = geoMatchLevel, NumberSelectionBehavior = numberSelectionBehavior, InterceptCallbackUrl = interceptCallbackUrl, OutOfSessionCallbackUrl = outOfSessionCallbackUrl
            };

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