Esempio n. 1
0
        public LinkedServiceDebugResource(LinkedService properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            Properties = properties;
        }
        internal static LinkedServiceResource DeserializeLinkedServiceResource(JsonElement element)
        {
            LinkedService properties = default;
            string        id         = default;
            string        name       = default;
            string        type       = default;
            string        etag       = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("properties"))
                {
                    properties = LinkedService.DeserializeLinkedService(property.Value);
                    continue;
                }
                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("etag"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    etag = property.Value.GetString();
                    continue;
                }
            }
            return(new LinkedServiceResource(id, name, type, etag, properties));
        }
Esempio n. 3
0
        internal static LinkedServiceDebugResource DeserializeLinkedServiceDebugResource(JsonElement element)
        {
            LinkedService     properties = default;
            Optional <string> name       = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("properties"))
                {
                    properties = LinkedService.DeserializeLinkedService(property.Value);
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
            }
            return(new LinkedServiceDebugResource(name.Value, properties));
        }
Esempio n. 4
0
 internal LinkedServiceResource(string id, string name, string type, string etag, LinkedService properties) : base(id, name, type, etag)
 {
     Properties = properties;
 }
 internal LinkedServiceDebugResource(string name, LinkedService properties) : base(name)
 {
     Properties = properties;
 }