github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/provider-config-schema/dotnet/Configstation/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 Configstation.Pulumi.Configstation
     9  {
    10      [EnumType]
    11      public readonly struct Color : IEquatable<Color>
    12      {
    13          private readonly string _value;
    14  
    15          private Color(string value)
    16          {
    17              _value = value ?? throw new ArgumentNullException(nameof(value));
    18          }
    19  
    20          public static Color Blue { get; } = new Color("blue");
    21          public static Color Red { get; } = new Color("red");
    22  
    23          public static bool operator ==(Color left, Color right) => left.Equals(right);
    24          public static bool operator !=(Color left, Color right) => !left.Equals(right);
    25  
    26          public static explicit operator string(Color value) => value._value;
    27  
    28          [EditorBrowsable(EditorBrowsableState.Never)]
    29          public override bool Equals(object? obj) => obj is Color other && Equals(other);
    30          public bool Equals(Color 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  }