Пример #1
0
 internal VaultAccessPolicyParameters(string id, string name, string type, string location, VaultAccessPolicyProperties properties)
 {
     Id         = id;
     Name       = name;
     Type       = type;
     Location   = location;
     Properties = properties;
 }
Пример #2
0
        public VaultAccessPolicyParameters(VaultAccessPolicyProperties properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            Properties = properties;
        }
        internal static VaultAccessPolicyParameters DeserializeVaultAccessPolicyParameters(JsonElement element)
        {
            string id       = default;
            string name     = default;
            string type     = default;
            string location = default;
            VaultAccessPolicyProperties properties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    properties = VaultAccessPolicyProperties.DeserializeVaultAccessPolicyProperties(property.Value);
                    continue;
                }
            }
            return(new VaultAccessPolicyParameters(id, name, type, location, properties));
        }
Пример #4
0
        internal static VaultAccessPolicyParameters DeserializeVaultAccessPolicyParameters(JsonElement element)
        {
            Optional <AzureLocation>    location   = default;
            VaultAccessPolicyProperties properties = default;
            ResourceIdentifier          id         = default;
            string       name       = default;
            ResourceType type       = default;
            SystemData   systemData = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("location"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    location = new AzureLocation(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    properties = VaultAccessPolicyProperties.DeserializeVaultAccessPolicyProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
            }
            return(new VaultAccessPolicyParameters(id, name, type, systemData, Optional.ToNullable(location), properties));
        }
Пример #5
0
        internal static VaultAccessPolicyParameters DeserializeVaultAccessPolicyParameters(JsonElement element)
        {
            Optional <string>           location   = default;
            VaultAccessPolicyProperties properties = default;
            ResourceIdentifier          id         = default;
            string       name       = default;
            ResourceType type       = default;
            SystemData   systemData = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    properties = VaultAccessPolicyProperties.DeserializeVaultAccessPolicyProperties(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
            }
            return(new VaultAccessPolicyParameters(id, name, type, systemData, location.Value, properties));
        }
        internal static VaultAccessPolicyParameters DeserializeVaultAccessPolicyParameters(JsonElement element)
        {
            Optional <string>           id         = default;
            Optional <string>           name       = default;
            Optional <string>           type       = default;
            Optional <string>           location   = default;
            VaultAccessPolicyProperties properties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    properties = VaultAccessPolicyProperties.DeserializeVaultAccessPolicyProperties(property.Value);
                    continue;
                }
            }
            return(new VaultAccessPolicyParameters(id.Value, name.Value, type.Value, location.Value, properties));
        }
Пример #7
0
 internal VaultAccessPolicyParameters(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, string location, VaultAccessPolicyProperties properties) : base(id, name, type, systemData)
 {
     Location   = location;
     Properties = properties;
 }