Ejemplo n.º 1
0
        public EnvironmentVersionData(EnvironmentVersionProperties properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            Properties = properties;
        }
Ejemplo n.º 2
0
        internal static EnvironmentVersionData DeserializeEnvironmentVersionData(JsonElement element)
        {
            EnvironmentVersionProperties properties = default;
            ResourceIdentifier           id         = default;
            string       name       = default;
            ResourceType type       = default;
            SystemData   systemData = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("properties"))
                {
                    properties = EnvironmentVersionProperties.DeserializeEnvironmentVersionProperties(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 EnvironmentVersionData(id, name, type, systemData, properties));
        }
Ejemplo n.º 3
0
 internal EnvironmentVersionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EnvironmentVersionProperties properties) : base(id, name, resourceType, systemData)
 {
     Properties = properties;
 }