pulumi/tests/testdata/codegen/kubernetes20/dotnet/Config/Config.cs

62 lines
2.1 KiB
C#

// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Immutable;
namespace Pulumi.Kubernetes
{
public static class Config
{
[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "IDE1006", Justification =
"Double underscore prefix used to avoid conflicts with variable names.")]
private sealed class __Value<T>
{
private readonly Func<T> _getter;
private T _value = default!;
private bool _set;
public __Value(Func<T> getter)
{
_getter = getter;
}
public T Get() => _set ? _value : _getter();
public void Set(T value)
{
_value = value;
_set = true;
}
}
private static readonly global::Pulumi.Config __config = new global::Pulumi.Config("kubernetes");
private static readonly __Value<string?> _kubeconfig = new __Value<string?>(() => __config.Get("kubeconfig"));
/// <summary>
/// The contents of a kubeconfig file or the path to a kubeconfig file. If this is set, this config will be used instead of $KUBECONFIG.
/// </summary>
public static string? KubeConfig
{
get => _kubeconfig.Get();
set => _kubeconfig.Set(value);
}
private static readonly __Value<string?> _namespace = new __Value<string?>(() => __config.Get("namespace"));
/// <summary>
/// If present, the default namespace to use. This flag is ignored for cluster-scoped resources.
///
/// A namespace can be specified in multiple places, and the precedence is as follows:
/// 1. `.metadata.namespace` set on the resource.
/// 2. This `namespace` parameter.
/// 3. `namespace` set for the active context in the kubeconfig.
/// </summary>
public static string? Namespace
{
get => _namespace.Get();
set => _namespace.Set(value);
}
}
}