/// <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)); }
/// <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)); }
private static Request BuildCreateRequest(CreateBundleOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Numbers, "/v2/RegulatoryCompliance/Bundles", postParams: options.GetParams() )); }
/// <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)); }
/// <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)); }