diff --git a/src/Docker.DotNet/Docker.DotNet.csproj b/src/Docker.DotNet/Docker.DotNet.csproj index ac77c8111..07a06a976 100644 --- a/src/Docker.DotNet/Docker.DotNet.csproj +++ b/src/Docker.DotNet/Docker.DotNet.csproj @@ -3,9 +3,12 @@ Docker.DotNet.Enhanced Docker.DotNet is a library that allows you to interact with the Docker Remote API programmatically with fully asynchronous, non-blocking and object-oriented code in your .NET applications. Docker.DotNet + latest - + + + \ No newline at end of file diff --git a/src/Docker.DotNet/DockerClient.cs b/src/Docker.DotNet/DockerClient.cs index 64a428f84..1960e8a84 100644 --- a/src/Docker.DotNet/DockerClient.cs +++ b/src/Docker.DotNet/DockerClient.cs @@ -33,7 +33,6 @@ internal DockerClient(DockerClientConfiguration configuration, Version requested Configuration = configuration; DefaultTimeout = configuration.DefaultTimeout; - JsonSerializer = new JsonSerializer(); Images = new ImageOperations(this); Containers = new ContainerOperations(this); System = new SystemOperations(this); @@ -149,7 +148,7 @@ await sock.ConnectAsync(new Microsoft.Net.Http.Client.UnixDomainSocketEndPoint(p public IExecOperations Exec { get; } - internal JsonSerializer JsonSerializer { get; } + internal static JsonSerializer JsonSerializer => JsonSerializer.Instance; public void Dispose() { @@ -157,49 +156,92 @@ public void Dispose() _client.Dispose(); } - internal Task MakeRequestAsync( + internal Task MakeRequestAsync( IEnumerable errorHandlers, HttpMethod method, string path, CancellationToken token) { - return MakeRequestAsync(errorHandlers, method, path, null, null, token); + return MakeRequestAsync(errorHandlers, method, path, null, null, token); } - internal Task MakeRequestAsync( + internal Task MakeRequestAsync( + IEnumerable errorHandlers, + HttpMethod method, + string path, + CancellationToken token) + { + return MakeRequestAsync(errorHandlers, method, path, null, null, token); + } + + internal Task MakeRequestAsync( + IEnumerable errorHandlers, + HttpMethod method, + string path, + IQueryString queryString, + CancellationToken token) + { + return MakeRequestAsync(errorHandlers, method, path, queryString, null, token); + } + + internal Task MakeRequestAsync( + IEnumerable errorHandlers, + HttpMethod method, + string path, + IQueryString queryString, + CancellationToken token) + { + return MakeRequestAsync(errorHandlers, method, path, queryString, null, token); + } + + internal Task MakeRequestAsync( + IEnumerable errorHandlers, + HttpMethod method, + string path, + IQueryString queryString, + IRequestContent body, + CancellationToken token) + { + return MakeRequestAsync(errorHandlers, method, path, queryString, body, null, token); + } + + internal Task MakeRequestAsync( IEnumerable errorHandlers, HttpMethod method, string path, IQueryString queryString, + IRequestContent body, CancellationToken token) { - return MakeRequestAsync(errorHandlers, method, path, queryString, null, token); + return MakeRequestAsync(errorHandlers, method, path, queryString, body, null, token); } - internal Task MakeRequestAsync( + internal Task MakeRequestAsync( IEnumerable errorHandlers, HttpMethod method, string path, IQueryString queryString, IRequestContent body, + IDictionary headers, CancellationToken token) { - return MakeRequestAsync(errorHandlers, method, path, queryString, body, null, token); + return MakeRequestAsync(errorHandlers, method, path, queryString, body, headers, DefaultTimeout, token); } - internal Task MakeRequestAsync( + internal Task MakeRequestAsync( IEnumerable errorHandlers, HttpMethod method, string path, IQueryString queryString, IRequestContent body, IDictionary headers, + TimeSpan timeout, CancellationToken token) { - return MakeRequestAsync(errorHandlers, method, path, queryString, body, headers, DefaultTimeout, token); + return MakeRequestAsync(errorHandlers, method, path, queryString, body, headers, timeout, token); } - internal async Task MakeRequestAsync( + internal async Task MakeRequestAsync( IEnumerable errorHandlers, HttpMethod method, string path, @@ -209,19 +251,19 @@ internal async Task MakeRequestAsync( TimeSpan timeout, CancellationToken token) { - var response = await PrivateMakeRequestAsync(timeout, HttpCompletionOption.ResponseContentRead, method, path, queryString, headers, body, token) + using var response = await PrivateMakeRequestAsync(timeout, HttpCompletionOption.ResponseContentRead, method, path, queryString, headers, body, token) .ConfigureAwait(false); - using (response) - { - await HandleIfErrorResponseAsync(response.StatusCode, response, errorHandlers) - .ConfigureAwait(false); - - var responseBody = await response.Content.ReadAsStringAsync() - .ConfigureAwait(false); + await HandleIfErrorResponseAsync(response.StatusCode, response, errorHandlers) + .ConfigureAwait(false); - return new DockerApiResponse(response.StatusCode, responseBody); + if (typeof(T) == typeof(NoContent)) + { + return default; } + + return await JsonSerializer.DeserializeAsync(response.Content, token) + .ConfigureAwait(false); } internal Task MakeRequestForStreamAsync( @@ -294,9 +336,12 @@ internal async Task MakeRequestForRawResponseAsync( IDictionary headers, CancellationToken token) { - var response = await PrivateMakeRequestAsync(SInfiniteTimeout, HttpCompletionOption.ResponseHeadersRead, method, path, queryString, headers, body, token).ConfigureAwait(false); + var response = await PrivateMakeRequestAsync(SInfiniteTimeout, HttpCompletionOption.ResponseHeadersRead, method, path, queryString, headers, body, token) + .ConfigureAwait(false); + await HandleIfErrorResponseAsync(response.StatusCode, response) .ConfigureAwait(false); + return response; } @@ -347,7 +392,7 @@ internal async Task MakeRequestForHijackedStreamAsync( await HandleIfErrorResponseAsync(response.StatusCode, response, errorHandlers) .ConfigureAwait(false); - if (!(response.Content is HttpConnectionResponseContent content)) + if (response.Content is not HttpConnectionResponseContent content) { throw new NotSupportedException("message handler does not support hijacked streams"); } @@ -388,7 +433,7 @@ private async Task PrivateMakeRequestAsync( } } - internal HttpRequestMessage PrepareRequest(HttpMethod method, string path, IQueryString queryString, IDictionary headers, IRequestContent data) + private HttpRequestMessage PrepareRequest(HttpMethod method, string path, IQueryString queryString, IDictionary headers, IRequestContent data) { if (string.IsNullOrEmpty(path)) { @@ -469,6 +514,8 @@ private async Task HandleIfErrorResponseAsync(HttpStatusCode statusCode, HttpRes throw new DockerApiException(statusCode, responseBody); } } + + private struct NoContent; } internal delegate void ApiResponseErrorHandlingDelegate(HttpStatusCode statusCode, string responseBody); diff --git a/src/Docker.DotNet/Endpoints/ConfigsOperations.cs b/src/Docker.DotNet/Endpoints/ConfigsOperations.cs index e7e04e8c8..04492f000 100644 --- a/src/Docker.DotNet/Endpoints/ConfigsOperations.cs +++ b/src/Docker.DotNet/Endpoints/ConfigsOperations.cs @@ -18,8 +18,7 @@ internal ConfigOperations(DockerClient client) async Task> IConfigOperations.ListConfigsAsync(CancellationToken cancellationToken) { - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "configs", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject>(response.Body); + return await _client.MakeRequestAsync>(_client.NoErrorHandlers, HttpMethod.Get, "configs", cancellationToken).ConfigureAwait(false); } async Task IConfigOperations.CreateConfigAsync(SwarmCreateConfigParameters body, CancellationToken cancellationToken) @@ -29,9 +28,8 @@ async Task IConfigOperations.CreateConfigAsync(SwarmC throw new ArgumentNullException(nameof(body)); } - var data = new JsonRequestContent(body.Config, _client.JsonSerializer); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "configs/create", null, data, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + var data = new JsonRequestContent(body.Config, DockerClient.JsonSerializer); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "configs/create", null, data, cancellationToken).ConfigureAwait(false); } async Task IConfigOperations.InspectConfigAsync(string id, CancellationToken cancellationToken) @@ -41,8 +39,7 @@ async Task IConfigOperations.InspectConfigAsync(string id, Cancella throw new ArgumentNullException(nameof(id)); } - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, $"configs/{id}", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, $"configs/{id}", cancellationToken).ConfigureAwait(false); } Task IConfigOperations.RemoveConfigAsync(string id, CancellationToken cancellationToken) @@ -55,4 +52,4 @@ Task IConfigOperations.RemoveConfigAsync(string id, CancellationToken cancellati return _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Delete, $"configs/{id}", cancellationToken); } } -} +} \ No newline at end of file diff --git a/src/Docker.DotNet/Endpoints/ContainerOperations.cs b/src/Docker.DotNet/Endpoints/ContainerOperations.cs index 03960ab7c..9d2ffe0a5 100644 --- a/src/Docker.DotNet/Endpoints/ContainerOperations.cs +++ b/src/Docker.DotNet/Endpoints/ContainerOperations.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Net; using System.Net.Http; -using System.Text; using System.Threading; using System.Threading.Tasks; @@ -13,14 +12,15 @@ namespace Docker.DotNet { internal class ContainerOperations : IContainerOperations { - internal static readonly ApiResponseErrorHandlingDelegate NoSuchContainerHandler = (statusCode, responseBody) => + private static readonly ApiResponseErrorHandlingDelegate NoSuchContainerHandler = (statusCode, responseBody) => { if (statusCode == HttpStatusCode.NotFound) { throw new DockerContainerNotFoundException(statusCode, responseBody); } }; - internal static readonly ApiResponseErrorHandlingDelegate NoSuchImageHandler = (statusCode, responseBody) => + + private static readonly ApiResponseErrorHandlingDelegate NoSuchImageHandler = (statusCode, responseBody) => { if (statusCode == HttpStatusCode.NotFound) { @@ -43,8 +43,7 @@ internal ContainerOperations(DockerClient client) } IQueryString queryParameters = new QueryString(parameters); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "containers/json", queryParameters, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "containers/json", queryParameters, cancellationToken).ConfigureAwait(false); } public async Task CreateContainerAsync(CreateContainerParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -61,9 +60,8 @@ internal ContainerOperations(DockerClient client) qs = new QueryString(parameters); } - var data = new JsonRequestContent(parameters, _client.JsonSerializer); - var response = await _client.MakeRequestAsync(new[] { NoSuchImageHandler }, HttpMethod.Post, "containers/create", qs, data, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + var data = new JsonRequestContent(parameters, DockerClient.JsonSerializer); + return await _client.MakeRequestAsync(new[] { NoSuchImageHandler }, HttpMethod.Post, "containers/create", qs, data, cancellationToken).ConfigureAwait(false); } public async Task InspectContainerAsync(string id, CancellationToken cancellationToken = default(CancellationToken)) @@ -73,8 +71,7 @@ internal ContainerOperations(DockerClient client) throw new ArgumentNullException(nameof(id)); } - var response = await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Get, $"containers/{id}/json", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Get, $"containers/{id}/json", cancellationToken).ConfigureAwait(false); } public async Task ListProcessesAsync(string id, ContainerListProcessesParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -90,8 +87,7 @@ internal ContainerOperations(DockerClient client) } IQueryString queryParameters = new QueryString(parameters); - var response = await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Get, $"containers/{id}/top", queryParameters, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Get, $"containers/{id}/top", queryParameters, cancellationToken).ConfigureAwait(false); } public Task GetContainerLogsAsync(string id, ContainerLogsParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -145,8 +141,7 @@ public Task GetContainerLogsAsync(string id, ContainerLogsParameters parameters, throw new ArgumentNullException(nameof(id)); } - var response = await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Get, $"containers/{id}/changes", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Get, $"containers/{id}/changes", cancellationToken).ConfigureAwait(false); } public Task ExportContainerAsync(string id, CancellationToken cancellationToken) @@ -207,9 +202,10 @@ public Task GetContainerStatsAsync(string id, ContainerStatsParameters p throw new ArgumentNullException(nameof(id)); } - var queryParams = parameters == null ? null : new QueryString(parameters); - var response = await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Post, $"containers/{id}/start", queryParams, cancellationToken).ConfigureAwait(false); - return response.StatusCode != HttpStatusCode.NotModified; + var queryParameters = parameters == null ? null : new QueryString(parameters); + bool? result = null; + await _client.MakeRequestAsync(new[] { NoSuchContainerHandler, (statusCode, _) => result = statusCode != HttpStatusCode.NotModified }, HttpMethod.Post, $"containers/{id}/start", queryParameters, cancellationToken).ConfigureAwait(false); + return result ?? throw new InvalidOperationException(); } public async Task StopContainerAsync(string id, ContainerStopParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -224,11 +220,12 @@ public Task GetContainerStatsAsync(string id, ContainerStatsParameters p throw new ArgumentNullException(nameof(parameters)); } - IQueryString queryParameters = new QueryString(parameters); + var queryParameters = new QueryString(parameters); // since specified wait timespan can be greater than HttpClient's default, we set the // client timeout to infinite and provide a cancellation token. - var response = await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Post, $"containers/{id}/stop", queryParameters, null, null, TimeSpan.FromMilliseconds(Timeout.Infinite), cancellationToken).ConfigureAwait(false); - return response.StatusCode != HttpStatusCode.NotModified; + bool? result = null; + await _client.MakeRequestAsync(new[] { NoSuchContainerHandler, (statusCode, _) => result = statusCode != HttpStatusCode.NotModified }, HttpMethod.Post, $"containers/{id}/stop", queryParameters, null, null, TimeSpan.FromMilliseconds(Timeout.Infinite), cancellationToken).ConfigureAwait(false); + return result ?? throw new InvalidOperationException(); } public Task RestartContainerAsync(string id, ContainerRestartParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -327,8 +324,7 @@ public Task RenameContainerAsync(string id, ContainerRenameParameters parameters throw new ArgumentNullException(nameof(id)); } - var response = await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Post, $"containers/{id}/wait", null, null, null, TimeSpan.FromMilliseconds(Timeout.Infinite), cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Post, $"containers/{id}/wait", null, null, null, TimeSpan.FromMilliseconds(Timeout.Infinite), cancellationToken).ConfigureAwait(false); } public Task RemoveContainerAsync(string id, ContainerRemoveParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -367,9 +363,7 @@ public Task RenameContainerAsync(string id, ContainerRenameParameters parameters var bytes = Convert.FromBase64String(statHeader); - var stat = Encoding.UTF8.GetString(bytes, 0, bytes.Length); - - var pathStat = _client.JsonSerializer.DeserializeObject(stat); + var pathStat = DockerClient.JsonSerializer.Deserialize(bytes); return new GetArchiveFromContainerResponse { @@ -399,8 +393,7 @@ public Task RenameContainerAsync(string id, ContainerRenameParameters parameters public async Task PruneContainersAsync(ContainersPruneParameters parameters, CancellationToken cancellationToken) { var queryParameters = parameters == null ? null : new QueryString(parameters); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "containers/prune", queryParameters, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "containers/prune", queryParameters, cancellationToken).ConfigureAwait(false); } public async Task UpdateContainerAsync(string id, ContainerUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -415,9 +408,8 @@ public async Task PruneContainersAsync(ContainersPruneP throw new ArgumentNullException(nameof(parameters)); } - var data = new JsonRequestContent(parameters, _client.JsonSerializer); - var response = await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Post, $"containers/{id}/update", null, data, cancellationToken); - return _client.JsonSerializer.DeserializeObject(response.Body); + var data = new JsonRequestContent(parameters, DockerClient.JsonSerializer); + return await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Post, $"containers/{id}/update", null, data, cancellationToken); } } } \ No newline at end of file diff --git a/src/Docker.DotNet/Endpoints/ExecOperations.cs b/src/Docker.DotNet/Endpoints/ExecOperations.cs index 27c695989..1708c6057 100644 --- a/src/Docker.DotNet/Endpoints/ExecOperations.cs +++ b/src/Docker.DotNet/Endpoints/ExecOperations.cs @@ -36,9 +36,8 @@ internal ExecOperations(DockerClient client) throw new ArgumentNullException(nameof(parameters)); } - var data = new JsonRequestContent(parameters, _client.JsonSerializer); - var response = await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Post, $"containers/{id}/exec", null, data, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + var data = new JsonRequestContent(parameters, DockerClient.JsonSerializer); + return await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Post, $"containers/{id}/exec", null, data, cancellationToken).ConfigureAwait(false); } public async Task InspectContainerExecAsync(string id, CancellationToken cancellationToken) @@ -48,8 +47,7 @@ public async Task InspectContainerExecAsync(string throw new ArgumentNullException(nameof(id)); } - var response = await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Get, $"exec/{id}/json", null, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Get, $"exec/{id}/json", null, cancellationToken).ConfigureAwait(false); } public Task ResizeContainerExecTtyAsync(string id, ContainerResizeParameters parameters, CancellationToken cancellationToken) @@ -81,7 +79,7 @@ public Task StartContainerExecAsync(string id, CancellationToken cancellationTok { Detach = true, }; - var data = new JsonRequestContent(parameters, _client.JsonSerializer); + var data = new JsonRequestContent(parameters, DockerClient.JsonSerializer); return _client.MakeRequestAsync(new[] { NoSuchContainerHandler }, HttpMethod.Post, $"exec/{id}/start", null, data, cancellationToken); } @@ -99,7 +97,7 @@ public async Task StartWithConfigContainerExecAsync(string id throw new ArgumentNullException(nameof(id)); } - var data = new JsonRequestContent(eConfig, _client.JsonSerializer); + var data = new JsonRequestContent(eConfig, DockerClient.JsonSerializer); var stream = await _client.MakeRequestForHijackedStreamAsync(new[] { NoSuchContainerHandler }, HttpMethod.Post, $"exec/{id}/start", null, data, null, cancellationToken).ConfigureAwait(false); if (!stream.CanCloseWrite) { @@ -110,4 +108,4 @@ public async Task StartWithConfigContainerExecAsync(string id return new MultiplexedStream(stream, !eConfig.Tty); } } -} +} \ No newline at end of file diff --git a/src/Docker.DotNet/Endpoints/ImageOperations.cs b/src/Docker.DotNet/Endpoints/ImageOperations.cs index a33df2def..1a965c48d 100644 --- a/src/Docker.DotNet/Endpoints/ImageOperations.cs +++ b/src/Docker.DotNet/Endpoints/ImageOperations.cs @@ -5,7 +5,6 @@ using System.Linq; using System.Net; using System.Net.Http; -using System.Text; using System.Threading; using System.Threading.Tasks; @@ -41,8 +40,7 @@ internal ImageOperations(DockerClient client) } IQueryString queryParameters = new QueryString(parameters); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "images/json", queryParameters, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "images/json", queryParameters, cancellationToken).ConfigureAwait(false); } public Task BuildImageFromDockerfileAsync(Stream contents, ImageBuildParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -140,7 +138,7 @@ public Task BuildImageFromDockerfileAsync(ImageBuildParameters parameters, Strea if(headers != null) { - foreach(string key in headers.Keys) + foreach(var key in headers.Keys) { customHeaders[key] = headers[key]; } @@ -161,8 +159,7 @@ public Task BuildImageFromDockerfileAsync(ImageBuildParameters parameters, Strea throw new ArgumentNullException(nameof(name)); } - var response = await _client.MakeRequestAsync(new[] { NoSuchImageHandler }, HttpMethod.Get, $"images/{name}/json", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { NoSuchImageHandler }, HttpMethod.Get, $"images/{name}/json", cancellationToken).ConfigureAwait(false); } public async Task> GetImageHistoryAsync(string name, CancellationToken cancellationToken = default(CancellationToken)) @@ -172,8 +169,7 @@ public Task BuildImageFromDockerfileAsync(ImageBuildParameters parameters, Strea throw new ArgumentNullException(nameof(name)); } - var response = await _client.MakeRequestAsync(new[] { NoSuchImageHandler }, HttpMethod.Get, $"images/{name}/history", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { NoSuchImageHandler }, HttpMethod.Get, $"images/{name}/history", cancellationToken).ConfigureAwait(false); } public Task PushImageAsync(string name, ImagePushParameters parameters, AuthConfig authConfig, IProgress progress, CancellationToken cancellationToken = default(CancellationToken)) @@ -225,8 +221,7 @@ public Task BuildImageFromDockerfileAsync(ImageBuildParameters parameters, Strea } IQueryString queryParameters = new QueryString(parameters); - var response = await _client.MakeRequestAsync(new[] { NoSuchImageHandler }, HttpMethod.Delete, $"images/{name}", queryParameters, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject[]>(response.Body); + return await _client.MakeRequestAsync[]>(new[] { NoSuchImageHandler }, HttpMethod.Delete, $"images/{name}", queryParameters, cancellationToken).ConfigureAwait(false); } public async Task> SearchImagesAsync(ImagesSearchParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -237,15 +232,13 @@ public Task BuildImageFromDockerfileAsync(ImageBuildParameters parameters, Strea } IQueryString queryParameters = new QueryString(parameters); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "images/search", queryParameters, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "images/search", queryParameters, cancellationToken).ConfigureAwait(false); } public async Task PruneImagesAsync(ImagesPruneParameters parameters, CancellationToken cancellationToken) { var queryParameters = parameters == null ? null : new QueryString(parameters); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "images/prune", queryParameters, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "images/prune", queryParameters, cancellationToken).ConfigureAwait(false); } public async Task CommitContainerChangesAsync(CommitContainerChangesParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -255,11 +248,10 @@ public async Task PruneImagesAsync(ImagesPruneParameters pa throw new ArgumentNullException(nameof(parameters)); } - var data = new JsonRequestContent(parameters, _client.JsonSerializer); + var data = new JsonRequestContent(parameters, DockerClient.JsonSerializer); IQueryString queryParameters = new QueryString(parameters); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "commit", queryParameters, data, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "commit", queryParameters, data, cancellationToken).ConfigureAwait(false); } public Task SaveImageAsync(string name, CancellationToken cancellationToken = default(CancellationToken)) @@ -307,12 +299,10 @@ private Dictionary RegistryAuthHeaders(AuthConfig authConfig) { { RegistryAuthHeaderKey, - Convert.ToBase64String( - Encoding.UTF8.GetBytes( - _client.JsonSerializer.SerializeObject(authConfig ?? new AuthConfig()))) - .Replace("/", "_").Replace("+", "-") + Convert.ToBase64String(DockerClient.JsonSerializer.SerializeToUtf8Bytes(authConfig ?? new AuthConfig())) + .Replace("/", "_").Replace("+", "-") // This is not documented in Docker API but from source code (https://github.com/docker/docker-ce/blob/10e40bd1548f69354a803a15fde1b672cc024b91/components/cli/cli/command/registry.go#L47) - // and from multiple internet sources it has to be base64-url-safe. + // and from multiple internet sources it has to be base64-url-safe. // See RFC 4648 Section 5. Padding (=) needs to be kept. } }; @@ -320,12 +310,12 @@ private Dictionary RegistryAuthHeaders(AuthConfig authConfig) private Dictionary RegistryConfigHeaders(IEnumerable authConfig) { - var configDictionary = (authConfig ?? new AuthConfig[0]).ToDictionary(e => e.ServerAddress, e => e); + var configDictionary = (authConfig ?? Array.Empty()).ToDictionary(e => e.ServerAddress, e => e); return new Dictionary { { RegistryConfigHeaderKey, - Convert.ToBase64String(Encoding.UTF8.GetBytes(_client.JsonSerializer.SerializeObject(configDictionary))) + Convert.ToBase64String(DockerClient.JsonSerializer.SerializeToUtf8Bytes(configDictionary)) } }; } diff --git a/src/Docker.DotNet/Endpoints/NetworkOperations.cs b/src/Docker.DotNet/Endpoints/NetworkOperations.cs index 3271c636c..aee91d2f0 100644 --- a/src/Docker.DotNet/Endpoints/NetworkOperations.cs +++ b/src/Docker.DotNet/Endpoints/NetworkOperations.cs @@ -29,8 +29,7 @@ internal NetworkOperations(DockerClient client) async Task> INetworkOperations.ListNetworksAsync(NetworksListParameters parameters, CancellationToken cancellationToken) { var queryParameters = parameters == null ? null : new QueryString(parameters); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "networks", queryParameters, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "networks", queryParameters, cancellationToken).ConfigureAwait(false); } async Task INetworkOperations.InspectNetworkAsync(string id, CancellationToken cancellationToken) @@ -40,8 +39,7 @@ async Task INetworkOperations.InspectNetworkAsync(string id, Ca throw new ArgumentNullException(nameof(id)); } - var response = await _client.MakeRequestAsync(new[] { NoSuchNetworkHandler }, HttpMethod.Get, $"networks/{id}", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { NoSuchNetworkHandler }, HttpMethod.Get, $"networks/{id}", cancellationToken).ConfigureAwait(false); } Task INetworkOperations.DeleteNetworkAsync(string id, CancellationToken cancellationToken) @@ -61,9 +59,8 @@ async Task INetworkOperations.CreateNetworkAsync(Network throw new ArgumentNullException(nameof(parameters)); } - var data = new JsonRequestContent(parameters, _client.JsonSerializer); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "networks/create", null, data, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + var data = new JsonRequestContent(parameters, DockerClient.JsonSerializer); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "networks/create", null, data, cancellationToken).ConfigureAwait(false); } Task INetworkOperations.ConnectNetworkAsync(string id, NetworkConnectParameters parameters, CancellationToken cancellationToken) @@ -78,7 +75,7 @@ Task INetworkOperations.ConnectNetworkAsync(string id, NetworkConnectParameters throw new ArgumentNullException(nameof(parameters)); } - var data = new JsonRequestContent(parameters, _client.JsonSerializer); + var data = new JsonRequestContent(parameters, DockerClient.JsonSerializer); return _client.MakeRequestAsync(new[] { NoSuchNetworkHandler }, HttpMethod.Post, $"networks/{id}/connect", null, data, cancellationToken); } @@ -94,7 +91,7 @@ Task INetworkOperations.DisconnectNetworkAsync(string id, NetworkDisconnectParam throw new ArgumentNullException(nameof(parameters)); } - var data = new JsonRequestContent(parameters, _client.JsonSerializer); + var data = new JsonRequestContent(parameters, DockerClient.JsonSerializer); return _client.MakeRequestAsync(new[] { NoSuchNetworkHandler }, HttpMethod.Post, $"networks/{id}/disconnect", null, data, cancellationToken); } @@ -106,8 +103,7 @@ Task INetworkOperations.DeleteUnusedNetworksAsync(NetworksDeleteUnusedParameters async Task INetworkOperations.PruneNetworksAsync(NetworksDeleteUnusedParameters parameters, CancellationToken cancellationToken) { var queryParameters = parameters == null ? null : new QueryString(parameters); - var response = await _client.MakeRequestAsync(null, HttpMethod.Post, "networks/prune", queryParameters, cancellationToken); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(null, HttpMethod.Post, "networks/prune", queryParameters, cancellationToken); } } -} +} \ No newline at end of file diff --git a/src/Docker.DotNet/Endpoints/PluginOperations.cs b/src/Docker.DotNet/Endpoints/PluginOperations.cs index 472c302a9..80fc7e213 100644 --- a/src/Docker.DotNet/Endpoints/PluginOperations.cs +++ b/src/Docker.DotNet/Endpoints/PluginOperations.cs @@ -30,8 +30,7 @@ internal PluginOperations(DockerClient client) public async Task> ListPluginsAsync(PluginListParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { IQueryString queryParameters = parameters == null ? null : new QueryString(parameters); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "plugins", queryParameters, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "plugins", queryParameters, cancellationToken).ConfigureAwait(false); } public async Task> GetPluginPrivilegesAsync(PluginGetPrivilegeParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -42,8 +41,7 @@ internal PluginOperations(DockerClient client) } var query = new QueryString(parameters); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "plugins/privileges", query, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "plugins/privileges", query, cancellationToken).ConfigureAwait(false); } public Task InstallPluginAsync(PluginInstallParameters parameters, IProgress progress, CancellationToken cancellationToken = default(CancellationToken)) @@ -58,7 +56,7 @@ internal PluginOperations(DockerClient client) throw new ArgumentNullException(nameof(parameters.Privileges)); } - var data = new JsonRequestContent>(parameters.Privileges, _client.JsonSerializer); + var data = new JsonRequestContent>(parameters.Privileges, DockerClient.JsonSerializer); IQueryString queryParameters = new QueryString(parameters); return StreamUtil.MonitorStreamForMessagesAsync( @@ -75,8 +73,7 @@ public async Task InspectPluginAsync(string name, CancellationToken canc throw new ArgumentNullException(nameof(name)); } - var response = await _client.MakeRequestAsync(new[] { NoSuchPluginHandler }, HttpMethod.Get, $"plugins/{name}/json", cancellationToken); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { NoSuchPluginHandler }, HttpMethod.Get, $"plugins/{name}/json", cancellationToken); } public Task RemovePluginAsync(string name, PluginRemoveParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -130,7 +127,7 @@ public async Task InspectPluginAsync(string name, CancellationToken canc } var query = new QueryString(parameters); - var data = new JsonRequestContent>(parameters.Privileges, _client.JsonSerializer); + var data = new JsonRequestContent>(parameters.Privileges, DockerClient.JsonSerializer); return _client.MakeRequestAsync(new[] { NoSuchPluginHandler }, HttpMethod.Post, $"plugins/{name}/upgrade", query, data, cancellationToken); } @@ -178,8 +175,8 @@ public async Task InspectPluginAsync(string name, CancellationToken canc throw new ArgumentNullException(nameof(parameters.Args)); } - var body = new JsonRequestContent>(parameters.Args, _client.JsonSerializer); + var body = new JsonRequestContent>(parameters.Args, DockerClient.JsonSerializer); return _client.MakeRequestAsync(new[] { NoSuchPluginHandler }, HttpMethod.Post, $"plugins/{name}/set", null, body, cancellationToken); } } -} +} \ No newline at end of file diff --git a/src/Docker.DotNet/Endpoints/SecretsOperations.cs b/src/Docker.DotNet/Endpoints/SecretsOperations.cs index 3c61a00cc..3145b52e0 100644 --- a/src/Docker.DotNet/Endpoints/SecretsOperations.cs +++ b/src/Docker.DotNet/Endpoints/SecretsOperations.cs @@ -18,8 +18,7 @@ internal SecretsOperations(DockerClient client) async Task> ISecretsOperations.ListAsync(CancellationToken cancellationToken) { - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "secrets", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject>(response.Body); + return await _client.MakeRequestAsync>(_client.NoErrorHandlers, HttpMethod.Get, "secrets", cancellationToken).ConfigureAwait(false); } async Task ISecretsOperations.CreateAsync(SecretSpec body, CancellationToken cancellationToken) @@ -29,9 +28,8 @@ async Task ISecretsOperations.CreateAsync(SecretSpec body, throw new ArgumentNullException(nameof(body)); } - var data = new JsonRequestContent(body, _client.JsonSerializer); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "secrets/create", null, data, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + var data = new JsonRequestContent(body, DockerClient.JsonSerializer); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "secrets/create", null, data, cancellationToken).ConfigureAwait(false); } async Task ISecretsOperations.InspectAsync(string id, CancellationToken cancellationToken) @@ -41,8 +39,7 @@ async Task ISecretsOperations.InspectAsync(string id, CancellationToken throw new ArgumentNullException(nameof(id)); } - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, $"secrets/{id}", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, $"secrets/{id}", cancellationToken).ConfigureAwait(false); } Task ISecretsOperations.DeleteAsync(string id, CancellationToken cancellationToken) diff --git a/src/Docker.DotNet/Endpoints/StreamUtil.cs b/src/Docker.DotNet/Endpoints/StreamUtil.cs index 92ea822e8..dbe9f2af9 100644 --- a/src/Docker.DotNet/Endpoints/StreamUtil.cs +++ b/src/Docker.DotNet/Endpoints/StreamUtil.cs @@ -4,7 +4,6 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using Newtonsoft.Json; namespace Docker.DotNet.Models { @@ -28,16 +27,10 @@ internal static async Task MonitorStreamAsync(Task streamTask, DockerCli internal static async Task MonitorStreamForMessagesAsync(Task streamTask, DockerClient client, CancellationToken cancellationToken, IProgress progress) { - var tcs = new TaskCompletionSource(); - using (var stream = await streamTask) - using (var reader = new StreamReader(stream, new UTF8Encoding(false))) - using (var jsonReader = new JsonTextReader(reader) { SupportMultipleContent = true }) - using (cancellationToken.Register(() => tcs.TrySetCanceled(cancellationToken))) { - while (await await Task.WhenAny(jsonReader.ReadAsync(cancellationToken), tcs.Task)) + await foreach (var ev in DockerClient.JsonSerializer.DeserializeAsync(stream, cancellationToken)) { - var ev = await client.JsonSerializer.Deserialize(jsonReader, cancellationToken); progress.Report(ev); } } diff --git a/src/Docker.DotNet/Endpoints/SwarmOperations.cs b/src/Docker.DotNet/Endpoints/SwarmOperations.cs index e6215df37..a511708db 100644 --- a/src/Docker.DotNet/Endpoints/SwarmOperations.cs +++ b/src/Docker.DotNet/Endpoints/SwarmOperations.cs @@ -4,7 +4,6 @@ namespace Docker.DotNet using System.Collections.Generic; using System.Net; using System.Net.Http; - using System.Text; using System.Threading.Tasks; using System.Threading; using Models; @@ -32,21 +31,19 @@ async Task ISwarmOperations.CreateServiceAsync(ServiceCre { if (parameters == null) throw new ArgumentNullException(nameof(parameters)); - var data = new JsonRequestContent(parameters.Service ?? throw new ArgumentNullException(nameof(parameters.Service)), _client.JsonSerializer); - var response = await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Post, "services/create", null, data, RegistryAuthHeaders(parameters.RegistryAuth), cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + var data = new JsonRequestContent(parameters.Service ?? throw new ArgumentNullException(nameof(parameters.Service)), DockerClient.JsonSerializer); + return await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Post, "services/create", null, data, RegistryAuthHeaders(parameters.RegistryAuth), cancellationToken).ConfigureAwait(false); } async Task ISwarmOperations.GetSwarmUnlockKeyAsync(CancellationToken cancellationToken) { - var response = await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, "swarm/unlockkey", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, "swarm/unlockkey", cancellationToken).ConfigureAwait(false); } async Task ISwarmOperations.InitSwarmAsync(SwarmInitParameters parameters, CancellationToken cancellationToken) { - var data = new JsonRequestContent(parameters ?? throw new ArgumentNullException(nameof(parameters)), _client.JsonSerializer); - var response = await _client.MakeRequestAsync( + var data = new JsonRequestContent(parameters ?? throw new ArgumentNullException(nameof(parameters)), DockerClient.JsonSerializer); + return await _client.MakeRequestAsync( new ApiResponseErrorHandlingDelegate[] { (statusCode, responseBody) => @@ -63,27 +60,23 @@ async Task ISwarmOperations.InitSwarmAsync(SwarmInitParameters parameter null, data, cancellationToken).ConfigureAwait(false); - - return response.Body; } async Task ISwarmOperations.InspectServiceAsync(string id, CancellationToken cancellationToken) { if (string.IsNullOrEmpty(id)) throw new ArgumentNullException(nameof(id)); - var response = await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, $"services/{id}", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, $"services/{id}", cancellationToken).ConfigureAwait(false); } async Task ISwarmOperations.InspectSwarmAsync(CancellationToken cancellationToken) { - var response = await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, "swarm", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, "swarm", cancellationToken).ConfigureAwait(false); } async Task ISwarmOperations.JoinSwarmAsync(SwarmJoinParameters parameters, CancellationToken cancellationToken) { - var data = new JsonRequestContent(parameters ?? throw new ArgumentNullException(nameof(parameters)), _client.JsonSerializer); + var data = new JsonRequestContent(parameters ?? throw new ArgumentNullException(nameof(parameters)), DockerClient.JsonSerializer); await _client.MakeRequestAsync( new ApiResponseErrorHandlingDelegate[] { @@ -127,10 +120,9 @@ await _client.MakeRequestAsync( async Task> ISwarmOperations.ListServicesAsync(ServiceListParameters parameters, CancellationToken cancellationToken) { var queryParameters = parameters != null ? new QueryString(parameters) : null; - var response = await _client - .MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, "services", queryParameters, cancellationToken) + return await _client + .MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, "services", queryParameters, cancellationToken) .ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); } async Task ISwarmOperations.RemoveServiceAsync(string id, CancellationToken cancellationToken) @@ -142,7 +134,7 @@ async Task ISwarmOperations.RemoveServiceAsync(string id, CancellationToken canc async Task ISwarmOperations.UnlockSwarmAsync(SwarmUnlockParameters parameters, CancellationToken cancellationToken) { - var body = new JsonRequestContent(parameters ?? throw new ArgumentNullException(nameof(parameters)), _client.JsonSerializer); + var body = new JsonRequestContent(parameters ?? throw new ArgumentNullException(nameof(parameters)), DockerClient.JsonSerializer); await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Post, "swarm/unlock", null, body, cancellationToken).ConfigureAwait(false); } @@ -152,9 +144,8 @@ async Task ISwarmOperations.UpdateServiceAsync(string id, if (parameters == null) throw new ArgumentNullException(nameof(parameters)); var query = new QueryString(parameters); - var body = new JsonRequestContent(parameters.Service ?? throw new ArgumentNullException(nameof(parameters.Service)), _client.JsonSerializer); - var response = await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Post, $"services/{id}/update", query, body, RegistryAuthHeaders(parameters.RegistryAuth), cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + var body = new JsonRequestContent(parameters.Service ?? throw new ArgumentNullException(nameof(parameters.Service)), DockerClient.JsonSerializer); + return await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Post, $"services/{id}/update", query, body, RegistryAuthHeaders(parameters.RegistryAuth), cancellationToken).ConfigureAwait(false); } public Task GetServiceLogsAsync(string id, ServiceLogsParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) @@ -195,7 +186,7 @@ async Task ISwarmOperations.UpdateServiceAsync(string id, async Task ISwarmOperations.UpdateSwarmAsync(SwarmUpdateParameters parameters, CancellationToken cancellationToken) { var query = new QueryString(parameters ?? throw new ArgumentNullException(nameof(parameters))); - var body = new JsonRequestContent(parameters.Spec ?? throw new ArgumentNullException(nameof(parameters.Spec)), _client.JsonSerializer); + var body = new JsonRequestContent(parameters.Spec ?? throw new ArgumentNullException(nameof(parameters.Spec)), DockerClient.JsonSerializer); await _client.MakeRequestAsync( new ApiResponseErrorHandlingDelegate[] { @@ -226,22 +217,20 @@ private IDictionary RegistryAuthHeaders(AuthConfig authConfig) { { "X-Registry-Auth", - Convert.ToBase64String(Encoding.UTF8.GetBytes(_client.JsonSerializer.SerializeObject(authConfig))) + Convert.ToBase64String(DockerClient.JsonSerializer.SerializeToUtf8Bytes(authConfig)) } }; } async Task> ISwarmOperations.ListNodesAsync(CancellationToken cancellationToken) { - var response = await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, "nodes", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, "nodes", cancellationToken).ConfigureAwait(false); } async Task ISwarmOperations.InspectNodeAsync(string id, CancellationToken cancellationToken) { if (string.IsNullOrEmpty(id)) throw new ArgumentNullException(nameof(id)); - var response = await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, $"nodes/{id}", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Get, $"nodes/{id}", cancellationToken).ConfigureAwait(false); } async Task ISwarmOperations.RemoveNodeAsync(string id, bool force, CancellationToken cancellationToken) @@ -256,8 +245,8 @@ async Task ISwarmOperations.UpdateNodeAsync(string id, ulong version, NodeUpdate { if (string.IsNullOrEmpty(id)) throw new ArgumentNullException(nameof(id)); var query = new EnumerableQueryString("version", new[] { version.ToString() }); - var body = new JsonRequestContent(parameters ?? throw new ArgumentNullException(nameof(parameters)), _client.JsonSerializer); + var body = new JsonRequestContent(parameters ?? throw new ArgumentNullException(nameof(parameters)), DockerClient.JsonSerializer); await _client.MakeRequestAsync(new[] { SwarmResponseHandler }, HttpMethod.Post, $"nodes/{id}/update", query, body, cancellationToken); } } -} +} \ No newline at end of file diff --git a/src/Docker.DotNet/Endpoints/SystemOperations.cs b/src/Docker.DotNet/Endpoints/SystemOperations.cs index 02e875277..6da3acf39 100644 --- a/src/Docker.DotNet/Endpoints/SystemOperations.cs +++ b/src/Docker.DotNet/Endpoints/SystemOperations.cs @@ -22,15 +22,14 @@ internal SystemOperations(DockerClient client) { throw new ArgumentNullException(nameof(authConfig)); } - var data = new JsonRequestContent(authConfig, _client.JsonSerializer); + var data = new JsonRequestContent(authConfig, DockerClient.JsonSerializer); return _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "auth", null, data, cancellationToken); } public async Task GetVersionAsync(CancellationToken cancellationToken = default(CancellationToken)) { - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "version", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "version", cancellationToken).ConfigureAwait(false); } public Task PingAsync(CancellationToken cancellationToken = default(CancellationToken)) @@ -40,8 +39,7 @@ internal SystemOperations(DockerClient client) public async Task GetSystemInfoAsync(CancellationToken cancellationToken = default(CancellationToken)) { - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "info", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "info", cancellationToken).ConfigureAwait(false); } public Task MonitorEventsAsync(ContainerEventsParameters parameters, CancellationToken cancellationToken) diff --git a/src/Docker.DotNet/Endpoints/TasksOperations.cs b/src/Docker.DotNet/Endpoints/TasksOperations.cs index 1a4feaa3f..9facb6482 100644 --- a/src/Docker.DotNet/Endpoints/TasksOperations.cs +++ b/src/Docker.DotNet/Endpoints/TasksOperations.cs @@ -28,8 +28,7 @@ async Task> ITasksOperations.ListAsync(TasksListParameters p query = new QueryString(parameters); } - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "tasks", query, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject>(response.Body); + return await _client.MakeRequestAsync>(_client.NoErrorHandlers, HttpMethod.Get, "tasks", query, cancellationToken).ConfigureAwait(false); } async Task ITasksOperations.InspectAsync(string id, CancellationToken cancellationToken) @@ -39,8 +38,7 @@ async Task ITasksOperations.InspectAsync(string id, CancellationTo throw new ArgumentNullException(nameof(id)); } - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, $"tasks/{id}", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, $"tasks/{id}", cancellationToken).ConfigureAwait(false); } } } \ No newline at end of file diff --git a/src/Docker.DotNet/Endpoints/VolumeOperations.cs b/src/Docker.DotNet/Endpoints/VolumeOperations.cs index 27d26912e..33f3f8ffb 100644 --- a/src/Docker.DotNet/Endpoints/VolumeOperations.cs +++ b/src/Docker.DotNet/Endpoints/VolumeOperations.cs @@ -17,15 +17,13 @@ internal VolumeOperations(DockerClient client) async Task IVolumeOperations.ListAsync(CancellationToken cancellationToken) { - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "volumes", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "volumes", cancellationToken).ConfigureAwait(false); } async Task IVolumeOperations.ListAsync(VolumesListParameters parameters, CancellationToken cancellationToken) { var queryParameters = parameters == null ? null : new QueryString(parameters); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "volumes", queryParameters, null, cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "volumes", queryParameters, null, cancellationToken).ConfigureAwait(false); } async Task IVolumeOperations.CreateAsync(VolumesCreateParameters parameters, CancellationToken cancellationToken) @@ -35,9 +33,8 @@ async Task IVolumeOperations.CreateAsync(VolumesCreateParameters throw new ArgumentNullException(nameof(parameters)); } - var data = new JsonRequestContent(parameters, _client.JsonSerializer); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "volumes/create", null, data, cancellationToken); - return _client.JsonSerializer.DeserializeObject(response.Body); + var data = new JsonRequestContent(parameters, DockerClient.JsonSerializer); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "volumes/create", null, data, cancellationToken); } async Task IVolumeOperations.InspectAsync(string name, CancellationToken cancellationToken) @@ -47,8 +44,7 @@ async Task IVolumeOperations.InspectAsync(string name, Cancellat throw new ArgumentNullException(nameof(name)); } - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, $"volumes/{name}", cancellationToken).ConfigureAwait(false); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, $"volumes/{name}", cancellationToken).ConfigureAwait(false); } Task IVolumeOperations.RemoveAsync(string name, bool? force, CancellationToken cancellationToken) @@ -57,15 +53,14 @@ Task IVolumeOperations.RemoveAsync(string name, bool? force, CancellationToken c { throw new ArgumentNullException(nameof(name)); } - + return _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Delete, $"volumes/{name}", cancellationToken); } async Task IVolumeOperations.PruneAsync(VolumesPruneParameters parameters, CancellationToken cancellationToken) { var queryParameters = parameters == null ? null : new QueryString(parameters); - var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "volumes/prune", queryParameters, cancellationToken); - return _client.JsonSerializer.DeserializeObject(response.Body); + return await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "volumes/prune", queryParameters, cancellationToken); } } } \ No newline at end of file diff --git a/src/Docker.DotNet/EnumerableQueryStringConverter.cs b/src/Docker.DotNet/EnumerableQueryStringConverter.cs index 5e015d1a5..d258690d5 100644 --- a/src/Docker.DotNet/EnumerableQueryStringConverter.cs +++ b/src/Docker.DotNet/EnumerableQueryStringConverter.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Reflection; -using Newtonsoft.Json; namespace Docker.DotNet { @@ -32,7 +31,7 @@ public string[] Convert(object o) } else { - items.Add(JsonConvert.SerializeObject(e)); + items.Add(JsonSerializer.Instance.Serialize(e)); } } diff --git a/src/Docker.DotNet/JsonBase64Converter.cs b/src/Docker.DotNet/JsonBase64Converter.cs index 889cf3ca5..9c22272a2 100644 --- a/src/Docker.DotNet/JsonBase64Converter.cs +++ b/src/Docker.DotNet/JsonBase64Converter.cs @@ -1,31 +1,39 @@ using System; using System.Collections.Generic; -using Newtonsoft.Json; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text.Json; +using System.Text.Json.Serialization; namespace Docker.DotNet { - internal class JsonBase64Converter : JsonConverter + internal class JsonBase64Converter : JsonConverter> { - private static readonly Type _byteListType = typeof(IList); - public override bool CanRead => true; - - public override bool CanWrite => false; - - public override void WriteJson(JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) + public override IList Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - throw new NotImplementedException(); + return reader.GetBytesFromBase64(); } - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) + public override void Write(Utf8JsonWriter writer, IList value, JsonSerializerOptions options) { - var strVal = reader.Value as string; - - return Convert.FromBase64String(strVal); + var bytes = GetBytes(value); + writer.WriteBase64StringValue(bytes); } - public override bool CanConvert(Type objectType) + private static ReadOnlySpan GetBytes(IList value) { - return objectType == _byteListType; +#if !NETSTANDARD + if (value is List list) + { + return CollectionsMarshal.AsSpan(list); + } +#endif + if (value is byte[] array) + { + return array; + } + + return value.ToArray(); } } } \ No newline at end of file diff --git a/src/Docker.DotNet/JsonDateTimeConverter.cs b/src/Docker.DotNet/JsonDateTimeConverter.cs new file mode 100644 index 000000000..f8d3ee346 --- /dev/null +++ b/src/Docker.DotNet/JsonDateTimeConverter.cs @@ -0,0 +1,28 @@ +namespace Docker.DotNet; + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; + +internal sealed class JsonDateTimeConverter : JsonConverter +{ + private static readonly DateTime UnixEpochBase = new(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + + public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case JsonTokenType.Number: + return UnixEpochBase.AddSeconds(reader.GetInt64()); + case JsonTokenType.String: + return reader.GetDateTime(); + default: + throw new NotImplementedException($"Deserializing JSON '{reader.TokenType}' to DateTime is not handled."); + } + } + + public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/src/Docker.DotNet/JsonEnumMemberConverter.cs b/src/Docker.DotNet/JsonEnumMemberConverter.cs new file mode 100644 index 000000000..0b8f9aff0 --- /dev/null +++ b/src/Docker.DotNet/JsonEnumMemberConverter.cs @@ -0,0 +1,34 @@ +namespace Docker.DotNet; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Runtime.Serialization; +using System.Text.Json; +using System.Text.Json.Serialization; + +// https://github.com/dotnet/runtime/issues/74385#issuecomment-1705083109. +internal sealed class JsonEnumMemberConverter : JsonStringEnumConverter where TEnum : struct, Enum +{ + public JsonEnumMemberConverter() : base(ResolveNamingPolicy()) + { + } + + private static JsonNamingPolicy ResolveNamingPolicy() + { + return new EnumMemberNamingPolicy(typeof(TEnum).GetFields(BindingFlags.Public | BindingFlags.Static) + .Select(fieldInfo => new KeyValuePair(fieldInfo.Name, fieldInfo.GetCustomAttribute()?.Value)) + .Where(kvp => kvp.Value != null) + .ToDictionary(kvp => kvp.Key, kvp => kvp.Value)); + } + + private sealed class EnumMemberNamingPolicy : JsonNamingPolicy + { + private readonly IReadOnlyDictionary _map; + + public EnumMemberNamingPolicy(IReadOnlyDictionary map) => _map = map; + + public override string ConvertName(string name) => _map.TryGetValue(name, out var newName) ? newName : name; + } +} \ No newline at end of file diff --git a/src/Docker.DotNet/JsonIso8601AndUnixEpochDateConverter.cs b/src/Docker.DotNet/JsonIso8601AndUnixEpochDateConverter.cs deleted file mode 100644 index e59f41b36..000000000 --- a/src/Docker.DotNet/JsonIso8601AndUnixEpochDateConverter.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Globalization; -using Newtonsoft.Json; - -namespace Docker.DotNet -{ - using System.Reflection; - - internal class JsonIso8601AndUnixEpochDateConverter : JsonConverter - { - private static readonly DateTime UnixEpochBase = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); - - public override bool CanConvert(Type objectType) - { - return objectType == typeof (DateTime) || objectType == typeof (DateTime?); - } - - public override void WriteJson(JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) - { - throw new NotImplementedException(); - } - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) - { - var isNullableType = (objectType.GetTypeInfo().IsGenericType && objectType.GetGenericTypeDefinition() == typeof (Nullable<>)); - var value = reader.Value; - - DateTime result; - if (value is DateTime) - { - result = (DateTime) value; - } - else if (value is string) - { - // ISO 8601 String - result = DateTime.Parse((string) value, CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind); - } - else if (value is long) - { - // UNIX epoch timestamp (in seconds) - result = UnixEpochBase.AddSeconds((long) value); - } - else - { - throw new NotImplementedException($"Deserializing {value.GetType().FullName} back to {objectType.FullName} is not handled."); - } - - if (isNullableType && result == default(DateTime)) - { - return null; // do not set result on DateTime? field - } - - return result; - } - } -} \ No newline at end of file diff --git a/src/Docker.DotNet/JsonNullableDateTimeConverter.cs b/src/Docker.DotNet/JsonNullableDateTimeConverter.cs new file mode 100644 index 000000000..9fe9c8113 --- /dev/null +++ b/src/Docker.DotNet/JsonNullableDateTimeConverter.cs @@ -0,0 +1,30 @@ +namespace Docker.DotNet; + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; + +internal sealed class JsonNullableDateTimeConverter : JsonConverter +{ + private static readonly DateTime UnixEpochBase = new(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + + public override DateTime? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case JsonTokenType.Null: + return null; + case JsonTokenType.Number: + return UnixEpochBase.AddSeconds(reader.GetInt64()); + case JsonTokenType.String: + return reader.GetDateTime(); + default: + throw new NotImplementedException($"Deserializing JSON '{reader.TokenType}' to DateTime is not handled."); + } + } + + public override void Write(Utf8JsonWriter writer, DateTime? value, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/src/Docker.DotNet/JsonQueryStringConverter.cs b/src/Docker.DotNet/JsonQueryStringConverter.cs index 323c64f36..14940a75c 100644 --- a/src/Docker.DotNet/JsonQueryStringConverter.cs +++ b/src/Docker.DotNet/JsonQueryStringConverter.cs @@ -1,6 +1,5 @@ using System; using System.Diagnostics; -using Newtonsoft.Json; namespace Docker.DotNet.Models { @@ -15,7 +14,7 @@ public string[] Convert(object o) { Debug.Assert(o != null); - return new[] {JsonConvert.SerializeObject(o, Formatting.None)}; + return new[] { JsonSerializer.Instance.Serialize(o) }; } } } \ No newline at end of file diff --git a/src/Docker.DotNet/JsonRequestContent.cs b/src/Docker.DotNet/JsonRequestContent.cs index fda26fc0b..912be62dc 100644 --- a/src/Docker.DotNet/JsonRequestContent.cs +++ b/src/Docker.DotNet/JsonRequestContent.cs @@ -1,14 +1,11 @@ using System; using System.Collections.Generic; using System.Net.Http; -using System.Text; namespace Docker.DotNet { internal class JsonRequestContent : IRequestContent { - private const string JsonMimeType = "application/json"; - private readonly T _value; private readonly JsonSerializer _serializer; @@ -30,8 +27,7 @@ public JsonRequestContent(T val, JsonSerializer serializer) public HttpContent GetContent() { - var serializedObject = _serializer.SerializeObject(_value); - return new StringContent(serializedObject, Encoding.UTF8, JsonMimeType); + return _serializer.GetJsonContent(_value); } } } \ No newline at end of file diff --git a/src/Docker.DotNet/JsonSerializer.cs b/src/Docker.DotNet/JsonSerializer.cs index 77f5177af..e64dde628 100644 --- a/src/Docker.DotNet/JsonSerializer.cs +++ b/src/Docker.DotNet/JsonSerializer.cs @@ -1,60 +1,95 @@ -using System.Threading; +namespace Docker.DotNet; + +using System.Buffers; +using System.Collections.Generic; +using System.IO; +using System.IO.Pipelines; +using System.Net.Http; +using System.Net.Http.Json; +using System.Runtime.CompilerServices; +using System.Text.Json; +using System.Threading; using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using Docker.DotNet.Models; -namespace Docker.DotNet +internal sealed class JsonSerializer { - /// - /// Facade for . - /// - internal class JsonSerializer + private readonly JsonSerializerOptions _options = new JsonSerializerOptions(); + + private JsonSerializer() + { + _options.Converters.Add(new JsonEnumMemberConverter()); + _options.Converters.Add(new JsonEnumMemberConverter()); + _options.Converters.Add(new JsonDateTimeConverter()); + _options.Converters.Add(new JsonNullableDateTimeConverter()); + _options.Converters.Add(new JsonBase64Converter()); + } + + public static JsonSerializer Instance { get; } + = new JsonSerializer(); + + public HttpContent GetJsonContent(T value) + { + return JsonContent.Create(value, options: _options); + } + + public string Serialize(T value) + { + return System.Text.Json.JsonSerializer.Serialize(value, _options); + } + + public byte[] SerializeToUtf8Bytes(T value) + { + return System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(value, _options); + } + + public T Deserialize(byte[] json) + { + return System.Text.Json.JsonSerializer.Deserialize(json, _options); + } + + public Task DeserializeAsync(HttpContent content, CancellationToken cancellationToken) { - private readonly Newtonsoft.Json.JsonSerializer _serializer; + return content.ReadFromJsonAsync(_options, cancellationToken); + } - private readonly JsonSerializerSettings _settings = new JsonSerializerSettings + public async IAsyncEnumerable DeserializeAsync(Stream stream, [EnumeratorCancellation] CancellationToken cancellationToken) + { + var reader = PipeReader.Create(stream); + + while (true) { - NullValueHandling = NullValueHandling.Ignore, - Converters = new JsonConverter[] + var result = await reader.ReadAsync(cancellationToken) + .ConfigureAwait(false); + + var buffer = result.Buffer; + + while (!buffer.IsEmpty && TryParseJson(ref buffer, out var jsonDocument)) { - new JsonIso8601AndUnixEpochDateConverter(), - new JsonVersionConverter(), - new StringEnumConverter(), - new TimeSpanSecondsConverter(), - new TimeSpanNanosecondsConverter(), - new JsonBase64Converter() + yield return jsonDocument.Deserialize(_options); } - }; - - public JsonSerializer() - { - _serializer = Newtonsoft.Json.JsonSerializer.CreateDefault(_settings); - } - public Task Deserialize(JsonReader jsonReader, CancellationToken cancellationToken) - { - var tcs = new TaskCompletionSource(); - using (cancellationToken.Register(() => tcs.TrySetCanceled(cancellationToken))) + if (result.IsCompleted) { - Task.Factory.StartNew( - () => tcs.TrySetResult(_serializer.Deserialize(jsonReader)), - cancellationToken, - TaskCreationOptions.LongRunning, - TaskScheduler.Default - ); - - return tcs.Task; + break; } - } - public T DeserializeObject(string json) - { - return JsonConvert.DeserializeObject(json, _settings); + reader.AdvanceTo(buffer.Start, buffer.End); } - public string SerializeObject(T value) + await reader.CompleteAsync(); + } + + private static bool TryParseJson(ref ReadOnlySequence buffer, out JsonDocument jsonDocument) + { + var reader = new Utf8JsonReader(buffer, isFinalBlock: false, default); + + if (JsonDocument.TryParseValue(ref reader, out jsonDocument)) { - return JsonConvert.SerializeObject(value, _settings); + buffer = buffer.Slice(reader.BytesConsumed); + return true; } + + return false; } -} +} \ No newline at end of file diff --git a/src/Docker.DotNet/JsonVersionConverter.cs b/src/Docker.DotNet/JsonVersionConverter.cs deleted file mode 100644 index b27871c38..000000000 --- a/src/Docker.DotNet/JsonVersionConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using Newtonsoft.Json; - -namespace Docker.DotNet -{ - internal class JsonVersionConverter : JsonConverter - { - public override void WriteJson(JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) - { - throw new NotImplementedException(); - } - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) - { - var strVal = reader.Value as string; - if (strVal == null) - { - var valueType = reader.Value == null ? "" : reader.Value.GetType().FullName; - throw new InvalidOperationException($"Cannot deserialize value of type '{valueType}' to '{objectType.FullName}' "); - } - - return Version.Parse(strVal); - } - - public override bool CanConvert(Type objectType) - { - return objectType == typeof (Version); - } - } -} \ No newline at end of file diff --git a/src/Docker.DotNet/MapQueryStringConverter.cs b/src/Docker.DotNet/MapQueryStringConverter.cs index 222ab9fca..bacc165e8 100644 --- a/src/Docker.DotNet/MapQueryStringConverter.cs +++ b/src/Docker.DotNet/MapQueryStringConverter.cs @@ -2,7 +2,6 @@ using System.Collections; using System.Diagnostics; using System.Reflection; -using Newtonsoft.Json; namespace Docker.DotNet { @@ -17,7 +16,7 @@ public string[] Convert(object o) { Debug.Assert(o != null); - return new[] { JsonConvert.SerializeObject(o) }; + return new[] { JsonSerializer.Instance.Serialize(o) }; } } } \ No newline at end of file diff --git a/src/Docker.DotNet/Microsoft.Net.Http.Client/UnixDomainSocketEndPoint.cs b/src/Docker.DotNet/Microsoft.Net.Http.Client/UnixDomainSocketEndPoint.cs index 343caccff..b89bd36fb 100644 --- a/src/Docker.DotNet/Microsoft.Net.Http.Client/UnixDomainSocketEndPoint.cs +++ b/src/Docker.DotNet/Microsoft.Net.Http.Client/UnixDomainSocketEndPoint.cs @@ -86,7 +86,7 @@ public override SocketAddress Serialize() return result; } - public override EndPoint Create(SocketAddress socketAddress) => new Microsoft.Net.Http.Client.UnixDomainSocketEndPoint(socketAddress); + public override EndPoint Create(SocketAddress socketAddress) => new UnixDomainSocketEndPoint(socketAddress); public override AddressFamily AddressFamily => EndPointAddressFamily; diff --git a/src/Docker.DotNet/Models/Actor.Generated.cs b/src/Docker.DotNet/Models/Actor.Generated.cs index 91f820970..7dfa73e62 100644 --- a/src/Docker.DotNet/Models/Actor.Generated.cs +++ b/src/Docker.DotNet/Models/Actor.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Actor // (events.Actor) { - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Attributes", EmitDefaultValue = false)] + [JsonPropertyName("Attributes")] public IDictionary Attributes { get; set; } } } diff --git a/src/Docker.DotNet/Models/Address.Generated.cs b/src/Docker.DotNet/Models/Address.Generated.cs index 6cc41d790..a09f127f9 100644 --- a/src/Docker.DotNet/Models/Address.Generated.cs +++ b/src/Docker.DotNet/Models/Address.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Address // (network.Address) { - [DataMember(Name = "Addr", EmitDefaultValue = false)] + [JsonPropertyName("Addr")] public string Addr { get; set; } - [DataMember(Name = "PrefixLen", EmitDefaultValue = false)] + [JsonPropertyName("PrefixLen")] public long PrefixLen { get; set; } } } diff --git a/src/Docker.DotNet/Models/Annotations.Generated.cs b/src/Docker.DotNet/Models/Annotations.Generated.cs index b71db7c80..4f2fd2479 100644 --- a/src/Docker.DotNet/Models/Annotations.Generated.cs +++ b/src/Docker.DotNet/Models/Annotations.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Annotations // (swarm.Annotations) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } } } diff --git a/src/Docker.DotNet/Models/AppArmorOpts.Generated.cs b/src/Docker.DotNet/Models/AppArmorOpts.Generated.cs index dba6dc0c4..53ff4bce6 100644 --- a/src/Docker.DotNet/Models/AppArmorOpts.Generated.cs +++ b/src/Docker.DotNet/Models/AppArmorOpts.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class AppArmorOpts // (swarm.AppArmorOpts) { - [DataMember(Name = "Mode", EmitDefaultValue = false)] + [JsonPropertyName("Mode")] public string Mode { get; set; } } } diff --git a/src/Docker.DotNet/Models/AttestationProperties.Generated.cs b/src/Docker.DotNet/Models/AttestationProperties.Generated.cs index 0e6799e19..ff848884c 100644 --- a/src/Docker.DotNet/Models/AttestationProperties.Generated.cs +++ b/src/Docker.DotNet/Models/AttestationProperties.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class AttestationProperties // (image.AttestationProperties) { - [DataMember(Name = "For", EmitDefaultValue = false)] + [JsonPropertyName("For")] public string For { get; set; } } } diff --git a/src/Docker.DotNet/Models/AuthConfig.Generated.cs b/src/Docker.DotNet/Models/AuthConfig.Generated.cs index c8f2f94c2..8cdff7b0a 100644 --- a/src/Docker.DotNet/Models/AuthConfig.Generated.cs +++ b/src/Docker.DotNet/Models/AuthConfig.Generated.cs @@ -1,29 +1,28 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class AuthConfig // (registry.AuthConfig) { - [DataMember(Name = "username", EmitDefaultValue = false)] + [JsonPropertyName("username")] public string Username { get; set; } - [DataMember(Name = "password", EmitDefaultValue = false)] + [JsonPropertyName("password")] public string Password { get; set; } - [DataMember(Name = "auth", EmitDefaultValue = false)] + [JsonPropertyName("auth")] public string Auth { get; set; } - [DataMember(Name = "email", EmitDefaultValue = false)] + [JsonPropertyName("email")] public string Email { get; set; } - [DataMember(Name = "serveraddress", EmitDefaultValue = false)] + [JsonPropertyName("serveraddress")] public string ServerAddress { get; set; } - [DataMember(Name = "identitytoken", EmitDefaultValue = false)] + [JsonPropertyName("identitytoken")] public string IdentityToken { get; set; } - [DataMember(Name = "registrytoken", EmitDefaultValue = false)] + [JsonPropertyName("registrytoken")] public string RegistryToken { get; set; } } } diff --git a/src/Docker.DotNet/Models/AuthResponse.Generated.cs b/src/Docker.DotNet/Models/AuthResponse.Generated.cs index b6001d68e..ade23ece3 100644 --- a/src/Docker.DotNet/Models/AuthResponse.Generated.cs +++ b/src/Docker.DotNet/Models/AuthResponse.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class AuthResponse // (registry.AuthenticateOKBody) { - [DataMember(Name = "IdentityToken", EmitDefaultValue = false)] + [JsonPropertyName("IdentityToken")] public string IdentityToken { get; set; } - [DataMember(Name = "Status", EmitDefaultValue = false)] + [JsonPropertyName("Status")] public string Status { get; set; } } } diff --git a/src/Docker.DotNet/Models/BindOptions.Generated.cs b/src/Docker.DotNet/Models/BindOptions.Generated.cs index aea05d74b..e90a45a00 100644 --- a/src/Docker.DotNet/Models/BindOptions.Generated.cs +++ b/src/Docker.DotNet/Models/BindOptions.Generated.cs @@ -1,23 +1,22 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class BindOptions // (mount.BindOptions) { - [DataMember(Name = "Propagation", EmitDefaultValue = false)] + [JsonPropertyName("Propagation")] public string Propagation { get; set; } - [DataMember(Name = "NonRecursive", EmitDefaultValue = false)] + [JsonPropertyName("NonRecursive")] public bool NonRecursive { get; set; } - [DataMember(Name = "CreateMountpoint", EmitDefaultValue = false)] + [JsonPropertyName("CreateMountpoint")] public bool CreateMountpoint { get; set; } - [DataMember(Name = "ReadOnlyNonRecursive", EmitDefaultValue = false)] + [JsonPropertyName("ReadOnlyNonRecursive")] public bool ReadOnlyNonRecursive { get; set; } - [DataMember(Name = "ReadOnlyForceRecursive", EmitDefaultValue = false)] + [JsonPropertyName("ReadOnlyForceRecursive")] public bool ReadOnlyForceRecursive { get; set; } } } diff --git a/src/Docker.DotNet/Models/BlkioStatEntry.Generated.cs b/src/Docker.DotNet/Models/BlkioStatEntry.Generated.cs index 6d64933ad..a500fd5ea 100644 --- a/src/Docker.DotNet/Models/BlkioStatEntry.Generated.cs +++ b/src/Docker.DotNet/Models/BlkioStatEntry.Generated.cs @@ -1,20 +1,19 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class BlkioStatEntry // (container.BlkioStatEntry) { - [DataMember(Name = "major", EmitDefaultValue = false)] + [JsonPropertyName("major")] public ulong Major { get; set; } - [DataMember(Name = "minor", EmitDefaultValue = false)] + [JsonPropertyName("minor")] public ulong Minor { get; set; } - [DataMember(Name = "op", EmitDefaultValue = false)] + [JsonPropertyName("op")] public string Op { get; set; } - [DataMember(Name = "value", EmitDefaultValue = false)] + [JsonPropertyName("value")] public ulong Value { get; set; } } } diff --git a/src/Docker.DotNet/Models/BlkioStats.Generated.cs b/src/Docker.DotNet/Models/BlkioStats.Generated.cs index d1e74bef0..018aa5413 100644 --- a/src/Docker.DotNet/Models/BlkioStats.Generated.cs +++ b/src/Docker.DotNet/Models/BlkioStats.Generated.cs @@ -1,33 +1,32 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class BlkioStats // (container.BlkioStats) { - [DataMember(Name = "io_service_bytes_recursive", EmitDefaultValue = false)] + [JsonPropertyName("io_service_bytes_recursive")] public IList IoServiceBytesRecursive { get; set; } - [DataMember(Name = "io_serviced_recursive", EmitDefaultValue = false)] + [JsonPropertyName("io_serviced_recursive")] public IList IoServicedRecursive { get; set; } - [DataMember(Name = "io_queue_recursive", EmitDefaultValue = false)] + [JsonPropertyName("io_queue_recursive")] public IList IoQueuedRecursive { get; set; } - [DataMember(Name = "io_service_time_recursive", EmitDefaultValue = false)] + [JsonPropertyName("io_service_time_recursive")] public IList IoServiceTimeRecursive { get; set; } - [DataMember(Name = "io_wait_time_recursive", EmitDefaultValue = false)] + [JsonPropertyName("io_wait_time_recursive")] public IList IoWaitTimeRecursive { get; set; } - [DataMember(Name = "io_merged_recursive", EmitDefaultValue = false)] + [JsonPropertyName("io_merged_recursive")] public IList IoMergedRecursive { get; set; } - [DataMember(Name = "io_time_recursive", EmitDefaultValue = false)] + [JsonPropertyName("io_time_recursive")] public IList IoTimeRecursive { get; set; } - [DataMember(Name = "sectors_recursive", EmitDefaultValue = false)] + [JsonPropertyName("sectors_recursive")] public IList SectorsRecursive { get; set; } } } diff --git a/src/Docker.DotNet/Models/CAConfig.Generated.cs b/src/Docker.DotNet/Models/CAConfig.Generated.cs index cdfebd761..df7d45ccd 100644 --- a/src/Docker.DotNet/Models/CAConfig.Generated.cs +++ b/src/Docker.DotNet/Models/CAConfig.Generated.cs @@ -1,24 +1,23 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class CAConfig // (swarm.CAConfig) { - [DataMember(Name = "NodeCertExpiry", EmitDefaultValue = false)] + [JsonPropertyName("NodeCertExpiry")] public long NodeCertExpiry { get; set; } - [DataMember(Name = "ExternalCAs", EmitDefaultValue = false)] + [JsonPropertyName("ExternalCAs")] public IList ExternalCAs { get; set; } - [DataMember(Name = "SigningCACert", EmitDefaultValue = false)] + [JsonPropertyName("SigningCACert")] public string SigningCACert { get; set; } - [DataMember(Name = "SigningCAKey", EmitDefaultValue = false)] + [JsonPropertyName("SigningCAKey")] public string SigningCAKey { get; set; } - [DataMember(Name = "ForceRotate", EmitDefaultValue = false)] + [JsonPropertyName("ForceRotate")] public ulong ForceRotate { get; set; } } } diff --git a/src/Docker.DotNet/Models/CPUStats.Generated.cs b/src/Docker.DotNet/Models/CPUStats.Generated.cs index 790aaaddf..93ff883b6 100644 --- a/src/Docker.DotNet/Models/CPUStats.Generated.cs +++ b/src/Docker.DotNet/Models/CPUStats.Generated.cs @@ -1,20 +1,19 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class CPUStats // (container.CPUStats) { - [DataMember(Name = "cpu_usage", EmitDefaultValue = false)] + [JsonPropertyName("cpu_usage")] public CPUUsage CPUUsage { get; set; } - [DataMember(Name = "system_cpu_usage", EmitDefaultValue = false)] + [JsonPropertyName("system_cpu_usage")] public ulong SystemUsage { get; set; } - [DataMember(Name = "online_cpus", EmitDefaultValue = false)] + [JsonPropertyName("online_cpus")] public uint OnlineCPUs { get; set; } - [DataMember(Name = "throttling_data", EmitDefaultValue = false)] + [JsonPropertyName("throttling_data")] public ThrottlingData ThrottlingData { get; set; } } } diff --git a/src/Docker.DotNet/Models/CPUUsage.Generated.cs b/src/Docker.DotNet/Models/CPUUsage.Generated.cs index e3265068e..54ca9f9ad 100644 --- a/src/Docker.DotNet/Models/CPUUsage.Generated.cs +++ b/src/Docker.DotNet/Models/CPUUsage.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class CPUUsage // (container.CPUUsage) { - [DataMember(Name = "total_usage", EmitDefaultValue = false)] + [JsonPropertyName("total_usage")] public ulong TotalUsage { get; set; } - [DataMember(Name = "percpu_usage", EmitDefaultValue = false)] + [JsonPropertyName("percpu_usage")] public IList PercpuUsage { get; set; } - [DataMember(Name = "usage_in_kernelmode", EmitDefaultValue = false)] + [JsonPropertyName("usage_in_kernelmode")] public ulong UsageInKernelmode { get; set; } - [DataMember(Name = "usage_in_usermode", EmitDefaultValue = false)] + [JsonPropertyName("usage_in_usermode")] public ulong UsageInUsermode { get; set; } } } diff --git a/src/Docker.DotNet/Models/CapacityRange.Generated.cs b/src/Docker.DotNet/Models/CapacityRange.Generated.cs index ee62c1039..e51d6ecd4 100644 --- a/src/Docker.DotNet/Models/CapacityRange.Generated.cs +++ b/src/Docker.DotNet/Models/CapacityRange.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class CapacityRange // (volume.CapacityRange) { - [DataMember(Name = "RequiredBytes", EmitDefaultValue = false)] + [JsonPropertyName("RequiredBytes")] public long RequiredBytes { get; set; } - [DataMember(Name = "LimitBytes", EmitDefaultValue = false)] + [JsonPropertyName("LimitBytes")] public long LimitBytes { get; set; } } } diff --git a/src/Docker.DotNet/Models/ClusterInfo.Generated.cs b/src/Docker.DotNet/Models/ClusterInfo.Generated.cs index 7bec4af9d..fe0a3629d 100644 --- a/src/Docker.DotNet/Models/ClusterInfo.Generated.cs +++ b/src/Docker.DotNet/Models/ClusterInfo.Generated.cs @@ -1,10 +1,9 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ClusterInfo // (swarm.ClusterInfo) { public ClusterInfo() @@ -21,34 +20,34 @@ public ClusterInfo(Meta Meta) } } - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public Version Version { get; set; } - [DataMember(Name = "CreatedAt", EmitDefaultValue = false)] + [JsonPropertyName("CreatedAt")] public DateTime CreatedAt { get; set; } - [DataMember(Name = "UpdatedAt", EmitDefaultValue = false)] + [JsonPropertyName("UpdatedAt")] public DateTime UpdatedAt { get; set; } - [DataMember(Name = "Spec", EmitDefaultValue = false)] + [JsonPropertyName("Spec")] public Spec Spec { get; set; } - [DataMember(Name = "TLSInfo", EmitDefaultValue = false)] + [JsonPropertyName("TLSInfo")] public TLSInfo TLSInfo { get; set; } - [DataMember(Name = "RootRotationInProgress", EmitDefaultValue = false)] + [JsonPropertyName("RootRotationInProgress")] public bool RootRotationInProgress { get; set; } - [DataMember(Name = "DefaultAddrPool", EmitDefaultValue = false)] + [JsonPropertyName("DefaultAddrPool")] public IList DefaultAddrPool { get; set; } - [DataMember(Name = "SubnetSize", EmitDefaultValue = false)] + [JsonPropertyName("SubnetSize")] public uint SubnetSize { get; set; } - [DataMember(Name = "DataPathPort", EmitDefaultValue = false)] + [JsonPropertyName("DataPathPort")] public uint DataPathPort { get; set; } } } diff --git a/src/Docker.DotNet/Models/ClusterOptions.Generated.cs b/src/Docker.DotNet/Models/ClusterOptions.Generated.cs index f26176aa9..01cfe710f 100644 --- a/src/Docker.DotNet/Models/ClusterOptions.Generated.cs +++ b/src/Docker.DotNet/Models/ClusterOptions.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ClusterOptions // (mount.ClusterOptions) { } diff --git a/src/Docker.DotNet/Models/ClusterVolume.Generated.cs b/src/Docker.DotNet/Models/ClusterVolume.Generated.cs index b4cb66138..bc4128383 100644 --- a/src/Docker.DotNet/Models/ClusterVolume.Generated.cs +++ b/src/Docker.DotNet/Models/ClusterVolume.Generated.cs @@ -1,10 +1,9 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ClusterVolume // (volume.ClusterVolume) { public ClusterVolume() @@ -21,25 +20,25 @@ public ClusterVolume(Meta Meta) } } - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public Version Version { get; set; } - [DataMember(Name = "CreatedAt", EmitDefaultValue = false)] + [JsonPropertyName("CreatedAt")] public DateTime CreatedAt { get; set; } - [DataMember(Name = "UpdatedAt", EmitDefaultValue = false)] + [JsonPropertyName("UpdatedAt")] public DateTime UpdatedAt { get; set; } - [DataMember(Name = "Spec", EmitDefaultValue = false)] + [JsonPropertyName("Spec")] public ClusterVolumeSpec Spec { get; set; } - [DataMember(Name = "PublishStatus", EmitDefaultValue = false)] + [JsonPropertyName("PublishStatus")] public IList PublishStatus { get; set; } - [DataMember(Name = "Info", EmitDefaultValue = false)] + [JsonPropertyName("Info")] public VolumeInfo Info { get; set; } } } diff --git a/src/Docker.DotNet/Models/ClusterVolumeSpec.Generated.cs b/src/Docker.DotNet/Models/ClusterVolumeSpec.Generated.cs index 38309c078..1ffbf287d 100644 --- a/src/Docker.DotNet/Models/ClusterVolumeSpec.Generated.cs +++ b/src/Docker.DotNet/Models/ClusterVolumeSpec.Generated.cs @@ -1,27 +1,26 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ClusterVolumeSpec // (volume.ClusterVolumeSpec) { - [DataMember(Name = "Group", EmitDefaultValue = false)] + [JsonPropertyName("Group")] public string Group { get; set; } - [DataMember(Name = "AccessMode", EmitDefaultValue = false)] + [JsonPropertyName("AccessMode")] public VolumeAccessMode AccessMode { get; set; } - [DataMember(Name = "AccessibilityRequirements", EmitDefaultValue = false)] + [JsonPropertyName("AccessibilityRequirements")] public TopologyRequirement AccessibilityRequirements { get; set; } - [DataMember(Name = "CapacityRange", EmitDefaultValue = false)] + [JsonPropertyName("CapacityRange")] public CapacityRange CapacityRange { get; set; } - [DataMember(Name = "Secrets", EmitDefaultValue = false)] + [JsonPropertyName("Secrets")] public IList Secrets { get; set; } - [DataMember(Name = "Availability", EmitDefaultValue = false)] + [JsonPropertyName("Availability")] public string Availability { get; set; } } } diff --git a/src/Docker.DotNet/Models/Commit.Generated.cs b/src/Docker.DotNet/Models/Commit.Generated.cs index b6132d835..487063477 100644 --- a/src/Docker.DotNet/Models/Commit.Generated.cs +++ b/src/Docker.DotNet/Models/Commit.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Commit // (system.Commit) { - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Expected", EmitDefaultValue = false)] + [JsonPropertyName("Expected")] public string Expected { get; set; } } } diff --git a/src/Docker.DotNet/Models/CommitContainerChangesParameters.Generated.cs b/src/Docker.DotNet/Models/CommitContainerChangesParameters.Generated.cs index 1e69df9fb..b861a4afe 100644 --- a/src/Docker.DotNet/Models/CommitContainerChangesParameters.Generated.cs +++ b/src/Docker.DotNet/Models/CommitContainerChangesParameters.Generated.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class CommitContainerChangesParameters // (main.CommitContainerChangesParameters) { public CommitContainerChangesParameters() @@ -65,80 +63,80 @@ public CommitContainerChangesParameters(Config Config) [QueryStringParameter("pause", false, typeof(BoolQueryStringConverter))] public bool? Pause { get; set; } - [DataMember(Name = "Hostname", EmitDefaultValue = false)] + [JsonPropertyName("Hostname")] public string Hostname { get; set; } - [DataMember(Name = "Domainname", EmitDefaultValue = false)] + [JsonPropertyName("Domainname")] public string Domainname { get; set; } - [DataMember(Name = "User", EmitDefaultValue = false)] + [JsonPropertyName("User")] public string User { get; set; } - [DataMember(Name = "AttachStdin", EmitDefaultValue = false)] + [JsonPropertyName("AttachStdin")] public bool AttachStdin { get; set; } - [DataMember(Name = "AttachStdout", EmitDefaultValue = false)] + [JsonPropertyName("AttachStdout")] public bool AttachStdout { get; set; } - [DataMember(Name = "AttachStderr", EmitDefaultValue = false)] + [JsonPropertyName("AttachStderr")] public bool AttachStderr { get; set; } - [DataMember(Name = "ExposedPorts", EmitDefaultValue = false)] + [JsonPropertyName("ExposedPorts")] public IDictionary ExposedPorts { get; set; } - [DataMember(Name = "Tty", EmitDefaultValue = false)] + [JsonPropertyName("Tty")] public bool Tty { get; set; } - [DataMember(Name = "OpenStdin", EmitDefaultValue = false)] + [JsonPropertyName("OpenStdin")] public bool OpenStdin { get; set; } - [DataMember(Name = "StdinOnce", EmitDefaultValue = false)] + [JsonPropertyName("StdinOnce")] public bool StdinOnce { get; set; } - [DataMember(Name = "Env", EmitDefaultValue = false)] + [JsonPropertyName("Env")] public IList Env { get; set; } - [DataMember(Name = "Cmd", EmitDefaultValue = false)] + [JsonPropertyName("Cmd")] public IList Cmd { get; set; } - [DataMember(Name = "Healthcheck", EmitDefaultValue = false)] + [JsonPropertyName("Healthcheck")] public HealthcheckConfig Healthcheck { get; set; } - [DataMember(Name = "ArgsEscaped", EmitDefaultValue = false)] + [JsonPropertyName("ArgsEscaped")] public bool ArgsEscaped { get; set; } - [DataMember(Name = "Image", EmitDefaultValue = false)] + [JsonPropertyName("Image")] public string Image { get; set; } - [DataMember(Name = "Volumes", EmitDefaultValue = false)] + [JsonPropertyName("Volumes")] public IDictionary Volumes { get; set; } - [DataMember(Name = "WorkingDir", EmitDefaultValue = false)] + [JsonPropertyName("WorkingDir")] public string WorkingDir { get; set; } - [DataMember(Name = "Entrypoint", EmitDefaultValue = false)] + [JsonPropertyName("Entrypoint")] public IList Entrypoint { get; set; } - [DataMember(Name = "NetworkDisabled", EmitDefaultValue = false)] + [JsonPropertyName("NetworkDisabled")] public bool NetworkDisabled { get; set; } - [DataMember(Name = "MacAddress", EmitDefaultValue = false)] + [JsonPropertyName("MacAddress")] public string MacAddress { get; set; } - [DataMember(Name = "OnBuild", EmitDefaultValue = false)] + [JsonPropertyName("OnBuild")] public IList OnBuild { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "StopSignal", EmitDefaultValue = false)] + [JsonPropertyName("StopSignal")] public string StopSignal { get; set; } - [DataMember(Name = "StopTimeout", EmitDefaultValue = false)] + [JsonPropertyName("StopTimeout")] [JsonConverter(typeof(TimeSpanSecondsConverter))] public TimeSpan? StopTimeout { get; set; } - [DataMember(Name = "Shell", EmitDefaultValue = false)] + [JsonPropertyName("Shell")] public IList Shell { get; set; } } } diff --git a/src/Docker.DotNet/Models/CommitContainerChangesResponse.Generated.cs b/src/Docker.DotNet/Models/CommitContainerChangesResponse.Generated.cs index fda334c06..6333322a9 100644 --- a/src/Docker.DotNet/Models/CommitContainerChangesResponse.Generated.cs +++ b/src/Docker.DotNet/Models/CommitContainerChangesResponse.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class CommitContainerChangesResponse // (main.CommitContainerChangesResponse) { - [DataMember(Name = "Id", EmitDefaultValue = false)] + [JsonPropertyName("Id")] public string ID { get; set; } } } diff --git a/src/Docker.DotNet/Models/ComponentVersion.Generated.cs b/src/Docker.DotNet/Models/ComponentVersion.Generated.cs index e04f766ab..3eb72fa37 100644 --- a/src/Docker.DotNet/Models/ComponentVersion.Generated.cs +++ b/src/Docker.DotNet/Models/ComponentVersion.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ComponentVersion // (types.ComponentVersion) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public string Version { get; set; } - [DataMember(Name = "Details", EmitDefaultValue = false)] + [JsonPropertyName("Details")] public IDictionary Details { get; set; } } } diff --git a/src/Docker.DotNet/Models/Config.Generated.cs b/src/Docker.DotNet/Models/Config.Generated.cs index 56645e0cb..601d6d107 100644 --- a/src/Docker.DotNet/Models/Config.Generated.cs +++ b/src/Docker.DotNet/Models/Config.Generated.cs @@ -1,87 +1,85 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Config // (container.Config) { - [DataMember(Name = "Hostname", EmitDefaultValue = false)] + [JsonPropertyName("Hostname")] public string Hostname { get; set; } - [DataMember(Name = "Domainname", EmitDefaultValue = false)] + [JsonPropertyName("Domainname")] public string Domainname { get; set; } - [DataMember(Name = "User", EmitDefaultValue = false)] + [JsonPropertyName("User")] public string User { get; set; } - [DataMember(Name = "AttachStdin", EmitDefaultValue = false)] + [JsonPropertyName("AttachStdin")] public bool AttachStdin { get; set; } - [DataMember(Name = "AttachStdout", EmitDefaultValue = false)] + [JsonPropertyName("AttachStdout")] public bool AttachStdout { get; set; } - [DataMember(Name = "AttachStderr", EmitDefaultValue = false)] + [JsonPropertyName("AttachStderr")] public bool AttachStderr { get; set; } - [DataMember(Name = "ExposedPorts", EmitDefaultValue = false)] + [JsonPropertyName("ExposedPorts")] public IDictionary ExposedPorts { get; set; } - [DataMember(Name = "Tty", EmitDefaultValue = false)] + [JsonPropertyName("Tty")] public bool Tty { get; set; } - [DataMember(Name = "OpenStdin", EmitDefaultValue = false)] + [JsonPropertyName("OpenStdin")] public bool OpenStdin { get; set; } - [DataMember(Name = "StdinOnce", EmitDefaultValue = false)] + [JsonPropertyName("StdinOnce")] public bool StdinOnce { get; set; } - [DataMember(Name = "Env", EmitDefaultValue = false)] + [JsonPropertyName("Env")] public IList Env { get; set; } - [DataMember(Name = "Cmd", EmitDefaultValue = false)] + [JsonPropertyName("Cmd")] public IList Cmd { get; set; } - [DataMember(Name = "Healthcheck", EmitDefaultValue = false)] + [JsonPropertyName("Healthcheck")] public HealthcheckConfig Healthcheck { get; set; } - [DataMember(Name = "ArgsEscaped", EmitDefaultValue = false)] + [JsonPropertyName("ArgsEscaped")] public bool ArgsEscaped { get; set; } - [DataMember(Name = "Image", EmitDefaultValue = false)] + [JsonPropertyName("Image")] public string Image { get; set; } - [DataMember(Name = "Volumes", EmitDefaultValue = false)] + [JsonPropertyName("Volumes")] public IDictionary Volumes { get; set; } - [DataMember(Name = "WorkingDir", EmitDefaultValue = false)] + [JsonPropertyName("WorkingDir")] public string WorkingDir { get; set; } - [DataMember(Name = "Entrypoint", EmitDefaultValue = false)] + [JsonPropertyName("Entrypoint")] public IList Entrypoint { get; set; } - [DataMember(Name = "NetworkDisabled", EmitDefaultValue = false)] + [JsonPropertyName("NetworkDisabled")] public bool NetworkDisabled { get; set; } - [DataMember(Name = "MacAddress", EmitDefaultValue = false)] + [JsonPropertyName("MacAddress")] public string MacAddress { get; set; } - [DataMember(Name = "OnBuild", EmitDefaultValue = false)] + [JsonPropertyName("OnBuild")] public IList OnBuild { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "StopSignal", EmitDefaultValue = false)] + [JsonPropertyName("StopSignal")] public string StopSignal { get; set; } - [DataMember(Name = "StopTimeout", EmitDefaultValue = false)] + [JsonPropertyName("StopTimeout")] [JsonConverter(typeof(TimeSpanSecondsConverter))] public TimeSpan? StopTimeout { get; set; } - [DataMember(Name = "Shell", EmitDefaultValue = false)] + [JsonPropertyName("Shell")] public IList Shell { get; set; } } } diff --git a/src/Docker.DotNet/Models/ConfigReference.Generated.cs b/src/Docker.DotNet/Models/ConfigReference.Generated.cs index 2e13cc8e0..0730bda8a 100644 --- a/src/Docker.DotNet/Models/ConfigReference.Generated.cs +++ b/src/Docker.DotNet/Models/ConfigReference.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ConfigReference // (network.ConfigReference) { - [DataMember(Name = "Network", EmitDefaultValue = false)] + [JsonPropertyName("Network")] public string Network { get; set; } } } diff --git a/src/Docker.DotNet/Models/ConfigReferenceFileTarget.Generated.cs b/src/Docker.DotNet/Models/ConfigReferenceFileTarget.Generated.cs index b5514f46d..0f43e3f2c 100644 --- a/src/Docker.DotNet/Models/ConfigReferenceFileTarget.Generated.cs +++ b/src/Docker.DotNet/Models/ConfigReferenceFileTarget.Generated.cs @@ -1,20 +1,19 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ConfigReferenceFileTarget // (swarm.ConfigReferenceFileTarget) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "UID", EmitDefaultValue = false)] + [JsonPropertyName("UID")] public string UID { get; set; } - [DataMember(Name = "GID", EmitDefaultValue = false)] + [JsonPropertyName("GID")] public string GID { get; set; } - [DataMember(Name = "Mode", EmitDefaultValue = false)] + [JsonPropertyName("Mode")] public uint Mode { get; set; } } } diff --git a/src/Docker.DotNet/Models/ConfigReferenceRuntimeTarget.Generated.cs b/src/Docker.DotNet/Models/ConfigReferenceRuntimeTarget.Generated.cs index 492966266..37876adf2 100644 --- a/src/Docker.DotNet/Models/ConfigReferenceRuntimeTarget.Generated.cs +++ b/src/Docker.DotNet/Models/ConfigReferenceRuntimeTarget.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ConfigReferenceRuntimeTarget // (swarm.ConfigReferenceRuntimeTarget) { } diff --git a/src/Docker.DotNet/Models/ContainerAttachParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerAttachParameters.Generated.cs index 0a2b58503..2d08ae7c0 100644 --- a/src/Docker.DotNet/Models/ContainerAttachParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerAttachParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerAttachParameters // (main.ContainerAttachParameters) { [QueryStringParameter("stream", false, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ContainerEventsParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerEventsParameters.Generated.cs index 275a78bfa..0261b7163 100644 --- a/src/Docker.DotNet/Models/ContainerEventsParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerEventsParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerEventsParameters // (main.ContainerEventsParameters) { [QueryStringParameter("since", false)] diff --git a/src/Docker.DotNet/Models/ContainerExecCreateParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerExecCreateParameters.Generated.cs index 215b5823a..f34bb1aa8 100644 --- a/src/Docker.DotNet/Models/ContainerExecCreateParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerExecCreateParameters.Generated.cs @@ -1,45 +1,44 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerExecCreateParameters // (main.ContainerExecCreateParameters) { - [DataMember(Name = "User", EmitDefaultValue = false)] + [JsonPropertyName("User")] public string User { get; set; } - [DataMember(Name = "Privileged", EmitDefaultValue = false)] + [JsonPropertyName("Privileged")] public bool Privileged { get; set; } - [DataMember(Name = "Tty", EmitDefaultValue = false)] + [JsonPropertyName("Tty")] public bool Tty { get; set; } - [DataMember(Name = "ConsoleSize", EmitDefaultValue = false)] + [JsonPropertyName("ConsoleSize")] public ulong[] ConsoleSize { get; set; } - [DataMember(Name = "AttachStdin", EmitDefaultValue = false)] + [JsonPropertyName("AttachStdin")] public bool AttachStdin { get; set; } - [DataMember(Name = "AttachStderr", EmitDefaultValue = false)] + [JsonPropertyName("AttachStderr")] public bool AttachStderr { get; set; } - [DataMember(Name = "AttachStdout", EmitDefaultValue = false)] + [JsonPropertyName("AttachStdout")] public bool AttachStdout { get; set; } - [DataMember(Name = "Detach", EmitDefaultValue = false)] + [JsonPropertyName("Detach")] public bool Detach { get; set; } - [DataMember(Name = "DetachKeys", EmitDefaultValue = false)] + [JsonPropertyName("DetachKeys")] public string DetachKeys { get; set; } - [DataMember(Name = "Env", EmitDefaultValue = false)] + [JsonPropertyName("Env")] public IList Env { get; set; } - [DataMember(Name = "WorkingDir", EmitDefaultValue = false)] + [JsonPropertyName("WorkingDir")] public string WorkingDir { get; set; } - [DataMember(Name = "Cmd", EmitDefaultValue = false)] + [JsonPropertyName("Cmd")] public IList Cmd { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerExecCreateResponse.Generated.cs b/src/Docker.DotNet/Models/ContainerExecCreateResponse.Generated.cs index 92fb2ef2d..9a06d0fc9 100644 --- a/src/Docker.DotNet/Models/ContainerExecCreateResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerExecCreateResponse.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerExecCreateResponse // (main.ContainerExecCreateResponse) { - [DataMember(Name = "Id", EmitDefaultValue = false)] + [JsonPropertyName("Id")] public string ID { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerExecInspectResponse.Generated.cs b/src/Docker.DotNet/Models/ContainerExecInspectResponse.Generated.cs index a94a5a3b1..35a3a5984 100644 --- a/src/Docker.DotNet/Models/ContainerExecInspectResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerExecInspectResponse.Generated.cs @@ -1,23 +1,22 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerExecInspectResponse // (container.ExecInspect) { - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ExecID { get; set; } - [DataMember(Name = "ContainerID", EmitDefaultValue = false)] + [JsonPropertyName("ContainerID")] public string ContainerID { get; set; } - [DataMember(Name = "Running", EmitDefaultValue = false)] + [JsonPropertyName("Running")] public bool Running { get; set; } - [DataMember(Name = "ExitCode", EmitDefaultValue = false)] + [JsonPropertyName("ExitCode")] public long ExitCode { get; set; } - [DataMember(Name = "Pid", EmitDefaultValue = false)] + [JsonPropertyName("Pid")] public long Pid { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerExecStartParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerExecStartParameters.Generated.cs index 93f030ac1..3e048a87e 100644 --- a/src/Docker.DotNet/Models/ContainerExecStartParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerExecStartParameters.Generated.cs @@ -1,45 +1,44 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerExecStartParameters // (main.ContainerExecStartParameters) { - [DataMember(Name = "User", EmitDefaultValue = false)] + [JsonPropertyName("User")] public string User { get; set; } - [DataMember(Name = "Privileged", EmitDefaultValue = false)] + [JsonPropertyName("Privileged")] public bool Privileged { get; set; } - [DataMember(Name = "Tty", EmitDefaultValue = false)] + [JsonPropertyName("Tty")] public bool Tty { get; set; } - [DataMember(Name = "ConsoleSize", EmitDefaultValue = false)] + [JsonPropertyName("ConsoleSize")] public ulong[] ConsoleSize { get; set; } - [DataMember(Name = "AttachStdin", EmitDefaultValue = false)] + [JsonPropertyName("AttachStdin")] public bool AttachStdin { get; set; } - [DataMember(Name = "AttachStderr", EmitDefaultValue = false)] + [JsonPropertyName("AttachStderr")] public bool AttachStderr { get; set; } - [DataMember(Name = "AttachStdout", EmitDefaultValue = false)] + [JsonPropertyName("AttachStdout")] public bool AttachStdout { get; set; } - [DataMember(Name = "Detach", EmitDefaultValue = false)] + [JsonPropertyName("Detach")] public bool Detach { get; set; } - [DataMember(Name = "DetachKeys", EmitDefaultValue = false)] + [JsonPropertyName("DetachKeys")] public string DetachKeys { get; set; } - [DataMember(Name = "Env", EmitDefaultValue = false)] + [JsonPropertyName("Env")] public IList Env { get; set; } - [DataMember(Name = "WorkingDir", EmitDefaultValue = false)] + [JsonPropertyName("WorkingDir")] public string WorkingDir { get; set; } - [DataMember(Name = "Cmd", EmitDefaultValue = false)] + [JsonPropertyName("Cmd")] public IList Cmd { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerFileSystemChangeResponse.Generated.cs b/src/Docker.DotNet/Models/ContainerFileSystemChangeResponse.Generated.cs index c51964822..f7f5496b5 100644 --- a/src/Docker.DotNet/Models/ContainerFileSystemChangeResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerFileSystemChangeResponse.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerFileSystemChangeResponse // (container.FilesystemChange) { - [DataMember(Name = "Kind", EmitDefaultValue = false)] + [JsonPropertyName("Kind")] public FileSystemChangeKind Kind { get; set; } - [DataMember(Name = "Path", EmitDefaultValue = false)] + [JsonPropertyName("Path")] public string Path { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerInspectParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerInspectParameters.Generated.cs index b2d7d372d..53892ee7d 100644 --- a/src/Docker.DotNet/Models/ContainerInspectParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerInspectParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerInspectParameters // (main.ContainerInspectParameters) { [QueryStringParameter("size", false, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ContainerInspectResponse.Generated.cs b/src/Docker.DotNet/Models/ContainerInspectResponse.Generated.cs index 73375c528..56734b827 100644 --- a/src/Docker.DotNet/Models/ContainerInspectResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerInspectResponse.Generated.cs @@ -1,10 +1,9 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerInspectResponse // (types.ContainerJSON) { public ContainerInspectResponse() @@ -41,82 +40,82 @@ public ContainerInspectResponse(ContainerJSONBase ContainerJSONBase) } } - [DataMember(Name = "Id", EmitDefaultValue = false)] + [JsonPropertyName("Id")] public string ID { get; set; } - [DataMember(Name = "Created", EmitDefaultValue = false)] + [JsonPropertyName("Created")] public DateTime Created { get; set; } - [DataMember(Name = "Path", EmitDefaultValue = false)] + [JsonPropertyName("Path")] public string Path { get; set; } - [DataMember(Name = "Args", EmitDefaultValue = false)] + [JsonPropertyName("Args")] public IList Args { get; set; } - [DataMember(Name = "State", EmitDefaultValue = false)] + [JsonPropertyName("State")] public ContainerState State { get; set; } - [DataMember(Name = "Image", EmitDefaultValue = false)] + [JsonPropertyName("Image")] public string Image { get; set; } - [DataMember(Name = "ResolvConfPath", EmitDefaultValue = false)] + [JsonPropertyName("ResolvConfPath")] public string ResolvConfPath { get; set; } - [DataMember(Name = "HostnamePath", EmitDefaultValue = false)] + [JsonPropertyName("HostnamePath")] public string HostnamePath { get; set; } - [DataMember(Name = "HostsPath", EmitDefaultValue = false)] + [JsonPropertyName("HostsPath")] public string HostsPath { get; set; } - [DataMember(Name = "LogPath", EmitDefaultValue = false)] + [JsonPropertyName("LogPath")] public string LogPath { get; set; } - [DataMember(Name = "Node", EmitDefaultValue = false)] + [JsonPropertyName("Node")] public ContainerNode Node { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "RestartCount", EmitDefaultValue = false)] + [JsonPropertyName("RestartCount")] public long RestartCount { get; set; } - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public string Driver { get; set; } - [DataMember(Name = "Platform", EmitDefaultValue = false)] + [JsonPropertyName("Platform")] public string Platform { get; set; } - [DataMember(Name = "MountLabel", EmitDefaultValue = false)] + [JsonPropertyName("MountLabel")] public string MountLabel { get; set; } - [DataMember(Name = "ProcessLabel", EmitDefaultValue = false)] + [JsonPropertyName("ProcessLabel")] public string ProcessLabel { get; set; } - [DataMember(Name = "AppArmorProfile", EmitDefaultValue = false)] + [JsonPropertyName("AppArmorProfile")] public string AppArmorProfile { get; set; } - [DataMember(Name = "ExecIDs", EmitDefaultValue = false)] + [JsonPropertyName("ExecIDs")] public IList ExecIDs { get; set; } - [DataMember(Name = "HostConfig", EmitDefaultValue = false)] + [JsonPropertyName("HostConfig")] public HostConfig HostConfig { get; set; } - [DataMember(Name = "GraphDriver", EmitDefaultValue = false)] + [JsonPropertyName("GraphDriver")] public GraphDriverData GraphDriver { get; set; } - [DataMember(Name = "SizeRw", EmitDefaultValue = false)] + [JsonPropertyName("SizeRw")] public long? SizeRw { get; set; } - [DataMember(Name = "SizeRootFs", EmitDefaultValue = false)] + [JsonPropertyName("SizeRootFs")] public long? SizeRootFs { get; set; } - [DataMember(Name = "Mounts", EmitDefaultValue = false)] + [JsonPropertyName("Mounts")] public IList Mounts { get; set; } - [DataMember(Name = "Config", EmitDefaultValue = false)] + [JsonPropertyName("Config")] public Config Config { get; set; } - [DataMember(Name = "NetworkSettings", EmitDefaultValue = false)] + [JsonPropertyName("NetworkSettings")] public NetworkSettings NetworkSettings { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerJSONBase.Generated.cs b/src/Docker.DotNet/Models/ContainerJSONBase.Generated.cs index 9eef0fbb3..798747db6 100644 --- a/src/Docker.DotNet/Models/ContainerJSONBase.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerJSONBase.Generated.cs @@ -1,79 +1,78 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerJSONBase // (types.ContainerJSONBase) { - [DataMember(Name = "Id", EmitDefaultValue = false)] + [JsonPropertyName("Id")] public string ID { get; set; } - [DataMember(Name = "Created", EmitDefaultValue = false)] + [JsonPropertyName("Created")] public DateTime Created { get; set; } - [DataMember(Name = "Path", EmitDefaultValue = false)] + [JsonPropertyName("Path")] public string Path { get; set; } - [DataMember(Name = "Args", EmitDefaultValue = false)] + [JsonPropertyName("Args")] public IList Args { get; set; } - [DataMember(Name = "State", EmitDefaultValue = false)] + [JsonPropertyName("State")] public ContainerState State { get; set; } - [DataMember(Name = "Image", EmitDefaultValue = false)] + [JsonPropertyName("Image")] public string Image { get; set; } - [DataMember(Name = "ResolvConfPath", EmitDefaultValue = false)] + [JsonPropertyName("ResolvConfPath")] public string ResolvConfPath { get; set; } - [DataMember(Name = "HostnamePath", EmitDefaultValue = false)] + [JsonPropertyName("HostnamePath")] public string HostnamePath { get; set; } - [DataMember(Name = "HostsPath", EmitDefaultValue = false)] + [JsonPropertyName("HostsPath")] public string HostsPath { get; set; } - [DataMember(Name = "LogPath", EmitDefaultValue = false)] + [JsonPropertyName("LogPath")] public string LogPath { get; set; } - [DataMember(Name = "Node", EmitDefaultValue = false)] + [JsonPropertyName("Node")] public ContainerNode Node { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "RestartCount", EmitDefaultValue = false)] + [JsonPropertyName("RestartCount")] public long RestartCount { get; set; } - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public string Driver { get; set; } - [DataMember(Name = "Platform", EmitDefaultValue = false)] + [JsonPropertyName("Platform")] public string Platform { get; set; } - [DataMember(Name = "MountLabel", EmitDefaultValue = false)] + [JsonPropertyName("MountLabel")] public string MountLabel { get; set; } - [DataMember(Name = "ProcessLabel", EmitDefaultValue = false)] + [JsonPropertyName("ProcessLabel")] public string ProcessLabel { get; set; } - [DataMember(Name = "AppArmorProfile", EmitDefaultValue = false)] + [JsonPropertyName("AppArmorProfile")] public string AppArmorProfile { get; set; } - [DataMember(Name = "ExecIDs", EmitDefaultValue = false)] + [JsonPropertyName("ExecIDs")] public IList ExecIDs { get; set; } - [DataMember(Name = "HostConfig", EmitDefaultValue = false)] + [JsonPropertyName("HostConfig")] public HostConfig HostConfig { get; set; } - [DataMember(Name = "GraphDriver", EmitDefaultValue = false)] + [JsonPropertyName("GraphDriver")] public GraphDriverData GraphDriver { get; set; } - [DataMember(Name = "SizeRw", EmitDefaultValue = false)] + [JsonPropertyName("SizeRw")] public long? SizeRw { get; set; } - [DataMember(Name = "SizeRootFs", EmitDefaultValue = false)] + [JsonPropertyName("SizeRootFs")] public long? SizeRootFs { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerKillParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerKillParameters.Generated.cs index ef697f563..8a411c2c6 100644 --- a/src/Docker.DotNet/Models/ContainerKillParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerKillParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerKillParameters // (main.ContainerKillParameters) { [QueryStringParameter("signal", false)] diff --git a/src/Docker.DotNet/Models/ContainerListProcessesParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerListProcessesParameters.Generated.cs index ed11dff2e..28a0a31b7 100644 --- a/src/Docker.DotNet/Models/ContainerListProcessesParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerListProcessesParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerListProcessesParameters // (main.ContainerListProcessesParameters) { [QueryStringParameter("ps_args", false)] diff --git a/src/Docker.DotNet/Models/ContainerListResponse.Generated.cs b/src/Docker.DotNet/Models/ContainerListResponse.Generated.cs index 0b308b847..e907e5178 100644 --- a/src/Docker.DotNet/Models/ContainerListResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerListResponse.Generated.cs @@ -1,52 +1,51 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerListResponse // (types.Container) { - [DataMember(Name = "Id", EmitDefaultValue = false)] + [JsonPropertyName("Id")] public string ID { get; set; } - [DataMember(Name = "Names", EmitDefaultValue = false)] + [JsonPropertyName("Names")] public IList Names { get; set; } - [DataMember(Name = "Image", EmitDefaultValue = false)] + [JsonPropertyName("Image")] public string Image { get; set; } - [DataMember(Name = "ImageID", EmitDefaultValue = false)] + [JsonPropertyName("ImageID")] public string ImageID { get; set; } - [DataMember(Name = "Command", EmitDefaultValue = false)] + [JsonPropertyName("Command")] public string Command { get; set; } - [DataMember(Name = "Created", EmitDefaultValue = false)] + [JsonPropertyName("Created")] public DateTime Created { get; set; } - [DataMember(Name = "Ports", EmitDefaultValue = false)] + [JsonPropertyName("Ports")] public IList Ports { get; set; } - [DataMember(Name = "SizeRw", EmitDefaultValue = false)] + [JsonPropertyName("SizeRw")] public long SizeRw { get; set; } - [DataMember(Name = "SizeRootFs", EmitDefaultValue = false)] + [JsonPropertyName("SizeRootFs")] public long SizeRootFs { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "State", EmitDefaultValue = false)] + [JsonPropertyName("State")] public string State { get; set; } - [DataMember(Name = "Status", EmitDefaultValue = false)] + [JsonPropertyName("Status")] public string Status { get; set; } - [DataMember(Name = "NetworkSettings", EmitDefaultValue = false)] + [JsonPropertyName("NetworkSettings")] public SummaryNetworkSettings NetworkSettings { get; set; } - [DataMember(Name = "Mounts", EmitDefaultValue = false)] + [JsonPropertyName("Mounts")] public IList Mounts { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerLogsParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerLogsParameters.Generated.cs index 38207b8ce..165358c45 100644 --- a/src/Docker.DotNet/Models/ContainerLogsParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerLogsParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerLogsParameters // (main.ContainerLogsParameters) { [QueryStringParameter("stdout", false, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ContainerNode.Generated.cs b/src/Docker.DotNet/Models/ContainerNode.Generated.cs index 6846bb20b..0b3c33c52 100644 --- a/src/Docker.DotNet/Models/ContainerNode.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerNode.Generated.cs @@ -1,30 +1,29 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerNode // (types.ContainerNode) { - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "IP", EmitDefaultValue = false)] + [JsonPropertyName("IP")] public string IPAddress { get; set; } - [DataMember(Name = "Addr", EmitDefaultValue = false)] + [JsonPropertyName("Addr")] public string Addr { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Cpus", EmitDefaultValue = false)] + [JsonPropertyName("Cpus")] public long Cpus { get; set; } - [DataMember(Name = "Memory", EmitDefaultValue = false)] + [JsonPropertyName("Memory")] public long Memory { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerPathStatParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerPathStatParameters.Generated.cs index c69838aad..a78057640 100644 --- a/src/Docker.DotNet/Models/ContainerPathStatParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerPathStatParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerPathStatParameters // (main.ContainerPathStatParameters) { [QueryStringParameter("path", true)] diff --git a/src/Docker.DotNet/Models/ContainerPathStatResponse.Generated.cs b/src/Docker.DotNet/Models/ContainerPathStatResponse.Generated.cs index 74900d9dc..154a002c9 100644 --- a/src/Docker.DotNet/Models/ContainerPathStatResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerPathStatResponse.Generated.cs @@ -1,24 +1,23 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerPathStatResponse // (container.PathStat) { - [DataMember(Name = "name", EmitDefaultValue = false)] + [JsonPropertyName("name")] public string Name { get; set; } - [DataMember(Name = "size", EmitDefaultValue = false)] + [JsonPropertyName("size")] public long Size { get; set; } - [DataMember(Name = "mode", EmitDefaultValue = false)] + [JsonPropertyName("mode")] public uint Mode { get; set; } - [DataMember(Name = "mtime", EmitDefaultValue = false)] + [JsonPropertyName("mtime")] public DateTime Mtime { get; set; } - [DataMember(Name = "linkTarget", EmitDefaultValue = false)] + [JsonPropertyName("linkTarget")] public string LinkTarget { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerProcessesResponse.Generated.cs b/src/Docker.DotNet/Models/ContainerProcessesResponse.Generated.cs index 18fcd6719..2d2667164 100644 --- a/src/Docker.DotNet/Models/ContainerProcessesResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerProcessesResponse.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerProcessesResponse // (container.ContainerTopOKBody) { - [DataMember(Name = "Processes", EmitDefaultValue = false)] + [JsonPropertyName("Processes")] public IList> Processes { get; set; } - [DataMember(Name = "Titles", EmitDefaultValue = false)] + [JsonPropertyName("Titles")] public IList Titles { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerRemoveParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerRemoveParameters.Generated.cs index d910f9ba2..a7e1b520f 100644 --- a/src/Docker.DotNet/Models/ContainerRemoveParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerRemoveParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerRemoveParameters // (main.ContainerRemoveParameters) { [QueryStringParameter("v", false, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ContainerRenameParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerRenameParameters.Generated.cs index 48e3456c8..af644d24a 100644 --- a/src/Docker.DotNet/Models/ContainerRenameParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerRenameParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerRenameParameters // (main.ContainerRenameParameters) { [QueryStringParameter("name", false)] diff --git a/src/Docker.DotNet/Models/ContainerResizeParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerResizeParameters.Generated.cs index adc5880b6..8453d6871 100644 --- a/src/Docker.DotNet/Models/ContainerResizeParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerResizeParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerResizeParameters // (main.ContainerResizeParameters) { [QueryStringParameter("h", false)] diff --git a/src/Docker.DotNet/Models/ContainerRestartParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerRestartParameters.Generated.cs index c19caedfb..443c6e299 100644 --- a/src/Docker.DotNet/Models/ContainerRestartParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerRestartParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerRestartParameters // (main.ContainerRestartParameters) { [QueryStringParameter("t", false)] diff --git a/src/Docker.DotNet/Models/ContainerSpec.Generated.cs b/src/Docker.DotNet/Models/ContainerSpec.Generated.cs index cc00601e8..32f286371 100644 --- a/src/Docker.DotNet/Models/ContainerSpec.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerSpec.Generated.cs @@ -1,93 +1,92 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerSpec // (swarm.ContainerSpec) { - [DataMember(Name = "Image", EmitDefaultValue = false)] + [JsonPropertyName("Image")] public string Image { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "Command", EmitDefaultValue = false)] + [JsonPropertyName("Command")] public IList Command { get; set; } - [DataMember(Name = "Args", EmitDefaultValue = false)] + [JsonPropertyName("Args")] public IList Args { get; set; } - [DataMember(Name = "Hostname", EmitDefaultValue = false)] + [JsonPropertyName("Hostname")] public string Hostname { get; set; } - [DataMember(Name = "Env", EmitDefaultValue = false)] + [JsonPropertyName("Env")] public IList Env { get; set; } - [DataMember(Name = "Dir", EmitDefaultValue = false)] + [JsonPropertyName("Dir")] public string Dir { get; set; } - [DataMember(Name = "User", EmitDefaultValue = false)] + [JsonPropertyName("User")] public string User { get; set; } - [DataMember(Name = "Groups", EmitDefaultValue = false)] + [JsonPropertyName("Groups")] public IList Groups { get; set; } - [DataMember(Name = "Privileges", EmitDefaultValue = false)] + [JsonPropertyName("Privileges")] public Privileges Privileges { get; set; } - [DataMember(Name = "Init", EmitDefaultValue = false)] + [JsonPropertyName("Init")] public bool? Init { get; set; } - [DataMember(Name = "StopSignal", EmitDefaultValue = false)] + [JsonPropertyName("StopSignal")] public string StopSignal { get; set; } - [DataMember(Name = "TTY", EmitDefaultValue = false)] + [JsonPropertyName("TTY")] public bool TTY { get; set; } - [DataMember(Name = "OpenStdin", EmitDefaultValue = false)] + [JsonPropertyName("OpenStdin")] public bool OpenStdin { get; set; } - [DataMember(Name = "ReadOnly", EmitDefaultValue = false)] + [JsonPropertyName("ReadOnly")] public bool ReadOnly { get; set; } - [DataMember(Name = "Mounts", EmitDefaultValue = false)] + [JsonPropertyName("Mounts")] public IList Mounts { get; set; } - [DataMember(Name = "StopGracePeriod", EmitDefaultValue = false)] + [JsonPropertyName("StopGracePeriod")] public long? StopGracePeriod { get; set; } - [DataMember(Name = "Healthcheck", EmitDefaultValue = false)] + [JsonPropertyName("Healthcheck")] public HealthcheckConfig Healthcheck { get; set; } - [DataMember(Name = "Hosts", EmitDefaultValue = false)] + [JsonPropertyName("Hosts")] public IList Hosts { get; set; } - [DataMember(Name = "DNSConfig", EmitDefaultValue = false)] + [JsonPropertyName("DNSConfig")] public DNSConfig DNSConfig { get; set; } - [DataMember(Name = "Secrets", EmitDefaultValue = false)] + [JsonPropertyName("Secrets")] public IList Secrets { get; set; } - [DataMember(Name = "Configs", EmitDefaultValue = false)] + [JsonPropertyName("Configs")] public IList Configs { get; set; } - [DataMember(Name = "Isolation", EmitDefaultValue = false)] + [JsonPropertyName("Isolation")] public string Isolation { get; set; } - [DataMember(Name = "Sysctls", EmitDefaultValue = false)] + [JsonPropertyName("Sysctls")] public IDictionary Sysctls { get; set; } - [DataMember(Name = "CapabilityAdd", EmitDefaultValue = false)] + [JsonPropertyName("CapabilityAdd")] public IList CapabilityAdd { get; set; } - [DataMember(Name = "CapabilityDrop", EmitDefaultValue = false)] + [JsonPropertyName("CapabilityDrop")] public IList CapabilityDrop { get; set; } - [DataMember(Name = "Ulimits", EmitDefaultValue = false)] + [JsonPropertyName("Ulimits")] public IList Ulimits { get; set; } - [DataMember(Name = "OomScoreAdj", EmitDefaultValue = false)] + [JsonPropertyName("OomScoreAdj")] public long OomScoreAdj { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerStartParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerStartParameters.Generated.cs index d9303d31c..7cd3f8ff2 100644 --- a/src/Docker.DotNet/Models/ContainerStartParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerStartParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerStartParameters // (main.ContainerStartParameters) { [QueryStringParameter("detachKeys", false)] diff --git a/src/Docker.DotNet/Models/ContainerState.Generated.cs b/src/Docker.DotNet/Models/ContainerState.Generated.cs index 2b15c5538..2a848b58b 100644 --- a/src/Docker.DotNet/Models/ContainerState.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerState.Generated.cs @@ -1,44 +1,43 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerState // (types.ContainerState) { - [DataMember(Name = "Status", EmitDefaultValue = false)] + [JsonPropertyName("Status")] public string Status { get; set; } - [DataMember(Name = "Running", EmitDefaultValue = false)] + [JsonPropertyName("Running")] public bool Running { get; set; } - [DataMember(Name = "Paused", EmitDefaultValue = false)] + [JsonPropertyName("Paused")] public bool Paused { get; set; } - [DataMember(Name = "Restarting", EmitDefaultValue = false)] + [JsonPropertyName("Restarting")] public bool Restarting { get; set; } - [DataMember(Name = "OOMKilled", EmitDefaultValue = false)] + [JsonPropertyName("OOMKilled")] public bool OOMKilled { get; set; } - [DataMember(Name = "Dead", EmitDefaultValue = false)] + [JsonPropertyName("Dead")] public bool Dead { get; set; } - [DataMember(Name = "Pid", EmitDefaultValue = false)] + [JsonPropertyName("Pid")] public long Pid { get; set; } - [DataMember(Name = "ExitCode", EmitDefaultValue = false)] + [JsonPropertyName("ExitCode")] public long ExitCode { get; set; } - [DataMember(Name = "Error", EmitDefaultValue = false)] + [JsonPropertyName("Error")] public string Error { get; set; } - [DataMember(Name = "StartedAt", EmitDefaultValue = false)] + [JsonPropertyName("StartedAt")] public string StartedAt { get; set; } - [DataMember(Name = "FinishedAt", EmitDefaultValue = false)] + [JsonPropertyName("FinishedAt")] public string FinishedAt { get; set; } - [DataMember(Name = "Health", EmitDefaultValue = false)] + [JsonPropertyName("Health")] public Health Health { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerStatsParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerStatsParameters.Generated.cs index f5a9ca9b8..a3fc9d735 100644 --- a/src/Docker.DotNet/Models/ContainerStatsParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerStatsParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerStatsParameters // (main.ContainerStatsParameters) { [QueryStringParameter("stream", true, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ContainerStatsResponse.Generated.cs b/src/Docker.DotNet/Models/ContainerStatsResponse.Generated.cs index 8d479e981..81bbcdca2 100644 --- a/src/Docker.DotNet/Models/ContainerStatsResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerStatsResponse.Generated.cs @@ -1,10 +1,9 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerStatsResponse // (container.StatsResponse) { public ContainerStatsResponse() @@ -27,40 +26,40 @@ public ContainerStatsResponse(Stats Stats) } } - [DataMember(Name = "read", EmitDefaultValue = false)] + [JsonPropertyName("read")] public DateTime Read { get; set; } - [DataMember(Name = "preread", EmitDefaultValue = false)] + [JsonPropertyName("preread")] public DateTime PreRead { get; set; } - [DataMember(Name = "pids_stats", EmitDefaultValue = false)] + [JsonPropertyName("pids_stats")] public PidsStats PidsStats { get; set; } - [DataMember(Name = "blkio_stats", EmitDefaultValue = false)] + [JsonPropertyName("blkio_stats")] public BlkioStats BlkioStats { get; set; } - [DataMember(Name = "num_procs", EmitDefaultValue = false)] + [JsonPropertyName("num_procs")] public uint NumProcs { get; set; } - [DataMember(Name = "storage_stats", EmitDefaultValue = false)] + [JsonPropertyName("storage_stats")] public StorageStats StorageStats { get; set; } - [DataMember(Name = "cpu_stats", EmitDefaultValue = false)] + [JsonPropertyName("cpu_stats")] public CPUStats CPUStats { get; set; } - [DataMember(Name = "precpu_stats", EmitDefaultValue = false)] + [JsonPropertyName("precpu_stats")] public CPUStats PreCPUStats { get; set; } - [DataMember(Name = "memory_stats", EmitDefaultValue = false)] + [JsonPropertyName("memory_stats")] public MemoryStats MemoryStats { get; set; } - [DataMember(Name = "name", EmitDefaultValue = false)] + [JsonPropertyName("name")] public string Name { get; set; } - [DataMember(Name = "id", EmitDefaultValue = false)] + [JsonPropertyName("id")] public string ID { get; set; } - [DataMember(Name = "networks", EmitDefaultValue = false)] + [JsonPropertyName("networks")] public IDictionary Networks { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerStatus.Generated.cs b/src/Docker.DotNet/Models/ContainerStatus.Generated.cs index fe3ac7f72..f7c8a8081 100644 --- a/src/Docker.DotNet/Models/ContainerStatus.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerStatus.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerStatus // (swarm.ContainerStatus) { - [DataMember(Name = "ContainerID", EmitDefaultValue = false)] + [JsonPropertyName("ContainerID")] public string ContainerID { get; set; } - [DataMember(Name = "PID", EmitDefaultValue = false)] + [JsonPropertyName("PID")] public long PID { get; set; } - [DataMember(Name = "ExitCode", EmitDefaultValue = false)] + [JsonPropertyName("ExitCode")] public long ExitCode { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerStopParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerStopParameters.Generated.cs index e6d1d1f23..bdfca3393 100644 --- a/src/Docker.DotNet/Models/ContainerStopParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerStopParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerStopParameters // (main.ContainerStopParameters) { [QueryStringParameter("t", false)] diff --git a/src/Docker.DotNet/Models/ContainerUpdateParameters.Generated.cs b/src/Docker.DotNet/Models/ContainerUpdateParameters.Generated.cs index 428886fd4..8ba059e6d 100644 --- a/src/Docker.DotNet/Models/ContainerUpdateParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerUpdateParameters.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerUpdateParameters // (main.ContainerUpdateParameters) { public ContainerUpdateParameters() @@ -49,100 +48,100 @@ public ContainerUpdateParameters(UpdateConfig UpdateConfig) } } - [DataMember(Name = "CpuShares", EmitDefaultValue = false)] + [JsonPropertyName("CpuShares")] public long CPUShares { get; set; } - [DataMember(Name = "Memory", EmitDefaultValue = false)] + [JsonPropertyName("Memory")] public long Memory { get; set; } - [DataMember(Name = "NanoCpus", EmitDefaultValue = false)] + [JsonPropertyName("NanoCpus")] public long NanoCPUs { get; set; } - [DataMember(Name = "CgroupParent", EmitDefaultValue = false)] + [JsonPropertyName("CgroupParent")] public string CgroupParent { get; set; } - [DataMember(Name = "BlkioWeight", EmitDefaultValue = false)] + [JsonPropertyName("BlkioWeight")] public ushort BlkioWeight { get; set; } - [DataMember(Name = "BlkioWeightDevice", EmitDefaultValue = false)] + [JsonPropertyName("BlkioWeightDevice")] public IList BlkioWeightDevice { get; set; } - [DataMember(Name = "BlkioDeviceReadBps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceReadBps")] public IList BlkioDeviceReadBps { get; set; } - [DataMember(Name = "BlkioDeviceWriteBps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceWriteBps")] public IList BlkioDeviceWriteBps { get; set; } - [DataMember(Name = "BlkioDeviceReadIOps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceReadIOps")] public IList BlkioDeviceReadIOps { get; set; } - [DataMember(Name = "BlkioDeviceWriteIOps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceWriteIOps")] public IList BlkioDeviceWriteIOps { get; set; } - [DataMember(Name = "CpuPeriod", EmitDefaultValue = false)] + [JsonPropertyName("CpuPeriod")] public long CPUPeriod { get; set; } - [DataMember(Name = "CpuQuota", EmitDefaultValue = false)] + [JsonPropertyName("CpuQuota")] public long CPUQuota { get; set; } - [DataMember(Name = "CpuRealtimePeriod", EmitDefaultValue = false)] + [JsonPropertyName("CpuRealtimePeriod")] public long CPURealtimePeriod { get; set; } - [DataMember(Name = "CpuRealtimeRuntime", EmitDefaultValue = false)] + [JsonPropertyName("CpuRealtimeRuntime")] public long CPURealtimeRuntime { get; set; } - [DataMember(Name = "CpusetCpus", EmitDefaultValue = false)] + [JsonPropertyName("CpusetCpus")] public string CpusetCpus { get; set; } - [DataMember(Name = "CpusetMems", EmitDefaultValue = false)] + [JsonPropertyName("CpusetMems")] public string CpusetMems { get; set; } - [DataMember(Name = "Devices", EmitDefaultValue = false)] + [JsonPropertyName("Devices")] public IList Devices { get; set; } - [DataMember(Name = "DeviceCgroupRules", EmitDefaultValue = false)] + [JsonPropertyName("DeviceCgroupRules")] public IList DeviceCgroupRules { get; set; } - [DataMember(Name = "DeviceRequests", EmitDefaultValue = false)] + [JsonPropertyName("DeviceRequests")] public IList DeviceRequests { get; set; } - [DataMember(Name = "KernelMemory", EmitDefaultValue = false)] + [JsonPropertyName("KernelMemory")] public long KernelMemory { get; set; } - [DataMember(Name = "KernelMemoryTCP", EmitDefaultValue = false)] + [JsonPropertyName("KernelMemoryTCP")] public long KernelMemoryTCP { get; set; } - [DataMember(Name = "MemoryReservation", EmitDefaultValue = false)] + [JsonPropertyName("MemoryReservation")] public long MemoryReservation { get; set; } - [DataMember(Name = "MemorySwap", EmitDefaultValue = false)] + [JsonPropertyName("MemorySwap")] public long MemorySwap { get; set; } - [DataMember(Name = "MemorySwappiness", EmitDefaultValue = false)] + [JsonPropertyName("MemorySwappiness")] public long? MemorySwappiness { get; set; } - [DataMember(Name = "OomKillDisable", EmitDefaultValue = false)] + [JsonPropertyName("OomKillDisable")] public bool? OomKillDisable { get; set; } - [DataMember(Name = "PidsLimit", EmitDefaultValue = false)] + [JsonPropertyName("PidsLimit")] public long? PidsLimit { get; set; } - [DataMember(Name = "Ulimits", EmitDefaultValue = false)] + [JsonPropertyName("Ulimits")] public IList Ulimits { get; set; } - [DataMember(Name = "CpuCount", EmitDefaultValue = false)] + [JsonPropertyName("CpuCount")] public long CPUCount { get; set; } - [DataMember(Name = "CpuPercent", EmitDefaultValue = false)] + [JsonPropertyName("CpuPercent")] public long CPUPercent { get; set; } - [DataMember(Name = "IOMaximumIOps", EmitDefaultValue = false)] + [JsonPropertyName("IOMaximumIOps")] public ulong IOMaximumIOps { get; set; } - [DataMember(Name = "IOMaximumBandwidth", EmitDefaultValue = false)] + [JsonPropertyName("IOMaximumBandwidth")] public ulong IOMaximumBandwidth { get; set; } - [DataMember(Name = "RestartPolicy", EmitDefaultValue = false)] + [JsonPropertyName("RestartPolicy")] public RestartPolicy RestartPolicy { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerUpdateResponse.Generated.cs b/src/Docker.DotNet/Models/ContainerUpdateResponse.Generated.cs index fe7a4371d..0ae6182bb 100644 --- a/src/Docker.DotNet/Models/ContainerUpdateResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerUpdateResponse.Generated.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerUpdateResponse // (main.ContainerUpdateResponse) { - [DataMember(Name = "Warnings", EmitDefaultValue = false)] + [JsonPropertyName("Warnings")] public IList Warnings { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerWaitResponse.Generated.cs b/src/Docker.DotNet/Models/ContainerWaitResponse.Generated.cs index 6f786eec0..465227ffb 100644 --- a/src/Docker.DotNet/Models/ContainerWaitResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerWaitResponse.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerWaitResponse // (main.ContainerWaitResponse) { - [DataMember(Name = "Error", EmitDefaultValue = false)] + [JsonPropertyName("Error")] public WaitExitError Error { get; set; } - [DataMember(Name = "StatusCode", EmitDefaultValue = false)] + [JsonPropertyName("StatusCode")] public long StatusCode { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerdInfo.Generated.cs b/src/Docker.DotNet/Models/ContainerdInfo.Generated.cs index 77a9ccad7..f0492e1a1 100644 --- a/src/Docker.DotNet/Models/ContainerdInfo.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerdInfo.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerdInfo // (system.ContainerdInfo) { - [DataMember(Name = "Address", EmitDefaultValue = false)] + [JsonPropertyName("Address")] public string Address { get; set; } - [DataMember(Name = "Namespaces", EmitDefaultValue = false)] + [JsonPropertyName("Namespaces")] public ContainerdNamespaces Namespaces { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainerdNamespaces.Generated.cs b/src/Docker.DotNet/Models/ContainerdNamespaces.Generated.cs index 720e37b3b..d474e8cd4 100644 --- a/src/Docker.DotNet/Models/ContainerdNamespaces.Generated.cs +++ b/src/Docker.DotNet/Models/ContainerdNamespaces.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainerdNamespaces // (system.ContainerdNamespaces) { - [DataMember(Name = "Containers", EmitDefaultValue = false)] + [JsonPropertyName("Containers")] public string Containers { get; set; } - [DataMember(Name = "Plugins", EmitDefaultValue = false)] + [JsonPropertyName("Plugins")] public string Plugins { get; set; } } } diff --git a/src/Docker.DotNet/Models/ContainersListParameters.Generated.cs b/src/Docker.DotNet/Models/ContainersListParameters.Generated.cs index 217a578f2..303906fae 100644 --- a/src/Docker.DotNet/Models/ContainersListParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainersListParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainersListParameters // (main.ContainersListParameters) { [QueryStringParameter("all", false, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ContainersPruneParameters.Generated.cs b/src/Docker.DotNet/Models/ContainersPruneParameters.Generated.cs index 9efa48cf7..f0a1ed7e3 100644 --- a/src/Docker.DotNet/Models/ContainersPruneParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ContainersPruneParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainersPruneParameters // (main.ContainersPruneParameters) { [QueryStringParameter("filters", false, typeof(MapQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ContainersPruneResponse.Generated.cs b/src/Docker.DotNet/Models/ContainersPruneResponse.Generated.cs index c26484ddc..dc8c40e3c 100644 --- a/src/Docker.DotNet/Models/ContainersPruneResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ContainersPruneResponse.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ContainersPruneResponse // (container.PruneReport) { - [DataMember(Name = "ContainersDeleted", EmitDefaultValue = false)] + [JsonPropertyName("ContainersDeleted")] public IList ContainersDeleted { get; set; } - [DataMember(Name = "SpaceReclaimed", EmitDefaultValue = false)] + [JsonPropertyName("SpaceReclaimed")] public ulong SpaceReclaimed { get; set; } } } diff --git a/src/Docker.DotNet/Models/CreateContainerParameters.Generated.cs b/src/Docker.DotNet/Models/CreateContainerParameters.Generated.cs index c629ed19c..9f0dca44b 100644 --- a/src/Docker.DotNet/Models/CreateContainerParameters.Generated.cs +++ b/src/Docker.DotNet/Models/CreateContainerParameters.Generated.cs @@ -1,11 +1,9 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class CreateContainerParameters // (main.CreateContainerParameters) { public CreateContainerParameters() @@ -50,86 +48,86 @@ public CreateContainerParameters(Config Config) [QueryStringParameter("platform", false)] public string Platform { get; set; } - [DataMember(Name = "Hostname", EmitDefaultValue = false)] + [JsonPropertyName("Hostname")] public string Hostname { get; set; } - [DataMember(Name = "Domainname", EmitDefaultValue = false)] + [JsonPropertyName("Domainname")] public string Domainname { get; set; } - [DataMember(Name = "User", EmitDefaultValue = false)] + [JsonPropertyName("User")] public string User { get; set; } - [DataMember(Name = "AttachStdin", EmitDefaultValue = false)] + [JsonPropertyName("AttachStdin")] public bool AttachStdin { get; set; } - [DataMember(Name = "AttachStdout", EmitDefaultValue = false)] + [JsonPropertyName("AttachStdout")] public bool AttachStdout { get; set; } - [DataMember(Name = "AttachStderr", EmitDefaultValue = false)] + [JsonPropertyName("AttachStderr")] public bool AttachStderr { get; set; } - [DataMember(Name = "ExposedPorts", EmitDefaultValue = false)] + [JsonPropertyName("ExposedPorts")] public IDictionary ExposedPorts { get; set; } - [DataMember(Name = "Tty", EmitDefaultValue = false)] + [JsonPropertyName("Tty")] public bool Tty { get; set; } - [DataMember(Name = "OpenStdin", EmitDefaultValue = false)] + [JsonPropertyName("OpenStdin")] public bool OpenStdin { get; set; } - [DataMember(Name = "StdinOnce", EmitDefaultValue = false)] + [JsonPropertyName("StdinOnce")] public bool StdinOnce { get; set; } - [DataMember(Name = "Env", EmitDefaultValue = false)] + [JsonPropertyName("Env")] public IList Env { get; set; } - [DataMember(Name = "Cmd", EmitDefaultValue = false)] + [JsonPropertyName("Cmd")] public IList Cmd { get; set; } - [DataMember(Name = "Healthcheck", EmitDefaultValue = false)] + [JsonPropertyName("Healthcheck")] public HealthcheckConfig Healthcheck { get; set; } - [DataMember(Name = "ArgsEscaped", EmitDefaultValue = false)] + [JsonPropertyName("ArgsEscaped")] public bool ArgsEscaped { get; set; } - [DataMember(Name = "Image", EmitDefaultValue = false)] + [JsonPropertyName("Image")] public string Image { get; set; } - [DataMember(Name = "Volumes", EmitDefaultValue = false)] + [JsonPropertyName("Volumes")] public IDictionary Volumes { get; set; } - [DataMember(Name = "WorkingDir", EmitDefaultValue = false)] + [JsonPropertyName("WorkingDir")] public string WorkingDir { get; set; } - [DataMember(Name = "Entrypoint", EmitDefaultValue = false)] + [JsonPropertyName("Entrypoint")] public IList Entrypoint { get; set; } - [DataMember(Name = "NetworkDisabled", EmitDefaultValue = false)] + [JsonPropertyName("NetworkDisabled")] public bool NetworkDisabled { get; set; } - [DataMember(Name = "MacAddress", EmitDefaultValue = false)] + [JsonPropertyName("MacAddress")] public string MacAddress { get; set; } - [DataMember(Name = "OnBuild", EmitDefaultValue = false)] + [JsonPropertyName("OnBuild")] public IList OnBuild { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "StopSignal", EmitDefaultValue = false)] + [JsonPropertyName("StopSignal")] public string StopSignal { get; set; } - [DataMember(Name = "StopTimeout", EmitDefaultValue = false)] + [JsonPropertyName("StopTimeout")] [JsonConverter(typeof(TimeSpanSecondsConverter))] public TimeSpan? StopTimeout { get; set; } - [DataMember(Name = "Shell", EmitDefaultValue = false)] + [JsonPropertyName("Shell")] public IList Shell { get; set; } - [DataMember(Name = "HostConfig", EmitDefaultValue = false)] + [JsonPropertyName("HostConfig")] public HostConfig HostConfig { get; set; } - [DataMember(Name = "NetworkingConfig", EmitDefaultValue = false)] + [JsonPropertyName("NetworkingConfig")] public NetworkingConfig NetworkingConfig { get; set; } } } diff --git a/src/Docker.DotNet/Models/CreateContainerResponse.Generated.cs b/src/Docker.DotNet/Models/CreateContainerResponse.Generated.cs index eef2cd750..71caf2ad8 100644 --- a/src/Docker.DotNet/Models/CreateContainerResponse.Generated.cs +++ b/src/Docker.DotNet/Models/CreateContainerResponse.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class CreateContainerResponse // (container.CreateResponse) { - [DataMember(Name = "Id", EmitDefaultValue = false)] + [JsonPropertyName("Id")] public string ID { get; set; } - [DataMember(Name = "Warnings", EmitDefaultValue = false)] + [JsonPropertyName("Warnings")] public IList Warnings { get; set; } } } diff --git a/src/Docker.DotNet/Models/CreateOptions.Generated.cs b/src/Docker.DotNet/Models/CreateOptions.Generated.cs index 0bf1d1697..e36674992 100644 --- a/src/Docker.DotNet/Models/CreateOptions.Generated.cs +++ b/src/Docker.DotNet/Models/CreateOptions.Generated.cs @@ -1,42 +1,41 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class CreateOptions // (network.CreateOptions) { - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public string Driver { get; set; } - [DataMember(Name = "Scope", EmitDefaultValue = false)] + [JsonPropertyName("Scope")] public string Scope { get; set; } - [DataMember(Name = "EnableIPv6", EmitDefaultValue = false)] + [JsonPropertyName("EnableIPv6")] public bool? EnableIPv6 { get; set; } - [DataMember(Name = "IPAM", EmitDefaultValue = false)] + [JsonPropertyName("IPAM")] public IPAM IPAM { get; set; } - [DataMember(Name = "Internal", EmitDefaultValue = false)] + [JsonPropertyName("Internal")] public bool Internal { get; set; } - [DataMember(Name = "Attachable", EmitDefaultValue = false)] + [JsonPropertyName("Attachable")] public bool Attachable { get; set; } - [DataMember(Name = "Ingress", EmitDefaultValue = false)] + [JsonPropertyName("Ingress")] public bool Ingress { get; set; } - [DataMember(Name = "ConfigOnly", EmitDefaultValue = false)] + [JsonPropertyName("ConfigOnly")] public bool ConfigOnly { get; set; } - [DataMember(Name = "ConfigFrom", EmitDefaultValue = false)] + [JsonPropertyName("ConfigFrom")] public ConfigReference ConfigFrom { get; set; } - [DataMember(Name = "Options", EmitDefaultValue = false)] + [JsonPropertyName("Options")] public IDictionary Options { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } } } diff --git a/src/Docker.DotNet/Models/CredentialSpec.Generated.cs b/src/Docker.DotNet/Models/CredentialSpec.Generated.cs index ef35fbfdf..550feceb2 100644 --- a/src/Docker.DotNet/Models/CredentialSpec.Generated.cs +++ b/src/Docker.DotNet/Models/CredentialSpec.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class CredentialSpec // (swarm.CredentialSpec) { - [DataMember(Name = "Config", EmitDefaultValue = false)] + [JsonPropertyName("Config")] public string Config { get; set; } - [DataMember(Name = "File", EmitDefaultValue = false)] + [JsonPropertyName("File")] public string File { get; set; } - [DataMember(Name = "Registry", EmitDefaultValue = false)] + [JsonPropertyName("Registry")] public string Registry { get; set; } } } diff --git a/src/Docker.DotNet/Models/DNSConfig.Generated.cs b/src/Docker.DotNet/Models/DNSConfig.Generated.cs index 4b977e41d..e52167a62 100644 --- a/src/Docker.DotNet/Models/DNSConfig.Generated.cs +++ b/src/Docker.DotNet/Models/DNSConfig.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class DNSConfig // (swarm.DNSConfig) { - [DataMember(Name = "Nameservers", EmitDefaultValue = false)] + [JsonPropertyName("Nameservers")] public IList Nameservers { get; set; } - [DataMember(Name = "Search", EmitDefaultValue = false)] + [JsonPropertyName("Search")] public IList Search { get; set; } - [DataMember(Name = "Options", EmitDefaultValue = false)] + [JsonPropertyName("Options")] public IList Options { get; set; } } } diff --git a/src/Docker.DotNet/Models/DefaultNetworkSettings.Generated.cs b/src/Docker.DotNet/Models/DefaultNetworkSettings.Generated.cs index 88ee811e5..92e78172b 100644 --- a/src/Docker.DotNet/Models/DefaultNetworkSettings.Generated.cs +++ b/src/Docker.DotNet/Models/DefaultNetworkSettings.Generated.cs @@ -1,32 +1,31 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class DefaultNetworkSettings // (types.DefaultNetworkSettings) { - [DataMember(Name = "EndpointID", EmitDefaultValue = false)] + [JsonPropertyName("EndpointID")] public string EndpointID { get; set; } - [DataMember(Name = "Gateway", EmitDefaultValue = false)] + [JsonPropertyName("Gateway")] public string Gateway { get; set; } - [DataMember(Name = "GlobalIPv6Address", EmitDefaultValue = false)] + [JsonPropertyName("GlobalIPv6Address")] public string GlobalIPv6Address { get; set; } - [DataMember(Name = "GlobalIPv6PrefixLen", EmitDefaultValue = false)] + [JsonPropertyName("GlobalIPv6PrefixLen")] public long GlobalIPv6PrefixLen { get; set; } - [DataMember(Name = "IPAddress", EmitDefaultValue = false)] + [JsonPropertyName("IPAddress")] public string IPAddress { get; set; } - [DataMember(Name = "IPPrefixLen", EmitDefaultValue = false)] + [JsonPropertyName("IPPrefixLen")] public long IPPrefixLen { get; set; } - [DataMember(Name = "IPv6Gateway", EmitDefaultValue = false)] + [JsonPropertyName("IPv6Gateway")] public string IPv6Gateway { get; set; } - [DataMember(Name = "MacAddress", EmitDefaultValue = false)] + [JsonPropertyName("MacAddress")] public string MacAddress { get; set; } } } diff --git a/src/Docker.DotNet/Models/Descriptor.Generated.cs b/src/Docker.DotNet/Models/Descriptor.Generated.cs index 07641f7be..9483dabb3 100644 --- a/src/Docker.DotNet/Models/Descriptor.Generated.cs +++ b/src/Docker.DotNet/Models/Descriptor.Generated.cs @@ -1,27 +1,26 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Descriptor // (v1.Descriptor) { - [DataMember(Name = "mediaType", EmitDefaultValue = false)] + [JsonPropertyName("mediaType")] public string MediaType { get; set; } - [DataMember(Name = "digest", EmitDefaultValue = false)] + [JsonPropertyName("digest")] public string Digest { get; set; } - [DataMember(Name = "size", EmitDefaultValue = false)] + [JsonPropertyName("size")] public long Size { get; set; } - [DataMember(Name = "urls", EmitDefaultValue = false)] + [JsonPropertyName("urls")] public IList URLs { get; set; } - [DataMember(Name = "annotations", EmitDefaultValue = false)] + [JsonPropertyName("annotations")] public IDictionary Annotations { get; set; } - [DataMember(Name = "platform", EmitDefaultValue = false)] + [JsonPropertyName("platform")] public Platform Platform { get; set; } } } diff --git a/src/Docker.DotNet/Models/DeviceMapping.Generated.cs b/src/Docker.DotNet/Models/DeviceMapping.Generated.cs index e199dd75c..73c8ea52f 100644 --- a/src/Docker.DotNet/Models/DeviceMapping.Generated.cs +++ b/src/Docker.DotNet/Models/DeviceMapping.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class DeviceMapping // (container.DeviceMapping) { - [DataMember(Name = "PathOnHost", EmitDefaultValue = false)] + [JsonPropertyName("PathOnHost")] public string PathOnHost { get; set; } - [DataMember(Name = "PathInContainer", EmitDefaultValue = false)] + [JsonPropertyName("PathInContainer")] public string PathInContainer { get; set; } - [DataMember(Name = "CgroupPermissions", EmitDefaultValue = false)] + [JsonPropertyName("CgroupPermissions")] public string CgroupPermissions { get; set; } } } diff --git a/src/Docker.DotNet/Models/DeviceRequest.Generated.cs b/src/Docker.DotNet/Models/DeviceRequest.Generated.cs index 2e6c136f0..c6e0c8a90 100644 --- a/src/Docker.DotNet/Models/DeviceRequest.Generated.cs +++ b/src/Docker.DotNet/Models/DeviceRequest.Generated.cs @@ -1,24 +1,23 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class DeviceRequest // (container.DeviceRequest) { - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public string Driver { get; set; } - [DataMember(Name = "Count", EmitDefaultValue = false)] + [JsonPropertyName("Count")] public long Count { get; set; } - [DataMember(Name = "DeviceIDs", EmitDefaultValue = false)] + [JsonPropertyName("DeviceIDs")] public IList DeviceIDs { get; set; } - [DataMember(Name = "Capabilities", EmitDefaultValue = false)] + [JsonPropertyName("Capabilities")] public IList> Capabilities { get; set; } - [DataMember(Name = "Options", EmitDefaultValue = false)] + [JsonPropertyName("Options")] public IDictionary Options { get; set; } } } diff --git a/src/Docker.DotNet/Models/DiscreteGenericResource.Generated.cs b/src/Docker.DotNet/Models/DiscreteGenericResource.Generated.cs index 7fdd41980..3fe0b51d3 100644 --- a/src/Docker.DotNet/Models/DiscreteGenericResource.Generated.cs +++ b/src/Docker.DotNet/Models/DiscreteGenericResource.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class DiscreteGenericResource // (swarm.DiscreteGenericResource) { - [DataMember(Name = "Kind", EmitDefaultValue = false)] + [JsonPropertyName("Kind")] public string Kind { get; set; } - [DataMember(Name = "Value", EmitDefaultValue = false)] + [JsonPropertyName("Value")] public long Value { get; set; } } } diff --git a/src/Docker.DotNet/Models/DispatcherConfig.Generated.cs b/src/Docker.DotNet/Models/DispatcherConfig.Generated.cs index b114555da..6647d0188 100644 --- a/src/Docker.DotNet/Models/DispatcherConfig.Generated.cs +++ b/src/Docker.DotNet/Models/DispatcherConfig.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class DispatcherConfig // (swarm.DispatcherConfig) { - [DataMember(Name = "HeartbeatPeriod", EmitDefaultValue = false)] + [JsonPropertyName("HeartbeatPeriod")] public long HeartbeatPeriod { get; set; } } } diff --git a/src/Docker.DotNet/Models/Driver.Generated.cs b/src/Docker.DotNet/Models/Driver.Generated.cs index 0f82e15a2..7cb9b81cf 100644 --- a/src/Docker.DotNet/Models/Driver.Generated.cs +++ b/src/Docker.DotNet/Models/Driver.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Driver // (mount.Driver) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Options", EmitDefaultValue = false)] + [JsonPropertyName("Options")] public IDictionary Options { get; set; } } } diff --git a/src/Docker.DotNet/Models/EncryptionConfig.Generated.cs b/src/Docker.DotNet/Models/EncryptionConfig.Generated.cs index b90ca7cab..c0129b5ba 100644 --- a/src/Docker.DotNet/Models/EncryptionConfig.Generated.cs +++ b/src/Docker.DotNet/Models/EncryptionConfig.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class EncryptionConfig // (swarm.EncryptionConfig) { - [DataMember(Name = "AutoLockManagers", EmitDefaultValue = false)] + [JsonPropertyName("AutoLockManagers")] public bool AutoLockManagers { get; set; } } } diff --git a/src/Docker.DotNet/Models/Endpoint.Generated.cs b/src/Docker.DotNet/Models/Endpoint.Generated.cs index 684ffde48..13dddb9b2 100644 --- a/src/Docker.DotNet/Models/Endpoint.Generated.cs +++ b/src/Docker.DotNet/Models/Endpoint.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Endpoint // (swarm.Endpoint) { - [DataMember(Name = "Spec", EmitDefaultValue = false)] + [JsonPropertyName("Spec")] public EndpointSpec Spec { get; set; } - [DataMember(Name = "Ports", EmitDefaultValue = false)] + [JsonPropertyName("Ports")] public IList Ports { get; set; } - [DataMember(Name = "VirtualIPs", EmitDefaultValue = false)] + [JsonPropertyName("VirtualIPs")] public IList VirtualIPs { get; set; } } } diff --git a/src/Docker.DotNet/Models/EndpointIPAMConfig.Generated.cs b/src/Docker.DotNet/Models/EndpointIPAMConfig.Generated.cs index 4d6376b3a..b6ed6f791 100644 --- a/src/Docker.DotNet/Models/EndpointIPAMConfig.Generated.cs +++ b/src/Docker.DotNet/Models/EndpointIPAMConfig.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class EndpointIPAMConfig // (network.EndpointIPAMConfig) { - [DataMember(Name = "IPv4Address", EmitDefaultValue = false)] + [JsonPropertyName("IPv4Address")] public string IPv4Address { get; set; } - [DataMember(Name = "IPv6Address", EmitDefaultValue = false)] + [JsonPropertyName("IPv6Address")] public string IPv6Address { get; set; } - [DataMember(Name = "LinkLocalIPs", EmitDefaultValue = false)] + [JsonPropertyName("LinkLocalIPs")] public IList LinkLocalIPs { get; set; } } } diff --git a/src/Docker.DotNet/Models/EndpointResource.Generated.cs b/src/Docker.DotNet/Models/EndpointResource.Generated.cs index 98c25b160..26b7e5d73 100644 --- a/src/Docker.DotNet/Models/EndpointResource.Generated.cs +++ b/src/Docker.DotNet/Models/EndpointResource.Generated.cs @@ -1,23 +1,22 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class EndpointResource // (network.EndpointResource) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "EndpointID", EmitDefaultValue = false)] + [JsonPropertyName("EndpointID")] public string EndpointID { get; set; } - [DataMember(Name = "MacAddress", EmitDefaultValue = false)] + [JsonPropertyName("MacAddress")] public string MacAddress { get; set; } - [DataMember(Name = "IPv4Address", EmitDefaultValue = false)] + [JsonPropertyName("IPv4Address")] public string IPv4Address { get; set; } - [DataMember(Name = "IPv6Address", EmitDefaultValue = false)] + [JsonPropertyName("IPv6Address")] public string IPv6Address { get; set; } } } diff --git a/src/Docker.DotNet/Models/EndpointSettings.Generated.cs b/src/Docker.DotNet/Models/EndpointSettings.Generated.cs index e86911fbd..33c8061ee 100644 --- a/src/Docker.DotNet/Models/EndpointSettings.Generated.cs +++ b/src/Docker.DotNet/Models/EndpointSettings.Generated.cs @@ -1,51 +1,50 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class EndpointSettings // (network.EndpointSettings) { - [DataMember(Name = "IPAMConfig", EmitDefaultValue = false)] + [JsonPropertyName("IPAMConfig")] public EndpointIPAMConfig IPAMConfig { get; set; } - [DataMember(Name = "Links", EmitDefaultValue = false)] + [JsonPropertyName("Links")] public IList Links { get; set; } - [DataMember(Name = "Aliases", EmitDefaultValue = false)] + [JsonPropertyName("Aliases")] public IList Aliases { get; set; } - [DataMember(Name = "MacAddress", EmitDefaultValue = false)] + [JsonPropertyName("MacAddress")] public string MacAddress { get; set; } - [DataMember(Name = "DriverOpts", EmitDefaultValue = false)] + [JsonPropertyName("DriverOpts")] public IDictionary DriverOpts { get; set; } - [DataMember(Name = "NetworkID", EmitDefaultValue = false)] + [JsonPropertyName("NetworkID")] public string NetworkID { get; set; } - [DataMember(Name = "EndpointID", EmitDefaultValue = false)] + [JsonPropertyName("EndpointID")] public string EndpointID { get; set; } - [DataMember(Name = "Gateway", EmitDefaultValue = false)] + [JsonPropertyName("Gateway")] public string Gateway { get; set; } - [DataMember(Name = "IPAddress", EmitDefaultValue = false)] + [JsonPropertyName("IPAddress")] public string IPAddress { get; set; } - [DataMember(Name = "IPPrefixLen", EmitDefaultValue = false)] + [JsonPropertyName("IPPrefixLen")] public long IPPrefixLen { get; set; } - [DataMember(Name = "IPv6Gateway", EmitDefaultValue = false)] + [JsonPropertyName("IPv6Gateway")] public string IPv6Gateway { get; set; } - [DataMember(Name = "GlobalIPv6Address", EmitDefaultValue = false)] + [JsonPropertyName("GlobalIPv6Address")] public string GlobalIPv6Address { get; set; } - [DataMember(Name = "GlobalIPv6PrefixLen", EmitDefaultValue = false)] + [JsonPropertyName("GlobalIPv6PrefixLen")] public long GlobalIPv6PrefixLen { get; set; } - [DataMember(Name = "DNSNames", EmitDefaultValue = false)] + [JsonPropertyName("DNSNames")] public IList DNSNames { get; set; } } } diff --git a/src/Docker.DotNet/Models/EndpointSpec.Generated.cs b/src/Docker.DotNet/Models/EndpointSpec.Generated.cs index 1af3a29c9..4437ffc4a 100644 --- a/src/Docker.DotNet/Models/EndpointSpec.Generated.cs +++ b/src/Docker.DotNet/Models/EndpointSpec.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class EndpointSpec // (swarm.EndpointSpec) { - [DataMember(Name = "Mode", EmitDefaultValue = false)] + [JsonPropertyName("Mode")] public string Mode { get; set; } - [DataMember(Name = "Ports", EmitDefaultValue = false)] + [JsonPropertyName("Ports")] public IList Ports { get; set; } } } diff --git a/src/Docker.DotNet/Models/EndpointVirtualIP.Generated.cs b/src/Docker.DotNet/Models/EndpointVirtualIP.Generated.cs index e31fe8cbd..4d9719608 100644 --- a/src/Docker.DotNet/Models/EndpointVirtualIP.Generated.cs +++ b/src/Docker.DotNet/Models/EndpointVirtualIP.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class EndpointVirtualIP // (swarm.EndpointVirtualIP) { - [DataMember(Name = "NetworkID", EmitDefaultValue = false)] + [JsonPropertyName("NetworkID")] public string NetworkID { get; set; } - [DataMember(Name = "Addr", EmitDefaultValue = false)] + [JsonPropertyName("Addr")] public string Addr { get; set; } } } diff --git a/src/Docker.DotNet/Models/EngineDescription.Generated.cs b/src/Docker.DotNet/Models/EngineDescription.Generated.cs index 34e0c4d73..73c1c5ac1 100644 --- a/src/Docker.DotNet/Models/EngineDescription.Generated.cs +++ b/src/Docker.DotNet/Models/EngineDescription.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class EngineDescription // (swarm.EngineDescription) { - [DataMember(Name = "EngineVersion", EmitDefaultValue = false)] + [JsonPropertyName("EngineVersion")] public string EngineVersion { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "Plugins", EmitDefaultValue = false)] + [JsonPropertyName("Plugins")] public IList Plugins { get; set; } } } diff --git a/src/Docker.DotNet/Models/ExternalCA.Generated.cs b/src/Docker.DotNet/Models/ExternalCA.Generated.cs index a156dd1a9..f0b2ac52b 100644 --- a/src/Docker.DotNet/Models/ExternalCA.Generated.cs +++ b/src/Docker.DotNet/Models/ExternalCA.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ExternalCA // (swarm.ExternalCA) { - [DataMember(Name = "Protocol", EmitDefaultValue = false)] + [JsonPropertyName("Protocol")] public string Protocol { get; set; } - [DataMember(Name = "URL", EmitDefaultValue = false)] + [JsonPropertyName("URL")] public string URL { get; set; } - [DataMember(Name = "Options", EmitDefaultValue = false)] + [JsonPropertyName("Options")] public IDictionary Options { get; set; } - [DataMember(Name = "CACert", EmitDefaultValue = false)] + [JsonPropertyName("CACert")] public string CACert { get; set; } } } diff --git a/src/Docker.DotNet/Models/GenericResource.Generated.cs b/src/Docker.DotNet/Models/GenericResource.Generated.cs index 5b3bc1f97..49dcdd525 100644 --- a/src/Docker.DotNet/Models/GenericResource.Generated.cs +++ b/src/Docker.DotNet/Models/GenericResource.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class GenericResource // (swarm.GenericResource) { - [DataMember(Name = "NamedResourceSpec", EmitDefaultValue = false)] + [JsonPropertyName("NamedResourceSpec")] public NamedGenericResource NamedResourceSpec { get; set; } - [DataMember(Name = "DiscreteResourceSpec", EmitDefaultValue = false)] + [JsonPropertyName("DiscreteResourceSpec")] public DiscreteGenericResource DiscreteResourceSpec { get; set; } } } diff --git a/src/Docker.DotNet/Models/GlobalJob.Generated.cs b/src/Docker.DotNet/Models/GlobalJob.Generated.cs index ec8ed7d2f..7aea07998 100644 --- a/src/Docker.DotNet/Models/GlobalJob.Generated.cs +++ b/src/Docker.DotNet/Models/GlobalJob.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class GlobalJob // (swarm.GlobalJob) { } diff --git a/src/Docker.DotNet/Models/GlobalService.Generated.cs b/src/Docker.DotNet/Models/GlobalService.Generated.cs index 3a7cc5ed7..78c456240 100644 --- a/src/Docker.DotNet/Models/GlobalService.Generated.cs +++ b/src/Docker.DotNet/Models/GlobalService.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class GlobalService // (swarm.GlobalService) { } diff --git a/src/Docker.DotNet/Models/GraphDriverData.Generated.cs b/src/Docker.DotNet/Models/GraphDriverData.Generated.cs index ab06c95ba..ace12dddf 100644 --- a/src/Docker.DotNet/Models/GraphDriverData.Generated.cs +++ b/src/Docker.DotNet/Models/GraphDriverData.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class GraphDriverData // (types.GraphDriverData) { - [DataMember(Name = "Data", EmitDefaultValue = false)] + [JsonPropertyName("Data")] public IDictionary Data { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } } } diff --git a/src/Docker.DotNet/Models/Health.Generated.cs b/src/Docker.DotNet/Models/Health.Generated.cs index edd90fb37..8bc02f8e3 100644 --- a/src/Docker.DotNet/Models/Health.Generated.cs +++ b/src/Docker.DotNet/Models/Health.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Health // (types.Health) { - [DataMember(Name = "Status", EmitDefaultValue = false)] + [JsonPropertyName("Status")] public string Status { get; set; } - [DataMember(Name = "FailingStreak", EmitDefaultValue = false)] + [JsonPropertyName("FailingStreak")] public long FailingStreak { get; set; } - [DataMember(Name = "Log", EmitDefaultValue = false)] + [JsonPropertyName("Log")] public IList Log { get; set; } } } diff --git a/src/Docker.DotNet/Models/HealthcheckConfig.Generated.cs b/src/Docker.DotNet/Models/HealthcheckConfig.Generated.cs index f3afcd026..ef209803f 100644 --- a/src/Docker.DotNet/Models/HealthcheckConfig.Generated.cs +++ b/src/Docker.DotNet/Models/HealthcheckConfig.Generated.cs @@ -1,31 +1,29 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class HealthcheckConfig // (v1.HealthcheckConfig) { - [DataMember(Name = "Test", EmitDefaultValue = false)] + [JsonPropertyName("Test")] public IList Test { get; set; } - [DataMember(Name = "Interval", EmitDefaultValue = false)] + [JsonPropertyName("Interval")] [JsonConverter(typeof(TimeSpanNanosecondsConverter))] public TimeSpan Interval { get; set; } - [DataMember(Name = "Timeout", EmitDefaultValue = false)] + [JsonPropertyName("Timeout")] [JsonConverter(typeof(TimeSpanNanosecondsConverter))] public TimeSpan Timeout { get; set; } - [DataMember(Name = "StartPeriod", EmitDefaultValue = false)] + [JsonPropertyName("StartPeriod")] public long StartPeriod { get; set; } - [DataMember(Name = "StartInterval", EmitDefaultValue = false)] + [JsonPropertyName("StartInterval")] public long StartInterval { get; set; } - [DataMember(Name = "Retries", EmitDefaultValue = false)] + [JsonPropertyName("Retries")] public long Retries { get; set; } } } diff --git a/src/Docker.DotNet/Models/HealthcheckResult.Generated.cs b/src/Docker.DotNet/Models/HealthcheckResult.Generated.cs index 98534a481..4ba07c70f 100644 --- a/src/Docker.DotNet/Models/HealthcheckResult.Generated.cs +++ b/src/Docker.DotNet/Models/HealthcheckResult.Generated.cs @@ -1,21 +1,20 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class HealthcheckResult // (types.HealthcheckResult) { - [DataMember(Name = "Start", EmitDefaultValue = false)] + [JsonPropertyName("Start")] public DateTime Start { get; set; } - [DataMember(Name = "End", EmitDefaultValue = false)] + [JsonPropertyName("End")] public DateTime End { get; set; } - [DataMember(Name = "ExitCode", EmitDefaultValue = false)] + [JsonPropertyName("ExitCode")] public long ExitCode { get; set; } - [DataMember(Name = "Output", EmitDefaultValue = false)] + [JsonPropertyName("Output")] public string Output { get; set; } } } diff --git a/src/Docker.DotNet/Models/HostConfig.Generated.cs b/src/Docker.DotNet/Models/HostConfig.Generated.cs index 6b4f1cec3..372d75007 100644 --- a/src/Docker.DotNet/Models/HostConfig.Generated.cs +++ b/src/Docker.DotNet/Models/HostConfig.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class HostConfig // (container.HostConfig) { public HostConfig() @@ -48,217 +47,217 @@ public HostConfig(Resources Resources) } } - [DataMember(Name = "Binds", EmitDefaultValue = false)] + [JsonPropertyName("Binds")] public IList Binds { get; set; } - [DataMember(Name = "ContainerIDFile", EmitDefaultValue = false)] + [JsonPropertyName("ContainerIDFile")] public string ContainerIDFile { get; set; } - [DataMember(Name = "LogConfig", EmitDefaultValue = false)] + [JsonPropertyName("LogConfig")] public LogConfig LogConfig { get; set; } - [DataMember(Name = "NetworkMode", EmitDefaultValue = false)] + [JsonPropertyName("NetworkMode")] public string NetworkMode { get; set; } - [DataMember(Name = "PortBindings", EmitDefaultValue = false)] + [JsonPropertyName("PortBindings")] public IDictionary> PortBindings { get; set; } - [DataMember(Name = "RestartPolicy", EmitDefaultValue = false)] + [JsonPropertyName("RestartPolicy")] public RestartPolicy RestartPolicy { get; set; } - [DataMember(Name = "AutoRemove", EmitDefaultValue = false)] + [JsonPropertyName("AutoRemove")] public bool AutoRemove { get; set; } - [DataMember(Name = "VolumeDriver", EmitDefaultValue = false)] + [JsonPropertyName("VolumeDriver")] public string VolumeDriver { get; set; } - [DataMember(Name = "VolumesFrom", EmitDefaultValue = false)] + [JsonPropertyName("VolumesFrom")] public IList VolumesFrom { get; set; } - [DataMember(Name = "ConsoleSize", EmitDefaultValue = false)] + [JsonPropertyName("ConsoleSize")] public ulong[] ConsoleSize { get; set; } - [DataMember(Name = "Annotations", EmitDefaultValue = false)] + [JsonPropertyName("Annotations")] public IDictionary Annotations { get; set; } - [DataMember(Name = "CapAdd", EmitDefaultValue = false)] + [JsonPropertyName("CapAdd")] public IList CapAdd { get; set; } - [DataMember(Name = "CapDrop", EmitDefaultValue = false)] + [JsonPropertyName("CapDrop")] public IList CapDrop { get; set; } - [DataMember(Name = "CgroupnsMode", EmitDefaultValue = false)] + [JsonPropertyName("CgroupnsMode")] public string CgroupnsMode { get; set; } - [DataMember(Name = "Dns", EmitDefaultValue = false)] + [JsonPropertyName("Dns")] public IList DNS { get; set; } - [DataMember(Name = "DnsOptions", EmitDefaultValue = false)] + [JsonPropertyName("DnsOptions")] public IList DNSOptions { get; set; } - [DataMember(Name = "DnsSearch", EmitDefaultValue = false)] + [JsonPropertyName("DnsSearch")] public IList DNSSearch { get; set; } - [DataMember(Name = "ExtraHosts", EmitDefaultValue = false)] + [JsonPropertyName("ExtraHosts")] public IList ExtraHosts { get; set; } - [DataMember(Name = "GroupAdd", EmitDefaultValue = false)] + [JsonPropertyName("GroupAdd")] public IList GroupAdd { get; set; } - [DataMember(Name = "IpcMode", EmitDefaultValue = false)] + [JsonPropertyName("IpcMode")] public string IpcMode { get; set; } - [DataMember(Name = "Cgroup", EmitDefaultValue = false)] + [JsonPropertyName("Cgroup")] public string Cgroup { get; set; } - [DataMember(Name = "Links", EmitDefaultValue = false)] + [JsonPropertyName("Links")] public IList Links { get; set; } - [DataMember(Name = "OomScoreAdj", EmitDefaultValue = false)] + [JsonPropertyName("OomScoreAdj")] public long OomScoreAdj { get; set; } - [DataMember(Name = "PidMode", EmitDefaultValue = false)] + [JsonPropertyName("PidMode")] public string PidMode { get; set; } - [DataMember(Name = "Privileged", EmitDefaultValue = false)] + [JsonPropertyName("Privileged")] public bool Privileged { get; set; } - [DataMember(Name = "PublishAllPorts", EmitDefaultValue = false)] + [JsonPropertyName("PublishAllPorts")] public bool PublishAllPorts { get; set; } - [DataMember(Name = "ReadonlyRootfs", EmitDefaultValue = false)] + [JsonPropertyName("ReadonlyRootfs")] public bool ReadonlyRootfs { get; set; } - [DataMember(Name = "SecurityOpt", EmitDefaultValue = false)] + [JsonPropertyName("SecurityOpt")] public IList SecurityOpt { get; set; } - [DataMember(Name = "StorageOpt", EmitDefaultValue = false)] + [JsonPropertyName("StorageOpt")] public IDictionary StorageOpt { get; set; } - [DataMember(Name = "Tmpfs", EmitDefaultValue = false)] + [JsonPropertyName("Tmpfs")] public IDictionary Tmpfs { get; set; } - [DataMember(Name = "UTSMode", EmitDefaultValue = false)] + [JsonPropertyName("UTSMode")] public string UTSMode { get; set; } - [DataMember(Name = "UsernsMode", EmitDefaultValue = false)] + [JsonPropertyName("UsernsMode")] public string UsernsMode { get; set; } - [DataMember(Name = "ShmSize", EmitDefaultValue = false)] + [JsonPropertyName("ShmSize")] public long ShmSize { get; set; } - [DataMember(Name = "Sysctls", EmitDefaultValue = false)] + [JsonPropertyName("Sysctls")] public IDictionary Sysctls { get; set; } - [DataMember(Name = "Runtime", EmitDefaultValue = false)] + [JsonPropertyName("Runtime")] public string Runtime { get; set; } - [DataMember(Name = "Isolation", EmitDefaultValue = false)] + [JsonPropertyName("Isolation")] public string Isolation { get; set; } - [DataMember(Name = "CpuShares", EmitDefaultValue = false)] + [JsonPropertyName("CpuShares")] public long CPUShares { get; set; } - [DataMember(Name = "Memory", EmitDefaultValue = false)] + [JsonPropertyName("Memory")] public long Memory { get; set; } - [DataMember(Name = "NanoCpus", EmitDefaultValue = false)] + [JsonPropertyName("NanoCpus")] public long NanoCPUs { get; set; } - [DataMember(Name = "CgroupParent", EmitDefaultValue = false)] + [JsonPropertyName("CgroupParent")] public string CgroupParent { get; set; } - [DataMember(Name = "BlkioWeight", EmitDefaultValue = false)] + [JsonPropertyName("BlkioWeight")] public ushort BlkioWeight { get; set; } - [DataMember(Name = "BlkioWeightDevice", EmitDefaultValue = false)] + [JsonPropertyName("BlkioWeightDevice")] public IList BlkioWeightDevice { get; set; } - [DataMember(Name = "BlkioDeviceReadBps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceReadBps")] public IList BlkioDeviceReadBps { get; set; } - [DataMember(Name = "BlkioDeviceWriteBps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceWriteBps")] public IList BlkioDeviceWriteBps { get; set; } - [DataMember(Name = "BlkioDeviceReadIOps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceReadIOps")] public IList BlkioDeviceReadIOps { get; set; } - [DataMember(Name = "BlkioDeviceWriteIOps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceWriteIOps")] public IList BlkioDeviceWriteIOps { get; set; } - [DataMember(Name = "CpuPeriod", EmitDefaultValue = false)] + [JsonPropertyName("CpuPeriod")] public long CPUPeriod { get; set; } - [DataMember(Name = "CpuQuota", EmitDefaultValue = false)] + [JsonPropertyName("CpuQuota")] public long CPUQuota { get; set; } - [DataMember(Name = "CpuRealtimePeriod", EmitDefaultValue = false)] + [JsonPropertyName("CpuRealtimePeriod")] public long CPURealtimePeriod { get; set; } - [DataMember(Name = "CpuRealtimeRuntime", EmitDefaultValue = false)] + [JsonPropertyName("CpuRealtimeRuntime")] public long CPURealtimeRuntime { get; set; } - [DataMember(Name = "CpusetCpus", EmitDefaultValue = false)] + [JsonPropertyName("CpusetCpus")] public string CpusetCpus { get; set; } - [DataMember(Name = "CpusetMems", EmitDefaultValue = false)] + [JsonPropertyName("CpusetMems")] public string CpusetMems { get; set; } - [DataMember(Name = "Devices", EmitDefaultValue = false)] + [JsonPropertyName("Devices")] public IList Devices { get; set; } - [DataMember(Name = "DeviceCgroupRules", EmitDefaultValue = false)] + [JsonPropertyName("DeviceCgroupRules")] public IList DeviceCgroupRules { get; set; } - [DataMember(Name = "DeviceRequests", EmitDefaultValue = false)] + [JsonPropertyName("DeviceRequests")] public IList DeviceRequests { get; set; } - [DataMember(Name = "KernelMemory", EmitDefaultValue = false)] + [JsonPropertyName("KernelMemory")] public long KernelMemory { get; set; } - [DataMember(Name = "KernelMemoryTCP", EmitDefaultValue = false)] + [JsonPropertyName("KernelMemoryTCP")] public long KernelMemoryTCP { get; set; } - [DataMember(Name = "MemoryReservation", EmitDefaultValue = false)] + [JsonPropertyName("MemoryReservation")] public long MemoryReservation { get; set; } - [DataMember(Name = "MemorySwap", EmitDefaultValue = false)] + [JsonPropertyName("MemorySwap")] public long MemorySwap { get; set; } - [DataMember(Name = "MemorySwappiness", EmitDefaultValue = false)] + [JsonPropertyName("MemorySwappiness")] public long? MemorySwappiness { get; set; } - [DataMember(Name = "OomKillDisable", EmitDefaultValue = false)] + [JsonPropertyName("OomKillDisable")] public bool? OomKillDisable { get; set; } - [DataMember(Name = "PidsLimit", EmitDefaultValue = false)] + [JsonPropertyName("PidsLimit")] public long? PidsLimit { get; set; } - [DataMember(Name = "Ulimits", EmitDefaultValue = false)] + [JsonPropertyName("Ulimits")] public IList Ulimits { get; set; } - [DataMember(Name = "CpuCount", EmitDefaultValue = false)] + [JsonPropertyName("CpuCount")] public long CPUCount { get; set; } - [DataMember(Name = "CpuPercent", EmitDefaultValue = false)] + [JsonPropertyName("CpuPercent")] public long CPUPercent { get; set; } - [DataMember(Name = "IOMaximumIOps", EmitDefaultValue = false)] + [JsonPropertyName("IOMaximumIOps")] public ulong IOMaximumIOps { get; set; } - [DataMember(Name = "IOMaximumBandwidth", EmitDefaultValue = false)] + [JsonPropertyName("IOMaximumBandwidth")] public ulong IOMaximumBandwidth { get; set; } - [DataMember(Name = "Mounts", EmitDefaultValue = false)] + [JsonPropertyName("Mounts")] public IList Mounts { get; set; } - [DataMember(Name = "MaskedPaths", EmitDefaultValue = false)] + [JsonPropertyName("MaskedPaths")] public IList MaskedPaths { get; set; } - [DataMember(Name = "ReadonlyPaths", EmitDefaultValue = false)] + [JsonPropertyName("ReadonlyPaths")] public IList ReadonlyPaths { get; set; } - [DataMember(Name = "Init", EmitDefaultValue = false)] + [JsonPropertyName("Init")] public bool? Init { get; set; } } } diff --git a/src/Docker.DotNet/Models/IPAM.Generated.cs b/src/Docker.DotNet/Models/IPAM.Generated.cs index 012c33f3e..f3f2c2a07 100644 --- a/src/Docker.DotNet/Models/IPAM.Generated.cs +++ b/src/Docker.DotNet/Models/IPAM.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class IPAM // (network.IPAM) { - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public string Driver { get; set; } - [DataMember(Name = "Options", EmitDefaultValue = false)] + [JsonPropertyName("Options")] public IDictionary Options { get; set; } - [DataMember(Name = "Config", EmitDefaultValue = false)] + [JsonPropertyName("Config")] public IList Config { get; set; } } } diff --git a/src/Docker.DotNet/Models/IPAMConfig.Generated.cs b/src/Docker.DotNet/Models/IPAMConfig.Generated.cs index 0437c427b..73194ca95 100644 --- a/src/Docker.DotNet/Models/IPAMConfig.Generated.cs +++ b/src/Docker.DotNet/Models/IPAMConfig.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class IPAMConfig // (network.IPAMConfig) { - [DataMember(Name = "Subnet", EmitDefaultValue = false)] + [JsonPropertyName("Subnet")] public string Subnet { get; set; } - [DataMember(Name = "IPRange", EmitDefaultValue = false)] + [JsonPropertyName("IPRange")] public string IPRange { get; set; } - [DataMember(Name = "Gateway", EmitDefaultValue = false)] + [JsonPropertyName("Gateway")] public string Gateway { get; set; } - [DataMember(Name = "AuxiliaryAddresses", EmitDefaultValue = false)] + [JsonPropertyName("AuxiliaryAddresses")] public IDictionary AuxAddress { get; set; } } } diff --git a/src/Docker.DotNet/Models/IPAMOptions.Generated.cs b/src/Docker.DotNet/Models/IPAMOptions.Generated.cs index 3b8084af6..4402e5520 100644 --- a/src/Docker.DotNet/Models/IPAMOptions.Generated.cs +++ b/src/Docker.DotNet/Models/IPAMOptions.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class IPAMOptions // (swarm.IPAMOptions) { - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public SwarmDriver Driver { get; set; } - [DataMember(Name = "Configs", EmitDefaultValue = false)] + [JsonPropertyName("Configs")] public IList Configs { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImageBuildParameters.Generated.cs b/src/Docker.DotNet/Models/ImageBuildParameters.Generated.cs index 285dfc9d9..fe4e30f7f 100644 --- a/src/Docker.DotNet/Models/ImageBuildParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ImageBuildParameters.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImageBuildParameters // (main.ImageBuildParameters) { [QueryStringParameter("t", false, typeof(EnumerableQueryStringConverter))] @@ -81,7 +80,7 @@ public class ImageBuildParameters // (main.ImageBuildParameters) [QueryStringParameter("version", false)] public string Version { get; set; } - [DataMember(Name = "AuthConfigs", EmitDefaultValue = false)] + [JsonPropertyName("AuthConfigs")] public IDictionary AuthConfigs { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImageBuildResponse.Generated.cs b/src/Docker.DotNet/Models/ImageBuildResponse.Generated.cs index 15f9d4539..7f914d979 100644 --- a/src/Docker.DotNet/Models/ImageBuildResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ImageBuildResponse.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImageBuildResponse // (types.ImageBuildResponse) { - [DataMember(Name = "Body", EmitDefaultValue = false)] + [JsonPropertyName("Body")] public object Body { get; set; } - [DataMember(Name = "OSType", EmitDefaultValue = false)] + [JsonPropertyName("OSType")] public string OSType { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImageDeleteParameters.Generated.cs b/src/Docker.DotNet/Models/ImageDeleteParameters.Generated.cs index 51125bee6..dcfbac61c 100644 --- a/src/Docker.DotNet/Models/ImageDeleteParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ImageDeleteParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImageDeleteParameters // (main.ImageDeleteParameters) { [QueryStringParameter("force", false, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ImageDeleteResponse.Generated.cs b/src/Docker.DotNet/Models/ImageDeleteResponse.Generated.cs index ef2f58877..6ba0a2d7a 100644 --- a/src/Docker.DotNet/Models/ImageDeleteResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ImageDeleteResponse.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImageDeleteResponse // (image.DeleteResponse) { - [DataMember(Name = "Deleted", EmitDefaultValue = false)] + [JsonPropertyName("Deleted")] public string Deleted { get; set; } - [DataMember(Name = "Untagged", EmitDefaultValue = false)] + [JsonPropertyName("Untagged")] public string Untagged { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImageHistoryResponse.Generated.cs b/src/Docker.DotNet/Models/ImageHistoryResponse.Generated.cs index 70ef825ff..72a60929f 100644 --- a/src/Docker.DotNet/Models/ImageHistoryResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ImageHistoryResponse.Generated.cs @@ -1,28 +1,27 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImageHistoryResponse // (image.HistoryResponseItem) { - [DataMember(Name = "Comment", EmitDefaultValue = false)] + [JsonPropertyName("Comment")] public string Comment { get; set; } - [DataMember(Name = "Created", EmitDefaultValue = false)] + [JsonPropertyName("Created")] public DateTime Created { get; set; } - [DataMember(Name = "CreatedBy", EmitDefaultValue = false)] + [JsonPropertyName("CreatedBy")] public string CreatedBy { get; set; } - [DataMember(Name = "Id", EmitDefaultValue = false)] + [JsonPropertyName("Id")] public string ID { get; set; } - [DataMember(Name = "Size", EmitDefaultValue = false)] + [JsonPropertyName("Size")] public long Size { get; set; } - [DataMember(Name = "Tags", EmitDefaultValue = false)] + [JsonPropertyName("Tags")] public IList Tags { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImageInspectResponse.Generated.cs b/src/Docker.DotNet/Models/ImageInspectResponse.Generated.cs index 504e36dff..1567c3509 100644 --- a/src/Docker.DotNet/Models/ImageInspectResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ImageInspectResponse.Generated.cs @@ -1,70 +1,69 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImageInspectResponse // (types.ImageInspect) { - [DataMember(Name = "Id", EmitDefaultValue = false)] + [JsonPropertyName("Id")] public string ID { get; set; } - [DataMember(Name = "RepoTags", EmitDefaultValue = false)] + [JsonPropertyName("RepoTags")] public IList RepoTags { get; set; } - [DataMember(Name = "RepoDigests", EmitDefaultValue = false)] + [JsonPropertyName("RepoDigests")] public IList RepoDigests { get; set; } - [DataMember(Name = "Parent", EmitDefaultValue = false)] + [JsonPropertyName("Parent")] public string Parent { get; set; } - [DataMember(Name = "Comment", EmitDefaultValue = false)] + [JsonPropertyName("Comment")] public string Comment { get; set; } - [DataMember(Name = "Created", EmitDefaultValue = false)] + [JsonPropertyName("Created")] public DateTime Created { get; set; } - [DataMember(Name = "Container", EmitDefaultValue = false)] + [JsonPropertyName("Container")] public string Container { get; set; } - [DataMember(Name = "ContainerConfig", EmitDefaultValue = false)] + [JsonPropertyName("ContainerConfig")] public Config ContainerConfig { get; set; } - [DataMember(Name = "DockerVersion", EmitDefaultValue = false)] + [JsonPropertyName("DockerVersion")] public string DockerVersion { get; set; } - [DataMember(Name = "Author", EmitDefaultValue = false)] + [JsonPropertyName("Author")] public string Author { get; set; } - [DataMember(Name = "Config", EmitDefaultValue = false)] + [JsonPropertyName("Config")] public Config Config { get; set; } - [DataMember(Name = "Architecture", EmitDefaultValue = false)] + [JsonPropertyName("Architecture")] public string Architecture { get; set; } - [DataMember(Name = "Variant", EmitDefaultValue = false)] + [JsonPropertyName("Variant")] public string Variant { get; set; } - [DataMember(Name = "Os", EmitDefaultValue = false)] + [JsonPropertyName("Os")] public string Os { get; set; } - [DataMember(Name = "OsVersion", EmitDefaultValue = false)] + [JsonPropertyName("OsVersion")] public string OsVersion { get; set; } - [DataMember(Name = "Size", EmitDefaultValue = false)] + [JsonPropertyName("Size")] public long Size { get; set; } - [DataMember(Name = "VirtualSize", EmitDefaultValue = false)] + [JsonPropertyName("VirtualSize")] public long VirtualSize { get; set; } - [DataMember(Name = "GraphDriver", EmitDefaultValue = false)] + [JsonPropertyName("GraphDriver")] public GraphDriverData GraphDriver { get; set; } - [DataMember(Name = "RootFS", EmitDefaultValue = false)] + [JsonPropertyName("RootFS")] public RootFS RootFS { get; set; } - [DataMember(Name = "Metadata", EmitDefaultValue = false)] + [JsonPropertyName("Metadata")] public Metadata Metadata { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImageLoadParameters.Generated.cs b/src/Docker.DotNet/Models/ImageLoadParameters.Generated.cs index cce37e95b..9b13b176c 100644 --- a/src/Docker.DotNet/Models/ImageLoadParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ImageLoadParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImageLoadParameters // (main.ImageLoadParameters) { [QueryStringParameter("quiet", true, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ImageProperties.Generated.cs b/src/Docker.DotNet/Models/ImageProperties.Generated.cs index 107300713..87876d77c 100644 --- a/src/Docker.DotNet/Models/ImageProperties.Generated.cs +++ b/src/Docker.DotNet/Models/ImageProperties.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImageProperties // (image.ImageProperties) { - [DataMember(Name = "Platform", EmitDefaultValue = false)] + [JsonPropertyName("Platform")] public Platform Platform { get; set; } - [DataMember(Name = "Containers", EmitDefaultValue = false)] + [JsonPropertyName("Containers")] public IList Containers { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImagePushParameters.Generated.cs b/src/Docker.DotNet/Models/ImagePushParameters.Generated.cs index 8df43f35a..2473787c3 100644 --- a/src/Docker.DotNet/Models/ImagePushParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ImagePushParameters.Generated.cs @@ -1,8 +1,7 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImagePushParameters // (main.ImagePushParameters) { [QueryStringParameter("tag", false)] @@ -11,7 +10,7 @@ public class ImagePushParameters // (main.ImagePushParameters) [QueryStringParameter("platform", false)] public string Platform { get; set; } - [DataMember(Name = "RegistryAuth", EmitDefaultValue = false)] + [JsonPropertyName("RegistryAuth")] public AuthConfig RegistryAuth { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImageSearchResponse.Generated.cs b/src/Docker.DotNet/Models/ImageSearchResponse.Generated.cs index c375437e1..2fdd515c7 100644 --- a/src/Docker.DotNet/Models/ImageSearchResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ImageSearchResponse.Generated.cs @@ -1,23 +1,22 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImageSearchResponse // (registry.SearchResult) { - [DataMember(Name = "star_count", EmitDefaultValue = false)] + [JsonPropertyName("star_count")] public long StarCount { get; set; } - [DataMember(Name = "is_official", EmitDefaultValue = false)] + [JsonPropertyName("is_official")] public bool IsOfficial { get; set; } - [DataMember(Name = "name", EmitDefaultValue = false)] + [JsonPropertyName("name")] public string Name { get; set; } - [DataMember(Name = "is_automated", EmitDefaultValue = false)] + [JsonPropertyName("is_automated")] public bool IsAutomated { get; set; } - [DataMember(Name = "description", EmitDefaultValue = false)] + [JsonPropertyName("description")] public string Description { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImageTagParameters.Generated.cs b/src/Docker.DotNet/Models/ImageTagParameters.Generated.cs index c05546935..c3c0b3aa5 100644 --- a/src/Docker.DotNet/Models/ImageTagParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ImageTagParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImageTagParameters // (main.ImageTagParameters) { [QueryStringParameter("repo", false)] diff --git a/src/Docker.DotNet/Models/ImagesCreateParameters.Generated.cs b/src/Docker.DotNet/Models/ImagesCreateParameters.Generated.cs index 350562e7c..54b8a3b71 100644 --- a/src/Docker.DotNet/Models/ImagesCreateParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ImagesCreateParameters.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImagesCreateParameters // (main.ImagesCreateParameters) { [QueryStringParameter("fromImage", false)] @@ -27,7 +26,7 @@ public class ImagesCreateParameters // (main.ImagesCreateParameters) [QueryStringParameter("platform", false)] public string Platform { get; set; } - [DataMember(Name = "RegistryAuth", EmitDefaultValue = false)] + [JsonPropertyName("RegistryAuth")] public AuthConfig RegistryAuth { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImagesListParameters.Generated.cs b/src/Docker.DotNet/Models/ImagesListParameters.Generated.cs index c97807fb1..b108ca38d 100644 --- a/src/Docker.DotNet/Models/ImagesListParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ImagesListParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImagesListParameters // (main.ImagesListParameters) { [QueryStringParameter("all", false, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ImagesListResponse.Generated.cs b/src/Docker.DotNet/Models/ImagesListResponse.Generated.cs index 76b9f3a46..3aa2f321a 100644 --- a/src/Docker.DotNet/Models/ImagesListResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ImagesListResponse.Generated.cs @@ -1,43 +1,42 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImagesListResponse // (image.Summary) { - [DataMember(Name = "Containers", EmitDefaultValue = false)] + [JsonPropertyName("Containers")] public long Containers { get; set; } - [DataMember(Name = "Created", EmitDefaultValue = false)] + [JsonPropertyName("Created")] public DateTime Created { get; set; } - [DataMember(Name = "Id", EmitDefaultValue = false)] + [JsonPropertyName("Id")] public string ID { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "ParentId", EmitDefaultValue = false)] + [JsonPropertyName("ParentId")] public string ParentID { get; set; } - [DataMember(Name = "Manifests", EmitDefaultValue = false)] + [JsonPropertyName("Manifests")] public IList Manifests { get; set; } - [DataMember(Name = "RepoDigests", EmitDefaultValue = false)] + [JsonPropertyName("RepoDigests")] public IList RepoDigests { get; set; } - [DataMember(Name = "RepoTags", EmitDefaultValue = false)] + [JsonPropertyName("RepoTags")] public IList RepoTags { get; set; } - [DataMember(Name = "SharedSize", EmitDefaultValue = false)] + [JsonPropertyName("SharedSize")] public long SharedSize { get; set; } - [DataMember(Name = "Size", EmitDefaultValue = false)] + [JsonPropertyName("Size")] public long Size { get; set; } - [DataMember(Name = "VirtualSize", EmitDefaultValue = false)] + [JsonPropertyName("VirtualSize")] public long VirtualSize { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImagesLoadResponse.Generated.cs b/src/Docker.DotNet/Models/ImagesLoadResponse.Generated.cs index 9a668d36e..0ec464c4a 100644 --- a/src/Docker.DotNet/Models/ImagesLoadResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ImagesLoadResponse.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImagesLoadResponse // (image.LoadResponse) { - [DataMember(Name = "Body", EmitDefaultValue = false)] + [JsonPropertyName("Body")] public object Body { get; set; } - [DataMember(Name = "JSON", EmitDefaultValue = false)] + [JsonPropertyName("JSON")] public bool JSON { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImagesPruneParameters.Generated.cs b/src/Docker.DotNet/Models/ImagesPruneParameters.Generated.cs index a8263a568..8eb0d8628 100644 --- a/src/Docker.DotNet/Models/ImagesPruneParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ImagesPruneParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImagesPruneParameters // (main.ImagesPruneParameters) { [QueryStringParameter("filters", false, typeof(MapQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ImagesPruneResponse.Generated.cs b/src/Docker.DotNet/Models/ImagesPruneResponse.Generated.cs index e4468f072..0ff6dba6c 100644 --- a/src/Docker.DotNet/Models/ImagesPruneResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ImagesPruneResponse.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImagesPruneResponse // (image.PruneReport) { - [DataMember(Name = "ImagesDeleted", EmitDefaultValue = false)] + [JsonPropertyName("ImagesDeleted")] public IList ImagesDeleted { get; set; } - [DataMember(Name = "SpaceReclaimed", EmitDefaultValue = false)] + [JsonPropertyName("SpaceReclaimed")] public ulong SpaceReclaimed { get; set; } } } diff --git a/src/Docker.DotNet/Models/ImagesSearchParameters.Generated.cs b/src/Docker.DotNet/Models/ImagesSearchParameters.Generated.cs index d20f1b33d..937089d8e 100644 --- a/src/Docker.DotNet/Models/ImagesSearchParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ImagesSearchParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ImagesSearchParameters // (main.ImagesSearchParameters) { [QueryStringParameter("term", false)] diff --git a/src/Docker.DotNet/Models/IndexInfo.Generated.cs b/src/Docker.DotNet/Models/IndexInfo.Generated.cs index db2cc9d2b..613537bbe 100644 --- a/src/Docker.DotNet/Models/IndexInfo.Generated.cs +++ b/src/Docker.DotNet/Models/IndexInfo.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class IndexInfo // (registry.IndexInfo) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Mirrors", EmitDefaultValue = false)] + [JsonPropertyName("Mirrors")] public IList Mirrors { get; set; } - [DataMember(Name = "Secure", EmitDefaultValue = false)] + [JsonPropertyName("Secure")] public bool Secure { get; set; } - [DataMember(Name = "Official", EmitDefaultValue = false)] + [JsonPropertyName("Official")] public bool Official { get; set; } } } diff --git a/src/Docker.DotNet/Models/Info.Generated.cs b/src/Docker.DotNet/Models/Info.Generated.cs index 50edebc3a..6c8d8ee87 100644 --- a/src/Docker.DotNet/Models/Info.Generated.cs +++ b/src/Docker.DotNet/Models/Info.Generated.cs @@ -1,39 +1,38 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Info // (swarm.Info) { - [DataMember(Name = "NodeID", EmitDefaultValue = false)] + [JsonPropertyName("NodeID")] public string NodeID { get; set; } - [DataMember(Name = "NodeAddr", EmitDefaultValue = false)] + [JsonPropertyName("NodeAddr")] public string NodeAddr { get; set; } - [DataMember(Name = "LocalNodeState", EmitDefaultValue = false)] + [JsonPropertyName("LocalNodeState")] public string LocalNodeState { get; set; } - [DataMember(Name = "ControlAvailable", EmitDefaultValue = false)] + [JsonPropertyName("ControlAvailable")] public bool ControlAvailable { get; set; } - [DataMember(Name = "Error", EmitDefaultValue = false)] + [JsonPropertyName("Error")] public string Error { get; set; } - [DataMember(Name = "RemoteManagers", EmitDefaultValue = false)] + [JsonPropertyName("RemoteManagers")] public IList RemoteManagers { get; set; } - [DataMember(Name = "Nodes", EmitDefaultValue = false)] + [JsonPropertyName("Nodes")] public long Nodes { get; set; } - [DataMember(Name = "Managers", EmitDefaultValue = false)] + [JsonPropertyName("Managers")] public long Managers { get; set; } - [DataMember(Name = "Cluster", EmitDefaultValue = false)] + [JsonPropertyName("Cluster")] public ClusterInfo Cluster { get; set; } - [DataMember(Name = "Warnings", EmitDefaultValue = false)] + [JsonPropertyName("Warnings")] public IList Warnings { get; set; } } } diff --git a/src/Docker.DotNet/Models/JSONError.Generated.cs b/src/Docker.DotNet/Models/JSONError.Generated.cs index d940381b8..d5aa441eb 100644 --- a/src/Docker.DotNet/Models/JSONError.Generated.cs +++ b/src/Docker.DotNet/Models/JSONError.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class JSONError // (jsonmessage.JSONError) { - [DataMember(Name = "code", EmitDefaultValue = false)] + [JsonPropertyName("code")] public long Code { get; set; } - [DataMember(Name = "message", EmitDefaultValue = false)] + [JsonPropertyName("message")] public string Message { get; set; } } } diff --git a/src/Docker.DotNet/Models/JSONMessage.Generated.cs b/src/Docker.DotNet/Models/JSONMessage.Generated.cs index a5951b9a9..a6adfdaf7 100644 --- a/src/Docker.DotNet/Models/JSONMessage.Generated.cs +++ b/src/Docker.DotNet/Models/JSONMessage.Generated.cs @@ -1,42 +1,41 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class JSONMessage // (jsonmessage.JSONMessage) { - [DataMember(Name = "stream", EmitDefaultValue = false)] + [JsonPropertyName("stream")] public string Stream { get; set; } - [DataMember(Name = "status", EmitDefaultValue = false)] + [JsonPropertyName("status")] public string Status { get; set; } - [DataMember(Name = "progressDetail", EmitDefaultValue = false)] + [JsonPropertyName("progressDetail")] public JSONProgress Progress { get; set; } - [DataMember(Name = "progress", EmitDefaultValue = false)] + [JsonPropertyName("progress")] public string ProgressMessage { get; set; } - [DataMember(Name = "id", EmitDefaultValue = false)] + [JsonPropertyName("id")] public string ID { get; set; } - [DataMember(Name = "from", EmitDefaultValue = false)] + [JsonPropertyName("from")] public string From { get; set; } - [DataMember(Name = "time", EmitDefaultValue = false)] + [JsonPropertyName("time")] public DateTime Time { get; set; } - [DataMember(Name = "timeNano", EmitDefaultValue = false)] + [JsonPropertyName("timeNano")] public long TimeNano { get; set; } - [DataMember(Name = "errorDetail", EmitDefaultValue = false)] + [JsonPropertyName("errorDetail")] public JSONError Error { get; set; } - [DataMember(Name = "error", EmitDefaultValue = false)] + [JsonPropertyName("error")] public string ErrorMessage { get; set; } - [DataMember(Name = "aux", EmitDefaultValue = false)] + [JsonPropertyName("aux")] public ObjectExtensionData Aux { get; set; } } } diff --git a/src/Docker.DotNet/Models/JSONProgress.Generated.cs b/src/Docker.DotNet/Models/JSONProgress.Generated.cs index 80415874d..cd5320369 100644 --- a/src/Docker.DotNet/Models/JSONProgress.Generated.cs +++ b/src/Docker.DotNet/Models/JSONProgress.Generated.cs @@ -1,26 +1,25 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class JSONProgress // (jsonmessage.JSONProgress) { - [DataMember(Name = "current", EmitDefaultValue = false)] + [JsonPropertyName("current")] public long Current { get; set; } - [DataMember(Name = "total", EmitDefaultValue = false)] + [JsonPropertyName("total")] public long Total { get; set; } - [DataMember(Name = "start", EmitDefaultValue = false)] + [JsonPropertyName("start")] public long Start { get; set; } - [DataMember(Name = "hidecounts", EmitDefaultValue = false)] + [JsonPropertyName("hidecounts")] public bool HideCounts { get; set; } - [DataMember(Name = "units", EmitDefaultValue = false)] + [JsonPropertyName("units")] public string Units { get; set; } - [DataMember(Name = "winSize", EmitDefaultValue = false)] + [JsonPropertyName("winSize")] public long winSize { get; set; } } } diff --git a/src/Docker.DotNet/Models/JobStatus.Generated.cs b/src/Docker.DotNet/Models/JobStatus.Generated.cs index c1a961e24..f81ce9a08 100644 --- a/src/Docker.DotNet/Models/JobStatus.Generated.cs +++ b/src/Docker.DotNet/Models/JobStatus.Generated.cs @@ -1,15 +1,14 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class JobStatus // (swarm.JobStatus) { - [DataMember(Name = "JobIteration", EmitDefaultValue = false)] + [JsonPropertyName("JobIteration")] public Version JobIteration { get; set; } - [DataMember(Name = "LastExecution", EmitDefaultValue = false)] + [JsonPropertyName("LastExecution")] public DateTime LastExecution { get; set; } } } diff --git a/src/Docker.DotNet/Models/JoinTokens.Generated.cs b/src/Docker.DotNet/Models/JoinTokens.Generated.cs index 62133dee1..9374ed8a7 100644 --- a/src/Docker.DotNet/Models/JoinTokens.Generated.cs +++ b/src/Docker.DotNet/Models/JoinTokens.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class JoinTokens // (swarm.JoinTokens) { - [DataMember(Name = "Worker", EmitDefaultValue = false)] + [JsonPropertyName("Worker")] public string Worker { get; set; } - [DataMember(Name = "Manager", EmitDefaultValue = false)] + [JsonPropertyName("Manager")] public string Manager { get; set; } } } diff --git a/src/Docker.DotNet/Models/LogConfig.Generated.cs b/src/Docker.DotNet/Models/LogConfig.Generated.cs index 0441e3b62..060917a72 100644 --- a/src/Docker.DotNet/Models/LogConfig.Generated.cs +++ b/src/Docker.DotNet/Models/LogConfig.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class LogConfig // (container.LogConfig) { - [DataMember(Name = "Type", EmitDefaultValue = false)] + [JsonPropertyName("Type")] public string Type { get; set; } - [DataMember(Name = "Config", EmitDefaultValue = false)] + [JsonPropertyName("Config")] public IDictionary Config { get; set; } } } diff --git a/src/Docker.DotNet/Models/ManagerStatus.Generated.cs b/src/Docker.DotNet/Models/ManagerStatus.Generated.cs index 2a52fbf57..43d14f94c 100644 --- a/src/Docker.DotNet/Models/ManagerStatus.Generated.cs +++ b/src/Docker.DotNet/Models/ManagerStatus.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ManagerStatus // (swarm.ManagerStatus) { - [DataMember(Name = "Leader", EmitDefaultValue = false)] + [JsonPropertyName("Leader")] public bool Leader { get; set; } - [DataMember(Name = "Reachability", EmitDefaultValue = false)] + [JsonPropertyName("Reachability")] public string Reachability { get; set; } - [DataMember(Name = "Addr", EmitDefaultValue = false)] + [JsonPropertyName("Addr")] public string Addr { get; set; } } } diff --git a/src/Docker.DotNet/Models/ManifestSummary.Generated.cs b/src/Docker.DotNet/Models/ManifestSummary.Generated.cs index 125aa6ebf..dfca9ed11 100644 --- a/src/Docker.DotNet/Models/ManifestSummary.Generated.cs +++ b/src/Docker.DotNet/Models/ManifestSummary.Generated.cs @@ -1,26 +1,25 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ManifestSummary // (image.ManifestSummary) { - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Descriptor", EmitDefaultValue = false)] + [JsonPropertyName("Descriptor")] public Descriptor Descriptor { get; set; } - [DataMember(Name = "Available", EmitDefaultValue = false)] + [JsonPropertyName("Available")] public bool Available { get; set; } - [DataMember(Name = "Kind", EmitDefaultValue = false)] + [JsonPropertyName("Kind")] public string Kind { get; set; } - [DataMember(Name = "ImageData", EmitDefaultValue = false)] + [JsonPropertyName("ImageData")] public ImageProperties ImageData { get; set; } - [DataMember(Name = "AttestationData", EmitDefaultValue = false)] + [JsonPropertyName("AttestationData")] public AttestationProperties AttestationData { get; set; } } } diff --git a/src/Docker.DotNet/Models/MemoryStats.Generated.cs b/src/Docker.DotNet/Models/MemoryStats.Generated.cs index 84f25c1b9..308e99a26 100644 --- a/src/Docker.DotNet/Models/MemoryStats.Generated.cs +++ b/src/Docker.DotNet/Models/MemoryStats.Generated.cs @@ -1,33 +1,32 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class MemoryStats // (container.MemoryStats) { - [DataMember(Name = "usage", EmitDefaultValue = false)] + [JsonPropertyName("usage")] public ulong Usage { get; set; } - [DataMember(Name = "max_usage", EmitDefaultValue = false)] + [JsonPropertyName("max_usage")] public ulong MaxUsage { get; set; } - [DataMember(Name = "stats", EmitDefaultValue = false)] + [JsonPropertyName("stats")] public IDictionary Stats { get; set; } - [DataMember(Name = "failcnt", EmitDefaultValue = false)] + [JsonPropertyName("failcnt")] public ulong Failcnt { get; set; } - [DataMember(Name = "limit", EmitDefaultValue = false)] + [JsonPropertyName("limit")] public ulong Limit { get; set; } - [DataMember(Name = "commitbytes", EmitDefaultValue = false)] + [JsonPropertyName("commitbytes")] public ulong Commit { get; set; } - [DataMember(Name = "commitpeakbytes", EmitDefaultValue = false)] + [JsonPropertyName("commitpeakbytes")] public ulong CommitPeak { get; set; } - [DataMember(Name = "privateworkingset", EmitDefaultValue = false)] + [JsonPropertyName("privateworkingset")] public ulong PrivateWorkingSet { get; set; } } } diff --git a/src/Docker.DotNet/Models/Message.Generated.cs b/src/Docker.DotNet/Models/Message.Generated.cs index 6514c21c7..136c69664 100644 --- a/src/Docker.DotNet/Models/Message.Generated.cs +++ b/src/Docker.DotNet/Models/Message.Generated.cs @@ -1,35 +1,34 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Message // (events.Message) { - [DataMember(Name = "status", EmitDefaultValue = false)] + [JsonPropertyName("status")] public string Status { get; set; } - [DataMember(Name = "id", EmitDefaultValue = false)] + [JsonPropertyName("id")] public string ID { get; set; } - [DataMember(Name = "from", EmitDefaultValue = false)] + [JsonPropertyName("from")] public string From { get; set; } - [DataMember(Name = "Type", EmitDefaultValue = false)] + [JsonPropertyName("Type")] public string Type { get; set; } - [DataMember(Name = "Action", EmitDefaultValue = false)] + [JsonPropertyName("Action")] public string Action { get; set; } - [DataMember(Name = "Actor", EmitDefaultValue = false)] + [JsonPropertyName("Actor")] public Actor Actor { get; set; } - [DataMember(Name = "scope", EmitDefaultValue = false)] + [JsonPropertyName("scope")] public string Scope { get; set; } - [DataMember(Name = "time", EmitDefaultValue = false)] + [JsonPropertyName("time")] public long Time { get; set; } - [DataMember(Name = "timeNano", EmitDefaultValue = false)] + [JsonPropertyName("timeNano")] public long TimeNano { get; set; } } } diff --git a/src/Docker.DotNet/Models/Meta.Generated.cs b/src/Docker.DotNet/Models/Meta.Generated.cs index 1c20a885a..11b9e8680 100644 --- a/src/Docker.DotNet/Models/Meta.Generated.cs +++ b/src/Docker.DotNet/Models/Meta.Generated.cs @@ -1,18 +1,17 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Meta // (swarm.Meta) { - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public Version Version { get; set; } - [DataMember(Name = "CreatedAt", EmitDefaultValue = false)] + [JsonPropertyName("CreatedAt")] public DateTime CreatedAt { get; set; } - [DataMember(Name = "UpdatedAt", EmitDefaultValue = false)] + [JsonPropertyName("UpdatedAt")] public DateTime UpdatedAt { get; set; } } } diff --git a/src/Docker.DotNet/Models/Metadata.Generated.cs b/src/Docker.DotNet/Models/Metadata.Generated.cs index d63ef39e1..01cb5f9e7 100644 --- a/src/Docker.DotNet/Models/Metadata.Generated.cs +++ b/src/Docker.DotNet/Models/Metadata.Generated.cs @@ -1,12 +1,11 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Metadata // (image.Metadata) { - [DataMember(Name = "LastTagTime", EmitDefaultValue = false)] + [JsonPropertyName("LastTagTime")] public DateTime LastTagTime { get; set; } } } diff --git a/src/Docker.DotNet/Models/Mount.Generated.cs b/src/Docker.DotNet/Models/Mount.Generated.cs index 659e76bf2..bb654eea8 100644 --- a/src/Docker.DotNet/Models/Mount.Generated.cs +++ b/src/Docker.DotNet/Models/Mount.Generated.cs @@ -1,35 +1,34 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Mount // (mount.Mount) { - [DataMember(Name = "Type", EmitDefaultValue = false)] + [JsonPropertyName("Type")] public string Type { get; set; } - [DataMember(Name = "Source", EmitDefaultValue = false)] + [JsonPropertyName("Source")] public string Source { get; set; } - [DataMember(Name = "Target", EmitDefaultValue = false)] + [JsonPropertyName("Target")] public string Target { get; set; } - [DataMember(Name = "ReadOnly", EmitDefaultValue = false)] + [JsonPropertyName("ReadOnly")] public bool ReadOnly { get; set; } - [DataMember(Name = "Consistency", EmitDefaultValue = false)] + [JsonPropertyName("Consistency")] public string Consistency { get; set; } - [DataMember(Name = "BindOptions", EmitDefaultValue = false)] + [JsonPropertyName("BindOptions")] public BindOptions BindOptions { get; set; } - [DataMember(Name = "VolumeOptions", EmitDefaultValue = false)] + [JsonPropertyName("VolumeOptions")] public VolumeOptions VolumeOptions { get; set; } - [DataMember(Name = "TmpfsOptions", EmitDefaultValue = false)] + [JsonPropertyName("TmpfsOptions")] public TmpfsOptions TmpfsOptions { get; set; } - [DataMember(Name = "ClusterOptions", EmitDefaultValue = false)] + [JsonPropertyName("ClusterOptions")] public ClusterOptions ClusterOptions { get; set; } } } diff --git a/src/Docker.DotNet/Models/MountPoint.Generated.cs b/src/Docker.DotNet/Models/MountPoint.Generated.cs index 6ac3c36a8..f349b9b37 100644 --- a/src/Docker.DotNet/Models/MountPoint.Generated.cs +++ b/src/Docker.DotNet/Models/MountPoint.Generated.cs @@ -1,32 +1,31 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class MountPoint // (types.MountPoint) { - [DataMember(Name = "Type", EmitDefaultValue = false)] + [JsonPropertyName("Type")] public string Type { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Source", EmitDefaultValue = false)] + [JsonPropertyName("Source")] public string Source { get; set; } - [DataMember(Name = "Destination", EmitDefaultValue = false)] + [JsonPropertyName("Destination")] public string Destination { get; set; } - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public string Driver { get; set; } - [DataMember(Name = "Mode", EmitDefaultValue = false)] + [JsonPropertyName("Mode")] public string Mode { get; set; } - [DataMember(Name = "RW", EmitDefaultValue = false)] + [JsonPropertyName("RW")] public bool RW { get; set; } - [DataMember(Name = "Propagation", EmitDefaultValue = false)] + [JsonPropertyName("Propagation")] public string Propagation { get; set; } } } diff --git a/src/Docker.DotNet/Models/NamedGenericResource.Generated.cs b/src/Docker.DotNet/Models/NamedGenericResource.Generated.cs index 1d4e5a91b..6321e84bb 100644 --- a/src/Docker.DotNet/Models/NamedGenericResource.Generated.cs +++ b/src/Docker.DotNet/Models/NamedGenericResource.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NamedGenericResource // (swarm.NamedGenericResource) { - [DataMember(Name = "Kind", EmitDefaultValue = false)] + [JsonPropertyName("Kind")] public string Kind { get; set; } - [DataMember(Name = "Value", EmitDefaultValue = false)] + [JsonPropertyName("Value")] public string Value { get; set; } } } diff --git a/src/Docker.DotNet/Models/Network.Generated.cs b/src/Docker.DotNet/Models/Network.Generated.cs index c00e35b4e..db9e3be3c 100644 --- a/src/Docker.DotNet/Models/Network.Generated.cs +++ b/src/Docker.DotNet/Models/Network.Generated.cs @@ -1,9 +1,8 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Network // (swarm.Network) { public Network() @@ -20,25 +19,25 @@ public Network(Meta Meta) } } - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public Version Version { get; set; } - [DataMember(Name = "CreatedAt", EmitDefaultValue = false)] + [JsonPropertyName("CreatedAt")] public DateTime CreatedAt { get; set; } - [DataMember(Name = "UpdatedAt", EmitDefaultValue = false)] + [JsonPropertyName("UpdatedAt")] public DateTime UpdatedAt { get; set; } - [DataMember(Name = "Spec", EmitDefaultValue = false)] + [JsonPropertyName("Spec")] public NetworkSpec Spec { get; set; } - [DataMember(Name = "DriverState", EmitDefaultValue = false)] + [JsonPropertyName("DriverState")] public SwarmDriver DriverState { get; set; } - [DataMember(Name = "IPAMOptions", EmitDefaultValue = false)] + [JsonPropertyName("IPAMOptions")] public IPAMOptions IPAMOptions { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkAddressPool.Generated.cs b/src/Docker.DotNet/Models/NetworkAddressPool.Generated.cs index 33a96a5a2..ecea08dd8 100644 --- a/src/Docker.DotNet/Models/NetworkAddressPool.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkAddressPool.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkAddressPool // (system.NetworkAddressPool) { - [DataMember(Name = "Base", EmitDefaultValue = false)] + [JsonPropertyName("Base")] public string Base { get; set; } - [DataMember(Name = "Size", EmitDefaultValue = false)] + [JsonPropertyName("Size")] public long Size { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkAttachment.Generated.cs b/src/Docker.DotNet/Models/NetworkAttachment.Generated.cs index 2581022bc..5e1df4854 100644 --- a/src/Docker.DotNet/Models/NetworkAttachment.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkAttachment.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkAttachment // (swarm.NetworkAttachment) { - [DataMember(Name = "Network", EmitDefaultValue = false)] + [JsonPropertyName("Network")] public Network Network { get; set; } - [DataMember(Name = "Addresses", EmitDefaultValue = false)] + [JsonPropertyName("Addresses")] public IList Addresses { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkAttachmentConfig.Generated.cs b/src/Docker.DotNet/Models/NetworkAttachmentConfig.Generated.cs index 2856926b2..0b4475e93 100644 --- a/src/Docker.DotNet/Models/NetworkAttachmentConfig.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkAttachmentConfig.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkAttachmentConfig // (swarm.NetworkAttachmentConfig) { - [DataMember(Name = "Target", EmitDefaultValue = false)] + [JsonPropertyName("Target")] public string Target { get; set; } - [DataMember(Name = "Aliases", EmitDefaultValue = false)] + [JsonPropertyName("Aliases")] public IList Aliases { get; set; } - [DataMember(Name = "DriverOpts", EmitDefaultValue = false)] + [JsonPropertyName("DriverOpts")] public IDictionary DriverOpts { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkAttachmentSpec.Generated.cs b/src/Docker.DotNet/Models/NetworkAttachmentSpec.Generated.cs index 4c4ccf241..f624dc543 100644 --- a/src/Docker.DotNet/Models/NetworkAttachmentSpec.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkAttachmentSpec.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkAttachmentSpec // (swarm.NetworkAttachmentSpec) { - [DataMember(Name = "ContainerID", EmitDefaultValue = false)] + [JsonPropertyName("ContainerID")] public string ContainerID { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkConnectParameters.Generated.cs b/src/Docker.DotNet/Models/NetworkConnectParameters.Generated.cs index f8f0041cc..29277b6ac 100644 --- a/src/Docker.DotNet/Models/NetworkConnectParameters.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkConnectParameters.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkConnectParameters // (network.ConnectOptions) { - [DataMember(Name = "Container", EmitDefaultValue = false)] + [JsonPropertyName("Container")] public string Container { get; set; } - [DataMember(Name = "EndpointConfig", EmitDefaultValue = false)] + [JsonPropertyName("EndpointConfig")] public EndpointSettings EndpointConfig { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkDisconnectParameters.Generated.cs b/src/Docker.DotNet/Models/NetworkDisconnectParameters.Generated.cs index 8073904ec..b484c7d28 100644 --- a/src/Docker.DotNet/Models/NetworkDisconnectParameters.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkDisconnectParameters.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkDisconnectParameters // (network.DisconnectOptions) { - [DataMember(Name = "Container", EmitDefaultValue = false)] + [JsonPropertyName("Container")] public string Container { get; set; } - [DataMember(Name = "Force", EmitDefaultValue = false)] + [JsonPropertyName("Force")] public bool Force { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkResponse.Generated.cs b/src/Docker.DotNet/Models/NetworkResponse.Generated.cs index bf28b24ff..b61286cd6 100644 --- a/src/Docker.DotNet/Models/NetworkResponse.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkResponse.Generated.cs @@ -1,61 +1,60 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkResponse // (network.Inspect) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Id", EmitDefaultValue = false)] + [JsonPropertyName("Id")] public string ID { get; set; } - [DataMember(Name = "Created", EmitDefaultValue = false)] + [JsonPropertyName("Created")] public DateTime Created { get; set; } - [DataMember(Name = "Scope", EmitDefaultValue = false)] + [JsonPropertyName("Scope")] public string Scope { get; set; } - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public string Driver { get; set; } - [DataMember(Name = "EnableIPv6", EmitDefaultValue = false)] + [JsonPropertyName("EnableIPv6")] public bool EnableIPv6 { get; set; } - [DataMember(Name = "IPAM", EmitDefaultValue = false)] + [JsonPropertyName("IPAM")] public IPAM IPAM { get; set; } - [DataMember(Name = "Internal", EmitDefaultValue = false)] + [JsonPropertyName("Internal")] public bool Internal { get; set; } - [DataMember(Name = "Attachable", EmitDefaultValue = false)] + [JsonPropertyName("Attachable")] public bool Attachable { get; set; } - [DataMember(Name = "Ingress", EmitDefaultValue = false)] + [JsonPropertyName("Ingress")] public bool Ingress { get; set; } - [DataMember(Name = "ConfigFrom", EmitDefaultValue = false)] + [JsonPropertyName("ConfigFrom")] public ConfigReference ConfigFrom { get; set; } - [DataMember(Name = "ConfigOnly", EmitDefaultValue = false)] + [JsonPropertyName("ConfigOnly")] public bool ConfigOnly { get; set; } - [DataMember(Name = "Containers", EmitDefaultValue = false)] + [JsonPropertyName("Containers")] public IDictionary Containers { get; set; } - [DataMember(Name = "Options", EmitDefaultValue = false)] + [JsonPropertyName("Options")] public IDictionary Options { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "Peers", EmitDefaultValue = false)] + [JsonPropertyName("Peers")] public IList Peers { get; set; } - [DataMember(Name = "Services", EmitDefaultValue = false)] + [JsonPropertyName("Services")] public IDictionary Services { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkSettings.Generated.cs b/src/Docker.DotNet/Models/NetworkSettings.Generated.cs index e10577b75..c8104dcaa 100644 --- a/src/Docker.DotNet/Models/NetworkSettings.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkSettings.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkSettings // (types.NetworkSettings) { public NetworkSettings() @@ -38,58 +37,58 @@ public NetworkSettings(NetworkSettingsBase NetworkSettingsBase, DefaultNetworkSe } } - [DataMember(Name = "Bridge", EmitDefaultValue = false)] + [JsonPropertyName("Bridge")] public string Bridge { get; set; } - [DataMember(Name = "SandboxID", EmitDefaultValue = false)] + [JsonPropertyName("SandboxID")] public string SandboxID { get; set; } - [DataMember(Name = "SandboxKey", EmitDefaultValue = false)] + [JsonPropertyName("SandboxKey")] public string SandboxKey { get; set; } - [DataMember(Name = "Ports", EmitDefaultValue = false)] + [JsonPropertyName("Ports")] public IDictionary> Ports { get; set; } - [DataMember(Name = "HairpinMode", EmitDefaultValue = false)] + [JsonPropertyName("HairpinMode")] public bool HairpinMode { get; set; } - [DataMember(Name = "LinkLocalIPv6Address", EmitDefaultValue = false)] + [JsonPropertyName("LinkLocalIPv6Address")] public string LinkLocalIPv6Address { get; set; } - [DataMember(Name = "LinkLocalIPv6PrefixLen", EmitDefaultValue = false)] + [JsonPropertyName("LinkLocalIPv6PrefixLen")] public long LinkLocalIPv6PrefixLen { get; set; } - [DataMember(Name = "SecondaryIPAddresses", EmitDefaultValue = false)] + [JsonPropertyName("SecondaryIPAddresses")] public IList
SecondaryIPAddresses { get; set; } - [DataMember(Name = "SecondaryIPv6Addresses", EmitDefaultValue = false)] + [JsonPropertyName("SecondaryIPv6Addresses")] public IList
SecondaryIPv6Addresses { get; set; } - [DataMember(Name = "EndpointID", EmitDefaultValue = false)] + [JsonPropertyName("EndpointID")] public string EndpointID { get; set; } - [DataMember(Name = "Gateway", EmitDefaultValue = false)] + [JsonPropertyName("Gateway")] public string Gateway { get; set; } - [DataMember(Name = "GlobalIPv6Address", EmitDefaultValue = false)] + [JsonPropertyName("GlobalIPv6Address")] public string GlobalIPv6Address { get; set; } - [DataMember(Name = "GlobalIPv6PrefixLen", EmitDefaultValue = false)] + [JsonPropertyName("GlobalIPv6PrefixLen")] public long GlobalIPv6PrefixLen { get; set; } - [DataMember(Name = "IPAddress", EmitDefaultValue = false)] + [JsonPropertyName("IPAddress")] public string IPAddress { get; set; } - [DataMember(Name = "IPPrefixLen", EmitDefaultValue = false)] + [JsonPropertyName("IPPrefixLen")] public long IPPrefixLen { get; set; } - [DataMember(Name = "IPv6Gateway", EmitDefaultValue = false)] + [JsonPropertyName("IPv6Gateway")] public string IPv6Gateway { get; set; } - [DataMember(Name = "MacAddress", EmitDefaultValue = false)] + [JsonPropertyName("MacAddress")] public string MacAddress { get; set; } - [DataMember(Name = "Networks", EmitDefaultValue = false)] + [JsonPropertyName("Networks")] public IDictionary Networks { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkSettingsBase.Generated.cs b/src/Docker.DotNet/Models/NetworkSettingsBase.Generated.cs index 20b9b4c0f..1c2445786 100644 --- a/src/Docker.DotNet/Models/NetworkSettingsBase.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkSettingsBase.Generated.cs @@ -1,36 +1,35 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkSettingsBase // (types.NetworkSettingsBase) { - [DataMember(Name = "Bridge", EmitDefaultValue = false)] + [JsonPropertyName("Bridge")] public string Bridge { get; set; } - [DataMember(Name = "SandboxID", EmitDefaultValue = false)] + [JsonPropertyName("SandboxID")] public string SandboxID { get; set; } - [DataMember(Name = "SandboxKey", EmitDefaultValue = false)] + [JsonPropertyName("SandboxKey")] public string SandboxKey { get; set; } - [DataMember(Name = "Ports", EmitDefaultValue = false)] + [JsonPropertyName("Ports")] public IDictionary> Ports { get; set; } - [DataMember(Name = "HairpinMode", EmitDefaultValue = false)] + [JsonPropertyName("HairpinMode")] public bool HairpinMode { get; set; } - [DataMember(Name = "LinkLocalIPv6Address", EmitDefaultValue = false)] + [JsonPropertyName("LinkLocalIPv6Address")] public string LinkLocalIPv6Address { get; set; } - [DataMember(Name = "LinkLocalIPv6PrefixLen", EmitDefaultValue = false)] + [JsonPropertyName("LinkLocalIPv6PrefixLen")] public long LinkLocalIPv6PrefixLen { get; set; } - [DataMember(Name = "SecondaryIPAddresses", EmitDefaultValue = false)] + [JsonPropertyName("SecondaryIPAddresses")] public IList
SecondaryIPAddresses { get; set; } - [DataMember(Name = "SecondaryIPv6Addresses", EmitDefaultValue = false)] + [JsonPropertyName("SecondaryIPv6Addresses")] public IList
SecondaryIPv6Addresses { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkSpec.Generated.cs b/src/Docker.DotNet/Models/NetworkSpec.Generated.cs index 5711890be..0590c92af 100644 --- a/src/Docker.DotNet/Models/NetworkSpec.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkSpec.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkSpec // (swarm.NetworkSpec) { public NetworkSpec() @@ -19,34 +18,34 @@ public NetworkSpec(Annotations Annotations) } } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "DriverConfiguration", EmitDefaultValue = false)] + [JsonPropertyName("DriverConfiguration")] public SwarmDriver DriverConfiguration { get; set; } - [DataMember(Name = "IPv6Enabled", EmitDefaultValue = false)] + [JsonPropertyName("IPv6Enabled")] public bool IPv6Enabled { get; set; } - [DataMember(Name = "Internal", EmitDefaultValue = false)] + [JsonPropertyName("Internal")] public bool Internal { get; set; } - [DataMember(Name = "Attachable", EmitDefaultValue = false)] + [JsonPropertyName("Attachable")] public bool Attachable { get; set; } - [DataMember(Name = "Ingress", EmitDefaultValue = false)] + [JsonPropertyName("Ingress")] public bool Ingress { get; set; } - [DataMember(Name = "IPAMOptions", EmitDefaultValue = false)] + [JsonPropertyName("IPAMOptions")] public IPAMOptions IPAMOptions { get; set; } - [DataMember(Name = "ConfigFrom", EmitDefaultValue = false)] + [JsonPropertyName("ConfigFrom")] public ConfigReference ConfigFrom { get; set; } - [DataMember(Name = "Scope", EmitDefaultValue = false)] + [JsonPropertyName("Scope")] public string Scope { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkStats.Generated.cs b/src/Docker.DotNet/Models/NetworkStats.Generated.cs index d442b822d..c3a0e44e2 100644 --- a/src/Docker.DotNet/Models/NetworkStats.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkStats.Generated.cs @@ -1,38 +1,37 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkStats // (container.NetworkStats) { - [DataMember(Name = "rx_bytes", EmitDefaultValue = false)] + [JsonPropertyName("rx_bytes")] public ulong RxBytes { get; set; } - [DataMember(Name = "rx_packets", EmitDefaultValue = false)] + [JsonPropertyName("rx_packets")] public ulong RxPackets { get; set; } - [DataMember(Name = "rx_errors", EmitDefaultValue = false)] + [JsonPropertyName("rx_errors")] public ulong RxErrors { get; set; } - [DataMember(Name = "rx_dropped", EmitDefaultValue = false)] + [JsonPropertyName("rx_dropped")] public ulong RxDropped { get; set; } - [DataMember(Name = "tx_bytes", EmitDefaultValue = false)] + [JsonPropertyName("tx_bytes")] public ulong TxBytes { get; set; } - [DataMember(Name = "tx_packets", EmitDefaultValue = false)] + [JsonPropertyName("tx_packets")] public ulong TxPackets { get; set; } - [DataMember(Name = "tx_errors", EmitDefaultValue = false)] + [JsonPropertyName("tx_errors")] public ulong TxErrors { get; set; } - [DataMember(Name = "tx_dropped", EmitDefaultValue = false)] + [JsonPropertyName("tx_dropped")] public ulong TxDropped { get; set; } - [DataMember(Name = "endpoint_id", EmitDefaultValue = false)] + [JsonPropertyName("endpoint_id")] public string EndpointID { get; set; } - [DataMember(Name = "instance_id", EmitDefaultValue = false)] + [JsonPropertyName("instance_id")] public string InstanceID { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkTask.Generated.cs b/src/Docker.DotNet/Models/NetworkTask.Generated.cs index 1ca997a15..ccc6f24b9 100644 --- a/src/Docker.DotNet/Models/NetworkTask.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkTask.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkTask // (network.Task) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "EndpointID", EmitDefaultValue = false)] + [JsonPropertyName("EndpointID")] public string EndpointID { get; set; } - [DataMember(Name = "EndpointIP", EmitDefaultValue = false)] + [JsonPropertyName("EndpointIP")] public string EndpointIP { get; set; } - [DataMember(Name = "Info", EmitDefaultValue = false)] + [JsonPropertyName("Info")] public IDictionary Info { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworkingConfig.Generated.cs b/src/Docker.DotNet/Models/NetworkingConfig.Generated.cs index e132cd482..637152b77 100644 --- a/src/Docker.DotNet/Models/NetworkingConfig.Generated.cs +++ b/src/Docker.DotNet/Models/NetworkingConfig.Generated.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworkingConfig // (network.NetworkingConfig) { - [DataMember(Name = "EndpointsConfig", EmitDefaultValue = false)] + [JsonPropertyName("EndpointsConfig")] public IDictionary EndpointsConfig { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworksCreateParameters.Generated.cs b/src/Docker.DotNet/Models/NetworksCreateParameters.Generated.cs index 49c3f2ea1..f55b6e562 100644 --- a/src/Docker.DotNet/Models/NetworksCreateParameters.Generated.cs +++ b/src/Docker.DotNet/Models/NetworksCreateParameters.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworksCreateParameters // (network.CreateRequest) { public NetworksCreateParameters() @@ -28,43 +27,43 @@ public NetworksCreateParameters(CreateOptions CreateOptions) } } - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public string Driver { get; set; } - [DataMember(Name = "Scope", EmitDefaultValue = false)] + [JsonPropertyName("Scope")] public string Scope { get; set; } - [DataMember(Name = "EnableIPv6", EmitDefaultValue = false)] + [JsonPropertyName("EnableIPv6")] public bool? EnableIPv6 { get; set; } - [DataMember(Name = "IPAM", EmitDefaultValue = false)] + [JsonPropertyName("IPAM")] public IPAM IPAM { get; set; } - [DataMember(Name = "Internal", EmitDefaultValue = false)] + [JsonPropertyName("Internal")] public bool Internal { get; set; } - [DataMember(Name = "Attachable", EmitDefaultValue = false)] + [JsonPropertyName("Attachable")] public bool Attachable { get; set; } - [DataMember(Name = "Ingress", EmitDefaultValue = false)] + [JsonPropertyName("Ingress")] public bool Ingress { get; set; } - [DataMember(Name = "ConfigOnly", EmitDefaultValue = false)] + [JsonPropertyName("ConfigOnly")] public bool ConfigOnly { get; set; } - [DataMember(Name = "ConfigFrom", EmitDefaultValue = false)] + [JsonPropertyName("ConfigFrom")] public ConfigReference ConfigFrom { get; set; } - [DataMember(Name = "Options", EmitDefaultValue = false)] + [JsonPropertyName("Options")] public IDictionary Options { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "CheckDuplicate", EmitDefaultValue = false)] + [JsonPropertyName("CheckDuplicate")] public bool? CheckDuplicate { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworksCreateResponse.Generated.cs b/src/Docker.DotNet/Models/NetworksCreateResponse.Generated.cs index 5b052edde..e8ae28410 100644 --- a/src/Docker.DotNet/Models/NetworksCreateResponse.Generated.cs +++ b/src/Docker.DotNet/Models/NetworksCreateResponse.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworksCreateResponse // (network.CreateResponse) { - [DataMember(Name = "Id", EmitDefaultValue = false)] + [JsonPropertyName("Id")] public string ID { get; set; } - [DataMember(Name = "Warning", EmitDefaultValue = false)] + [JsonPropertyName("Warning")] public string Warning { get; set; } } } diff --git a/src/Docker.DotNet/Models/NetworksDeleteUnusedParameters.Generated.cs b/src/Docker.DotNet/Models/NetworksDeleteUnusedParameters.Generated.cs index 5af47b3a4..b52c14700 100644 --- a/src/Docker.DotNet/Models/NetworksDeleteUnusedParameters.Generated.cs +++ b/src/Docker.DotNet/Models/NetworksDeleteUnusedParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworksDeleteUnusedParameters // (main.NetworksDeleteUnusedParameters) { [QueryStringParameter("filters", false, typeof(MapQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/NetworksListParameters.Generated.cs b/src/Docker.DotNet/Models/NetworksListParameters.Generated.cs index 0a0737b72..3ba3b47ba 100644 --- a/src/Docker.DotNet/Models/NetworksListParameters.Generated.cs +++ b/src/Docker.DotNet/Models/NetworksListParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworksListParameters // (main.NetworksListParameters) { [QueryStringParameter("filters", false, typeof(MapQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/NetworksPruneResponse.Generated.cs b/src/Docker.DotNet/Models/NetworksPruneResponse.Generated.cs index d8350d12b..4671ba058 100644 --- a/src/Docker.DotNet/Models/NetworksPruneResponse.Generated.cs +++ b/src/Docker.DotNet/Models/NetworksPruneResponse.Generated.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NetworksPruneResponse // (network.PruneReport) { - [DataMember(Name = "NetworksDeleted", EmitDefaultValue = false)] + [JsonPropertyName("NetworksDeleted")] public IList NetworksDeleted { get; set; } } } diff --git a/src/Docker.DotNet/Models/NodeCSIInfo.Generated.cs b/src/Docker.DotNet/Models/NodeCSIInfo.Generated.cs index bf6e997f8..f4264eefe 100644 --- a/src/Docker.DotNet/Models/NodeCSIInfo.Generated.cs +++ b/src/Docker.DotNet/Models/NodeCSIInfo.Generated.cs @@ -1,20 +1,19 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NodeCSIInfo // (swarm.NodeCSIInfo) { - [DataMember(Name = "PluginName", EmitDefaultValue = false)] + [JsonPropertyName("PluginName")] public string PluginName { get; set; } - [DataMember(Name = "NodeID", EmitDefaultValue = false)] + [JsonPropertyName("NodeID")] public string NodeID { get; set; } - [DataMember(Name = "MaxVolumesPerNode", EmitDefaultValue = false)] + [JsonPropertyName("MaxVolumesPerNode")] public long MaxVolumesPerNode { get; set; } - [DataMember(Name = "AccessibleTopology", EmitDefaultValue = false)] + [JsonPropertyName("AccessibleTopology")] public Topology AccessibleTopology { get; set; } } } diff --git a/src/Docker.DotNet/Models/NodeDescription.Generated.cs b/src/Docker.DotNet/Models/NodeDescription.Generated.cs index 360d6165d..db12496b0 100644 --- a/src/Docker.DotNet/Models/NodeDescription.Generated.cs +++ b/src/Docker.DotNet/Models/NodeDescription.Generated.cs @@ -1,27 +1,26 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NodeDescription // (swarm.NodeDescription) { - [DataMember(Name = "Hostname", EmitDefaultValue = false)] + [JsonPropertyName("Hostname")] public string Hostname { get; set; } - [DataMember(Name = "Platform", EmitDefaultValue = false)] + [JsonPropertyName("Platform")] public SwarmPlatform Platform { get; set; } - [DataMember(Name = "Resources", EmitDefaultValue = false)] + [JsonPropertyName("Resources")] public SwarmResources Resources { get; set; } - [DataMember(Name = "Engine", EmitDefaultValue = false)] + [JsonPropertyName("Engine")] public EngineDescription Engine { get; set; } - [DataMember(Name = "TLSInfo", EmitDefaultValue = false)] + [JsonPropertyName("TLSInfo")] public TLSInfo TLSInfo { get; set; } - [DataMember(Name = "CSIInfo", EmitDefaultValue = false)] + [JsonPropertyName("CSIInfo")] public IList CSIInfo { get; set; } } } diff --git a/src/Docker.DotNet/Models/NodeListResponse.Generated.cs b/src/Docker.DotNet/Models/NodeListResponse.Generated.cs index fe52f92b0..5f5a5fb18 100644 --- a/src/Docker.DotNet/Models/NodeListResponse.Generated.cs +++ b/src/Docker.DotNet/Models/NodeListResponse.Generated.cs @@ -1,9 +1,8 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NodeListResponse // (swarm.Node) { public NodeListResponse() @@ -20,28 +19,28 @@ public NodeListResponse(Meta Meta) } } - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public Version Version { get; set; } - [DataMember(Name = "CreatedAt", EmitDefaultValue = false)] + [JsonPropertyName("CreatedAt")] public DateTime CreatedAt { get; set; } - [DataMember(Name = "UpdatedAt", EmitDefaultValue = false)] + [JsonPropertyName("UpdatedAt")] public DateTime UpdatedAt { get; set; } - [DataMember(Name = "Spec", EmitDefaultValue = false)] + [JsonPropertyName("Spec")] public NodeUpdateParameters Spec { get; set; } - [DataMember(Name = "Description", EmitDefaultValue = false)] + [JsonPropertyName("Description")] public NodeDescription Description { get; set; } - [DataMember(Name = "Status", EmitDefaultValue = false)] + [JsonPropertyName("Status")] public NodeStatus Status { get; set; } - [DataMember(Name = "ManagerStatus", EmitDefaultValue = false)] + [JsonPropertyName("ManagerStatus")] public ManagerStatus ManagerStatus { get; set; } } } diff --git a/src/Docker.DotNet/Models/NodeRemoveParameters.Generated.cs b/src/Docker.DotNet/Models/NodeRemoveParameters.Generated.cs index ef50331d4..6dd6dca0b 100644 --- a/src/Docker.DotNet/Models/NodeRemoveParameters.Generated.cs +++ b/src/Docker.DotNet/Models/NodeRemoveParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NodeRemoveParameters // (main.NodeRemoveParameters) { [QueryStringParameter("force", false, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/NodeStatus.Generated.cs b/src/Docker.DotNet/Models/NodeStatus.Generated.cs index d51ab7f29..190d9b229 100644 --- a/src/Docker.DotNet/Models/NodeStatus.Generated.cs +++ b/src/Docker.DotNet/Models/NodeStatus.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NodeStatus // (swarm.NodeStatus) { - [DataMember(Name = "State", EmitDefaultValue = false)] + [JsonPropertyName("State")] public string State { get; set; } - [DataMember(Name = "Message", EmitDefaultValue = false)] + [JsonPropertyName("Message")] public string Message { get; set; } - [DataMember(Name = "Addr", EmitDefaultValue = false)] + [JsonPropertyName("Addr")] public string Addr { get; set; } } } diff --git a/src/Docker.DotNet/Models/NodeUpdateParameters.Generated.cs b/src/Docker.DotNet/Models/NodeUpdateParameters.Generated.cs index 2d976af01..8489361b8 100644 --- a/src/Docker.DotNet/Models/NodeUpdateParameters.Generated.cs +++ b/src/Docker.DotNet/Models/NodeUpdateParameters.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class NodeUpdateParameters // (swarm.NodeSpec) { public NodeUpdateParameters() @@ -19,16 +18,16 @@ public NodeUpdateParameters(Annotations Annotations) } } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "Role", EmitDefaultValue = false)] + [JsonPropertyName("Role")] public string Role { get; set; } - [DataMember(Name = "Availability", EmitDefaultValue = false)] + [JsonPropertyName("Availability")] public string Availability { get; set; } } } diff --git a/src/Docker.DotNet/Models/ObjectExtensionData.cs b/src/Docker.DotNet/Models/ObjectExtensionData.cs index 2dd6a8f30..3807e0de6 100644 --- a/src/Docker.DotNet/Models/ObjectExtensionData.cs +++ b/src/Docker.DotNet/Models/ObjectExtensionData.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using Newtonsoft.Json; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { diff --git a/src/Docker.DotNet/Models/OrchestrationConfig.Generated.cs b/src/Docker.DotNet/Models/OrchestrationConfig.Generated.cs index b02ba193f..005eb3cdb 100644 --- a/src/Docker.DotNet/Models/OrchestrationConfig.Generated.cs +++ b/src/Docker.DotNet/Models/OrchestrationConfig.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class OrchestrationConfig // (swarm.OrchestrationConfig) { - [DataMember(Name = "TaskHistoryRetentionLimit", EmitDefaultValue = false)] + [JsonPropertyName("TaskHistoryRetentionLimit")] public long? TaskHistoryRetentionLimit { get; set; } } } diff --git a/src/Docker.DotNet/Models/Peer.Generated.cs b/src/Docker.DotNet/Models/Peer.Generated.cs index a00cd9844..0782d1302 100644 --- a/src/Docker.DotNet/Models/Peer.Generated.cs +++ b/src/Docker.DotNet/Models/Peer.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Peer // (swarm.Peer) { - [DataMember(Name = "NodeID", EmitDefaultValue = false)] + [JsonPropertyName("NodeID")] public string NodeID { get; set; } - [DataMember(Name = "Addr", EmitDefaultValue = false)] + [JsonPropertyName("Addr")] public string Addr { get; set; } } } diff --git a/src/Docker.DotNet/Models/PeerInfo.Generated.cs b/src/Docker.DotNet/Models/PeerInfo.Generated.cs index 877785d99..67ee46df3 100644 --- a/src/Docker.DotNet/Models/PeerInfo.Generated.cs +++ b/src/Docker.DotNet/Models/PeerInfo.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PeerInfo // (network.PeerInfo) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "IP", EmitDefaultValue = false)] + [JsonPropertyName("IP")] public string IP { get; set; } } } diff --git a/src/Docker.DotNet/Models/PidsStats.Generated.cs b/src/Docker.DotNet/Models/PidsStats.Generated.cs index ffe46e1fa..a38a8099e 100644 --- a/src/Docker.DotNet/Models/PidsStats.Generated.cs +++ b/src/Docker.DotNet/Models/PidsStats.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PidsStats // (container.PidsStats) { - [DataMember(Name = "current", EmitDefaultValue = false)] + [JsonPropertyName("current")] public ulong Current { get; set; } - [DataMember(Name = "limit", EmitDefaultValue = false)] + [JsonPropertyName("limit")] public ulong Limit { get; set; } } } diff --git a/src/Docker.DotNet/Models/Placement.Generated.cs b/src/Docker.DotNet/Models/Placement.Generated.cs index 767ccd049..3d4de170a 100644 --- a/src/Docker.DotNet/Models/Placement.Generated.cs +++ b/src/Docker.DotNet/Models/Placement.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Placement // (swarm.Placement) { - [DataMember(Name = "Constraints", EmitDefaultValue = false)] + [JsonPropertyName("Constraints")] public IList Constraints { get; set; } - [DataMember(Name = "Preferences", EmitDefaultValue = false)] + [JsonPropertyName("Preferences")] public IList Preferences { get; set; } - [DataMember(Name = "MaxReplicas", EmitDefaultValue = false)] + [JsonPropertyName("MaxReplicas")] public ulong MaxReplicas { get; set; } - [DataMember(Name = "Platforms", EmitDefaultValue = false)] + [JsonPropertyName("Platforms")] public IList Platforms { get; set; } } } diff --git a/src/Docker.DotNet/Models/PlacementPreference.Generated.cs b/src/Docker.DotNet/Models/PlacementPreference.Generated.cs index f59e30e8b..df7c3fc0f 100644 --- a/src/Docker.DotNet/Models/PlacementPreference.Generated.cs +++ b/src/Docker.DotNet/Models/PlacementPreference.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PlacementPreference // (swarm.PlacementPreference) { - [DataMember(Name = "Spread", EmitDefaultValue = false)] + [JsonPropertyName("Spread")] public SpreadOver Spread { get; set; } } } diff --git a/src/Docker.DotNet/Models/Platform.Generated.cs b/src/Docker.DotNet/Models/Platform.Generated.cs index f39ee39a7..3c2709c65 100644 --- a/src/Docker.DotNet/Models/Platform.Generated.cs +++ b/src/Docker.DotNet/Models/Platform.Generated.cs @@ -1,24 +1,23 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Platform // (v1.Platform) { - [DataMember(Name = "architecture", EmitDefaultValue = false)] + [JsonPropertyName("architecture")] public string Architecture { get; set; } - [DataMember(Name = "os", EmitDefaultValue = false)] + [JsonPropertyName("os")] public string OS { get; set; } - [DataMember(Name = "os.version", EmitDefaultValue = false)] + [JsonPropertyName("os.version")] public string OSVersion { get; set; } - [DataMember(Name = "os.features", EmitDefaultValue = false)] + [JsonPropertyName("os.features")] public IList OSFeatures { get; set; } - [DataMember(Name = "variant", EmitDefaultValue = false)] + [JsonPropertyName("variant")] public string Variant { get; set; } } } diff --git a/src/Docker.DotNet/Models/Plugin.Generated.cs b/src/Docker.DotNet/Models/Plugin.Generated.cs index fd4949b8b..b7fc8db59 100644 --- a/src/Docker.DotNet/Models/Plugin.Generated.cs +++ b/src/Docker.DotNet/Models/Plugin.Generated.cs @@ -1,26 +1,25 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Plugin // (types.Plugin) { - [DataMember(Name = "Config", EmitDefaultValue = false)] + [JsonPropertyName("Config")] public PluginConfig Config { get; set; } - [DataMember(Name = "Enabled", EmitDefaultValue = false)] + [JsonPropertyName("Enabled")] public bool Enabled { get; set; } - [DataMember(Name = "Id", EmitDefaultValue = false)] + [JsonPropertyName("Id")] public string ID { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "PluginReference", EmitDefaultValue = false)] + [JsonPropertyName("PluginReference")] public string PluginReference { get; set; } - [DataMember(Name = "Settings", EmitDefaultValue = false)] + [JsonPropertyName("Settings")] public PluginSettings Settings { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginConfig.Generated.cs b/src/Docker.DotNet/Models/PluginConfig.Generated.cs index 7c0142031..c34d4a686 100644 --- a/src/Docker.DotNet/Models/PluginConfig.Generated.cs +++ b/src/Docker.DotNet/Models/PluginConfig.Generated.cs @@ -1,57 +1,56 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginConfig // (types.PluginConfig) { - [DataMember(Name = "Args", EmitDefaultValue = false)] + [JsonPropertyName("Args")] public PluginConfigArgs Args { get; set; } - [DataMember(Name = "Description", EmitDefaultValue = false)] + [JsonPropertyName("Description")] public string Description { get; set; } - [DataMember(Name = "DockerVersion", EmitDefaultValue = false)] + [JsonPropertyName("DockerVersion")] public string DockerVersion { get; set; } - [DataMember(Name = "Documentation", EmitDefaultValue = false)] + [JsonPropertyName("Documentation")] public string Documentation { get; set; } - [DataMember(Name = "Entrypoint", EmitDefaultValue = false)] + [JsonPropertyName("Entrypoint")] public IList Entrypoint { get; set; } - [DataMember(Name = "Env", EmitDefaultValue = false)] + [JsonPropertyName("Env")] public IList Env { get; set; } - [DataMember(Name = "Interface", EmitDefaultValue = false)] + [JsonPropertyName("Interface")] public PluginConfigInterface Interface { get; set; } - [DataMember(Name = "IpcHost", EmitDefaultValue = false)] + [JsonPropertyName("IpcHost")] public bool IpcHost { get; set; } - [DataMember(Name = "Linux", EmitDefaultValue = false)] + [JsonPropertyName("Linux")] public PluginConfigLinux Linux { get; set; } - [DataMember(Name = "Mounts", EmitDefaultValue = false)] + [JsonPropertyName("Mounts")] public IList Mounts { get; set; } - [DataMember(Name = "Network", EmitDefaultValue = false)] + [JsonPropertyName("Network")] public PluginConfigNetwork Network { get; set; } - [DataMember(Name = "PidHost", EmitDefaultValue = false)] + [JsonPropertyName("PidHost")] public bool PidHost { get; set; } - [DataMember(Name = "PropagatedMount", EmitDefaultValue = false)] + [JsonPropertyName("PropagatedMount")] public string PropagatedMount { get; set; } - [DataMember(Name = "User", EmitDefaultValue = false)] + [JsonPropertyName("User")] public PluginConfigUser User { get; set; } - [DataMember(Name = "WorkDir", EmitDefaultValue = false)] + [JsonPropertyName("WorkDir")] public string WorkDir { get; set; } - [DataMember(Name = "rootfs", EmitDefaultValue = false)] + [JsonPropertyName("rootfs")] public PluginConfigRootfs Rootfs { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginConfigArgs.Generated.cs b/src/Docker.DotNet/Models/PluginConfigArgs.Generated.cs index f12bf17dc..57a976da8 100644 --- a/src/Docker.DotNet/Models/PluginConfigArgs.Generated.cs +++ b/src/Docker.DotNet/Models/PluginConfigArgs.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginConfigArgs // (types.PluginConfigArgs) { - [DataMember(Name = "Description", EmitDefaultValue = false)] + [JsonPropertyName("Description")] public string Description { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Settable", EmitDefaultValue = false)] + [JsonPropertyName("Settable")] public IList Settable { get; set; } - [DataMember(Name = "Value", EmitDefaultValue = false)] + [JsonPropertyName("Value")] public IList Value { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginConfigInterface.Generated.cs b/src/Docker.DotNet/Models/PluginConfigInterface.Generated.cs index a6188b2f2..b311fc174 100644 --- a/src/Docker.DotNet/Models/PluginConfigInterface.Generated.cs +++ b/src/Docker.DotNet/Models/PluginConfigInterface.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginConfigInterface // (types.PluginConfigInterface) { - [DataMember(Name = "ProtocolScheme", EmitDefaultValue = false)] + [JsonPropertyName("ProtocolScheme")] public string ProtocolScheme { get; set; } - [DataMember(Name = "Socket", EmitDefaultValue = false)] + [JsonPropertyName("Socket")] public string Socket { get; set; } - [DataMember(Name = "Types", EmitDefaultValue = false)] + [JsonPropertyName("Types")] public IList Types { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginConfigLinux.Generated.cs b/src/Docker.DotNet/Models/PluginConfigLinux.Generated.cs index 5503f4d21..443376e01 100644 --- a/src/Docker.DotNet/Models/PluginConfigLinux.Generated.cs +++ b/src/Docker.DotNet/Models/PluginConfigLinux.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginConfigLinux // (types.PluginConfigLinux) { - [DataMember(Name = "AllowAllDevices", EmitDefaultValue = false)] + [JsonPropertyName("AllowAllDevices")] public bool AllowAllDevices { get; set; } - [DataMember(Name = "Capabilities", EmitDefaultValue = false)] + [JsonPropertyName("Capabilities")] public IList Capabilities { get; set; } - [DataMember(Name = "Devices", EmitDefaultValue = false)] + [JsonPropertyName("Devices")] public IList Devices { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginConfigNetwork.Generated.cs b/src/Docker.DotNet/Models/PluginConfigNetwork.Generated.cs index cefb46464..dc2089993 100644 --- a/src/Docker.DotNet/Models/PluginConfigNetwork.Generated.cs +++ b/src/Docker.DotNet/Models/PluginConfigNetwork.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginConfigNetwork // (types.PluginConfigNetwork) { - [DataMember(Name = "Type", EmitDefaultValue = false)] + [JsonPropertyName("Type")] public string Type { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginConfigRootfs.Generated.cs b/src/Docker.DotNet/Models/PluginConfigRootfs.Generated.cs index d8409e8b3..35c29a6fa 100644 --- a/src/Docker.DotNet/Models/PluginConfigRootfs.Generated.cs +++ b/src/Docker.DotNet/Models/PluginConfigRootfs.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginConfigRootfs // (types.PluginConfigRootfs) { - [DataMember(Name = "diff_ids", EmitDefaultValue = false)] + [JsonPropertyName("diff_ids")] public IList DiffIds { get; set; } - [DataMember(Name = "type", EmitDefaultValue = false)] + [JsonPropertyName("type")] public string Type { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginConfigUser.Generated.cs b/src/Docker.DotNet/Models/PluginConfigUser.Generated.cs index e137d2000..0dea25957 100644 --- a/src/Docker.DotNet/Models/PluginConfigUser.Generated.cs +++ b/src/Docker.DotNet/Models/PluginConfigUser.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginConfigUser // (types.PluginConfigUser) { - [DataMember(Name = "GID", EmitDefaultValue = false)] + [JsonPropertyName("GID")] public uint GID { get; set; } - [DataMember(Name = "UID", EmitDefaultValue = false)] + [JsonPropertyName("UID")] public uint UID { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginConfigureParameters.Generated.cs b/src/Docker.DotNet/Models/PluginConfigureParameters.Generated.cs index d51f469b9..053c389f3 100644 --- a/src/Docker.DotNet/Models/PluginConfigureParameters.Generated.cs +++ b/src/Docker.DotNet/Models/PluginConfigureParameters.Generated.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginConfigureParameters // (main.PluginConfigureParameters) { - [DataMember(Name = "Args", EmitDefaultValue = false)] + [JsonPropertyName("Args")] public IList Args { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginCreateParameters.Generated.cs b/src/Docker.DotNet/Models/PluginCreateParameters.Generated.cs index db17597b4..a969a556c 100644 --- a/src/Docker.DotNet/Models/PluginCreateParameters.Generated.cs +++ b/src/Docker.DotNet/Models/PluginCreateParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginCreateParameters // (main.PluginCreateParameters) { [QueryStringParameter("name", true)] diff --git a/src/Docker.DotNet/Models/PluginDescription.Generated.cs b/src/Docker.DotNet/Models/PluginDescription.Generated.cs index 63ba3d8d0..cb8653555 100644 --- a/src/Docker.DotNet/Models/PluginDescription.Generated.cs +++ b/src/Docker.DotNet/Models/PluginDescription.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginDescription // (swarm.PluginDescription) { - [DataMember(Name = "Type", EmitDefaultValue = false)] + [JsonPropertyName("Type")] public string Type { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginDevice.Generated.cs b/src/Docker.DotNet/Models/PluginDevice.Generated.cs index 588804b37..3f723e56b 100644 --- a/src/Docker.DotNet/Models/PluginDevice.Generated.cs +++ b/src/Docker.DotNet/Models/PluginDevice.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginDevice // (types.PluginDevice) { - [DataMember(Name = "Description", EmitDefaultValue = false)] + [JsonPropertyName("Description")] public string Description { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Path", EmitDefaultValue = false)] + [JsonPropertyName("Path")] public string Path { get; set; } - [DataMember(Name = "Settable", EmitDefaultValue = false)] + [JsonPropertyName("Settable")] public IList Settable { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginDisableParameters.Generated.cs b/src/Docker.DotNet/Models/PluginDisableParameters.Generated.cs index d75711511..6c85dae13 100644 --- a/src/Docker.DotNet/Models/PluginDisableParameters.Generated.cs +++ b/src/Docker.DotNet/Models/PluginDisableParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginDisableParameters // (main.PluginDisableParameters) { [QueryStringParameter("force", false, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/PluginEnableParameters.Generated.cs b/src/Docker.DotNet/Models/PluginEnableParameters.Generated.cs index 34f94a5fd..5e077528f 100644 --- a/src/Docker.DotNet/Models/PluginEnableParameters.Generated.cs +++ b/src/Docker.DotNet/Models/PluginEnableParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginEnableParameters // (main.PluginEnableParameters) { [QueryStringParameter("timeout", false)] diff --git a/src/Docker.DotNet/Models/PluginEnv.Generated.cs b/src/Docker.DotNet/Models/PluginEnv.Generated.cs index 92ba4d412..dd78bfe33 100644 --- a/src/Docker.DotNet/Models/PluginEnv.Generated.cs +++ b/src/Docker.DotNet/Models/PluginEnv.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginEnv // (types.PluginEnv) { - [DataMember(Name = "Description", EmitDefaultValue = false)] + [JsonPropertyName("Description")] public string Description { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Settable", EmitDefaultValue = false)] + [JsonPropertyName("Settable")] public IList Settable { get; set; } - [DataMember(Name = "Value", EmitDefaultValue = false)] + [JsonPropertyName("Value")] public string Value { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginGetPrivilegeParameters.Generated.cs b/src/Docker.DotNet/Models/PluginGetPrivilegeParameters.Generated.cs index 159bcb345..16b6b103f 100644 --- a/src/Docker.DotNet/Models/PluginGetPrivilegeParameters.Generated.cs +++ b/src/Docker.DotNet/Models/PluginGetPrivilegeParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginGetPrivilegeParameters // (main.PluginGetPrivilegeParameters) { [QueryStringParameter("remote", true)] diff --git a/src/Docker.DotNet/Models/PluginInstallParameters.Generated.cs b/src/Docker.DotNet/Models/PluginInstallParameters.Generated.cs index 8d01cf65b..088ad738e 100644 --- a/src/Docker.DotNet/Models/PluginInstallParameters.Generated.cs +++ b/src/Docker.DotNet/Models/PluginInstallParameters.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginInstallParameters // (main.PluginInstallParameters) { [QueryStringParameter("remote", true)] @@ -12,10 +11,10 @@ public class PluginInstallParameters // (main.PluginInstallParameters) [QueryStringParameter("name", false)] public string Name { get; set; } - [DataMember(Name = "RegistryAuth", EmitDefaultValue = false)] + [JsonPropertyName("RegistryAuth")] public AuthConfig RegistryAuth { get; set; } - [DataMember(Name = "Privileges", EmitDefaultValue = false)] + [JsonPropertyName("Privileges")] public IList Privileges { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginInterfaceType.Generated.cs b/src/Docker.DotNet/Models/PluginInterfaceType.Generated.cs index 826b81bc5..4241c1dd7 100644 --- a/src/Docker.DotNet/Models/PluginInterfaceType.Generated.cs +++ b/src/Docker.DotNet/Models/PluginInterfaceType.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginInterfaceType // (types.PluginInterfaceType) { - [DataMember(Name = "Capability", EmitDefaultValue = false)] + [JsonPropertyName("Capability")] public string Capability { get; set; } - [DataMember(Name = "Prefix", EmitDefaultValue = false)] + [JsonPropertyName("Prefix")] public string Prefix { get; set; } - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public string Version { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginListParameters.Generated.cs b/src/Docker.DotNet/Models/PluginListParameters.Generated.cs index c2578796b..68b3c1511 100644 --- a/src/Docker.DotNet/Models/PluginListParameters.Generated.cs +++ b/src/Docker.DotNet/Models/PluginListParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginListParameters // (main.PluginListParameters) { [QueryStringParameter("filters", false, typeof(MapQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/PluginMount.Generated.cs b/src/Docker.DotNet/Models/PluginMount.Generated.cs index 57ff6b110..a0253b956 100644 --- a/src/Docker.DotNet/Models/PluginMount.Generated.cs +++ b/src/Docker.DotNet/Models/PluginMount.Generated.cs @@ -1,30 +1,29 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginMount // (types.PluginMount) { - [DataMember(Name = "Description", EmitDefaultValue = false)] + [JsonPropertyName("Description")] public string Description { get; set; } - [DataMember(Name = "Destination", EmitDefaultValue = false)] + [JsonPropertyName("Destination")] public string Destination { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Options", EmitDefaultValue = false)] + [JsonPropertyName("Options")] public IList Options { get; set; } - [DataMember(Name = "Settable", EmitDefaultValue = false)] + [JsonPropertyName("Settable")] public IList Settable { get; set; } - [DataMember(Name = "Source", EmitDefaultValue = false)] + [JsonPropertyName("Source")] public string Source { get; set; } - [DataMember(Name = "Type", EmitDefaultValue = false)] + [JsonPropertyName("Type")] public string Type { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginPrivilege.Generated.cs b/src/Docker.DotNet/Models/PluginPrivilege.Generated.cs index a548daf51..729624e15 100644 --- a/src/Docker.DotNet/Models/PluginPrivilege.Generated.cs +++ b/src/Docker.DotNet/Models/PluginPrivilege.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginPrivilege // (types.PluginPrivilege) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Description", EmitDefaultValue = false)] + [JsonPropertyName("Description")] public string Description { get; set; } - [DataMember(Name = "Value", EmitDefaultValue = false)] + [JsonPropertyName("Value")] public IList Value { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginRemoveParameters.Generated.cs b/src/Docker.DotNet/Models/PluginRemoveParameters.Generated.cs index c266f8185..f6aed3822 100644 --- a/src/Docker.DotNet/Models/PluginRemoveParameters.Generated.cs +++ b/src/Docker.DotNet/Models/PluginRemoveParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginRemoveParameters // (main.PluginRemoveParameters) { [QueryStringParameter("force", false, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/PluginSettings.Generated.cs b/src/Docker.DotNet/Models/PluginSettings.Generated.cs index 3ef5c324b..e641dc0e7 100644 --- a/src/Docker.DotNet/Models/PluginSettings.Generated.cs +++ b/src/Docker.DotNet/Models/PluginSettings.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginSettings // (types.PluginSettings) { - [DataMember(Name = "Args", EmitDefaultValue = false)] + [JsonPropertyName("Args")] public IList Args { get; set; } - [DataMember(Name = "Devices", EmitDefaultValue = false)] + [JsonPropertyName("Devices")] public IList Devices { get; set; } - [DataMember(Name = "Env", EmitDefaultValue = false)] + [JsonPropertyName("Env")] public IList Env { get; set; } - [DataMember(Name = "Mounts", EmitDefaultValue = false)] + [JsonPropertyName("Mounts")] public IList Mounts { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginSpec.Generated.cs b/src/Docker.DotNet/Models/PluginSpec.Generated.cs index 9f00d4ee7..5c1e1a875 100644 --- a/src/Docker.DotNet/Models/PluginSpec.Generated.cs +++ b/src/Docker.DotNet/Models/PluginSpec.Generated.cs @@ -1,24 +1,23 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginSpec // (runtime.PluginSpec) { - [DataMember(Name = "name", EmitDefaultValue = false)] + [JsonPropertyName("name")] public string Name { get; set; } - [DataMember(Name = "remote", EmitDefaultValue = false)] + [JsonPropertyName("remote")] public string Remote { get; set; } - [DataMember(Name = "privileges", EmitDefaultValue = false)] + [JsonPropertyName("privileges")] public IList Privileges { get; set; } - [DataMember(Name = "disabled", EmitDefaultValue = false)] + [JsonPropertyName("disabled")] public bool Disabled { get; set; } - [DataMember(Name = "env", EmitDefaultValue = false)] + [JsonPropertyName("env")] public IList Env { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginUpgradeParameters.Generated.cs b/src/Docker.DotNet/Models/PluginUpgradeParameters.Generated.cs index 078aff659..ea71220d6 100644 --- a/src/Docker.DotNet/Models/PluginUpgradeParameters.Generated.cs +++ b/src/Docker.DotNet/Models/PluginUpgradeParameters.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginUpgradeParameters // (main.PluginUpgradeParameters) { [QueryStringParameter("remote", true)] public string Remote { get; set; } - [DataMember(Name = "RegistryAuth", EmitDefaultValue = false)] + [JsonPropertyName("RegistryAuth")] public AuthConfig RegistryAuth { get; set; } - [DataMember(Name = "Privileges", EmitDefaultValue = false)] + [JsonPropertyName("Privileges")] public IList Privileges { get; set; } } } diff --git a/src/Docker.DotNet/Models/PluginsInfo.Generated.cs b/src/Docker.DotNet/Models/PluginsInfo.Generated.cs index d9e921540..759c1be4f 100644 --- a/src/Docker.DotNet/Models/PluginsInfo.Generated.cs +++ b/src/Docker.DotNet/Models/PluginsInfo.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PluginsInfo // (system.PluginsInfo) { - [DataMember(Name = "Volume", EmitDefaultValue = false)] + [JsonPropertyName("Volume")] public IList Volume { get; set; } - [DataMember(Name = "Network", EmitDefaultValue = false)] + [JsonPropertyName("Network")] public IList Network { get; set; } - [DataMember(Name = "Authorization", EmitDefaultValue = false)] + [JsonPropertyName("Authorization")] public IList Authorization { get; set; } - [DataMember(Name = "Log", EmitDefaultValue = false)] + [JsonPropertyName("Log")] public IList Log { get; set; } } } diff --git a/src/Docker.DotNet/Models/Port.Generated.cs b/src/Docker.DotNet/Models/Port.Generated.cs index b34d60ec0..6ca819a82 100644 --- a/src/Docker.DotNet/Models/Port.Generated.cs +++ b/src/Docker.DotNet/Models/Port.Generated.cs @@ -1,20 +1,19 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Port // (types.Port) { - [DataMember(Name = "IP", EmitDefaultValue = false)] + [JsonPropertyName("IP")] public string IP { get; set; } - [DataMember(Name = "PrivatePort", EmitDefaultValue = false)] + [JsonPropertyName("PrivatePort")] public ushort PrivatePort { get; set; } - [DataMember(Name = "PublicPort", EmitDefaultValue = false)] + [JsonPropertyName("PublicPort")] public ushort PublicPort { get; set; } - [DataMember(Name = "Type", EmitDefaultValue = false)] + [JsonPropertyName("Type")] public string Type { get; set; } } } diff --git a/src/Docker.DotNet/Models/PortBinding.Generated.cs b/src/Docker.DotNet/Models/PortBinding.Generated.cs index d8d459c09..fb3040e10 100644 --- a/src/Docker.DotNet/Models/PortBinding.Generated.cs +++ b/src/Docker.DotNet/Models/PortBinding.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PortBinding // (nat.PortBinding) { - [DataMember(Name = "HostIp", EmitDefaultValue = false)] + [JsonPropertyName("HostIp")] public string HostIP { get; set; } - [DataMember(Name = "HostPort", EmitDefaultValue = false)] + [JsonPropertyName("HostPort")] public string HostPort { get; set; } } } diff --git a/src/Docker.DotNet/Models/PortConfig.Generated.cs b/src/Docker.DotNet/Models/PortConfig.Generated.cs index 8f780b65a..aff87bb50 100644 --- a/src/Docker.DotNet/Models/PortConfig.Generated.cs +++ b/src/Docker.DotNet/Models/PortConfig.Generated.cs @@ -1,23 +1,22 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PortConfig // (swarm.PortConfig) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Protocol", EmitDefaultValue = false)] + [JsonPropertyName("Protocol")] public string Protocol { get; set; } - [DataMember(Name = "TargetPort", EmitDefaultValue = false)] + [JsonPropertyName("TargetPort")] public uint TargetPort { get; set; } - [DataMember(Name = "PublishedPort", EmitDefaultValue = false)] + [JsonPropertyName("PublishedPort")] public uint PublishedPort { get; set; } - [DataMember(Name = "PublishMode", EmitDefaultValue = false)] + [JsonPropertyName("PublishMode")] public string PublishMode { get; set; } } } diff --git a/src/Docker.DotNet/Models/PortStatus.Generated.cs b/src/Docker.DotNet/Models/PortStatus.Generated.cs index 625f4c58a..266ae4fd4 100644 --- a/src/Docker.DotNet/Models/PortStatus.Generated.cs +++ b/src/Docker.DotNet/Models/PortStatus.Generated.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PortStatus // (swarm.PortStatus) { - [DataMember(Name = "Ports", EmitDefaultValue = false)] + [JsonPropertyName("Ports")] public IList Ports { get; set; } } } diff --git a/src/Docker.DotNet/Models/Privileges.Generated.cs b/src/Docker.DotNet/Models/Privileges.Generated.cs index faffa1e25..2f1db7924 100644 --- a/src/Docker.DotNet/Models/Privileges.Generated.cs +++ b/src/Docker.DotNet/Models/Privileges.Generated.cs @@ -1,23 +1,22 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Privileges // (swarm.Privileges) { - [DataMember(Name = "CredentialSpec", EmitDefaultValue = false)] + [JsonPropertyName("CredentialSpec")] public CredentialSpec CredentialSpec { get; set; } - [DataMember(Name = "SELinuxContext", EmitDefaultValue = false)] + [JsonPropertyName("SELinuxContext")] public SELinuxContext SELinuxContext { get; set; } - [DataMember(Name = "Seccomp", EmitDefaultValue = false)] + [JsonPropertyName("Seccomp")] public SeccompOpts Seccomp { get; set; } - [DataMember(Name = "AppArmor", EmitDefaultValue = false)] + [JsonPropertyName("AppArmor")] public AppArmorOpts AppArmor { get; set; } - [DataMember(Name = "NoNewPrivileges", EmitDefaultValue = false)] + [JsonPropertyName("NoNewPrivileges")] public bool NoNewPrivileges { get; set; } } } diff --git a/src/Docker.DotNet/Models/PublishStatus.Generated.cs b/src/Docker.DotNet/Models/PublishStatus.Generated.cs index db35f19b9..aec78cd42 100644 --- a/src/Docker.DotNet/Models/PublishStatus.Generated.cs +++ b/src/Docker.DotNet/Models/PublishStatus.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class PublishStatus // (volume.PublishStatus) { - [DataMember(Name = "NodeID", EmitDefaultValue = false)] + [JsonPropertyName("NodeID")] public string NodeID { get; set; } - [DataMember(Name = "State", EmitDefaultValue = false)] + [JsonPropertyName("State")] public string State { get; set; } - [DataMember(Name = "PublishContext", EmitDefaultValue = false)] + [JsonPropertyName("PublishContext")] public IDictionary PublishContext { get; set; } } } diff --git a/src/Docker.DotNet/Models/RaftConfig.Generated.cs b/src/Docker.DotNet/Models/RaftConfig.Generated.cs index 07b06e814..5573c3fd1 100644 --- a/src/Docker.DotNet/Models/RaftConfig.Generated.cs +++ b/src/Docker.DotNet/Models/RaftConfig.Generated.cs @@ -1,23 +1,22 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class RaftConfig // (swarm.RaftConfig) { - [DataMember(Name = "SnapshotInterval", EmitDefaultValue = false)] + [JsonPropertyName("SnapshotInterval")] public ulong SnapshotInterval { get; set; } - [DataMember(Name = "KeepOldSnapshots", EmitDefaultValue = false)] + [JsonPropertyName("KeepOldSnapshots")] public ulong? KeepOldSnapshots { get; set; } - [DataMember(Name = "LogEntriesForSlowFollowers", EmitDefaultValue = false)] + [JsonPropertyName("LogEntriesForSlowFollowers")] public ulong LogEntriesForSlowFollowers { get; set; } - [DataMember(Name = "ElectionTick", EmitDefaultValue = false)] + [JsonPropertyName("ElectionTick")] public long ElectionTick { get; set; } - [DataMember(Name = "HeartbeatTick", EmitDefaultValue = false)] + [JsonPropertyName("HeartbeatTick")] public long HeartbeatTick { get; set; } } } diff --git a/src/Docker.DotNet/Models/ReplicatedJob.Generated.cs b/src/Docker.DotNet/Models/ReplicatedJob.Generated.cs index ad84b2849..97ba4a10f 100644 --- a/src/Docker.DotNet/Models/ReplicatedJob.Generated.cs +++ b/src/Docker.DotNet/Models/ReplicatedJob.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ReplicatedJob // (swarm.ReplicatedJob) { - [DataMember(Name = "MaxConcurrent", EmitDefaultValue = false)] + [JsonPropertyName("MaxConcurrent")] public ulong? MaxConcurrent { get; set; } - [DataMember(Name = "TotalCompletions", EmitDefaultValue = false)] + [JsonPropertyName("TotalCompletions")] public ulong? TotalCompletions { get; set; } } } diff --git a/src/Docker.DotNet/Models/ReplicatedService.Generated.cs b/src/Docker.DotNet/Models/ReplicatedService.Generated.cs index a729a1f68..790a36277 100644 --- a/src/Docker.DotNet/Models/ReplicatedService.Generated.cs +++ b/src/Docker.DotNet/Models/ReplicatedService.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ReplicatedService // (swarm.ReplicatedService) { - [DataMember(Name = "Replicas", EmitDefaultValue = false)] + [JsonPropertyName("Replicas")] public ulong? Replicas { get; set; } } } diff --git a/src/Docker.DotNet/Models/ResourceRequirements.Generated.cs b/src/Docker.DotNet/Models/ResourceRequirements.Generated.cs index cca6d8abf..d60f36116 100644 --- a/src/Docker.DotNet/Models/ResourceRequirements.Generated.cs +++ b/src/Docker.DotNet/Models/ResourceRequirements.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ResourceRequirements // (swarm.ResourceRequirements) { - [DataMember(Name = "Limits", EmitDefaultValue = false)] + [JsonPropertyName("Limits")] public SwarmLimit Limits { get; set; } - [DataMember(Name = "Reservations", EmitDefaultValue = false)] + [JsonPropertyName("Reservations")] public SwarmResources Reservations { get; set; } } } diff --git a/src/Docker.DotNet/Models/Resources.Generated.cs b/src/Docker.DotNet/Models/Resources.Generated.cs index e11d6bf36..99e85b682 100644 --- a/src/Docker.DotNet/Models/Resources.Generated.cs +++ b/src/Docker.DotNet/Models/Resources.Generated.cs @@ -1,102 +1,101 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Resources // (container.Resources) { - [DataMember(Name = "CpuShares", EmitDefaultValue = false)] + [JsonPropertyName("CpuShares")] public long CPUShares { get; set; } - [DataMember(Name = "Memory", EmitDefaultValue = false)] + [JsonPropertyName("Memory")] public long Memory { get; set; } - [DataMember(Name = "NanoCpus", EmitDefaultValue = false)] + [JsonPropertyName("NanoCpus")] public long NanoCPUs { get; set; } - [DataMember(Name = "CgroupParent", EmitDefaultValue = false)] + [JsonPropertyName("CgroupParent")] public string CgroupParent { get; set; } - [DataMember(Name = "BlkioWeight", EmitDefaultValue = false)] + [JsonPropertyName("BlkioWeight")] public ushort BlkioWeight { get; set; } - [DataMember(Name = "BlkioWeightDevice", EmitDefaultValue = false)] + [JsonPropertyName("BlkioWeightDevice")] public IList BlkioWeightDevice { get; set; } - [DataMember(Name = "BlkioDeviceReadBps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceReadBps")] public IList BlkioDeviceReadBps { get; set; } - [DataMember(Name = "BlkioDeviceWriteBps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceWriteBps")] public IList BlkioDeviceWriteBps { get; set; } - [DataMember(Name = "BlkioDeviceReadIOps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceReadIOps")] public IList BlkioDeviceReadIOps { get; set; } - [DataMember(Name = "BlkioDeviceWriteIOps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceWriteIOps")] public IList BlkioDeviceWriteIOps { get; set; } - [DataMember(Name = "CpuPeriod", EmitDefaultValue = false)] + [JsonPropertyName("CpuPeriod")] public long CPUPeriod { get; set; } - [DataMember(Name = "CpuQuota", EmitDefaultValue = false)] + [JsonPropertyName("CpuQuota")] public long CPUQuota { get; set; } - [DataMember(Name = "CpuRealtimePeriod", EmitDefaultValue = false)] + [JsonPropertyName("CpuRealtimePeriod")] public long CPURealtimePeriod { get; set; } - [DataMember(Name = "CpuRealtimeRuntime", EmitDefaultValue = false)] + [JsonPropertyName("CpuRealtimeRuntime")] public long CPURealtimeRuntime { get; set; } - [DataMember(Name = "CpusetCpus", EmitDefaultValue = false)] + [JsonPropertyName("CpusetCpus")] public string CpusetCpus { get; set; } - [DataMember(Name = "CpusetMems", EmitDefaultValue = false)] + [JsonPropertyName("CpusetMems")] public string CpusetMems { get; set; } - [DataMember(Name = "Devices", EmitDefaultValue = false)] + [JsonPropertyName("Devices")] public IList Devices { get; set; } - [DataMember(Name = "DeviceCgroupRules", EmitDefaultValue = false)] + [JsonPropertyName("DeviceCgroupRules")] public IList DeviceCgroupRules { get; set; } - [DataMember(Name = "DeviceRequests", EmitDefaultValue = false)] + [JsonPropertyName("DeviceRequests")] public IList DeviceRequests { get; set; } - [DataMember(Name = "KernelMemory", EmitDefaultValue = false)] + [JsonPropertyName("KernelMemory")] public long KernelMemory { get; set; } - [DataMember(Name = "KernelMemoryTCP", EmitDefaultValue = false)] + [JsonPropertyName("KernelMemoryTCP")] public long KernelMemoryTCP { get; set; } - [DataMember(Name = "MemoryReservation", EmitDefaultValue = false)] + [JsonPropertyName("MemoryReservation")] public long MemoryReservation { get; set; } - [DataMember(Name = "MemorySwap", EmitDefaultValue = false)] + [JsonPropertyName("MemorySwap")] public long MemorySwap { get; set; } - [DataMember(Name = "MemorySwappiness", EmitDefaultValue = false)] + [JsonPropertyName("MemorySwappiness")] public long? MemorySwappiness { get; set; } - [DataMember(Name = "OomKillDisable", EmitDefaultValue = false)] + [JsonPropertyName("OomKillDisable")] public bool? OomKillDisable { get; set; } - [DataMember(Name = "PidsLimit", EmitDefaultValue = false)] + [JsonPropertyName("PidsLimit")] public long? PidsLimit { get; set; } - [DataMember(Name = "Ulimits", EmitDefaultValue = false)] + [JsonPropertyName("Ulimits")] public IList Ulimits { get; set; } - [DataMember(Name = "CpuCount", EmitDefaultValue = false)] + [JsonPropertyName("CpuCount")] public long CPUCount { get; set; } - [DataMember(Name = "CpuPercent", EmitDefaultValue = false)] + [JsonPropertyName("CpuPercent")] public long CPUPercent { get; set; } - [DataMember(Name = "IOMaximumIOps", EmitDefaultValue = false)] + [JsonPropertyName("IOMaximumIOps")] public ulong IOMaximumIOps { get; set; } - [DataMember(Name = "IOMaximumBandwidth", EmitDefaultValue = false)] + [JsonPropertyName("IOMaximumBandwidth")] public ulong IOMaximumBandwidth { get; set; } } } diff --git a/src/Docker.DotNet/Models/RestartPolicy.Generated.cs b/src/Docker.DotNet/Models/RestartPolicy.Generated.cs index 097270a4e..8da3edd9f 100644 --- a/src/Docker.DotNet/Models/RestartPolicy.Generated.cs +++ b/src/Docker.DotNet/Models/RestartPolicy.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class RestartPolicy // (container.RestartPolicy) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public RestartPolicyKind Name { get; set; } - [DataMember(Name = "MaximumRetryCount", EmitDefaultValue = false)] + [JsonPropertyName("MaximumRetryCount")] public long MaximumRetryCount { get; set; } } } diff --git a/src/Docker.DotNet/Models/RootFS.Generated.cs b/src/Docker.DotNet/Models/RootFS.Generated.cs index f1c72d7ed..3b0c6fa73 100644 --- a/src/Docker.DotNet/Models/RootFS.Generated.cs +++ b/src/Docker.DotNet/Models/RootFS.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class RootFS // (types.RootFS) { - [DataMember(Name = "Type", EmitDefaultValue = false)] + [JsonPropertyName("Type")] public string Type { get; set; } - [DataMember(Name = "Layers", EmitDefaultValue = false)] + [JsonPropertyName("Layers")] public IList Layers { get; set; } } } diff --git a/src/Docker.DotNet/Models/Runtime.Generated.cs b/src/Docker.DotNet/Models/Runtime.Generated.cs index ea02d0bf2..3c9053ed4 100644 --- a/src/Docker.DotNet/Models/Runtime.Generated.cs +++ b/src/Docker.DotNet/Models/Runtime.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Runtime // (system.Runtime) { - [DataMember(Name = "path", EmitDefaultValue = false)] + [JsonPropertyName("path")] public string Path { get; set; } - [DataMember(Name = "runtimeArgs", EmitDefaultValue = false)] + [JsonPropertyName("runtimeArgs")] public IList Args { get; set; } - [DataMember(Name = "runtimeType", EmitDefaultValue = false)] + [JsonPropertyName("runtimeType")] public string Type { get; set; } - [DataMember(Name = "options", EmitDefaultValue = false)] + [JsonPropertyName("options")] public IDictionary Options { get; set; } } } diff --git a/src/Docker.DotNet/Models/RuntimePluginPrivilege.Generated.cs b/src/Docker.DotNet/Models/RuntimePluginPrivilege.Generated.cs index 79d4eba61..b6d9b2808 100644 --- a/src/Docker.DotNet/Models/RuntimePluginPrivilege.Generated.cs +++ b/src/Docker.DotNet/Models/RuntimePluginPrivilege.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class RuntimePluginPrivilege // (runtime.PluginPrivilege) { - [DataMember(Name = "name", EmitDefaultValue = false)] + [JsonPropertyName("name")] public string Name { get; set; } - [DataMember(Name = "description", EmitDefaultValue = false)] + [JsonPropertyName("description")] public string Description { get; set; } - [DataMember(Name = "value", EmitDefaultValue = false)] + [JsonPropertyName("value")] public IList Value { get; set; } } } diff --git a/src/Docker.DotNet/Models/RuntimeWithStatus.Generated.cs b/src/Docker.DotNet/Models/RuntimeWithStatus.Generated.cs index 5bae464e7..b0651b0c5 100644 --- a/src/Docker.DotNet/Models/RuntimeWithStatus.Generated.cs +++ b/src/Docker.DotNet/Models/RuntimeWithStatus.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class RuntimeWithStatus // (system.RuntimeWithStatus) { public RuntimeWithStatus() @@ -21,19 +20,19 @@ public RuntimeWithStatus(Runtime Runtime) } } - [DataMember(Name = "path", EmitDefaultValue = false)] + [JsonPropertyName("path")] public string Path { get; set; } - [DataMember(Name = "runtimeArgs", EmitDefaultValue = false)] + [JsonPropertyName("runtimeArgs")] public IList Args { get; set; } - [DataMember(Name = "runtimeType", EmitDefaultValue = false)] + [JsonPropertyName("runtimeType")] public string Type { get; set; } - [DataMember(Name = "options", EmitDefaultValue = false)] + [JsonPropertyName("options")] public IDictionary Options { get; set; } - [DataMember(Name = "status", EmitDefaultValue = false)] + [JsonPropertyName("status")] public IDictionary Status { get; set; } } } diff --git a/src/Docker.DotNet/Models/SELinuxContext.Generated.cs b/src/Docker.DotNet/Models/SELinuxContext.Generated.cs index 41cd92275..93c35e693 100644 --- a/src/Docker.DotNet/Models/SELinuxContext.Generated.cs +++ b/src/Docker.DotNet/Models/SELinuxContext.Generated.cs @@ -1,23 +1,22 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SELinuxContext // (swarm.SELinuxContext) { - [DataMember(Name = "Disable", EmitDefaultValue = false)] + [JsonPropertyName("Disable")] public bool Disable { get; set; } - [DataMember(Name = "User", EmitDefaultValue = false)] + [JsonPropertyName("User")] public string User { get; set; } - [DataMember(Name = "Role", EmitDefaultValue = false)] + [JsonPropertyName("Role")] public string Role { get; set; } - [DataMember(Name = "Type", EmitDefaultValue = false)] + [JsonPropertyName("Type")] public string Type { get; set; } - [DataMember(Name = "Level", EmitDefaultValue = false)] + [JsonPropertyName("Level")] public string Level { get; set; } } } diff --git a/src/Docker.DotNet/Models/SeccompOpts.Generated.cs b/src/Docker.DotNet/Models/SeccompOpts.Generated.cs index ca333796a..6e8575f6f 100644 --- a/src/Docker.DotNet/Models/SeccompOpts.Generated.cs +++ b/src/Docker.DotNet/Models/SeccompOpts.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SeccompOpts // (swarm.SeccompOpts) { - [DataMember(Name = "Mode", EmitDefaultValue = false)] + [JsonPropertyName("Mode")] public string Mode { get; set; } - [DataMember(Name = "Profile", EmitDefaultValue = false)] + [JsonPropertyName("Profile")] public IList Profile { get; set; } } } diff --git a/src/Docker.DotNet/Models/Secret.Generated.cs b/src/Docker.DotNet/Models/Secret.Generated.cs index fd31a7020..5e95d5758 100644 --- a/src/Docker.DotNet/Models/Secret.Generated.cs +++ b/src/Docker.DotNet/Models/Secret.Generated.cs @@ -1,9 +1,8 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Secret // (swarm.Secret) { public Secret() @@ -20,19 +19,19 @@ public Secret(Meta Meta) } } - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public Version Version { get; set; } - [DataMember(Name = "CreatedAt", EmitDefaultValue = false)] + [JsonPropertyName("CreatedAt")] public DateTime CreatedAt { get; set; } - [DataMember(Name = "UpdatedAt", EmitDefaultValue = false)] + [JsonPropertyName("UpdatedAt")] public DateTime UpdatedAt { get; set; } - [DataMember(Name = "Spec", EmitDefaultValue = false)] + [JsonPropertyName("Spec")] public SecretSpec Spec { get; set; } } } diff --git a/src/Docker.DotNet/Models/SecretCreateResponse.Generated.cs b/src/Docker.DotNet/Models/SecretCreateResponse.Generated.cs index 55422170a..e7e343820 100644 --- a/src/Docker.DotNet/Models/SecretCreateResponse.Generated.cs +++ b/src/Docker.DotNet/Models/SecretCreateResponse.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SecretCreateResponse // (main.SecretCreateResponse) { - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } } } diff --git a/src/Docker.DotNet/Models/SecretReference.Generated.cs b/src/Docker.DotNet/Models/SecretReference.Generated.cs index b497fc694..9aeb29f27 100644 --- a/src/Docker.DotNet/Models/SecretReference.Generated.cs +++ b/src/Docker.DotNet/Models/SecretReference.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SecretReference // (swarm.SecretReference) { - [DataMember(Name = "File", EmitDefaultValue = false)] + [JsonPropertyName("File")] public SecretReferenceFileTarget File { get; set; } - [DataMember(Name = "SecretID", EmitDefaultValue = false)] + [JsonPropertyName("SecretID")] public string SecretID { get; set; } - [DataMember(Name = "SecretName", EmitDefaultValue = false)] + [JsonPropertyName("SecretName")] public string SecretName { get; set; } } } diff --git a/src/Docker.DotNet/Models/SecretReferenceFileTarget.Generated.cs b/src/Docker.DotNet/Models/SecretReferenceFileTarget.Generated.cs index 7a2b677d4..39122ded2 100644 --- a/src/Docker.DotNet/Models/SecretReferenceFileTarget.Generated.cs +++ b/src/Docker.DotNet/Models/SecretReferenceFileTarget.Generated.cs @@ -1,20 +1,19 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SecretReferenceFileTarget // (swarm.SecretReferenceFileTarget) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "UID", EmitDefaultValue = false)] + [JsonPropertyName("UID")] public string UID { get; set; } - [DataMember(Name = "GID", EmitDefaultValue = false)] + [JsonPropertyName("GID")] public string GID { get; set; } - [DataMember(Name = "Mode", EmitDefaultValue = false)] + [JsonPropertyName("Mode")] public uint Mode { get; set; } } } diff --git a/src/Docker.DotNet/Models/SecretSpec.Generated.cs b/src/Docker.DotNet/Models/SecretSpec.Generated.cs index 98b14b568..01c2bf076 100644 --- a/src/Docker.DotNet/Models/SecretSpec.Generated.cs +++ b/src/Docker.DotNet/Models/SecretSpec.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SecretSpec // (swarm.SecretSpec) { public SecretSpec() @@ -19,19 +18,19 @@ public SecretSpec(Annotations Annotations) } } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "Data", EmitDefaultValue = false)] + [JsonPropertyName("Data")] public IList Data { get; set; } - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public SwarmDriver Driver { get; set; } - [DataMember(Name = "Templating", EmitDefaultValue = false)] + [JsonPropertyName("Templating")] public SwarmDriver Templating { get; set; } } } diff --git a/src/Docker.DotNet/Models/ServiceConfig.Generated.cs b/src/Docker.DotNet/Models/ServiceConfig.Generated.cs index 14c8e7b7a..7932222d2 100644 --- a/src/Docker.DotNet/Models/ServiceConfig.Generated.cs +++ b/src/Docker.DotNet/Models/ServiceConfig.Generated.cs @@ -1,24 +1,23 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ServiceConfig // (registry.ServiceConfig) { - [DataMember(Name = "AllowNondistributableArtifactsCIDRs", EmitDefaultValue = false)] + [JsonPropertyName("AllowNondistributableArtifactsCIDRs")] public IList AllowNondistributableArtifactsCIDRs { get; set; } - [DataMember(Name = "AllowNondistributableArtifactsHostnames", EmitDefaultValue = false)] + [JsonPropertyName("AllowNondistributableArtifactsHostnames")] public IList AllowNondistributableArtifactsHostnames { get; set; } - [DataMember(Name = "InsecureRegistryCIDRs", EmitDefaultValue = false)] + [JsonPropertyName("InsecureRegistryCIDRs")] public IList InsecureRegistryCIDRs { get; set; } - [DataMember(Name = "IndexConfigs", EmitDefaultValue = false)] + [JsonPropertyName("IndexConfigs")] public IDictionary IndexConfigs { get; set; } - [DataMember(Name = "Mirrors", EmitDefaultValue = false)] + [JsonPropertyName("Mirrors")] public IList Mirrors { get; set; } } } diff --git a/src/Docker.DotNet/Models/ServiceCreateParameters.Generated.cs b/src/Docker.DotNet/Models/ServiceCreateParameters.Generated.cs index 92fc96aad..280aa3af2 100644 --- a/src/Docker.DotNet/Models/ServiceCreateParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ServiceCreateParameters.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ServiceCreateParameters // (main.ServiceCreateParameters) { - [DataMember(Name = "Service", EmitDefaultValue = false)] + [JsonPropertyName("Service")] public ServiceSpec Service { get; set; } - [DataMember(Name = "RegistryAuth", EmitDefaultValue = false)] + [JsonPropertyName("RegistryAuth")] public AuthConfig RegistryAuth { get; set; } } } diff --git a/src/Docker.DotNet/Models/ServiceCreateResponse.Generated.cs b/src/Docker.DotNet/Models/ServiceCreateResponse.Generated.cs index 19b79d041..ec9d8a841 100644 --- a/src/Docker.DotNet/Models/ServiceCreateResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ServiceCreateResponse.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ServiceCreateResponse // (swarm.ServiceCreateResponse) { - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Warnings", EmitDefaultValue = false)] + [JsonPropertyName("Warnings")] public IList Warnings { get; set; } } } diff --git a/src/Docker.DotNet/Models/ServiceInfo.Generated.cs b/src/Docker.DotNet/Models/ServiceInfo.Generated.cs index 91f020944..337b570bb 100644 --- a/src/Docker.DotNet/Models/ServiceInfo.Generated.cs +++ b/src/Docker.DotNet/Models/ServiceInfo.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ServiceInfo // (network.ServiceInfo) { - [DataMember(Name = "VIP", EmitDefaultValue = false)] + [JsonPropertyName("VIP")] public string VIP { get; set; } - [DataMember(Name = "Ports", EmitDefaultValue = false)] + [JsonPropertyName("Ports")] public IList Ports { get; set; } - [DataMember(Name = "LocalLBIndex", EmitDefaultValue = false)] + [JsonPropertyName("LocalLBIndex")] public long LocalLBIndex { get; set; } - [DataMember(Name = "Tasks", EmitDefaultValue = false)] + [JsonPropertyName("Tasks")] public IList Tasks { get; set; } } } diff --git a/src/Docker.DotNet/Models/ServiceListParameters.Generated.cs b/src/Docker.DotNet/Models/ServiceListParameters.Generated.cs index ed9706620..86bbd15e6 100644 --- a/src/Docker.DotNet/Models/ServiceListParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ServiceListParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ServiceListParameters // (main.ServiceListParameters) { [QueryStringParameter("filters", false, typeof(MapQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ServiceLogsParameters.Generated.cs b/src/Docker.DotNet/Models/ServiceLogsParameters.Generated.cs index 4dbe47cf4..82360df3c 100644 --- a/src/Docker.DotNet/Models/ServiceLogsParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ServiceLogsParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ServiceLogsParameters // (main.ServiceLogsParameters) { [QueryStringParameter("stdout", false, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ServiceMode.Generated.cs b/src/Docker.DotNet/Models/ServiceMode.Generated.cs index 2b95862ce..b3cefb45f 100644 --- a/src/Docker.DotNet/Models/ServiceMode.Generated.cs +++ b/src/Docker.DotNet/Models/ServiceMode.Generated.cs @@ -1,20 +1,19 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ServiceMode // (swarm.ServiceMode) { - [DataMember(Name = "Replicated", EmitDefaultValue = false)] + [JsonPropertyName("Replicated")] public ReplicatedService Replicated { get; set; } - [DataMember(Name = "Global", EmitDefaultValue = false)] + [JsonPropertyName("Global")] public GlobalService Global { get; set; } - [DataMember(Name = "ReplicatedJob", EmitDefaultValue = false)] + [JsonPropertyName("ReplicatedJob")] public ReplicatedJob ReplicatedJob { get; set; } - [DataMember(Name = "GlobalJob", EmitDefaultValue = false)] + [JsonPropertyName("GlobalJob")] public GlobalJob GlobalJob { get; set; } } } diff --git a/src/Docker.DotNet/Models/ServiceSpec.Generated.cs b/src/Docker.DotNet/Models/ServiceSpec.Generated.cs index 1d5038c60..65ad6cf6b 100644 --- a/src/Docker.DotNet/Models/ServiceSpec.Generated.cs +++ b/src/Docker.DotNet/Models/ServiceSpec.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ServiceSpec // (swarm.ServiceSpec) { public ServiceSpec() @@ -19,28 +18,28 @@ public ServiceSpec(Annotations Annotations) } } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "TaskTemplate", EmitDefaultValue = false)] + [JsonPropertyName("TaskTemplate")] public TaskSpec TaskTemplate { get; set; } - [DataMember(Name = "Mode", EmitDefaultValue = false)] + [JsonPropertyName("Mode")] public ServiceMode Mode { get; set; } - [DataMember(Name = "UpdateConfig", EmitDefaultValue = false)] + [JsonPropertyName("UpdateConfig")] public SwarmUpdateConfig UpdateConfig { get; set; } - [DataMember(Name = "RollbackConfig", EmitDefaultValue = false)] + [JsonPropertyName("RollbackConfig")] public SwarmUpdateConfig RollbackConfig { get; set; } - [DataMember(Name = "Networks", EmitDefaultValue = false)] + [JsonPropertyName("Networks")] public IList Networks { get; set; } - [DataMember(Name = "EndpointSpec", EmitDefaultValue = false)] + [JsonPropertyName("EndpointSpec")] public EndpointSpec EndpointSpec { get; set; } } } diff --git a/src/Docker.DotNet/Models/ServiceStatus.Generated.cs b/src/Docker.DotNet/Models/ServiceStatus.Generated.cs index 4db3b5aa1..b7ea3474c 100644 --- a/src/Docker.DotNet/Models/ServiceStatus.Generated.cs +++ b/src/Docker.DotNet/Models/ServiceStatus.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ServiceStatus // (swarm.ServiceStatus) { - [DataMember(Name = "RunningTasks", EmitDefaultValue = false)] + [JsonPropertyName("RunningTasks")] public ulong RunningTasks { get; set; } - [DataMember(Name = "DesiredTasks", EmitDefaultValue = false)] + [JsonPropertyName("DesiredTasks")] public ulong DesiredTasks { get; set; } - [DataMember(Name = "CompletedTasks", EmitDefaultValue = false)] + [JsonPropertyName("CompletedTasks")] public ulong CompletedTasks { get; set; } } } diff --git a/src/Docker.DotNet/Models/ServiceUpdateParameters.Generated.cs b/src/Docker.DotNet/Models/ServiceUpdateParameters.Generated.cs index bc6e61bc2..0bea58fd2 100644 --- a/src/Docker.DotNet/Models/ServiceUpdateParameters.Generated.cs +++ b/src/Docker.DotNet/Models/ServiceUpdateParameters.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ServiceUpdateParameters // (main.ServiceUpdateParameters) { - [DataMember(Name = "Service", EmitDefaultValue = false)] + [JsonPropertyName("Service")] public ServiceSpec Service { get; set; } [QueryStringParameter("version", true)] @@ -17,7 +16,7 @@ public class ServiceUpdateParameters // (main.ServiceUpdateParameters) [QueryStringParameter("rollback", false)] public string Rollback { get; set; } - [DataMember(Name = "RegistryAuth", EmitDefaultValue = false)] + [JsonPropertyName("RegistryAuth")] public AuthConfig RegistryAuth { get; set; } } } diff --git a/src/Docker.DotNet/Models/ServiceUpdateResponse.Generated.cs b/src/Docker.DotNet/Models/ServiceUpdateResponse.Generated.cs index 8164b4b26..17529228e 100644 --- a/src/Docker.DotNet/Models/ServiceUpdateResponse.Generated.cs +++ b/src/Docker.DotNet/Models/ServiceUpdateResponse.Generated.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ServiceUpdateResponse // (swarm.ServiceUpdateResponse) { - [DataMember(Name = "Warnings", EmitDefaultValue = false)] + [JsonPropertyName("Warnings")] public IList Warnings { get; set; } } } diff --git a/src/Docker.DotNet/Models/Spec.Generated.cs b/src/Docker.DotNet/Models/Spec.Generated.cs index 9f6e81c14..f753e2b5a 100644 --- a/src/Docker.DotNet/Models/Spec.Generated.cs +++ b/src/Docker.DotNet/Models/Spec.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Spec // (swarm.Spec) { public Spec() @@ -19,28 +18,28 @@ public Spec(Annotations Annotations) } } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "Orchestration", EmitDefaultValue = false)] + [JsonPropertyName("Orchestration")] public OrchestrationConfig Orchestration { get; set; } - [DataMember(Name = "Raft", EmitDefaultValue = false)] + [JsonPropertyName("Raft")] public RaftConfig Raft { get; set; } - [DataMember(Name = "Dispatcher", EmitDefaultValue = false)] + [JsonPropertyName("Dispatcher")] public DispatcherConfig Dispatcher { get; set; } - [DataMember(Name = "CAConfig", EmitDefaultValue = false)] + [JsonPropertyName("CAConfig")] public CAConfig CAConfig { get; set; } - [DataMember(Name = "TaskDefaults", EmitDefaultValue = false)] + [JsonPropertyName("TaskDefaults")] public TaskDefaults TaskDefaults { get; set; } - [DataMember(Name = "EncryptionConfig", EmitDefaultValue = false)] + [JsonPropertyName("EncryptionConfig")] public EncryptionConfig EncryptionConfig { get; set; } } } diff --git a/src/Docker.DotNet/Models/SpreadOver.Generated.cs b/src/Docker.DotNet/Models/SpreadOver.Generated.cs index 0ad24d778..b200b5ebf 100644 --- a/src/Docker.DotNet/Models/SpreadOver.Generated.cs +++ b/src/Docker.DotNet/Models/SpreadOver.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SpreadOver // (swarm.SpreadOver) { - [DataMember(Name = "SpreadDescriptor", EmitDefaultValue = false)] + [JsonPropertyName("SpreadDescriptor")] public string SpreadDescriptor { get; set; } } } diff --git a/src/Docker.DotNet/Models/Stats.Generated.cs b/src/Docker.DotNet/Models/Stats.Generated.cs index 71c467734..88b590d3e 100644 --- a/src/Docker.DotNet/Models/Stats.Generated.cs +++ b/src/Docker.DotNet/Models/Stats.Generated.cs @@ -1,36 +1,35 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Stats // (container.Stats) { - [DataMember(Name = "read", EmitDefaultValue = false)] + [JsonPropertyName("read")] public DateTime Read { get; set; } - [DataMember(Name = "preread", EmitDefaultValue = false)] + [JsonPropertyName("preread")] public DateTime PreRead { get; set; } - [DataMember(Name = "pids_stats", EmitDefaultValue = false)] + [JsonPropertyName("pids_stats")] public PidsStats PidsStats { get; set; } - [DataMember(Name = "blkio_stats", EmitDefaultValue = false)] + [JsonPropertyName("blkio_stats")] public BlkioStats BlkioStats { get; set; } - [DataMember(Name = "num_procs", EmitDefaultValue = false)] + [JsonPropertyName("num_procs")] public uint NumProcs { get; set; } - [DataMember(Name = "storage_stats", EmitDefaultValue = false)] + [JsonPropertyName("storage_stats")] public StorageStats StorageStats { get; set; } - [DataMember(Name = "cpu_stats", EmitDefaultValue = false)] + [JsonPropertyName("cpu_stats")] public CPUStats CPUStats { get; set; } - [DataMember(Name = "precpu_stats", EmitDefaultValue = false)] + [JsonPropertyName("precpu_stats")] public CPUStats PreCPUStats { get; set; } - [DataMember(Name = "memory_stats", EmitDefaultValue = false)] + [JsonPropertyName("memory_stats")] public MemoryStats MemoryStats { get; set; } } } diff --git a/src/Docker.DotNet/Models/StorageStats.Generated.cs b/src/Docker.DotNet/Models/StorageStats.Generated.cs index 9d61e6b1b..b08bba403 100644 --- a/src/Docker.DotNet/Models/StorageStats.Generated.cs +++ b/src/Docker.DotNet/Models/StorageStats.Generated.cs @@ -1,20 +1,19 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class StorageStats // (container.StorageStats) { - [DataMember(Name = "read_count_normalized", EmitDefaultValue = false)] + [JsonPropertyName("read_count_normalized")] public ulong ReadCountNormalized { get; set; } - [DataMember(Name = "read_size_bytes", EmitDefaultValue = false)] + [JsonPropertyName("read_size_bytes")] public ulong ReadSizeBytes { get; set; } - [DataMember(Name = "write_count_normalized", EmitDefaultValue = false)] + [JsonPropertyName("write_count_normalized")] public ulong WriteCountNormalized { get; set; } - [DataMember(Name = "write_size_bytes", EmitDefaultValue = false)] + [JsonPropertyName("write_size_bytes")] public ulong WriteSizeBytes { get; set; } } } diff --git a/src/Docker.DotNet/Models/SummaryNetworkSettings.Generated.cs b/src/Docker.DotNet/Models/SummaryNetworkSettings.Generated.cs index 040761851..8e32e603f 100644 --- a/src/Docker.DotNet/Models/SummaryNetworkSettings.Generated.cs +++ b/src/Docker.DotNet/Models/SummaryNetworkSettings.Generated.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SummaryNetworkSettings // (types.SummaryNetworkSettings) { - [DataMember(Name = "Networks", EmitDefaultValue = false)] + [JsonPropertyName("Networks")] public IDictionary Networks { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmConfig.Generated.cs b/src/Docker.DotNet/Models/SwarmConfig.Generated.cs index dd85ef54b..815241c32 100644 --- a/src/Docker.DotNet/Models/SwarmConfig.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmConfig.Generated.cs @@ -1,9 +1,8 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmConfig // (main.SwarmConfig) { public SwarmConfig() @@ -20,19 +19,19 @@ public SwarmConfig(Meta Meta) } } - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public Version Version { get; set; } - [DataMember(Name = "CreatedAt", EmitDefaultValue = false)] + [JsonPropertyName("CreatedAt")] public DateTime CreatedAt { get; set; } - [DataMember(Name = "UpdatedAt", EmitDefaultValue = false)] + [JsonPropertyName("UpdatedAt")] public DateTime UpdatedAt { get; set; } - [DataMember(Name = "Spec", EmitDefaultValue = false)] + [JsonPropertyName("Spec")] public SwarmConfigSpec Spec { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmConfigReference.Generated.cs b/src/Docker.DotNet/Models/SwarmConfigReference.Generated.cs index 1da38f2fa..7e851b5c5 100644 --- a/src/Docker.DotNet/Models/SwarmConfigReference.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmConfigReference.Generated.cs @@ -1,20 +1,19 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmConfigReference // (swarm.ConfigReference) { - [DataMember(Name = "File", EmitDefaultValue = false)] + [JsonPropertyName("File")] public ConfigReferenceFileTarget File { get; set; } - [DataMember(Name = "Runtime", EmitDefaultValue = false)] + [JsonPropertyName("Runtime")] public ConfigReferenceRuntimeTarget Runtime { get; set; } - [DataMember(Name = "ConfigID", EmitDefaultValue = false)] + [JsonPropertyName("ConfigID")] public string ConfigID { get; set; } - [DataMember(Name = "ConfigName", EmitDefaultValue = false)] + [JsonPropertyName("ConfigName")] public string ConfigName { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmConfigSpec.Generated.cs b/src/Docker.DotNet/Models/SwarmConfigSpec.Generated.cs index 09cf6b8a7..967b2c26e 100644 --- a/src/Docker.DotNet/Models/SwarmConfigSpec.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmConfigSpec.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmConfigSpec // (swarm.ConfigSpec) { public SwarmConfigSpec() @@ -19,16 +18,16 @@ public SwarmConfigSpec(Annotations Annotations) } } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "Data", EmitDefaultValue = false)] + [JsonPropertyName("Data")] public IList Data { get; set; } - [DataMember(Name = "Templating", EmitDefaultValue = false)] + [JsonPropertyName("Templating")] public SwarmDriver Templating { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmCreateConfigParameters.Generated.cs b/src/Docker.DotNet/Models/SwarmCreateConfigParameters.Generated.cs index 8054da32f..7cc4fa9d5 100644 --- a/src/Docker.DotNet/Models/SwarmCreateConfigParameters.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmCreateConfigParameters.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmCreateConfigParameters // (main.SwarmCreateConfigParameters) { - [DataMember(Name = "Config", EmitDefaultValue = false)] + [JsonPropertyName("Config")] public SwarmConfigSpec Config { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmCreateConfigResponse.Generated.cs b/src/Docker.DotNet/Models/SwarmCreateConfigResponse.Generated.cs index fb8cee38c..d75abc9fe 100644 --- a/src/Docker.DotNet/Models/SwarmCreateConfigResponse.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmCreateConfigResponse.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmCreateConfigResponse // (main.SwarmCreateConfigResponse) { - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmDriver.Generated.cs b/src/Docker.DotNet/Models/SwarmDriver.Generated.cs index 743239c75..cce6bafcc 100644 --- a/src/Docker.DotNet/Models/SwarmDriver.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmDriver.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmDriver // (swarm.Driver) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Options", EmitDefaultValue = false)] + [JsonPropertyName("Options")] public IDictionary Options { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmIPAMConfig.Generated.cs b/src/Docker.DotNet/Models/SwarmIPAMConfig.Generated.cs index 2564724c3..77b4cd611 100644 --- a/src/Docker.DotNet/Models/SwarmIPAMConfig.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmIPAMConfig.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmIPAMConfig // (swarm.IPAMConfig) { - [DataMember(Name = "Subnet", EmitDefaultValue = false)] + [JsonPropertyName("Subnet")] public string Subnet { get; set; } - [DataMember(Name = "Range", EmitDefaultValue = false)] + [JsonPropertyName("Range")] public string Range { get; set; } - [DataMember(Name = "Gateway", EmitDefaultValue = false)] + [JsonPropertyName("Gateway")] public string Gateway { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmInitParameters.Generated.cs b/src/Docker.DotNet/Models/SwarmInitParameters.Generated.cs index f897d252c..67cf85124 100644 --- a/src/Docker.DotNet/Models/SwarmInitParameters.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmInitParameters.Generated.cs @@ -1,39 +1,38 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmInitParameters // (swarm.InitRequest) { - [DataMember(Name = "ListenAddr", EmitDefaultValue = false)] + [JsonPropertyName("ListenAddr")] public string ListenAddr { get; set; } - [DataMember(Name = "AdvertiseAddr", EmitDefaultValue = false)] + [JsonPropertyName("AdvertiseAddr")] public string AdvertiseAddr { get; set; } - [DataMember(Name = "DataPathAddr", EmitDefaultValue = false)] + [JsonPropertyName("DataPathAddr")] public string DataPathAddr { get; set; } - [DataMember(Name = "DataPathPort", EmitDefaultValue = false)] + [JsonPropertyName("DataPathPort")] public uint DataPathPort { get; set; } - [DataMember(Name = "ForceNewCluster", EmitDefaultValue = false)] + [JsonPropertyName("ForceNewCluster")] public bool ForceNewCluster { get; set; } - [DataMember(Name = "Spec", EmitDefaultValue = false)] + [JsonPropertyName("Spec")] public Spec Spec { get; set; } - [DataMember(Name = "AutoLockManagers", EmitDefaultValue = false)] + [JsonPropertyName("AutoLockManagers")] public bool AutoLockManagers { get; set; } - [DataMember(Name = "Availability", EmitDefaultValue = false)] + [JsonPropertyName("Availability")] public string Availability { get; set; } - [DataMember(Name = "DefaultAddrPool", EmitDefaultValue = false)] + [JsonPropertyName("DefaultAddrPool")] public IList DefaultAddrPool { get; set; } - [DataMember(Name = "SubnetSize", EmitDefaultValue = false)] + [JsonPropertyName("SubnetSize")] public uint SubnetSize { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmInspectResponse.Generated.cs b/src/Docker.DotNet/Models/SwarmInspectResponse.Generated.cs index 156da8112..5f4d036c2 100644 --- a/src/Docker.DotNet/Models/SwarmInspectResponse.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmInspectResponse.Generated.cs @@ -1,10 +1,9 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmInspectResponse // (swarm.Swarm) { public SwarmInspectResponse() @@ -28,37 +27,37 @@ public SwarmInspectResponse(ClusterInfo ClusterInfo) } } - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public Version Version { get; set; } - [DataMember(Name = "CreatedAt", EmitDefaultValue = false)] + [JsonPropertyName("CreatedAt")] public DateTime CreatedAt { get; set; } - [DataMember(Name = "UpdatedAt", EmitDefaultValue = false)] + [JsonPropertyName("UpdatedAt")] public DateTime UpdatedAt { get; set; } - [DataMember(Name = "Spec", EmitDefaultValue = false)] + [JsonPropertyName("Spec")] public Spec Spec { get; set; } - [DataMember(Name = "TLSInfo", EmitDefaultValue = false)] + [JsonPropertyName("TLSInfo")] public TLSInfo TLSInfo { get; set; } - [DataMember(Name = "RootRotationInProgress", EmitDefaultValue = false)] + [JsonPropertyName("RootRotationInProgress")] public bool RootRotationInProgress { get; set; } - [DataMember(Name = "DefaultAddrPool", EmitDefaultValue = false)] + [JsonPropertyName("DefaultAddrPool")] public IList DefaultAddrPool { get; set; } - [DataMember(Name = "SubnetSize", EmitDefaultValue = false)] + [JsonPropertyName("SubnetSize")] public uint SubnetSize { get; set; } - [DataMember(Name = "DataPathPort", EmitDefaultValue = false)] + [JsonPropertyName("DataPathPort")] public uint DataPathPort { get; set; } - [DataMember(Name = "JoinTokens", EmitDefaultValue = false)] + [JsonPropertyName("JoinTokens")] public JoinTokens JoinTokens { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmJoinParameters.Generated.cs b/src/Docker.DotNet/Models/SwarmJoinParameters.Generated.cs index c16a55628..90a3e3171 100644 --- a/src/Docker.DotNet/Models/SwarmJoinParameters.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmJoinParameters.Generated.cs @@ -1,27 +1,26 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmJoinParameters // (swarm.JoinRequest) { - [DataMember(Name = "ListenAddr", EmitDefaultValue = false)] + [JsonPropertyName("ListenAddr")] public string ListenAddr { get; set; } - [DataMember(Name = "AdvertiseAddr", EmitDefaultValue = false)] + [JsonPropertyName("AdvertiseAddr")] public string AdvertiseAddr { get; set; } - [DataMember(Name = "DataPathAddr", EmitDefaultValue = false)] + [JsonPropertyName("DataPathAddr")] public string DataPathAddr { get; set; } - [DataMember(Name = "RemoteAddrs", EmitDefaultValue = false)] + [JsonPropertyName("RemoteAddrs")] public IList RemoteAddrs { get; set; } - [DataMember(Name = "JoinToken", EmitDefaultValue = false)] + [JsonPropertyName("JoinToken")] public string JoinToken { get; set; } - [DataMember(Name = "Availability", EmitDefaultValue = false)] + [JsonPropertyName("Availability")] public string Availability { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmLeaveParameters.Generated.cs b/src/Docker.DotNet/Models/SwarmLeaveParameters.Generated.cs index 4ba1424fe..498e1b905 100644 --- a/src/Docker.DotNet/Models/SwarmLeaveParameters.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmLeaveParameters.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmLeaveParameters // (main.SwarmLeaveParameters) { [QueryStringParameter("force", false, typeof(BoolQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/SwarmLimit.Generated.cs b/src/Docker.DotNet/Models/SwarmLimit.Generated.cs index d09fb7f08..78e1fa7dd 100644 --- a/src/Docker.DotNet/Models/SwarmLimit.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmLimit.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmLimit // (swarm.Limit) { - [DataMember(Name = "NanoCPUs", EmitDefaultValue = false)] + [JsonPropertyName("NanoCPUs")] public long NanoCPUs { get; set; } - [DataMember(Name = "MemoryBytes", EmitDefaultValue = false)] + [JsonPropertyName("MemoryBytes")] public long MemoryBytes { get; set; } - [DataMember(Name = "Pids", EmitDefaultValue = false)] + [JsonPropertyName("Pids")] public long Pids { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmPlatform.Generated.cs b/src/Docker.DotNet/Models/SwarmPlatform.Generated.cs index 9e3b9f4b8..e41e959c2 100644 --- a/src/Docker.DotNet/Models/SwarmPlatform.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmPlatform.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmPlatform // (swarm.Platform) { - [DataMember(Name = "Architecture", EmitDefaultValue = false)] + [JsonPropertyName("Architecture")] public string Architecture { get; set; } - [DataMember(Name = "OS", EmitDefaultValue = false)] + [JsonPropertyName("OS")] public string OS { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmResources.Generated.cs b/src/Docker.DotNet/Models/SwarmResources.Generated.cs index c5a95bbcb..8e72dc9eb 100644 --- a/src/Docker.DotNet/Models/SwarmResources.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmResources.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmResources // (swarm.Resources) { - [DataMember(Name = "NanoCPUs", EmitDefaultValue = false)] + [JsonPropertyName("NanoCPUs")] public long NanoCPUs { get; set; } - [DataMember(Name = "MemoryBytes", EmitDefaultValue = false)] + [JsonPropertyName("MemoryBytes")] public long MemoryBytes { get; set; } - [DataMember(Name = "GenericResources", EmitDefaultValue = false)] + [JsonPropertyName("GenericResources")] public IList GenericResources { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmRestartPolicy.Generated.cs b/src/Docker.DotNet/Models/SwarmRestartPolicy.Generated.cs index a33403c8d..90fb77712 100644 --- a/src/Docker.DotNet/Models/SwarmRestartPolicy.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmRestartPolicy.Generated.cs @@ -1,20 +1,19 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmRestartPolicy // (swarm.RestartPolicy) { - [DataMember(Name = "Condition", EmitDefaultValue = false)] + [JsonPropertyName("Condition")] public string Condition { get; set; } - [DataMember(Name = "Delay", EmitDefaultValue = false)] + [JsonPropertyName("Delay")] public long? Delay { get; set; } - [DataMember(Name = "MaxAttempts", EmitDefaultValue = false)] + [JsonPropertyName("MaxAttempts")] public ulong? MaxAttempts { get; set; } - [DataMember(Name = "Window", EmitDefaultValue = false)] + [JsonPropertyName("Window")] public long? Window { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmService.Generated.cs b/src/Docker.DotNet/Models/SwarmService.Generated.cs index db9600199..84f032f57 100644 --- a/src/Docker.DotNet/Models/SwarmService.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmService.Generated.cs @@ -1,9 +1,8 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmService // (swarm.Service) { public SwarmService() @@ -20,34 +19,34 @@ public SwarmService(Meta Meta) } } - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public Version Version { get; set; } - [DataMember(Name = "CreatedAt", EmitDefaultValue = false)] + [JsonPropertyName("CreatedAt")] public DateTime CreatedAt { get; set; } - [DataMember(Name = "UpdatedAt", EmitDefaultValue = false)] + [JsonPropertyName("UpdatedAt")] public DateTime UpdatedAt { get; set; } - [DataMember(Name = "Spec", EmitDefaultValue = false)] + [JsonPropertyName("Spec")] public ServiceSpec Spec { get; set; } - [DataMember(Name = "PreviousSpec", EmitDefaultValue = false)] + [JsonPropertyName("PreviousSpec")] public ServiceSpec PreviousSpec { get; set; } - [DataMember(Name = "Endpoint", EmitDefaultValue = false)] + [JsonPropertyName("Endpoint")] public Endpoint Endpoint { get; set; } - [DataMember(Name = "UpdateStatus", EmitDefaultValue = false)] + [JsonPropertyName("UpdateStatus")] public UpdateStatus UpdateStatus { get; set; } - [DataMember(Name = "ServiceStatus", EmitDefaultValue = false)] + [JsonPropertyName("ServiceStatus")] public ServiceStatus ServiceStatus { get; set; } - [DataMember(Name = "JobStatus", EmitDefaultValue = false)] + [JsonPropertyName("JobStatus")] public JobStatus JobStatus { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmUnlockParameters.Generated.cs b/src/Docker.DotNet/Models/SwarmUnlockParameters.Generated.cs index 15b47f988..c27fe91b2 100644 --- a/src/Docker.DotNet/Models/SwarmUnlockParameters.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmUnlockParameters.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmUnlockParameters // (main.SwarmUnlockParameters) { - [DataMember(Name = "UnlockKey", EmitDefaultValue = false)] + [JsonPropertyName("UnlockKey")] public string UnlockKey { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmUnlockResponse.Generated.cs b/src/Docker.DotNet/Models/SwarmUnlockResponse.Generated.cs index fa37accfb..0adc68959 100644 --- a/src/Docker.DotNet/Models/SwarmUnlockResponse.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmUnlockResponse.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmUnlockResponse // (main.SwarmUnlockResponse) { - [DataMember(Name = "UnlockKey", EmitDefaultValue = false)] + [JsonPropertyName("UnlockKey")] public string UnlockKey { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmUpdateConfig.Generated.cs b/src/Docker.DotNet/Models/SwarmUpdateConfig.Generated.cs index a027132be..717fe5613 100644 --- a/src/Docker.DotNet/Models/SwarmUpdateConfig.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmUpdateConfig.Generated.cs @@ -1,26 +1,25 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmUpdateConfig // (swarm.UpdateConfig) { - [DataMember(Name = "Parallelism", EmitDefaultValue = false)] + [JsonPropertyName("Parallelism")] public ulong Parallelism { get; set; } - [DataMember(Name = "Delay", EmitDefaultValue = false)] + [JsonPropertyName("Delay")] public long Delay { get; set; } - [DataMember(Name = "FailureAction", EmitDefaultValue = false)] + [JsonPropertyName("FailureAction")] public string FailureAction { get; set; } - [DataMember(Name = "Monitor", EmitDefaultValue = false)] + [JsonPropertyName("Monitor")] public long Monitor { get; set; } - [DataMember(Name = "MaxFailureRatio", EmitDefaultValue = false)] + [JsonPropertyName("MaxFailureRatio")] public float MaxFailureRatio { get; set; } - [DataMember(Name = "Order", EmitDefaultValue = false)] + [JsonPropertyName("Order")] public string Order { get; set; } } } diff --git a/src/Docker.DotNet/Models/SwarmUpdateConfigParameters.Generated.cs b/src/Docker.DotNet/Models/SwarmUpdateConfigParameters.Generated.cs index ed5b2df90..54fdcbfc2 100644 --- a/src/Docker.DotNet/Models/SwarmUpdateConfigParameters.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmUpdateConfigParameters.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmUpdateConfigParameters // (main.SwarmUpdateConfigParameters) { - [DataMember(Name = "Config", EmitDefaultValue = false)] + [JsonPropertyName("Config")] public SwarmConfigSpec Config { get; set; } [QueryStringParameter("version", true)] diff --git a/src/Docker.DotNet/Models/SwarmUpdateParameters.Generated.cs b/src/Docker.DotNet/Models/SwarmUpdateParameters.Generated.cs index 2a397cd28..47b7dc2b0 100644 --- a/src/Docker.DotNet/Models/SwarmUpdateParameters.Generated.cs +++ b/src/Docker.DotNet/Models/SwarmUpdateParameters.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SwarmUpdateParameters // (main.SwarmUpdateParameters) { - [DataMember(Name = "Spec", EmitDefaultValue = false)] + [JsonPropertyName("Spec")] public Spec Spec { get; set; } [QueryStringParameter("version", true)] diff --git a/src/Docker.DotNet/Models/SystemInfoResponse.Generated.cs b/src/Docker.DotNet/Models/SystemInfoResponse.Generated.cs index 790f43f47..861da36b7 100644 --- a/src/Docker.DotNet/Models/SystemInfoResponse.Generated.cs +++ b/src/Docker.DotNet/Models/SystemInfoResponse.Generated.cs @@ -1,201 +1,200 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class SystemInfoResponse // (system.Info) { - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Containers", EmitDefaultValue = false)] + [JsonPropertyName("Containers")] public long Containers { get; set; } - [DataMember(Name = "ContainersRunning", EmitDefaultValue = false)] + [JsonPropertyName("ContainersRunning")] public long ContainersRunning { get; set; } - [DataMember(Name = "ContainersPaused", EmitDefaultValue = false)] + [JsonPropertyName("ContainersPaused")] public long ContainersPaused { get; set; } - [DataMember(Name = "ContainersStopped", EmitDefaultValue = false)] + [JsonPropertyName("ContainersStopped")] public long ContainersStopped { get; set; } - [DataMember(Name = "Images", EmitDefaultValue = false)] + [JsonPropertyName("Images")] public long Images { get; set; } - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public string Driver { get; set; } - [DataMember(Name = "DriverStatus", EmitDefaultValue = false)] + [JsonPropertyName("DriverStatus")] public IList DriverStatus { get; set; } - [DataMember(Name = "SystemStatus", EmitDefaultValue = false)] + [JsonPropertyName("SystemStatus")] public IList SystemStatus { get; set; } - [DataMember(Name = "Plugins", EmitDefaultValue = false)] + [JsonPropertyName("Plugins")] public PluginsInfo Plugins { get; set; } - [DataMember(Name = "MemoryLimit", EmitDefaultValue = false)] + [JsonPropertyName("MemoryLimit")] public bool MemoryLimit { get; set; } - [DataMember(Name = "SwapLimit", EmitDefaultValue = false)] + [JsonPropertyName("SwapLimit")] public bool SwapLimit { get; set; } - [DataMember(Name = "KernelMemory", EmitDefaultValue = false)] + [JsonPropertyName("KernelMemory")] public bool KernelMemory { get; set; } - [DataMember(Name = "KernelMemoryTCP", EmitDefaultValue = false)] + [JsonPropertyName("KernelMemoryTCP")] public bool KernelMemoryTCP { get; set; } - [DataMember(Name = "CpuCfsPeriod", EmitDefaultValue = false)] + [JsonPropertyName("CpuCfsPeriod")] public bool CPUCfsPeriod { get; set; } - [DataMember(Name = "CpuCfsQuota", EmitDefaultValue = false)] + [JsonPropertyName("CpuCfsQuota")] public bool CPUCfsQuota { get; set; } - [DataMember(Name = "CPUShares", EmitDefaultValue = false)] + [JsonPropertyName("CPUShares")] public bool CPUShares { get; set; } - [DataMember(Name = "CPUSet", EmitDefaultValue = false)] + [JsonPropertyName("CPUSet")] public bool CPUSet { get; set; } - [DataMember(Name = "PidsLimit", EmitDefaultValue = false)] + [JsonPropertyName("PidsLimit")] public bool PidsLimit { get; set; } - [DataMember(Name = "IPv4Forwarding", EmitDefaultValue = false)] + [JsonPropertyName("IPv4Forwarding")] public bool IPv4Forwarding { get; set; } - [DataMember(Name = "BridgeNfIptables", EmitDefaultValue = false)] + [JsonPropertyName("BridgeNfIptables")] public bool BridgeNfIptables { get; set; } - [DataMember(Name = "BridgeNfIp6tables", EmitDefaultValue = false)] + [JsonPropertyName("BridgeNfIp6tables")] public bool BridgeNfIP6tables { get; set; } - [DataMember(Name = "Debug", EmitDefaultValue = false)] + [JsonPropertyName("Debug")] public bool Debug { get; set; } - [DataMember(Name = "NFd", EmitDefaultValue = false)] + [JsonPropertyName("NFd")] public long NFd { get; set; } - [DataMember(Name = "OomKillDisable", EmitDefaultValue = false)] + [JsonPropertyName("OomKillDisable")] public bool OomKillDisable { get; set; } - [DataMember(Name = "NGoroutines", EmitDefaultValue = false)] + [JsonPropertyName("NGoroutines")] public long NGoroutines { get; set; } - [DataMember(Name = "SystemTime", EmitDefaultValue = false)] + [JsonPropertyName("SystemTime")] public string SystemTime { get; set; } - [DataMember(Name = "LoggingDriver", EmitDefaultValue = false)] + [JsonPropertyName("LoggingDriver")] public string LoggingDriver { get; set; } - [DataMember(Name = "CgroupDriver", EmitDefaultValue = false)] + [JsonPropertyName("CgroupDriver")] public string CgroupDriver { get; set; } - [DataMember(Name = "CgroupVersion", EmitDefaultValue = false)] + [JsonPropertyName("CgroupVersion")] public string CgroupVersion { get; set; } - [DataMember(Name = "NEventsListener", EmitDefaultValue = false)] + [JsonPropertyName("NEventsListener")] public long NEventsListener { get; set; } - [DataMember(Name = "KernelVersion", EmitDefaultValue = false)] + [JsonPropertyName("KernelVersion")] public string KernelVersion { get; set; } - [DataMember(Name = "OperatingSystem", EmitDefaultValue = false)] + [JsonPropertyName("OperatingSystem")] public string OperatingSystem { get; set; } - [DataMember(Name = "OSVersion", EmitDefaultValue = false)] + [JsonPropertyName("OSVersion")] public string OSVersion { get; set; } - [DataMember(Name = "OSType", EmitDefaultValue = false)] + [JsonPropertyName("OSType")] public string OSType { get; set; } - [DataMember(Name = "Architecture", EmitDefaultValue = false)] + [JsonPropertyName("Architecture")] public string Architecture { get; set; } - [DataMember(Name = "IndexServerAddress", EmitDefaultValue = false)] + [JsonPropertyName("IndexServerAddress")] public string IndexServerAddress { get; set; } - [DataMember(Name = "RegistryConfig", EmitDefaultValue = false)] + [JsonPropertyName("RegistryConfig")] public ServiceConfig RegistryConfig { get; set; } - [DataMember(Name = "NCPU", EmitDefaultValue = false)] + [JsonPropertyName("NCPU")] public long NCPU { get; set; } - [DataMember(Name = "MemTotal", EmitDefaultValue = false)] + [JsonPropertyName("MemTotal")] public long MemTotal { get; set; } - [DataMember(Name = "GenericResources", EmitDefaultValue = false)] + [JsonPropertyName("GenericResources")] public IList GenericResources { get; set; } - [DataMember(Name = "DockerRootDir", EmitDefaultValue = false)] + [JsonPropertyName("DockerRootDir")] public string DockerRootDir { get; set; } - [DataMember(Name = "HttpProxy", EmitDefaultValue = false)] + [JsonPropertyName("HttpProxy")] public string HTTPProxy { get; set; } - [DataMember(Name = "HttpsProxy", EmitDefaultValue = false)] + [JsonPropertyName("HttpsProxy")] public string HTTPSProxy { get; set; } - [DataMember(Name = "NoProxy", EmitDefaultValue = false)] + [JsonPropertyName("NoProxy")] public string NoProxy { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IList Labels { get; set; } - [DataMember(Name = "ExperimentalBuild", EmitDefaultValue = false)] + [JsonPropertyName("ExperimentalBuild")] public bool ExperimentalBuild { get; set; } - [DataMember(Name = "ServerVersion", EmitDefaultValue = false)] + [JsonPropertyName("ServerVersion")] public string ServerVersion { get; set; } - [DataMember(Name = "Runtimes", EmitDefaultValue = false)] + [JsonPropertyName("Runtimes")] public IDictionary Runtimes { get; set; } - [DataMember(Name = "DefaultRuntime", EmitDefaultValue = false)] + [JsonPropertyName("DefaultRuntime")] public string DefaultRuntime { get; set; } - [DataMember(Name = "Swarm", EmitDefaultValue = false)] + [JsonPropertyName("Swarm")] public Info Swarm { get; set; } - [DataMember(Name = "LiveRestoreEnabled", EmitDefaultValue = false)] + [JsonPropertyName("LiveRestoreEnabled")] public bool LiveRestoreEnabled { get; set; } - [DataMember(Name = "Isolation", EmitDefaultValue = false)] + [JsonPropertyName("Isolation")] public string Isolation { get; set; } - [DataMember(Name = "InitBinary", EmitDefaultValue = false)] + [JsonPropertyName("InitBinary")] public string InitBinary { get; set; } - [DataMember(Name = "ContainerdCommit", EmitDefaultValue = false)] + [JsonPropertyName("ContainerdCommit")] public Commit ContainerdCommit { get; set; } - [DataMember(Name = "RuncCommit", EmitDefaultValue = false)] + [JsonPropertyName("RuncCommit")] public Commit RuncCommit { get; set; } - [DataMember(Name = "InitCommit", EmitDefaultValue = false)] + [JsonPropertyName("InitCommit")] public Commit InitCommit { get; set; } - [DataMember(Name = "SecurityOptions", EmitDefaultValue = false)] + [JsonPropertyName("SecurityOptions")] public IList SecurityOptions { get; set; } - [DataMember(Name = "ProductLicense", EmitDefaultValue = false)] + [JsonPropertyName("ProductLicense")] public string ProductLicense { get; set; } - [DataMember(Name = "DefaultAddressPools", EmitDefaultValue = false)] + [JsonPropertyName("DefaultAddressPools")] public IList DefaultAddressPools { get; set; } - [DataMember(Name = "CDISpecDirs", EmitDefaultValue = false)] + [JsonPropertyName("CDISpecDirs")] public IList CDISpecDirs { get; set; } - [DataMember(Name = "Containerd", EmitDefaultValue = false)] + [JsonPropertyName("Containerd")] public ContainerdInfo Containerd { get; set; } - [DataMember(Name = "Warnings", EmitDefaultValue = false)] + [JsonPropertyName("Warnings")] public IList Warnings { get; set; } } } diff --git a/src/Docker.DotNet/Models/TLSInfo.Generated.cs b/src/Docker.DotNet/Models/TLSInfo.Generated.cs index eca8ff1ea..c52e33701 100644 --- a/src/Docker.DotNet/Models/TLSInfo.Generated.cs +++ b/src/Docker.DotNet/Models/TLSInfo.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class TLSInfo // (swarm.TLSInfo) { - [DataMember(Name = "TrustRoot", EmitDefaultValue = false)] + [JsonPropertyName("TrustRoot")] public string TrustRoot { get; set; } - [DataMember(Name = "CertIssuerSubject", EmitDefaultValue = false)] + [JsonPropertyName("CertIssuerSubject")] public IList CertIssuerSubject { get; set; } - [DataMember(Name = "CertIssuerPublicKey", EmitDefaultValue = false)] + [JsonPropertyName("CertIssuerPublicKey")] public IList CertIssuerPublicKey { get; set; } } } diff --git a/src/Docker.DotNet/Models/TaskDefaults.Generated.cs b/src/Docker.DotNet/Models/TaskDefaults.Generated.cs index dc6f90ae2..5c62677b9 100644 --- a/src/Docker.DotNet/Models/TaskDefaults.Generated.cs +++ b/src/Docker.DotNet/Models/TaskDefaults.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class TaskDefaults // (swarm.TaskDefaults) { - [DataMember(Name = "LogDriver", EmitDefaultValue = false)] + [JsonPropertyName("LogDriver")] public SwarmDriver LogDriver { get; set; } } } diff --git a/src/Docker.DotNet/Models/TaskResponse.Generated.cs b/src/Docker.DotNet/Models/TaskResponse.Generated.cs index be6225db9..94c6f1c42 100644 --- a/src/Docker.DotNet/Models/TaskResponse.Generated.cs +++ b/src/Docker.DotNet/Models/TaskResponse.Generated.cs @@ -1,10 +1,9 @@ using System; using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class TaskResponse // (swarm.Task) { public TaskResponse() @@ -27,52 +26,52 @@ public TaskResponse(Meta Meta, Annotations Annotations) } } - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public Version Version { get; set; } - [DataMember(Name = "CreatedAt", EmitDefaultValue = false)] + [JsonPropertyName("CreatedAt")] public DateTime CreatedAt { get; set; } - [DataMember(Name = "UpdatedAt", EmitDefaultValue = false)] + [JsonPropertyName("UpdatedAt")] public DateTime UpdatedAt { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "Spec", EmitDefaultValue = false)] + [JsonPropertyName("Spec")] public TaskSpec Spec { get; set; } - [DataMember(Name = "ServiceID", EmitDefaultValue = false)] + [JsonPropertyName("ServiceID")] public string ServiceID { get; set; } - [DataMember(Name = "Slot", EmitDefaultValue = false)] + [JsonPropertyName("Slot")] public long Slot { get; set; } - [DataMember(Name = "NodeID", EmitDefaultValue = false)] + [JsonPropertyName("NodeID")] public string NodeID { get; set; } - [DataMember(Name = "Status", EmitDefaultValue = false)] + [JsonPropertyName("Status")] public TaskStatus Status { get; set; } - [DataMember(Name = "DesiredState", EmitDefaultValue = false)] + [JsonPropertyName("DesiredState")] public TaskState DesiredState { get; set; } - [DataMember(Name = "NetworksAttachments", EmitDefaultValue = false)] + [JsonPropertyName("NetworksAttachments")] public IList NetworksAttachments { get; set; } - [DataMember(Name = "GenericResources", EmitDefaultValue = false)] + [JsonPropertyName("GenericResources")] public IList GenericResources { get; set; } - [DataMember(Name = "JobIteration", EmitDefaultValue = false)] + [JsonPropertyName("JobIteration")] public Version JobIteration { get; set; } - [DataMember(Name = "Volumes", EmitDefaultValue = false)] + [JsonPropertyName("Volumes")] public IList Volumes { get; set; } } } diff --git a/src/Docker.DotNet/Models/TaskSpec.Generated.cs b/src/Docker.DotNet/Models/TaskSpec.Generated.cs index 007355983..b6fec4e09 100644 --- a/src/Docker.DotNet/Models/TaskSpec.Generated.cs +++ b/src/Docker.DotNet/Models/TaskSpec.Generated.cs @@ -1,39 +1,38 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class TaskSpec // (swarm.TaskSpec) { - [DataMember(Name = "ContainerSpec", EmitDefaultValue = false)] + [JsonPropertyName("ContainerSpec")] public ContainerSpec ContainerSpec { get; set; } - [DataMember(Name = "PluginSpec", EmitDefaultValue = false)] + [JsonPropertyName("PluginSpec")] public PluginSpec PluginSpec { get; set; } - [DataMember(Name = "NetworkAttachmentSpec", EmitDefaultValue = false)] + [JsonPropertyName("NetworkAttachmentSpec")] public NetworkAttachmentSpec NetworkAttachmentSpec { get; set; } - [DataMember(Name = "Resources", EmitDefaultValue = false)] + [JsonPropertyName("Resources")] public ResourceRequirements Resources { get; set; } - [DataMember(Name = "RestartPolicy", EmitDefaultValue = false)] + [JsonPropertyName("RestartPolicy")] public SwarmRestartPolicy RestartPolicy { get; set; } - [DataMember(Name = "Placement", EmitDefaultValue = false)] + [JsonPropertyName("Placement")] public Placement Placement { get; set; } - [DataMember(Name = "Networks", EmitDefaultValue = false)] + [JsonPropertyName("Networks")] public IList Networks { get; set; } - [DataMember(Name = "LogDriver", EmitDefaultValue = false)] + [JsonPropertyName("LogDriver")] public SwarmDriver LogDriver { get; set; } - [DataMember(Name = "ForceUpdate", EmitDefaultValue = false)] + [JsonPropertyName("ForceUpdate")] public ulong ForceUpdate { get; set; } - [DataMember(Name = "Runtime", EmitDefaultValue = false)] + [JsonPropertyName("Runtime")] public string Runtime { get; set; } } } diff --git a/src/Docker.DotNet/Models/TaskStatus.Generated.cs b/src/Docker.DotNet/Models/TaskStatus.Generated.cs index 83f6acce8..d37f09bea 100644 --- a/src/Docker.DotNet/Models/TaskStatus.Generated.cs +++ b/src/Docker.DotNet/Models/TaskStatus.Generated.cs @@ -1,27 +1,26 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class TaskStatus // (swarm.TaskStatus) { - [DataMember(Name = "Timestamp", EmitDefaultValue = false)] + [JsonPropertyName("Timestamp")] public DateTime Timestamp { get; set; } - [DataMember(Name = "State", EmitDefaultValue = false)] + [JsonPropertyName("State")] public TaskState State { get; set; } - [DataMember(Name = "Message", EmitDefaultValue = false)] + [JsonPropertyName("Message")] public string Message { get; set; } - [DataMember(Name = "Err", EmitDefaultValue = false)] + [JsonPropertyName("Err")] public string Err { get; set; } - [DataMember(Name = "ContainerStatus", EmitDefaultValue = false)] + [JsonPropertyName("ContainerStatus")] public ContainerStatus ContainerStatus { get; set; } - [DataMember(Name = "PortStatus", EmitDefaultValue = false)] + [JsonPropertyName("PortStatus")] public PortStatus PortStatus { get; set; } } } diff --git a/src/Docker.DotNet/Models/TasksListParameters.Generated.cs b/src/Docker.DotNet/Models/TasksListParameters.Generated.cs index 39be9ba42..07c46243c 100644 --- a/src/Docker.DotNet/Models/TasksListParameters.Generated.cs +++ b/src/Docker.DotNet/Models/TasksListParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class TasksListParameters // (main.TasksListParameters) { [QueryStringParameter("filters", false, typeof(MapQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/ThrottleDevice.Generated.cs b/src/Docker.DotNet/Models/ThrottleDevice.Generated.cs index 977e46453..d94c96669 100644 --- a/src/Docker.DotNet/Models/ThrottleDevice.Generated.cs +++ b/src/Docker.DotNet/Models/ThrottleDevice.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ThrottleDevice // (blkiodev.ThrottleDevice) { - [DataMember(Name = "Path", EmitDefaultValue = false)] + [JsonPropertyName("Path")] public string Path { get; set; } - [DataMember(Name = "Rate", EmitDefaultValue = false)] + [JsonPropertyName("Rate")] public ulong Rate { get; set; } } } diff --git a/src/Docker.DotNet/Models/ThrottlingData.Generated.cs b/src/Docker.DotNet/Models/ThrottlingData.Generated.cs index f99c7b03e..458b91609 100644 --- a/src/Docker.DotNet/Models/ThrottlingData.Generated.cs +++ b/src/Docker.DotNet/Models/ThrottlingData.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class ThrottlingData // (container.ThrottlingData) { - [DataMember(Name = "periods", EmitDefaultValue = false)] + [JsonPropertyName("periods")] public ulong Periods { get; set; } - [DataMember(Name = "throttled_periods", EmitDefaultValue = false)] + [JsonPropertyName("throttled_periods")] public ulong ThrottledPeriods { get; set; } - [DataMember(Name = "throttled_time", EmitDefaultValue = false)] + [JsonPropertyName("throttled_time")] public ulong ThrottledTime { get; set; } } } diff --git a/src/Docker.DotNet/Models/TmpfsOptions.Generated.cs b/src/Docker.DotNet/Models/TmpfsOptions.Generated.cs index e6dc5be95..ca7fe92e0 100644 --- a/src/Docker.DotNet/Models/TmpfsOptions.Generated.cs +++ b/src/Docker.DotNet/Models/TmpfsOptions.Generated.cs @@ -1,18 +1,17 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class TmpfsOptions // (mount.TmpfsOptions) { - [DataMember(Name = "SizeBytes", EmitDefaultValue = false)] + [JsonPropertyName("SizeBytes")] public long SizeBytes { get; set; } - [DataMember(Name = "Mode", EmitDefaultValue = false)] + [JsonPropertyName("Mode")] public uint Mode { get; set; } - [DataMember(Name = "Options", EmitDefaultValue = false)] + [JsonPropertyName("Options")] public IList> Options { get; set; } } } diff --git a/src/Docker.DotNet/Models/Topology.Generated.cs b/src/Docker.DotNet/Models/Topology.Generated.cs index d20628394..0793a73d9 100644 --- a/src/Docker.DotNet/Models/Topology.Generated.cs +++ b/src/Docker.DotNet/Models/Topology.Generated.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Topology // (swarm.Topology) { - [DataMember(Name = "Segments", EmitDefaultValue = false)] + [JsonPropertyName("Segments")] public IDictionary Segments { get; set; } } } diff --git a/src/Docker.DotNet/Models/TopologyRequirement.Generated.cs b/src/Docker.DotNet/Models/TopologyRequirement.Generated.cs index 567885ea7..a8fa5f915 100644 --- a/src/Docker.DotNet/Models/TopologyRequirement.Generated.cs +++ b/src/Docker.DotNet/Models/TopologyRequirement.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class TopologyRequirement // (volume.TopologyRequirement) { - [DataMember(Name = "Requisite", EmitDefaultValue = false)] + [JsonPropertyName("Requisite")] public IList Requisite { get; set; } - [DataMember(Name = "Preferred", EmitDefaultValue = false)] + [JsonPropertyName("Preferred")] public IList Preferred { get; set; } } } diff --git a/src/Docker.DotNet/Models/TypeBlock.Generated.cs b/src/Docker.DotNet/Models/TypeBlock.Generated.cs index 393533258..82ba1d8c8 100644 --- a/src/Docker.DotNet/Models/TypeBlock.Generated.cs +++ b/src/Docker.DotNet/Models/TypeBlock.Generated.cs @@ -1,8 +1,6 @@ -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class TypeBlock // (volume.TypeBlock) { } diff --git a/src/Docker.DotNet/Models/TypeMount.Generated.cs b/src/Docker.DotNet/Models/TypeMount.Generated.cs index 3f2475a81..1be8b3d00 100644 --- a/src/Docker.DotNet/Models/TypeMount.Generated.cs +++ b/src/Docker.DotNet/Models/TypeMount.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class TypeMount // (volume.TypeMount) { - [DataMember(Name = "FsType", EmitDefaultValue = false)] + [JsonPropertyName("FsType")] public string FsType { get; set; } - [DataMember(Name = "MountFlags", EmitDefaultValue = false)] + [JsonPropertyName("MountFlags")] public IList MountFlags { get; set; } } } diff --git a/src/Docker.DotNet/Models/Ulimit.Generated.cs b/src/Docker.DotNet/Models/Ulimit.Generated.cs index a0d3712c5..f6d1c694e 100644 --- a/src/Docker.DotNet/Models/Ulimit.Generated.cs +++ b/src/Docker.DotNet/Models/Ulimit.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Ulimit // (units.Ulimit) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Hard", EmitDefaultValue = false)] + [JsonPropertyName("Hard")] public long Hard { get; set; } - [DataMember(Name = "Soft", EmitDefaultValue = false)] + [JsonPropertyName("Soft")] public long Soft { get; set; } } } diff --git a/src/Docker.DotNet/Models/UpdateConfig.Generated.cs b/src/Docker.DotNet/Models/UpdateConfig.Generated.cs index 337d85e9b..3190b2169 100644 --- a/src/Docker.DotNet/Models/UpdateConfig.Generated.cs +++ b/src/Docker.DotNet/Models/UpdateConfig.Generated.cs @@ -1,9 +1,8 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class UpdateConfig // (container.UpdateConfig) { public UpdateConfig() @@ -48,100 +47,100 @@ public UpdateConfig(Resources Resources) } } - [DataMember(Name = "CpuShares", EmitDefaultValue = false)] + [JsonPropertyName("CpuShares")] public long CPUShares { get; set; } - [DataMember(Name = "Memory", EmitDefaultValue = false)] + [JsonPropertyName("Memory")] public long Memory { get; set; } - [DataMember(Name = "NanoCpus", EmitDefaultValue = false)] + [JsonPropertyName("NanoCpus")] public long NanoCPUs { get; set; } - [DataMember(Name = "CgroupParent", EmitDefaultValue = false)] + [JsonPropertyName("CgroupParent")] public string CgroupParent { get; set; } - [DataMember(Name = "BlkioWeight", EmitDefaultValue = false)] + [JsonPropertyName("BlkioWeight")] public ushort BlkioWeight { get; set; } - [DataMember(Name = "BlkioWeightDevice", EmitDefaultValue = false)] + [JsonPropertyName("BlkioWeightDevice")] public IList BlkioWeightDevice { get; set; } - [DataMember(Name = "BlkioDeviceReadBps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceReadBps")] public IList BlkioDeviceReadBps { get; set; } - [DataMember(Name = "BlkioDeviceWriteBps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceWriteBps")] public IList BlkioDeviceWriteBps { get; set; } - [DataMember(Name = "BlkioDeviceReadIOps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceReadIOps")] public IList BlkioDeviceReadIOps { get; set; } - [DataMember(Name = "BlkioDeviceWriteIOps", EmitDefaultValue = false)] + [JsonPropertyName("BlkioDeviceWriteIOps")] public IList BlkioDeviceWriteIOps { get; set; } - [DataMember(Name = "CpuPeriod", EmitDefaultValue = false)] + [JsonPropertyName("CpuPeriod")] public long CPUPeriod { get; set; } - [DataMember(Name = "CpuQuota", EmitDefaultValue = false)] + [JsonPropertyName("CpuQuota")] public long CPUQuota { get; set; } - [DataMember(Name = "CpuRealtimePeriod", EmitDefaultValue = false)] + [JsonPropertyName("CpuRealtimePeriod")] public long CPURealtimePeriod { get; set; } - [DataMember(Name = "CpuRealtimeRuntime", EmitDefaultValue = false)] + [JsonPropertyName("CpuRealtimeRuntime")] public long CPURealtimeRuntime { get; set; } - [DataMember(Name = "CpusetCpus", EmitDefaultValue = false)] + [JsonPropertyName("CpusetCpus")] public string CpusetCpus { get; set; } - [DataMember(Name = "CpusetMems", EmitDefaultValue = false)] + [JsonPropertyName("CpusetMems")] public string CpusetMems { get; set; } - [DataMember(Name = "Devices", EmitDefaultValue = false)] + [JsonPropertyName("Devices")] public IList Devices { get; set; } - [DataMember(Name = "DeviceCgroupRules", EmitDefaultValue = false)] + [JsonPropertyName("DeviceCgroupRules")] public IList DeviceCgroupRules { get; set; } - [DataMember(Name = "DeviceRequests", EmitDefaultValue = false)] + [JsonPropertyName("DeviceRequests")] public IList DeviceRequests { get; set; } - [DataMember(Name = "KernelMemory", EmitDefaultValue = false)] + [JsonPropertyName("KernelMemory")] public long KernelMemory { get; set; } - [DataMember(Name = "KernelMemoryTCP", EmitDefaultValue = false)] + [JsonPropertyName("KernelMemoryTCP")] public long KernelMemoryTCP { get; set; } - [DataMember(Name = "MemoryReservation", EmitDefaultValue = false)] + [JsonPropertyName("MemoryReservation")] public long MemoryReservation { get; set; } - [DataMember(Name = "MemorySwap", EmitDefaultValue = false)] + [JsonPropertyName("MemorySwap")] public long MemorySwap { get; set; } - [DataMember(Name = "MemorySwappiness", EmitDefaultValue = false)] + [JsonPropertyName("MemorySwappiness")] public long? MemorySwappiness { get; set; } - [DataMember(Name = "OomKillDisable", EmitDefaultValue = false)] + [JsonPropertyName("OomKillDisable")] public bool? OomKillDisable { get; set; } - [DataMember(Name = "PidsLimit", EmitDefaultValue = false)] + [JsonPropertyName("PidsLimit")] public long? PidsLimit { get; set; } - [DataMember(Name = "Ulimits", EmitDefaultValue = false)] + [JsonPropertyName("Ulimits")] public IList Ulimits { get; set; } - [DataMember(Name = "CpuCount", EmitDefaultValue = false)] + [JsonPropertyName("CpuCount")] public long CPUCount { get; set; } - [DataMember(Name = "CpuPercent", EmitDefaultValue = false)] + [JsonPropertyName("CpuPercent")] public long CPUPercent { get; set; } - [DataMember(Name = "IOMaximumIOps", EmitDefaultValue = false)] + [JsonPropertyName("IOMaximumIOps")] public ulong IOMaximumIOps { get; set; } - [DataMember(Name = "IOMaximumBandwidth", EmitDefaultValue = false)] + [JsonPropertyName("IOMaximumBandwidth")] public ulong IOMaximumBandwidth { get; set; } - [DataMember(Name = "RestartPolicy", EmitDefaultValue = false)] + [JsonPropertyName("RestartPolicy")] public RestartPolicy RestartPolicy { get; set; } } } diff --git a/src/Docker.DotNet/Models/UpdateStatus.Generated.cs b/src/Docker.DotNet/Models/UpdateStatus.Generated.cs index 9034a7dfb..b0d7d3638 100644 --- a/src/Docker.DotNet/Models/UpdateStatus.Generated.cs +++ b/src/Docker.DotNet/Models/UpdateStatus.Generated.cs @@ -1,21 +1,20 @@ using System; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class UpdateStatus // (swarm.UpdateStatus) { - [DataMember(Name = "State", EmitDefaultValue = false)] + [JsonPropertyName("State")] public string State { get; set; } - [DataMember(Name = "StartedAt", EmitDefaultValue = false)] + [JsonPropertyName("StartedAt")] public DateTime? StartedAt { get; set; } - [DataMember(Name = "CompletedAt", EmitDefaultValue = false)] + [JsonPropertyName("CompletedAt")] public DateTime? CompletedAt { get; set; } - [DataMember(Name = "Message", EmitDefaultValue = false)] + [JsonPropertyName("Message")] public string Message { get; set; } } } diff --git a/src/Docker.DotNet/Models/UsageData.Generated.cs b/src/Docker.DotNet/Models/UsageData.Generated.cs index b30fde97b..abe10c209 100644 --- a/src/Docker.DotNet/Models/UsageData.Generated.cs +++ b/src/Docker.DotNet/Models/UsageData.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class UsageData // (volume.UsageData) { - [DataMember(Name = "RefCount", EmitDefaultValue = false)] + [JsonPropertyName("RefCount")] public long RefCount { get; set; } - [DataMember(Name = "Size", EmitDefaultValue = false)] + [JsonPropertyName("Size")] public long Size { get; set; } } } diff --git a/src/Docker.DotNet/Models/Version.Generated.cs b/src/Docker.DotNet/Models/Version.Generated.cs index 44b151205..76b1c8573 100644 --- a/src/Docker.DotNet/Models/Version.Generated.cs +++ b/src/Docker.DotNet/Models/Version.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class Version // (swarm.Version) { - [DataMember(Name = "Index", EmitDefaultValue = false)] + [JsonPropertyName("Index")] public ulong Index { get; set; } } } diff --git a/src/Docker.DotNet/Models/VersionResponse.Generated.cs b/src/Docker.DotNet/Models/VersionResponse.Generated.cs index 87045defe..c2ed007ea 100644 --- a/src/Docker.DotNet/Models/VersionResponse.Generated.cs +++ b/src/Docker.DotNet/Models/VersionResponse.Generated.cs @@ -1,42 +1,41 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VersionResponse // (types.Version) { - [DataMember(Name = "Components", EmitDefaultValue = false)] + [JsonPropertyName("Components")] public IList Components { get; set; } - [DataMember(Name = "Version", EmitDefaultValue = false)] + [JsonPropertyName("Version")] public string Version { get; set; } - [DataMember(Name = "ApiVersion", EmitDefaultValue = false)] + [JsonPropertyName("ApiVersion")] public string APIVersion { get; set; } - [DataMember(Name = "MinAPIVersion", EmitDefaultValue = false)] + [JsonPropertyName("MinAPIVersion")] public string MinAPIVersion { get; set; } - [DataMember(Name = "GitCommit", EmitDefaultValue = false)] + [JsonPropertyName("GitCommit")] public string GitCommit { get; set; } - [DataMember(Name = "GoVersion", EmitDefaultValue = false)] + [JsonPropertyName("GoVersion")] public string GoVersion { get; set; } - [DataMember(Name = "Os", EmitDefaultValue = false)] + [JsonPropertyName("Os")] public string Os { get; set; } - [DataMember(Name = "Arch", EmitDefaultValue = false)] + [JsonPropertyName("Arch")] public string Arch { get; set; } - [DataMember(Name = "KernelVersion", EmitDefaultValue = false)] + [JsonPropertyName("KernelVersion")] public string KernelVersion { get; set; } - [DataMember(Name = "Experimental", EmitDefaultValue = false)] + [JsonPropertyName("Experimental")] public bool Experimental { get; set; } - [DataMember(Name = "BuildTime", EmitDefaultValue = false)] + [JsonPropertyName("BuildTime")] public string BuildTime { get; set; } } } diff --git a/src/Docker.DotNet/Models/VolumeAccessMode.Generated.cs b/src/Docker.DotNet/Models/VolumeAccessMode.Generated.cs index 312d38d84..f97f7cb92 100644 --- a/src/Docker.DotNet/Models/VolumeAccessMode.Generated.cs +++ b/src/Docker.DotNet/Models/VolumeAccessMode.Generated.cs @@ -1,20 +1,19 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VolumeAccessMode // (volume.AccessMode) { - [DataMember(Name = "Scope", EmitDefaultValue = false)] + [JsonPropertyName("Scope")] public string Scope { get; set; } - [DataMember(Name = "Sharing", EmitDefaultValue = false)] + [JsonPropertyName("Sharing")] public string Sharing { get; set; } - [DataMember(Name = "MountVolume", EmitDefaultValue = false)] + [JsonPropertyName("MountVolume")] public TypeMount MountVolume { get; set; } - [DataMember(Name = "BlockVolume", EmitDefaultValue = false)] + [JsonPropertyName("BlockVolume")] public TypeBlock BlockVolume { get; set; } } } diff --git a/src/Docker.DotNet/Models/VolumeAttachment.Generated.cs b/src/Docker.DotNet/Models/VolumeAttachment.Generated.cs index 38f469d09..4da2f3ef8 100644 --- a/src/Docker.DotNet/Models/VolumeAttachment.Generated.cs +++ b/src/Docker.DotNet/Models/VolumeAttachment.Generated.cs @@ -1,17 +1,16 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VolumeAttachment // (swarm.VolumeAttachment) { - [DataMember(Name = "ID", EmitDefaultValue = false)] + [JsonPropertyName("ID")] public string ID { get; set; } - [DataMember(Name = "Source", EmitDefaultValue = false)] + [JsonPropertyName("Source")] public string Source { get; set; } - [DataMember(Name = "Target", EmitDefaultValue = false)] + [JsonPropertyName("Target")] public string Target { get; set; } } } diff --git a/src/Docker.DotNet/Models/VolumeInfo.Generated.cs b/src/Docker.DotNet/Models/VolumeInfo.Generated.cs index 2c2377dfd..5b23ca522 100644 --- a/src/Docker.DotNet/Models/VolumeInfo.Generated.cs +++ b/src/Docker.DotNet/Models/VolumeInfo.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VolumeInfo // (volume.Info) { - [DataMember(Name = "CapacityBytes", EmitDefaultValue = false)] + [JsonPropertyName("CapacityBytes")] public long CapacityBytes { get; set; } - [DataMember(Name = "VolumeContext", EmitDefaultValue = false)] + [JsonPropertyName("VolumeContext")] public IDictionary VolumeContext { get; set; } - [DataMember(Name = "VolumeID", EmitDefaultValue = false)] + [JsonPropertyName("VolumeID")] public string VolumeID { get; set; } - [DataMember(Name = "AccessibleTopology", EmitDefaultValue = false)] + [JsonPropertyName("AccessibleTopology")] public IList AccessibleTopology { get; set; } } } diff --git a/src/Docker.DotNet/Models/VolumeOptions.Generated.cs b/src/Docker.DotNet/Models/VolumeOptions.Generated.cs index 30806c18e..a6138bf22 100644 --- a/src/Docker.DotNet/Models/VolumeOptions.Generated.cs +++ b/src/Docker.DotNet/Models/VolumeOptions.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VolumeOptions // (mount.VolumeOptions) { - [DataMember(Name = "NoCopy", EmitDefaultValue = false)] + [JsonPropertyName("NoCopy")] public bool NoCopy { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "Subpath", EmitDefaultValue = false)] + [JsonPropertyName("Subpath")] public string Subpath { get; set; } - [DataMember(Name = "DriverConfig", EmitDefaultValue = false)] + [JsonPropertyName("DriverConfig")] public Driver DriverConfig { get; set; } } } diff --git a/src/Docker.DotNet/Models/VolumeResponse.Generated.cs b/src/Docker.DotNet/Models/VolumeResponse.Generated.cs index 12b929978..f1285895c 100644 --- a/src/Docker.DotNet/Models/VolumeResponse.Generated.cs +++ b/src/Docker.DotNet/Models/VolumeResponse.Generated.cs @@ -1,39 +1,38 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VolumeResponse // (main.VolumeResponse) { - [DataMember(Name = "ClusterVolume", EmitDefaultValue = false)] + [JsonPropertyName("ClusterVolume")] public ClusterVolume ClusterVolume { get; set; } - [DataMember(Name = "CreatedAt", EmitDefaultValue = false)] + [JsonPropertyName("CreatedAt")] public string CreatedAt { get; set; } - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public string Driver { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } - [DataMember(Name = "Mountpoint", EmitDefaultValue = false)] + [JsonPropertyName("Mountpoint")] public string Mountpoint { get; set; } - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Options", EmitDefaultValue = false)] + [JsonPropertyName("Options")] public IDictionary Options { get; set; } - [DataMember(Name = "Scope", EmitDefaultValue = false)] + [JsonPropertyName("Scope")] public string Scope { get; set; } - [DataMember(Name = "Status", EmitDefaultValue = false)] + [JsonPropertyName("Status")] public IDictionary Status { get; set; } - [DataMember(Name = "UsageData", EmitDefaultValue = false)] + [JsonPropertyName("UsageData")] public UsageData UsageData { get; set; } } } diff --git a/src/Docker.DotNet/Models/VolumeSecret.Generated.cs b/src/Docker.DotNet/Models/VolumeSecret.Generated.cs index 8df3da991..60f0d4c69 100644 --- a/src/Docker.DotNet/Models/VolumeSecret.Generated.cs +++ b/src/Docker.DotNet/Models/VolumeSecret.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VolumeSecret // (volume.Secret) { - [DataMember(Name = "Key", EmitDefaultValue = false)] + [JsonPropertyName("Key")] public string Key { get; set; } - [DataMember(Name = "Secret", EmitDefaultValue = false)] + [JsonPropertyName("Secret")] public string Secret { get; set; } } } diff --git a/src/Docker.DotNet/Models/VolumeTopology.Generated.cs b/src/Docker.DotNet/Models/VolumeTopology.Generated.cs index b87b05215..4f98aadbc 100644 --- a/src/Docker.DotNet/Models/VolumeTopology.Generated.cs +++ b/src/Docker.DotNet/Models/VolumeTopology.Generated.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VolumeTopology // (volume.Topology) { - [DataMember(Name = "Segments", EmitDefaultValue = false)] + [JsonPropertyName("Segments")] public IDictionary Segments { get; set; } } } diff --git a/src/Docker.DotNet/Models/VolumesCreateParameters.Generated.cs b/src/Docker.DotNet/Models/VolumesCreateParameters.Generated.cs index cc2a41027..b7b983f52 100644 --- a/src/Docker.DotNet/Models/VolumesCreateParameters.Generated.cs +++ b/src/Docker.DotNet/Models/VolumesCreateParameters.Generated.cs @@ -1,21 +1,20 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VolumesCreateParameters // (main.VolumesCreateParameters) { - [DataMember(Name = "Name", EmitDefaultValue = false)] + [JsonPropertyName("Name")] public string Name { get; set; } - [DataMember(Name = "Driver", EmitDefaultValue = false)] + [JsonPropertyName("Driver")] public string Driver { get; set; } - [DataMember(Name = "DriverOpts", EmitDefaultValue = false)] + [JsonPropertyName("DriverOpts")] public IDictionary DriverOpts { get; set; } - [DataMember(Name = "Labels", EmitDefaultValue = false)] + [JsonPropertyName("Labels")] public IDictionary Labels { get; set; } } } diff --git a/src/Docker.DotNet/Models/VolumesListParameters.Generated.cs b/src/Docker.DotNet/Models/VolumesListParameters.Generated.cs index a71d5df4a..6d23c6dd0 100644 --- a/src/Docker.DotNet/Models/VolumesListParameters.Generated.cs +++ b/src/Docker.DotNet/Models/VolumesListParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VolumesListParameters // (main.VolumesListParameters) { [QueryStringParameter("filters", false, typeof(MapQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/VolumesListResponse.Generated.cs b/src/Docker.DotNet/Models/VolumesListResponse.Generated.cs index acd2ce977..b02a3109f 100644 --- a/src/Docker.DotNet/Models/VolumesListResponse.Generated.cs +++ b/src/Docker.DotNet/Models/VolumesListResponse.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VolumesListResponse // (main.VolumesListResponse) { - [DataMember(Name = "Volumes", EmitDefaultValue = false)] + [JsonPropertyName("Volumes")] public IList Volumes { get; set; } - [DataMember(Name = "Warnings", EmitDefaultValue = false)] + [JsonPropertyName("Warnings")] public IList Warnings { get; set; } } } diff --git a/src/Docker.DotNet/Models/VolumesPruneParameters.Generated.cs b/src/Docker.DotNet/Models/VolumesPruneParameters.Generated.cs index 80f5b1dec..55193858d 100644 --- a/src/Docker.DotNet/Models/VolumesPruneParameters.Generated.cs +++ b/src/Docker.DotNet/Models/VolumesPruneParameters.Generated.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Runtime.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VolumesPruneParameters // (main.VolumesPruneParameters) { [QueryStringParameter("filters", false, typeof(MapQueryStringConverter))] diff --git a/src/Docker.DotNet/Models/VolumesPruneResponse.Generated.cs b/src/Docker.DotNet/Models/VolumesPruneResponse.Generated.cs index 630ea05ac..2b2eaff1e 100644 --- a/src/Docker.DotNet/Models/VolumesPruneResponse.Generated.cs +++ b/src/Docker.DotNet/Models/VolumesPruneResponse.Generated.cs @@ -1,15 +1,14 @@ using System.Collections.Generic; -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class VolumesPruneResponse // (volume.PruneReport) { - [DataMember(Name = "VolumesDeleted", EmitDefaultValue = false)] + [JsonPropertyName("VolumesDeleted")] public IList VolumesDeleted { get; set; } - [DataMember(Name = "SpaceReclaimed", EmitDefaultValue = false)] + [JsonPropertyName("SpaceReclaimed")] public ulong SpaceReclaimed { get; set; } } } diff --git a/src/Docker.DotNet/Models/WaitExitError.Generated.cs b/src/Docker.DotNet/Models/WaitExitError.Generated.cs index 7d019089a..4d730dc5f 100644 --- a/src/Docker.DotNet/Models/WaitExitError.Generated.cs +++ b/src/Docker.DotNet/Models/WaitExitError.Generated.cs @@ -1,11 +1,10 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class WaitExitError // (container.WaitExitError) { - [DataMember(Name = "Message", EmitDefaultValue = false)] + [JsonPropertyName("Message")] public string Message { get; set; } } } diff --git a/src/Docker.DotNet/Models/WeightDevice.Generated.cs b/src/Docker.DotNet/Models/WeightDevice.Generated.cs index 08478de31..d76318a0e 100644 --- a/src/Docker.DotNet/Models/WeightDevice.Generated.cs +++ b/src/Docker.DotNet/Models/WeightDevice.Generated.cs @@ -1,14 +1,13 @@ -using System.Runtime.Serialization; +using System.Text.Json.Serialization; namespace Docker.DotNet.Models { - [DataContract] public class WeightDevice // (blkiodev.WeightDevice) { - [DataMember(Name = "Path", EmitDefaultValue = false)] + [JsonPropertyName("Path")] public string Path { get; set; } - [DataMember(Name = "Weight", EmitDefaultValue = false)] + [JsonPropertyName("Weight")] public ushort Weight { get; set; } } } diff --git a/src/Docker.DotNet/TimeSpanNanoSecondsConverter.cs b/src/Docker.DotNet/TimeSpanNanoSecondsConverter.cs index 145933db8..05ed9b019 100644 --- a/src/Docker.DotNet/TimeSpanNanoSecondsConverter.cs +++ b/src/Docker.DotNet/TimeSpanNanoSecondsConverter.cs @@ -1,38 +1,23 @@ using System; -using Newtonsoft.Json; +using System.Text.Json; +using System.Text.Json.Serialization; namespace Docker.DotNet { - internal class TimeSpanNanosecondsConverter : JsonConverter + internal class TimeSpanNanosecondsConverter : JsonConverter { - const int MiliSecondToNanoSecond = 1000000; - public override void WriteJson(JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) - { - var timeSpan = value as TimeSpan?; - if (timeSpan == null) - { - return; - } - - writer.WriteValue((long)(timeSpan.Value.TotalMilliseconds * MiliSecondToNanoSecond)); - } + private const int MilliSecondToNanoSecond = 1000000; - public override bool CanConvert(Type objectType) + public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - return objectType == typeof(TimeSpan) || objectType == typeof(TimeSpan?); + var valueInNanoSeconds = reader.GetInt64(); + var milliSecondValue = valueInNanoSeconds / MilliSecondToNanoSecond; + return TimeSpan.FromMilliseconds(milliSecondValue); } - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) + public override void Write(Utf8JsonWriter writer, TimeSpan timeSpan, JsonSerializerOptions options) { - var valueInNanoSeconds = (long?)reader.Value; - - if (!valueInNanoSeconds.HasValue) - { - return null; - } - var milliSecondValue = valueInNanoSeconds.Value / MiliSecondToNanoSecond; - - return TimeSpan.FromMilliseconds(milliSecondValue); + writer.WriteNumberValue(timeSpan.TotalMilliseconds * MilliSecondToNanoSecond); } } } \ No newline at end of file diff --git a/src/Docker.DotNet/TimeSpanSecondsConverter.cs b/src/Docker.DotNet/TimeSpanSecondsConverter.cs index 839ab37aa..5b2918e95 100644 --- a/src/Docker.DotNet/TimeSpanSecondsConverter.cs +++ b/src/Docker.DotNet/TimeSpanSecondsConverter.cs @@ -1,35 +1,29 @@ using System; -using Newtonsoft.Json; +using System.Text.Json; +using System.Text.Json.Serialization; namespace Docker.DotNet { - internal class TimeSpanSecondsConverter : JsonConverter + internal class TimeSpanSecondsConverter : JsonConverter { - public override void WriteJson(JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) + public override TimeSpan? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - var timeSpan = value as TimeSpan?; - if (timeSpan == null) + if (reader.TokenType == JsonTokenType.Null) { - return; + return null; } - writer.WriteValue((long)timeSpan.Value.TotalSeconds); + return TimeSpan.FromSeconds(reader.GetInt64()); } - public override bool CanConvert(Type objectType) + public override void Write(Utf8JsonWriter writer, TimeSpan? value, JsonSerializerOptions options) { - return objectType == typeof(TimeSpan) || objectType == typeof(TimeSpan?); - } - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) - { - var valueInSeconds = (long?)reader.Value; - if(!valueInSeconds.HasValue) + if (value == null) { - return null; + return; } - return TimeSpan.FromSeconds(valueInSeconds.Value); + writer.WriteNumberValue(value.Value.TotalSeconds); } } } \ No newline at end of file diff --git a/test/Docker.DotNet.Tests/IContainerOperationsTests.cs b/test/Docker.DotNet.Tests/IContainerOperationsTests.cs index 6e14d813d..dc0178cf2 100644 --- a/test/Docker.DotNet.Tests/IContainerOperationsTests.cs +++ b/test/Docker.DotNet.Tests/IContainerOperationsTests.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Reflection; -using System.Text; using System.Threading; using System.Threading.Tasks; using Docker.DotNet.Models; @@ -435,7 +434,7 @@ await _dockerClient.Containers.GetContainerStatsAsync( linkedCts.Token ); } - catch (TaskCanceledException) + catch (OperationCanceledException) { // this is expected to happen on task cancelaltion } @@ -528,7 +527,7 @@ await _dockerClient.Containers.GetContainerStatsAsync( linkedTcs.Token ); } - catch (TaskCanceledException) + catch (OperationCanceledException) { // this is expected to happen on task cancelaltion } diff --git a/test/Docker.DotNet.Tests/ISystemOperations.Tests.cs b/test/Docker.DotNet.Tests/ISystemOperations.Tests.cs index 974e1020d..ea60e88d6 100644 --- a/test/Docker.DotNet.Tests/ISystemOperations.Tests.cs +++ b/test/Docker.DotNet.Tests/ISystemOperations.Tests.cs @@ -118,7 +118,7 @@ await _dockerClient.Images.DeleteImageAsync( await cts.CancelAsync(); - await Assert.ThrowsAsync(() => task); + await Assert.ThrowsAsync(() => task).ConfigureAwait(false); Assert.True(wasProgressCalled); } @@ -180,7 +180,7 @@ await _dockerClient.Images.TagImageAsync( await monitorTask; } - catch (TaskCanceledException) + catch (OperationCanceledException) { // Exceptions other than this causes test to fail } @@ -263,7 +263,7 @@ await _dockerClient.Images.TagImageAsync( await Task.Delay(TimeSpan.FromSeconds(1)); await cts.CancelAsync(); - await Assert.ThrowsAsync(() => task); + await Assert.ThrowsAsync(() => task); Assert.Equal(2, progressCalledCounter); Assert.True(task.IsCanceled); diff --git a/tools/specgen/csharptype.go b/tools/specgen/csharptype.go index 8e879ef44..5843bc84b 100644 --- a/tools/specgen/csharptype.go +++ b/tools/specgen/csharptype.go @@ -161,8 +161,6 @@ func NewModel(name, sourceName string) *CSModelType { SourceName: sourceName, } - s.Attributes = append(s.Attributes, CSAttribute{Type: CSType{"System.Runtime.Serialization", "DataContract", false}}) - return &s } diff --git a/tools/specgen/specgen.go b/tools/specgen/specgen.go index 65c8085a1..06609a9d2 100644 --- a/tools/specgen/specgen.go +++ b/tools/specgen/specgen.go @@ -34,7 +34,7 @@ var typesToDisambiguate = map[string]*CSModelType{ CSProperty{ Name: "StopTimeout", Type: CSType{"System", "TimeSpan", true}, - Attributes: []CSAttribute{CSAttribute{Type: CSType{"Newtonsoft.Json", "JsonConverter", false}, Arguments: []CSArgument{{Value: "typeof(TimeSpanSecondsConverter)"}}}}, + Attributes: []CSAttribute{CSAttribute{Type: CSType{"System.Text.Json.Serialization", "JsonConverter", false}, Arguments: []CSArgument{{Value: "typeof(TimeSpanSecondsConverter)"}}}}, }, }, }, @@ -44,12 +44,12 @@ var typesToDisambiguate = map[string]*CSModelType{ CSProperty{ Name: "Interval", Type: CSType{"System", "TimeSpan", true}, - Attributes: []CSAttribute{CSAttribute{Type: CSType{"Newtonsoft.Json", "JsonConverter", false}, Arguments: []CSArgument{{Value: "typeof(TimeSpanNanosecondsConverter)"}}}}, + Attributes: []CSAttribute{CSAttribute{Type: CSType{"System.Text.Json.Serialization", "JsonConverter", false}, Arguments: []CSArgument{{Value: "typeof(TimeSpanNanosecondsConverter)"}}}}, }, CSProperty{ Name: "Timeout", Type: CSType{"System", "TimeSpan", true}, - Attributes: []CSAttribute{CSAttribute{Type: CSType{"Newtonsoft.Json", "JsonConverter", false}, Arguments: []CSArgument{{Value: "typeof(TimeSpanNanosecondsConverter)"}}}}, + Attributes: []CSAttribute{CSAttribute{Type: CSType{"System.Text.Json.Serialization", "JsonConverter", false}, Arguments: []CSArgument{{Value: "typeof(TimeSpanNanosecondsConverter)"}}}}, }, }, }, @@ -67,7 +67,7 @@ var typesToDisambiguate = map[string]*CSModelType{ CSProperty{ Name: "StopTimeout", Type: CSType{"System", "TimeSpan", true}, - Attributes: []CSAttribute{CSAttribute{Type: CSType{"Newtonsoft.Json", "JsonConverter", false}, Arguments: []CSArgument{{Value: "typeof(TimeSpanSecondsConverter)"}}}}, + Attributes: []CSAttribute{CSAttribute{Type: CSType{"System.Text.Json.Serialization", "JsonConverter", false}, Arguments: []CSArgument{{Value: "typeof(TimeSpanSecondsConverter)"}}}}, }, }, }, @@ -629,9 +629,8 @@ func reflectTypeMembers(t reflect.Type, m *CSModelType) { csProp.Attributes = append(csProp.Attributes, a) csProp.DefaultValue = restTag.Default } else { - a := CSAttribute{Type: CSType{"", "DataMember", false}} - a.NamedArguments = append(a.NamedArguments, CSNamedArgument{"Name", CSArgument{jsonName, CSInboxTypesMap[reflect.String]}}) - a.NamedArguments = append(a.NamedArguments, CSNamedArgument{"EmitDefaultValue", CSArgument{strconv.FormatBool(false), CSInboxTypesMap[reflect.Bool]}}) + a := CSAttribute{Type: CSType{"System.Text.Json.Serialization", "JsonPropertyName", false}} + a.Arguments = append(a.Arguments, CSArgument{jsonName, CSInboxTypesMap[reflect.String]}) csProp.IsOpt = f.Type.Kind() == reflect.Ptr csProp.Attributes = append(csProp.Attributes, a) }