Пример #1
0
        internal static OperationAutoGenerated DeserializeOperationAutoGenerated(JsonElement element)
        {
            string name = default;
            OperationDisplayAutoGenerated display = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("display"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    display = OperationDisplayAutoGenerated.DeserializeOperationDisplayAutoGenerated(property.Value);
                    continue;
                }
            }
            return(new OperationAutoGenerated(name, display));
        }
        internal static OperationAutoGenerated DeserializeOperationAutoGenerated(JsonElement element)
        {
            Optional <string> name = default;
            Optional <OperationDisplayAutoGenerated> display = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("display"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    display = OperationDisplayAutoGenerated.DeserializeOperationDisplayAutoGenerated(property.Value);
                    continue;
                }
            }
            return(new OperationAutoGenerated(name.Value, display.Value));
        }