github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/simple-yaml-schema/dotnet/Enums.cs (about)

     1  // *** WARNING: this file was generated by test. ***
     2  // *** Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  using System;
     5  using System.ComponentModel;
     6  using Pulumi;
     7  
     8  namespace Pulumi.Example
     9  {
    10      [EnumType]
    11      public readonly struct OutputOnlyEnumType : IEquatable<OutputOnlyEnumType>
    12      {
    13          private readonly string _value;
    14  
    15          private OutputOnlyEnumType(string value)
    16          {
    17              _value = value ?? throw new ArgumentNullException(nameof(value));
    18          }
    19  
    20          public static OutputOnlyEnumType Foo { get; } = new OutputOnlyEnumType("foo");
    21          public static OutputOnlyEnumType Bar { get; } = new OutputOnlyEnumType("bar");
    22  
    23          public static bool operator ==(OutputOnlyEnumType left, OutputOnlyEnumType right) => left.Equals(right);
    24          public static bool operator !=(OutputOnlyEnumType left, OutputOnlyEnumType right) => !left.Equals(right);
    25  
    26          public static explicit operator string(OutputOnlyEnumType value) => value._value;
    27  
    28          [EditorBrowsable(EditorBrowsableState.Never)]
    29          public override bool Equals(object? obj) => obj is OutputOnlyEnumType other && Equals(other);
    30          public bool Equals(OutputOnlyEnumType other) => string.Equals(_value, other._value, StringComparison.Ordinal);
    31  
    32          [EditorBrowsable(EditorBrowsableState.Never)]
    33          public override int GetHashCode() => _value?.GetHashCode() ?? 0;
    34  
    35          public override string ToString() => _value;
    36      }
    37  
    38      /// <summary>
    39      /// types of rubber trees
    40      /// </summary>
    41      [EnumType]
    42      public readonly struct RubberTreeVariety : IEquatable<RubberTreeVariety>
    43      {
    44          private readonly string _value;
    45  
    46          private RubberTreeVariety(string value)
    47          {
    48              _value = value ?? throw new ArgumentNullException(nameof(value));
    49          }
    50  
    51          /// <summary>
    52          /// A burgundy rubber tree.
    53          /// </summary>
    54          public static RubberTreeVariety Burgundy { get; } = new RubberTreeVariety("Burgundy");
    55          /// <summary>
    56          /// A ruby rubber tree.
    57          /// </summary>
    58          public static RubberTreeVariety Ruby { get; } = new RubberTreeVariety("Ruby");
    59          /// <summary>
    60          /// A tineke rubber tree.
    61          /// </summary>
    62          public static RubberTreeVariety Tineke { get; } = new RubberTreeVariety("Tineke");
    63  
    64          public static bool operator ==(RubberTreeVariety left, RubberTreeVariety right) => left.Equals(right);
    65          public static bool operator !=(RubberTreeVariety left, RubberTreeVariety right) => !left.Equals(right);
    66  
    67          public static explicit operator string(RubberTreeVariety value) => value._value;
    68  
    69          [EditorBrowsable(EditorBrowsableState.Never)]
    70          public override bool Equals(object? obj) => obj is RubberTreeVariety other && Equals(other);
    71          public bool Equals(RubberTreeVariety other) => string.Equals(_value, other._value, StringComparison.Ordinal);
    72  
    73          [EditorBrowsable(EditorBrowsableState.Never)]
    74          public override int GetHashCode() => _value?.GetHashCode() ?? 0;
    75  
    76          public override string ToString() => _value;
    77      }
    78  }