pulumi/tests/testdata/codegen/replace-on-change/nodejs/noRecursive.ts

68 lines
2.7 KiB
TypeScript
Raw Permalink Normal View History

// *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
import * as utilities from "./utilities";
export class NoRecursive extends pulumi.CustomResource {
/**
* Get an existing NoRecursive resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): NoRecursive {
return new NoRecursive(name, undefined as any, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'example::NoRecursive';
/**
* Returns true if the given object is an instance of NoRecursive. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is NoRecursive {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === NoRecursive.__pulumiType;
}
public /*out*/ readonly rec!: pulumi.Output<outputs.Rec | undefined>;
[sdkgen/python] Replace-on-changes values should be camelCased (#15666) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description When replaceOnChanges is set in the schema for a property with a multi-word name, currently, Python SDK generation incorrectly puts its Python name into replace_on_changes. This is wrong, because these property names are passed to the engine and they should be engine names (i.e. schema names). All other languages (Node.js, .NET, Go) do this correctly. This PR adds a test case and fixes the Python generation to use the same naming as all other SDKs. Fixes #15665 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2024-03-13 15:43:56 +00:00
public /*out*/ readonly replaceMe!: pulumi.Output<string | undefined>;
/**
* Create a NoRecursive resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: NoRecursiveArgs, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (!opts.id) {
resourceInputs["rec"] = undefined /*out*/;
[sdkgen/python] Replace-on-changes values should be camelCased (#15666) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description When replaceOnChanges is set in the schema for a property with a multi-word name, currently, Python SDK generation incorrectly puts its Python name into replace_on_changes. This is wrong, because these property names are passed to the engine and they should be engine names (i.e. schema names). All other languages (Node.js, .NET, Go) do this correctly. This PR adds a test case and fixes the Python generation to use the same naming as all other SDKs. Fixes #15665 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2024-03-13 15:43:56 +00:00
resourceInputs["replaceMe"] = undefined /*out*/;
} else {
resourceInputs["rec"] = undefined /*out*/;
[sdkgen/python] Replace-on-changes values should be camelCased (#15666) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description When replaceOnChanges is set in the schema for a property with a multi-word name, currently, Python SDK generation incorrectly puts its Python name into replace_on_changes. This is wrong, because these property names are passed to the engine and they should be engine names (i.e. schema names). All other languages (Node.js, .NET, Go) do this correctly. This PR adds a test case and fixes the Python generation to use the same naming as all other SDKs. Fixes #15665 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2024-03-13 15:43:56 +00:00
resourceInputs["replaceMe"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
[sdkgen/python] Replace-on-changes values should be camelCased (#15666) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description When replaceOnChanges is set in the schema for a property with a multi-word name, currently, Python SDK generation incorrectly puts its Python name into replace_on_changes. This is wrong, because these property names are passed to the engine and they should be engine names (i.e. schema names). All other languages (Node.js, .NET, Go) do this correctly. This PR adds a test case and fixes the Python generation to use the same naming as all other SDKs. Fixes #15665 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [x] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2024-03-13 15:43:56 +00:00
const replaceOnChanges = { replaceOnChanges: ["replaceMe"] };
opts = pulumi.mergeOptions(opts, replaceOnChanges);
super(NoRecursive.__pulumiType, name, resourceInputs, opts);
}
}
/**
* The set of arguments for constructing a NoRecursive resource.
*/
export interface NoRecursiveArgs {
}