/// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="identity"> The identity </param>
        /// <param name="tag"> The tag </param>
        /// <param name="body"> The body </param>
        /// <param name="priority"> The priority </param>
        /// <param name="ttl"> The ttl </param>
        /// <param name="title"> The title </param>
        /// <param name="sound"> The sound </param>
        /// <param name="action"> The action </param>
        /// <param name="data"> The data </param>
        /// <param name="apn"> The apn </param>
        /// <param name="gcm"> The gcm </param>
        /// <param name="sms"> The sms </param>
        /// <param name="facebookMessenger"> The facebook_messenger </param>
        /// <param name="fcm"> The fcm </param>
        /// <param name="segment"> The segment </param>
        /// <param name="alexa"> The alexa </param>
        /// <param name="toBinding"> The to_binding </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Notification </returns>
        public static async System.Threading.Tasks.Task <NotificationResource> CreateAsync(string pathServiceSid,
                                                                                           List <string> identity = null,
                                                                                           List <string> tag      = null,
                                                                                           string body            = null,
                                                                                           NotificationResource.PriorityEnum priority = null,
                                                                                           int?ttl                  = null,
                                                                                           string title             = null,
                                                                                           string sound             = null,
                                                                                           string action            = null,
                                                                                           object data              = null,
                                                                                           object apn               = null,
                                                                                           object gcm               = null,
                                                                                           object sms               = null,
                                                                                           object facebookMessenger = null,
                                                                                           object fcm               = null,
                                                                                           List <string> segment    = null,
                                                                                           object alexa             = null,
                                                                                           List <string> toBinding  = null,
                                                                                           ITwilioRestClient client = null)
        {
            var options = new CreateNotificationOptions(pathServiceSid)
            {
                Identity = identity, Tag = tag, Body = body, Priority = priority, Ttl = ttl, Title = title, Sound = sound, Action = action, Data = data, Apn = apn, Gcm = gcm, Sms = sms, FacebookMessenger = facebookMessenger, Fcm = fcm, Segment = segment, Alexa = alexa, ToBinding = toBinding
            };

            return(await CreateAsync(options, client));
        }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Notification parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Notification </returns>
        public static NotificationResource Create(CreateNotificationOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Example #3
0
 private static Request BuildCreateRequest(CreateNotificationOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Notify,
                "/v1/Services/" + options.PathServiceSid + "/Notifications",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create Notification parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Notification </returns>
        public static async System.Threading.Tasks.Task <NotificationResource> CreateAsync(CreateNotificationOptions options,
                                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }