Пример #1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Trunk parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Trunk </returns>
        public static TrunkResource Create(CreateTrunkOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Пример #2
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="options"> Create Trunk parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Trunk </returns>
        public static async System.Threading.Tasks.Task <TrunkResource> CreateAsync(CreateTrunkOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Пример #3
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="domainName"> The domain_name </param>
        /// <param name="disasterRecoveryUrl"> The disaster_recovery_url </param>
        /// <param name="disasterRecoveryMethod"> The disaster_recovery_method </param>
        /// <param name="recording"> The recording </param>
        /// <param name="secure"> The secure </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Trunk </returns>
        public static async System.Threading.Tasks.Task <TrunkResource> CreateAsync(string friendlyName = null, string domainName = null, Uri disasterRecoveryUrl = null, Twilio.Http.HttpMethod disasterRecoveryMethod = null, string recording = null, bool?secure = null, ITwilioRestClient client = null)
        {
            var options = new CreateTrunkOptions {
                FriendlyName = friendlyName, DomainName = domainName, DisasterRecoveryUrl = disasterRecoveryUrl, DisasterRecoveryMethod = disasterRecoveryMethod, Recording = recording, Secure = secure
            };

            return(await CreateAsync(options, client));
        }
Пример #4
0
 private static Request BuildCreateRequest(CreateTrunkOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Trunking,
                "/v1/Trunks",
                postParams: options.GetParams()
                ));
 }
Пример #5
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="domainName"> The domain_name </param>
        /// <param name="disasterRecoveryUrl"> The disaster_recovery_url </param>
        /// <param name="disasterRecoveryMethod"> The disaster_recovery_method </param>
        /// <param name="recording"> The recording </param>
        /// <param name="secure"> The secure </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Trunk </returns>
        public static TrunkResource Create(string friendlyName     = null,
                                           string domainName       = null,
                                           Uri disasterRecoveryUrl = null,
                                           Twilio.Http.HttpMethod disasterRecoveryMethod = null,
                                           string recording         = null,
                                           bool?secure              = null,
                                           ITwilioRestClient client = null)
        {
            var options = new CreateTrunkOptions()
            {
                FriendlyName = friendlyName, DomainName = domainName, DisasterRecoveryUrl = disasterRecoveryUrl, DisasterRecoveryMethod = disasterRecoveryMethod, Recording = recording, Secure = secure
            };

            return(Create(options, client));
        }
Пример #6
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="domainName"> The unique address you reserve on Twilio to which you route your SIP traffic </param>
        /// <param name="disasterRecoveryUrl"> The HTTP URL that we should call if an error occurs while sending SIP traffic
        ///                           towards your configured Origination URL </param>
        /// <param name="disasterRecoveryMethod"> The HTTP method we should use to call the disaster_recovery_url </param>
        /// <param name="transferMode"> The call transfer settings for the trunk </param>
        /// <param name="secure"> Whether Secure Trunking is enabled for the trunk </param>
        /// <param name="cnamLookupEnabled"> Whether Caller ID Name (CNAM) lookup should be enabled for the trunk </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Trunk </returns>
        public static async System.Threading.Tasks.Task <TrunkResource> CreateAsync(string friendlyName     = null,
                                                                                    string domainName       = null,
                                                                                    Uri disasterRecoveryUrl = null,
                                                                                    Twilio.Http.HttpMethod disasterRecoveryMethod  = null,
                                                                                    TrunkResource.TransferSettingEnum transferMode = null,
                                                                                    bool?secure              = null,
                                                                                    bool?cnamLookupEnabled   = null,
                                                                                    ITwilioRestClient client = null)
        {
            var options = new CreateTrunkOptions()
            {
                FriendlyName = friendlyName, DomainName = domainName, DisasterRecoveryUrl = disasterRecoveryUrl, DisasterRecoveryMethod = disasterRecoveryMethod, TransferMode = transferMode, Secure = secure, CnamLookupEnabled = cnamLookupEnabled
            };

            return(await CreateAsync(options, client));
        }
Пример #7
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="domainName"> The unique address you reserve on Twilio to which you route your SIP traffic </param>
        /// <param name="disasterRecoveryUrl"> The HTTP URL that we should call if an error occurs while sending SIP traffic
        ///                           towards your configured Origination URL </param>
        /// <param name="disasterRecoveryMethod"> The HTTP method we should use to call the disaster_recovery_url </param>
        /// <param name="recording"> The recording settings for the trunk </param>
        /// <param name="transferMode"> The call transfer settings for the trunk </param>
        /// <param name="secure"> Whether Secure Trunking is enabled for the trunk </param>
        /// <param name="cnamLookupEnabled"> Whether Caller ID Name (CNAM) lookup should be enabled for the trunk </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Trunk </returns>
        public static TrunkResource Create(string friendlyName     = null,
                                           string domainName       = null,
                                           Uri disasterRecoveryUrl = null,
                                           Twilio.Http.HttpMethod disasterRecoveryMethod  = null,
                                           TrunkResource.RecordingSettingEnum recording   = null,
                                           TrunkResource.TransferSettingEnum transferMode = null,
                                           bool?secure              = null,
                                           bool?cnamLookupEnabled   = null,
                                           ITwilioRestClient client = null)
        {
            var options = new CreateTrunkOptions()
            {
                FriendlyName = friendlyName, DomainName = domainName, DisasterRecoveryUrl = disasterRecoveryUrl, DisasterRecoveryMethod = disasterRecoveryMethod, Recording = recording, TransferMode = transferMode, Secure = secure, CnamLookupEnabled = cnamLookupEnabled
            };

            return(Create(options, client));
        }