Exemplo n.º 1
0
        internal static ArmApplicationDefinitionArtifact DeserializeArmApplicationDefinitionArtifact(JsonElement element)
        {
            ArmApplicationDefinitionArtifactName name = default;
            Uri uri = default;
            ArmApplicationArtifactType type = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = new ArmApplicationDefinitionArtifactName(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("uri"))
                {
                    uri = new Uri(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString().ToArmApplicationArtifactType();
                    continue;
                }
            }
            return(new ArmApplicationDefinitionArtifact(name, uri, type));
        }
Exemplo n.º 2
0
        public ArmApplicationDefinitionArtifact(ArmApplicationDefinitionArtifactName name, Uri uri, ArmApplicationArtifactType armApplicationArtifactType)
        {
            if (uri == null)
            {
                throw new ArgumentNullException(nameof(uri));
            }

            Name = name;
            Uri  = uri;
            ArmApplicationArtifactType = armApplicationArtifactType;
        }