pulumi/pkg/codegen/internal/test/testdata/simple-plain-schema/dotnet/Component.cs
Justin Van Patten 572c74826c
Add schema & codegen support for plain properties (#6481)
This change adds schema and codegen support for plain properties which
are emitted typed as the plain type rather than wrapped as an `Input`.
Plain properties require a prompt value and do not accept a value that
is `Output`.
2021-03-10 07:08:08 -08:00

90 lines
2.8 KiB
C#

// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Example
{
[ExampleResourceType("example::Component")]
public partial class Component : Pulumi.ComponentResource
{
[Output("a")]
public Output<bool> A { get; private set; } = null!;
[Output("b")]
public Output<bool?> B { get; private set; } = null!;
[Output("c")]
public Output<int> C { get; private set; } = null!;
[Output("d")]
public Output<int?> D { get; private set; } = null!;
[Output("e")]
public Output<string> E { get; private set; } = null!;
[Output("f")]
public Output<string?> F { get; private set; } = null!;
[Output("foo")]
public Output<Outputs.Foo?> Foo { get; private set; } = null!;
/// <summary>
/// Create a Component resource with the given unique name, arguments, and options.
/// </summary>
///
/// <param name="name">The unique name of the resource</param>
/// <param name="args">The arguments used to populate this resource's properties</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public Component(string name, ComponentArgs args, ComponentResourceOptions? options = null)
: base("example::Component", name, args ?? new ComponentArgs(), MakeResourceOptions(options, ""), remote: true)
{
}
private static ComponentResourceOptions MakeResourceOptions(ComponentResourceOptions? options, Input<string>? id)
{
var defaultOptions = new ComponentResourceOptions
{
Version = Utilities.Version,
};
var merged = ComponentResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
merged.Id = id ?? merged.Id;
return merged;
}
}
public sealed class ComponentArgs : Pulumi.ResourceArgs
{
[Input("a", required: true)]
public bool A { get; set; } = null!;
[Input("b")]
public bool? B { get; set; }
[Input("c", required: true)]
public int C { get; set; } = null!;
[Input("d")]
public int? D { get; set; }
[Input("e", required: true)]
public string E { get; set; } = null!;
[Input("f")]
public string? F { get; set; }
[Input("foo")]
public Input<Inputs.FooArgs>? Foo { get; set; }
public ComponentArgs()
{
}
}
}