From cea1f989c8c392e552675e54064d378f0daf01f3 Mon Sep 17 00:00:00 2001 From: pulumi-bot Date: Fri, 13 Dec 2024 17:40:31 +0000 Subject: [PATCH] make build_sdks --- sdk/dotnet/GetSchemas.cs | 25 ++++ sdk/dotnet/GetSequences.cs | 25 ++++ sdk/dotnet/GetTables.cs | 25 ++++ sdk/dotnet/Utilities.cs | 7 + sdk/go/postgresql/getSchemas.go | 16 +-- sdk/go/postgresql/getSequences.go | 16 +-- sdk/go/postgresql/getTables.go | 16 +-- sdk/java/build.gradle | 2 +- .../postgresql/PostgresqlFunctions.java | 127 ++++++++++++++++++ .../java/com/pulumi/postgresql/Utilities.java | 31 +++-- sdk/nodejs/package.json | 2 +- sdk/python/pyproject.toml | 4 +- 12 files changed, 244 insertions(+), 52 deletions(-) diff --git a/sdk/dotnet/GetSchemas.cs b/sdk/dotnet/GetSchemas.cs index 484a7a4e..e86a57de 100644 --- a/sdk/dotnet/GetSchemas.cs +++ b/sdk/dotnet/GetSchemas.cs @@ -60,6 +60,31 @@ public static Task InvokeAsync(GetSchemasArgs args, InvokeOpti /// public static Output Invoke(GetSchemasInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("postgresql:index/getSchemas:getSchemas", args ?? new GetSchemasInvokeArgs(), options.WithDefaults()); + + /// + /// The ``postgresql.getSchemas`` data source retrieves a list of schema names from a specified PostgreSQL database. + /// + /// + /// ## Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using PostgreSql = Pulumi.PostgreSql; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var mySchemas = PostgreSql.GetSchemas.Invoke(new() + /// { + /// Database = "my_database", + /// }); + /// + /// }); + /// ``` + /// + public static Output Invoke(GetSchemasInvokeArgs args, InvokeOutputOptions options) + => global::Pulumi.Deployment.Instance.Invoke("postgresql:index/getSchemas:getSchemas", args ?? new GetSchemasInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/GetSequences.cs b/sdk/dotnet/GetSequences.cs index 67ba0439..f14476f8 100644 --- a/sdk/dotnet/GetSequences.cs +++ b/sdk/dotnet/GetSequences.cs @@ -60,6 +60,31 @@ public static Task InvokeAsync(GetSequencesArgs args, Invoke /// public static Output Invoke(GetSequencesInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("postgresql:index/getSequences:getSequences", args ?? new GetSequencesInvokeArgs(), options.WithDefaults()); + + /// + /// The ``postgresql.getSequences`` data source retrieves a list of sequence names from a specified PostgreSQL database. + /// + /// + /// ## Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using PostgreSql = Pulumi.PostgreSql; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var mySequences = PostgreSql.GetSequences.Invoke(new() + /// { + /// Database = "my_database", + /// }); + /// + /// }); + /// ``` + /// + public static Output Invoke(GetSequencesInvokeArgs args, InvokeOutputOptions options) + => global::Pulumi.Deployment.Instance.Invoke("postgresql:index/getSequences:getSequences", args ?? new GetSequencesInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/GetTables.cs b/sdk/dotnet/GetTables.cs index 4fd01af6..e93337f5 100644 --- a/sdk/dotnet/GetTables.cs +++ b/sdk/dotnet/GetTables.cs @@ -60,6 +60,31 @@ public static Task InvokeAsync(GetTablesArgs args, InvokeOption /// public static Output Invoke(GetTablesInvokeArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.Invoke("postgresql:index/getTables:getTables", args ?? new GetTablesInvokeArgs(), options.WithDefaults()); + + /// + /// The ``postgresql.getTables`` data source retrieves a list of table names from a specified PostgreSQL database. + /// + /// + /// ## Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using PostgreSql = Pulumi.PostgreSql; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var myTables = PostgreSql.GetTables.Invoke(new() + /// { + /// Database = "my_database", + /// }); + /// + /// }); + /// ``` + /// + public static Output Invoke(GetTablesInvokeArgs args, InvokeOutputOptions options) + => global::Pulumi.Deployment.Instance.Invoke("postgresql:index/getTables:getTables", args ?? new GetTablesInvokeArgs(), options.WithDefaults()); } diff --git a/sdk/dotnet/Utilities.cs b/sdk/dotnet/Utilities.cs index d30638b7..4b75bc14 100644 --- a/sdk/dotnet/Utilities.cs +++ b/sdk/dotnet/Utilities.cs @@ -56,6 +56,13 @@ static class Utilities return dst; } + public static global::Pulumi.InvokeOutputOptions WithDefaults(this global::Pulumi.InvokeOutputOptions? src) + { + var dst = src ?? new global::Pulumi.InvokeOutputOptions{}; + dst.Version = src?.Version ?? Version; + return dst; + } + private readonly static string version; public static string Version => version; diff --git a/sdk/go/postgresql/getSchemas.go b/sdk/go/postgresql/getSchemas.go index 77deb8dc..e8d2a785 100644 --- a/sdk/go/postgresql/getSchemas.go +++ b/sdk/go/postgresql/getSchemas.go @@ -81,21 +81,11 @@ type GetSchemasResult struct { } func GetSchemasOutput(ctx *pulumi.Context, args GetSchemasOutputArgs, opts ...pulumi.InvokeOption) GetSchemasResultOutput { - return pulumi.ToOutputWithContext(context.Background(), args). + return pulumi.ToOutputWithContext(ctx.Context(), args). ApplyT(func(v interface{}) (GetSchemasResultOutput, error) { args := v.(GetSchemasArgs) - opts = internal.PkgInvokeDefaultOpts(opts) - var rv GetSchemasResult - secret, err := ctx.InvokePackageRaw("postgresql:index/getSchemas:getSchemas", args, &rv, "", opts...) - if err != nil { - return GetSchemasResultOutput{}, err - } - - output := pulumi.ToOutput(rv).(GetSchemasResultOutput) - if secret { - return pulumi.ToSecret(output).(GetSchemasResultOutput), nil - } - return output, nil + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("postgresql:index/getSchemas:getSchemas", args, GetSchemasResultOutput{}, options).(GetSchemasResultOutput), nil }).(GetSchemasResultOutput) } diff --git a/sdk/go/postgresql/getSequences.go b/sdk/go/postgresql/getSequences.go index 17b99c0f..ac4da1c7 100644 --- a/sdk/go/postgresql/getSequences.go +++ b/sdk/go/postgresql/getSequences.go @@ -82,21 +82,11 @@ type GetSequencesResult struct { } func GetSequencesOutput(ctx *pulumi.Context, args GetSequencesOutputArgs, opts ...pulumi.InvokeOption) GetSequencesResultOutput { - return pulumi.ToOutputWithContext(context.Background(), args). + return pulumi.ToOutputWithContext(ctx.Context(), args). ApplyT(func(v interface{}) (GetSequencesResultOutput, error) { args := v.(GetSequencesArgs) - opts = internal.PkgInvokeDefaultOpts(opts) - var rv GetSequencesResult - secret, err := ctx.InvokePackageRaw("postgresql:index/getSequences:getSequences", args, &rv, "", opts...) - if err != nil { - return GetSequencesResultOutput{}, err - } - - output := pulumi.ToOutput(rv).(GetSequencesResultOutput) - if secret { - return pulumi.ToSecret(output).(GetSequencesResultOutput), nil - } - return output, nil + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("postgresql:index/getSequences:getSequences", args, GetSequencesResultOutput{}, options).(GetSequencesResultOutput), nil }).(GetSequencesResultOutput) } diff --git a/sdk/go/postgresql/getTables.go b/sdk/go/postgresql/getTables.go index 6f649897..247efe2c 100644 --- a/sdk/go/postgresql/getTables.go +++ b/sdk/go/postgresql/getTables.go @@ -85,21 +85,11 @@ type GetTablesResult struct { } func GetTablesOutput(ctx *pulumi.Context, args GetTablesOutputArgs, opts ...pulumi.InvokeOption) GetTablesResultOutput { - return pulumi.ToOutputWithContext(context.Background(), args). + return pulumi.ToOutputWithContext(ctx.Context(), args). ApplyT(func(v interface{}) (GetTablesResultOutput, error) { args := v.(GetTablesArgs) - opts = internal.PkgInvokeDefaultOpts(opts) - var rv GetTablesResult - secret, err := ctx.InvokePackageRaw("postgresql:index/getTables:getTables", args, &rv, "", opts...) - if err != nil { - return GetTablesResultOutput{}, err - } - - output := pulumi.ToOutput(rv).(GetTablesResultOutput) - if secret { - return pulumi.ToSecret(output).(GetTablesResultOutput), nil - } - return output, nil + options := pulumi.InvokeOutputOptions{InvokeOptions: internal.PkgInvokeDefaultOpts(opts)} + return ctx.InvokeOutput("postgresql:index/getTables:getTables", args, GetTablesResultOutput{}, options).(GetTablesResultOutput), nil }).(GetTablesResultOutput) } diff --git a/sdk/java/build.gradle b/sdk/java/build.gradle index 66cec235..dee71f52 100644 --- a/sdk/java/build.gradle +++ b/sdk/java/build.gradle @@ -44,7 +44,7 @@ repositories { dependencies { implementation("com.google.code.findbugs:jsr305:3.0.2") implementation("com.google.code.gson:gson:2.8.9") - implementation("com.pulumi:pulumi:0.18.0") + implementation("com.pulumi:pulumi:0.20.0") } task sourcesJar(type: Jar) { diff --git a/sdk/java/src/main/java/com/pulumi/postgresql/PostgresqlFunctions.java b/sdk/java/src/main/java/com/pulumi/postgresql/PostgresqlFunctions.java index 556582a0..4e1145fc 100644 --- a/sdk/java/src/main/java/com/pulumi/postgresql/PostgresqlFunctions.java +++ b/sdk/java/src/main/java/com/pulumi/postgresql/PostgresqlFunctions.java @@ -7,6 +7,7 @@ import com.pulumi.core.TypeShape; import com.pulumi.deployment.Deployment; import com.pulumi.deployment.InvokeOptions; +import com.pulumi.deployment.InvokeOutputOptions; import com.pulumi.postgresql.Utilities; import com.pulumi.postgresql.inputs.GetSchemasArgs; import com.pulumi.postgresql.inputs.GetSchemasPlainArgs; @@ -146,6 +147,48 @@ public static CompletableFuture getSchemasPlain(GetSchemasPlai public static Output getSchemas(GetSchemasArgs args, InvokeOptions options) { return Deployment.getInstance().invoke("postgresql:index/getSchemas:getSchemas", TypeShape.of(GetSchemasResult.class), args, Utilities.withVersion(options)); } + /** + * The ``postgresql.getSchemas`` data source retrieves a list of schema names from a specified PostgreSQL database. + * + * ## Usage + * + * <!--Start PulumiCodeChooser --> + *
+     * {@code
+     * package generated_program;
+     * 
+     * import com.pulumi.Context;
+     * import com.pulumi.Pulumi;
+     * import com.pulumi.core.Output;
+     * import com.pulumi.postgresql.PostgresqlFunctions;
+     * import com.pulumi.postgresql.inputs.GetSchemasArgs;
+     * import java.util.List;
+     * import java.util.ArrayList;
+     * import java.util.Map;
+     * import java.io.File;
+     * import java.nio.file.Files;
+     * import java.nio.file.Paths;
+     * 
+     * public class App {
+     *     public static void main(String[] args) {
+     *         Pulumi.run(App::stack);
+     *     }
+     * 
+     *     public static void stack(Context ctx) {
+     *         final var mySchemas = PostgresqlFunctions.getSchemas(GetSchemasArgs.builder()
+     *             .database("my_database")
+     *             .build());
+     * 
+     *     }
+     * }
+     * }
+     * 
+ * <!--End PulumiCodeChooser --> + * + */ + public static Output getSchemas(GetSchemasArgs args, InvokeOutputOptions options) { + return Deployment.getInstance().invoke("postgresql:index/getSchemas:getSchemas", TypeShape.of(GetSchemasResult.class), args, Utilities.withVersion(options)); + } /** * The ``postgresql.getSchemas`` data source retrieves a list of schema names from a specified PostgreSQL database. * @@ -314,6 +357,48 @@ public static CompletableFuture getSequencesPlain(GetSequenc public static Output getSequences(GetSequencesArgs args, InvokeOptions options) { return Deployment.getInstance().invoke("postgresql:index/getSequences:getSequences", TypeShape.of(GetSequencesResult.class), args, Utilities.withVersion(options)); } + /** + * The ``postgresql.getSequences`` data source retrieves a list of sequence names from a specified PostgreSQL database. + * + * ## Usage + * + * <!--Start PulumiCodeChooser --> + *
+     * {@code
+     * package generated_program;
+     * 
+     * import com.pulumi.Context;
+     * import com.pulumi.Pulumi;
+     * import com.pulumi.core.Output;
+     * import com.pulumi.postgresql.PostgresqlFunctions;
+     * import com.pulumi.postgresql.inputs.GetSequencesArgs;
+     * import java.util.List;
+     * import java.util.ArrayList;
+     * import java.util.Map;
+     * import java.io.File;
+     * import java.nio.file.Files;
+     * import java.nio.file.Paths;
+     * 
+     * public class App {
+     *     public static void main(String[] args) {
+     *         Pulumi.run(App::stack);
+     *     }
+     * 
+     *     public static void stack(Context ctx) {
+     *         final var mySequences = PostgresqlFunctions.getSequences(GetSequencesArgs.builder()
+     *             .database("my_database")
+     *             .build());
+     * 
+     *     }
+     * }
+     * }
+     * 
+ * <!--End PulumiCodeChooser --> + * + */ + public static Output getSequences(GetSequencesArgs args, InvokeOutputOptions options) { + return Deployment.getInstance().invoke("postgresql:index/getSequences:getSequences", TypeShape.of(GetSequencesResult.class), args, Utilities.withVersion(options)); + } /** * The ``postgresql.getSequences`` data source retrieves a list of sequence names from a specified PostgreSQL database. * @@ -482,6 +567,48 @@ public static CompletableFuture getTablesPlain(GetTablesPlainAr public static Output getTables(GetTablesArgs args, InvokeOptions options) { return Deployment.getInstance().invoke("postgresql:index/getTables:getTables", TypeShape.of(GetTablesResult.class), args, Utilities.withVersion(options)); } + /** + * The ``postgresql.getTables`` data source retrieves a list of table names from a specified PostgreSQL database. + * + * ## Usage + * + * <!--Start PulumiCodeChooser --> + *
+     * {@code
+     * package generated_program;
+     * 
+     * import com.pulumi.Context;
+     * import com.pulumi.Pulumi;
+     * import com.pulumi.core.Output;
+     * import com.pulumi.postgresql.PostgresqlFunctions;
+     * import com.pulumi.postgresql.inputs.GetTablesArgs;
+     * import java.util.List;
+     * import java.util.ArrayList;
+     * import java.util.Map;
+     * import java.io.File;
+     * import java.nio.file.Files;
+     * import java.nio.file.Paths;
+     * 
+     * public class App {
+     *     public static void main(String[] args) {
+     *         Pulumi.run(App::stack);
+     *     }
+     * 
+     *     public static void stack(Context ctx) {
+     *         final var myTables = PostgresqlFunctions.getTables(GetTablesArgs.builder()
+     *             .database("my_database")
+     *             .build());
+     * 
+     *     }
+     * }
+     * }
+     * 
+ * <!--End PulumiCodeChooser --> + * + */ + public static Output getTables(GetTablesArgs args, InvokeOutputOptions options) { + return Deployment.getInstance().invoke("postgresql:index/getTables:getTables", TypeShape.of(GetTablesResult.class), args, Utilities.withVersion(options)); + } /** * The ``postgresql.getTables`` data source retrieves a list of table names from a specified PostgreSQL database. * diff --git a/sdk/java/src/main/java/com/pulumi/postgresql/Utilities.java b/sdk/java/src/main/java/com/pulumi/postgresql/Utilities.java index 81cc452e..e6fe99d6 100644 --- a/sdk/java/src/main/java/com/pulumi/postgresql/Utilities.java +++ b/sdk/java/src/main/java/com/pulumi/postgresql/Utilities.java @@ -14,6 +14,7 @@ import javax.annotation.Nullable; import com.pulumi.core.internal.Environment; import com.pulumi.deployment.InvokeOptions; +import com.pulumi.deployment.InvokeOutputOptions; public class Utilities { @@ -57,16 +58,28 @@ public static Optional getEnvDouble(java.lang.String... names) return Optional.empty(); } - public static InvokeOptions withVersion(@Nullable InvokeOptions options) { - if (options != null && options.getVersion().isPresent()) { - return options; - } - return new InvokeOptions( - options == null ? null : options.getParent().orElse(null), - options == null ? null : options.getProvider().orElse(null), - getVersion() - ); + public static InvokeOptions withVersion(@Nullable InvokeOptions options) { + if (options != null && options.getVersion().isPresent()) { + return options; + } + return new InvokeOptions( + options == null ? null : options.getParent().orElse(null), + options == null ? null : options.getProvider().orElse(null), + getVersion() + ); + } + + public static InvokeOutputOptions withVersion(@Nullable InvokeOutputOptions options) { + if (options != null && options.getVersion().isPresent()) { + return options; } + return new InvokeOutputOptions( + options == null ? null : options.getParent().orElse(null), + options == null ? null : options.getProvider().orElse(null), + getVersion(), + options == null ? null : options.getDependsOn() + ); + } private static final java.lang.String version; public static java.lang.String getVersion() { diff --git a/sdk/nodejs/package.json b/sdk/nodejs/package.json index fbbf85eb..8bdeba86 100644 --- a/sdk/nodejs/package.json +++ b/sdk/nodejs/package.json @@ -13,7 +13,7 @@ "build": "tsc" }, "dependencies": { - "@pulumi/pulumi": "^3.136.0" + "@pulumi/pulumi": "^3.142.0" }, "devDependencies": { "@types/mime": "^2.0.0", diff --git a/sdk/python/pyproject.toml b/sdk/python/pyproject.toml index 9e499404..21d11cf0 100644 --- a/sdk/python/pyproject.toml +++ b/sdk/python/pyproject.toml @@ -1,10 +1,10 @@ [project] name = "pulumi_postgresql" description = "A Pulumi package for creating and managing postgresql cloud resources." - dependencies = ["parver>=0.2.1", "pulumi>=3.136.0,<4.0.0", "semver>=2.8.1", "typing-extensions>=4.11; python_version < \"3.11\""] + dependencies = ["parver>=0.2.1", "pulumi>=3.142.0,<4.0.0", "semver>=2.8.1", "typing-extensions>=4.11; python_version < \"3.11\""] keywords = ["pulumi", "postgresql"] readme = "README.md" - requires-python = ">=3.8" + requires-python = ">=3.9" version = "3.0.0a0+dev" [project.license] text = "Apache-2.0"