github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/simple-methods-schema/dotnet/Foo.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::Foo")]
    13      public partial class Foo : global::Pulumi.ComponentResource
    14      {
    15          /// <summary>
    16          /// Create a Foo resource with the given unique name, arguments, and options.
    17          /// </summary>
    18          ///
    19          /// <param name="name">The unique name of the resource</param>
    20          /// <param name="args">The arguments used to populate this resource's properties</param>
    21          /// <param name="options">A bag of options that control this resource's behavior</param>
    22          public Foo(string name, FooArgs? args = null, ComponentResourceOptions? options = null)
    23              : base("example::Foo", name, args ?? new FooArgs(), MakeResourceOptions(options, ""), remote: true)
    24          {
    25          }
    26  
    27          private static ComponentResourceOptions MakeResourceOptions(ComponentResourceOptions? options, Input<string>? id)
    28          {
    29              var defaultOptions = new ComponentResourceOptions
    30              {
    31                  Version = Utilities.Version,
    32              };
    33              var merged = ComponentResourceOptions.Merge(defaultOptions, options);
    34              // Override the ID if one was specified for consistency with other language SDKs.
    35              merged.Id = id ?? merged.Id;
    36              return merged;
    37          }
    38  
    39          /// <summary>
    40          /// A description of bar.
    41          /// </summary>
    42          public global::Pulumi.Output<FooBarResult> Bar(FooBarArgs args)
    43              => global::Pulumi.Deployment.Instance.Call<FooBarResult>("example::Foo/bar", args ?? new FooBarArgs(), this);
    44  
    45          public void Baz()
    46              => global::Pulumi.Deployment.Instance.Call("example::Foo/baz", CallArgs.Empty, this);
    47  
    48          /// <summary>
    49          /// Do something with something else
    50          /// </summary>
    51          public global::Pulumi.Output<FooGenerateKubeconfigResult> GenerateKubeconfig(FooGenerateKubeconfigArgs args)
    52              => global::Pulumi.Deployment.Instance.Call<FooGenerateKubeconfigResult>("example::Foo/generateKubeconfig", args ?? new FooGenerateKubeconfigArgs(), this);
    53      }
    54  
    55      public sealed class FooArgs : global::Pulumi.ResourceArgs
    56      {
    57          public FooArgs()
    58          {
    59          }
    60          public static new FooArgs Empty => new FooArgs();
    61      }
    62  
    63      /// <summary>
    64      /// The set of arguments for the <see cref="Foo.Bar"/> method.
    65      /// </summary>
    66      public sealed class FooBarArgs : global::Pulumi.CallArgs
    67      {
    68          [Input("baz")]
    69          public Input<Pulumi.Example.Nested.Inputs.BazArgs>? Baz { get; set; }
    70  
    71          [Input("bazPlain")]
    72          public Pulumi.Example.Nested.Inputs.BazArgs? BazPlain { get; set; }
    73  
    74          [Input("bazRequired", required: true)]
    75          public Input<Pulumi.Example.Nested.Inputs.BazArgs> BazRequired { get; set; } = null!;
    76  
    77          [Input("boolValue")]
    78          public Input<bool>? BoolValue { get; set; }
    79  
    80          [Input("boolValuePlain")]
    81          public bool? BoolValuePlain { get; set; }
    82  
    83          [Input("boolValueRequired", required: true)]
    84          public Input<bool> BoolValueRequired { get; set; } = null!;
    85  
    86          [Input("name")]
    87          public Input<Pulumi.Random.RandomPet>? Name { get; set; }
    88  
    89          [Input("namePlain")]
    90          public Pulumi.Random.RandomPet? NamePlain { get; set; }
    91  
    92          [Input("nameRequired", required: true)]
    93          public Input<Pulumi.Random.RandomPet> NameRequired { get; set; } = null!;
    94  
    95          [Input("stringValue")]
    96          public Input<string>? StringValue { get; set; }
    97  
    98          [Input("stringValuePlain")]
    99          public string? StringValuePlain { get; set; }
   100  
   101          [Input("stringValueRequired", required: true)]
   102          public Input<string> StringValueRequired { get; set; } = null!;
   103  
   104          public FooBarArgs()
   105          {
   106          }
   107          public static new FooBarArgs Empty => new FooBarArgs();
   108      }
   109  
   110      /// <summary>
   111      /// The results of the <see cref="Foo.Bar"/> method.
   112      /// </summary>
   113      [OutputType]
   114      public sealed class FooBarResult
   115      {
   116          public readonly string SomeValue;
   117  
   118          [OutputConstructor]
   119          private FooBarResult(string someValue)
   120          {
   121              SomeValue = someValue;
   122          }
   123      }
   124  
   125      /// <summary>
   126      /// The set of arguments for the <see cref="Foo.GenerateKubeconfig"/> method.
   127      /// </summary>
   128      public sealed class FooGenerateKubeconfigArgs : global::Pulumi.CallArgs
   129      {
   130          [Input("boolValue", required: true)]
   131          public bool BoolValue { get; set; }
   132  
   133          public FooGenerateKubeconfigArgs()
   134          {
   135          }
   136          public static new FooGenerateKubeconfigArgs Empty => new FooGenerateKubeconfigArgs();
   137      }
   138  
   139      /// <summary>
   140      /// The results of the <see cref="Foo.GenerateKubeconfig"/> method.
   141      /// </summary>
   142      [OutputType]
   143      public sealed class FooGenerateKubeconfigResult
   144      {
   145          public readonly string Kubeconfig;
   146  
   147          [OutputConstructor]
   148          private FooGenerateKubeconfigResult(string kubeconfig)
   149          {
   150              Kubeconfig = kubeconfig;
   151          }
   152      }
   153  }