Skip to content

Commit

Permalink
feat: declare a new type for 'any resource' (#15793)
Browse files Browse the repository at this point in the history
This commit exists to enable the Java SDK to update and use it, which
then unblocks the next commit passing tests.

Part of #6346

---------

Co-authored-by: Eron Wright <[email protected]>
  • Loading branch information
AaronFriel and EronWright committed Apr 9, 2024
1 parent f72e276 commit e211f2e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
1 change: 0 additions & 1 deletion pkg/codegen/pcl/binder_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ func ComponentProgramBinderFromFileSystem() ComponentProgramBinder {
}

err = parser.ParseFile(file, fileName)

if err != nil {
diagnostics = diagnostics.Append(errorf(nodeRange, err.Error()))
return nil, diagnostics, err
Expand Down
21 changes: 13 additions & 8 deletions pkg/codegen/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ type Type interface {
type primitiveType int

const (
boolType primitiveType = 1
intType primitiveType = 2
numberType primitiveType = 3
stringType primitiveType = 4
archiveType primitiveType = 5
assetType primitiveType = 6
anyType primitiveType = 7
jsonType primitiveType = 8
boolType primitiveType = 1
intType primitiveType = 2
numberType primitiveType = 3
stringType primitiveType = 4
archiveType primitiveType = 5
assetType primitiveType = 6
anyType primitiveType = 7
jsonType primitiveType = 8
anyResourceType primitiveType = 9
)

func (t primitiveType) String() string {
Expand All @@ -70,6 +71,8 @@ func (t primitiveType) String() string {
return "pulumi:pulumi:Asset"
case jsonType:
fallthrough
case anyResourceType:
fallthrough
case anyType:
return "pulumi:pulumi:Any"
default:
Expand Down Expand Up @@ -103,6 +106,8 @@ var (
JSONType Type = jsonType
// AnyType represents the complete set of values.
AnyType Type = anyType
// AnyResourceType represents any Pulumi resource - custom or component
AnyResourceType Type = anyResourceType
)

// An InvalidType represents an invalid type with associated diagnostics.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type {{.PtrType}} {{.ElemElementType}}
func {{.Name}}(v {{.ElemElementType}}) {{.Name}}Input {
return ({{.InputType}})(&v)
}

func {{.Name}}FromPtr(v *{{.ElemElementType}}) {{.Name}}Input {
if v == nil {
return nil
Expand Down
6 changes: 6 additions & 0 deletions sdk/go/pulumi/types_builtins.go

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

0 comments on commit e211f2e

Please sign in to comment.