| | 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.Text.Json; |
| | 9 | | using Azure.Core; |
| | 10 | |
|
| | 11 | | namespace Azure.ResourceManager.Storage.Models |
| | 12 | | { |
| | 13 | | public partial class ActiveDirectoryProperties : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | writer.WritePropertyName("domainName"); |
| 0 | 19 | | writer.WriteStringValue(DomainName); |
| 0 | 20 | | writer.WritePropertyName("netBiosDomainName"); |
| 0 | 21 | | writer.WriteStringValue(NetBiosDomainName); |
| 0 | 22 | | writer.WritePropertyName("forestName"); |
| 0 | 23 | | writer.WriteStringValue(ForestName); |
| 0 | 24 | | writer.WritePropertyName("domainGuid"); |
| 0 | 25 | | writer.WriteStringValue(DomainGuid); |
| 0 | 26 | | writer.WritePropertyName("domainSid"); |
| 0 | 27 | | writer.WriteStringValue(DomainSid); |
| 0 | 28 | | writer.WritePropertyName("azureStorageSid"); |
| 0 | 29 | | writer.WriteStringValue(AzureStorageSid); |
| 0 | 30 | | writer.WriteEndObject(); |
| 0 | 31 | | } |
| | 32 | |
|
| | 33 | | internal static ActiveDirectoryProperties DeserializeActiveDirectoryProperties(JsonElement element) |
| | 34 | | { |
| 0 | 35 | | string domainName = default; |
| 0 | 36 | | string netBiosDomainName = default; |
| 0 | 37 | | string forestName = default; |
| 0 | 38 | | string domainGuid = default; |
| 0 | 39 | | string domainSid = default; |
| 0 | 40 | | string azureStorageSid = default; |
| 0 | 41 | | foreach (var property in element.EnumerateObject()) |
| | 42 | | { |
| 0 | 43 | | if (property.NameEquals("domainName")) |
| | 44 | | { |
| 0 | 45 | | domainName = property.Value.GetString(); |
| 0 | 46 | | continue; |
| | 47 | | } |
| 0 | 48 | | if (property.NameEquals("netBiosDomainName")) |
| | 49 | | { |
| 0 | 50 | | netBiosDomainName = property.Value.GetString(); |
| 0 | 51 | | continue; |
| | 52 | | } |
| 0 | 53 | | if (property.NameEquals("forestName")) |
| | 54 | | { |
| 0 | 55 | | forestName = property.Value.GetString(); |
| 0 | 56 | | continue; |
| | 57 | | } |
| 0 | 58 | | if (property.NameEquals("domainGuid")) |
| | 59 | | { |
| 0 | 60 | | domainGuid = property.Value.GetString(); |
| 0 | 61 | | continue; |
| | 62 | | } |
| 0 | 63 | | if (property.NameEquals("domainSid")) |
| | 64 | | { |
| 0 | 65 | | domainSid = property.Value.GetString(); |
| 0 | 66 | | continue; |
| | 67 | | } |
| 0 | 68 | | if (property.NameEquals("azureStorageSid")) |
| | 69 | | { |
| 0 | 70 | | azureStorageSid = property.Value.GetString(); |
| | 71 | | continue; |
| | 72 | | } |
| | 73 | | } |
| 0 | 74 | | return new ActiveDirectoryProperties(domainName, netBiosDomainName, forestName, domainGuid, domainSid, azure |
| | 75 | | } |
| | 76 | | } |
| | 77 | | } |