openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
src/Custom/Files/OpenAIFileCollection.cs
59lines · modeblame
9f9f2936Jose Arriaga Maldonado2 years ago | 1 | using System; |
| 2 | using System.Collections.Generic; | |
| 3 | using System.Collections.ObjectModel; | |
| 4 | | |
| 5 | namespace OpenAI.Files; | |
| 6 | | |
| 7 | [CodeGenModel("ListFilesResponse")] | |
| 8 | [CodeGenSuppress("Data")] | |
19ceae44ShivangiReja1 years ago | 9 | [CodeGenSuppress(nameof(OpenAIFileCollection))] |
0e0c460cJose Arriaga Maldonado1 years ago | 10 | [CodeGenSuppress(nameof(OpenAIFileCollection), typeof(string), typeof(string), typeof(bool))] |
| 11 | [CodeGenSuppress(nameof(OpenAIFileCollection), typeof(InternalListFilesResponseObject), typeof(string), typeof(string), typeof(bool), typeof(IDictionary<string, BinaryData>))] | |
19ceae44ShivangiReja1 years ago | 12 | public partial class OpenAIFileCollection : ReadOnlyCollection<OpenAIFile> |
9f9f2936Jose Arriaga Maldonado2 years ago | 13 | { |
| 14 | // CUSTOM: Made private. This property does not add value in the context of a strongly-typed class. | |
0e0c460cJose Arriaga Maldonado1 years ago | 15 | [CodeGenMember("Object")] |
9f9f2936Jose Arriaga Maldonado2 years ago | 16 | private InternalListFilesResponseObject Object { get; } = InternalListFilesResponseObject.List; |
e0fee603Jose Arriaga Maldonado1 years ago | 17 | |
0e0c460cJose Arriaga Maldonado1 years ago | 18 | // CUSTOM: Internalizing pending stanardized pagination representation for the list operation. |
| 19 | [CodeGenMember("FirstId")] | |
| 20 | internal string FirstId { get; } | |
| 21 | | |
| 22 | [CodeGenMember("LastId")] | |
| 23 | internal string LastId { get; } | |
| 24 | | |
| 25 | [CodeGenMember("HasMore")] | |
| 26 | internal bool HasMore { get; } | |
| 27 | | |
19ceae44ShivangiReja1 years ago | 28 | /// <summary> Initializes a new instance of <see cref="OpenAIFileCollection"/>. </summary> |
9f9f2936Jose Arriaga Maldonado2 years ago | 29 | /// <param name="data"></param> |
| 30 | /// <exception cref="ArgumentNullException"> <paramref name="data"/> is null. </exception> | |
0e0c460cJose Arriaga Maldonado1 years ago | 31 | internal OpenAIFileCollection(IEnumerable<OpenAIFile> data, string firstId, string lastId, bool hasMore) |
9f9f2936Jose Arriaga Maldonado2 years ago | 32 | : base([.. data]) |
| 33 | { | |
| 34 | Argument.AssertNotNull(data, nameof(data)); | |
0e0c460cJose Arriaga Maldonado1 years ago | 35 | FirstId = firstId; |
| 36 | LastId = lastId; | |
| 37 | HasMore = hasMore; | |
9f9f2936Jose Arriaga Maldonado2 years ago | 38 | } |
| 39 | | |
19ceae44ShivangiReja1 years ago | 40 | /// <summary> Initializes a new instance of <see cref="OpenAIFileCollection"/>. </summary> |
9f9f2936Jose Arriaga Maldonado2 years ago | 41 | /// <param name="data"></param> |
| 42 | /// <param name="object"></param> | |
| 43 | /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> | |
0e0c460cJose Arriaga Maldonado1 years ago | 44 | internal OpenAIFileCollection(IReadOnlyList<OpenAIFile> data, string @object, string firstId, string lastId, bool hasMore, IDictionary<string, BinaryData> serializedAdditionalRawData) |
9f9f2936Jose Arriaga Maldonado2 years ago | 45 | : base([.. data]) |
| 46 | { | |
| 47 | Object = @object; | |
19fc7d54Jose Arriaga Maldonado2 years ago | 48 | SerializedAdditionalRawData = serializedAdditionalRawData; |
0e0c460cJose Arriaga Maldonado1 years ago | 49 | FirstId = firstId; |
| 50 | LastId = lastId; | |
| 51 | HasMore = hasMore; | |
9f9f2936Jose Arriaga Maldonado2 years ago | 52 | } |
| 53 | | |
19ceae44ShivangiReja1 years ago | 54 | /// <summary> Initializes a new instance of <see cref="OpenAIFileCollection"/> for deserialization. </summary> |
| 55 | internal OpenAIFileCollection() | |
9f9f2936Jose Arriaga Maldonado2 years ago | 56 | : base([]) |
| 57 | { | |
| 58 | } | |
| 59 | } |