Exemplo n.º 1
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Room parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Room </returns>
        public static ResourceSet <RoomResource> Read(ReadRoomOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <RoomResource> .FromJson("rooms", response.Content);

            return(new ResourceSet <RoomResource>(page, options, client));
        }
Exemplo n.º 2
0
 private static Request BuildReadRequest(ReadRoomOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Insights,
                "/v1/Video/Rooms",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
Exemplo n.º 3
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="roomType"> The room_type </param>
        /// <param name="codec"> The codec </param>
        /// <param name="roomName"> The room_name </param>
        /// <param name="createdAfter"> The created_after </param>
        /// <param name="createdBefore"> The created_before </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 Room </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <RoomResource> > ReadAsync(List <RoomResource.RoomTypeEnum> roomType = null,
                                                                                                List <RoomResource.CodecEnum> codec       = null,
                                                                                                string roomName          = null,
                                                                                                DateTime?createdAfter    = null,
                                                                                                DateTime?createdBefore   = null,
                                                                                                int?pageSize             = null,
                                                                                                long?limit               = null,
                                                                                                ITwilioRestClient client = null)
        {
            var options = new ReadRoomOptions()
            {
                RoomType = roomType, Codec = codec, RoomName = roomName, CreatedAfter = createdAfter, CreatedBefore = createdBefore, PageSize = pageSize, Limit = limit
            };

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

            var page = Page <RoomResource> .FromJson("rooms", response.Content);

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