| /* |
| * 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 tos. |
| /// </summary> |
| public sealed class TosServiceConfig : IServiceConfig |
| { |
| /// <summary> |
| /// access_key_id of this backend. - If access_key_id is set, we will take user's input first. - If not, we will try to load it from environment. |
| /// </summary> |
| public string? AccessKeyId { get; init; } |
| /// <summary> |
| /// bucket name of this backend. required. |
| /// </summary> |
| public string? Bucket { get; init; } |
| /// <summary> |
| /// Disable config load so that opendal will not load config from environment. For examples: - envs like `TOS_ACCESS_KEY_ID` |
| /// </summary> |
| public bool? DisableConfigLoad { get; init; } |
| /// <summary> |
| /// endpoint of this backend. Endpoint must be full uri, e.g. - TOS: `https://tos-cn-beijing.volces.com` - TOS with region: `https://tos-{region}.volces.com` If user inputs endpoint without scheme like "tos-cn-beijing.volces.com", we will prepend "https://" before it. |
| /// </summary> |
| public string? Endpoint { get; init; } |
| /// <summary> |
| /// Region represent the signing region of this endpoint. Required if endpoint is not provided. - If region is set, we will take user's input first. - If not, we will try to load it from environment. - If still not set, default to `cn-beijing`. |
| /// </summary> |
| public string? Region { get; init; } |
| /// <summary> |
| /// root of this backend. All operations will happen under this root. default to `/` if not set. |
| /// </summary> |
| public string? Root { get; init; } |
| /// <summary> |
| /// secret_access_key of this backend. - If secret_access_key is set, we will take user's input first. - If not, we will try to load it from environment. |
| /// </summary> |
| public string? SecretAccessKey { get; init; } |
| /// <summary> |
| /// security_token of this backend. This token will expire after sometime, it's recommended to set security_token by hand. |
| /// </summary> |
| public string? SecurityToken { get; init; } |
| /// <summary> |
| /// Skip signature will skip loading credentials and signing requests. |
| /// </summary> |
| public bool? SkipSignature { get; init; } |
| |
| public string Scheme => "tos"; |
| |
| public IReadOnlyDictionary<string, string> ToOptions() |
| { |
| var map = new Dictionary<string, string>(); |
| if (AccessKeyId is not null) |
| { |
| map["access_key_id"] = Utilities.ToOptionString(AccessKeyId); |
| } |
| if (Bucket is not null) |
| { |
| map["bucket"] = Utilities.ToOptionString(Bucket); |
| } |
| if (DisableConfigLoad is not null) |
| { |
| map["disable_config_load"] = Utilities.ToOptionString(DisableConfigLoad); |
| } |
| if (Endpoint is not null) |
| { |
| map["endpoint"] = Utilities.ToOptionString(Endpoint); |
| } |
| if (Region is not null) |
| { |
| map["region"] = Utilities.ToOptionString(Region); |
| } |
| if (Root is not null) |
| { |
| map["root"] = Utilities.ToOptionString(Root); |
| } |
| if (SecretAccessKey is not null) |
| { |
| map["secret_access_key"] = Utilities.ToOptionString(SecretAccessKey); |
| } |
| if (SecurityToken is not null) |
| { |
| map["security_token"] = Utilities.ToOptionString(SecurityToken); |
| } |
| if (SkipSignature is not null) |
| { |
| map["skip_signature"] = Utilities.ToOptionString(SkipSignature); |
| } |
| return map; |
| } |
| } |
| |
| } |