Skip to content

Commit

Permalink
Commit SDK for Renovate
Browse files Browse the repository at this point in the history
  • Loading branch information
pulumi-bot committed Jan 17, 2025
1 parent 85cbcfe commit 40a8dcd
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 23 deletions.
7 changes: 7 additions & 0 deletions sdk/dotnet/Local/Run.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ public static Task<RunResult> InvokeAsync(RunArgs args, InvokeOptions? options =
/// </summary>
public static Output<RunResult> Invoke(RunInvokeArgs args, InvokeOptions? options = null)
=> global::Pulumi.Deployment.Instance.Invoke<RunResult>("command:local:run", args ?? new RunInvokeArgs(), options.WithDefaults());

/// <summary>
/// A local command to be executed.
/// This command will always be run on any preview or deployment. Use `local.Command` to avoid duplicating executions.
/// </summary>
public static Output<RunResult> Invoke(RunInvokeArgs args, InvokeOutputOptions options)
=> global::Pulumi.Deployment.Instance.Invoke<RunResult>("command:local:run", args ?? new RunInvokeArgs(), options.WithDefaults());
}


Expand Down
7 changes: 7 additions & 0 deletions sdk/dotnet/Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
17 changes: 3 additions & 14 deletions sdk/go/command/local/run.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 22 additions & 9 deletions sdk/java/src/main/java/com/pulumi/command/Utilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -57,16 +58,28 @@ public static Optional<java.lang.Double> 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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.pulumi.core.TypeShape;
import com.pulumi.deployment.Deployment;
import com.pulumi.deployment.InvokeOptions;
import com.pulumi.deployment.InvokeOutputOptions;
import java.util.concurrent.CompletableFuture;

public final class LocalFunctions {
Expand Down Expand Up @@ -38,6 +39,14 @@ public static CompletableFuture<RunResult> runPlain(RunPlainArgs args) {
public static Output<RunResult> run(RunArgs args, InvokeOptions options) {
return Deployment.getInstance().invoke("command:local:run", TypeShape.of(RunResult.class), args, Utilities.withVersion(options));
}
/**
* A local command to be executed.
* This command will always be run on any preview or deployment. Use `local.Command` to avoid duplicating executions.
*
*/
public static Output<RunResult> run(RunArgs args, InvokeOutputOptions options) {
return Deployment.getInstance().invoke("command:local:run", TypeShape.of(RunResult.class), args, Utilities.withVersion(options));
}
/**
* A local command to be executed.
* This command will always be run on any preview or deployment. Use `local.Command` to avoid duplicating executions.
Expand Down

0 comments on commit 40a8dcd

Please sign in to comment.