Exemplo n.º 1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Subscription parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Subscription </returns>
        public static SubscriptionResource Create(CreateSubscriptionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="description"> The description </param>
        /// <param name="sinkSid"> The sink_sid </param>
        /// <param name="types"> The types </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Subscription </returns>
        public static async System.Threading.Tasks.Task <SubscriptionResource> CreateAsync(string description,
                                                                                           string sinkSid,
                                                                                           List <object> types,
                                                                                           ITwilioRestClient client = null)
        {
            var options = new CreateSubscriptionOptions(description, sinkSid, types);

            return(await CreateAsync(options, client));
        }
Exemplo n.º 3
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="description"> The description </param>
        /// <param name="sinkSid"> The sink_sid </param>
        /// <param name="types"> The types </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Subscription </returns>
        public static SubscriptionResource Create(string description,
                                                  string sinkSid,
                                                  List <object> types,
                                                  ITwilioRestClient client = null)
        {
            var options = new CreateSubscriptionOptions(description, sinkSid, types);

            return(Create(options, client));
        }
Exemplo n.º 4
0
 private static Request BuildCreateRequest(CreateSubscriptionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Events,
                "/v1/Subscriptions",
                postParams: options.GetParams()
                ));
 }
Exemplo n.º 5
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Subscription parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Subscription </returns>
        public static async System.Threading.Tasks.Task <SubscriptionResource> CreateAsync(CreateSubscriptionOptions options,
                                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }