| | 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 HBaseLinkedService : 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("host"); |
| 0 | 55 | | writer.WriteObjectValue(Host); |
| 0 | 56 | | if (Optional.IsDefined(Port)) |
| | 57 | | { |
| 0 | 58 | | writer.WritePropertyName("port"); |
| 0 | 59 | | writer.WriteObjectValue(Port); |
| | 60 | | } |
| 0 | 61 | | if (Optional.IsDefined(HttpPath)) |
| | 62 | | { |
| 0 | 63 | | writer.WritePropertyName("httpPath"); |
| 0 | 64 | | writer.WriteObjectValue(HttpPath); |
| | 65 | | } |
| 0 | 66 | | writer.WritePropertyName("authenticationType"); |
| 0 | 67 | | writer.WriteStringValue(AuthenticationType.ToString()); |
| 0 | 68 | | if (Optional.IsDefined(Username)) |
| | 69 | | { |
| 0 | 70 | | writer.WritePropertyName("username"); |
| 0 | 71 | | writer.WriteObjectValue(Username); |
| | 72 | | } |
| 0 | 73 | | if (Optional.IsDefined(Password)) |
| | 74 | | { |
| 0 | 75 | | writer.WritePropertyName("password"); |
| 0 | 76 | | writer.WriteObjectValue(Password); |
| | 77 | | } |
| 0 | 78 | | if (Optional.IsDefined(EnableSsl)) |
| | 79 | | { |
| 0 | 80 | | writer.WritePropertyName("enableSsl"); |
| 0 | 81 | | writer.WriteObjectValue(EnableSsl); |
| | 82 | | } |
| 0 | 83 | | if (Optional.IsDefined(TrustedCertPath)) |
| | 84 | | { |
| 0 | 85 | | writer.WritePropertyName("trustedCertPath"); |
| 0 | 86 | | writer.WriteObjectValue(TrustedCertPath); |
| | 87 | | } |
| 0 | 88 | | if (Optional.IsDefined(AllowHostNameCNMismatch)) |
| | 89 | | { |
| 0 | 90 | | writer.WritePropertyName("allowHostNameCNMismatch"); |
| 0 | 91 | | writer.WriteObjectValue(AllowHostNameCNMismatch); |
| | 92 | | } |
| 0 | 93 | | if (Optional.IsDefined(AllowSelfSignedServerCert)) |
| | 94 | | { |
| 0 | 95 | | writer.WritePropertyName("allowSelfSignedServerCert"); |
| 0 | 96 | | writer.WriteObjectValue(AllowSelfSignedServerCert); |
| | 97 | | } |
| 0 | 98 | | if (Optional.IsDefined(EncryptedCredential)) |
| | 99 | | { |
| 0 | 100 | | writer.WritePropertyName("encryptedCredential"); |
| 0 | 101 | | writer.WriteObjectValue(EncryptedCredential); |
| | 102 | | } |
| 0 | 103 | | writer.WriteEndObject(); |
| 0 | 104 | | foreach (var item in AdditionalProperties) |
| | 105 | | { |
| 0 | 106 | | writer.WritePropertyName(item.Key); |
| 0 | 107 | | writer.WriteObjectValue(item.Value); |
| | 108 | | } |
| 0 | 109 | | writer.WriteEndObject(); |
| 0 | 110 | | } |
| | 111 | |
|
| | 112 | | internal static HBaseLinkedService DeserializeHBaseLinkedService(JsonElement element) |
| | 113 | | { |
| 0 | 114 | | string type = default; |
| 0 | 115 | | Optional<IntegrationRuntimeReference> connectVia = default; |
| 0 | 116 | | Optional<string> description = default; |
| 0 | 117 | | Optional<IDictionary<string, ParameterSpecification>> parameters = default; |
| 0 | 118 | | Optional<IList<object>> annotations = default; |
| 0 | 119 | | object host = default; |
| 0 | 120 | | Optional<object> port = default; |
| 0 | 121 | | Optional<object> httpPath = default; |
| 0 | 122 | | HBaseAuthenticationType authenticationType = default; |
| 0 | 123 | | Optional<object> username = default; |
| 0 | 124 | | Optional<SecretBase> password = default; |
| 0 | 125 | | Optional<object> enableSsl = default; |
| 0 | 126 | | Optional<object> trustedCertPath = default; |
| 0 | 127 | | Optional<object> allowHostNameCNMismatch = default; |
| 0 | 128 | | Optional<object> allowSelfSignedServerCert = default; |
| 0 | 129 | | Optional<object> encryptedCredential = default; |
| 0 | 130 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 131 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 132 | | foreach (var property in element.EnumerateObject()) |
| | 133 | | { |
| 0 | 134 | | if (property.NameEquals("type")) |
| | 135 | | { |
| 0 | 136 | | type = property.Value.GetString(); |
| 0 | 137 | | continue; |
| | 138 | | } |
| 0 | 139 | | if (property.NameEquals("connectVia")) |
| | 140 | | { |
| 0 | 141 | | connectVia = IntegrationRuntimeReference.DeserializeIntegrationRuntimeReference(property.Value); |
| 0 | 142 | | continue; |
| | 143 | | } |
| 0 | 144 | | if (property.NameEquals("description")) |
| | 145 | | { |
| 0 | 146 | | description = property.Value.GetString(); |
| 0 | 147 | | continue; |
| | 148 | | } |
| 0 | 149 | | if (property.NameEquals("parameters")) |
| | 150 | | { |
| 0 | 151 | | Dictionary<string, ParameterSpecification> dictionary = new Dictionary<string, ParameterSpecificatio |
| 0 | 152 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 153 | | { |
| 0 | 154 | | dictionary.Add(property0.Name, ParameterSpecification.DeserializeParameterSpecification(property |
| | 155 | | } |
| 0 | 156 | | parameters = dictionary; |
| 0 | 157 | | continue; |
| | 158 | | } |
| 0 | 159 | | if (property.NameEquals("annotations")) |
| | 160 | | { |
| 0 | 161 | | List<object> array = new List<object>(); |
| 0 | 162 | | foreach (var item in property.Value.EnumerateArray()) |
| | 163 | | { |
| 0 | 164 | | array.Add(item.GetObject()); |
| | 165 | | } |
| 0 | 166 | | annotations = array; |
| 0 | 167 | | continue; |
| | 168 | | } |
| 0 | 169 | | if (property.NameEquals("typeProperties")) |
| | 170 | | { |
| 0 | 171 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 172 | | { |
| 0 | 173 | | if (property0.NameEquals("host")) |
| | 174 | | { |
| 0 | 175 | | host = property0.Value.GetObject(); |
| 0 | 176 | | continue; |
| | 177 | | } |
| 0 | 178 | | if (property0.NameEquals("port")) |
| | 179 | | { |
| 0 | 180 | | port = property0.Value.GetObject(); |
| 0 | 181 | | continue; |
| | 182 | | } |
| 0 | 183 | | if (property0.NameEquals("httpPath")) |
| | 184 | | { |
| 0 | 185 | | httpPath = property0.Value.GetObject(); |
| 0 | 186 | | continue; |
| | 187 | | } |
| 0 | 188 | | if (property0.NameEquals("authenticationType")) |
| | 189 | | { |
| 0 | 190 | | authenticationType = new HBaseAuthenticationType(property0.Value.GetString()); |
| 0 | 191 | | continue; |
| | 192 | | } |
| 0 | 193 | | if (property0.NameEquals("username")) |
| | 194 | | { |
| 0 | 195 | | username = property0.Value.GetObject(); |
| 0 | 196 | | continue; |
| | 197 | | } |
| 0 | 198 | | if (property0.NameEquals("password")) |
| | 199 | | { |
| 0 | 200 | | password = SecretBase.DeserializeSecretBase(property0.Value); |
| 0 | 201 | | continue; |
| | 202 | | } |
| 0 | 203 | | if (property0.NameEquals("enableSsl")) |
| | 204 | | { |
| 0 | 205 | | enableSsl = property0.Value.GetObject(); |
| 0 | 206 | | continue; |
| | 207 | | } |
| 0 | 208 | | if (property0.NameEquals("trustedCertPath")) |
| | 209 | | { |
| 0 | 210 | | trustedCertPath = property0.Value.GetObject(); |
| 0 | 211 | | continue; |
| | 212 | | } |
| 0 | 213 | | if (property0.NameEquals("allowHostNameCNMismatch")) |
| | 214 | | { |
| 0 | 215 | | allowHostNameCNMismatch = property0.Value.GetObject(); |
| 0 | 216 | | continue; |
| | 217 | | } |
| 0 | 218 | | if (property0.NameEquals("allowSelfSignedServerCert")) |
| | 219 | | { |
| 0 | 220 | | allowSelfSignedServerCert = property0.Value.GetObject(); |
| 0 | 221 | | continue; |
| | 222 | | } |
| 0 | 223 | | if (property0.NameEquals("encryptedCredential")) |
| | 224 | | { |
| 0 | 225 | | encryptedCredential = property0.Value.GetObject(); |
| | 226 | | continue; |
| | 227 | | } |
| | 228 | | } |
| | 229 | | continue; |
| | 230 | | } |
| 0 | 231 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 232 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 233 | | } |
| 0 | 234 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 235 | | return new HBaseLinkedService(type, connectVia.Value, description.Value, Optional.ToDictionary(parameters), |
| | 236 | | } |
| | 237 | | } |
| | 238 | | } |