/// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static ServiceProperties GetFromJsonProperties(JsonReader reader)
        {
            var description         = default(string);
            var replicaCount        = default(int?);
            var autoScalingPolicies = default(IEnumerable <AutoScalingPolicy>);
            var status              = default(ResourceStatus?);
            var statusDetails       = default(string);
            var healthState         = default(HealthState?);
            var unhealthyEvaluation = default(string);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("description", propName, StringComparison.Ordinal) == 0)
                {
                    description = reader.ReadValueAsString();
                }
                else if (string.Compare("replicaCount", propName, StringComparison.Ordinal) == 0)
                {
                    replicaCount = reader.ReadValueAsInt();
                }
                else if (string.Compare("autoScalingPolicies", propName, StringComparison.Ordinal) == 0)
                {
                    autoScalingPolicies = reader.ReadList(AutoScalingPolicyConverter.Deserialize);
                }
                else if (string.Compare("status", propName, StringComparison.Ordinal) == 0)
                {
                    status = ResourceStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("statusDetails", propName, StringComparison.Ordinal) == 0)
                {
                    statusDetails = reader.ReadValueAsString();
                }
                else if (string.Compare("healthState", propName, StringComparison.Ordinal) == 0)
                {
                    healthState = HealthStateConverter.Deserialize(reader);
                }
                else if (string.Compare("unhealthyEvaluation", propName, StringComparison.Ordinal) == 0)
                {
                    unhealthyEvaluation = reader.ReadValueAsString();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            var serviceProperties = new ServiceProperties(
                description: description,
                replicaCount: replicaCount,
                autoScalingPolicies: autoScalingPolicies);

            serviceProperties.Status              = status;
            serviceProperties.StatusDetails       = statusDetails;
            serviceProperties.HealthState         = healthState;
            serviceProperties.UnhealthyEvaluation = unhealthyEvaluation;
            return(serviceProperties);
        }
Пример #2
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static SecretResourceProperties GetFromJsonProperties(JsonReader reader)
        {
            var kind          = default(SecretKind?);
            var description   = default(string);
            var status        = default(ResourceStatus?);
            var statusDetails = default(string);
            var contentType   = default(string);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("kind", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    kind = SecretKindConverter.Deserialize(reader);
                }
                else if (string.Compare("description", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    description = reader.ReadValueAsString();
                }
                else if (string.Compare("status", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    status = ResourceStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("statusDetails", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    statusDetails = reader.ReadValueAsString();
                }
                else if (string.Compare("contentType", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    contentType = reader.ReadValueAsString();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            var secretResourceProperties = new SecretResourceProperties(
                kind: kind,
                description: description,
                contentType: contentType);

            secretResourceProperties.Status        = status;
            secretResourceProperties.StatusDetails = statusDetails;
            return(secretResourceProperties);
        }
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static VolumeProperties GetFromJsonProperties(JsonReader reader)
        {
            var description         = default(string);
            var status              = default(ResourceStatus?);
            var statusDetails       = default(string);
            var azureFileParameters = default(VolumeProviderParametersAzureFile);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("description", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    description = reader.ReadValueAsString();
                }
                else if (string.Compare("status", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    status = ResourceStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("statusDetails", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    statusDetails = reader.ReadValueAsString();
                }
                else if (string.Compare("azureFileParameters", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    azureFileParameters = VolumeProviderParametersAzureFileConverter.Deserialize(reader);
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            var volumeProperties = new VolumeProperties(
                description: description,
                azureFileParameters: azureFileParameters);

            volumeProperties.Status        = status;
            volumeProperties.StatusDetails = statusDetails;
            return(volumeProperties);
        }
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static NetworkResourceProperties GetFromJsonProperties(JsonReader reader)
        {
            var kind          = default(NetworkKind?);
            var description   = default(string);
            var status        = default(ResourceStatus?);
            var statusDetails = default(string);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("kind", propName, StringComparison.Ordinal) == 0)
                {
                    kind = NetworkKindConverter.Deserialize(reader);
                }
                else if (string.Compare("description", propName, StringComparison.Ordinal) == 0)
                {
                    description = reader.ReadValueAsString();
                }
                else if (string.Compare("status", propName, StringComparison.Ordinal) == 0)
                {
                    status = ResourceStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("statusDetails", propName, StringComparison.Ordinal) == 0)
                {
                    statusDetails = reader.ReadValueAsString();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            var networkResourceProperties = new NetworkResourceProperties(
                kind: kind,
                description: description);

            networkResourceProperties.Status        = status;
            networkResourceProperties.StatusDetails = statusDetails;
            return(networkResourceProperties);
        }
Пример #5
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static LocalNetworkResourceProperties GetFromJsonProperties(JsonReader reader)
        {
            var description          = default(string);
            var status               = default(ResourceStatus?);
            var statusDetails        = default(string);
            var networkAddressPrefix = default(string);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("description", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    description = reader.ReadValueAsString();
                }
                else if (string.Compare("status", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    status = ResourceStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("statusDetails", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    statusDetails = reader.ReadValueAsString();
                }
                else if (string.Compare("networkAddressPrefix", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    networkAddressPrefix = reader.ReadValueAsString();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            var localNetworkResourceProperties = new LocalNetworkResourceProperties(
                description: description,
                networkAddressPrefix: networkAddressPrefix);

            localNetworkResourceProperties.Status        = status;
            localNetworkResourceProperties.StatusDetails = statusDetails;
            return(localNetworkResourceProperties);
        }
Пример #6
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static ApplicationProperties GetFromJsonProperties(JsonReader reader)
        {
            var description         = default(string);
            var services            = default(IEnumerable <ServiceResourceDescription>);
            var diagnostics         = default(DiagnosticsDescription);
            var debugParams         = default(string);
            var serviceNames        = default(IEnumerable <string>);
            var status              = default(ResourceStatus?);
            var statusDetails       = default(string);
            var healthState         = default(HealthState?);
            var unhealthyEvaluation = default(string);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("description", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    description = reader.ReadValueAsString();
                }
                else if (string.Compare("services", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    services = reader.ReadList(ServiceResourceDescriptionConverter.Deserialize);
                }
                else if (string.Compare("diagnostics", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    diagnostics = DiagnosticsDescriptionConverter.Deserialize(reader);
                }
                else if (string.Compare("debugParams", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    debugParams = reader.ReadValueAsString();
                }
                else if (string.Compare("serviceNames", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    serviceNames = reader.ReadList(JsonReaderExtensions.ReadValueAsString);
                }
                else if (string.Compare("status", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    status = ResourceStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("statusDetails", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    statusDetails = reader.ReadValueAsString();
                }
                else if (string.Compare("healthState", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    healthState = HealthStateConverter.Deserialize(reader);
                }
                else if (string.Compare("unhealthyEvaluation", propName, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    unhealthyEvaluation = reader.ReadValueAsString();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            var applicationProperties = new ApplicationProperties(
                description: description,
                services: services,
                diagnostics: diagnostics,
                debugParams: debugParams);

            applicationProperties.ServiceNames        = serviceNames;
            applicationProperties.Status              = status;
            applicationProperties.StatusDetails       = statusDetails;
            applicationProperties.HealthState         = healthState;
            applicationProperties.UnhealthyEvaluation = unhealthyEvaluation;
            return(applicationProperties);
        }
Пример #7
0
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static GatewayProperties GetFromJsonProperties(JsonReader reader)
        {
            var description        = default(string);
            var sourceNetwork      = default(NetworkRef);
            var destinationNetwork = default(NetworkRef);
            var tcp           = default(IEnumerable <TcpConfig>);
            var http          = default(IEnumerable <HttpConfig>);
            var status        = default(ResourceStatus?);
            var statusDetails = default(string);
            var ipAddress     = default(string);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("description", propName, StringComparison.Ordinal) == 0)
                {
                    description = reader.ReadValueAsString();
                }
                else if (string.Compare("sourceNetwork", propName, StringComparison.Ordinal) == 0)
                {
                    sourceNetwork = NetworkRefConverter.Deserialize(reader);
                }
                else if (string.Compare("destinationNetwork", propName, StringComparison.Ordinal) == 0)
                {
                    destinationNetwork = NetworkRefConverter.Deserialize(reader);
                }
                else if (string.Compare("tcp", propName, StringComparison.Ordinal) == 0)
                {
                    tcp = reader.ReadList(TcpConfigConverter.Deserialize);
                }
                else if (string.Compare("http", propName, StringComparison.Ordinal) == 0)
                {
                    http = reader.ReadList(HttpConfigConverter.Deserialize);
                }
                else if (string.Compare("status", propName, StringComparison.Ordinal) == 0)
                {
                    status = ResourceStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("statusDetails", propName, StringComparison.Ordinal) == 0)
                {
                    statusDetails = reader.ReadValueAsString();
                }
                else if (string.Compare("ipAddress", propName, StringComparison.Ordinal) == 0)
                {
                    ipAddress = reader.ReadValueAsString();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            var gatewayProperties = new GatewayProperties(
                description: description,
                sourceNetwork: sourceNetwork,
                destinationNetwork: destinationNetwork,
                tcp: tcp,
                http: http);

            gatewayProperties.Status        = status;
            gatewayProperties.StatusDetails = statusDetails;
            gatewayProperties.IpAddress     = ipAddress;
            return(gatewayProperties);
        }
        /// <summary>
        /// Gets the object from Json properties.
        /// </summary>
        /// <param name="reader">The <see cref="T: Newtonsoft.Json.JsonReader" /> to read from, reader must be placed at first property.</param>
        /// <returns>The object Value.</returns>
        internal static ServiceResourceProperties GetFromJsonProperties(JsonReader reader)
        {
            var osType              = default(OperatingSystemType?);
            var codePackages        = default(IEnumerable <ContainerCodePackageProperties>);
            var networkRefs         = default(IEnumerable <NetworkRef>);
            var diagnostics         = default(DiagnosticsRef);
            var description         = default(string);
            var replicaCount        = default(int?);
            var autoScalingPolicies = default(IEnumerable <AutoScalingPolicy>);
            var status              = default(ResourceStatus?);
            var statusDetails       = default(string);
            var healthState         = default(HealthState?);
            var unhealthyEvaluation = default(string);

            do
            {
                var propName = reader.ReadPropertyName();
                if (string.Compare("osType", propName, StringComparison.Ordinal) == 0)
                {
                    osType = OperatingSystemTypeConverter.Deserialize(reader);
                }
                else if (string.Compare("codePackages", propName, StringComparison.Ordinal) == 0)
                {
                    codePackages = reader.ReadList(ContainerCodePackagePropertiesConverter.Deserialize);
                }
                else if (string.Compare("networkRefs", propName, StringComparison.Ordinal) == 0)
                {
                    networkRefs = reader.ReadList(NetworkRefConverter.Deserialize);
                }
                else if (string.Compare("diagnostics", propName, StringComparison.Ordinal) == 0)
                {
                    diagnostics = DiagnosticsRefConverter.Deserialize(reader);
                }
                else if (string.Compare("description", propName, StringComparison.Ordinal) == 0)
                {
                    description = reader.ReadValueAsString();
                }
                else if (string.Compare("replicaCount", propName, StringComparison.Ordinal) == 0)
                {
                    replicaCount = reader.ReadValueAsInt();
                }
                else if (string.Compare("autoScalingPolicies", propName, StringComparison.Ordinal) == 0)
                {
                    autoScalingPolicies = reader.ReadList(AutoScalingPolicyConverter.Deserialize);
                }
                else if (string.Compare("status", propName, StringComparison.Ordinal) == 0)
                {
                    status = ResourceStatusConverter.Deserialize(reader);
                }
                else if (string.Compare("statusDetails", propName, StringComparison.Ordinal) == 0)
                {
                    statusDetails = reader.ReadValueAsString();
                }
                else if (string.Compare("healthState", propName, StringComparison.Ordinal) == 0)
                {
                    healthState = HealthStateConverter.Deserialize(reader);
                }
                else if (string.Compare("unhealthyEvaluation", propName, StringComparison.Ordinal) == 0)
                {
                    unhealthyEvaluation = reader.ReadValueAsString();
                }
                else
                {
                    reader.SkipPropertyValue();
                }
            }while (reader.TokenType != JsonToken.EndObject);

            var serviceResourceProperties = new ServiceResourceProperties(
                osType: osType,
                codePackages: codePackages,
                networkRefs: networkRefs,
                diagnostics: diagnostics,
                description: description,
                replicaCount: replicaCount,
                autoScalingPolicies: autoScalingPolicies);

            serviceResourceProperties.Status              = status;
            serviceResourceProperties.StatusDetails       = statusDetails;
            serviceResourceProperties.HealthState         = healthState;
            serviceResourceProperties.UnhealthyEvaluation = unhealthyEvaluation;
            return(serviceResourceProperties);
        }