internal static RollingUpgradeStatusInfo DeserializeRollingUpgradeStatusInfo(JsonElement element)
        {
            Optional <string> id       = default;
            Optional <string> name     = default;
            Optional <string> type     = default;
            string            location = default;
            Optional <IDictionary <string, string> > tags          = default;
            Optional <RollingUpgradePolicy>          policy        = default;
            Optional <RollingUpgradeRunningStatus>   runningStatus = default;
            Optional <RollingUpgradeProgressInfo>    progress      = default;
            Optional <ApiError> error = default;

            foreach (var property in element.EnumerateObject())
            {
                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;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("policy"))
                        {
                            policy = RollingUpgradePolicy.DeserializeRollingUpgradePolicy(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("runningStatus"))
                        {
                            runningStatus = RollingUpgradeRunningStatus.DeserializeRollingUpgradeRunningStatus(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("progress"))
                        {
                            progress = RollingUpgradeProgressInfo.DeserializeRollingUpgradeProgressInfo(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("error"))
                        {
                            error = ApiError.DeserializeApiError(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new RollingUpgradeStatusInfo(id.Value, name.Value, type.Value, location, Optional.ToDictionary(tags), policy.Value, runningStatus.Value, progress.Value, error.Value));
        }
Exemple #2
0
 internal RollingUpgradeStatusInfo(string id, string name, string type, string location, IDictionary <string, string> tags, RollingUpgradePolicy policy, RollingUpgradeRunningStatus runningStatus, RollingUpgradeProgressInfo progress, ApiError error) : base(id, name, type, location, tags)
 {
     Policy        = policy;
     RunningStatus = runningStatus;
     Progress      = progress;
     Error         = error;
 }