internal static ExpressRouteLinkMacSecConfig DeserializeExpressRouteLinkMacSecConfig(JsonElement element) { Optional <string> cknSecretIdentifier = default; Optional <string> cakSecretIdentifier = default; Optional <ExpressRouteLinkMacSecCipher> cipher = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("cknSecretIdentifier")) { cknSecretIdentifier = property.Value.GetString(); continue; } if (property.NameEquals("cakSecretIdentifier")) { cakSecretIdentifier = property.Value.GetString(); continue; } if (property.NameEquals("cipher")) { cipher = new ExpressRouteLinkMacSecCipher(property.Value.GetString()); continue; } } return(new ExpressRouteLinkMacSecConfig(cknSecretIdentifier.Value, cakSecretIdentifier.Value, Optional.ToNullable(cipher))); }
internal static ExpressRouteLinkMacSecConfig DeserializeExpressRouteLinkMacSecConfig(JsonElement element) { string cknSecretIdentifier = default; string cakSecretIdentifier = default; ExpressRouteLinkMacSecCipher?cipher = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("cknSecretIdentifier")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } cknSecretIdentifier = property.Value.GetString(); continue; } if (property.NameEquals("cakSecretIdentifier")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } cakSecretIdentifier = property.Value.GetString(); continue; } if (property.NameEquals("cipher")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } cipher = new ExpressRouteLinkMacSecCipher(property.Value.GetString()); continue; } } return(new ExpressRouteLinkMacSecConfig(cknSecretIdentifier, cakSecretIdentifier, cipher)); }