| | 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 AmazonMWSLinkedService : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | writer.WritePropertyName("type"); |
| 0 | 20 | | writer.WriteStringValue(Type); |
| 0 | 21 | | if (Optional.IsDefined(ConnectVia)) |
| | 22 | | { |
| 0 | 23 | | writer.WritePropertyName("connectVia"); |
| 0 | 24 | | writer.WriteObjectValue(ConnectVia); |
| | 25 | | } |
| 0 | 26 | | if (Optional.IsDefined(Description)) |
| | 27 | | { |
| 0 | 28 | | writer.WritePropertyName("description"); |
| 0 | 29 | | writer.WriteStringValue(Description); |
| | 30 | | } |
| 0 | 31 | | if (Optional.IsCollectionDefined(Parameters)) |
| | 32 | | { |
| 0 | 33 | | writer.WritePropertyName("parameters"); |
| 0 | 34 | | writer.WriteStartObject(); |
| 0 | 35 | | foreach (var item in Parameters) |
| | 36 | | { |
| 0 | 37 | | writer.WritePropertyName(item.Key); |
| 0 | 38 | | writer.WriteObjectValue(item.Value); |
| | 39 | | } |
| 0 | 40 | | writer.WriteEndObject(); |
| | 41 | | } |
| 0 | 42 | | if (Optional.IsCollectionDefined(Annotations)) |
| | 43 | | { |
| 0 | 44 | | writer.WritePropertyName("annotations"); |
| 0 | 45 | | writer.WriteStartArray(); |
| 0 | 46 | | foreach (var item in Annotations) |
| | 47 | | { |
| 0 | 48 | | writer.WriteObjectValue(item); |
| | 49 | | } |
| 0 | 50 | | writer.WriteEndArray(); |
| | 51 | | } |
| 0 | 52 | | writer.WritePropertyName("typeProperties"); |
| 0 | 53 | | writer.WriteStartObject(); |
| 0 | 54 | | writer.WritePropertyName("endpoint"); |
| 0 | 55 | | writer.WriteObjectValue(Endpoint); |
| 0 | 56 | | writer.WritePropertyName("marketplaceID"); |
| 0 | 57 | | writer.WriteObjectValue(MarketplaceID); |
| 0 | 58 | | writer.WritePropertyName("sellerID"); |
| 0 | 59 | | writer.WriteObjectValue(SellerID); |
| 0 | 60 | | if (Optional.IsDefined(MwsAuthToken)) |
| | 61 | | { |
| 0 | 62 | | writer.WritePropertyName("mwsAuthToken"); |
| 0 | 63 | | writer.WriteObjectValue(MwsAuthToken); |
| | 64 | | } |
| 0 | 65 | | writer.WritePropertyName("accessKeyId"); |
| 0 | 66 | | writer.WriteObjectValue(AccessKeyId); |
| 0 | 67 | | if (Optional.IsDefined(SecretKey)) |
| | 68 | | { |
| 0 | 69 | | writer.WritePropertyName("secretKey"); |
| 0 | 70 | | writer.WriteObjectValue(SecretKey); |
| | 71 | | } |
| 0 | 72 | | if (Optional.IsDefined(UseEncryptedEndpoints)) |
| | 73 | | { |
| 0 | 74 | | writer.WritePropertyName("useEncryptedEndpoints"); |
| 0 | 75 | | writer.WriteObjectValue(UseEncryptedEndpoints); |
| | 76 | | } |
| 0 | 77 | | if (Optional.IsDefined(UseHostVerification)) |
| | 78 | | { |
| 0 | 79 | | writer.WritePropertyName("useHostVerification"); |
| 0 | 80 | | writer.WriteObjectValue(UseHostVerification); |
| | 81 | | } |
| 0 | 82 | | if (Optional.IsDefined(UsePeerVerification)) |
| | 83 | | { |
| 0 | 84 | | writer.WritePropertyName("usePeerVerification"); |
| 0 | 85 | | writer.WriteObjectValue(UsePeerVerification); |
| | 86 | | } |
| 0 | 87 | | if (Optional.IsDefined(EncryptedCredential)) |
| | 88 | | { |
| 0 | 89 | | writer.WritePropertyName("encryptedCredential"); |
| 0 | 90 | | writer.WriteObjectValue(EncryptedCredential); |
| | 91 | | } |
| 0 | 92 | | writer.WriteEndObject(); |
| 0 | 93 | | foreach (var item in AdditionalProperties) |
| | 94 | | { |
| 0 | 95 | | writer.WritePropertyName(item.Key); |
| 0 | 96 | | writer.WriteObjectValue(item.Value); |
| | 97 | | } |
| 0 | 98 | | writer.WriteEndObject(); |
| 0 | 99 | | } |
| | 100 | |
|
| | 101 | | internal static AmazonMWSLinkedService DeserializeAmazonMWSLinkedService(JsonElement element) |
| | 102 | | { |
| 0 | 103 | | string type = default; |
| 0 | 104 | | Optional<IntegrationRuntimeReference> connectVia = default; |
| 0 | 105 | | Optional<string> description = default; |
| 0 | 106 | | Optional<IDictionary<string, ParameterSpecification>> parameters = default; |
| 0 | 107 | | Optional<IList<object>> annotations = default; |
| 0 | 108 | | object endpoint = default; |
| 0 | 109 | | object marketplaceID = default; |
| 0 | 110 | | object sellerID = default; |
| 0 | 111 | | Optional<SecretBase> mwsAuthToken = default; |
| 0 | 112 | | object accessKeyId = default; |
| 0 | 113 | | Optional<SecretBase> secretKey = default; |
| 0 | 114 | | Optional<object> useEncryptedEndpoints = default; |
| 0 | 115 | | Optional<object> useHostVerification = default; |
| 0 | 116 | | Optional<object> usePeerVerification = default; |
| 0 | 117 | | Optional<object> encryptedCredential = default; |
| 0 | 118 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 119 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 120 | | foreach (var property in element.EnumerateObject()) |
| | 121 | | { |
| 0 | 122 | | if (property.NameEquals("type")) |
| | 123 | | { |
| 0 | 124 | | type = property.Value.GetString(); |
| 0 | 125 | | continue; |
| | 126 | | } |
| 0 | 127 | | if (property.NameEquals("connectVia")) |
| | 128 | | { |
| 0 | 129 | | connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value); |
| 0 | 130 | | continue; |
| | 131 | | } |
| 0 | 132 | | if (property.NameEquals("description")) |
| | 133 | | { |
| 0 | 134 | | description = property.Value.GetString(); |
| 0 | 135 | | continue; |
| | 136 | | } |
| 0 | 137 | | if (property.NameEquals("parameters")) |
| | 138 | | { |
| 0 | 139 | | Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio |
| 0 | 140 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 141 | | { |
| 0 | 142 | | dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property |
| | 143 | | } |
| 0 | 144 | | parameters = dictionary; |
| 0 | 145 | | continue; |
| | 146 | | } |
| 0 | 147 | | if (property.NameEquals("annotations")) |
| | 148 | | { |
| 0 | 149 | | List<object> array = new List<object>(); |
| 0 | 150 | | foreach (var item in property.Value.EnumerateArray()) |
| | 151 | | { |
| 0 | 152 | | array.Add(item.GetObject()); |
| | 153 | | } |
| 0 | 154 | | annotations = array; |
| 0 | 155 | | continue; |
| | 156 | | } |
| 0 | 157 | | if (property.NameEquals("typeProperties")) |
| | 158 | | { |
| 0 | 159 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 160 | | { |
| 0 | 161 | | if (property0.NameEquals("endpoint")) |
| | 162 | | { |
| 0 | 163 | | endpoint = property0.Value.GetObject(); |
| 0 | 164 | | continue; |
| | 165 | | } |
| 0 | 166 | | if (property0.NameEquals("marketplaceID")) |
| | 167 | | { |
| 0 | 168 | | marketplaceID = property0.Value.GetObject(); |
| 0 | 169 | | continue; |
| | 170 | | } |
| 0 | 171 | | if (property0.NameEquals("sellerID")) |
| | 172 | | { |
| 0 | 173 | | sellerID = property0.Value.GetObject(); |
| 0 | 174 | | continue; |
| | 175 | | } |
| 0 | 176 | | if (property0.NameEquals("mwsAuthToken")) |
| | 177 | | { |
| 0 | 178 | | mwsAuthToken = SecretBase.DeserializeSecretBase(property0.Value); |
| 0 | 179 | | continue; |
| | 180 | | } |
| 0 | 181 | | if (property0.NameEquals("accessKeyId")) |
| | 182 | | { |
| 0 | 183 | | accessKeyId = property0.Value.GetObject(); |
| 0 | 184 | | continue; |
| | 185 | | } |
| 0 | 186 | | if (property0.NameEquals("secretKey")) |
| | 187 | | { |
| 0 | 188 | | secretKey = SecretBase.DeserializeSecretBase(property0.Value); |
| 0 | 189 | | continue; |
| | 190 | | } |
| 0 | 191 | | if (property0.NameEquals("useEncryptedEndpoints")) |
| | 192 | | { |
| 0 | 193 | | useEncryptedEndpoints = property0.Value.GetObject(); |
| 0 | 194 | | continue; |
| | 195 | | } |
| 0 | 196 | | if (property0.NameEquals("useHostVerification")) |
| | 197 | | { |
| 0 | 198 | | useHostVerification = property0.Value.GetObject(); |
| 0 | 199 | | continue; |
| | 200 | | } |
| 0 | 201 | | if (property0.NameEquals("usePeerVerification")) |
| | 202 | | { |
| 0 | 203 | | usePeerVerification = property0.Value.GetObject(); |
| 0 | 204 | | continue; |
| | 205 | | } |
| 0 | 206 | | if (property0.NameEquals("encryptedCredential")) |
| | 207 | | { |
| 0 | 208 | | encryptedCredential = property0.Value.GetObject(); |
| | 209 | | continue; |
| | 210 | | } |
| | 211 | | } |
| | 212 | | continue; |
| | 213 | | } |
| 0 | 214 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 215 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 216 | | } |
| 0 | 217 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 218 | | return new AmazonMWSLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameter |
| | 219 | | } |
| | 220 | | } |
| | 221 | | } |