openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
src/Custom/Files/OpenAIFileCollection.cs
59lines · modecode
| 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")] |
| 9 | [CodeGenSuppress(nameof(OpenAIFileCollection))] |
| 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>))] |
| 12 | public partial class OpenAIFileCollection : ReadOnlyCollection<OpenAIFile> |
| 13 | { |
| 14 | // CUSTOM: Made private. This property does not add value in the context of a strongly-typed class. |
| 15 | [CodeGenMember("Object")] |
| 16 | private InternalListFilesResponseObject Object { get; } = InternalListFilesResponseObject.List; |
| 17 | |
| 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 | |
| 28 | /// <summary> Initializes a new instance of <see cref="OpenAIFileCollection"/>. </summary> |
| 29 | /// <param name="data"></param> |
| 30 | /// <exception cref="ArgumentNullException"> <paramref name="data"/> is null. </exception> |
| 31 | internal OpenAIFileCollection(IEnumerable<OpenAIFile> data, string firstId, string lastId, bool hasMore) |
| 32 | : base([.. data]) |
| 33 | { |
| 34 | Argument.AssertNotNull(data, nameof(data)); |
| 35 | FirstId = firstId; |
| 36 | LastId = lastId; |
| 37 | HasMore = hasMore; |
| 38 | } |
| 39 | |
| 40 | /// <summary> Initializes a new instance of <see cref="OpenAIFileCollection"/>. </summary> |
| 41 | /// <param name="data"></param> |
| 42 | /// <param name="object"></param> |
| 43 | /// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param> |
| 44 | internal OpenAIFileCollection(IReadOnlyList<OpenAIFile> data, string @object, string firstId, string lastId, bool hasMore, IDictionary<string, BinaryData> serializedAdditionalRawData) |
| 45 | : base([.. data]) |
| 46 | { |
| 47 | Object = @object; |
| 48 | SerializedAdditionalRawData = serializedAdditionalRawData; |
| 49 | FirstId = firstId; |
| 50 | LastId = lastId; |
| 51 | HasMore = hasMore; |
| 52 | } |
| 53 | |
| 54 | /// <summary> Initializes a new instance of <see cref="OpenAIFileCollection"/> for deserialization. </summary> |
| 55 | internal OpenAIFileCollection() |
| 56 | : base([]) |
| 57 | { |
| 58 | } |
| 59 | } |