Example #1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create RatePlan parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of RatePlan </returns>
        public static RatePlanResource Create(CreateRatePlanOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Example #2
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="uniqueName"> The unique_name </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="dataEnabled"> The data_enabled </param>
        /// <param name="dataLimit"> The data_limit </param>
        /// <param name="dataMetering"> The data_metering </param>
        /// <param name="messagingEnabled"> The messaging_enabled </param>
        /// <param name="voiceEnabled"> The voice_enabled </param>
        /// <param name="commandsEnabled"> The commands_enabled </param>
        /// <param name="nationalRoamingEnabled"> The national_roaming_enabled </param>
        /// <param name="internationalRoaming"> The international_roaming </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of RatePlan </returns>
        public static async System.Threading.Tasks.Task <RatePlanResource> CreateAsync(string uniqueName = null, string friendlyName = null, bool?dataEnabled = null, int?dataLimit = null, string dataMetering = null, bool?messagingEnabled = null, bool?voiceEnabled = null, bool?commandsEnabled = null, bool?nationalRoamingEnabled = null, List <string> internationalRoaming = null, ITwilioRestClient client = null)
        {
            var options = new CreateRatePlanOptions {
                UniqueName = uniqueName, FriendlyName = friendlyName, DataEnabled = dataEnabled, DataLimit = dataLimit, DataMetering = dataMetering, MessagingEnabled = messagingEnabled, VoiceEnabled = voiceEnabled, CommandsEnabled = commandsEnabled, NationalRoamingEnabled = nationalRoamingEnabled, InternationalRoaming = internationalRoaming
            };

            return(await CreateAsync(options, client));
        }
Example #3
0
 private static Request BuildCreateRequest(CreateRatePlanOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/wireless/RatePlans",
                postParams: options.GetParams()
                ));
 }
Example #4
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create RatePlan parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of RatePlan </returns>
        public static async System.Threading.Tasks.Task <RatePlanResource> CreateAsync(CreateRatePlanOptions options,
                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }