| /* | |
| * 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 System.Runtime.InteropServices; | |
| using OpenDAL.Options.Abstractions; | |
| namespace OpenDAL.Options; | |
| /// <summary> | |
| /// {{ class.summary }} | |
| /// </summary> | |
| public sealed class {{ class.name }} : IOptions<OpenDAL{{ class.name }}> | |
| { | |
| {%- for p in class.properties %} | |
| /// <summary> | |
| /// {{ p.summary }} | |
| /// </summary> | |
| {%- for cref in p.see_also %} | |
| /// <seealso cref="{{ cref }}"/> | |
| {%- endfor %} | |
| public {{ p.cs_type }} {{ p.pascal }} { get; init; }{{ p.initializer }} | |
| {% endfor %} | |
| {%- if class.validations %} | |
| void IOptions<OpenDAL{{ class.name }}>.Validate() | |
| { | |
| {%- for v in class.validations %} | |
| {{ v }} | |
| {%- endfor %} | |
| } | |
| {% endif %} | |
| OpenDAL{{ class.name }} IOptions<OpenDAL{{ class.name }}>.ToNative(ref NativeOptionsWriter writer) | |
| { | |
| var native = new OpenDAL{{ class.name }}(); | |
| {%- for w in class.cs_writes %} | |
| {{ w }} | |
| {%- endfor %} | |
| return native; | |
| } | |
| } | |
| /// <summary> | |
| /// Mirror of the native <c>Opendal{{ class.name }}</c> struct. Pointers refer | |
| /// into the options buffer of a single call. | |
| /// </summary> | |
| [StructLayout(LayoutKind.Sequential)] | |
| internal struct OpenDAL{{ class.name }} | |
| { | |
| {%- for p in class.parts %} | |
| public {{ p.cs_type }} {{ p.pascal }}; | |
| {%- endfor %} | |
| } |