Exemple #1
0
        /// <summary>
        /// Retrieve a list of conversations in your service
        /// </summary>
        /// <param name="options"> Read Conversation parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Conversation </returns>
        public static ResourceSet <ConversationResource> Read(ReadConversationOptions options,
                                                              ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <ConversationResource> .FromJson("conversations", response.Content);

            return(new ResourceSet <ConversationResource>(page, options, client));
        }
Exemple #2
0
 private static Request BuildReadRequest(ReadConversationOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Conversations,
                "/v1/Services/" + options.PathChatServiceSid + "/Conversations",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
Exemple #3
0
        /// <summary>
        /// Retrieve a list of conversations in your service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Conversation Service that the resource is associated with. </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 Conversation </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <ConversationResource> > ReadAsync(string pathChatServiceSid,
                                                                                                        int?pageSize             = null,
                                                                                                        long?limit               = null,
                                                                                                        ITwilioRestClient client = null)
        {
            var options = new ReadConversationOptions(pathChatServiceSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Exemple #4
0
        /// <summary>
        /// Retrieve a list of conversations in your service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Conversation Service that the resource is associated with. </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 Conversation </returns>
        public static ResourceSet <ConversationResource> Read(string pathChatServiceSid,
                                                              int?pageSize             = null,
                                                              long?limit               = null,
                                                              ITwilioRestClient client = null)
        {
            var options = new ReadConversationOptions(pathChatServiceSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Exemple #5
0
        /// <summary>
        /// Retrieve a list of conversations in your service
        /// </summary>
        /// <param name="options"> Read Conversation parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Conversation </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <ConversationResource> > ReadAsync(ReadConversationOptions options,
                                                                                                        ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <ConversationResource> .FromJson("conversations", response.Content);

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