pulumi/sdk/go/pulumi-language-go/testdata/sdks/asset-archive-5.0.0/assetarchive/assetResource.go

117 lines
3.5 KiB
Go

// Code generated by pulumi-language-go DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package assetarchive
import (
"context"
"reflect"
"errors"
"example.com/pulumi-asset-archive/sdk/go/v5/assetarchive/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type AssetResource struct {
pulumi.CustomResourceState
Value pulumi.AssetOrArchiveOutput `pulumi:"value"`
}
// NewAssetResource registers a new resource with the given unique name, arguments, and options.
func NewAssetResource(ctx *pulumi.Context,
name string, args *AssetResourceArgs, opts ...pulumi.ResourceOption) (*AssetResource, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Value == nil {
return nil, errors.New("invalid value for required argument 'Value'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource AssetResource
err := ctx.RegisterResource("asset-archive:index:AssetResource", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAssetResource gets an existing AssetResource resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetAssetResource(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AssetResourceState, opts ...pulumi.ResourceOption) (*AssetResource, error) {
var resource AssetResource
err := ctx.ReadResource("asset-archive:index:AssetResource", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AssetResource resources.
type assetResourceState struct {
}
type AssetResourceState struct {
}
func (AssetResourceState) ElementType() reflect.Type {
return reflect.TypeOf((*assetResourceState)(nil)).Elem()
}
type assetResourceArgs struct {
Value pulumi.AssetOrArchive `pulumi:"value"`
}
// The set of arguments for constructing a AssetResource resource.
type AssetResourceArgs struct {
Value pulumi.AssetOrArchiveInput
}
func (AssetResourceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*assetResourceArgs)(nil)).Elem()
}
type AssetResourceInput interface {
pulumi.Input
ToAssetResourceOutput() AssetResourceOutput
ToAssetResourceOutputWithContext(ctx context.Context) AssetResourceOutput
}
func (*AssetResource) ElementType() reflect.Type {
return reflect.TypeOf((**AssetResource)(nil)).Elem()
}
func (i *AssetResource) ToAssetResourceOutput() AssetResourceOutput {
return i.ToAssetResourceOutputWithContext(context.Background())
}
func (i *AssetResource) ToAssetResourceOutputWithContext(ctx context.Context) AssetResourceOutput {
return pulumi.ToOutputWithContext(ctx, i).(AssetResourceOutput)
}
type AssetResourceOutput struct{ *pulumi.OutputState }
func (AssetResourceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AssetResource)(nil)).Elem()
}
func (o AssetResourceOutput) ToAssetResourceOutput() AssetResourceOutput {
return o
}
func (o AssetResourceOutput) ToAssetResourceOutputWithContext(ctx context.Context) AssetResourceOutput {
return o
}
func (o AssetResourceOutput) Value() pulumi.AssetOrArchiveOutput {
return o.ApplyT(func(v *AssetResource) pulumi.AssetOrArchiveOutput { return v.Value }).(pulumi.AssetOrArchiveOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AssetResourceInput)(nil)).Elem(), &AssetResource{})
pulumi.RegisterOutputType(AssetResourceOutput{})
}