Пример #1
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="friendlyName"> The friendly_name </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 Workspace </returns>
        public static ResourceSet <WorkspaceResource> Read(string friendlyName = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadWorkspaceOptions {
                FriendlyName = friendlyName, PageSize = pageSize, Limit = limit
            };

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

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

            var page = Page <WorkspaceResource> .FromJson("workspaces", response.Content);

            return(new ResourceSet <WorkspaceResource>(page, options, client));
        }
 private static Request BuildReadRequest(ReadWorkspaceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Workspace parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Workspace </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <WorkspaceResource> > ReadAsync(ReadWorkspaceOptions options,
                                                                                                     ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <WorkspaceResource> .FromJson("workspaces", response.Content);

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