github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/simple-enum-schema/dotnet/Tree/V1/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.Plant.Tree.V1 9 { 10 [EnumType] 11 public readonly struct Diameter : IEquatable<Diameter> 12 { 13 private readonly double _value; 14 15 private Diameter(double value) 16 { 17 _value = value; 18 } 19 20 public static Diameter Sixinch { get; } = new Diameter(6); 21 public static Diameter Twelveinch { get; } = new Diameter(12); 22 23 public static bool operator ==(Diameter left, Diameter right) => left.Equals(right); 24 public static bool operator !=(Diameter left, Diameter right) => !left.Equals(right); 25 26 public static explicit operator double(Diameter value) => value._value; 27 28 [EditorBrowsable(EditorBrowsableState.Never)] 29 public override bool Equals(object? obj) => obj is Diameter other && Equals(other); 30 public bool Equals(Diameter other) => _value == other._value; 31 32 [EditorBrowsable(EditorBrowsableState.Never)] 33 public override int GetHashCode() => _value.GetHashCode(); 34 35 public override string ToString() => _value.ToString(); 36 } 37 38 [EnumType] 39 public readonly struct Farm : IEquatable<Farm> 40 { 41 private readonly string _value; 42 43 private Farm(string value) 44 { 45 _value = value ?? throw new ArgumentNullException(nameof(value)); 46 } 47 48 public static Farm Pulumi_Planters_Inc_ { get; } = new Farm("Pulumi Planters Inc."); 49 public static Farm Plants_R_Us { get; } = new Farm("Plants'R'Us"); 50 51 public static bool operator ==(Farm left, Farm right) => left.Equals(right); 52 public static bool operator !=(Farm left, Farm right) => !left.Equals(right); 53 54 public static explicit operator string(Farm value) => value._value; 55 56 [EditorBrowsable(EditorBrowsableState.Never)] 57 public override bool Equals(object? obj) => obj is Farm other && Equals(other); 58 public bool Equals(Farm other) => string.Equals(_value, other._value, StringComparison.Ordinal); 59 60 [EditorBrowsable(EditorBrowsableState.Never)] 61 public override int GetHashCode() => _value?.GetHashCode() ?? 0; 62 63 public override string ToString() => _value; 64 } 65 66 /// <summary> 67 /// types of rubber trees 68 /// </summary> 69 [EnumType] 70 public readonly struct RubberTreeVariety : IEquatable<RubberTreeVariety> 71 { 72 private readonly string _value; 73 74 private RubberTreeVariety(string value) 75 { 76 _value = value ?? throw new ArgumentNullException(nameof(value)); 77 } 78 79 /// <summary> 80 /// A burgundy rubber tree. 81 /// </summary> 82 public static RubberTreeVariety Burgundy { get; } = new RubberTreeVariety("Burgundy"); 83 /// <summary> 84 /// A ruby rubber tree. 85 /// </summary> 86 public static RubberTreeVariety Ruby { get; } = new RubberTreeVariety("Ruby"); 87 /// <summary> 88 /// A tineke rubber tree. 89 /// </summary> 90 public static RubberTreeVariety Tineke { get; } = new RubberTreeVariety("Tineke"); 91 92 public static bool operator ==(RubberTreeVariety left, RubberTreeVariety right) => left.Equals(right); 93 public static bool operator !=(RubberTreeVariety left, RubberTreeVariety right) => !left.Equals(right); 94 95 public static explicit operator string(RubberTreeVariety value) => value._value; 96 97 [EditorBrowsable(EditorBrowsableState.Never)] 98 public override bool Equals(object? obj) => obj is RubberTreeVariety other && Equals(other); 99 public bool Equals(RubberTreeVariety other) => string.Equals(_value, other._value, StringComparison.Ordinal); 100 101 [EditorBrowsable(EditorBrowsableState.Never)] 102 public override int GetHashCode() => _value?.GetHashCode() ?? 0; 103 104 public override string ToString() => _value; 105 } 106 107 [EnumType] 108 public readonly struct TreeSize : IEquatable<TreeSize> 109 { 110 private readonly string _value; 111 112 private TreeSize(string value) 113 { 114 _value = value ?? throw new ArgumentNullException(nameof(value)); 115 } 116 117 public static TreeSize Small { get; } = new TreeSize("small"); 118 public static TreeSize Medium { get; } = new TreeSize("medium"); 119 public static TreeSize Large { get; } = new TreeSize("large"); 120 121 public static bool operator ==(TreeSize left, TreeSize right) => left.Equals(right); 122 public static bool operator !=(TreeSize left, TreeSize right) => !left.Equals(right); 123 124 public static explicit operator string(TreeSize value) => value._value; 125 126 [EditorBrowsable(EditorBrowsableState.Never)] 127 public override bool Equals(object? obj) => obj is TreeSize other && Equals(other); 128 public bool Equals(TreeSize other) => string.Equals(_value, other._value, StringComparison.Ordinal); 129 130 [EditorBrowsable(EditorBrowsableState.Never)] 131 public override int GetHashCode() => _value?.GetHashCode() ?? 0; 132 133 public override string ToString() => _value; 134 } 135 }