コード例 #1
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("endpointComputeType");
     writer.WriteStringValue(EndpointComputeType.ToString());
     writer.WriteEndObject();
 }
コード例 #2
0
 internal OnlineDeploymentProperties(CodeConfiguration codeConfiguration, string description, string environmentId, IDictionary <string, string> environmentVariables, IDictionary <string, string> properties, bool?appInsightsEnabled, EgressPublicNetworkAccessType?egressPublicNetworkAccess, EndpointComputeType endpointComputeType, string instanceType, ProbeSettings livenessProbe, string model, string modelMountPath, bool?privateNetworkConnection, DeploymentProvisioningState?provisioningState, ProbeSettings readinessProbe, OnlineRequestSettings requestSettings, OnlineScaleSettings scaleSettings) : base(codeConfiguration, description, environmentId, environmentVariables, properties)
 {
     AppInsightsEnabled        = appInsightsEnabled;
     EgressPublicNetworkAccess = egressPublicNetworkAccess;
     EndpointComputeType       = endpointComputeType;
     InstanceType             = instanceType;
     LivenessProbe            = livenessProbe;
     Model                    = model;
     ModelMountPath           = modelMountPath;
     PrivateNetworkConnection = privateNetworkConnection;
     ProvisioningState        = provisioningState;
     ReadinessProbe           = readinessProbe;
     RequestSettings          = requestSettings;
     ScaleSettings            = scaleSettings;
 }
コード例 #3
0
        internal static KubernetesOnlineDeployment DeserializeKubernetesOnlineDeployment(JsonElement element)
        {
            Optional <ContainerResourceRequirements> containerResourceRequirements = default;
            Optional <bool> appInsightsEnabled = default;
            Optional <EgressPublicNetworkAccessType> egressPublicNetworkAccess = default;
            EndpointComputeType      endpointComputeType = default;
            Optional <string>        instanceType        = default;
            Optional <ProbeSettings> livenessProbe       = default;
            Optional <string>        model                           = default;
            Optional <string>        modelMountPath                  = default;
            Optional <bool>          privateNetworkConnection        = default;
            Optional <DeploymentProvisioningState> provisioningState = default;
            Optional <ProbeSettings>         readinessProbe          = default;
            Optional <OnlineRequestSettings> requestSettings         = default;
            Optional <OnlineScaleSettings>   scaleSettings           = default;
            Optional <CodeConfiguration>     codeConfiguration       = default;
            Optional <string> description   = default;
            Optional <string> environmentId = default;
            Optional <IDictionary <string, string> > environmentVariables = default;
            Optional <IDictionary <string, string> > properties           = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("containerResourceRequirements"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        containerResourceRequirements = null;
                        continue;
                    }
                    containerResourceRequirements = ContainerResourceRequirements.DeserializeContainerResourceRequirements(property.Value);
                    continue;
                }
                if (property.NameEquals("appInsightsEnabled"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    appInsightsEnabled = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("egressPublicNetworkAccess"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    egressPublicNetworkAccess = new EgressPublicNetworkAccessType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("endpointComputeType"))
                {
                    endpointComputeType = new EndpointComputeType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("instanceType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        instanceType = null;
                        continue;
                    }
                    instanceType = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("livenessProbe"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        livenessProbe = null;
                        continue;
                    }
                    livenessProbe = ProbeSettings.DeserializeProbeSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("model"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        model = null;
                        continue;
                    }
                    model = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("modelMountPath"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        modelMountPath = null;
                        continue;
                    }
                    modelMountPath = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("privateNetworkConnection"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    privateNetworkConnection = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("provisioningState"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    provisioningState = new DeploymentProvisioningState(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("readinessProbe"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        readinessProbe = null;
                        continue;
                    }
                    readinessProbe = ProbeSettings.DeserializeProbeSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("requestSettings"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        requestSettings = null;
                        continue;
                    }
                    requestSettings = OnlineRequestSettings.DeserializeOnlineRequestSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("scaleSettings"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        scaleSettings = null;
                        continue;
                    }
                    scaleSettings = OnlineScaleSettings.DeserializeOnlineScaleSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("codeConfiguration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        codeConfiguration = null;
                        continue;
                    }
                    codeConfiguration = CodeConfiguration.DeserializeCodeConfiguration(property.Value);
                    continue;
                }
                if (property.NameEquals("description"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        description = null;
                        continue;
                    }
                    description = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("environmentId"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        environmentId = null;
                        continue;
                    }
                    environmentId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("environmentVariables"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        environmentVariables = null;
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.Value.ValueKind == JsonValueKind.Null)
                        {
                            dictionary.Add(property0.Name, null);
                        }
                        else
                        {
                            dictionary.Add(property0.Name, property0.Value.GetString());
                        }
                    }
                    environmentVariables = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        properties = null;
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.Value.ValueKind == JsonValueKind.Null)
                        {
                            dictionary.Add(property0.Name, null);
                        }
                        else
                        {
                            dictionary.Add(property0.Name, property0.Value.GetString());
                        }
                    }
                    properties = dictionary;
                    continue;
                }
            }
            return(new KubernetesOnlineDeployment(codeConfiguration.Value, description.Value, environmentId.Value, Optional.ToDictionary(environmentVariables), Optional.ToDictionary(properties), Optional.ToNullable(appInsightsEnabled), Optional.ToNullable(egressPublicNetworkAccess), endpointComputeType, instanceType.Value, livenessProbe.Value, model.Value, modelMountPath.Value, Optional.ToNullable(privateNetworkConnection), Optional.ToNullable(provisioningState), readinessProbe.Value, requestSettings.Value, scaleSettings.Value, containerResourceRequirements.Value));
        }
コード例 #4
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     if (Optional.IsDefined(ContainerResourceRequirements))
     {
         if (ContainerResourceRequirements != null)
         {
             writer.WritePropertyName("containerResourceRequirements");
             writer.WriteObjectValue(ContainerResourceRequirements);
         }
         else
         {
             writer.WriteNull("containerResourceRequirements");
         }
     }
     if (Optional.IsDefined(AppInsightsEnabled))
     {
         writer.WritePropertyName("appInsightsEnabled");
         writer.WriteBooleanValue(AppInsightsEnabled.Value);
     }
     if (Optional.IsDefined(EgressPublicNetworkAccess))
     {
         writer.WritePropertyName("egressPublicNetworkAccess");
         writer.WriteStringValue(EgressPublicNetworkAccess.Value.ToString());
     }
     writer.WritePropertyName("endpointComputeType");
     writer.WriteStringValue(EndpointComputeType.ToString());
     if (Optional.IsDefined(InstanceType))
     {
         if (InstanceType != null)
         {
             writer.WritePropertyName("instanceType");
             writer.WriteStringValue(InstanceType);
         }
         else
         {
             writer.WriteNull("instanceType");
         }
     }
     if (Optional.IsDefined(LivenessProbe))
     {
         if (LivenessProbe != null)
         {
             writer.WritePropertyName("livenessProbe");
             writer.WriteObjectValue(LivenessProbe);
         }
         else
         {
             writer.WriteNull("livenessProbe");
         }
     }
     if (Optional.IsDefined(Model))
     {
         if (Model != null)
         {
             writer.WritePropertyName("model");
             writer.WriteStringValue(Model);
         }
         else
         {
             writer.WriteNull("model");
         }
     }
     if (Optional.IsDefined(ModelMountPath))
     {
         if (ModelMountPath != null)
         {
             writer.WritePropertyName("modelMountPath");
             writer.WriteStringValue(ModelMountPath);
         }
         else
         {
             writer.WriteNull("modelMountPath");
         }
     }
     if (Optional.IsDefined(PrivateNetworkConnection))
     {
         writer.WritePropertyName("privateNetworkConnection");
         writer.WriteBooleanValue(PrivateNetworkConnection.Value);
     }
     if (Optional.IsDefined(ReadinessProbe))
     {
         if (ReadinessProbe != null)
         {
             writer.WritePropertyName("readinessProbe");
             writer.WriteObjectValue(ReadinessProbe);
         }
         else
         {
             writer.WriteNull("readinessProbe");
         }
     }
     if (Optional.IsDefined(RequestSettings))
     {
         if (RequestSettings != null)
         {
             writer.WritePropertyName("requestSettings");
             writer.WriteObjectValue(RequestSettings);
         }
         else
         {
             writer.WriteNull("requestSettings");
         }
     }
     if (Optional.IsDefined(ScaleSettings))
     {
         if (ScaleSettings != null)
         {
             writer.WritePropertyName("scaleSettings");
             writer.WriteObjectValue(ScaleSettings);
         }
         else
         {
             writer.WriteNull("scaleSettings");
         }
     }
     if (Optional.IsDefined(CodeConfiguration))
     {
         if (CodeConfiguration != null)
         {
             writer.WritePropertyName("codeConfiguration");
             writer.WriteObjectValue(CodeConfiguration);
         }
         else
         {
             writer.WriteNull("codeConfiguration");
         }
     }
     if (Optional.IsDefined(Description))
     {
         if (Description != null)
         {
             writer.WritePropertyName("description");
             writer.WriteStringValue(Description);
         }
         else
         {
             writer.WriteNull("description");
         }
     }
     if (Optional.IsDefined(EnvironmentId))
     {
         if (EnvironmentId != null)
         {
             writer.WritePropertyName("environmentId");
             writer.WriteStringValue(EnvironmentId);
         }
         else
         {
             writer.WriteNull("environmentId");
         }
     }
     if (Optional.IsCollectionDefined(EnvironmentVariables))
     {
         if (EnvironmentVariables != null)
         {
             writer.WritePropertyName("environmentVariables");
             writer.WriteStartObject();
             foreach (var item in EnvironmentVariables)
             {
                 writer.WritePropertyName(item.Key);
                 writer.WriteStringValue(item.Value);
             }
             writer.WriteEndObject();
         }
         else
         {
             writer.WriteNull("environmentVariables");
         }
     }
     if (Optional.IsCollectionDefined(Properties))
     {
         if (Properties != null)
         {
             writer.WritePropertyName("properties");
             writer.WriteStartObject();
             foreach (var item in Properties)
             {
                 writer.WritePropertyName(item.Key);
                 writer.WriteStringValue(item.Value);
             }
             writer.WriteEndObject();
         }
         else
         {
             writer.WriteNull("properties");
         }
     }
     writer.WriteEndObject();
 }
コード例 #5
0
 internal ManagedOnlineDeployment(CodeConfiguration codeConfiguration, string description, string environmentId, IDictionary <string, string> environmentVariables, IDictionary <string, string> properties, bool?appInsightsEnabled, EgressPublicNetworkAccessType?egressPublicNetworkAccess, EndpointComputeType endpointComputeType, string instanceType, ProbeSettings livenessProbe, string model, string modelMountPath, bool?privateNetworkConnection, DeploymentProvisioningState?provisioningState, ProbeSettings readinessProbe, OnlineRequestSettings requestSettings, OnlineScaleSettings scaleSettings) : base(codeConfiguration, description, environmentId, environmentVariables, properties, appInsightsEnabled, egressPublicNetworkAccess, endpointComputeType, instanceType, livenessProbe, model, modelMountPath, privateNetworkConnection, provisioningState, readinessProbe, requestSettings, scaleSettings)
 {
     EndpointComputeType = endpointComputeType;
 }