From b53e3b918ff709725834cff8c348921b7fd8aa18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=BCdel?= Date: Thu, 7 Dec 2023 12:13:04 +0100 Subject: [PATCH 1/2] PP9-18550: Regenerate contracts --- .../Generated/Clients.Generated.cs | 8 +- .../Generated/Contracts.Generated.cs | 147 ++++++++++++++---- swagger/CloudManagerSwagger.json | 112 ++++++++++--- 3 files changed, 211 insertions(+), 56 deletions(-) diff --git a/src/Picturepark.SDK.V1.CloudManager/Generated/Clients.Generated.cs b/src/Picturepark.SDK.V1.CloudManager/Generated/Clients.Generated.cs index b1fa1538..7f9aa709 100644 --- a/src/Picturepark.SDK.V1.CloudManager/Generated/Clients.Generated.cs +++ b/src/Picturepark.SDK.V1.CloudManager/Generated/Clients.Generated.cs @@ -17775,7 +17775,7 @@ private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() /// Internal server error /// Entity not found /// Entity not found - public virtual async System.Threading.Tasks.Task GetAsync(string customerId, string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task GetAsync(string customerId, string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var urlBuilder_ = new System.Text.StringBuilder(); urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/OutputFormat/customer/{customerId}/outputformats/{id}"); @@ -17814,7 +17814,7 @@ public virtual async System.Threading.Tasks.Task GetAsync(st var status_ = (int)response_.StatusCode; if (status_ == 200) { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); if (objectResponse_.Object == null) { throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); @@ -17946,7 +17946,7 @@ public virtual async System.Threading.Tasks.Task GetAsync(st /// Internal server error /// Entity not found /// Entity not found - public virtual async System.Threading.Tasks.Task UpdateAsync(string customerId, string id, OutputFormatEditable format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task UpdateAsync(string customerId, string id, StaticOutputFormatEditable format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (format == null) throw new System.ArgumentNullException("format"); @@ -18295,7 +18295,7 @@ public virtual async System.Threading.Tasks.Task DeleteAsync(st /// Internal server error /// Entity not found /// Entity not found - public virtual async System.Threading.Tasks.Task CreateAsync(string customerId, OutputFormat format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task CreateAsync(string customerId, StaticOutputFormat format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (format == null) throw new System.ArgumentNullException("format"); diff --git a/src/Picturepark.SDK.V1.CloudManager/Generated/Contracts.Generated.cs b/src/Picturepark.SDK.V1.CloudManager/Generated/Contracts.Generated.cs index 1f78ab45..aa44d6ec 100644 --- a/src/Picturepark.SDK.V1.CloudManager/Generated/Contracts.Generated.cs +++ b/src/Picturepark.SDK.V1.CloudManager/Generated/Contracts.Generated.cs @@ -1106,7 +1106,7 @@ public partial interface IOutputFormatClient /// Internal server error /// Entity not found /// Entity not found - System.Threading.Tasks.Task GetAsync(string customerId, string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task GetAsync(string customerId, string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// A server side error occurred. @@ -1117,7 +1117,7 @@ public partial interface IOutputFormatClient /// Internal server error /// Entity not found /// Entity not found - System.Threading.Tasks.Task UpdateAsync(string customerId, string id, OutputFormatEditable format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UpdateAsync(string customerId, string id, StaticOutputFormatEditable format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// A server side error occurred. @@ -1139,7 +1139,7 @@ public partial interface IOutputFormatClient /// Internal server error /// Entity not found /// Entity not found - System.Threading.Tasks.Task CreateAsync(string customerId, OutputFormat format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task CreateAsync(string customerId, StaticOutputFormat format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } @@ -16659,7 +16659,7 @@ public partial class CustomerCreateRequest public LanguageConfiguration LanguageConfiguration { get; set; } [Newtonsoft.Json.JsonProperty("outputFormats", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection OutputFormats { get; set; } + public System.Collections.Generic.ICollection OutputFormats { get; set; } [Newtonsoft.Json.JsonProperty("contentRetentionTime", Required = Newtonsoft.Json.Required.Always)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] @@ -17138,38 +17138,23 @@ public static LanguageConfiguration FromJson(string data) } /// - /// Represents an output format. + /// Represents a static output format used in cloud manager. /// [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class OutputFormat : OutputFormatEditable + public partial class StaticOutputFormat : StaticOutputFormatEditable { - /// - /// Output format ID. - /// [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string Id { get; set; } - /// - /// Marks if this is a system output format. - /// [Newtonsoft.Json.JsonProperty("system", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public bool System { get; set; } - /// - /// A dynamic output format is not rendered automatically, but only on demand. - /// [Newtonsoft.Json.JsonProperty("dynamic", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public bool Dynamic { get; set; } - /// - /// Specifies if output format should be taken into account during data extraction. - /// [Newtonsoft.Json.JsonProperty("dataExtraction", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public bool DataExtraction { get; set; } - /// - /// Temporary outputs will not be backed up. - /// [Newtonsoft.Json.JsonProperty("temporary", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public bool Temporary { get; set; } @@ -17179,15 +17164,119 @@ public string ToJson() return Newtonsoft.Json.JsonConvert.SerializeObject(this, new Newtonsoft.Json.JsonSerializerSettings()); } - public static OutputFormat FromJson(string data) + public static StaticOutputFormat FromJson(string data) + { + + return Newtonsoft.Json.JsonConvert.DeserializeObject(data, new Newtonsoft.Json.JsonSerializerSettings()); + + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class StaticOutputFormatEditable : OutputFormatEditable + { + [Newtonsoft.Json.JsonProperty("storageAttributes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public OutputFormatStorageAttributes StorageAttributes { get; set; } + + public string ToJson() + { + + return Newtonsoft.Json.JsonConvert.SerializeObject(this, new Newtonsoft.Json.JsonSerializerSettings()); + + } + public static StaticOutputFormatEditable FromJson(string data) { - return Newtonsoft.Json.JsonConvert.DeserializeObject(data, new Newtonsoft.Json.JsonSerializerSettings()); + return Newtonsoft.Json.JsonConvert.DeserializeObject(data, new Newtonsoft.Json.JsonSerializerSettings()); } } + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class OutputFormatStorageAttributes + { + [Newtonsoft.Json.JsonProperty("azure", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public AzureStorageAttributes Azure { get; set; } + + public string ToJson() + { + + return Newtonsoft.Json.JsonConvert.SerializeObject(this, new Newtonsoft.Json.JsonSerializerSettings()); + + } + public static OutputFormatStorageAttributes FromJson(string data) + { + + return Newtonsoft.Json.JsonConvert.DeserializeObject(data, new Newtonsoft.Json.JsonSerializerSettings()); + + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class AzureStorageAttributes + { + [Newtonsoft.Json.JsonProperty("accessTierPhases", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.Generic.ICollection AccessTierPhases { get; set; } + + public string ToJson() + { + + return Newtonsoft.Json.JsonConvert.SerializeObject(this, new Newtonsoft.Json.JsonSerializerSettings()); + + } + public static AzureStorageAttributes FromJson(string data) + { + + return Newtonsoft.Json.JsonConvert.DeserializeObject(data, new Newtonsoft.Json.JsonSerializerSettings()); + + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class AzureStorageAccessTierPhase + { + [Newtonsoft.Json.JsonProperty("tier", Required = Newtonsoft.Json.Required.Always)] + [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public AzureStorageAccessTier Tier { get; set; } + + [Newtonsoft.Json.JsonProperty("duration", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.TimeSpan? Duration { get; set; } + + public string ToJson() + { + + return Newtonsoft.Json.JsonConvert.SerializeObject(this, new Newtonsoft.Json.JsonSerializerSettings()); + + } + public static AzureStorageAccessTierPhase FromJson(string data) + { + + return Newtonsoft.Json.JsonConvert.DeserializeObject(data, new Newtonsoft.Json.JsonSerializerSettings()); + + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum AzureStorageAccessTier + { + + [System.Runtime.Serialization.EnumMember(Value = @"Hot")] + Hot = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"Cool")] + Cool = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Cold")] + Cold = 2, + + } + /// /// Represents the editable part of the output format. /// @@ -22101,15 +22190,9 @@ public static ContentDownloadsEditable FromJson(string data) } - /// - /// Represents an output format. - /// [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")] - public partial class OutputFormatDetail : OutputFormat + public partial class StaticOutputFormatDetail : StaticOutputFormat { - /// - /// Audit information. - /// [Newtonsoft.Json.JsonProperty("audit", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public UserAuditDetail Audit { get; set; } @@ -22119,10 +22202,10 @@ public string ToJson() return Newtonsoft.Json.JsonConvert.SerializeObject(this, new Newtonsoft.Json.JsonSerializerSettings()); } - public static OutputFormatDetail FromJson(string data) + public static StaticOutputFormatDetail FromJson(string data) { - return Newtonsoft.Json.JsonConvert.DeserializeObject(data, new Newtonsoft.Json.JsonSerializerSettings()); + return Newtonsoft.Json.JsonConvert.DeserializeObject(data, new Newtonsoft.Json.JsonSerializerSettings()); } diff --git a/swagger/CloudManagerSwagger.json b/swagger/CloudManagerSwagger.json index 56252055..61569881 100644 --- a/swagger/CloudManagerSwagger.json +++ b/swagger/CloudManagerSwagger.json @@ -11472,7 +11472,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OutputFormatDetail" + "$ref": "#/components/schemas/StaticOutputFormatDetail" } } } @@ -11601,7 +11601,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OutputFormatEditable" + "$ref": "#/components/schemas/StaticOutputFormatEditable" } } }, @@ -11865,7 +11865,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OutputFormat" + "$ref": "#/components/schemas/StaticOutputFormat" } } }, @@ -26962,7 +26962,7 @@ "type": "array", "nullable": true, "items": { - "$ref": "#/components/schemas/OutputFormat" + "$ref": "#/components/schemas/StaticOutputFormat" } }, "contentRetentionTime": { @@ -27425,39 +27425,113 @@ } } }, - "OutputFormat": { + "StaticOutputFormat": { "allOf": [ { - "$ref": "#/components/schemas/OutputFormatEditable" + "$ref": "#/components/schemas/StaticOutputFormatEditable" }, { "type": "object", - "description": "Represents an output format.", + "description": "Represents a static output format used in cloud manager.", "additionalProperties": false, "properties": { "id": { "type": "string", - "description": "Output format ID.", "nullable": true }, "system": { - "type": "boolean", - "description": "Marks if this is a system output format." + "type": "boolean" }, "dynamic": { - "type": "boolean", - "description": "A dynamic output format is not rendered automatically, but only on demand." + "type": "boolean" }, "dataExtraction": { - "type": "boolean", - "description": "Specifies if output format should be taken into account during data extraction." + "type": "boolean" }, "temporary": { - "type": "boolean", - "description": "Temporary outputs will not be backed up." + "type": "boolean" + } + } + } + ] + }, + "StaticOutputFormatEditable": { + "allOf": [ + { + "$ref": "#/components/schemas/OutputFormatEditable" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "storageAttributes": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/OutputFormatStorageAttributes" + } + ] + } + } + } + ] + }, + "OutputFormatStorageAttributes": { + "type": "object", + "additionalProperties": false, + "properties": { + "azure": { + "nullable": true, + "oneOf": [ + { + "$ref": "#/components/schemas/AzureStorageAttributes" } + ] + } + } + }, + "AzureStorageAttributes": { + "type": "object", + "additionalProperties": false, + "properties": { + "accessTierPhases": { + "type": "array", + "nullable": true, + "items": { + "$ref": "#/components/schemas/AzureStorageAccessTierPhase" } } + } + }, + "AzureStorageAccessTierPhase": { + "type": "object", + "additionalProperties": false, + "required": [ + "tier" + ], + "properties": { + "tier": { + "$ref": "#/components/schemas/AzureStorageAccessTier" + }, + "duration": { + "type": "string", + "format": "duration", + "nullable": true + } + } + }, + "AzureStorageAccessTier": { + "type": "string", + "description": "", + "x-enumNames": [ + "Hot", + "Cool", + "Cold" + ], + "enum": [ + "Hot", + "Cool", + "Cold" ] }, "OutputFormatEditable": { @@ -31713,18 +31787,16 @@ } } }, - "OutputFormatDetail": { + "StaticOutputFormatDetail": { "allOf": [ { - "$ref": "#/components/schemas/OutputFormat" + "$ref": "#/components/schemas/StaticOutputFormat" }, { "type": "object", - "description": "Represents an output format.", "additionalProperties": false, "properties": { "audit": { - "description": "Audit information.", "nullable": true, "oneOf": [ { From 12e8625e9b14d242891e545ad12db010697047be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=BCdel?= Date: Thu, 7 Dec 2023 12:25:55 +0100 Subject: [PATCH 2/2] PP9-18850: Regenerate again to keep obsolete attributes --- .../Generated/Contracts.Generated.cs | 2 ++ src/Picturepark.SDK.V1.Contract/Contracts.Generated.cs | 2 ++ swagger/CloudManagerSwagger.json | 8 ++++++-- swagger/PictureparkSwagger.json | 8 ++++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Picturepark.SDK.V1.CloudManager/Generated/Contracts.Generated.cs b/src/Picturepark.SDK.V1.CloudManager/Generated/Contracts.Generated.cs index aa44d6ec..4ddf61ad 100644 --- a/src/Picturepark.SDK.V1.CloudManager/Generated/Contracts.Generated.cs +++ b/src/Picturepark.SDK.V1.CloudManager/Generated/Contracts.Generated.cs @@ -17147,12 +17147,14 @@ public partial class StaticOutputFormat : StaticOutputFormatEditable public string Id { get; set; } [Newtonsoft.Json.JsonProperty("system", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete("Will be removed in future versions")] public bool System { get; set; } [Newtonsoft.Json.JsonProperty("dynamic", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public bool Dynamic { get; set; } [Newtonsoft.Json.JsonProperty("dataExtraction", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete("Will be removed in future versions")] public bool DataExtraction { get; set; } [Newtonsoft.Json.JsonProperty("temporary", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] diff --git a/src/Picturepark.SDK.V1.Contract/Contracts.Generated.cs b/src/Picturepark.SDK.V1.Contract/Contracts.Generated.cs index 26940bc2..8bbdec86 100644 --- a/src/Picturepark.SDK.V1.Contract/Contracts.Generated.cs +++ b/src/Picturepark.SDK.V1.Contract/Contracts.Generated.cs @@ -33648,6 +33648,7 @@ public partial class OutputFormat : OutputFormatEditable /// Marks if this is a system output format. /// [Newtonsoft.Json.JsonProperty("system", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete("Will be removed in future versions")] public bool System { get; set; } /// @@ -33660,6 +33661,7 @@ public partial class OutputFormat : OutputFormatEditable /// Specifies if output format should be taken into account during data extraction. /// [Newtonsoft.Json.JsonProperty("dataExtraction", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + [System.Obsolete("Will be removed in future versions")] public bool DataExtraction { get; set; } /// diff --git a/swagger/CloudManagerSwagger.json b/swagger/CloudManagerSwagger.json index 61569881..e57a1690 100644 --- a/swagger/CloudManagerSwagger.json +++ b/swagger/CloudManagerSwagger.json @@ -27440,13 +27440,17 @@ "nullable": true }, "system": { - "type": "boolean" + "type": "boolean", + "deprecated": true, + "x-deprecatedMessage": "Will be removed in future versions" }, "dynamic": { "type": "boolean" }, "dataExtraction": { - "type": "boolean" + "type": "boolean", + "deprecated": true, + "x-deprecatedMessage": "Will be removed in future versions" }, "temporary": { "type": "boolean" diff --git a/swagger/PictureparkSwagger.json b/swagger/PictureparkSwagger.json index b2bef4a0..677ec585 100644 --- a/swagger/PictureparkSwagger.json +++ b/swagger/PictureparkSwagger.json @@ -53882,7 +53882,9 @@ }, "system": { "type": "boolean", - "description": "Marks if this is a system output format." + "description": "Marks if this is a system output format.", + "deprecated": true, + "x-deprecatedMessage": "Will be removed in future versions" }, "dynamic": { "type": "boolean", @@ -53890,7 +53892,9 @@ }, "dataExtraction": { "type": "boolean", - "description": "Specifies if output format should be taken into account during data extraction." + "description": "Specifies if output format should be taken into account during data extraction.", + "deprecated": true, + "x-deprecatedMessage": "Will be removed in future versions" }, "temporary": { "type": "boolean",