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

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

            return(FromJson(response.Content));
        }
Пример #3
0
 private static Request BuildCreateRequest(CreateBundleOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Numbers,
                "/v2/RegulatoryCompliance/Bundles",
                postParams: options.GetParams()
                ));
 }
Пример #4
0
        /// <summary>
        /// Create a new Bundle.
        /// </summary>
        /// <param name="friendlyName"> The string that you assigned to describe the resource </param>
        /// <param name="email"> The email address </param>
        /// <param name="statusCallback"> The URL we call to inform your application of status changes. </param>
        /// <param name="regulationSid"> The unique string of a regulation. </param>
        /// <param name="isoCountry"> The ISO country code of the country </param>
        /// <param name="endUserType"> The type of End User of the Bundle resource </param>
        /// <param name="numberType"> The type of phone number </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Bundle </returns>
        public static async System.Threading.Tasks.Task <BundleResource> CreateAsync(string friendlyName,
                                                                                     string email,
                                                                                     Uri statusCallback   = null,
                                                                                     string regulationSid = null,
                                                                                     string isoCountry    = null,
                                                                                     BundleResource.EndUserTypeEnum endUserType = null,
                                                                                     string numberType        = null,
                                                                                     ITwilioRestClient client = null)
        {
            var options = new CreateBundleOptions(friendlyName, email)
            {
                StatusCallback = statusCallback, RegulationSid = regulationSid, IsoCountry = isoCountry, EndUserType = endUserType, NumberType = numberType
            };

            return(await CreateAsync(options, client));
        }
Пример #5
0
        /// <summary>
        /// Create a new Bundle.
        /// </summary>
        /// <param name="friendlyName"> The string that you assigned to describe the resource </param>
        /// <param name="email"> The email address </param>
        /// <param name="statusCallback"> The URL we call to inform your application of status changes. </param>
        /// <param name="regulationSid"> The unique string of a regulation. </param>
        /// <param name="isoCountry"> The ISO country code of the country </param>
        /// <param name="endUserType"> The type of End User of the Bundle resource </param>
        /// <param name="numberType"> The type of phone number </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Bundle </returns>
        public static BundleResource Create(string friendlyName,
                                            string email,
                                            Uri statusCallback   = null,
                                            string regulationSid = null,
                                            string isoCountry    = null,
                                            BundleResource.EndUserTypeEnum endUserType = null,
                                            string numberType        = null,
                                            ITwilioRestClient client = null)
        {
            var options = new CreateBundleOptions(friendlyName, email)
            {
                StatusCallback = statusCallback, RegulationSid = regulationSid, IsoCountry = isoCountry, EndUserType = endUserType, NumberType = numberType
            };

            return(Create(options, client));
        }