private static Request BuildReadRequest(ReadCustomerProfilesChannelEndpointAssignmentOptions options,
                                         ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Trusthub,
                "/v1/CustomerProfiles/" + options.PathCustomerProfileSid + "/ChannelEndpointAssignments",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
        /// <summary>
        /// Retrieve a list of all Assigned Items for an account.
        /// </summary>
        /// <param name="pathCustomerProfileSid"> 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 CustomerProfilesChannelEndpointAssignment </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <CustomerProfilesChannelEndpointAssignmentResource> > ReadAsync(string pathCustomerProfileSid,
                                                                                                                                     string channelEndpointSid  = null,
                                                                                                                                     string channelEndpointSids = null,
                                                                                                                                     int?pageSize             = null,
                                                                                                                                     long?limit               = null,
                                                                                                                                     ITwilioRestClient client = null)
        {
            var options = new ReadCustomerProfilesChannelEndpointAssignmentOptions(pathCustomerProfileSid)
            {
                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="pathCustomerProfileSid"> 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 CustomerProfilesChannelEndpointAssignment </returns>
        public static ResourceSet <CustomerProfilesChannelEndpointAssignmentResource> Read(string pathCustomerProfileSid,
                                                                                           string channelEndpointSid  = null,
                                                                                           string channelEndpointSids = null,
                                                                                           int?pageSize             = null,
                                                                                           long?limit               = null,
                                                                                           ITwilioRestClient client = null)
        {
            var options = new ReadCustomerProfilesChannelEndpointAssignmentOptions(pathCustomerProfileSid)
            {
                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 CustomerProfilesChannelEndpointAssignment parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CustomerProfilesChannelEndpointAssignment </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <CustomerProfilesChannelEndpointAssignmentResource> > ReadAsync(ReadCustomerProfilesChannelEndpointAssignmentOptions options,
                                                                                                                                     ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

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

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