Esempio n. 1
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Member parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Member </returns>
        public static ResourceSet <MemberResource> Read(ReadMemberOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <MemberResource> .FromJson("members", response.Content);

            return(new ResourceSet <MemberResource>(page, options, client));
        }
Esempio n. 2
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathChannelSid"> The channel_sid </param>
        /// <param name="identity"> The identity </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Member </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <MemberResource> > ReadAsync(string pathServiceSid, string pathChannelSid, List <string> identity = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadMemberOptions(pathServiceSid, pathChannelSid)
            {
                Identity = identity, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
 private static Request BuildReadRequest(ReadMemberOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.IpMessaging,
                "/v1/Services/" + options.PathServiceSid + "/Channels/" + options.PathChannelSid + "/Members",
                queryParams: options.GetParams()
                ));
 }
Esempio n. 4
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathChannelSid"> The channel_sid </param>
        /// <param name="identity"> The identity </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Member </returns>
        public static ResourceSet <MemberResource> Read(string pathServiceSid, string pathChannelSid, List <string> identity = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadMemberOptions(pathServiceSid, pathChannelSid)
            {
                Identity = identity, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Esempio n. 5
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Member parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Member </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <MemberResource> > ReadAsync(ReadMemberOptions options,
                                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <MemberResource> .FromJson("members", response.Content);

            return(new ResourceSet <MemberResource>(page, options, client));
        }