blob: 6f2ec54814a70934ae141c1d2cb7d030d89f7a78 [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 gridfs.
/// </summary>
public sealed class GridfsServiceConfig : IServiceConfig
{
/// <summary>
/// The bucket name of the MongoDB GridFs service to read/write.
/// </summary>
public string? Bucket { get; init; }
/// <summary>
/// The chunk size of the MongoDB GridFs service used to break the user file into chunks.
/// </summary>
public int? ChunkSize { get; init; }
/// <summary>
/// The connection string of the MongoDB service.
/// </summary>
public string? ConnectionString { get; init; }
/// <summary>
/// The database name of the MongoDB GridFs service to read/write.
/// </summary>
public string? Database { get; init; }
/// <summary>
/// The working directory, all operations will be performed under it.
/// </summary>
public string? Root { get; init; }
public string Scheme => "gridfs";
public IReadOnlyDictionary<string, string> ToOptions()
{
var map = new Dictionary<string, string>();
if (Bucket is not null)
{
map["bucket"] = Utilities.ToOptionString(Bucket);
}
if (ChunkSize is not null)
{
map["chunk_size"] = Utilities.ToOptionString(ChunkSize);
}
if (ConnectionString is not null)
{
map["connection_string"] = Utilities.ToOptionString(ConnectionString);
}
if (Database is not null)
{
map["database"] = Utilities.ToOptionString(Database);
}
if (Root is not null)
{
map["root"] = Utilities.ToOptionString(Root);
}
return map;
}
}
}