github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/simple-plain-schema/dotnet/Component.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.Collections.Generic;
     6  using System.Collections.Immutable;
     7  using System.Threading.Tasks;
     8  using Pulumi.Serialization;
     9  
    10  namespace Pulumi.Example
    11  {
    12      [ExampleResourceType("example::Component")]
    13      public partial class Component : global::Pulumi.ComponentResource
    14      {
    15          [Output("a")]
    16          public Output<bool> A { get; private set; } = null!;
    17  
    18          [Output("b")]
    19          public Output<bool?> B { get; private set; } = null!;
    20  
    21          [Output("bar")]
    22          public Output<Outputs.Foo?> Bar { get; private set; } = null!;
    23  
    24          [Output("baz")]
    25          public Output<ImmutableArray<Outputs.Foo>> Baz { get; private set; } = null!;
    26  
    27          [Output("c")]
    28          public Output<int> C { get; private set; } = null!;
    29  
    30          [Output("d")]
    31          public Output<int?> D { get; private set; } = null!;
    32  
    33          [Output("e")]
    34          public Output<string> E { get; private set; } = null!;
    35  
    36          [Output("f")]
    37          public Output<string?> F { get; private set; } = null!;
    38  
    39          [Output("foo")]
    40          public Output<Outputs.Foo?> Foo { get; private set; } = null!;
    41  
    42  
    43          /// <summary>
    44          /// Create a Component resource with the given unique name, arguments, and options.
    45          /// </summary>
    46          ///
    47          /// <param name="name">The unique name of the resource</param>
    48          /// <param name="args">The arguments used to populate this resource's properties</param>
    49          /// <param name="options">A bag of options that control this resource's behavior</param>
    50          public Component(string name, ComponentArgs args, ComponentResourceOptions? options = null)
    51              : base("example::Component", name, args ?? new ComponentArgs(), MakeResourceOptions(options, ""), remote: true)
    52          {
    53          }
    54  
    55          private static ComponentResourceOptions MakeResourceOptions(ComponentResourceOptions? options, Input<string>? id)
    56          {
    57              var defaultOptions = new ComponentResourceOptions
    58              {
    59                  Version = Utilities.Version,
    60              };
    61              var merged = ComponentResourceOptions.Merge(defaultOptions, options);
    62              // Override the ID if one was specified for consistency with other language SDKs.
    63              merged.Id = id ?? merged.Id;
    64              return merged;
    65          }
    66      }
    67  
    68      public sealed class ComponentArgs : global::Pulumi.ResourceArgs
    69      {
    70          [Input("a", required: true)]
    71          public bool A { get; set; }
    72  
    73          [Input("b")]
    74          public bool? B { get; set; }
    75  
    76          [Input("bar")]
    77          public Inputs.FooArgs? Bar { get; set; }
    78  
    79          [Input("baz")]
    80          private List<Input<Inputs.FooArgs>>? _baz;
    81          public List<Input<Inputs.FooArgs>> Baz
    82          {
    83              get => _baz ?? (_baz = new List<Input<Inputs.FooArgs>>());
    84              set => _baz = value;
    85          }
    86  
    87          [Input("bazMap")]
    88          private Dictionary<string, Input<Inputs.FooArgs>>? _bazMap;
    89          public Dictionary<string, Input<Inputs.FooArgs>> BazMap
    90          {
    91              get => _bazMap ?? (_bazMap = new Dictionary<string, Input<Inputs.FooArgs>>());
    92              set => _bazMap = value;
    93          }
    94  
    95          [Input("c", required: true)]
    96          public int C { get; set; }
    97  
    98          [Input("d")]
    99          public int? D { get; set; }
   100  
   101          [Input("e", required: true)]
   102          public string E { get; set; } = null!;
   103  
   104          [Input("f")]
   105          public string? F { get; set; }
   106  
   107          [Input("foo")]
   108          public Input<Inputs.FooArgs>? Foo { get; set; }
   109  
   110          public ComponentArgs()
   111          {
   112          }
   113          public static new ComponentArgs Empty => new ComponentArgs();
   114      }
   115  }