|
| 1 | +// Copyright (c) Microsoft Corporation. |
| 2 | +// Licensed under the MIT License. |
| 3 | + |
| 4 | +using System.Text.Json.Serialization; |
| 5 | +using Microsoft.OpenApi.Models; |
| 6 | + |
| 7 | +namespace Microsoft.DevProxy.Plugins.RequestLogs.ApiCenter; |
| 8 | + |
| 9 | +internal class Collection<T>() |
| 10 | +{ |
| 11 | + public T[] Value { get; set; } = []; |
| 12 | +} |
| 13 | + |
| 14 | +internal class Api |
| 15 | +{ |
| 16 | + public ApiProperties? Properties { get; set; } |
| 17 | + public string? Name { get; set; } |
| 18 | + public string? Id { get; set; } |
| 19 | +} |
| 20 | + |
| 21 | +internal class ApiProperties |
| 22 | +{ |
| 23 | + public string? Title { get; set; } |
| 24 | + public string? Summary { get; set; } |
| 25 | + [JsonConverter(typeof(JsonStringEnumConverter))] |
| 26 | + public ApiKind? Kind { get; set; } |
| 27 | + [JsonConverter(typeof(JsonStringEnumConverter))] |
| 28 | + public ApiLifecycleStage? LifecycleStage { get; set; } |
| 29 | + public ApiContact[] Contacts { get; set; } = []; |
| 30 | + public dynamic CustomProperties { get; set; } = new object(); |
| 31 | +} |
| 32 | + |
| 33 | +internal class ApiContact |
| 34 | +{ |
| 35 | + public string? Name { get; set; } |
| 36 | + public string? Email { get; set; } |
| 37 | + public string? Url { get; set; } |
| 38 | +} |
| 39 | + |
| 40 | +internal class ApiDeployment |
| 41 | +{ |
| 42 | + public ApiDeploymentProperties? Properties { get; set; } |
| 43 | + public string? Name { get; set; } |
| 44 | +} |
| 45 | + |
| 46 | +internal class ApiDeploymentProperties |
| 47 | +{ |
| 48 | + public string? Title { get; set; } |
| 49 | + public string? DefinitionId { get; set; } |
| 50 | + public ApiDeploymentServer? Server { get; set; } |
| 51 | + public dynamic CustomProperties { get; set; } = new object(); |
| 52 | +} |
| 53 | + |
| 54 | +internal class ApiDeploymentServer |
| 55 | +{ |
| 56 | + public string[] RuntimeUri { get; set; } = []; |
| 57 | +} |
| 58 | + |
| 59 | +internal class ApiDefinition |
| 60 | +{ |
| 61 | + public string? Id { get; set; } |
| 62 | + public ApiDefinitionProperties? Properties { get; set; } |
| 63 | + public OpenApiDocument? Definition { get; set; } |
| 64 | +} |
| 65 | + |
| 66 | +internal class ApiDefinitionProperties |
| 67 | +{ |
| 68 | + public ApiDefinitionPropertiesSpecification? Specification { get; set; } |
| 69 | +} |
| 70 | + |
| 71 | +internal class ApiDefinitionPropertiesSpecification |
| 72 | +{ |
| 73 | + public string? Name { get; set; } |
| 74 | +} |
| 75 | + |
| 76 | +internal class ApiSpecExportResult |
| 77 | +{ |
| 78 | + [JsonConverter(typeof(JsonStringEnumConverter))] |
| 79 | + public ApiSpecExportResultFormat? Format { get; set; } |
| 80 | + public string? Value { get; set; } |
| 81 | +} |
| 82 | + |
| 83 | +internal class ApiVersion |
| 84 | +{ |
| 85 | + public ApiVersionProperties? Properties { get; set; } |
| 86 | + public string? Id { get; set; } |
| 87 | + public string? Name { get; set; } |
| 88 | +} |
| 89 | + |
| 90 | +internal class ApiVersionProperties |
| 91 | +{ |
| 92 | + public string? Title { get; set; } |
| 93 | + [JsonConverter(typeof(JsonStringEnumConverter))] |
| 94 | + public ApiLifecycleStage LifecycleStage { get; set; } |
| 95 | +} |
| 96 | + |
| 97 | +internal enum ApiSpecExportResultFormat |
| 98 | +{ |
| 99 | + Inline, |
| 100 | + Link |
| 101 | +} |
| 102 | + |
| 103 | +internal enum ApiKind |
| 104 | +{ |
| 105 | + GraphQL, |
| 106 | + gRPC, |
| 107 | + REST, |
| 108 | + SOAP, |
| 109 | + Webhook, |
| 110 | + WebSocket |
| 111 | +} |
| 112 | + |
| 113 | +internal enum ApiLifecycleStage |
| 114 | +{ |
| 115 | + Deprecated, |
| 116 | + Design, |
| 117 | + Development, |
| 118 | + Preview, |
| 119 | + Production, |
| 120 | + Retired, |
| 121 | + Testing |
| 122 | +} |
0 commit comments