blob: c25e811a5daa520e256adf0dbded19aa4840889b [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.
*/
// DO NOT EDIT IT MANUALLY. This file is generated by opendal/dev/src/generate/dotnet.rs.
using OpenDAL.ServiceConfig.Abstractions;
namespace OpenDAL.ServiceConfig
{
/// <summary>
/// Configuration for service {{ service }}.
/// </summary>
public sealed class {{ class_name }}ServiceConfig : IServiceConfig
{
{%- for f in fields %}
{%- if f.doc %}
/// <summary>
/// {{ f.doc }}
/// </summary>
{%- endif %}
{%- if f.deprecated %}
[System.Obsolete("{{ f.deprecated }}")]
{%- endif %}
public {{ f.cs_type }} {{ f.pascal }} { get; init; }
{%- endfor %}
public string Scheme => "{{ scheme }}";
public IReadOnlyDictionary<string, string> ToOptions()
{
var map = new Dictionary<string, string>();
{%- for f in fields %}
{%- if f.deprecated %}
#pragma warning disable CS0618
{%- endif %}
{%- if f.check_null %}
if ({{ f.pascal }} is not null)
{
map["{{ f.key }}"] = {{ f.value_expr }};
}
{%- else %}
map["{{ f.key }}"] = {{ f.value_expr }};
{%- endif %}
{%- if f.deprecated %}
#pragma warning restore CS0618
{%- endif %}
{%- endfor %}
return map;
}
}
}