internal ManagedIntegrationRuntime(IntegrationRuntimeType type, string description, IDictionary <string, object> additionalProperties, IntegrationRuntimeState?state, IntegrationRuntimeComputeProperties computeProperties, IntegrationRuntimeSsisProperties ssisProperties) : base(type, description, additionalProperties)
 {
     State             = state;
     ComputeProperties = computeProperties;
     SsisProperties    = ssisProperties;
     Type = type;
 }
        internal static IntegrationRuntime DeserializeIntegrationRuntime(JsonElement element)
        {
            if (element.TryGetProperty("type", out JsonElement discriminator))
            {
                switch (discriminator.GetString())
                {
                case "Managed": return(ManagedIntegrationRuntime.DeserializeManagedIntegrationRuntime(element));

                case "SelfHosted": return(SelfHostedIntegrationRuntime.DeserializeSelfHostedIntegrationRuntime(element));
                }
            }
            IntegrationRuntimeType       type                           = default;
            Optional <string>            description                    = default;
            IDictionary <string, object> additionalProperties           = default;
            Dictionary <string, object>  additionalPropertiesDictionary = new Dictionary <string, object>();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("type"))
                {
                    type = new IntegrationRuntimeType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
            }
            additionalProperties = additionalPropertiesDictionary;
            return(new IntegrationRuntime(type, description.Value, additionalProperties));
        }
        internal static SelfHostedIntegrationRuntime DeserializeSelfHostedIntegrationRuntime(JsonElement element)
        {
            IntegrationRuntimeType type        = default;
            Optional <string>      description = default;
            Optional <LinkedIntegrationRuntimeType> linkedInfo                     = default;
            IDictionary <string, object>            additionalProperties           = default;
            Dictionary <string, object>             additionalPropertiesDictionary = new Dictionary <string, object>();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("type"))
                {
                    type = new IntegrationRuntimeType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("typeProperties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("linkedInfo"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            linkedInfo = LinkedIntegrationRuntimeType.DeserializeLinkedIntegrationRuntimeType(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
            }
            additionalProperties = additionalPropertiesDictionary;
            return(new SelfHostedIntegrationRuntime(type, description.Value, additionalProperties, linkedInfo.Value));
        }
Exemple #4
0
 internal SelfHostedIntegrationRuntime(IntegrationRuntimeType type, string description, IDictionary <string, object> additionalProperties, LinkedIntegrationRuntimeType linkedInfo) : base(type, description, additionalProperties)
 {
     LinkedInfo = linkedInfo;
     Type       = type;
 }
 internal IntegrationRuntime(IntegrationRuntimeType type, string description, IDictionary <string, object> additionalProperties)
 {
     Type                 = type;
     Description          = description;
     AdditionalProperties = additionalProperties;
 }
 public IntegrationRuntime()
 {
     AdditionalProperties = new ChangeTrackingDictionary <string, object>();
     Type = new IntegrationRuntimeType("IntegrationRuntime");
 }
Exemple #7
0
        internal static ManagedIntegrationRuntime DeserializeManagedIntegrationRuntime(JsonElement element)
        {
            Optional <IntegrationRuntimeState> state = default;
            IntegrationRuntimeType             type  = default;
            Optional <string> description            = default;
            Optional <IntegrationRuntimeComputeProperties> computeProperties = default;
            Optional <IntegrationRuntimeSsisProperties>    ssisProperties    = default;
            IDictionary <string, object> additionalProperties           = default;
            Dictionary <string, object>  additionalPropertiesDictionary = new Dictionary <string, object>();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("state"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    state = new IntegrationRuntimeState(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new IntegrationRuntimeType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("typeProperties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("computeProperties"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            computeProperties = IntegrationRuntimeComputeProperties.DeserializeIntegrationRuntimeComputeProperties(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("ssisProperties"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            ssisProperties = IntegrationRuntimeSsisProperties.DeserializeIntegrationRuntimeSsisProperties(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
            }
            additionalProperties = additionalPropertiesDictionary;
            return(new ManagedIntegrationRuntime(type, description.Value, additionalProperties, Optional.ToNullable(state), computeProperties.Value, ssisProperties.Value));
        }