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

            return(FromJson(response.Content));
        }
Esempio n. 2
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathIdentity"> The identity </param>
        /// <param name="segment"> The segment </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SegmentMembership </returns>
        public static async System.Threading.Tasks.Task <SegmentMembershipResource> CreateAsync(string pathServiceSid,
                                                                                                string pathIdentity,
                                                                                                string segment,
                                                                                                ITwilioRestClient client = null)
        {
            var options = new CreateSegmentMembershipOptions(pathServiceSid, pathIdentity, segment);

            return(await CreateAsync(options, client));
        }
Esempio n. 3
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathIdentity"> The identity </param>
        /// <param name="segment"> The segment </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SegmentMembership </returns>
        public static SegmentMembershipResource Create(string pathServiceSid,
                                                       string pathIdentity,
                                                       string segment,
                                                       ITwilioRestClient client = null)
        {
            var options = new CreateSegmentMembershipOptions(pathServiceSid, pathIdentity, segment);

            return(Create(options, client));
        }
Esempio n. 4
0
 private static Request BuildCreateRequest(CreateSegmentMembershipOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Notify,
                "/v1/Services/" + options.PathServiceSid + "/Users/" + options.PathIdentity + "/SegmentMemberships",
                client.Region,
                postParams: options.GetParams()
                ));
 }
Esempio n. 5
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="options"> Create SegmentMembership parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SegmentMembership </returns>
        public static async System.Threading.Tasks.Task <SegmentMembershipResource> CreateAsync(CreateSegmentMembershipOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }