66using System . ClientModel ;
77using System . ClientModel . Primitives ;
88using System . Diagnostics . CodeAnalysis ;
9+ using System . Threading ;
910using System . Threading . Tasks ;
1011using OpenAI ;
12+ using OpenAI . VectorStores ;
1113
1214namespace OpenAI . Containers
1315{
@@ -22,16 +24,24 @@ protected ContainerClient()
2224
2325 public ClientPipeline Pipeline { get ; }
2426
25- public virtual ClientResult GetContainers ( int ? limit = default , string order = default , string after = default , RequestOptions options = null )
27+ public virtual CollectionResult GetContainers ( int ? limit , string order , string after , RequestOptions options )
2628 {
27- using PipelineMessage message = CreateGetContainersRequest ( limit , order , after , options ) ;
28- return ClientResult . FromResponse ( Pipeline . ProcessMessage ( message , options ) ) ;
29+ return new ContainerClientGetContainersCollectionResult ( this , limit , order , after , options ) ;
2930 }
3031
31- public virtual async Task < ClientResult > GetContainersAsync ( int ? limit = default , string order = default , string after = default , RequestOptions options = null )
32+ public virtual AsyncCollectionResult GetContainersAsync ( int ? limit , string order , string after , RequestOptions options )
3233 {
33- using PipelineMessage message = CreateGetContainersRequest ( limit , order , after , options ) ;
34- return ClientResult . FromResponse ( await Pipeline . ProcessMessageAsync ( message , options ) . ConfigureAwait ( false ) ) ;
34+ return new ContainerClientGetContainersAsyncCollectionResult ( this , limit , order , after , options ) ;
35+ }
36+
37+ public virtual CollectionResult < ContainerResource > GetContainers ( int ? limit = default , VectorStoreCollectionOrder ? order = default , string after = default , CancellationToken cancellationToken = default )
38+ {
39+ return new ContainerClientGetContainersCollectionResultOfT ( this , limit , order ? . ToString ( ) , after , cancellationToken . CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null ) ;
40+ }
41+
42+ public virtual AsyncCollectionResult < ContainerResource > GetContainersAsync ( int ? limit = default , VectorStoreCollectionOrder ? order = default , string after = default , CancellationToken cancellationToken = default )
43+ {
44+ return new ContainerClientGetContainersAsyncCollectionResultOfT ( this , limit , order ? . ToString ( ) , after , cancellationToken . CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null ) ;
3545 }
3646
3747 public virtual ClientResult CreateContainer ( BinaryContent content , RequestOptions options = null )
@@ -100,20 +110,56 @@ public virtual async Task<ClientResult> CreateContainerFileAsync(string containe
100110 return ClientResult . FromResponse ( await Pipeline . ProcessMessageAsync ( message , options ) . ConfigureAwait ( false ) ) ;
101111 }
102112
103- public virtual ClientResult GetContainerFiles ( string containerId , int ? limit = default , string order = default , string after = default , RequestOptions options = null )
113+ public virtual CollectionResult GetContainerFiles ( string containerId , int ? limit , string order , string after , RequestOptions options )
104114 {
105115 Argument . AssertNotNullOrEmpty ( containerId , nameof ( containerId ) ) ;
106116
107- using PipelineMessage message = CreateGetContainerFilesRequest ( containerId , limit , order , after , options ) ;
108- return ClientResult . FromResponse ( Pipeline . ProcessMessage ( message , options ) ) ;
117+ return new ContainerClientGetContainerFilesCollectionResult (
118+ this ,
119+ containerId ,
120+ limit ,
121+ order ,
122+ after ,
123+ options ) ;
109124 }
110125
111- public virtual async Task < ClientResult > GetContainerFilesAsync ( string containerId , int ? limit = default , string order = default , string after = default , RequestOptions options = null )
126+ public virtual AsyncCollectionResult GetContainerFilesAsync ( string containerId , int ? limit , string order , string after , RequestOptions options )
112127 {
113128 Argument . AssertNotNullOrEmpty ( containerId , nameof ( containerId ) ) ;
114129
115- using PipelineMessage message = CreateGetContainerFilesRequest ( containerId , limit , order , after , options ) ;
116- return ClientResult . FromResponse ( await Pipeline . ProcessMessageAsync ( message , options ) . ConfigureAwait ( false ) ) ;
130+ return new ContainerClientGetContainerFilesAsyncCollectionResult (
131+ this ,
132+ containerId ,
133+ limit ,
134+ order ,
135+ after ,
136+ options ) ;
137+ }
138+
139+ public virtual CollectionResult < ContainerFileResource > GetContainerFiles ( string containerId , int ? limit = default , VectorStoreCollectionOrder ? order = default , string after = default , CancellationToken cancellationToken = default )
140+ {
141+ Argument . AssertNotNullOrEmpty ( containerId , nameof ( containerId ) ) ;
142+
143+ return new ContainerClientGetContainerFilesCollectionResultOfT (
144+ this ,
145+ containerId ,
146+ limit ,
147+ order ? . ToString ( ) ,
148+ after ,
149+ cancellationToken . CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null ) ;
150+ }
151+
152+ public virtual AsyncCollectionResult < ContainerFileResource > GetContainerFilesAsync ( string containerId , int ? limit = default , VectorStoreCollectionOrder ? order = default , string after = default , CancellationToken cancellationToken = default )
153+ {
154+ Argument . AssertNotNullOrEmpty ( containerId , nameof ( containerId ) ) ;
155+
156+ return new ContainerClientGetContainerFilesAsyncCollectionResultOfT (
157+ this ,
158+ containerId ,
159+ limit ,
160+ order ? . ToString ( ) ,
161+ after ,
162+ cancellationToken . CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null ) ;
117163 }
118164
119165 public virtual ClientResult GetContainerFile ( string containerId , string fileId , RequestOptions options = null )
0 commit comments