コード例 #1
0
 private static Request BuildReadRequest(ReadMessagingConfigurationOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Verify,
                "/v2/Services/" + options.PathServiceSid + "/MessagingConfigurations",
                queryParams: options.GetParams()
                ));
 }
コード例 #2
0
        /// <summary>
        /// Retrieve a list of all Messaging Configurations for a Service.
        /// </summary>
        /// <param name="options"> Read MessagingConfiguration parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of MessagingConfiguration </returns>
        public static ResourceSet <MessagingConfigurationResource> Read(ReadMessagingConfigurationOptions options,
                                                                        ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <MessagingConfigurationResource> .FromJson("messaging_configurations", response.Content);

            return(new ResourceSet <MessagingConfigurationResource>(page, options, client));
        }
コード例 #3
0
        /// <summary>
        /// Retrieve a list of all Messaging Configurations for a Service.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the 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 MessagingConfiguration </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <MessagingConfigurationResource> > ReadAsync(string pathServiceSid,
                                                                                                                  int?pageSize             = null,
                                                                                                                  long?limit               = null,
                                                                                                                  ITwilioRestClient client = null)
        {
            var options = new ReadMessagingConfigurationOptions(pathServiceSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
コード例 #4
0
        /// <summary>
        /// Retrieve a list of all Messaging Configurations for a Service.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the 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 MessagingConfiguration </returns>
        public static ResourceSet <MessagingConfigurationResource> Read(string pathServiceSid,
                                                                        int?pageSize             = null,
                                                                        long?limit               = null,
                                                                        ITwilioRestClient client = null)
        {
            var options = new ReadMessagingConfigurationOptions(pathServiceSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
コード例 #5
0
        /// <summary>
        /// Retrieve a list of all Messaging Configurations for a Service.
        /// </summary>
        /// <param name="options"> Read MessagingConfiguration parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of MessagingConfiguration </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <MessagingConfigurationResource> > ReadAsync(ReadMessagingConfigurationOptions options,
                                                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <MessagingConfigurationResource> .FromJson("messaging_configurations", response.Content);

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