blob: 86ad72d7c9af417fd455aafce867ddc718442347 [file]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// Generated from bindings/java ServiceConfig definitions.
using OpenDAL.ServiceConfig.Abstractions;
namespace OpenDAL.ServiceConfig
{
/// <summary>
/// Configuration for service surrealdb.
/// </summary>
public sealed class SurrealdbServiceConfig : IServiceConfig
{
/// <summary>
/// The connection string for surrealdb.
/// </summary>
public string? ConnectionString { get; init; }
/// <summary>
/// The database for surrealdb.
/// </summary>
public string? Database { get; init; }
/// <summary>
/// The key field for surrealdb.
/// </summary>
public string? KeyField { get; init; }
/// <summary>
/// The namespace for surrealdb.
/// </summary>
public string? Namespace { get; init; }
/// <summary>
/// The password for surrealdb.
/// </summary>
public string? Password { get; init; }
/// <summary>
/// The root for surrealdb.
/// </summary>
public string? Root { get; init; }
/// <summary>
/// The table for surrealdb.
/// </summary>
public string? Table { get; init; }
/// <summary>
/// The username for surrealdb.
/// </summary>
public string? Username { get; init; }
/// <summary>
/// The value field for surrealdb.
/// </summary>
public string? ValueField { get; init; }
public string Scheme => "surrealdb";
public IReadOnlyDictionary<string, string> ToOptions()
{
var map = new Dictionary<string, string>();
if (ConnectionString is not null)
{
map["connection_string"] = Utilities.ToOptionString(ConnectionString);
}
if (Database is not null)
{
map["database"] = Utilities.ToOptionString(Database);
}
if (KeyField is not null)
{
map["key_field"] = Utilities.ToOptionString(KeyField);
}
if (Namespace is not null)
{
map["namespace"] = Utilities.ToOptionString(Namespace);
}
if (Password is not null)
{
map["password"] = Utilities.ToOptionString(Password);
}
if (Root is not null)
{
map["root"] = Utilities.ToOptionString(Root);
}
if (Table is not null)
{
map["table"] = Utilities.ToOptionString(Table);
}
if (Username is not null)
{
map["username"] = Utilities.ToOptionString(Username);
}
if (ValueField is not null)
{
map["value_field"] = Utilities.ToOptionString(ValueField);
}
return map;
}
}
}