Пример #1
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Invite parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Invite </returns>
        public static ResourceSet <InviteResource> Read(ReadInviteOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <InviteResource> .FromJson("invites", response.Content);

            return(new ResourceSet <InviteResource>(page, options, client));
        }
Пример #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> A single instance of Invite </returns>
        public static ResourceSet <InviteResource> Read(string pathServiceSid, string pathChannelSid, List <string> identity = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadInviteOptions(pathServiceSid, pathChannelSid)
            {
                Identity = identity, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Пример #3
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 Invite </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <InviteResource> > ReadAsync(string pathServiceSid, string pathChannelSid, List <string> identity = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadInviteOptions(pathServiceSid, pathChannelSid)
            {
                Identity = identity, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
 private static Request BuildReadRequest(ReadInviteOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.IpMessaging,
                "/v2/Services/" + options.PathServiceSid + "/Channels/" + options.PathChannelSid + "/Invites",
                queryParams: options.GetParams()
                ));
 }
Пример #5
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Invite parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Invite </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <InviteResource> > ReadAsync(ReadInviteOptions options,
                                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <InviteResource> .FromJson("invites", response.Content);

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