コード例 #1
0
 internal SynapseNotebookActivity(string name, string type, string description, IList <ActivityDependency> dependsOn, IList <UserProperty> userProperties, IDictionary <string, object> additionalProperties, LinkedServiceReference linkedServiceName, ActivityPolicy policy, SynapseNotebookReference notebook, BigDataPoolParametrizationReference sparkPool, IDictionary <string, NotebookParameter> parameters) : base(name, type, description, dependsOn, userProperties, additionalProperties, linkedServiceName, policy)
 {
     Notebook   = notebook;
     SparkPool  = sparkPool;
     Parameters = parameters;
     Type       = type ?? "SynapseNotebook";
 }
コード例 #2
0
        public SynapseNotebookActivity(string name, SynapseNotebookReference notebook) : base(name)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (notebook == null)
            {
                throw new ArgumentNullException(nameof(notebook));
            }

            Notebook   = notebook;
            Parameters = new ChangeTrackingDictionary <string, object>();
            Type       = "SynapseNotebook";
        }
        internal static SynapseNotebookActivity DeserializeSynapseNotebookActivity(JsonElement element)
        {
            Optional <LinkedServiceReference> linkedServiceName = default;
            Optional <ActivityPolicy>         policy            = default;
            string            name        = default;
            string            type        = default;
            Optional <string> description = default;
            Optional <IList <ActivityDependency> > dependsOn      = default;
            Optional <IList <UserProperty> >       userProperties = default;
            SynapseNotebookReference notebook = default;
            Optional <IDictionary <string, object> > parameters           = default;
            IDictionary <string, object>             additionalProperties = default;
            Dictionary <string, object> additionalPropertiesDictionary    = new Dictionary <string, object>();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("linkedServiceName"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value);
                    continue;
                }
                if (property.NameEquals("policy"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    policy = ActivityPolicy.DeserializeActivityPolicy(property.Value);
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("dependsOn"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <ActivityDependency> array = new List <ActivityDependency>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ActivityDependency.DeserializeActivityDependency(item));
                    }
                    dependsOn = array;
                    continue;
                }
                if (property.NameEquals("userProperties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <UserProperty> array = new List <UserProperty>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(UserProperty.DeserializeUserProperty(item));
                    }
                    userProperties = array;
                    continue;
                }
                if (property.NameEquals("typeProperties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("notebook"))
                        {
                            notebook = SynapseNotebookReference.DeserializeSynapseNotebookReference(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("parameters"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            Dictionary <string, object> dictionary = new Dictionary <string, object>();
                            foreach (var property1 in property0.Value.EnumerateObject())
                            {
                                dictionary.Add(property1.Name, property1.Value.GetObject());
                            }
                            parameters = dictionary;
                            continue;
                        }
                    }
                    continue;
                }
                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
            }
            additionalProperties = additionalPropertiesDictionary;
            return(new SynapseNotebookActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(userProperties), additionalProperties, linkedServiceName.Value, policy.Value, notebook, Optional.ToDictionary(parameters)));
        }
コード例 #4
0
 internal SynapseNotebookActivity(string name, string type, string description, IList <ActivityDependency> dependsOn, IList <UserProperty> userProperties, IDictionary <string, object> additionalProperties, SynapseNotebookReference notebook, IDictionary <string, object> parameters) : base(name, type, description, dependsOn, userProperties, additionalProperties)
 {
     Notebook   = notebook;
     Parameters = parameters;
     Type       = type ?? "SynapseNotebook";
 }