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.
- Loading branch information
1 parent
887e995
commit 82067d4
Showing
24 changed files
with
1,432 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -71,4 +71,5 @@ enum Bin { | |
BIN_TAR = 5; | ||
BIN_MKDIR = 6; | ||
BIN_MKTEMP = 7; | ||
BIN_CHMOD = 8; | ||
} |
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,90 @@ | ||
package cmd | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"strings" | ||
|
||
"github.com/pulumi/pulumi-go-provider/infer" | ||
pb "github.com/unmango/pulumi-baremetal/gen/go/unmango/baremetal/v1alpha1" | ||
) | ||
|
||
type ChmodArgs struct { | ||
DefaultFileManipulator | ||
Files []string `pulumi:"files"` | ||
Mode []string `pulumi:"mode,optional"` | ||
OctalMode string `pulumi:"octalMode,optional"` | ||
Changes bool `pulumi:"changes,optional"` | ||
NoPreserveRoot bool `pulumi:"noPreserveRoot,optional"` | ||
PreserveRoot bool `pulumi:"preserveRoot,optional"` | ||
Quiet bool `pulumi:"quiet,optional"` | ||
Reference string `pulumi:"reference,optional"` | ||
Recursive bool `pulumi:"recursive,optional"` | ||
Verbose bool `pulumi:"verbose,optional"` | ||
Help bool `pulumi:"help,optional"` | ||
Version bool `pulumi:"version,optional"` | ||
} | ||
|
||
// Cmd implements CommandArgs. | ||
func (m ChmodArgs) Cmd() *pb.Command { | ||
b := builder{} | ||
b.op(m.Changes, "--changes") | ||
b.op(m.NoPreserveRoot, "--no-preserve-root") | ||
b.op(m.PreserveRoot, "--preserve-root") | ||
b.op(m.Quiet, "--quiet") | ||
b.opv(m.Reference, "--reference") | ||
b.op(m.Recursive, "--recursive") | ||
b.op(m.Verbose, "--verbose") | ||
b.op(m.Help, "--help") | ||
b.op(m.Version, "--version") | ||
|
||
b.arg(strings.Join(m.Mode, ",")) | ||
b.arg(m.OctalMode) | ||
|
||
for _, f := range m.Files { | ||
b.arg(f) | ||
} | ||
|
||
return &pb.Command{ | ||
Bin: pb.Bin_BIN_CHMOD, | ||
Args: b.args, | ||
} | ||
} | ||
|
||
var _ CommandArgs = ChmodArgs{} | ||
|
||
type Chmod struct{} | ||
|
||
type ChmodState = CommandState[ChmodArgs] | ||
|
||
// Create implements infer.CustomCreate. | ||
func (Chmod) Create(ctx context.Context, name string, inputs ChmodArgs, preview bool) (id string, output ChmodState, err error) { | ||
state := ChmodState{} | ||
if err := state.Create(ctx, inputs, preview); err != nil { | ||
return name, state, fmt.Errorf("chmod: %w", err) | ||
} | ||
|
||
return name, state, nil | ||
} | ||
|
||
// Update implements infer.CustomUpdate. | ||
func (Chmod) Update(ctx context.Context, id string, olds ChmodState, news ChmodArgs, preview bool) (ChmodState, error) { | ||
state, err := olds.Update(ctx, news, preview) | ||
if err != nil { | ||
return olds, fmt.Errorf("chmod: %w", err) | ||
} | ||
|
||
return state, nil | ||
} | ||
|
||
// Delete implements infer.CustomDelete. | ||
func (Chmod) Delete(ctx context.Context, id string, props ChmodState) error { | ||
if err := props.Delete(ctx); err != nil { | ||
return fmt.Errorf("chmod: %w", err) | ||
} | ||
|
||
return nil | ||
} | ||
|
||
var _ = (infer.CustomCreate[ChmodArgs, ChmodState])((*Chmod)(nil)) | ||
var _ = (infer.CustomUpdate[ChmodArgs, ChmodState])((*Chmod)(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
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,131 @@ | ||
// *** 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:Chmod")] | ||
public partial class Chmod : global::Pulumi.CustomResource | ||
{ | ||
[Output("args")] | ||
public Output<Outputs.ChmodArgs> 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("movedFiles")] | ||
public Output<ImmutableDictionary<string, string>> MovedFiles { 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 Chmod 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 Chmod(string name, ChmodArgs args, CustomResourceOptions? options = null) | ||
: base("baremetal:cmd:Chmod", name, args ?? new ChmodArgs(), MakeResourceOptions(options, "")) | ||
{ | ||
} | ||
|
||
private Chmod(string name, Input<string> id, CustomResourceOptions? options = null) | ||
: base("baremetal:cmd:Chmod", 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 Chmod 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 Chmod Get(string name, Input<string> id, CustomResourceOptions? options = null) | ||
{ | ||
return new Chmod(name, id, options); | ||
} | ||
} | ||
|
||
public sealed class ChmodArgs : global::Pulumi.ResourceArgs | ||
{ | ||
[Input("changes")] | ||
public Input<bool>? Changes { get; set; } | ||
|
||
[Input("files", required: true)] | ||
private InputList<string>? _files; | ||
public InputList<string> Files | ||
{ | ||
get => _files ?? (_files = new InputList<string>()); | ||
set => _files = value; | ||
} | ||
|
||
[Input("help")] | ||
public Input<bool>? Help { get; set; } | ||
|
||
[Input("mode")] | ||
private InputList<string>? _mode; | ||
public InputList<string> Mode | ||
{ | ||
get => _mode ?? (_mode = new InputList<string>()); | ||
set => _mode = value; | ||
} | ||
|
||
[Input("noPreserveRoot")] | ||
public Input<bool>? NoPreserveRoot { get; set; } | ||
|
||
[Input("octalMode")] | ||
public Input<string>? OctalMode { get; set; } | ||
|
||
[Input("preserveRoot")] | ||
public Input<bool>? PreserveRoot { get; set; } | ||
|
||
[Input("quiet")] | ||
public Input<bool>? Quiet { get; set; } | ||
|
||
[Input("recursive")] | ||
public Input<bool>? Recursive { get; set; } | ||
|
||
[Input("reference")] | ||
public Input<string>? Reference { get; set; } | ||
|
||
[Input("verbose")] | ||
public Input<bool>? Verbose { get; set; } | ||
|
||
[Input("version")] | ||
public Input<bool>? Version { get; set; } | ||
|
||
public ChmodArgs() | ||
{ | ||
} | ||
public static new ChmodArgs Empty => new ChmodArgs(); | ||
} | ||
} |
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,70 @@ | ||
// *** 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 ChmodArgs | ||
{ | ||
public readonly bool? Changes; | ||
public readonly ImmutableArray<string> Files; | ||
public readonly bool? Help; | ||
public readonly ImmutableArray<string> Mode; | ||
public readonly bool? NoPreserveRoot; | ||
public readonly string? OctalMode; | ||
public readonly bool? PreserveRoot; | ||
public readonly bool? Quiet; | ||
public readonly bool? Recursive; | ||
public readonly string? Reference; | ||
public readonly bool? Verbose; | ||
public readonly bool? Version; | ||
|
||
[OutputConstructor] | ||
private ChmodArgs( | ||
bool? changes, | ||
|
||
ImmutableArray<string> files, | ||
|
||
bool? help, | ||
|
||
ImmutableArray<string> mode, | ||
|
||
bool? noPreserveRoot, | ||
|
||
string? octalMode, | ||
|
||
bool? preserveRoot, | ||
|
||
bool? quiet, | ||
|
||
bool? recursive, | ||
|
||
string? reference, | ||
|
||
bool? verbose, | ||
|
||
bool? version) | ||
{ | ||
Changes = changes; | ||
Files = files; | ||
Help = help; | ||
Mode = mode; | ||
NoPreserveRoot = noPreserveRoot; | ||
OctalMode = octalMode; | ||
PreserveRoot = preserveRoot; | ||
Quiet = quiet; | ||
Recursive = recursive; | ||
Reference = reference; | ||
Verbose = verbose; | ||
Version = version; | ||
} | ||
} | ||
} |
Oops, something went wrong.