internal static RestoreParameters DeserializeRestoreParameters(JsonElement element)
        {
            Optional <RestoreMode>    restoreMode           = default;
            Optional <string>         restoreSource         = default;
            Optional <DateTimeOffset> restoreTimestampInUtc = default;
            Optional <IList <DatabaseRestoreResource> > databasesToRestore = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("restoreMode"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    restoreMode = new RestoreMode(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("restoreSource"))
                {
                    restoreSource = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("restoreTimestampInUtc"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    restoreTimestampInUtc = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("databasesToRestore"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <DatabaseRestoreResource> array = new List <DatabaseRestoreResource>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DatabaseRestoreResource.DeserializeDatabaseRestoreResource(item));
                    }
                    databasesToRestore = array;
                    continue;
                }
            }
            return(new RestoreParameters(Optional.ToNullable(restoreMode), restoreSource.Value, Optional.ToNullable(restoreTimestampInUtc), Optional.ToList(databasesToRestore)));
        }
 internal static RestorableMongodbResourcesListResult DeserializeRestorableMongodbResourcesListResult(JsonElement element)
 {
     Optional<IReadOnlyList<DatabaseRestoreResource>> value = default;
     foreach (var property in element.EnumerateObject())
     {
         if (property.NameEquals("value"))
         {
             if (property.Value.ValueKind == JsonValueKind.Null)
             {
                 property.ThrowNonNullablePropertyIsNull();
                 continue;
             }
             List<DatabaseRestoreResource> array = new List<DatabaseRestoreResource>();
             foreach (var item in property.Value.EnumerateArray())
             {
                 array.Add(DatabaseRestoreResource.DeserializeDatabaseRestoreResource(item));
             }
             value = array;
             continue;
         }
     }
     return new RestorableMongodbResourcesListResult(Optional.ToList(value));
 }