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

            var page = Page <SyncMapResource> .FromJson("maps", response.Content);

            return(new ResourceSet <SyncMapResource>(page, options, client));
        }
Пример #2
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </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 SyncMap </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <SyncMapResource> > ReadAsync(string pathServiceSid, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadSyncMapOptions(pathServiceSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
 private static Request BuildReadRequest(ReadSyncMapOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/Sync/Services/" + options.PathServiceSid + "/Maps",
                queryParams: options.GetParams()
                ));
 }
Пример #4
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </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 SyncMap </returns>
        public static ResourceSet <SyncMapResource> Read(string pathServiceSid, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadSyncMapOptions(pathServiceSid)
            {
                PageSize = pageSize, Limit = limit
            };

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

            var page = Page <SyncMapResource> .FromJson("maps", response.Content);

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