private static Request BuildReadRequest(ReadTrustProductsChannelEndpointAssignmentOptions options,
                                         ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Trusthub,
                "/v1/TrustProducts/" + options.PathTrustProductSid + "/ChannelEndpointAssignments",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
        /// <summary>
        /// Retrieve a list of all Assigned Items for an account.
        /// </summary>
        /// <param name="pathTrustProductSid"> The unique string that identifies the resource. </param>
        /// <param name="channelEndpointSid"> The sid of an channel endpoint </param>
        /// <param name="channelEndpointSids"> comma separated list of channel endpoint sids </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 TrustProductsChannelEndpointAssignment </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <TrustProductsChannelEndpointAssignmentResource> > ReadAsync(string pathTrustProductSid,
                                                                                                                                  string channelEndpointSid  = null,
                                                                                                                                  string channelEndpointSids = null,
                                                                                                                                  int?pageSize             = null,
                                                                                                                                  long?limit               = null,
                                                                                                                                  ITwilioRestClient client = null)
        {
            var options = new ReadTrustProductsChannelEndpointAssignmentOptions(pathTrustProductSid)
            {
                ChannelEndpointSid = channelEndpointSid, ChannelEndpointSids = channelEndpointSids, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// Retrieve a list of all Assigned Items for an account.
        /// </summary>
        /// <param name="pathTrustProductSid"> The unique string that identifies the resource. </param>
        /// <param name="channelEndpointSid"> The sid of an channel endpoint </param>
        /// <param name="channelEndpointSids"> comma separated list of channel endpoint sids </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 TrustProductsChannelEndpointAssignment </returns>
        public static ResourceSet <TrustProductsChannelEndpointAssignmentResource> Read(string pathTrustProductSid,
                                                                                        string channelEndpointSid  = null,
                                                                                        string channelEndpointSids = null,
                                                                                        int?pageSize             = null,
                                                                                        long?limit               = null,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new ReadTrustProductsChannelEndpointAssignmentOptions(pathTrustProductSid)
            {
                ChannelEndpointSid = channelEndpointSid, ChannelEndpointSids = channelEndpointSids, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
        /// <summary>
        /// Retrieve a list of all Assigned Items for an account.
        /// </summary>
        /// <param name="options"> Read TrustProductsChannelEndpointAssignment parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TrustProductsChannelEndpointAssignment </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <TrustProductsChannelEndpointAssignmentResource> > ReadAsync(ReadTrustProductsChannelEndpointAssignmentOptions options,
                                                                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <TrustProductsChannelEndpointAssignmentResource> .FromJson("results", response.Content);

            return(new ResourceSet <TrustProductsChannelEndpointAssignmentResource>(page, options, client));
        }
        /// <summary>
        /// Retrieve a list of all Assigned Items for an account.
        /// </summary>
        /// <param name="options"> Read TrustProductsChannelEndpointAssignment parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TrustProductsChannelEndpointAssignment </returns>
        public static ResourceSet <TrustProductsChannelEndpointAssignmentResource> Read(ReadTrustProductsChannelEndpointAssignmentOptions options,
                                                                                        ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <TrustProductsChannelEndpointAssignmentResource> .FromJson("results", response.Content);

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