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

            Properties = properties;
        }
Esempio n. 2
0
        internal static SparkJobDefinitionResource DeserializeSparkJobDefinitionResource(JsonElement element)
        {
            SparkJobDefinition 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 = SparkJobDefinition.DeserializeSparkJobDefinition(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 SparkJobDefinitionResource(id, name, type, etag, properties));
        }
        internal static SparkJobDefinitionResource DeserializeSparkJobDefinitionResource(JsonElement element)
        {
            SparkJobDefinition properties = default;
            Optional <string>  etag       = default;
            Optional <string>  id         = default;
            Optional <string>  name       = default;
            Optional <string>  type       = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("properties"))
                {
                    properties = SparkJobDefinition.DeserializeSparkJobDefinition(property.Value);
                    continue;
                }
                if (property.NameEquals("etag"))
                {
                    etag = property.Value.GetString();
                    continue;
                }
                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;
                }
            }
            return(new SparkJobDefinitionResource(id.Value, name.Value, type.Value, etag.Value, properties));
        }
Esempio n. 4
0
 internal SparkJobDefinitionResource(string id, string name, string type, string etag, SparkJobDefinition properties) : base(id, name, type, etag)
 {
     Properties = properties;
 }