From a4a5b8e89da60c35fcce0b7b17830bb86b11cea6 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 18 Mar 2024 10:15:24 +0000 Subject: [PATCH] CodeGen from PR 28294 in Azure/azure-rest-api-specs Merge 7e01a14382b71517575ec1e81f39f877a83acd4b into 9158709864db10cec00c04c6544d6fddf43fcc37 --- ...ourceManager.DataFactory.netstandard2.0.cs | 3 +- .../DataFactoryExpressionV2.Serialization.cs | 43 ++++++++++++++++--- .../Models/DataFactoryExpressionV2.cs | 38 ++++++++++++++-- .../Models/DataFactoryExpressionV2Type.cs | 3 ++ .../src/autorest.md | 2 +- 5 files changed, 78 insertions(+), 11 deletions(-) diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/api/Azure.ResourceManager.DataFactory.netstandard2.0.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/api/Azure.ResourceManager.DataFactory.netstandard2.0.cs index 644f44f1225a5..0bf6160155f02 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/api/Azure.ResourceManager.DataFactory.netstandard2.0.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/api/Azure.ResourceManager.DataFactory.netstandard2.0.cs @@ -3239,7 +3239,7 @@ public partial class DataFactoryExpressionV2 : System.ClientModel.Primitives.IJs { public DataFactoryExpressionV2() { } public System.Collections.Generic.IList Operands { get { throw null; } } - public string Operator { get { throw null; } set { } } + public System.Collections.Generic.IList Operator { get { throw null; } } public Azure.ResourceManager.DataFactory.Models.DataFactoryExpressionV2Type? V2Type { get { throw null; } set { } } public string Value { get { throw null; } set { } } Azure.ResourceManager.DataFactory.Models.DataFactoryExpressionV2 System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3257,6 +3257,7 @@ public DataFactoryExpressionV2() { } public static Azure.ResourceManager.DataFactory.Models.DataFactoryExpressionV2Type Binary { get { throw null; } } public static Azure.ResourceManager.DataFactory.Models.DataFactoryExpressionV2Type Constant { get { throw null; } } public static Azure.ResourceManager.DataFactory.Models.DataFactoryExpressionV2Type Field { get { throw null; } } + public static Azure.ResourceManager.DataFactory.Models.DataFactoryExpressionV2Type NAry { get { throw null; } } public static Azure.ResourceManager.DataFactory.Models.DataFactoryExpressionV2Type Unary { get { throw null; } } public bool Equals(Azure.ResourceManager.DataFactory.Models.DataFactoryExpressionV2Type other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataFactoryExpressionV2.Serialization.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataFactoryExpressionV2.Serialization.cs index a892ef0dc3682..af887a2504faf 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataFactoryExpressionV2.Serialization.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataFactoryExpressionV2.Serialization.cs @@ -37,10 +37,27 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WritePropertyName("value"u8); writer.WriteStringValue(Value); } - if (Optional.IsDefined(Operator)) + if (Optional.IsCollectionDefined(Operator)) { writer.WritePropertyName("operator"u8); - writer.WriteStringValue(Operator); + writer.WriteStartArray(); + foreach (var item in Operator) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item); +#else + using (JsonDocument document = JsonDocument.Parse(item)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndArray(); } if (Optional.IsCollectionDefined(Operands)) { @@ -92,7 +109,7 @@ internal static DataFactoryExpressionV2 DeserializeDataFactoryExpressionV2(JsonE } DataFactoryExpressionV2Type? type = default; string value = default; - string @operator = default; + IList @operator = default; IList operands = default; IDictionary serializedAdditionalRawData = default; Dictionary additionalPropertiesDictionary = new Dictionary(); @@ -114,7 +131,23 @@ internal static DataFactoryExpressionV2 DeserializeDataFactoryExpressionV2(JsonE } if (property.NameEquals("operator"u8)) { - @operator = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(BinaryData.FromString(item.GetRawText())); + } + } + @operator = array; continue; } if (property.NameEquals("operands"u8)) @@ -137,7 +170,7 @@ internal static DataFactoryExpressionV2 DeserializeDataFactoryExpressionV2(JsonE } } serializedAdditionalRawData = additionalPropertiesDictionary; - return new DataFactoryExpressionV2(type, value, @operator, operands ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new DataFactoryExpressionV2(type, value, @operator ?? new ChangeTrackingList(), operands ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataFactoryExpressionV2.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataFactoryExpressionV2.cs index 01079cfd4e346..692ce8906eb15 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataFactoryExpressionV2.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataFactoryExpressionV2.cs @@ -49,16 +49,17 @@ public partial class DataFactoryExpressionV2 /// Initializes a new instance of . public DataFactoryExpressionV2() { + Operator = new ChangeTrackingList(); Operands = new ChangeTrackingList(); } /// Initializes a new instance of . /// Type of expressions supported by the system. Type: string. /// Value for Constant/Field Type: string. - /// Expression operator value Type: string. + /// Expression operator value Type: list of strings. /// List of nested expressions. /// Keeps track of any properties unknown to the library. - internal DataFactoryExpressionV2(DataFactoryExpressionV2Type? v2Type, string value, string @operator, IList operands, IDictionary serializedAdditionalRawData) + internal DataFactoryExpressionV2(DataFactoryExpressionV2Type? v2Type, string value, IList @operator, IList operands, IDictionary serializedAdditionalRawData) { V2Type = v2Type; Value = value; @@ -71,8 +72,37 @@ internal DataFactoryExpressionV2(DataFactoryExpressionV2Type? v2Type, string val public DataFactoryExpressionV2Type? V2Type { get; set; } /// Value for Constant/Field Type: string. public string Value { get; set; } - /// Expression operator value Type: string. - public string Operator { get; set; } + /// + /// Expression operator value Type: list of strings. + /// + /// To assign an object to the element of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IList Operator { get; } /// List of nested expressions. public IList Operands { get; } } diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataFactoryExpressionV2Type.cs b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataFactoryExpressionV2Type.cs index 31d6dd227588b..4e88222bd176d 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataFactoryExpressionV2Type.cs +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Generated/Models/DataFactoryExpressionV2Type.cs @@ -26,6 +26,7 @@ public DataFactoryExpressionV2Type(string value) private const string FieldValue = "Field"; private const string UnaryValue = "Unary"; private const string BinaryValue = "Binary"; + private const string NAryValue = "NAry"; /// Constant. public static DataFactoryExpressionV2Type Constant { get; } = new DataFactoryExpressionV2Type(ConstantValue); @@ -35,6 +36,8 @@ public DataFactoryExpressionV2Type(string value) public static DataFactoryExpressionV2Type Unary { get; } = new DataFactoryExpressionV2Type(UnaryValue); /// Binary. public static DataFactoryExpressionV2Type Binary { get; } = new DataFactoryExpressionV2Type(BinaryValue); + /// NAry. + public static DataFactoryExpressionV2Type NAry { get; } = new DataFactoryExpressionV2Type(NAryValue); /// Determines if two values are the same. public static bool operator ==(DataFactoryExpressionV2Type left, DataFactoryExpressionV2Type right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/autorest.md b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/autorest.md index 62493124ee1de..b8e38603a3c93 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/autorest.md +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: DataFactory namespace: Azure.ResourceManager.DataFactory -require: https://github.com/Azure/azure-rest-api-specs/blob/98df3588284c0b77389e981ef04aa93fed89037e/specification/datafactory/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/datafactory/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: