public IAsyncEnumerable <EnumValueData> GetAllEnumValuesAsyncEnumerable(string typeKey, string customFieldId, ExtendedTypeScope scope, EnumValueOrdering ordering = EnumValueOrdering.NAMEASC, string?skip = null, int?top = 100, string?query = null, bool?countRecords = null, string?addedByProfileId = null, Func <Partial <EnumValueData>, Partial <EnumValueData> >?partial = null, CancellationToken cancellationToken = default) => BatchEnumerator.AllItems((batchSkip, batchCancellationToken) => GetAllEnumValuesAsync(typeKey: typeKey, customFieldId: customFieldId, ordering: ordering, scope: scope, top: top, query: query, countRecords: countRecords, addedByProfileId: addedByProfileId, cancellationToken: cancellationToken, skip: batchSkip, partial: builder => Partial <Batch <EnumValueData> > .Default().WithNext().WithTotalCount().WithData(partial != null ? partial : _ => Partial <EnumValueData> .Default())), skip, cancellationToken);
public async Task <Batch <EnumValueData> > GetAllEnumValuesAsync(string typeKey, string customFieldId, ExtendedTypeScope scope, EnumValueOrdering ordering = EnumValueOrdering.NAMEASC, string?skip = null, int?top = 100, string?query = null, bool?countRecords = null, string?addedByProfileId = null, Func <Partial <Batch <EnumValueData> >, Partial <Batch <EnumValueData> > >?partial = null, CancellationToken cancellationToken = default) { var queryParameters = new NameValueCollection(); if (skip != null) { queryParameters.Append("$skip", skip); } if (top != null) { queryParameters.Append("$top", top?.ToString()); } if (query != null) { queryParameters.Append("query", query); } queryParameters.Append("ordering", ordering.ToEnumString()); if (countRecords != null) { queryParameters.Append("countRecords", countRecords?.ToString("l")); } if (addedByProfileId != null) { queryParameters.Append("addedByProfileId", addedByProfileId); } queryParameters.Append("scope", scope.ToString()); queryParameters.Append("$fields", (partial != null ? partial(new Partial <Batch <EnumValueData> >()) : Partial <Batch <EnumValueData> > .Default()).ToString()); return(await _connection.RequestResourceAsync <Batch <EnumValueData> >("GET", $"api/http/custom-fields/{typeKey}/enum-values/{customFieldId}{queryParameters.ToQueryString()}", cancellationToken)); }