|  |  | 1 |  | // Copyright (c) Microsoft Corporation. All rights reserved. | 
|  |  | 2 |  | // Licensed under the MIT License. | 
|  |  | 3 |  |  | 
|  |  | 4 |  | // <auto-generated/> | 
|  |  | 5 |  |  | 
|  |  | 6 |  | #nullable disable | 
|  |  | 7 |  |  | 
|  |  | 8 |  | using System.Collections.Generic; | 
|  |  | 9 |  | using System.Text.Json; | 
|  |  | 10 |  | using Azure.Core; | 
|  |  | 11 |  |  | 
|  |  | 12 |  | namespace Azure.Analytics.Synapse.Artifacts.Models | 
|  |  | 13 |  | { | 
|  |  | 14 |  |     public partial class AzureMLUpdateResourceActivity : IUtf8JsonSerializable | 
|  |  | 15 |  |     { | 
|  |  | 16 |  |         void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) | 
|  |  | 17 |  |         { | 
|  | 0 | 18 |  |             writer.WriteStartObject(); | 
|  | 0 | 19 |  |             if (Optional.IsDefined(LinkedServiceName)) | 
|  |  | 20 |  |             { | 
|  | 0 | 21 |  |                 writer.WritePropertyName("linkedServiceName"); | 
|  | 0 | 22 |  |                 writer.WriteObjectValue(LinkedServiceName); | 
|  |  | 23 |  |             } | 
|  | 0 | 24 |  |             if (Optional.IsDefined(Policy)) | 
|  |  | 25 |  |             { | 
|  | 0 | 26 |  |                 writer.WritePropertyName("policy"); | 
|  | 0 | 27 |  |                 writer.WriteObjectValue(Policy); | 
|  |  | 28 |  |             } | 
|  | 0 | 29 |  |             writer.WritePropertyName("name"); | 
|  | 0 | 30 |  |             writer.WriteStringValue(Name); | 
|  | 0 | 31 |  |             writer.WritePropertyName("type"); | 
|  | 0 | 32 |  |             writer.WriteStringValue(Type); | 
|  | 0 | 33 |  |             if (Optional.IsDefined(Description)) | 
|  |  | 34 |  |             { | 
|  | 0 | 35 |  |                 writer.WritePropertyName("description"); | 
|  | 0 | 36 |  |                 writer.WriteStringValue(Description); | 
|  |  | 37 |  |             } | 
|  | 0 | 38 |  |             if (Optional.IsCollectionDefined(DependsOn)) | 
|  |  | 39 |  |             { | 
|  | 0 | 40 |  |                 writer.WritePropertyName("dependsOn"); | 
|  | 0 | 41 |  |                 writer.WriteStartArray(); | 
|  | 0 | 42 |  |                 foreach (var item in DependsOn) | 
|  |  | 43 |  |                 { | 
|  | 0 | 44 |  |                     writer.WriteObjectValue(item); | 
|  |  | 45 |  |                 } | 
|  | 0 | 46 |  |                 writer.WriteEndArray(); | 
|  |  | 47 |  |             } | 
|  | 0 | 48 |  |             if (Optional.IsCollectionDefined(UserProperties)) | 
|  |  | 49 |  |             { | 
|  | 0 | 50 |  |                 writer.WritePropertyName("userProperties"); | 
|  | 0 | 51 |  |                 writer.WriteStartArray(); | 
|  | 0 | 52 |  |                 foreach (var item in UserProperties) | 
|  |  | 53 |  |                 { | 
|  | 0 | 54 |  |                     writer.WriteObjectValue(item); | 
|  |  | 55 |  |                 } | 
|  | 0 | 56 |  |                 writer.WriteEndArray(); | 
|  |  | 57 |  |             } | 
|  | 0 | 58 |  |             writer.WritePropertyName("typeProperties"); | 
|  | 0 | 59 |  |             writer.WriteStartObject(); | 
|  | 0 | 60 |  |             writer.WritePropertyName("trainedModelName"); | 
|  | 0 | 61 |  |             writer.WriteObjectValue(TrainedModelName); | 
|  | 0 | 62 |  |             writer.WritePropertyName("trainedModelLinkedServiceName"); | 
|  | 0 | 63 |  |             writer.WriteObjectValue(TrainedModelLinkedServiceName); | 
|  | 0 | 64 |  |             writer.WritePropertyName("trainedModelFilePath"); | 
|  | 0 | 65 |  |             writer.WriteObjectValue(TrainedModelFilePath); | 
|  | 0 | 66 |  |             writer.WriteEndObject(); | 
|  | 0 | 67 |  |             foreach (var item in AdditionalProperties) | 
|  |  | 68 |  |             { | 
|  | 0 | 69 |  |                 writer.WritePropertyName(item.Key); | 
|  | 0 | 70 |  |                 writer.WriteObjectValue(item.Value); | 
|  |  | 71 |  |             } | 
|  | 0 | 72 |  |             writer.WriteEndObject(); | 
|  | 0 | 73 |  |         } | 
|  |  | 74 |  |  | 
|  |  | 75 |  |         internal static AzureMLUpdateResourceActivity DeserializeAzureMLUpdateResourceActivity(JsonElement element) | 
|  |  | 76 |  |         { | 
|  | 0 | 77 |  |             Optional<LinkedServiceReference> linkedServiceName = default; | 
|  | 0 | 78 |  |             Optional<ActivityPolicy> policy = default; | 
|  | 0 | 79 |  |             string name = default; | 
|  | 0 | 80 |  |             string type = default; | 
|  | 0 | 81 |  |             Optional<string> description = default; | 
|  | 0 | 82 |  |             Optional<IList<ActivityDependency>> dependsOn = default; | 
|  | 0 | 83 |  |             Optional<IList<UserProperty>> userProperties = default; | 
|  | 0 | 84 |  |             object trainedModelName = default; | 
|  | 0 | 85 |  |             LinkedServiceReference trainedModelLinkedServiceName = default; | 
|  | 0 | 86 |  |             object trainedModelFilePath = default; | 
|  | 0 | 87 |  |             IDictionary<string, object> additionalProperties = default; | 
|  | 0 | 88 |  |             Dictionary<string, object> additionalPropertiesDictionary = default; | 
|  | 0 | 89 |  |             foreach (var property in element.EnumerateObject()) | 
|  |  | 90 |  |             { | 
|  | 0 | 91 |  |                 if (property.NameEquals("linkedServiceName")) | 
|  |  | 92 |  |                 { | 
|  | 0 | 93 |  |                     linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value); | 
|  | 0 | 94 |  |                     continue; | 
|  |  | 95 |  |                 } | 
|  | 0 | 96 |  |                 if (property.NameEquals("policy")) | 
|  |  | 97 |  |                 { | 
|  | 0 | 98 |  |                     policy = ActivityPolicy.DeserializeActivityPolicy(property.Value); | 
|  | 0 | 99 |  |                     continue; | 
|  |  | 100 |  |                 } | 
|  | 0 | 101 |  |                 if (property.NameEquals("name")) | 
|  |  | 102 |  |                 { | 
|  | 0 | 103 |  |                     name = property.Value.GetString(); | 
|  | 0 | 104 |  |                     continue; | 
|  |  | 105 |  |                 } | 
|  | 0 | 106 |  |                 if (property.NameEquals("type")) | 
|  |  | 107 |  |                 { | 
|  | 0 | 108 |  |                     type = property.Value.GetString(); | 
|  | 0 | 109 |  |                     continue; | 
|  |  | 110 |  |                 } | 
|  | 0 | 111 |  |                 if (property.NameEquals("description")) | 
|  |  | 112 |  |                 { | 
|  | 0 | 113 |  |                     description = property.Value.GetString(); | 
|  | 0 | 114 |  |                     continue; | 
|  |  | 115 |  |                 } | 
|  | 0 | 116 |  |                 if (property.NameEquals("dependsOn")) | 
|  |  | 117 |  |                 { | 
|  | 0 | 118 |  |                     List<ActivityDependency> array = new List<ActivityDependency>(); | 
|  | 0 | 119 |  |                     foreach (var item in property.Value.EnumerateArray()) | 
|  |  | 120 |  |                     { | 
|  | 0 | 121 |  |                         array.Add(ActivityDependency.DeserializeActivityDependency(item)); | 
|  |  | 122 |  |                     } | 
|  | 0 | 123 |  |                     dependsOn = array; | 
|  | 0 | 124 |  |                     continue; | 
|  |  | 125 |  |                 } | 
|  | 0 | 126 |  |                 if (property.NameEquals("userProperties")) | 
|  |  | 127 |  |                 { | 
|  | 0 | 128 |  |                     List<UserProperty> array = new List<UserProperty>(); | 
|  | 0 | 129 |  |                     foreach (var item in property.Value.EnumerateArray()) | 
|  |  | 130 |  |                     { | 
|  | 0 | 131 |  |                         array.Add(UserProperty.DeserializeUserProperty(item)); | 
|  |  | 132 |  |                     } | 
|  | 0 | 133 |  |                     userProperties = array; | 
|  | 0 | 134 |  |                     continue; | 
|  |  | 135 |  |                 } | 
|  | 0 | 136 |  |                 if (property.NameEquals("typeProperties")) | 
|  |  | 137 |  |                 { | 
|  | 0 | 138 |  |                     foreach (var property0 in property.Value.EnumerateObject()) | 
|  |  | 139 |  |                     { | 
|  | 0 | 140 |  |                         if (property0.NameEquals("trainedModelName")) | 
|  |  | 141 |  |                         { | 
|  | 0 | 142 |  |                             trainedModelName = property0.Value.GetObject(); | 
|  | 0 | 143 |  |                             continue; | 
|  |  | 144 |  |                         } | 
|  | 0 | 145 |  |                         if (property0.NameEquals("trainedModelLinkedServiceName")) | 
|  |  | 146 |  |                         { | 
|  | 0 | 147 |  |                             trainedModelLinkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(pro | 
|  | 0 | 148 |  |                             continue; | 
|  |  | 149 |  |                         } | 
|  | 0 | 150 |  |                         if (property0.NameEquals("trainedModelFilePath")) | 
|  |  | 151 |  |                         { | 
|  | 0 | 152 |  |                             trainedModelFilePath = property0.Value.GetObject(); | 
|  |  | 153 |  |                             continue; | 
|  |  | 154 |  |                         } | 
|  |  | 155 |  |                     } | 
|  |  | 156 |  |                     continue; | 
|  |  | 157 |  |                 } | 
|  | 0 | 158 |  |                 additionalPropertiesDictionary ??= new Dictionary<string, object>(); | 
|  | 0 | 159 |  |                 additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); | 
|  |  | 160 |  |             } | 
|  | 0 | 161 |  |             additionalProperties = additionalPropertiesDictionary; | 
|  | 0 | 162 |  |             return new AzureMLUpdateResourceActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional | 
|  |  | 163 |  |         } | 
|  |  | 164 |  |     } | 
|  |  | 165 |  | } |