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)));
        }
Exemplo n.º 2
0
        internal static ExpressRouteLinkMacSecConfig DeserializeExpressRouteLinkMacSecConfig(JsonElement element)
        {
            Optional <string> cknSecretIdentifier              = default;
            Optional <string> cakSecretIdentifier              = default;
            Optional <ExpressRouteLinkMacSecCipher>   cipher   = default;
            Optional <ExpressRouteLinkMacSecSciState> sciState = 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"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    cipher = new ExpressRouteLinkMacSecCipher(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("sciState"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sciState = new ExpressRouteLinkMacSecSciState(property.Value.GetString());
                    continue;
                }
            }
            return(new ExpressRouteLinkMacSecConfig(cknSecretIdentifier.Value, cakSecretIdentifier.Value, Optional.ToNullable(cipher), Optional.ToNullable(sciState)));
        }
Exemplo n.º 3
0
        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));
        }