Ejemplo n.º 1
0
        internal static PrivateLinkResource DeserializePrivateLinkResource(JsonElement element)
        {
            PrivateLinkResourceProperties properties = default;
            ResourceIdentifier            id         = default;
            string       name = default;
            ResourceType type = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("properties"))
                {
                    properties = PrivateLinkResourceProperties.DeserializePrivateLinkResourceProperties(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;
                }
            }
            return(new PrivateLinkResource(id, name, type, properties));
        }
Ejemplo n.º 2
0
        internal PrivateLinkResource(PrivateLinkResourceProperties properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            Properties = properties;
        }
Ejemplo n.º 3
0
 internal PrivateLinkResource(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, PrivateLinkResourceProperties properties) : base(id, name, type, systemData)
 {
     Properties = properties;
 }