Add more update tests (#85) #36
Annotations
4 warnings
sdk/go/baremetal/cmd/pulumiTypes.go#L1
File modified:
@@ -14,196 +14,44 @@ import (
var _ = internal.GetEnvOrDefault
-type TeeOpts struct {
+type TeeArgsType struct {
Append *bool `pulumi:"append"`
Content string `pulumi:"content"`
Files []string `pulumi:"files"`
}
-// TeeOptsInput is an input type that accepts TeeOptsArgs and TeeOptsOutput values.
-// You can construct a concrete instance of `TeeOptsInput` via:
-//
-// TeeOptsArgs{...}
-type TeeOptsInput interface {
- pulumi.Input
+type TeeArgsTypeOutput struct{ *pulumi.OutputState }
- ToTeeOptsOutput() TeeOptsOutput
- ToTeeOptsOutputWithContext(context.Context) TeeOptsOutput
+func (TeeArgsTypeOutput) ElementType() reflect.Type {
+ return reflect.TypeOf((*TeeArgsType)(nil)).Elem()
}
-type TeeOptsArgs struct {
- Append pulumi.BoolPtrInput `pulumi:"append"`
- Content pulumi.StringInput `pulumi:"content"`
- Files pulumi.StringArrayInput `pulumi:"files"`
-}
-
-func (TeeOptsArgs) ElementType() reflect.Type {
- return reflect.TypeOf((*TeeOpts)(nil)).Elem()
-}
-
-func (i TeeOptsArgs) ToTeeOptsOutput() TeeOptsOutput {
- return i.ToTeeOptsOutputWithContext(context.Background())
-}
-
-func (i TeeOptsArgs) ToTeeOptsOutputWithContext(ctx context.Context) TeeOptsOutput {
- return pulumi.ToOutputWithContext(ctx, i).(TeeOptsOutput)
-}
-
-func (i TeeOptsArgs) ToOutput(ctx context.Context) pulumix.Output[TeeOpts] {
- return pulumix.Output[TeeOpts]{
- OutputState: i.ToTeeOptsOutputWithContext(ctx).OutputState,
- }
-}
-
-func (i TeeOptsArgs) ToTeeOptsPtrOutput() TeeOptsPtrOutput {
- return i.ToTeeOptsPtrOutputWithContext(context.Background())
-}
-
-func (i TeeOptsArgs) ToTeeOptsPtrOutputWithContext(ctx context.Context) TeeOptsPtrOutput {
- return pulumi.ToOutputWithContext(ctx, i).(TeeOptsOutput).ToTeeOptsPtrOutputWithContext(ctx)
-}
-
-// TeeOptsPtrInput is an input type that accepts TeeOptsArgs, TeeOptsPtr and TeeOptsPtrOutput values.
-// You can construct a concrete instance of `TeeOptsPtrInput` via:
-//
-// TeeOptsArgs{...}
-//
-// or:
-//
-// nil
-type TeeOptsPtrInput interface {
- pulumi.Input
-
- ToTeeOptsPtrOutput() TeeOptsPtrOutput
- ToTeeOptsPtrOutputWithContext(context.Context) TeeOptsPtrOutput
-}
-
-type teeOptsPtrType TeeOptsArgs
-
-func TeeOptsPtr(v *TeeOptsArgs) TeeOptsPtrInput {
- return (*teeOptsPtrType)(v)
-}
-
-func (*teeOptsPtrType) ElementType() reflect.Type {
- return reflect.TypeOf((**TeeOpts)(nil)).Elem()
-}
-
-func (i *teeOptsPtrType) ToTeeOptsPtrOutput() TeeOptsPtrOutput {
- return i.ToTeeOptsPtrOutputWithContext(context.Background())
-}
-
-func (i *teeOptsPtrType) ToTeeOptsPtrOutputWithContext(ctx context.Context) TeeOptsPtrOutput {
- return pulumi.ToOutputWithContext(ctx, i).(TeeOptsPtrOutput)
-}
-
-func (i *teeOptsPtrType) ToOutput(ctx context.Context) pulumix.Output[*TeeOpts] {
- return pulumix.Output[*TeeOpts]{
- OutputState: i.ToTeeOptsPtrOutputWithContext(ctx).OutputState,
- }
-}
-
-type TeeOptsOutput struct{ *pulumi.OutputState }
-
-func (TeeOptsOutput) ElementType() reflect.Type {
- return reflect.TypeOf((*TeeOpts)(nil)).Elem()
-}
-
-func (o TeeOptsOutput) ToTeeOptsOutput() TeeOptsOutput {
+func (o TeeArgsTypeOutput) ToTeeArgsTypeOutput() TeeArgsTypeOutput {
return o
}
-func (o TeeOptsOutput) ToTeeOptsOutputWithContext(ctx context.Context) TeeOptsOutput {
+func (o TeeArgsTypeOutput) ToTeeArgsTypeOutputWithContext(ctx context.Context) TeeArgsTypeOutput {
return o
}
-func (o TeeOptsOutput) ToTeeOptsPtrOutput() TeeOptsPtrOutput {
- return o.ToTeeOptsPtrOutputWithContext(context.Background())
-}
-
-func (o TeeOptsOutput) ToTeeOptsPtrOutputWithContext(ctx context.Context) TeeOptsPtrOutput {
- return o.ApplyTWithContext(ctx, func(_ context.Context, v TeeOpts) *TeeOpts {
- return &v
- }).(TeeOptsPtrOutput)
-}
-
-func (o TeeOptsOutput) ToOutput(ctx context.Context) pulumix.Output[TeeOpts] {
- return pulumix.Output[TeeOpts]{
+func (o TeeArgsTypeOutput) ToOutput(ctx context.Context) pulumix.Output[TeeArgsType] {
+ return pulumix.Output[TeeArgsType]{
OutputState: o.OutputState,
}
}
-func (o TeeOptsOutput) Append() pulumi.BoolPtr
|
sdk/go/baremetal/cmd/tee.go#L1
File modified:
@@ -7,6 +7,7 @@ import (
"context"
"reflect"
+ "errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
"github.com/unmango/pulumi-baremetal/sdk/go/baremetal/internal"
@@ -84,8 +85,9 @@ import (
type Tee struct {
pulumi.CustomResourceState
- CreateOpts TeeOptsPtrOutput `pulumi:"createOpts"`
+ Args TeeArgsTypeOutput `pulumi:"args"`
CreatedFiles pulumi.StringArrayOutput `pulumi:"createdFiles"`
+ ExitCode pulumi.IntOutput `pulumi:"exitCode"`
Stderr pulumi.StringOutput `pulumi:"stderr"`
Stdout pulumi.StringOutput `pulumi:"stdout"`
}
@@ -94,9 +96,15 @@ type Tee struct {
func NewTee(ctx *pulumi.Context,
name string, args *TeeArgs, opts ...pulumi.ResourceOption) (*Tee, error) {
if args == nil {
- args = &TeeArgs{}
+ return nil, errors.New("missing one or more required arguments")
}
+ if args.Content == nil {
+ return nil, errors.New("invalid value for required argument 'Content'")
+ }
+ if args.Files == nil {
+ return nil, errors.New("invalid value for required argument 'Files'")
+ }
opts = internal.PkgResourceDefaultOpts(opts)
var resource Tee
err := ctx.RegisterResource("baremetal:cmd:Tee", name, args, &resource, opts...)
@@ -130,12 +138,16 @@ func (TeeState) ElementType() reflect.Type {
}
type teeArgs struct {
- Create *TeeOpts `pulumi:"create"`
+ Append *bool `pulumi:"append"`
+ Content string `pulumi:"content"`
+ Files []string `pulumi:"files"`
}
// The set of arguments for constructing a Tee resource.
type TeeArgs struct {
- Create TeeOptsPtrInput
+ Append pulumi.BoolPtrInput
+ Content pulumi.StringInput
+ Files pulumi.StringArrayInput
}
func (TeeArgs) ElementType() reflect.Type {
@@ -187,14 +199,18 @@ func (o TeeOutput) ToOutput(ctx context.Context) pulumix.Output[*Tee] {
}
}
-func (o TeeOutput) CreateOpts() TeeOptsPtrOutput {
- return o.ApplyT(func(v *Tee) TeeOptsPtrOutput { return v.CreateOpts }).(TeeOptsPtrOutput)
+func (o TeeOutput) Args() TeeArgsTypeOutput {
+ return o.ApplyT(func(v *Tee) TeeArgsTypeOutput { return v.Args }).(TeeArgsTypeOutput)
}
func (o TeeOutput) CreatedFiles() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Tee) pulumi.StringArrayOutput { return v.CreatedFiles }).(pulumi.StringArrayOutput)
}
+func (o TeeOutput) ExitCode() pulumi.IntOutput {
+ return o.ApplyT(func(v *Tee) pulumi.IntOutput { return v.ExitCode }).(pulumi.IntOutput)
+}
+
func (o TeeOutput) Stderr() pulumi.StringOutput {
return o.ApplyT(func(v *Tee) pulumi.StringOutput { return v.Stderr }).(pulumi.StringOutput)
}
|
sdk/go/baremetal/x/cmd/pulumiTypes.go#L1
File modified:
@@ -14,67 +14,45 @@ import (
var _ = internal.GetEnvOrDefault
-type TeeOpts struct {
+type TeeArgsType struct {
Append *bool `pulumi:"append"`
Content string `pulumi:"content"`
Files []string `pulumi:"files"`
}
-type TeeOptsArgs struct {
- Append pulumix.Input[*bool] `pulumi:"append"`
- Content pulumix.Input[string] `pulumi:"content"`
- Files pulumix.Input[[]string] `pulumi:"files"`
-}
-
-func (TeeOptsArgs) ElementType() reflect.Type {
- return reflect.TypeOf((*TeeOpts)(nil)).Elem()
-}
-
-func (i TeeOptsArgs) ToTeeOptsOutput() TeeOptsOutput {
- return i.ToTeeOptsOutputWithContext(context.Background())
-}
-
-func (i TeeOptsArgs) ToTeeOptsOutputWithContext(ctx context.Context) TeeOptsOutput {
- return pulumi.ToOutputWithContext(ctx, i).(TeeOptsOutput)
-}
-
-func (i *TeeOptsArgs) ToOutput(ctx context.Context) pulumix.Output[*TeeOptsArgs] {
- return pulumix.Val(i)
-}
-
-type TeeOptsOutput struct{ *pulumi.OutputState }
+type TeeArgsTypeOutput struct{ *pulumi.OutputState }
-func (TeeOptsOutput) ElementType() reflect.Type {
- return reflect.TypeOf((*TeeOpts)(nil)).Elem()
+func (TeeArgsTypeOutput) ElementType() reflect.Type {
+ return reflect.TypeOf((*TeeArgsType)(nil)).Elem()
}
-func (o TeeOptsOutput) ToTeeOptsOutput() TeeOptsOutput {
+func (o TeeArgsTypeOutput) ToTeeArgsTypeOutput() TeeArgsTypeOutput {
return o
}
-func (o TeeOptsOutput) ToTeeOptsOutputWithContext(ctx context.Context) TeeOptsOutput {
+func (o TeeArgsTypeOutput) ToTeeArgsTypeOutputWithContext(ctx context.Context) TeeArgsTypeOutput {
return o
}
-func (o TeeOptsOutput) ToOutput(ctx context.Context) pulumix.Output[TeeOpts] {
- return pulumix.Output[TeeOpts]{
+func (o TeeArgsTypeOutput) ToOutput(ctx context.Context) pulumix.Output[TeeArgsType] {
+ return pulumix.Output[TeeArgsType]{
OutputState: o.OutputState,
}
}
-func (o TeeOptsOutput) Append() pulumix.Output[*bool] {
- return pulumix.Apply[TeeOpts](o, func(v TeeOpts) *bool { return v.Append })
+func (o TeeArgsTypeOutput) Append() pulumix.Output[*bool] {
+ return pulumix.Apply[TeeArgsType](o, func(v TeeArgsType) *bool { return v.Append })
}
-func (o TeeOptsOutput) Content() pulumix.Output[string] {
- return pulumix.Apply[TeeOpts](o, func(v TeeOpts) string { return v.Content })
+func (o TeeArgsTypeOutput) Content() pulumix.Output[string] {
+ return pulumix.Apply[TeeArgsType](o, func(v TeeArgsType) string { return v.Content })
}
-func (o TeeOptsOutput) Files() pulumix.ArrayOutput[string] {
- value := pulumix.Apply[TeeOpts](o, func(v TeeOpts) []string { return v.Files })
+func (o TeeArgsTypeOutput) Files() pulumix.ArrayOutput[string] {
+ value := pulumix.Apply[TeeArgsType](o, func(v TeeArgsType) []string { return v.Files })
return pulumix.ArrayOutput[string]{OutputState: value.OutputState}
}
func init() {
- pulumi.RegisterOutputType(TeeOptsOutput{})
+ pulumi.RegisterOutputType(TeeArgsTypeOutput{})
}
|
sdk/go/baremetal/x/cmd/tee.go#L1
File modified:
@@ -7,6 +7,7 @@ import (
"context"
"reflect"
+ "errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
"github.com/unmango/pulumi-baremetal/sdk/go/baremetal/internal"
@@ -84,19 +85,26 @@ import (
type Tee struct {
pulumi.CustomResourceState
- CreateOpts pulumix.GPtrOutput[TeeOpts, TeeOptsOutput] `pulumi:"createOpts"`
- CreatedFiles pulumix.ArrayOutput[string] `pulumi:"createdFiles"`
- Stderr pulumix.Output[string] `pulumi:"stderr"`
- Stdout pulumix.Output[string] `pulumi:"stdout"`
+ Args pulumix.GPtrOutput[TeeArgsType, TeeArgsTypeOutput] `pulumi:"args"`
+ CreatedFiles pulumix.ArrayOutput[string] `pulumi:"createdFiles"`
+ ExitCode pulumix.Output[int] `pulumi:"exitCode"`
+ Stderr pulumix.Output[string] `pulumi:"stderr"`
+ Stdout pulumix.Output[string] `pulumi:"stdout"`
}
// NewTee registers a new resource with the given unique name, arguments, and options.
func NewTee(ctx *pulumi.Context,
name string, args *TeeArgs, opts ...pulumi.ResourceOption) (*Tee, error) {
if args == nil {
- args = &TeeArgs{}
+ return nil, errors.New("missing one or more required arguments")
}
+ if args.Content == nil {
+ return nil, errors.New("invalid value for required argument 'Content'")
+ }
+ if args.Files == nil {
+ return nil, errors.New("invalid value for required argument 'Files'")
+ }
opts = internal.PkgResourceDefaultOpts(opts)
var resource Tee
err := ctx.RegisterResource("baremetal:cmd:Tee", name, args, &resource, opts...)
@@ -130,12 +138,16 @@ func (TeeState) ElementType() reflect.Type {
}
type teeArgs struct {
- Create *TeeOpts `pulumi:"create"`
+ Append *bool `pulumi:"append"`
+ Content string `pulumi:"content"`
+ Files []string `pulumi:"files"`
}
// The set of arguments for constructing a Tee resource.
type TeeArgs struct {
- Create pulumix.Input[*TeeOptsArgs]
+ Append pulumix.Input[*bool]
+ Content pulumix.Input[string]
+ Files pulumix.Input[[]string]
}
func (TeeArgs) ElementType() reflect.Type {
@@ -162,10 +174,10 @@ func (o TeeOutput) ToOutput(ctx context.Context) pulumix.Output[Tee] {
}
}
-func (o TeeOutput) CreateOpts() pulumix.GPtrOutput[TeeOpts, TeeOptsOutput] {
- value := pulumix.Apply[Tee](o, func(v Tee) pulumix.GPtrOutput[TeeOpts, TeeOptsOutput] { return v.CreateOpts })
- unwrapped := pulumix.Flatten[*TeeOpts, pulumix.GPtrOutput[TeeOpts, TeeOptsOutput]](value)
- return pulumix.GPtrOutput[TeeOpts, TeeOptsOutput]{OutputState: unwrapped.OutputState}
+func (o TeeOutput) Args() pulumix.GPtrOutput[TeeArgsType, TeeArgsTypeOutput] {
+ value := pulumix.Apply[Tee](o, func(v Tee) pulumix.GPtrOutput[TeeArgsType, TeeArgsTypeOutput] { return v.Args })
+ unwrapped := pulumix.Flatten[*TeeArgsType, pulumix.GPtrOutput[TeeArgsType, TeeArgsTypeOutput]](value)
+ return pulumix.GPtrOutput[TeeArgsType, TeeArgsTypeOutput]{OutputState: unwrapped.OutputState}
}
func (o TeeOutput) CreatedFiles() pulumix.ArrayOutput[string] {
@@ -174,6 +186,11 @@ func (o TeeOutput) CreatedFiles() pulumix.ArrayOutput[string] {
return pulumix.ArrayOutput[string]{OutputState: unwrapped.OutputState}
}
+func (o TeeOutput) ExitCode() pulumix.Output[int] {
+ value := pulumix.Apply[Tee](o, func(v Tee) pulumix.Output[int] { return v.ExitCode })
+ return pulumix.Flatten[int, pulumix.Output[int]](value)
+}
+
func (o TeeOutput) Stderr() pulumix.Output[string] {
value := pulumix.Apply[Tee](o, func(v Tee) pulumix.Output[string] { return v.Stderr })
return pulumix.Flatten[string, pulumix.Output[string]](value)
|
This job succeeded
Loading