/// <summary> /// Filter the list of agents according to a set of predefined filters. /// /// c.f. https://developers.freshdesk.com/api/#list_all_agents /// </summary> /// /// <param name="request"> /// A <seealso cref="ListAllAgentsRequest"/> object which contains /// the filters that we want to apply. By default will include all /// agents. /// </param> /// /// <param name="cancellationToken"></param> /// /// <returns> /// The full set of agents matching the filters supplied, this /// request is paged and iterating to the next entry may cause a new /// API call to get the next page. /// </returns> public async IAsyncEnumerable <Agent> ListAllAgentsAsync( ListAllAgentsRequest request, [EnumeratorCancellation] CancellationToken cancellationToken = default) { await foreach (var agent in _freshdeskClient.GetPagedResults <Agent>(request.UrlWithQueryString, false, cancellationToken).ConfigureAwait(false)) { yield return(agent); } }
public void TestBlankQueryStringGeneration() { var listAllAgentsRequest = new ListAllAgentsRequest(); Assert.Equal("UrlWithQueryString: /api/v2/agents", listAllAgentsRequest.ToString()); }