fix, baselines, CL

This commit is contained in:
Pat Gavlin 2021-11-17 11:21:33 -08:00
parent ae70447a18
commit cf6076d6b0
56 changed files with 139 additions and 123 deletions

View file

@ -1,4 +1,10 @@
### Improvements ### Improvements
- [sdk/nodejs] - Type optional input properties as `Input<T | undefined> | undefined` instead of
`Input<T> | undefined`. This allows users to pass `Output<T | undefined>` for optional input
properties.
[#6323](https://github.com/pulumi/pulumi/pull/6323)
- Adds CI detector for Buildkite - Adds CI detector for Buildkite
[#7933](https://github.com/pulumi/pulumi/pull/7933) [#7933](https://github.com/pulumi/pulumi/pull/7933)

View file

@ -60,5 +60,5 @@ export class ModuleResource extends pulumi.CustomResource {
* The set of arguments for constructing a ModuleResource resource. * The set of arguments for constructing a ModuleResource resource.
*/ */
export interface ModuleResourceArgs { export interface ModuleResourceArgs {
thing?: pulumi.Input<inputs.TopLevelArgs>; thing?: pulumi.Input<inputs.TopLevelArgs | undefined>;
} }

View file

@ -5,5 +5,5 @@ import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types"; import { input as inputs, output as outputs } from "../types";
export interface TopLevelArgs { export interface TopLevelArgs {
buzz?: pulumi.Input<string>; buzz?: pulumi.Input<string | undefined>;
} }

View file

@ -65,7 +65,7 @@ export interface NurseryArgs {
/** /**
* The sizes of trees available * The sizes of trees available
*/ */
sizes?: pulumi.Input<{[key: string]: pulumi.Input<enums.tree.v1.TreeSize>}>; sizes?: pulumi.Input<{[key: string]: pulumi.Input<enums.tree.v1.TreeSize>} | undefined>;
/** /**
* The varieties available * The varieties available
*/ */

View file

@ -75,16 +75,16 @@ export class RubberTree extends pulumi.CustomResource {
} }
export interface RubberTreeState { export interface RubberTreeState {
farm?: pulumi.Input<enums.tree.v1.Farm | string>; farm?: pulumi.Input<enums.tree.v1.Farm | string | undefined>;
} }
/** /**
* The set of arguments for constructing a RubberTree resource. * The set of arguments for constructing a RubberTree resource.
*/ */
export interface RubberTreeArgs { export interface RubberTreeArgs {
container?: pulumi.Input<inputs.ContainerArgs>; container?: pulumi.Input<inputs.ContainerArgs | undefined>;
diameter: pulumi.Input<enums.tree.v1.Diameter>; diameter: pulumi.Input<enums.tree.v1.Diameter>;
farm?: pulumi.Input<enums.tree.v1.Farm | string>; farm?: pulumi.Input<enums.tree.v1.Farm | string | undefined>;
size?: pulumi.Input<enums.tree.v1.TreeSize>; size?: pulumi.Input<enums.tree.v1.TreeSize | undefined>;
type: pulumi.Input<enums.tree.v1.RubberTreeVariety>; type: pulumi.Input<enums.tree.v1.RubberTreeVariety>;
} }

View file

@ -5,8 +5,8 @@ import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs, enums } from "../types"; import { input as inputs, output as outputs, enums } from "../types";
export interface ContainerArgs { export interface ContainerArgs {
brightness?: pulumi.Input<enums.ContainerBrightness>; brightness?: pulumi.Input<enums.ContainerBrightness | undefined>;
color?: pulumi.Input<enums.ContainerColor | string>; color?: pulumi.Input<enums.ContainerColor | string | undefined>;
material?: pulumi.Input<string>; material?: pulumi.Input<string | undefined>;
size: pulumi.Input<enums.ContainerSize>; size: pulumi.Input<enums.ContainerSize>;
} }

View file

@ -33,5 +33,5 @@ export function argFunctionOutput(args?: ArgFunctionOutputArgs, opts?: pulumi.In
} }
export interface ArgFunctionOutputArgs { export interface ArgFunctionOutputArgs {
name?: pulumi.Input<pulumiRandom.RandomPet>; name?: pulumi.Input<pulumiRandom.RandomPet | undefined>;
} }

View file

@ -64,6 +64,6 @@ export class Cat extends pulumi.CustomResource {
* The set of arguments for constructing a Cat resource. * The set of arguments for constructing a Cat resource.
*/ */
export interface CatArgs { export interface CatArgs {
age?: pulumi.Input<number>; age?: pulumi.Input<number | undefined>;
pet?: pulumi.Input<inputs.PetArgs>; pet?: pulumi.Input<inputs.PetArgs | undefined>;
} }

View file

@ -83,9 +83,9 @@ export class Component extends pulumi.CustomResource {
* The set of arguments for constructing a Component resource. * The set of arguments for constructing a Component resource.
*/ */
export interface ComponentArgs { export interface ComponentArgs {
metadata?: pulumi.Input<pulumiKubernetes.types.input.meta.v1.ObjectMetaArgs>; metadata?: pulumi.Input<pulumiKubernetes.types.input.meta.v1.ObjectMetaArgs | undefined>;
metadataArray?: pulumi.Input<pulumi.Input<pulumiKubernetes.types.input.meta.v1.ObjectMetaArgs>[]>; metadataArray?: pulumi.Input<pulumi.Input<pulumiKubernetes.types.input.meta.v1.ObjectMetaArgs>[] | undefined>;
metadataMap?: pulumi.Input<{[key: string]: pulumi.Input<pulumiKubernetes.types.input.meta.v1.ObjectMetaArgs>}>; metadataMap?: pulumi.Input<{[key: string]: pulumi.Input<pulumiKubernetes.types.input.meta.v1.ObjectMetaArgs>} | undefined>;
requiredMetadata: pulumi.Input<pulumiKubernetes.types.input.meta.v1.ObjectMetaArgs>; requiredMetadata: pulumi.Input<pulumiKubernetes.types.input.meta.v1.ObjectMetaArgs>;
requiredMetadataArray: pulumi.Input<pulumi.Input<pulumiKubernetes.types.input.meta.v1.ObjectMetaArgs>[]>; requiredMetadataArray: pulumi.Input<pulumi.Input<pulumiKubernetes.types.input.meta.v1.ObjectMetaArgs>[]>;
requiredMetadataMap: pulumi.Input<{[key: string]: pulumi.Input<pulumiKubernetes.types.input.meta.v1.ObjectMetaArgs>}>; requiredMetadataMap: pulumi.Input<{[key: string]: pulumi.Input<pulumiKubernetes.types.input.meta.v1.ObjectMetaArgs>}>;

View file

@ -7,10 +7,10 @@ import { input as inputs, output as outputs } from "../types";
import * as pulumiRandom from "@pulumi/random"; import * as pulumiRandom from "@pulumi/random";
export interface PetArgs { export interface PetArgs {
age?: pulumi.Input<number>; age?: pulumi.Input<number | undefined>;
name?: pulumi.Input<pulumiRandom.RandomPet>; name?: pulumi.Input<pulumiRandom.RandomPet | undefined>;
nameArray?: pulumi.Input<pulumi.Input<pulumiRandom.RandomPet>[]>; nameArray?: pulumi.Input<pulumi.Input<pulumiRandom.RandomPet>[] | undefined>;
nameMap?: pulumi.Input<{[key: string]: pulumi.Input<pulumiRandom.RandomPet>}>; nameMap?: pulumi.Input<{[key: string]: pulumi.Input<pulumiRandom.RandomPet>} | undefined>;
requiredName: pulumi.Input<pulumiRandom.RandomPet>; requiredName: pulumi.Input<pulumiRandom.RandomPet>;
requiredNameArray: pulumi.Input<pulumi.Input<pulumiRandom.RandomPet>[]>; requiredNameArray: pulumi.Input<pulumi.Input<pulumiRandom.RandomPet>[]>;
requiredNameMap: pulumi.Input<{[key: string]: pulumi.Input<pulumiRandom.RandomPet>}>; requiredNameMap: pulumi.Input<{[key: string]: pulumi.Input<pulumiRandom.RandomPet>}>;

View file

@ -61,5 +61,5 @@ export class Resource extends pulumi.CustomResource {
* The set of arguments for constructing a Resource resource. * The set of arguments for constructing a Resource resource.
*/ */
export interface ResourceArgs { export interface ResourceArgs {
baz?: pulumi.Input<string>; baz?: pulumi.Input<string | undefined>;
} }

View file

@ -61,5 +61,5 @@ export class Resource extends pulumi.CustomResource {
* The set of arguments for constructing a Resource resource. * The set of arguments for constructing a Resource resource.
*/ */
export interface ResourceArgs { export interface ResourceArgs {
bar?: pulumi.Input<string>; bar?: pulumi.Input<string | undefined>;
} }

View file

@ -65,9 +65,9 @@ export interface ListConfigurationsOutputArgs {
/** /**
* Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details * Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details
*/ */
customerSubscriptionDetails?: pulumi.Input<inputs.CustomerSubscriptionDetailsArgs>; customerSubscriptionDetails?: pulumi.Input<inputs.CustomerSubscriptionDetailsArgs | undefined>;
/** /**
* $skipToken is supported on list of configurations, which provides the next page in the list of configurations. * $skipToken is supported on list of configurations, which provides the next page in the list of configurations.
*/ */
skipToken?: pulumi.Input<string>; skipToken?: pulumi.Input<string | undefined>;
} }

View file

@ -66,11 +66,11 @@ export interface ListProductFamiliesOutputArgs {
/** /**
* Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details * Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details
*/ */
customerSubscriptionDetails?: pulumi.Input<inputs.CustomerSubscriptionDetailsArgs>; customerSubscriptionDetails?: pulumi.Input<inputs.CustomerSubscriptionDetailsArgs | undefined>;
/** /**
* $expand is supported on configurations parameter for product, which provides details on the configurations for the product. * $expand is supported on configurations parameter for product, which provides details on the configurations for the product.
*/ */
expand?: pulumi.Input<string>; expand?: pulumi.Input<string | undefined>;
/** /**
* Dictionary of filterable properties on product family. * Dictionary of filterable properties on product family.
*/ */
@ -78,5 +78,5 @@ export interface ListProductFamiliesOutputArgs {
/** /**
* $skipToken is supported on list of product families, which provides the next page in the list of product families. * $skipToken is supported on list of product families, which provides the next page in the list of product families.
*/ */
skipToken?: pulumi.Input<string>; skipToken?: pulumi.Input<string | undefined>;
} }

View file

@ -11,7 +11,7 @@ export interface ConfigurationFiltersArgs {
/** /**
* Filters specific to product * Filters specific to product
*/ */
filterableProperty?: pulumi.Input<pulumi.Input<inputs.FilterablePropertyArgs>[]>; filterableProperty?: pulumi.Input<pulumi.Input<inputs.FilterablePropertyArgs>[] | undefined>;
/** /**
* Product hierarchy information * Product hierarchy information
*/ */
@ -57,7 +57,7 @@ export interface CustomerSubscriptionDetailsArgs {
/** /**
* Location placement Id of a subscription * Location placement Id of a subscription
*/ */
locationPlacementId?: pulumi.Input<string>; locationPlacementId?: pulumi.Input<string | undefined>;
/** /**
* Quota ID of a subscription * Quota ID of a subscription
*/ */
@ -65,7 +65,7 @@ export interface CustomerSubscriptionDetailsArgs {
/** /**
* List of registered feature flags for subscription * List of registered feature flags for subscription
*/ */
registeredFeatures?: pulumi.Input<pulumi.Input<inputs.CustomerSubscriptionRegisteredFeaturesArgs>[]>; registeredFeatures?: pulumi.Input<pulumi.Input<inputs.CustomerSubscriptionRegisteredFeaturesArgs>[] | undefined>;
} }
/** /**
@ -89,11 +89,11 @@ export interface CustomerSubscriptionRegisteredFeaturesArgs {
/** /**
* Name of subscription registered feature * Name of subscription registered feature
*/ */
name?: pulumi.Input<string>; name?: pulumi.Input<string | undefined>;
/** /**
* State of subscription registered feature * State of subscription registered feature
*/ */
state?: pulumi.Input<string>; state?: pulumi.Input<string | undefined>;
} }
/** /**
@ -153,18 +153,18 @@ export interface HierarchyInformationArgs {
/** /**
* Represents configuration name that uniquely identifies configuration * Represents configuration name that uniquely identifies configuration
*/ */
configurationName?: pulumi.Input<string>; configurationName?: pulumi.Input<string | undefined>;
/** /**
* Represents product family name that uniquely identifies product family * Represents product family name that uniquely identifies product family
*/ */
productFamilyName?: pulumi.Input<string>; productFamilyName?: pulumi.Input<string | undefined>;
/** /**
* Represents product line name that uniquely identifies product line * Represents product line name that uniquely identifies product line
*/ */
productLineName?: pulumi.Input<string>; productLineName?: pulumi.Input<string | undefined>;
/** /**
* Represents product name that uniquely identifies product * Represents product name that uniquely identifies product
*/ */
productName?: pulumi.Input<string>; productName?: pulumi.Input<string | undefined>;
} }

View file

@ -88,13 +88,13 @@ export interface GetAmiIdsOutputArgs {
* Limit search to users with *explicit* launch * Limit search to users with *explicit* launch
* permission on the image. Valid items are the numeric account ID or `self`. * permission on the image. Valid items are the numeric account ID or `self`.
*/ */
executableUsers?: pulumi.Input<pulumi.Input<string>[]>; executableUsers?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/** /**
* One or more name/value pairs to filter off of. There * One or more name/value pairs to filter off of. There
* are several valid keys, for a full reference, check out * are several valid keys, for a full reference, check out
* [describe-images in the AWS CLI reference][1]. * [describe-images in the AWS CLI reference][1].
*/ */
filters?: pulumi.Input<pulumi.Input<inputs.GetAmiIdsFilterArgs>[]>; filters?: pulumi.Input<pulumi.Input<inputs.GetAmiIdsFilterArgs>[] | undefined>;
/** /**
* A regex string to apply to the AMI list returned * A regex string to apply to the AMI list returned
* by AWS. This allows more advanced filtering not supported from the AWS API. * by AWS. This allows more advanced filtering not supported from the AWS API.
@ -102,7 +102,7 @@ export interface GetAmiIdsOutputArgs {
* impact if the result is large. It is recommended to combine this with other * impact if the result is large. It is recommended to combine this with other
* options to narrow down the list AWS returns. * options to narrow down the list AWS returns.
*/ */
nameRegex?: pulumi.Input<string>; nameRegex?: pulumi.Input<string | undefined>;
/** /**
* List of AMI owners to limit search. At least 1 value must be specified. Valid values: an AWS account ID, `self` (the current account), or an AWS owner alias (e.g. `amazon`, `aws-marketplace`, `microsoft`). * List of AMI owners to limit search. At least 1 value must be specified. Valid values: an AWS account ID, `self` (the current account), or an AWS owner alias (e.g. `amazon`, `aws-marketplace`, `microsoft`).
*/ */
@ -110,5 +110,5 @@ export interface GetAmiIdsOutputArgs {
/** /**
* Used to sort AMIs by creation time. * Used to sort AMIs by creation time.
*/ */
sortAscending?: pulumi.Input<boolean>; sortAscending?: pulumi.Input<boolean | undefined>;
} }

View file

@ -61,7 +61,7 @@ export interface ListStorageAccountKeysOutputArgs {
/** /**
* Specifies type of the key to be listed. Possible value is kerb. * Specifies type of the key to be listed. Possible value is kerb.
*/ */
expand?: pulumi.Input<string>; expand?: pulumi.Input<string | undefined>;
/** /**
* The name of the resource group within the user's subscription. The name is case insensitive. * The name of the resource group within the user's subscription. The name is case insensitive.
*/ */

View file

@ -45,9 +45,9 @@ export interface FuncWithAllOptionalInputsOutputArgs {
/** /**
* Property A * Property A
*/ */
a?: pulumi.Input<string>; a?: pulumi.Input<string | undefined>;
/** /**
* Property B * Property B
*/ */
b?: pulumi.Input<string>; b?: pulumi.Input<string | undefined>;
} }

View file

@ -36,5 +36,5 @@ export function funcWithDefaultValueOutput(args: FuncWithDefaultValueOutputArgs,
export interface FuncWithDefaultValueOutputArgs { export interface FuncWithDefaultValueOutputArgs {
a: pulumi.Input<string>; a: pulumi.Input<string>;
b?: pulumi.Input<string>; b?: pulumi.Input<string | undefined>;
} }

View file

@ -36,6 +36,6 @@ export function funcWithDictParamOutput(args?: FuncWithDictParamOutputArgs, opts
} }
export interface FuncWithDictParamOutputArgs { export interface FuncWithDictParamOutputArgs {
a?: pulumi.Input<{[key: string]: pulumi.Input<string>}>; a?: pulumi.Input<{[key: string]: pulumi.Input<string>} | undefined>;
b?: pulumi.Input<string>; b?: pulumi.Input<string | undefined>;
} }

View file

@ -36,6 +36,6 @@ export function funcWithListParamOutput(args?: FuncWithListParamOutputArgs, opts
} }
export interface FuncWithListParamOutputArgs { export interface FuncWithListParamOutputArgs {
a?: pulumi.Input<pulumi.Input<string>[]>; a?: pulumi.Input<pulumi.Input<string>[] | undefined>;
b?: pulumi.Input<string>; b?: pulumi.Input<string | undefined>;
} }

View file

@ -65,5 +65,5 @@ export interface GetBastionShareableLinkOutputArgs {
/** /**
* List of VM references. * List of VM references.
*/ */
vms?: pulumi.Input<pulumi.Input<inputs.BastionShareableLinkArgs>[]>; vms?: pulumi.Input<pulumi.Input<inputs.BastionShareableLinkArgs>[] | undefined>;
} }

View file

@ -74,7 +74,7 @@ export interface GetIntegrationRuntimeObjectMetadatumOutputArgs {
/** /**
* Metadata path. * Metadata path.
*/ */
metadataPath?: pulumi.Input<string>; metadataPath?: pulumi.Input<string | undefined>;
/** /**
* The resource group name. * The resource group name.
*/ */

View file

@ -61,7 +61,7 @@ export interface ListStorageAccountKeysOutputArgs {
/** /**
* Specifies type of the key to be listed. Possible value is kerb. * Specifies type of the key to be listed. Possible value is kerb.
*/ */
expand?: pulumi.Input<string>; expand?: pulumi.Input<string | undefined>;
/** /**
* The name of the resource group within the user's subscription. The name is case insensitive. * The name of the resource group within the user's subscription. The name is case insensitive.
*/ */

View file

@ -98,11 +98,11 @@ export class ModuleResource extends pulumi.CustomResource {
* The set of arguments for constructing a ModuleResource resource. * The set of arguments for constructing a ModuleResource resource.
*/ */
export interface ModuleResourceArgs { export interface ModuleResourceArgs {
optional_bool?: pulumi.Input<boolean>; optional_bool?: pulumi.Input<boolean | undefined>;
optional_const?: pulumi.Input<"val">; optional_const?: pulumi.Input<"val" | undefined>;
optional_enum?: pulumi.Input<enums.EnumThing>; optional_enum?: pulumi.Input<enums.EnumThing | undefined>;
optional_number?: pulumi.Input<number>; optional_number?: pulumi.Input<number | undefined>;
optional_string?: pulumi.Input<string>; optional_string?: pulumi.Input<string | undefined>;
plain_optional_bool?: boolean; plain_optional_bool?: boolean;
plain_optional_const?: "val"; plain_optional_const?: "val";
plain_optional_number?: number; plain_optional_number?: number;

View file

@ -5,5 +5,5 @@ import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types"; import { input as inputs, output as outputs } from "../types";
export interface FooArgs { export interface FooArgs {
a?: pulumi.Input<boolean>; a?: pulumi.Input<boolean | undefined>;
} }

View file

@ -48,5 +48,5 @@ export interface ProviderArgs {
/** /**
* this is a relaxed string enum which can also be set via env var * this is a relaxed string enum which can also be set via env var
*/ */
favoriteColor?: pulumi.Input<string | enums.Color>; favoriteColor?: pulumi.Input<string | enums.Color | undefined>;
} }

View file

@ -63,6 +63,6 @@ export class Person extends pulumi.CustomResource {
* The set of arguments for constructing a Person resource. * The set of arguments for constructing a Person resource.
*/ */
export interface PersonArgs { export interface PersonArgs {
name?: pulumi.Input<string>; name?: pulumi.Input<string | undefined>;
pets?: pulumi.Input<pulumi.Input<inputs.PetArgs>[]>; pets?: pulumi.Input<pulumi.Input<inputs.PetArgs>[] | undefined>;
} }

View file

@ -59,5 +59,5 @@ export class Pet extends pulumi.CustomResource {
* The set of arguments for constructing a Pet resource. * The set of arguments for constructing a Pet resource.
*/ */
export interface PetArgs { export interface PetArgs {
name?: pulumi.Input<string>; name?: pulumi.Input<string | undefined>;
} }

View file

@ -5,5 +5,5 @@ import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types"; import { input as inputs, output as outputs } from "../types";
export interface PetArgs { export interface PetArgs {
name?: pulumi.Input<string>; name?: pulumi.Input<string | undefined>;
} }

View file

@ -63,6 +63,6 @@ export class Person extends pulumi.CustomResource {
* The set of arguments for constructing a Person resource. * The set of arguments for constructing a Person resource.
*/ */
export interface PersonArgs { export interface PersonArgs {
name?: pulumi.Input<string>; name?: pulumi.Input<string | undefined>;
pets?: pulumi.Input<pulumi.Input<inputs.PetArgs>[]>; pets?: pulumi.Input<pulumi.Input<inputs.PetArgs>[] | undefined>;
} }

View file

@ -59,5 +59,5 @@ export class Pet extends pulumi.CustomResource {
* The set of arguments for constructing a Pet resource. * The set of arguments for constructing a Pet resource.
*/ */
export interface PetArgs { export interface PetArgs {
name?: pulumi.Input<string>; name?: pulumi.Input<string | undefined>;
} }

View file

@ -5,5 +5,5 @@ import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types"; import { input as inputs, output as outputs } from "../types";
export interface PetArgs { export interface PetArgs {
name?: pulumi.Input<string>; name?: pulumi.Input<string | undefined>;
} }

View file

@ -65,7 +65,7 @@ export interface NurseryArgs {
/** /**
* The sizes of trees available * The sizes of trees available
*/ */
sizes?: pulumi.Input<{[key: string]: pulumi.Input<enums.tree.v1.TreeSize>}>; sizes?: pulumi.Input<{[key: string]: pulumi.Input<enums.tree.v1.TreeSize>} | undefined>;
/** /**
* The varieties available * The varieties available
*/ */

View file

@ -75,16 +75,16 @@ export class RubberTree extends pulumi.CustomResource {
} }
export interface RubberTreeState { export interface RubberTreeState {
farm?: pulumi.Input<enums.tree.v1.Farm | string>; farm?: pulumi.Input<enums.tree.v1.Farm | string | undefined>;
} }
/** /**
* The set of arguments for constructing a RubberTree resource. * The set of arguments for constructing a RubberTree resource.
*/ */
export interface RubberTreeArgs { export interface RubberTreeArgs {
container?: pulumi.Input<inputs.ContainerArgs>; container?: pulumi.Input<inputs.ContainerArgs | undefined>;
diameter: pulumi.Input<enums.tree.v1.Diameter>; diameter: pulumi.Input<enums.tree.v1.Diameter>;
farm?: pulumi.Input<enums.tree.v1.Farm | string>; farm?: pulumi.Input<enums.tree.v1.Farm | string | undefined>;
size?: pulumi.Input<enums.tree.v1.TreeSize>; size?: pulumi.Input<enums.tree.v1.TreeSize | undefined>;
type: pulumi.Input<enums.tree.v1.RubberTreeVariety>; type: pulumi.Input<enums.tree.v1.RubberTreeVariety>;
} }

View file

@ -5,8 +5,8 @@ import * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs, enums } from "../types"; import { input as inputs, output as outputs, enums } from "../types";
export interface ContainerArgs { export interface ContainerArgs {
brightness?: pulumi.Input<enums.ContainerBrightness>; brightness?: pulumi.Input<enums.ContainerBrightness | undefined>;
color?: pulumi.Input<enums.ContainerColor | string>; color?: pulumi.Input<enums.ContainerColor | string | undefined>;
material?: pulumi.Input<string>; material?: pulumi.Input<string | undefined>;
size: pulumi.Input<enums.ContainerSize>; size: pulumi.Input<enums.ContainerSize>;
} }

View file

@ -61,8 +61,8 @@ export namespace Foo {
* The set of arguments for the Foo.getKubeconfig method. * The set of arguments for the Foo.getKubeconfig method.
*/ */
export interface GetKubeconfigArgs { export interface GetKubeconfigArgs {
profileName?: pulumi.Input<string>; profileName?: pulumi.Input<string | undefined>;
roleArn?: pulumi.Input<string>; roleArn?: pulumi.Input<string | undefined>;
} }
/** /**

View file

@ -91,16 +91,16 @@ export namespace Foo {
* The set of arguments for the Foo.bar method. * The set of arguments for the Foo.bar method.
*/ */
export interface BarArgs { export interface BarArgs {
baz?: pulumi.Input<inputs.nested.BazArgs>; baz?: pulumi.Input<inputs.nested.BazArgs | undefined>;
bazPlain?: inputs.nested.BazArgs; bazPlain?: inputs.nested.BazArgs;
bazRequired: pulumi.Input<inputs.nested.BazArgs>; bazRequired: pulumi.Input<inputs.nested.BazArgs>;
boolValue?: pulumi.Input<boolean>; boolValue?: pulumi.Input<boolean | undefined>;
boolValuePlain?: boolean; boolValuePlain?: boolean;
boolValueRequired: pulumi.Input<boolean>; boolValueRequired: pulumi.Input<boolean>;
name?: pulumi.Input<pulumiRandom.RandomPet>; name?: pulumi.Input<pulumiRandom.RandomPet | undefined>;
namePlain?: pulumiRandom.RandomPet; namePlain?: pulumiRandom.RandomPet;
nameRequired: pulumi.Input<pulumiRandom.RandomPet>; nameRequired: pulumi.Input<pulumiRandom.RandomPet>;
stringValue?: pulumi.Input<string>; stringValue?: pulumi.Input<string | undefined>;
stringValuePlain?: string; stringValuePlain?: string;
stringValueRequired: pulumi.Input<string>; stringValueRequired: pulumi.Input<string>;
} }

View file

@ -11,7 +11,7 @@ export namespace nested {
} }
export interface BazArgs { export interface BazArgs {
hello?: pulumi.Input<string>; hello?: pulumi.Input<string | undefined>;
world?: pulumi.Input<string>; world?: pulumi.Input<string | undefined>;
} }
} }

View file

@ -89,5 +89,5 @@ export interface ComponentArgs {
d?: number; d?: number;
e: string; e: string;
f?: string; f?: string;
foo?: pulumi.Input<inputs.FooArgs>; foo?: pulumi.Input<inputs.FooArgs | undefined>;
} }

View file

@ -91,5 +91,5 @@ export interface ComponentArgs {
d?: number; d?: number;
e: string; e: string;
f?: string; f?: string;
foo?: pulumi.Input<inputs.FooArgs>; foo?: pulumi.Input<inputs.FooArgs | undefined>;
} }

View file

@ -33,5 +33,5 @@ export function argFunctionOutput(args?: ArgFunctionOutputArgs, opts?: pulumi.In
} }
export interface ArgFunctionOutputArgs { export interface ArgFunctionOutputArgs {
arg1?: pulumi.Input<Resource>; arg1?: pulumi.Input<Resource | undefined>;
} }

View file

@ -49,5 +49,5 @@ export class OtherResource extends pulumi.ComponentResource {
* The set of arguments for constructing a OtherResource resource. * The set of arguments for constructing a OtherResource resource.
*/ */
export interface OtherResourceArgs { export interface OtherResourceArgs {
foo?: pulumi.Input<Resource>; foo?: pulumi.Input<Resource | undefined>;
} }

View file

@ -59,5 +59,5 @@ export class Resource extends pulumi.CustomResource {
* The set of arguments for constructing a Resource resource. * The set of arguments for constructing a Resource resource.
*/ */
export interface ResourceArgs { export interface ResourceArgs {
bar?: pulumi.Input<string>; bar?: pulumi.Input<string | undefined>;
} }

View file

@ -33,5 +33,5 @@ export function argFunctionOutput(args?: ArgFunctionOutputArgs, opts?: pulumi.In
} }
export interface ArgFunctionOutputArgs { export interface ArgFunctionOutputArgs {
arg1?: pulumi.Input<Resource>; arg1?: pulumi.Input<Resource | undefined>;
} }

View file

@ -49,5 +49,5 @@ export class OtherResource extends pulumi.ComponentResource {
* The set of arguments for constructing a OtherResource resource. * The set of arguments for constructing a OtherResource resource.
*/ */
export interface OtherResourceArgs { export interface OtherResourceArgs {
foo?: pulumi.Input<Resource>; foo?: pulumi.Input<Resource | undefined>;
} }

View file

@ -61,5 +61,5 @@ export class Resource extends pulumi.CustomResource {
* The set of arguments for constructing a Resource resource. * The set of arguments for constructing a Resource resource.
*/ */
export interface ResourceArgs { export interface ResourceArgs {
bar?: pulumi.Input<string>; bar?: pulumi.Input<string | undefined>;
} }

View file

@ -68,7 +68,7 @@ export class TypeUses extends pulumi.CustomResource {
* The set of arguments for constructing a TypeUses resource. * The set of arguments for constructing a TypeUses resource.
*/ */
export interface TypeUsesArgs { export interface TypeUsesArgs {
bar?: pulumi.Input<inputs.SomeOtherObjectArgs>; bar?: pulumi.Input<inputs.SomeOtherObjectArgs | undefined>;
baz?: pulumi.Input<inputs.ObjectWithNodeOptionalInputsArgs>; baz?: pulumi.Input<inputs.ObjectWithNodeOptionalInputsArgs | undefined>;
foo?: pulumi.Input<inputs.ObjectArgs>; foo?: pulumi.Input<inputs.ObjectArgs | undefined>;
} }

View file

@ -7,28 +7,28 @@ import { input as inputs, output as outputs } from "../types";
import {Resource} from ".."; import {Resource} from "..";
export interface ConfigMapArgs { export interface ConfigMapArgs {
config?: pulumi.Input<string>; config?: pulumi.Input<string | undefined>;
} }
export interface ObjectArgs { export interface ObjectArgs {
bar?: pulumi.Input<string>; bar?: pulumi.Input<string | undefined>;
configs?: pulumi.Input<pulumi.Input<inputs.ConfigMapArgs>[]>; configs?: pulumi.Input<pulumi.Input<inputs.ConfigMapArgs>[] | undefined>;
foo?: pulumi.Input<Resource>; foo?: pulumi.Input<Resource | undefined>;
/** /**
* List of lists of other objects * List of lists of other objects
*/ */
others?: pulumi.Input<pulumi.Input<pulumi.Input<inputs.SomeOtherObjectArgs>[]>[]>; others?: pulumi.Input<pulumi.Input<pulumi.Input<inputs.SomeOtherObjectArgs>[]>[] | undefined>;
/** /**
* Mapping from string to list of some other object * Mapping from string to list of some other object
*/ */
stillOthers?: pulumi.Input<{[key: string]: pulumi.Input<pulumi.Input<inputs.SomeOtherObjectArgs>[]>}>; stillOthers?: pulumi.Input<{[key: string]: pulumi.Input<pulumi.Input<inputs.SomeOtherObjectArgs>[]>} | undefined>;
} }
export interface ObjectWithNodeOptionalInputsArgs { export interface ObjectWithNodeOptionalInputsArgs {
bar?: pulumi.Input<number>; bar?: pulumi.Input<number | undefined>;
foo?: pulumi.Input<string>; foo?: pulumi.Input<string | undefined>;
} }
export interface SomeOtherObjectArgs { export interface SomeOtherObjectArgs {
baz?: pulumi.Input<string>; baz?: pulumi.Input<string | undefined>;
} }

View file

@ -33,5 +33,5 @@ export function argFunctionOutput(args?: ArgFunctionOutputArgs, opts?: pulumi.In
} }
export interface ArgFunctionOutputArgs { export interface ArgFunctionOutputArgs {
arg1?: pulumi.Input<Resource>; arg1?: pulumi.Input<Resource | undefined>;
} }

View file

@ -51,5 +51,5 @@ export class OtherResource extends pulumi.ComponentResource {
*/ */
export interface OtherResourceArgs { export interface OtherResourceArgs {
bar?: pulumi.Input<string>[]; bar?: pulumi.Input<string>[];
foo?: pulumi.Input<Resource>; foo?: pulumi.Input<Resource | undefined>;
} }

View file

@ -61,5 +61,5 @@ export class Resource extends pulumi.CustomResource {
* The set of arguments for constructing a Resource resource. * The set of arguments for constructing a Resource resource.
*/ */
export interface ResourceArgs { export interface ResourceArgs {
bar?: pulumi.Input<string>; bar?: pulumi.Input<string | undefined>;
} }

View file

@ -71,8 +71,8 @@ export class TypeUses extends pulumi.CustomResource {
* The set of arguments for constructing a TypeUses resource. * The set of arguments for constructing a TypeUses resource.
*/ */
export interface TypeUsesArgs { export interface TypeUsesArgs {
bar?: pulumi.Input<inputs.SomeOtherObjectArgs>; bar?: pulumi.Input<inputs.SomeOtherObjectArgs | undefined>;
baz?: pulumi.Input<inputs.ObjectWithNodeOptionalInputsArgs>; baz?: pulumi.Input<inputs.ObjectWithNodeOptionalInputsArgs | undefined>;
foo?: pulumi.Input<inputs.ObjectArgs>; foo?: pulumi.Input<inputs.ObjectArgs | undefined>;
qux?: pulumi.Input<enums.RubberTreeVariety>; qux?: pulumi.Input<enums.RubberTreeVariety | undefined>;
} }

View file

@ -7,28 +7,28 @@ import { input as inputs, output as outputs, enums } from "../types";
import {Resource} from ".."; import {Resource} from "..";
export interface ConfigMapArgs { export interface ConfigMapArgs {
config?: pulumi.Input<string>; config?: pulumi.Input<string | undefined>;
} }
export interface ObjectArgs { export interface ObjectArgs {
bar?: pulumi.Input<string>; bar?: pulumi.Input<string | undefined>;
configs?: pulumi.Input<pulumi.Input<inputs.ConfigMapArgs>[]>; configs?: pulumi.Input<pulumi.Input<inputs.ConfigMapArgs>[] | undefined>;
foo?: pulumi.Input<Resource>; foo?: pulumi.Input<Resource | undefined>;
/** /**
* List of lists of other objects * List of lists of other objects
*/ */
others?: pulumi.Input<pulumi.Input<pulumi.Input<inputs.SomeOtherObjectArgs>[]>[]>; others?: pulumi.Input<pulumi.Input<pulumi.Input<inputs.SomeOtherObjectArgs>[]>[] | undefined>;
/** /**
* Mapping from string to list of some other object * Mapping from string to list of some other object
*/ */
stillOthers?: pulumi.Input<{[key: string]: pulumi.Input<pulumi.Input<inputs.SomeOtherObjectArgs>[]>}>; stillOthers?: pulumi.Input<{[key: string]: pulumi.Input<pulumi.Input<inputs.SomeOtherObjectArgs>[]>} | undefined>;
} }
export interface ObjectWithNodeOptionalInputsArgs { export interface ObjectWithNodeOptionalInputsArgs {
bar?: pulumi.Input<number>; bar?: pulumi.Input<number | undefined>;
foo?: pulumi.Input<string>; foo?: pulumi.Input<string | undefined>;
} }
export interface SomeOtherObjectArgs { export interface SomeOtherObjectArgs {
baz?: pulumi.Input<string>; baz?: pulumi.Input<string | undefined>;
} }

View file

@ -68,6 +68,14 @@ func Union(t ...TypeAst) TypeAst {
return &unionType{t[0], t[1], t[2:]} return &unionType{t[0], t[1], t[2:]}
} }
// IsUnion returns true if the AST node is a union.
func IsUnion(t TypeAst) ([]TypeAst, bool) {
if union, ok := t.(*unionType); ok {
return union.all(), true
}
return nil, false
}
// Normalizes by unnesting unions `A | (B | C) => A | B | C`. // Normalizes by unnesting unions `A | (B | C) => A | B | C`.
func Normalize(ast TypeAst) TypeAst { func Normalize(ast TypeAst) TypeAst {
return transform(ast, func(t TypeAst) TypeAst { return transform(ast, func(t TypeAst) TypeAst {

View file

@ -432,13 +432,15 @@ func (mod *modContext) genPlainType(w io.Writer, name, comment string, propertie
prefix = "readonly " prefix = "readonly "
} }
sigil, propertyType := "", p.Type sigil, typ := "", mod.typeAst(p.Type, input, p.ConstValue)
if !p.IsRequired() { if types, ok := tstypes.IsUnion(typ); ok {
sigil, propertyType = "?", codegen.RequiredType(p) if id, ok := tstypes.IsIdentifier(types[len(types)-1]); ok && id == "undefined" {
sigil, typ = "?", tstypes.Union(types[:len(types)-1]...)
}
} }
typ := mod.typeString(propertyType, input, p.ConstValue) typLit := tstypes.TypeLiteral(tstypes.Normalize(typ))
fmt.Fprintf(w, "%s %s%s%s: %s;\n", indent, prefix, p.Name, sigil, typ) fmt.Fprintf(w, "%s %s%s%s: %s;\n", indent, prefix, p.Name, sigil, typLit)
} }
fmt.Fprintf(w, "%s}\n", indent) fmt.Fprintf(w, "%s}\n", indent)
} }