@@ -858,47 +858,57 @@ protected ComputeApi(IServiceType serviceType, IAuthenticationProvider authentic
858858 /// <summary>
859859 /// Lists summary information for available flavors.
860860 /// </summary>
861- /// <typeparam name="T">The return type.</typeparam>
861+ /// <typeparam name="TPage">The return type.</typeparam>
862+ /// <param name="queryString">Options for paging and filtering.</param>
862863 /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
863- public virtual async Task < T > ListFlavorSummariesAsync < T > ( CancellationToken cancellationToken = default ( CancellationToken ) )
864- where T : IEnumerable < IServiceResource >
864+ public virtual async Task < TPage > ListFlavorSummariesAsync < TPage > ( IQueryStringBuilder queryString , CancellationToken cancellationToken = default ( CancellationToken ) )
865+ where TPage : IPageBuilder < TPage > , IEnumerable < IServiceResource >
865866 {
866- return await BuildListFlavorSummariesRequest ( cancellationToken )
867- . SendAsync ( )
868- . ReceiveJson < T > ( )
867+ Url initialRequestUrl = await BuildListFlavorSummariesURL ( queryString , cancellationToken ) . ConfigureAwait ( false ) ;
868+ return await Endpoint . GetResourcePageAsync < TPage > ( initialRequestUrl , cancellationToken )
869869 . PropogateOwnerToChildren ( this ) . ConfigureAwait ( false ) ;
870870 }
871871
872872 /// <summary>
873873 /// Builds the <see cref="ListFlavorSummariesAsync{T}"/> request.
874874 /// </summary>
875+ /// <param name="queryString">Options for paging and filtering.</param>
875876 /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
876- public virtual Task < PreparedRequest > BuildListFlavorSummariesRequest ( CancellationToken cancellationToken = default ( CancellationToken ) )
877+ public virtual async Task < Url > BuildListFlavorSummariesURL ( IQueryStringBuilder queryString , CancellationToken cancellationToken = default ( CancellationToken ) )
877878 {
878- return Endpoint . PrepareListResourcesRequest ( "flavors" , cancellationToken ) ;
879+ Url endpoint = await Endpoint . GetEndpoint ( cancellationToken ) . ConfigureAwait ( false ) ;
880+
881+ return endpoint
882+ . AppendPathSegment ( "flavors" )
883+ . SetQueryParams ( queryString ? . Build ( ) ) ;
879884 }
880885
881886 /// <summary>
882887 /// Lists available flavors.
883888 /// </summary>
884- /// <typeparam name="T">The return type.</typeparam>
889+ /// <typeparam name="TPage">The return type.</typeparam>
890+ /// <param name="queryString">Options for paging and filtering.</param>
885891 /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
886- public virtual async Task < T > ListFlavorsAsync < T > ( CancellationToken cancellationToken = default ( CancellationToken ) )
887- where T : IEnumerable < IServiceResource >
892+ public virtual async Task < TPage > ListFlavorsAsync < TPage > ( IQueryStringBuilder queryString , CancellationToken cancellationToken = default ( CancellationToken ) )
893+ where TPage : IPageBuilder < TPage > , IEnumerable < IServiceResource >
888894 {
889- return await BuildListFlavorsRequest ( cancellationToken )
890- . SendAsync ( )
891- . ReceiveJson < T > ( )
895+ Url initialRequestUrl = await BuildListFlavorsURL ( queryString , cancellationToken ) . ConfigureAwait ( false ) ;
896+ return await Endpoint . GetResourcePageAsync < TPage > ( initialRequestUrl , cancellationToken )
892897 . PropogateOwnerToChildren ( this ) . ConfigureAwait ( false ) ;
893898 }
894899
895900 /// <summary>
896- /// Builds the <see cref="ListFlavorsAsync{T}"/> request .
901+ /// Builds the <see cref="ListFlavorsAsync{T}"/> URL .
897902 /// </summary>
903+ /// <param name="queryString">Options for paging and filtering.</param>
898904 /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
899- public virtual Task < PreparedRequest > BuildListFlavorsRequest ( CancellationToken cancellationToken = default ( CancellationToken ) )
905+ public virtual async Task < Url > BuildListFlavorsURL ( IQueryStringBuilder queryString , CancellationToken cancellationToken = default ( CancellationToken ) )
900906 {
901- return Endpoint . PrepareListResourcesRequest ( "flavors/detail" , cancellationToken ) ;
907+ Url endpoint = await Endpoint . GetEndpoint ( cancellationToken ) . ConfigureAwait ( false ) ;
908+
909+ return endpoint
910+ . AppendPathSegment ( "flavors/detail" )
911+ . SetQueryParams ( queryString ? . Build ( ) ) ;
902912 }
903913
904914 #endregion
0 commit comments