generated from pulumi/pulumi-provider-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
1,132 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package cmd | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/pulumi/pulumi-go-provider/infer" | ||
pb "github.com/unmango/pulumi-baremetal/gen/go/unmango/baremetal/v1alpha1" | ||
) | ||
|
||
type RmArgs struct { | ||
Dir bool `pulumi:"dir,optional"` | ||
Files []string `pulumi:"files"` | ||
Force bool `pulumi:"force,optional"` | ||
Help bool `pulumi:"help,optional"` | ||
OneFileSystem bool `pulumi:"oneFileSystem,optional"` | ||
Recursive bool `pulumi:"recursive,optional"` | ||
Verbose bool `pulumi:"verbose,optional"` | ||
} | ||
|
||
// Cmd implements CommandArgs. | ||
func (r RmArgs) Cmd() *pb.Command { | ||
b := builder{r.Files} | ||
b.op(r.Dir, "--dir") | ||
b.op(r.Force, "--force") | ||
b.op(r.Help, "--help") | ||
b.op(r.OneFileSystem, "--one-file-system") | ||
b.op(r.Verbose, "--verbose") | ||
|
||
return &pb.Command{ | ||
Bin: pb.Bin_BIN_RM, | ||
Args: b.args, | ||
} | ||
} | ||
|
||
// ExpectedFiles implements CommandArgs. | ||
func (r RmArgs) ExpectedFiles() []string { | ||
return []string{} | ||
} | ||
|
||
var _ CommandArgs = RmArgs{} | ||
|
||
type Rm struct{} | ||
|
||
type RmState = CommandState[RmArgs] | ||
|
||
// Create implements infer.CustomCreate. | ||
func (Rm) Create(ctx context.Context, name string, inputs RmArgs, preview bool) (id string, output RmState, err error) { | ||
state := RmState{} | ||
if err := state.Create(ctx, inputs, preview); err != nil { | ||
return name, state, fmt.Errorf("wget: %w", err) | ||
} | ||
|
||
return name, state, nil | ||
} | ||
|
||
// Update implements infer.CustomUpdate. | ||
func (Rm) Update(ctx context.Context, id string, olds RmState, news RmArgs, preview bool) (RmState, error) { | ||
state, err := olds.Update(ctx, news, preview) | ||
if err != nil { | ||
return olds, fmt.Errorf("wget: %w", err) | ||
} | ||
|
||
return state, nil | ||
} | ||
|
||
// Delete implements infer.CustomDelete. | ||
func (Rm) Delete(ctx context.Context, id string, props RmState) error { | ||
if err := props.Delete(ctx); err != nil { | ||
return fmt.Errorf("wget: %w", err) | ||
} | ||
|
||
return nil | ||
} | ||
|
||
var _ = (infer.CustomCreate[RmArgs, RmState])((*Rm)(nil)) | ||
var _ = (infer.CustomUpdate[RmArgs, RmState])((*Rm)(nil)) | ||
var _ = (infer.CustomDelete[RmState])((*Rm)(nil)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// *** WARNING: this file was generated by pulumi. *** | ||
// *** 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; | ||
using Pulumi; | ||
|
||
namespace UnMango.Baremetal.Cmd.Outputs | ||
{ | ||
|
||
[OutputType] | ||
public sealed class RmArgs | ||
{ | ||
public readonly bool? Dir; | ||
public readonly ImmutableArray<string> Files; | ||
public readonly bool? Force; | ||
public readonly bool? Help; | ||
public readonly bool? OneFileSystem; | ||
public readonly bool? Recursive; | ||
public readonly bool? Verbose; | ||
|
||
[OutputConstructor] | ||
private RmArgs( | ||
bool? dir, | ||
|
||
ImmutableArray<string> files, | ||
|
||
bool? force, | ||
|
||
bool? help, | ||
|
||
bool? oneFileSystem, | ||
|
||
bool? recursive, | ||
|
||
bool? verbose) | ||
{ | ||
Dir = dir; | ||
Files = files; | ||
Force = force; | ||
Help = help; | ||
OneFileSystem = oneFileSystem; | ||
Recursive = recursive; | ||
Verbose = verbose; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
// *** WARNING: this file was generated by pulumi. *** | ||
// *** 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; | ||
using Pulumi; | ||
|
||
namespace UnMango.Baremetal.Cmd | ||
{ | ||
[BaremetalResourceType("baremetal:cmd:Rm")] | ||
public partial class Rm : global::Pulumi.CustomResource | ||
{ | ||
[Output("args")] | ||
public Output<Outputs.RmArgs> Args { get; private set; } = null!; | ||
|
||
[Output("createdFiles")] | ||
public Output<ImmutableArray<string>> CreatedFiles { get; private set; } = null!; | ||
|
||
[Output("exitCode")] | ||
public Output<int> ExitCode { get; private set; } = null!; | ||
|
||
[Output("stderr")] | ||
public Output<string> Stderr { get; private set; } = null!; | ||
|
||
[Output("stdout")] | ||
public Output<string> Stdout { get; private set; } = null!; | ||
|
||
|
||
/// <summary> | ||
/// Create a Rm 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 Rm(string name, RmArgs args, CustomResourceOptions? options = null) | ||
: base("baremetal:cmd:Rm", name, args ?? new RmArgs(), MakeResourceOptions(options, "")) | ||
{ | ||
} | ||
|
||
private Rm(string name, Input<string> id, CustomResourceOptions? options = null) | ||
: base("baremetal:cmd:Rm", name, null, MakeResourceOptions(options, id)) | ||
{ | ||
} | ||
|
||
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id) | ||
{ | ||
var defaultOptions = new CustomResourceOptions | ||
{ | ||
Version = Utilities.Version, | ||
PluginDownloadURL = "github://api.github.com/unmango", | ||
}; | ||
var merged = CustomResourceOptions.Merge(defaultOptions, options); | ||
// Override the ID if one was specified for consistency with other language SDKs. | ||
merged.Id = id ?? merged.Id; | ||
return merged; | ||
} | ||
/// <summary> | ||
/// Get an existing Rm resource's state with the given name, ID, and optional extra | ||
/// properties used to qualify the lookup. | ||
/// </summary> | ||
/// | ||
/// <param name="name">The unique name of the resulting resource.</param> | ||
/// <param name="id">The unique provider ID of the resource to lookup.</param> | ||
/// <param name="options">A bag of options that control this resource's behavior</param> | ||
public static Rm Get(string name, Input<string> id, CustomResourceOptions? options = null) | ||
{ | ||
return new Rm(name, id, options); | ||
} | ||
} | ||
|
||
public sealed class RmArgs : global::Pulumi.ResourceArgs | ||
{ | ||
[Input("dir")] | ||
public Input<bool>? Dir { get; set; } | ||
|
||
[Input("files", required: true)] | ||
private InputList<string>? _files; | ||
public InputList<string> Files | ||
{ | ||
get => _files ?? (_files = new InputList<string>()); | ||
set => _files = value; | ||
} | ||
|
||
[Input("force")] | ||
public Input<bool>? Force { get; set; } | ||
|
||
[Input("help")] | ||
public Input<bool>? Help { get; set; } | ||
|
||
[Input("oneFileSystem")] | ||
public Input<bool>? OneFileSystem { get; set; } | ||
|
||
[Input("recursive")] | ||
public Input<bool>? Recursive { get; set; } | ||
|
||
[Input("verbose")] | ||
public Input<bool>? Verbose { get; set; } | ||
|
||
public RmArgs() | ||
{ | ||
} | ||
public static new RmArgs Empty => new RmArgs(); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.