From 889cae1ac3c70e86de0f77223d9b613c70292a64 Mon Sep 17 00:00:00 2001 From: stack72 Date: Wed, 13 Jan 2021 17:52:18 +0000 Subject: [PATCH] Upgrade to v2.17.0 of the pulumi-terraform-bridge --- CHANGELOG.md | 3 +- .../cmd/pulumi-resource-github/schema.json | 9 +- provider/go.mod | 4 +- provider/go.sum | 11 ++ provider/resources.go | 5 +- sdk/go/github/actionsOrganizationSecret.go | 17 +-- sdk/go/github/actionsSecret.go | 17 +-- sdk/go/github/branch.go | 13 +- sdk/go/github/branchDefault.go | 13 +- sdk/go/github/branchProtection.go | 13 +- sdk/go/github/config/pulumiUtilities.go | 11 ++ sdk/go/github/issueLabel.go | 13 +- sdk/go/github/membership.go | 9 +- sdk/go/github/organizationBlock.go | 9 +- sdk/go/github/organizationProject.go | 1 + sdk/go/github/organizationWebhook.go | 9 +- sdk/go/github/projectCard.go | 13 +- sdk/go/github/projectColumn.go | 9 +- sdk/go/github/provider.go | 1 + sdk/go/github/pulumiUtilities.go | 11 ++ sdk/go/github/repository.go | 1 + sdk/go/github/repositoryCollaborator.go | 13 +- sdk/go/github/repositoryDeployKey.go | 17 +-- sdk/go/github/repositoryFile.go | 17 +-- sdk/go/github/repositoryMilestone.go | 17 +-- sdk/go/github/repositoryProject.go | 9 +- sdk/go/github/repositoryWebhook.go | 13 +- sdk/go/github/team.go | 1 + sdk/go/github/teamMembership.go | 13 +- sdk/go/github/teamRepository.go | 13 +- sdk/go/github/teamSyncGroupMapping.go | 9 +- sdk/go/github/userGpgKey.go | 9 +- sdk/go/github/userInvitationAccepter.go | 9 +- sdk/go/github/userSshKey.go | 13 +- sdk/nodejs/actionsOrganizationSecret.ts | 6 +- sdk/nodejs/actionsSecret.ts | 6 +- sdk/nodejs/branch.ts | 4 +- sdk/nodejs/branchDefault.ts | 4 +- sdk/nodejs/branchProtection.ts | 4 +- sdk/nodejs/index.ts | 131 ++++++++++++++++++ sdk/nodejs/issueLabel.ts | 4 +- sdk/nodejs/membership.ts | 2 +- sdk/nodejs/organizationBlock.ts | 2 +- sdk/nodejs/organizationWebhook.ts | 2 +- sdk/nodejs/package.json | 2 +- sdk/nodejs/projectCard.ts | 4 +- sdk/nodejs/projectColumn.ts | 2 +- sdk/nodejs/repositoryCollaborator.ts | 4 +- sdk/nodejs/repositoryDeployKey.ts | 6 +- sdk/nodejs/repositoryFile.ts | 6 +- sdk/nodejs/repositoryMilestone.ts | 6 +- sdk/nodejs/repositoryProject.ts | 2 +- sdk/nodejs/repositoryWebhook.ts | 4 +- sdk/nodejs/teamMembership.ts | 4 +- sdk/nodejs/teamRepository.ts | 4 +- sdk/nodejs/teamSyncGroupMapping.ts | 2 +- sdk/nodejs/userGpgKey.ts | 2 +- sdk/nodejs/userInvitationAccepter.ts | 2 +- sdk/nodejs/userSshKey.ts | 4 +- sdk/python/pulumi_github/__init__.py | 113 +++++++++++++++ sdk/python/pulumi_github/_utilities.py | 8 +- .../actions_organization_secret.py | 6 +- sdk/python/pulumi_github/actions_secret.py | 6 +- sdk/python/pulumi_github/branch.py | 4 +- sdk/python/pulumi_github/branch_default.py | 4 +- sdk/python/pulumi_github/branch_protection.py | 4 +- sdk/python/pulumi_github/issue_label.py | 4 +- sdk/python/pulumi_github/membership.py | 2 +- .../pulumi_github/organization_block.py | 2 +- .../pulumi_github/organization_webhook.py | 2 +- sdk/python/pulumi_github/project_card.py | 4 +- sdk/python/pulumi_github/project_column.py | 2 +- sdk/python/pulumi_github/repository.py | 4 +- .../pulumi_github/repository_collaborator.py | 4 +- .../pulumi_github/repository_deploy_key.py | 6 +- sdk/python/pulumi_github/repository_file.py | 6 +- .../pulumi_github/repository_milestone.py | 6 +- .../pulumi_github/repository_project.py | 2 +- .../pulumi_github/repository_webhook.py | 4 +- sdk/python/pulumi_github/team_membership.py | 4 +- sdk/python/pulumi_github/team_repository.py | 4 +- .../pulumi_github/team_sync_group_mapping.py | 2 +- sdk/python/pulumi_github/user_gpg_key.py | 2 +- .../pulumi_github/user_invitation_accepter.py | 4 +- sdk/python/pulumi_github/user_ssh_key.py | 4 +- sdk/python/setup.py | 2 +- 86 files changed, 542 insertions(+), 237 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb1cde86..ae5dd3bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ CHANGELOG ========= ## HEAD (Unreleased) -_(none)_ +* Upgrade to pulumi-terraform-bridge v2.17.0 +* Upgrade to Pulumi v2.17.0 --- diff --git a/provider/cmd/pulumi-resource-github/schema.json b/provider/cmd/pulumi-resource-github/schema.json index 82be21c0..ea2ec084 100644 --- a/provider/cmd/pulumi-resource-github/schema.json +++ b/provider/cmd/pulumi-resource-github/schema.json @@ -2674,7 +2674,7 @@ } }, "github:index/userInvitationAccepter:UserInvitationAccepter": { - "description": "Provides a resource to manage GitHub repository collaborator invitations.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst exampleRepository = new github.Repository(\"example\", {});\nconst exampleRepositoryCollaborator = new github.RepositoryCollaborator(\"example\", {\n permission: \"push\",\n repository: exampleRepository.name,\n username: \"example-username\",\n});\nconst invitee = new github.Provider(\"invitee\", {\n token: var_invitee_token,\n});\nconst exampleUserInvitationAccepter = new github.UserInvitationAccepter(\"example\", {\n invitationId: exampleRepositoryCollaborator.invitationId,\n}, { provider: invitee });\n```\n```python\nimport pulumi\nimport pulumi_github as github\nimport pulumi_pulumi as pulumi\n\nexample_repository = github.Repository(\"exampleRepository\")\nexample_repository_collaborator = github.RepositoryCollaborator(\"exampleRepositoryCollaborator\",\n permission=\"push\",\n repository=example_repository.name,\n username=\"example-username\")\ninvitee = pulumi.providers.Github(\"invitee\", token=var[\"invitee_token\"])\nexample_user_invitation_accepter = github.UserInvitationAccepter(\"exampleUserInvitationAccepter\", invitation_id=example_repository_collaborator.invitation_id,\nopts=ResourceOptions(provider=\"github.invitee\"))\n```\n```csharp\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var exampleRepository = new Github.Repository(\"exampleRepository\", new Github.RepositoryArgs\n {\n });\n var exampleRepositoryCollaborator = new Github.RepositoryCollaborator(\"exampleRepositoryCollaborator\", new Github.RepositoryCollaboratorArgs\n {\n Permission = \"push\",\n Repository = exampleRepository.Name,\n Username = \"example-username\",\n });\n var invitee = new Github.Provider(\"invitee\", new Github.ProviderArgs\n {\n Token = @var.Invitee_token,\n });\n var exampleUserInvitationAccepter = new Github.UserInvitationAccepter(\"exampleUserInvitationAccepter\", new Github.UserInvitationAccepterArgs\n {\n InvitationId = exampleRepositoryCollaborator.InvitationId,\n }, new CustomResourceOptions\n {\n Provider = \"github.invitee\",\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v2/go/github\"\n\t\"github.com/pulumi/pulumi-github/sdk/v2/go/github/providers\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\texampleRepository, err := github.NewRepository(ctx, \"exampleRepository\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\texampleRepositoryCollaborator, err := github.NewRepositoryCollaborator(ctx, \"exampleRepositoryCollaborator\", \u0026github.RepositoryCollaboratorArgs{\n\t\t\tPermission: pulumi.String(\"push\"),\n\t\t\tRepository: exampleRepository.Name,\n\t\t\tUsername: pulumi.String(\"example-username\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = providers.Newgithub(ctx, \"invitee\", \u0026providers.githubArgs{\n\t\t\tToken: pulumi.Any(_var.Invitee_token),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewUserInvitationAccepter(ctx, \"exampleUserInvitationAccepter\", \u0026github.UserInvitationAccepterArgs{\n\t\t\tInvitationId: exampleRepositoryCollaborator.InvitationId,\n\t\t}, pulumi.Provider(\"github.invitee\"))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n{{% /example %}}\n{{% /examples %}}", + "description": "Provides a resource to manage GitHub repository collaborator invitations.\n\n{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst exampleRepository = new github.Repository(\"example\", {});\nconst exampleRepositoryCollaborator = new github.RepositoryCollaborator(\"example\", {\n permission: \"push\",\n repository: exampleRepository.name,\n username: \"example-username\",\n});\nconst invitee = new github.Provider(\"invitee\", {\n token: var_invitee_token,\n});\nconst exampleUserInvitationAccepter = new github.UserInvitationAccepter(\"example\", {\n invitationId: exampleRepositoryCollaborator.invitationId,\n}, { provider: invitee });\n```\n```python\nimport pulumi\nimport pulumi_github as github\nimport pulumi_pulumi as pulumi\n\nexample_repository = github.Repository(\"exampleRepository\")\nexample_repository_collaborator = github.RepositoryCollaborator(\"exampleRepositoryCollaborator\",\n permission=\"push\",\n repository=example_repository.name,\n username=\"example-username\")\ninvitee = pulumi.providers.Github(\"invitee\", token=var[\"invitee_token\"])\nexample_user_invitation_accepter = github.UserInvitationAccepter(\"exampleUserInvitationAccepter\", invitation_id=example_repository_collaborator.invitation_id,\nopts=pulumi.ResourceOptions(provider=\"github.invitee\"))\n```\n```csharp\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nclass MyStack : Stack\n{\n public MyStack()\n {\n var exampleRepository = new Github.Repository(\"exampleRepository\", new Github.RepositoryArgs\n {\n });\n var exampleRepositoryCollaborator = new Github.RepositoryCollaborator(\"exampleRepositoryCollaborator\", new Github.RepositoryCollaboratorArgs\n {\n Permission = \"push\",\n Repository = exampleRepository.Name,\n Username = \"example-username\",\n });\n var invitee = new Github.Provider(\"invitee\", new Github.ProviderArgs\n {\n Token = @var.Invitee_token,\n });\n var exampleUserInvitationAccepter = new Github.UserInvitationAccepter(\"exampleUserInvitationAccepter\", new Github.UserInvitationAccepterArgs\n {\n InvitationId = exampleRepositoryCollaborator.InvitationId,\n }, new CustomResourceOptions\n {\n Provider = \"github.invitee\",\n });\n }\n\n}\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v2/go/github\"\n\t\"github.com/pulumi/pulumi-github/sdk/v2/go/github/providers\"\n\t\"github.com/pulumi/pulumi/sdk/v2/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\texampleRepository, err := github.NewRepository(ctx, \"exampleRepository\", nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\texampleRepositoryCollaborator, err := github.NewRepositoryCollaborator(ctx, \"exampleRepositoryCollaborator\", \u0026github.RepositoryCollaboratorArgs{\n\t\t\tPermission: pulumi.String(\"push\"),\n\t\t\tRepository: exampleRepository.Name,\n\t\t\tUsername: pulumi.String(\"example-username\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = providers.Newgithub(ctx, \"invitee\", \u0026providers.githubArgs{\n\t\t\tToken: pulumi.Any(_var.Invitee_token),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewUserInvitationAccepter(ctx, \"exampleUserInvitationAccepter\", \u0026github.UserInvitationAccepterArgs{\n\t\t\tInvitationId: exampleRepositoryCollaborator.InvitationId,\n\t\t}, pulumi.Provider(\"github.invitee\"))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n{{% /example %}}\n{{% /examples %}}", "properties": { "invitationId": { "type": "string", @@ -3708,7 +3708,7 @@ }, "nodejs": { "dependencies": { - "@pulumi/pulumi": "^2.0.0" + "@pulumi/pulumi": "^2.15.0" }, "devDependencies": { "@types/mime": "^2.0.0", @@ -3723,9 +3723,8 @@ "python": { "readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-github)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi/pulumi-github` repo](https://github.com/pulumi/pulumi-github/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-providers/terraform-provider-github` repo](https://github.com/terraform-providers/terraform-provider-github/issues).", "requires": { - "pulumi": "\u003e=2.9.0,\u003c3.0.0" - }, - "usesIOClasses": true + "pulumi": "\u003e=2.15.0,\u003c3.0.0" + } } } } \ No newline at end of file diff --git a/provider/go.mod b/provider/go.mod index 729de56a..0006649b 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -6,7 +6,7 @@ replace github.com/Azure/go-autorest => github.com/Azure/go-autorest v12.4.3+inc require ( github.com/hashicorp/terraform-plugin-sdk v1.9.1 - github.com/pulumi/pulumi-terraform-bridge/v2 v2.13.2 - github.com/pulumi/pulumi/sdk/v2 v2.13.3-0.20201109230029-a6f8b9b205cd + github.com/pulumi/pulumi-terraform-bridge/v2 v2.17.0 + github.com/pulumi/pulumi/sdk/v2 v2.17.0 github.com/terraform-providers/terraform-provider-github v1.3.1-0.20201201134554-f6add3ed515b ) diff --git a/provider/go.sum b/provider/go.sum index 5e20c8d3..5e1c0d66 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -603,6 +603,8 @@ github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9 github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks= +github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -672,11 +674,20 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/pulumi/pulumi-terraform-bridge/v2 v2.13.2 h1:8sEHpBhHUl+lVuruvvMXL8NJFrpPSEVxB6Nexuy1irs= github.com/pulumi/pulumi-terraform-bridge/v2 v2.13.2/go.mod h1:NVzB8KA29SMXW8Nwp6OHI4yevnQkLiY0VMucAI2R7jU= +github.com/pulumi/pulumi-terraform-bridge/v2 v2.17.0 h1:QIlM45O+pD2oKJdcvmpom7CHZpC2GOjWpIA2j3QXscU= +github.com/pulumi/pulumi-terraform-bridge/v2 v2.17.0/go.mod h1:/oSHj3Hg9zd8xT2dKVoBifeBbH+/pLPqmTDypgN5FHk= github.com/pulumi/pulumi/pkg/v2 v2.13.3-0.20201109230029-a6f8b9b205cd h1:ID3x2Bv/yEDQCU67THkmdhgoINcYYb0zYXo01FeJUhU= github.com/pulumi/pulumi/pkg/v2 v2.13.3-0.20201109230029-a6f8b9b205cd/go.mod h1:xLEDqsipr92IXfe8EJrl8bANoEUtwmBJGBE8X8PKmP0= +github.com/pulumi/pulumi/pkg/v2 v2.15.1-0.20201202214525-260620430c4c h1:M4BMhdOt1le+7JtOhR7uOVrpvu9HnN9388AI/Je9/3Y= +github.com/pulumi/pulumi/pkg/v2 v2.15.1-0.20201202214525-260620430c4c/go.mod h1:xLEDqsipr92IXfe8EJrl8bANoEUtwmBJGBE8X8PKmP0= github.com/pulumi/pulumi/sdk/v2 v2.2.1/go.mod h1:QNbWpL4gvf3X0lUFT7TXA2Jo1ff/Ti2l97AyFGYwvW4= github.com/pulumi/pulumi/sdk/v2 v2.13.3-0.20201109230029-a6f8b9b205cd h1:acvoTtWZHySIlANIlR5LSfRyjYSUadeJcdUZhyx9y4o= github.com/pulumi/pulumi/sdk/v2 v2.13.3-0.20201109230029-a6f8b9b205cd/go.mod h1:Z9ifPo/Q0+hUpAyguVx2gp5Sx+CBumnWvYQDhrM8l3E= +github.com/pulumi/pulumi/sdk/v2 v2.15.1-0.20201202214525-260620430c4c/go.mod h1:Z9ifPo/Q0+hUpAyguVx2gp5Sx+CBumnWvYQDhrM8l3E= +github.com/pulumi/pulumi/sdk/v2 v2.17.0 h1:mFsYS4Qnpk0uGcN4cGPd/S6KWdx92BbudOerxf5JlcA= +github.com/pulumi/pulumi/sdk/v2 v2.17.0/go.mod h1:fCFhRV6NmidWetmgDPA76efL+s0JqLlS54JJIwfOt+o= +github.com/pulumi/terraform-diff-reader v0.0.0-20201211191010-ad4715e9285e h1:Dik4Qe/+xguB8JagPyXNlbOnRiXGmq/PSPQTGunYnTk= +github.com/pulumi/terraform-diff-reader v0.0.0-20201211191010-ad4715e9285e/go.mod h1:sZ9FUzGO+yM41hsQHs/yIcj/Y993qMdBxBU5mpDmAfQ= github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= diff --git a/provider/resources.go b/provider/resources.go index d3059fe2..d481ca96 100644 --- a/provider/resources.go +++ b/provider/resources.go @@ -154,7 +154,7 @@ func Provider() tfbridge.ProviderInfo { JavaScript: &tfbridge.JavaScriptInfo{ // List any npm dependencies and their versions Dependencies: map[string]string{ - "@pulumi/pulumi": "^2.0.0", + "@pulumi/pulumi": "^2.15.0", }, DevDependencies: map[string]string{ "@types/node": "^8.0.25", // so we can access strongly typed node definitions. @@ -164,9 +164,8 @@ func Provider() tfbridge.ProviderInfo { Python: &tfbridge.PythonInfo{ // List any Python dependencies and their version ranges Requires: map[string]string{ - "pulumi": ">=2.9.0,<3.0.0", + "pulumi": ">=2.15.0,<3.0.0", }, - UsesIOClasses: true, }, CSharp: &tfbridge.CSharpInfo{ PackageReferences: map[string]string{ diff --git a/sdk/go/github/actionsOrganizationSecret.go b/sdk/go/github/actionsOrganizationSecret.go index 555e3168..35896413 100644 --- a/sdk/go/github/actionsOrganizationSecret.go +++ b/sdk/go/github/actionsOrganizationSecret.go @@ -30,17 +30,18 @@ type ActionsOrganizationSecret struct { // NewActionsOrganizationSecret registers a new resource with the given unique name, arguments, and options. func NewActionsOrganizationSecret(ctx *pulumi.Context, name string, args *ActionsOrganizationSecretArgs, opts ...pulumi.ResourceOption) (*ActionsOrganizationSecret, error) { - if args == nil || args.PlaintextValue == nil { - return nil, errors.New("missing required argument 'PlaintextValue'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.SecretName == nil { - return nil, errors.New("missing required argument 'SecretName'") + + if args.PlaintextValue == nil { + return nil, errors.New("invalid value for required argument 'PlaintextValue'") } - if args == nil || args.Visibility == nil { - return nil, errors.New("missing required argument 'Visibility'") + if args.SecretName == nil { + return nil, errors.New("invalid value for required argument 'SecretName'") } - if args == nil { - args = &ActionsOrganizationSecretArgs{} + if args.Visibility == nil { + return nil, errors.New("invalid value for required argument 'Visibility'") } var resource ActionsOrganizationSecret err := ctx.RegisterResource("github:index/actionsOrganizationSecret:ActionsOrganizationSecret", name, args, &resource, opts...) diff --git a/sdk/go/github/actionsSecret.go b/sdk/go/github/actionsSecret.go index 96a7c6f1..b9d91f61 100644 --- a/sdk/go/github/actionsSecret.go +++ b/sdk/go/github/actionsSecret.go @@ -29,17 +29,18 @@ type ActionsSecret struct { // NewActionsSecret registers a new resource with the given unique name, arguments, and options. func NewActionsSecret(ctx *pulumi.Context, name string, args *ActionsSecretArgs, opts ...pulumi.ResourceOption) (*ActionsSecret, error) { - if args == nil || args.PlaintextValue == nil { - return nil, errors.New("missing required argument 'PlaintextValue'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.Repository == nil { - return nil, errors.New("missing required argument 'Repository'") + + if args.PlaintextValue == nil { + return nil, errors.New("invalid value for required argument 'PlaintextValue'") } - if args == nil || args.SecretName == nil { - return nil, errors.New("missing required argument 'SecretName'") + if args.Repository == nil { + return nil, errors.New("invalid value for required argument 'Repository'") } - if args == nil { - args = &ActionsSecretArgs{} + if args.SecretName == nil { + return nil, errors.New("invalid value for required argument 'SecretName'") } var resource ActionsSecret err := ctx.RegisterResource("github:index/actionsSecret:ActionsSecret", name, args, &resource, opts...) diff --git a/sdk/go/github/branch.go b/sdk/go/github/branch.go index bdbcef79..5fb3211c 100644 --- a/sdk/go/github/branch.go +++ b/sdk/go/github/branch.go @@ -75,14 +75,15 @@ type Branch struct { // NewBranch registers a new resource with the given unique name, arguments, and options. func NewBranch(ctx *pulumi.Context, name string, args *BranchArgs, opts ...pulumi.ResourceOption) (*Branch, error) { - if args == nil || args.Branch == nil { - return nil, errors.New("missing required argument 'Branch'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.Repository == nil { - return nil, errors.New("missing required argument 'Repository'") + + if args.Branch == nil { + return nil, errors.New("invalid value for required argument 'Branch'") } - if args == nil { - args = &BranchArgs{} + if args.Repository == nil { + return nil, errors.New("invalid value for required argument 'Repository'") } var resource Branch err := ctx.RegisterResource("github:index/branch:Branch", name, args, &resource, opts...) diff --git a/sdk/go/github/branchDefault.go b/sdk/go/github/branchDefault.go index 7905ad39..8d7d5861 100644 --- a/sdk/go/github/branchDefault.go +++ b/sdk/go/github/branchDefault.go @@ -76,14 +76,15 @@ type BranchDefault struct { // NewBranchDefault registers a new resource with the given unique name, arguments, and options. func NewBranchDefault(ctx *pulumi.Context, name string, args *BranchDefaultArgs, opts ...pulumi.ResourceOption) (*BranchDefault, error) { - if args == nil || args.Branch == nil { - return nil, errors.New("missing required argument 'Branch'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.Repository == nil { - return nil, errors.New("missing required argument 'Repository'") + + if args.Branch == nil { + return nil, errors.New("invalid value for required argument 'Branch'") } - if args == nil { - args = &BranchDefaultArgs{} + if args.Repository == nil { + return nil, errors.New("invalid value for required argument 'Repository'") } var resource BranchDefault err := ctx.RegisterResource("github:index/branchDefault:BranchDefault", name, args, &resource, opts...) diff --git a/sdk/go/github/branchProtection.go b/sdk/go/github/branchProtection.go index e9a2ba95..cef509f5 100644 --- a/sdk/go/github/branchProtection.go +++ b/sdk/go/github/branchProtection.go @@ -44,14 +44,15 @@ type BranchProtection struct { // NewBranchProtection registers a new resource with the given unique name, arguments, and options. func NewBranchProtection(ctx *pulumi.Context, name string, args *BranchProtectionArgs, opts ...pulumi.ResourceOption) (*BranchProtection, error) { - if args == nil || args.Pattern == nil { - return nil, errors.New("missing required argument 'Pattern'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.RepositoryId == nil { - return nil, errors.New("missing required argument 'RepositoryId'") + + if args.Pattern == nil { + return nil, errors.New("invalid value for required argument 'Pattern'") } - if args == nil { - args = &BranchProtectionArgs{} + if args.RepositoryId == nil { + return nil, errors.New("invalid value for required argument 'RepositoryId'") } var resource BranchProtection err := ctx.RegisterResource("github:index/branchProtection:BranchProtection", name, args, &resource, opts...) diff --git a/sdk/go/github/config/pulumiUtilities.go b/sdk/go/github/config/pulumiUtilities.go index 85cf2773..fa624469 100644 --- a/sdk/go/github/config/pulumiUtilities.go +++ b/sdk/go/github/config/pulumiUtilities.go @@ -6,6 +6,9 @@ package config import ( "os" "strconv" + "strings" + + "github.com/pulumi/pulumi/sdk/v2/go/pulumi" ) type envParser func(v string) interface{} @@ -34,6 +37,14 @@ func parseEnvFloat(v string) interface{} { return f } +func parseEnvStringArray(v string) interface{} { + var result pulumi.StringArray + for _, item := range strings.Split(v, ";") { + result = append(result, pulumi.String(item)) + } + return result +} + func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { for _, v := range vars { if value := os.Getenv(v); value != "" { diff --git a/sdk/go/github/issueLabel.go b/sdk/go/github/issueLabel.go index a6427ab3..4c26df08 100644 --- a/sdk/go/github/issueLabel.go +++ b/sdk/go/github/issueLabel.go @@ -37,14 +37,15 @@ type IssueLabel struct { // NewIssueLabel registers a new resource with the given unique name, arguments, and options. func NewIssueLabel(ctx *pulumi.Context, name string, args *IssueLabelArgs, opts ...pulumi.ResourceOption) (*IssueLabel, error) { - if args == nil || args.Color == nil { - return nil, errors.New("missing required argument 'Color'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.Repository == nil { - return nil, errors.New("missing required argument 'Repository'") + + if args.Color == nil { + return nil, errors.New("invalid value for required argument 'Color'") } - if args == nil { - args = &IssueLabelArgs{} + if args.Repository == nil { + return nil, errors.New("invalid value for required argument 'Repository'") } var resource IssueLabel err := ctx.RegisterResource("github:index/issueLabel:IssueLabel", name, args, &resource, opts...) diff --git a/sdk/go/github/membership.go b/sdk/go/github/membership.go index 5a48eecf..53ce4ef8 100644 --- a/sdk/go/github/membership.go +++ b/sdk/go/github/membership.go @@ -62,11 +62,12 @@ type Membership struct { // NewMembership registers a new resource with the given unique name, arguments, and options. func NewMembership(ctx *pulumi.Context, name string, args *MembershipArgs, opts ...pulumi.ResourceOption) (*Membership, error) { - if args == nil || args.Username == nil { - return nil, errors.New("missing required argument 'Username'") - } if args == nil { - args = &MembershipArgs{} + return nil, errors.New("missing one or more required arguments") + } + + if args.Username == nil { + return nil, errors.New("invalid value for required argument 'Username'") } var resource Membership err := ctx.RegisterResource("github:index/membership:Membership", name, args, &resource, opts...) diff --git a/sdk/go/github/organizationBlock.go b/sdk/go/github/organizationBlock.go index dfb20dab..958acf2b 100644 --- a/sdk/go/github/organizationBlock.go +++ b/sdk/go/github/organizationBlock.go @@ -46,11 +46,12 @@ type OrganizationBlock struct { // NewOrganizationBlock registers a new resource with the given unique name, arguments, and options. func NewOrganizationBlock(ctx *pulumi.Context, name string, args *OrganizationBlockArgs, opts ...pulumi.ResourceOption) (*OrganizationBlock, error) { - if args == nil || args.Username == nil { - return nil, errors.New("missing required argument 'Username'") - } if args == nil { - args = &OrganizationBlockArgs{} + return nil, errors.New("missing one or more required arguments") + } + + if args.Username == nil { + return nil, errors.New("invalid value for required argument 'Username'") } var resource OrganizationBlock err := ctx.RegisterResource("github:index/organizationBlock:OrganizationBlock", name, args, &resource, opts...) diff --git a/sdk/go/github/organizationProject.go b/sdk/go/github/organizationProject.go index d1294150..a89a2372 100644 --- a/sdk/go/github/organizationProject.go +++ b/sdk/go/github/organizationProject.go @@ -52,6 +52,7 @@ func NewOrganizationProject(ctx *pulumi.Context, if args == nil { args = &OrganizationProjectArgs{} } + var resource OrganizationProject err := ctx.RegisterResource("github:index/organizationProject:OrganizationProject", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/github/organizationWebhook.go b/sdk/go/github/organizationWebhook.go index eacf41cc..ee4d16ff 100644 --- a/sdk/go/github/organizationWebhook.go +++ b/sdk/go/github/organizationWebhook.go @@ -70,11 +70,12 @@ type OrganizationWebhook struct { // NewOrganizationWebhook registers a new resource with the given unique name, arguments, and options. func NewOrganizationWebhook(ctx *pulumi.Context, name string, args *OrganizationWebhookArgs, opts ...pulumi.ResourceOption) (*OrganizationWebhook, error) { - if args == nil || args.Events == nil { - return nil, errors.New("missing required argument 'Events'") - } if args == nil { - args = &OrganizationWebhookArgs{} + return nil, errors.New("missing one or more required arguments") + } + + if args.Events == nil { + return nil, errors.New("invalid value for required argument 'Events'") } var resource OrganizationWebhook err := ctx.RegisterResource("github:index/organizationWebhook:OrganizationWebhook", name, args, &resource, opts...) diff --git a/sdk/go/github/projectCard.go b/sdk/go/github/projectCard.go index cfa7eb33..f1662d4c 100644 --- a/sdk/go/github/projectCard.go +++ b/sdk/go/github/projectCard.go @@ -70,14 +70,15 @@ type ProjectCard struct { // NewProjectCard registers a new resource with the given unique name, arguments, and options. func NewProjectCard(ctx *pulumi.Context, name string, args *ProjectCardArgs, opts ...pulumi.ResourceOption) (*ProjectCard, error) { - if args == nil || args.ColumnId == nil { - return nil, errors.New("missing required argument 'ColumnId'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.Note == nil { - return nil, errors.New("missing required argument 'Note'") + + if args.ColumnId == nil { + return nil, errors.New("invalid value for required argument 'ColumnId'") } - if args == nil { - args = &ProjectCardArgs{} + if args.Note == nil { + return nil, errors.New("invalid value for required argument 'Note'") } var resource ProjectCard err := ctx.RegisterResource("github:index/projectCard:ProjectCard", name, args, &resource, opts...) diff --git a/sdk/go/github/projectColumn.go b/sdk/go/github/projectColumn.go index f05ff418..d41d1282 100644 --- a/sdk/go/github/projectColumn.go +++ b/sdk/go/github/projectColumn.go @@ -55,11 +55,12 @@ type ProjectColumn struct { // NewProjectColumn registers a new resource with the given unique name, arguments, and options. func NewProjectColumn(ctx *pulumi.Context, name string, args *ProjectColumnArgs, opts ...pulumi.ResourceOption) (*ProjectColumn, error) { - if args == nil || args.ProjectId == nil { - return nil, errors.New("missing required argument 'ProjectId'") - } if args == nil { - args = &ProjectColumnArgs{} + return nil, errors.New("missing one or more required arguments") + } + + if args.ProjectId == nil { + return nil, errors.New("invalid value for required argument 'ProjectId'") } var resource ProjectColumn err := ctx.RegisterResource("github:index/projectColumn:ProjectColumn", name, args, &resource, opts...) diff --git a/sdk/go/github/provider.go b/sdk/go/github/provider.go index f802a7b2..939da71e 100644 --- a/sdk/go/github/provider.go +++ b/sdk/go/github/provider.go @@ -24,6 +24,7 @@ func NewProvider(ctx *pulumi.Context, if args == nil { args = &ProviderArgs{} } + if args.BaseUrl == nil { args.BaseUrl = pulumi.StringPtr(getEnvOrDefault("https://api.github.com/", nil, "GITHUB_BASE_URL").(string)) } diff --git a/sdk/go/github/pulumiUtilities.go b/sdk/go/github/pulumiUtilities.go index 9cf54938..be815977 100644 --- a/sdk/go/github/pulumiUtilities.go +++ b/sdk/go/github/pulumiUtilities.go @@ -6,6 +6,9 @@ package github import ( "os" "strconv" + "strings" + + "github.com/pulumi/pulumi/sdk/v2/go/pulumi" ) type envParser func(v string) interface{} @@ -34,6 +37,14 @@ func parseEnvFloat(v string) interface{} { return f } +func parseEnvStringArray(v string) interface{} { + var result pulumi.StringArray + for _, item := range strings.Split(v, ";") { + result = append(result, pulumi.String(item)) + } + return result +} + func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { for _, v := range vars { if value := os.Getenv(v); value != "" { diff --git a/sdk/go/github/repository.go b/sdk/go/github/repository.go index 53b588ce..24a2f3f8 100644 --- a/sdk/go/github/repository.go +++ b/sdk/go/github/repository.go @@ -131,6 +131,7 @@ func NewRepository(ctx *pulumi.Context, if args == nil { args = &RepositoryArgs{} } + var resource Repository err := ctx.RegisterResource("github:index/repository:Repository", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/github/repositoryCollaborator.go b/sdk/go/github/repositoryCollaborator.go index 17e7cb1d..635ef76c 100644 --- a/sdk/go/github/repositoryCollaborator.go +++ b/sdk/go/github/repositoryCollaborator.go @@ -80,14 +80,15 @@ type RepositoryCollaborator struct { // NewRepositoryCollaborator registers a new resource with the given unique name, arguments, and options. func NewRepositoryCollaborator(ctx *pulumi.Context, name string, args *RepositoryCollaboratorArgs, opts ...pulumi.ResourceOption) (*RepositoryCollaborator, error) { - if args == nil || args.Repository == nil { - return nil, errors.New("missing required argument 'Repository'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.Username == nil { - return nil, errors.New("missing required argument 'Username'") + + if args.Repository == nil { + return nil, errors.New("invalid value for required argument 'Repository'") } - if args == nil { - args = &RepositoryCollaboratorArgs{} + if args.Username == nil { + return nil, errors.New("invalid value for required argument 'Username'") } var resource RepositoryCollaborator err := ctx.RegisterResource("github:index/repositoryCollaborator:RepositoryCollaborator", name, args, &resource, opts...) diff --git a/sdk/go/github/repositoryDeployKey.go b/sdk/go/github/repositoryDeployKey.go index 182a1367..408856bf 100644 --- a/sdk/go/github/repositoryDeployKey.go +++ b/sdk/go/github/repositoryDeployKey.go @@ -72,17 +72,18 @@ type RepositoryDeployKey struct { // NewRepositoryDeployKey registers a new resource with the given unique name, arguments, and options. func NewRepositoryDeployKey(ctx *pulumi.Context, name string, args *RepositoryDeployKeyArgs, opts ...pulumi.ResourceOption) (*RepositoryDeployKey, error) { - if args == nil || args.Key == nil { - return nil, errors.New("missing required argument 'Key'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.Repository == nil { - return nil, errors.New("missing required argument 'Repository'") + + if args.Key == nil { + return nil, errors.New("invalid value for required argument 'Key'") } - if args == nil || args.Title == nil { - return nil, errors.New("missing required argument 'Title'") + if args.Repository == nil { + return nil, errors.New("invalid value for required argument 'Repository'") } - if args == nil { - args = &RepositoryDeployKeyArgs{} + if args.Title == nil { + return nil, errors.New("invalid value for required argument 'Title'") } var resource RepositoryDeployKey err := ctx.RegisterResource("github:index/repositoryDeployKey:RepositoryDeployKey", name, args, &resource, opts...) diff --git a/sdk/go/github/repositoryFile.go b/sdk/go/github/repositoryFile.go index 5b0f932d..ac2911fb 100644 --- a/sdk/go/github/repositoryFile.go +++ b/sdk/go/github/repositoryFile.go @@ -90,17 +90,18 @@ type RepositoryFile struct { // NewRepositoryFile registers a new resource with the given unique name, arguments, and options. func NewRepositoryFile(ctx *pulumi.Context, name string, args *RepositoryFileArgs, opts ...pulumi.ResourceOption) (*RepositoryFile, error) { - if args == nil || args.Content == nil { - return nil, errors.New("missing required argument 'Content'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.File == nil { - return nil, errors.New("missing required argument 'File'") + + if args.Content == nil { + return nil, errors.New("invalid value for required argument 'Content'") } - if args == nil || args.Repository == nil { - return nil, errors.New("missing required argument 'Repository'") + if args.File == nil { + return nil, errors.New("invalid value for required argument 'File'") } - if args == nil { - args = &RepositoryFileArgs{} + if args.Repository == nil { + return nil, errors.New("invalid value for required argument 'Repository'") } var resource RepositoryFile err := ctx.RegisterResource("github:index/repositoryFile:RepositoryFile", name, args, &resource, opts...) diff --git a/sdk/go/github/repositoryMilestone.go b/sdk/go/github/repositoryMilestone.go index 8e9cab7c..5bf5d249 100644 --- a/sdk/go/github/repositoryMilestone.go +++ b/sdk/go/github/repositoryMilestone.go @@ -69,17 +69,18 @@ type RepositoryMilestone struct { // NewRepositoryMilestone registers a new resource with the given unique name, arguments, and options. func NewRepositoryMilestone(ctx *pulumi.Context, name string, args *RepositoryMilestoneArgs, opts ...pulumi.ResourceOption) (*RepositoryMilestone, error) { - if args == nil || args.Owner == nil { - return nil, errors.New("missing required argument 'Owner'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.Repository == nil { - return nil, errors.New("missing required argument 'Repository'") + + if args.Owner == nil { + return nil, errors.New("invalid value for required argument 'Owner'") } - if args == nil || args.Title == nil { - return nil, errors.New("missing required argument 'Title'") + if args.Repository == nil { + return nil, errors.New("invalid value for required argument 'Repository'") } - if args == nil { - args = &RepositoryMilestoneArgs{} + if args.Title == nil { + return nil, errors.New("invalid value for required argument 'Title'") } var resource RepositoryMilestone err := ctx.RegisterResource("github:index/repositoryMilestone:RepositoryMilestone", name, args, &resource, opts...) diff --git a/sdk/go/github/repositoryProject.go b/sdk/go/github/repositoryProject.go index 6b2127e0..bfc01736 100644 --- a/sdk/go/github/repositoryProject.go +++ b/sdk/go/github/repositoryProject.go @@ -60,11 +60,12 @@ type RepositoryProject struct { // NewRepositoryProject registers a new resource with the given unique name, arguments, and options. func NewRepositoryProject(ctx *pulumi.Context, name string, args *RepositoryProjectArgs, opts ...pulumi.ResourceOption) (*RepositoryProject, error) { - if args == nil || args.Repository == nil { - return nil, errors.New("missing required argument 'Repository'") - } if args == nil { - args = &RepositoryProjectArgs{} + return nil, errors.New("missing one or more required arguments") + } + + if args.Repository == nil { + return nil, errors.New("invalid value for required argument 'Repository'") } var resource RepositoryProject err := ctx.RegisterResource("github:index/repositoryProject:RepositoryProject", name, args, &resource, opts...) diff --git a/sdk/go/github/repositoryWebhook.go b/sdk/go/github/repositoryWebhook.go index 003eed96..ff91a887 100644 --- a/sdk/go/github/repositoryWebhook.go +++ b/sdk/go/github/repositoryWebhook.go @@ -82,14 +82,15 @@ type RepositoryWebhook struct { // NewRepositoryWebhook registers a new resource with the given unique name, arguments, and options. func NewRepositoryWebhook(ctx *pulumi.Context, name string, args *RepositoryWebhookArgs, opts ...pulumi.ResourceOption) (*RepositoryWebhook, error) { - if args == nil || args.Events == nil { - return nil, errors.New("missing required argument 'Events'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.Repository == nil { - return nil, errors.New("missing required argument 'Repository'") + + if args.Events == nil { + return nil, errors.New("invalid value for required argument 'Events'") } - if args == nil { - args = &RepositoryWebhookArgs{} + if args.Repository == nil { + return nil, errors.New("invalid value for required argument 'Repository'") } var resource RepositoryWebhook err := ctx.RegisterResource("github:index/repositoryWebhook:RepositoryWebhook", name, args, &resource, opts...) diff --git a/sdk/go/github/team.go b/sdk/go/github/team.go index dd7acf85..8cbdf284 100644 --- a/sdk/go/github/team.go +++ b/sdk/go/github/team.go @@ -75,6 +75,7 @@ func NewTeam(ctx *pulumi.Context, if args == nil { args = &TeamArgs{} } + var resource Team err := ctx.RegisterResource("github:index/team:Team", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/github/teamMembership.go b/sdk/go/github/teamMembership.go index 6a5a95d3..3226a9ec 100644 --- a/sdk/go/github/teamMembership.go +++ b/sdk/go/github/teamMembership.go @@ -79,14 +79,15 @@ type TeamMembership struct { // NewTeamMembership registers a new resource with the given unique name, arguments, and options. func NewTeamMembership(ctx *pulumi.Context, name string, args *TeamMembershipArgs, opts ...pulumi.ResourceOption) (*TeamMembership, error) { - if args == nil || args.TeamId == nil { - return nil, errors.New("missing required argument 'TeamId'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.Username == nil { - return nil, errors.New("missing required argument 'Username'") + + if args.TeamId == nil { + return nil, errors.New("invalid value for required argument 'TeamId'") } - if args == nil { - args = &TeamMembershipArgs{} + if args.Username == nil { + return nil, errors.New("invalid value for required argument 'Username'") } var resource TeamMembership err := ctx.RegisterResource("github:index/teamMembership:TeamMembership", name, args, &resource, opts...) diff --git a/sdk/go/github/teamRepository.go b/sdk/go/github/teamRepository.go index d9895e21..477af587 100644 --- a/sdk/go/github/teamRepository.go +++ b/sdk/go/github/teamRepository.go @@ -79,14 +79,15 @@ type TeamRepository struct { // NewTeamRepository registers a new resource with the given unique name, arguments, and options. func NewTeamRepository(ctx *pulumi.Context, name string, args *TeamRepositoryArgs, opts ...pulumi.ResourceOption) (*TeamRepository, error) { - if args == nil || args.Repository == nil { - return nil, errors.New("missing required argument 'Repository'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.TeamId == nil { - return nil, errors.New("missing required argument 'TeamId'") + + if args.Repository == nil { + return nil, errors.New("invalid value for required argument 'Repository'") } - if args == nil { - args = &TeamRepositoryArgs{} + if args.TeamId == nil { + return nil, errors.New("invalid value for required argument 'TeamId'") } var resource TeamRepository err := ctx.RegisterResource("github:index/teamRepository:TeamRepository", name, args, &resource, opts...) diff --git a/sdk/go/github/teamSyncGroupMapping.go b/sdk/go/github/teamSyncGroupMapping.go index a7db5a98..581c4223 100644 --- a/sdk/go/github/teamSyncGroupMapping.go +++ b/sdk/go/github/teamSyncGroupMapping.go @@ -38,11 +38,12 @@ type TeamSyncGroupMapping struct { // NewTeamSyncGroupMapping registers a new resource with the given unique name, arguments, and options. func NewTeamSyncGroupMapping(ctx *pulumi.Context, name string, args *TeamSyncGroupMappingArgs, opts ...pulumi.ResourceOption) (*TeamSyncGroupMapping, error) { - if args == nil || args.TeamSlug == nil { - return nil, errors.New("missing required argument 'TeamSlug'") - } if args == nil { - args = &TeamSyncGroupMappingArgs{} + return nil, errors.New("missing one or more required arguments") + } + + if args.TeamSlug == nil { + return nil, errors.New("invalid value for required argument 'TeamSlug'") } var resource TeamSyncGroupMapping err := ctx.RegisterResource("github:index/teamSyncGroupMapping:TeamSyncGroupMapping", name, args, &resource, opts...) diff --git a/sdk/go/github/userGpgKey.go b/sdk/go/github/userGpgKey.go index 34038dab..13a2114d 100644 --- a/sdk/go/github/userGpgKey.go +++ b/sdk/go/github/userGpgKey.go @@ -57,11 +57,12 @@ type UserGpgKey struct { // NewUserGpgKey registers a new resource with the given unique name, arguments, and options. func NewUserGpgKey(ctx *pulumi.Context, name string, args *UserGpgKeyArgs, opts ...pulumi.ResourceOption) (*UserGpgKey, error) { - if args == nil || args.ArmoredPublicKey == nil { - return nil, errors.New("missing required argument 'ArmoredPublicKey'") - } if args == nil { - args = &UserGpgKeyArgs{} + return nil, errors.New("missing one or more required arguments") + } + + if args.ArmoredPublicKey == nil { + return nil, errors.New("invalid value for required argument 'ArmoredPublicKey'") } var resource UserGpgKey err := ctx.RegisterResource("github:index/userGpgKey:UserGpgKey", name, args, &resource, opts...) diff --git a/sdk/go/github/userInvitationAccepter.go b/sdk/go/github/userInvitationAccepter.go index 83c51e2b..2f727682 100644 --- a/sdk/go/github/userInvitationAccepter.go +++ b/sdk/go/github/userInvitationAccepter.go @@ -64,11 +64,12 @@ type UserInvitationAccepter struct { // NewUserInvitationAccepter registers a new resource with the given unique name, arguments, and options. func NewUserInvitationAccepter(ctx *pulumi.Context, name string, args *UserInvitationAccepterArgs, opts ...pulumi.ResourceOption) (*UserInvitationAccepter, error) { - if args == nil || args.InvitationId == nil { - return nil, errors.New("missing required argument 'InvitationId'") - } if args == nil { - args = &UserInvitationAccepterArgs{} + return nil, errors.New("missing one or more required arguments") + } + + if args.InvitationId == nil { + return nil, errors.New("invalid value for required argument 'InvitationId'") } var resource UserInvitationAccepter err := ctx.RegisterResource("github:index/userInvitationAccepter:UserInvitationAccepter", name, args, &resource, opts...) diff --git a/sdk/go/github/userSshKey.go b/sdk/go/github/userSshKey.go index 1ba6fae8..6de97f56 100644 --- a/sdk/go/github/userSshKey.go +++ b/sdk/go/github/userSshKey.go @@ -37,14 +37,15 @@ type UserSshKey struct { // NewUserSshKey registers a new resource with the given unique name, arguments, and options. func NewUserSshKey(ctx *pulumi.Context, name string, args *UserSshKeyArgs, opts ...pulumi.ResourceOption) (*UserSshKey, error) { - if args == nil || args.Key == nil { - return nil, errors.New("missing required argument 'Key'") + if args == nil { + return nil, errors.New("missing one or more required arguments") } - if args == nil || args.Title == nil { - return nil, errors.New("missing required argument 'Title'") + + if args.Key == nil { + return nil, errors.New("invalid value for required argument 'Key'") } - if args == nil { - args = &UserSshKeyArgs{} + if args.Title == nil { + return nil, errors.New("invalid value for required argument 'Title'") } var resource UserSshKey err := ctx.RegisterResource("github:index/userSshKey:UserSshKey", name, args, &resource, opts...) diff --git a/sdk/nodejs/actionsOrganizationSecret.ts b/sdk/nodejs/actionsOrganizationSecret.ts index 56974be6..dd065803 100644 --- a/sdk/nodejs/actionsOrganizationSecret.ts +++ b/sdk/nodejs/actionsOrganizationSecret.ts @@ -74,13 +74,13 @@ export class ActionsOrganizationSecret extends pulumi.CustomResource { inputs["visibility"] = state ? state.visibility : undefined; } else { const args = argsOrState as ActionsOrganizationSecretArgs | undefined; - if (!args || args.plaintextValue === undefined) { + if ((!args || args.plaintextValue === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'plaintextValue'"); } - if (!args || args.secretName === undefined) { + if ((!args || args.secretName === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'secretName'"); } - if (!args || args.visibility === undefined) { + if ((!args || args.visibility === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'visibility'"); } inputs["plaintextValue"] = args ? args.plaintextValue : undefined; diff --git a/sdk/nodejs/actionsSecret.ts b/sdk/nodejs/actionsSecret.ts index 5d3688bb..5d5655f3 100644 --- a/sdk/nodejs/actionsSecret.ts +++ b/sdk/nodejs/actionsSecret.ts @@ -72,13 +72,13 @@ export class ActionsSecret extends pulumi.CustomResource { inputs["updatedAt"] = state ? state.updatedAt : undefined; } else { const args = argsOrState as ActionsSecretArgs | undefined; - if (!args || args.plaintextValue === undefined) { + if ((!args || args.plaintextValue === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'plaintextValue'"); } - if (!args || args.repository === undefined) { + if ((!args || args.repository === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'repository'"); } - if (!args || args.secretName === undefined) { + if ((!args || args.secretName === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'secretName'"); } inputs["plaintextValue"] = args ? args.plaintextValue : undefined; diff --git a/sdk/nodejs/branch.ts b/sdk/nodejs/branch.ts index 3154da35..d6bd285e 100644 --- a/sdk/nodejs/branch.ts +++ b/sdk/nodejs/branch.ts @@ -114,10 +114,10 @@ export class Branch extends pulumi.CustomResource { inputs["sourceSha"] = state ? state.sourceSha : undefined; } else { const args = argsOrState as BranchArgs | undefined; - if (!args || args.branch === undefined) { + if ((!args || args.branch === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'branch'"); } - if (!args || args.repository === undefined) { + if ((!args || args.repository === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'repository'"); } inputs["branch"] = args ? args.branch : undefined; diff --git a/sdk/nodejs/branchDefault.ts b/sdk/nodejs/branchDefault.ts index 06e9a202..6e0dc18b 100644 --- a/sdk/nodejs/branchDefault.ts +++ b/sdk/nodejs/branchDefault.ts @@ -94,10 +94,10 @@ export class BranchDefault extends pulumi.CustomResource { inputs["repository"] = state ? state.repository : undefined; } else { const args = argsOrState as BranchDefaultArgs | undefined; - if (!args || args.branch === undefined) { + if ((!args || args.branch === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'branch'"); } - if (!args || args.repository === undefined) { + if ((!args || args.repository === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'repository'"); } inputs["branch"] = args ? args.branch : undefined; diff --git a/sdk/nodejs/branchProtection.ts b/sdk/nodejs/branchProtection.ts index 0c5f27bc..5ee3538e 100644 --- a/sdk/nodejs/branchProtection.ts +++ b/sdk/nodejs/branchProtection.ts @@ -96,10 +96,10 @@ export class BranchProtection extends pulumi.CustomResource { inputs["requiredStatusChecks"] = state ? state.requiredStatusChecks : undefined; } else { const args = argsOrState as BranchProtectionArgs | undefined; - if (!args || args.pattern === undefined) { + if ((!args || args.pattern === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'pattern'"); } - if (!args || args.repositoryId === undefined) { + if ((!args || args.repositoryId === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'repositoryId'"); } inputs["enforceAdmins"] = args ? args.enforceAdmins : undefined; diff --git a/sdk/nodejs/index.ts b/sdk/nodejs/index.ts index 3188c739..6dbcb812 100644 --- a/sdk/nodejs/index.ts +++ b/sdk/nodejs/index.ts @@ -1,6 +1,9 @@ // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** +import * as pulumi from "@pulumi/pulumi"; +import * as utilities from "./utilities"; + // Export members: export * from "./actionsOrganizationSecret"; export * from "./actionsSecret"; @@ -51,3 +54,131 @@ export { config, types, }; + +// Import resources to register: +import { ActionsOrganizationSecret } from "./actionsOrganizationSecret"; +import { ActionsSecret } from "./actionsSecret"; +import { Branch } from "./branch"; +import { BranchDefault } from "./branchDefault"; +import { BranchProtection } from "./branchProtection"; +import { IssueLabel } from "./issueLabel"; +import { Membership } from "./membership"; +import { OrganizationBlock } from "./organizationBlock"; +import { OrganizationProject } from "./organizationProject"; +import { OrganizationWebhook } from "./organizationWebhook"; +import { ProjectCard } from "./projectCard"; +import { ProjectColumn } from "./projectColumn"; +import { Repository } from "./repository"; +import { RepositoryCollaborator } from "./repositoryCollaborator"; +import { RepositoryDeployKey } from "./repositoryDeployKey"; +import { RepositoryFile } from "./repositoryFile"; +import { RepositoryMilestone } from "./repositoryMilestone"; +import { RepositoryProject } from "./repositoryProject"; +import { RepositoryWebhook } from "./repositoryWebhook"; +import { Team } from "./team"; +import { TeamMembership } from "./teamMembership"; +import { TeamRepository } from "./teamRepository"; +import { TeamSyncGroupMapping } from "./teamSyncGroupMapping"; +import { UserGpgKey } from "./userGpgKey"; +import { UserInvitationAccepter } from "./userInvitationAccepter"; +import { UserSshKey } from "./userSshKey"; + +const _module = { + version: utilities.getVersion(), + construct: (name: string, type: string, urn: string): pulumi.Resource => { + switch (type) { + case "github:index/actionsOrganizationSecret:ActionsOrganizationSecret": + return new ActionsOrganizationSecret(name, undefined, { urn }) + case "github:index/actionsSecret:ActionsSecret": + return new ActionsSecret(name, undefined, { urn }) + case "github:index/branch:Branch": + return new Branch(name, undefined, { urn }) + case "github:index/branchDefault:BranchDefault": + return new BranchDefault(name, undefined, { urn }) + case "github:index/branchProtection:BranchProtection": + return new BranchProtection(name, undefined, { urn }) + case "github:index/issueLabel:IssueLabel": + return new IssueLabel(name, undefined, { urn }) + case "github:index/membership:Membership": + return new Membership(name, undefined, { urn }) + case "github:index/organizationBlock:OrganizationBlock": + return new OrganizationBlock(name, undefined, { urn }) + case "github:index/organizationProject:OrganizationProject": + return new OrganizationProject(name, undefined, { urn }) + case "github:index/organizationWebhook:OrganizationWebhook": + return new OrganizationWebhook(name, undefined, { urn }) + case "github:index/projectCard:ProjectCard": + return new ProjectCard(name, undefined, { urn }) + case "github:index/projectColumn:ProjectColumn": + return new ProjectColumn(name, undefined, { urn }) + case "github:index/repository:Repository": + return new Repository(name, undefined, { urn }) + case "github:index/repositoryCollaborator:RepositoryCollaborator": + return new RepositoryCollaborator(name, undefined, { urn }) + case "github:index/repositoryDeployKey:RepositoryDeployKey": + return new RepositoryDeployKey(name, undefined, { urn }) + case "github:index/repositoryFile:RepositoryFile": + return new RepositoryFile(name, undefined, { urn }) + case "github:index/repositoryMilestone:RepositoryMilestone": + return new RepositoryMilestone(name, undefined, { urn }) + case "github:index/repositoryProject:RepositoryProject": + return new RepositoryProject(name, undefined, { urn }) + case "github:index/repositoryWebhook:RepositoryWebhook": + return new RepositoryWebhook(name, undefined, { urn }) + case "github:index/team:Team": + return new Team(name, undefined, { urn }) + case "github:index/teamMembership:TeamMembership": + return new TeamMembership(name, undefined, { urn }) + case "github:index/teamRepository:TeamRepository": + return new TeamRepository(name, undefined, { urn }) + case "github:index/teamSyncGroupMapping:TeamSyncGroupMapping": + return new TeamSyncGroupMapping(name, undefined, { urn }) + case "github:index/userGpgKey:UserGpgKey": + return new UserGpgKey(name, undefined, { urn }) + case "github:index/userInvitationAccepter:UserInvitationAccepter": + return new UserInvitationAccepter(name, undefined, { urn }) + case "github:index/userSshKey:UserSshKey": + return new UserSshKey(name, undefined, { urn }) + default: + throw new Error(`unknown resource type ${type}`); + } + }, +}; +pulumi.runtime.registerResourceModule("github", "index/actionsOrganizationSecret", _module) +pulumi.runtime.registerResourceModule("github", "index/actionsSecret", _module) +pulumi.runtime.registerResourceModule("github", "index/branch", _module) +pulumi.runtime.registerResourceModule("github", "index/branchDefault", _module) +pulumi.runtime.registerResourceModule("github", "index/branchProtection", _module) +pulumi.runtime.registerResourceModule("github", "index/issueLabel", _module) +pulumi.runtime.registerResourceModule("github", "index/membership", _module) +pulumi.runtime.registerResourceModule("github", "index/organizationBlock", _module) +pulumi.runtime.registerResourceModule("github", "index/organizationProject", _module) +pulumi.runtime.registerResourceModule("github", "index/organizationWebhook", _module) +pulumi.runtime.registerResourceModule("github", "index/projectCard", _module) +pulumi.runtime.registerResourceModule("github", "index/projectColumn", _module) +pulumi.runtime.registerResourceModule("github", "index/repository", _module) +pulumi.runtime.registerResourceModule("github", "index/repositoryCollaborator", _module) +pulumi.runtime.registerResourceModule("github", "index/repositoryDeployKey", _module) +pulumi.runtime.registerResourceModule("github", "index/repositoryFile", _module) +pulumi.runtime.registerResourceModule("github", "index/repositoryMilestone", _module) +pulumi.runtime.registerResourceModule("github", "index/repositoryProject", _module) +pulumi.runtime.registerResourceModule("github", "index/repositoryWebhook", _module) +pulumi.runtime.registerResourceModule("github", "index/team", _module) +pulumi.runtime.registerResourceModule("github", "index/teamMembership", _module) +pulumi.runtime.registerResourceModule("github", "index/teamRepository", _module) +pulumi.runtime.registerResourceModule("github", "index/teamSyncGroupMapping", _module) +pulumi.runtime.registerResourceModule("github", "index/userGpgKey", _module) +pulumi.runtime.registerResourceModule("github", "index/userInvitationAccepter", _module) +pulumi.runtime.registerResourceModule("github", "index/userSshKey", _module) + +import { Provider } from "./provider"; + +pulumi.runtime.registerResourcePackage("github", { + version: utilities.getVersion(), + constructProvider: (name: string, type: string, urn: string): pulumi.ProviderResource => { + if (type !== "pulumi:providers:github") { + throw new Error(`unknown provider type ${type}`); + } + return new Provider(name, undefined, { urn }); + }, +}); diff --git a/sdk/nodejs/issueLabel.ts b/sdk/nodejs/issueLabel.ts index 2e241dc4..75248258 100644 --- a/sdk/nodejs/issueLabel.ts +++ b/sdk/nodejs/issueLabel.ts @@ -83,10 +83,10 @@ export class IssueLabel extends pulumi.CustomResource { inputs["url"] = state ? state.url : undefined; } else { const args = argsOrState as IssueLabelArgs | undefined; - if (!args || args.color === undefined) { + if ((!args || args.color === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'color'"); } - if (!args || args.repository === undefined) { + if ((!args || args.repository === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'repository'"); } inputs["color"] = args ? args.color : undefined; diff --git a/sdk/nodejs/membership.ts b/sdk/nodejs/membership.ts index 4fed1e41..13594d48 100644 --- a/sdk/nodejs/membership.ts +++ b/sdk/nodejs/membership.ts @@ -88,7 +88,7 @@ export class Membership extends pulumi.CustomResource { inputs["username"] = state ? state.username : undefined; } else { const args = argsOrState as MembershipArgs | undefined; - if (!args || args.username === undefined) { + if ((!args || args.username === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'username'"); } inputs["role"] = args ? args.role : undefined; diff --git a/sdk/nodejs/organizationBlock.ts b/sdk/nodejs/organizationBlock.ts index 1cfcaed3..f1fba809 100644 --- a/sdk/nodejs/organizationBlock.ts +++ b/sdk/nodejs/organizationBlock.ts @@ -68,7 +68,7 @@ export class OrganizationBlock extends pulumi.CustomResource { inputs["username"] = state ? state.username : undefined; } else { const args = argsOrState as OrganizationBlockArgs | undefined; - if (!args || args.username === undefined) { + if ((!args || args.username === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'username'"); } inputs["username"] = args ? args.username : undefined; diff --git a/sdk/nodejs/organizationWebhook.ts b/sdk/nodejs/organizationWebhook.ts index 5446ec42..e935b73d 100644 --- a/sdk/nodejs/organizationWebhook.ts +++ b/sdk/nodejs/organizationWebhook.ts @@ -100,7 +100,7 @@ export class OrganizationWebhook extends pulumi.CustomResource { inputs["url"] = state ? state.url : undefined; } else { const args = argsOrState as OrganizationWebhookArgs | undefined; - if (!args || args.events === undefined) { + if ((!args || args.events === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'events'"); } inputs["active"] = args ? args.active : undefined; diff --git a/sdk/nodejs/package.json b/sdk/nodejs/package.json index 17e87d96..9168a8dd 100644 --- a/sdk/nodejs/package.json +++ b/sdk/nodejs/package.json @@ -13,7 +13,7 @@ "build": "tsc" }, "dependencies": { - "@pulumi/pulumi": "^2.0.0" + "@pulumi/pulumi": "^2.15.0" }, "devDependencies": { "@types/mime": "^2.0.0", diff --git a/sdk/nodejs/projectCard.ts b/sdk/nodejs/projectCard.ts index 49cd6bdc..fb418f78 100644 --- a/sdk/nodejs/projectCard.ts +++ b/sdk/nodejs/projectCard.ts @@ -86,10 +86,10 @@ export class ProjectCard extends pulumi.CustomResource { inputs["note"] = state ? state.note : undefined; } else { const args = argsOrState as ProjectCardArgs | undefined; - if (!args || args.columnId === undefined) { + if ((!args || args.columnId === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'columnId'"); } - if (!args || args.note === undefined) { + if ((!args || args.note === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'note'"); } inputs["columnId"] = args ? args.columnId : undefined; diff --git a/sdk/nodejs/projectColumn.ts b/sdk/nodejs/projectColumn.ts index 3e40c932..0e61d625 100644 --- a/sdk/nodejs/projectColumn.ts +++ b/sdk/nodejs/projectColumn.ts @@ -78,7 +78,7 @@ export class ProjectColumn extends pulumi.CustomResource { inputs["projectId"] = state ? state.projectId : undefined; } else { const args = argsOrState as ProjectColumnArgs | undefined; - if (!args || args.projectId === undefined) { + if ((!args || args.projectId === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'projectId'"); } inputs["name"] = args ? args.name : undefined; diff --git a/sdk/nodejs/repositoryCollaborator.ts b/sdk/nodejs/repositoryCollaborator.ts index 86773693..d976bba1 100644 --- a/sdk/nodejs/repositoryCollaborator.ts +++ b/sdk/nodejs/repositoryCollaborator.ts @@ -111,10 +111,10 @@ export class RepositoryCollaborator extends pulumi.CustomResource { inputs["username"] = state ? state.username : undefined; } else { const args = argsOrState as RepositoryCollaboratorArgs | undefined; - if (!args || args.repository === undefined) { + if ((!args || args.repository === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'repository'"); } - if (!args || args.username === undefined) { + if ((!args || args.username === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'username'"); } inputs["permission"] = args ? args.permission : undefined; diff --git a/sdk/nodejs/repositoryDeployKey.ts b/sdk/nodejs/repositoryDeployKey.ts index c14eb057..2f4b957c 100644 --- a/sdk/nodejs/repositoryDeployKey.ts +++ b/sdk/nodejs/repositoryDeployKey.ts @@ -104,13 +104,13 @@ export class RepositoryDeployKey extends pulumi.CustomResource { inputs["title"] = state ? state.title : undefined; } else { const args = argsOrState as RepositoryDeployKeyArgs | undefined; - if (!args || args.key === undefined) { + if ((!args || args.key === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'key'"); } - if (!args || args.repository === undefined) { + if ((!args || args.repository === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'repository'"); } - if (!args || args.title === undefined) { + if ((!args || args.title === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'title'"); } inputs["key"] = args ? args.key : undefined; diff --git a/sdk/nodejs/repositoryFile.ts b/sdk/nodejs/repositoryFile.ts index 605994bd..f9877a1c 100644 --- a/sdk/nodejs/repositoryFile.ts +++ b/sdk/nodejs/repositoryFile.ts @@ -130,13 +130,13 @@ export class RepositoryFile extends pulumi.CustomResource { inputs["sha"] = state ? state.sha : undefined; } else { const args = argsOrState as RepositoryFileArgs | undefined; - if (!args || args.content === undefined) { + if ((!args || args.content === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'content'"); } - if (!args || args.file === undefined) { + if ((!args || args.file === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'file'"); } - if (!args || args.repository === undefined) { + if ((!args || args.repository === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'repository'"); } inputs["branch"] = args ? args.branch : undefined; diff --git a/sdk/nodejs/repositoryMilestone.ts b/sdk/nodejs/repositoryMilestone.ts index c533eead..bed3b2db 100644 --- a/sdk/nodejs/repositoryMilestone.ts +++ b/sdk/nodejs/repositoryMilestone.ts @@ -109,13 +109,13 @@ export class RepositoryMilestone extends pulumi.CustomResource { inputs["title"] = state ? state.title : undefined; } else { const args = argsOrState as RepositoryMilestoneArgs | undefined; - if (!args || args.owner === undefined) { + if ((!args || args.owner === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'owner'"); } - if (!args || args.repository === undefined) { + if ((!args || args.repository === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'repository'"); } - if (!args || args.title === undefined) { + if ((!args || args.title === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'title'"); } inputs["description"] = args ? args.description : undefined; diff --git a/sdk/nodejs/repositoryProject.ts b/sdk/nodejs/repositoryProject.ts index 3bb26427..07d25d6c 100644 --- a/sdk/nodejs/repositoryProject.ts +++ b/sdk/nodejs/repositoryProject.ts @@ -88,7 +88,7 @@ export class RepositoryProject extends pulumi.CustomResource { inputs["url"] = state ? state.url : undefined; } else { const args = argsOrState as RepositoryProjectArgs | undefined; - if (!args || args.repository === undefined) { + if ((!args || args.repository === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'repository'"); } inputs["body"] = args ? args.body : undefined; diff --git a/sdk/nodejs/repositoryWebhook.ts b/sdk/nodejs/repositoryWebhook.ts index 1cdb9f8a..75acb028 100644 --- a/sdk/nodejs/repositoryWebhook.ts +++ b/sdk/nodejs/repositoryWebhook.ts @@ -112,10 +112,10 @@ export class RepositoryWebhook extends pulumi.CustomResource { inputs["url"] = state ? state.url : undefined; } else { const args = argsOrState as RepositoryWebhookArgs | undefined; - if (!args || args.events === undefined) { + if ((!args || args.events === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'events'"); } - if (!args || args.repository === undefined) { + if ((!args || args.repository === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'repository'"); } inputs["active"] = args ? args.active : undefined; diff --git a/sdk/nodejs/teamMembership.ts b/sdk/nodejs/teamMembership.ts index e44021da..63593eea 100644 --- a/sdk/nodejs/teamMembership.ts +++ b/sdk/nodejs/teamMembership.ts @@ -102,10 +102,10 @@ export class TeamMembership extends pulumi.CustomResource { inputs["username"] = state ? state.username : undefined; } else { const args = argsOrState as TeamMembershipArgs | undefined; - if (!args || args.teamId === undefined) { + if ((!args || args.teamId === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'teamId'"); } - if (!args || args.username === undefined) { + if ((!args || args.username === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'username'"); } inputs["role"] = args ? args.role : undefined; diff --git a/sdk/nodejs/teamRepository.ts b/sdk/nodejs/teamRepository.ts index 7da8c09e..8c02f3b1 100644 --- a/sdk/nodejs/teamRepository.ts +++ b/sdk/nodejs/teamRepository.ts @@ -102,10 +102,10 @@ export class TeamRepository extends pulumi.CustomResource { inputs["teamId"] = state ? state.teamId : undefined; } else { const args = argsOrState as TeamRepositoryArgs | undefined; - if (!args || args.repository === undefined) { + if ((!args || args.repository === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'repository'"); } - if (!args || args.teamId === undefined) { + if ((!args || args.teamId === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'teamId'"); } inputs["permission"] = args ? args.permission : undefined; diff --git a/sdk/nodejs/teamSyncGroupMapping.ts b/sdk/nodejs/teamSyncGroupMapping.ts index 0d05adaa..47ec2f1b 100644 --- a/sdk/nodejs/teamSyncGroupMapping.ts +++ b/sdk/nodejs/teamSyncGroupMapping.ts @@ -96,7 +96,7 @@ export class TeamSyncGroupMapping extends pulumi.CustomResource { inputs["teamSlug"] = state ? state.teamSlug : undefined; } else { const args = argsOrState as TeamSyncGroupMappingArgs | undefined; - if (!args || args.teamSlug === undefined) { + if ((!args || args.teamSlug === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'teamSlug'"); } inputs["groups"] = args ? args.groups : undefined; diff --git a/sdk/nodejs/userGpgKey.ts b/sdk/nodejs/userGpgKey.ts index 047a8456..bc08e373 100644 --- a/sdk/nodejs/userGpgKey.ts +++ b/sdk/nodejs/userGpgKey.ts @@ -82,7 +82,7 @@ export class UserGpgKey extends pulumi.CustomResource { inputs["keyId"] = state ? state.keyId : undefined; } else { const args = argsOrState as UserGpgKeyArgs | undefined; - if (!args || args.armoredPublicKey === undefined) { + if ((!args || args.armoredPublicKey === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'armoredPublicKey'"); } inputs["armoredPublicKey"] = args ? args.armoredPublicKey : undefined; diff --git a/sdk/nodejs/userInvitationAccepter.ts b/sdk/nodejs/userInvitationAccepter.ts index 26264004..4462604d 100644 --- a/sdk/nodejs/userInvitationAccepter.ts +++ b/sdk/nodejs/userInvitationAccepter.ts @@ -75,7 +75,7 @@ export class UserInvitationAccepter extends pulumi.CustomResource { inputs["invitationId"] = state ? state.invitationId : undefined; } else { const args = argsOrState as UserInvitationAccepterArgs | undefined; - if (!args || args.invitationId === undefined) { + if ((!args || args.invitationId === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'invitationId'"); } inputs["invitationId"] = args ? args.invitationId : undefined; diff --git a/sdk/nodejs/userSshKey.ts b/sdk/nodejs/userSshKey.ts index 9b7dc1a4..c2da940f 100644 --- a/sdk/nodejs/userSshKey.ts +++ b/sdk/nodejs/userSshKey.ts @@ -90,10 +90,10 @@ export class UserSshKey extends pulumi.CustomResource { inputs["url"] = state ? state.url : undefined; } else { const args = argsOrState as UserSshKeyArgs | undefined; - if (!args || args.key === undefined) { + if ((!args || args.key === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'key'"); } - if (!args || args.title === undefined) { + if ((!args || args.title === undefined) && !(opts && opts.urn)) { throw new Error("Missing required property 'title'"); } inputs["key"] = args ? args.key : undefined; diff --git a/sdk/python/pulumi_github/__init__.py b/sdk/python/pulumi_github/__init__.py index 9d480c9b..869e3cb0 100644 --- a/sdk/python/pulumi_github/__init__.py +++ b/sdk/python/pulumi_github/__init__.py @@ -50,3 +50,116 @@ from . import ( config, ) + +def _register_module(): + import pulumi + from . import _utilities + + + class Module(pulumi.runtime.ResourceModule): + _version = _utilities.get_semver_version() + + def version(self): + return Module._version + + def construct(self, name: str, typ: str, urn: str) -> pulumi.Resource: + if typ == "github:index/actionsOrganizationSecret:ActionsOrganizationSecret": + return ActionsOrganizationSecret(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/actionsSecret:ActionsSecret": + return ActionsSecret(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/branch:Branch": + return Branch(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/branchDefault:BranchDefault": + return BranchDefault(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/branchProtection:BranchProtection": + return BranchProtection(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/issueLabel:IssueLabel": + return IssueLabel(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/membership:Membership": + return Membership(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/organizationBlock:OrganizationBlock": + return OrganizationBlock(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/organizationProject:OrganizationProject": + return OrganizationProject(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/organizationWebhook:OrganizationWebhook": + return OrganizationWebhook(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/projectCard:ProjectCard": + return ProjectCard(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/projectColumn:ProjectColumn": + return ProjectColumn(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/repository:Repository": + return Repository(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/repositoryCollaborator:RepositoryCollaborator": + return RepositoryCollaborator(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/repositoryDeployKey:RepositoryDeployKey": + return RepositoryDeployKey(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/repositoryFile:RepositoryFile": + return RepositoryFile(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/repositoryMilestone:RepositoryMilestone": + return RepositoryMilestone(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/repositoryProject:RepositoryProject": + return RepositoryProject(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/repositoryWebhook:RepositoryWebhook": + return RepositoryWebhook(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/team:Team": + return Team(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/teamMembership:TeamMembership": + return TeamMembership(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/teamRepository:TeamRepository": + return TeamRepository(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/teamSyncGroupMapping:TeamSyncGroupMapping": + return TeamSyncGroupMapping(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/userGpgKey:UserGpgKey": + return UserGpgKey(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/userInvitationAccepter:UserInvitationAccepter": + return UserInvitationAccepter(name, pulumi.ResourceOptions(urn=urn)) + elif typ == "github:index/userSshKey:UserSshKey": + return UserSshKey(name, pulumi.ResourceOptions(urn=urn)) + else: + raise Exception(f"unknown resource type {typ}") + + + _module_instance = Module() + pulumi.runtime.register_resource_module("github", "index/actionsOrganizationSecret", _module_instance) + pulumi.runtime.register_resource_module("github", "index/actionsSecret", _module_instance) + pulumi.runtime.register_resource_module("github", "index/branch", _module_instance) + pulumi.runtime.register_resource_module("github", "index/branchDefault", _module_instance) + pulumi.runtime.register_resource_module("github", "index/branchProtection", _module_instance) + pulumi.runtime.register_resource_module("github", "index/issueLabel", _module_instance) + pulumi.runtime.register_resource_module("github", "index/membership", _module_instance) + pulumi.runtime.register_resource_module("github", "index/organizationBlock", _module_instance) + pulumi.runtime.register_resource_module("github", "index/organizationProject", _module_instance) + pulumi.runtime.register_resource_module("github", "index/organizationWebhook", _module_instance) + pulumi.runtime.register_resource_module("github", "index/projectCard", _module_instance) + pulumi.runtime.register_resource_module("github", "index/projectColumn", _module_instance) + pulumi.runtime.register_resource_module("github", "index/repository", _module_instance) + pulumi.runtime.register_resource_module("github", "index/repositoryCollaborator", _module_instance) + pulumi.runtime.register_resource_module("github", "index/repositoryDeployKey", _module_instance) + pulumi.runtime.register_resource_module("github", "index/repositoryFile", _module_instance) + pulumi.runtime.register_resource_module("github", "index/repositoryMilestone", _module_instance) + pulumi.runtime.register_resource_module("github", "index/repositoryProject", _module_instance) + pulumi.runtime.register_resource_module("github", "index/repositoryWebhook", _module_instance) + pulumi.runtime.register_resource_module("github", "index/team", _module_instance) + pulumi.runtime.register_resource_module("github", "index/teamMembership", _module_instance) + pulumi.runtime.register_resource_module("github", "index/teamRepository", _module_instance) + pulumi.runtime.register_resource_module("github", "index/teamSyncGroupMapping", _module_instance) + pulumi.runtime.register_resource_module("github", "index/userGpgKey", _module_instance) + pulumi.runtime.register_resource_module("github", "index/userInvitationAccepter", _module_instance) + pulumi.runtime.register_resource_module("github", "index/userSshKey", _module_instance) + + + class Package(pulumi.runtime.ResourcePackage): + _version = _utilities.get_semver_version() + + def version(self): + return Package._version + + def construct_provider(self, name: str, typ: str, urn: str) -> pulumi.ProviderResource: + if typ != "pulumi:providers:github": + raise Exception(f"unknown provider type {typ}") + return Provider(name, pulumi.ResourceOptions(urn=urn)) + + + pulumi.runtime.register_resource_package("github", Package()) + +_register_module() diff --git a/sdk/python/pulumi_github/_utilities.py b/sdk/python/pulumi_github/_utilities.py index 829bc0cf..457d32c8 100644 --- a/sdk/python/pulumi_github/_utilities.py +++ b/sdk/python/pulumi_github/_utilities.py @@ -50,7 +50,7 @@ def get_env_float(*args): return None -def get_version(): +def get_semver_version(): # __name__ is set to the fully-qualified name of the current module, In our case, it will be # ._utilities. is the module we want to query the version for. root_package, *rest = __name__.split('.') @@ -79,5 +79,7 @@ def get_version(): # for dev builds, while semver encodes them as "prerelease" versions. In order to bridge between the two, we convert # our dev build version into a prerelease tag. This matches what all of our other packages do when constructing # their own semver string. - semver_version = SemverVersion(major=major, minor=minor, patch=patch, prerelease=prerelease) - return str(semver_version) + return SemverVersion(major=major, minor=minor, patch=patch, prerelease=prerelease) + +def get_version(): + return str(get_semver_version()) diff --git a/sdk/python/pulumi_github/actions_organization_secret.py b/sdk/python/pulumi_github/actions_organization_secret.py index 75df88d0..b07e94e7 100644 --- a/sdk/python/pulumi_github/actions_organization_secret.py +++ b/sdk/python/pulumi_github/actions_organization_secret.py @@ -47,14 +47,14 @@ def __init__(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() - if plaintext_value is None: + if plaintext_value is None and not opts.urn: raise TypeError("Missing required property 'plaintext_value'") __props__['plaintext_value'] = plaintext_value - if secret_name is None: + if secret_name is None and not opts.urn: raise TypeError("Missing required property 'secret_name'") __props__['secret_name'] = secret_name __props__['selected_repository_ids'] = selected_repository_ids - if visibility is None: + if visibility is None and not opts.urn: raise TypeError("Missing required property 'visibility'") __props__['visibility'] = visibility __props__['created_at'] = None diff --git a/sdk/python/pulumi_github/actions_secret.py b/sdk/python/pulumi_github/actions_secret.py index ee2dc02c..e3cf9727 100644 --- a/sdk/python/pulumi_github/actions_secret.py +++ b/sdk/python/pulumi_github/actions_secret.py @@ -46,13 +46,13 @@ def __init__(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() - if plaintext_value is None: + if plaintext_value is None and not opts.urn: raise TypeError("Missing required property 'plaintext_value'") __props__['plaintext_value'] = plaintext_value - if repository is None: + if repository is None and not opts.urn: raise TypeError("Missing required property 'repository'") __props__['repository'] = repository - if secret_name is None: + if secret_name is None and not opts.urn: raise TypeError("Missing required property 'secret_name'") __props__['secret_name'] = secret_name __props__['created_at'] = None diff --git a/sdk/python/pulumi_github/branch.py b/sdk/python/pulumi_github/branch.py index 21c0ae8d..d4dab74b 100644 --- a/sdk/python/pulumi_github/branch.py +++ b/sdk/python/pulumi_github/branch.py @@ -77,10 +77,10 @@ def __init__(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() - if branch is None: + if branch is None and not opts.urn: raise TypeError("Missing required property 'branch'") __props__['branch'] = branch - if repository is None: + if repository is None and not opts.urn: raise TypeError("Missing required property 'repository'") __props__['repository'] = repository __props__['source_branch'] = source_branch diff --git a/sdk/python/pulumi_github/branch_default.py b/sdk/python/pulumi_github/branch_default.py index 448dfe7e..b2b85c7a 100644 --- a/sdk/python/pulumi_github/branch_default.py +++ b/sdk/python/pulumi_github/branch_default.py @@ -76,10 +76,10 @@ def __init__(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() - if branch is None: + if branch is None and not opts.urn: raise TypeError("Missing required property 'branch'") __props__['branch'] = branch - if repository is None: + if repository is None and not opts.urn: raise TypeError("Missing required property 'repository'") __props__['repository'] = repository super(BranchDefault, __self__).__init__( diff --git a/sdk/python/pulumi_github/branch_protection.py b/sdk/python/pulumi_github/branch_protection.py index b0424dd6..155b1f25 100644 --- a/sdk/python/pulumi_github/branch_protection.py +++ b/sdk/python/pulumi_github/branch_protection.py @@ -68,11 +68,11 @@ def __init__(__self__, __props__ = dict() __props__['enforce_admins'] = enforce_admins - if pattern is None: + if pattern is None and not opts.urn: raise TypeError("Missing required property 'pattern'") __props__['pattern'] = pattern __props__['push_restrictions'] = push_restrictions - if repository_id is None: + if repository_id is None and not opts.urn: raise TypeError("Missing required property 'repository_id'") __props__['repository_id'] = repository_id __props__['require_signed_commits'] = require_signed_commits diff --git a/sdk/python/pulumi_github/issue_label.py b/sdk/python/pulumi_github/issue_label.py index 1fd5a26d..1856f364 100644 --- a/sdk/python/pulumi_github/issue_label.py +++ b/sdk/python/pulumi_github/issue_label.py @@ -55,12 +55,12 @@ def __init__(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() - if color is None: + if color is None and not opts.urn: raise TypeError("Missing required property 'color'") __props__['color'] = color __props__['description'] = description __props__['name'] = name - if repository is None: + if repository is None and not opts.urn: raise TypeError("Missing required property 'repository'") __props__['repository'] = repository __props__['etag'] = None diff --git a/sdk/python/pulumi_github/membership.py b/sdk/python/pulumi_github/membership.py index 8e386294..9e8cca60 100644 --- a/sdk/python/pulumi_github/membership.py +++ b/sdk/python/pulumi_github/membership.py @@ -71,7 +71,7 @@ def __init__(__self__, __props__ = dict() __props__['role'] = role - if username is None: + if username is None and not opts.urn: raise TypeError("Missing required property 'username'") __props__['username'] = username __props__['etag'] = None diff --git a/sdk/python/pulumi_github/organization_block.py b/sdk/python/pulumi_github/organization_block.py index 20759c76..776d3b5c 100644 --- a/sdk/python/pulumi_github/organization_block.py +++ b/sdk/python/pulumi_github/organization_block.py @@ -52,7 +52,7 @@ def __init__(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() - if username is None: + if username is None and not opts.urn: raise TypeError("Missing required property 'username'") __props__['username'] = username __props__['etag'] = None diff --git a/sdk/python/pulumi_github/organization_webhook.py b/sdk/python/pulumi_github/organization_webhook.py index 0ee59d80..d6a29f8a 100644 --- a/sdk/python/pulumi_github/organization_webhook.py +++ b/sdk/python/pulumi_github/organization_webhook.py @@ -77,7 +77,7 @@ def __init__(__self__, __props__['active'] = active __props__['configuration'] = configuration - if events is None: + if events is None and not opts.urn: raise TypeError("Missing required property 'events'") __props__['events'] = events __props__['etag'] = None diff --git a/sdk/python/pulumi_github/project_card.py b/sdk/python/pulumi_github/project_card.py index 58f0436c..bd558e74 100644 --- a/sdk/python/pulumi_github/project_card.py +++ b/sdk/python/pulumi_github/project_card.py @@ -66,10 +66,10 @@ def __init__(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() - if column_id is None: + if column_id is None and not opts.urn: raise TypeError("Missing required property 'column_id'") __props__['column_id'] = column_id - if note is None: + if note is None and not opts.urn: raise TypeError("Missing required property 'note'") __props__['note'] = note __props__['card_id'] = None diff --git a/sdk/python/pulumi_github/project_column.py b/sdk/python/pulumi_github/project_column.py index 8a34d112..c38b0781 100644 --- a/sdk/python/pulumi_github/project_column.py +++ b/sdk/python/pulumi_github/project_column.py @@ -56,7 +56,7 @@ def __init__(__self__, __props__ = dict() __props__['name'] = name - if project_id is None: + if project_id is None and not opts.urn: raise TypeError("Missing required property 'project_id'") __props__['project_id'] = project_id __props__['column_id'] = None diff --git a/sdk/python/pulumi_github/repository.py b/sdk/python/pulumi_github/repository.py index e64d550f..b8319096 100644 --- a/sdk/python/pulumi_github/repository.py +++ b/sdk/python/pulumi_github/repository.py @@ -124,7 +124,7 @@ def __init__(__self__, __props__['archive_on_destroy'] = archive_on_destroy __props__['archived'] = archived __props__['auto_init'] = auto_init - if default_branch is not None: + if default_branch is not None and not opts.urn: warnings.warn("""Use the github_branch_default resource instead""", DeprecationWarning) pulumi.log.warn("default_branch is deprecated: Use the github_branch_default resource instead") __props__['default_branch'] = default_branch @@ -139,7 +139,7 @@ def __init__(__self__, __props__['is_template'] = is_template __props__['license_template'] = license_template __props__['name'] = name - if private is not None: + if private is not None and not opts.urn: warnings.warn("""use visibility instead""", DeprecationWarning) pulumi.log.warn("private is deprecated: use visibility instead") __props__['private'] = private diff --git a/sdk/python/pulumi_github/repository_collaborator.py b/sdk/python/pulumi_github/repository_collaborator.py index eca9d0c1..009e6037 100644 --- a/sdk/python/pulumi_github/repository_collaborator.py +++ b/sdk/python/pulumi_github/repository_collaborator.py @@ -88,10 +88,10 @@ def __init__(__self__, __props__ = dict() __props__['permission'] = permission - if repository is None: + if repository is None and not opts.urn: raise TypeError("Missing required property 'repository'") __props__['repository'] = repository - if username is None: + if username is None and not opts.urn: raise TypeError("Missing required property 'username'") __props__['username'] = username __props__['invitation_id'] = None diff --git a/sdk/python/pulumi_github/repository_deploy_key.py b/sdk/python/pulumi_github/repository_deploy_key.py index 41134570..e14f631b 100644 --- a/sdk/python/pulumi_github/repository_deploy_key.py +++ b/sdk/python/pulumi_github/repository_deploy_key.py @@ -80,14 +80,14 @@ def __init__(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() - if key is None: + if key is None and not opts.urn: raise TypeError("Missing required property 'key'") __props__['key'] = key __props__['read_only'] = read_only - if repository is None: + if repository is None and not opts.urn: raise TypeError("Missing required property 'repository'") __props__['repository'] = repository - if title is None: + if title is None and not opts.urn: raise TypeError("Missing required property 'title'") __props__['title'] = title __props__['etag'] = None diff --git a/sdk/python/pulumi_github/repository_file.py b/sdk/python/pulumi_github/repository_file.py index c5aa403e..43d9ec33 100644 --- a/sdk/python/pulumi_github/repository_file.py +++ b/sdk/python/pulumi_github/repository_file.py @@ -95,14 +95,14 @@ def __init__(__self__, __props__['commit_author'] = commit_author __props__['commit_email'] = commit_email __props__['commit_message'] = commit_message - if content is None: + if content is None and not opts.urn: raise TypeError("Missing required property 'content'") __props__['content'] = content - if file is None: + if file is None and not opts.urn: raise TypeError("Missing required property 'file'") __props__['file'] = file __props__['overwrite_on_create'] = overwrite_on_create - if repository is None: + if repository is None and not opts.urn: raise TypeError("Missing required property 'repository'") __props__['repository'] = repository __props__['sha'] = None diff --git a/sdk/python/pulumi_github/repository_milestone.py b/sdk/python/pulumi_github/repository_milestone.py index f5abde15..b727eee5 100644 --- a/sdk/python/pulumi_github/repository_milestone.py +++ b/sdk/python/pulumi_github/repository_milestone.py @@ -78,14 +78,14 @@ def __init__(__self__, __props__['description'] = description __props__['due_date'] = due_date - if owner is None: + if owner is None and not opts.urn: raise TypeError("Missing required property 'owner'") __props__['owner'] = owner - if repository is None: + if repository is None and not opts.urn: raise TypeError("Missing required property 'repository'") __props__['repository'] = repository __props__['state'] = state - if title is None: + if title is None and not opts.urn: raise TypeError("Missing required property 'title'") __props__['title'] = title __props__['number'] = None diff --git a/sdk/python/pulumi_github/repository_project.py b/sdk/python/pulumi_github/repository_project.py index 64367c58..51b227ad 100644 --- a/sdk/python/pulumi_github/repository_project.py +++ b/sdk/python/pulumi_github/repository_project.py @@ -63,7 +63,7 @@ def __init__(__self__, __props__['body'] = body __props__['name'] = name - if repository is None: + if repository is None and not opts.urn: raise TypeError("Missing required property 'repository'") __props__['repository'] = repository __props__['etag'] = None diff --git a/sdk/python/pulumi_github/repository_webhook.py b/sdk/python/pulumi_github/repository_webhook.py index 3855be1b..b984f837 100644 --- a/sdk/python/pulumi_github/repository_webhook.py +++ b/sdk/python/pulumi_github/repository_webhook.py @@ -85,10 +85,10 @@ def __init__(__self__, __props__['active'] = active __props__['configuration'] = configuration - if events is None: + if events is None and not opts.urn: raise TypeError("Missing required property 'events'") __props__['events'] = events - if repository is None: + if repository is None and not opts.urn: raise TypeError("Missing required property 'repository'") __props__['repository'] = repository __props__['etag'] = None diff --git a/sdk/python/pulumi_github/team_membership.py b/sdk/python/pulumi_github/team_membership.py index 204bdfb3..9a09a99d 100644 --- a/sdk/python/pulumi_github/team_membership.py +++ b/sdk/python/pulumi_github/team_membership.py @@ -79,10 +79,10 @@ def __init__(__self__, __props__ = dict() __props__['role'] = role - if team_id is None: + if team_id is None and not opts.urn: raise TypeError("Missing required property 'team_id'") __props__['team_id'] = team_id - if username is None: + if username is None and not opts.urn: raise TypeError("Missing required property 'username'") __props__['username'] = username __props__['etag'] = None diff --git a/sdk/python/pulumi_github/team_repository.py b/sdk/python/pulumi_github/team_repository.py index 0aaba997..a084a4e2 100644 --- a/sdk/python/pulumi_github/team_repository.py +++ b/sdk/python/pulumi_github/team_repository.py @@ -80,10 +80,10 @@ def __init__(__self__, __props__ = dict() __props__['permission'] = permission - if repository is None: + if repository is None and not opts.urn: raise TypeError("Missing required property 'repository'") __props__['repository'] = repository - if team_id is None: + if team_id is None and not opts.urn: raise TypeError("Missing required property 'team_id'") __props__['team_id'] = team_id __props__['etag'] = None diff --git a/sdk/python/pulumi_github/team_sync_group_mapping.py b/sdk/python/pulumi_github/team_sync_group_mapping.py index 0d64e473..c4c285fe 100644 --- a/sdk/python/pulumi_github/team_sync_group_mapping.py +++ b/sdk/python/pulumi_github/team_sync_group_mapping.py @@ -61,7 +61,7 @@ def __init__(__self__, __props__ = dict() __props__['groups'] = groups - if team_slug is None: + if team_slug is None and not opts.urn: raise TypeError("Missing required property 'team_slug'") __props__['team_slug'] = team_slug __props__['etag'] = None diff --git a/sdk/python/pulumi_github/user_gpg_key.py b/sdk/python/pulumi_github/user_gpg_key.py index f620c05c..6d2fbf32 100644 --- a/sdk/python/pulumi_github/user_gpg_key.py +++ b/sdk/python/pulumi_github/user_gpg_key.py @@ -62,7 +62,7 @@ def __init__(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() - if armored_public_key is None: + if armored_public_key is None and not opts.urn: raise TypeError("Missing required property 'armored_public_key'") __props__['armored_public_key'] = armored_public_key __props__['etag'] = None diff --git a/sdk/python/pulumi_github/user_invitation_accepter.py b/sdk/python/pulumi_github/user_invitation_accepter.py index bafd5ddc..ca205e3e 100644 --- a/sdk/python/pulumi_github/user_invitation_accepter.py +++ b/sdk/python/pulumi_github/user_invitation_accepter.py @@ -36,7 +36,7 @@ def __init__(__self__, username="example-username") invitee = pulumi.providers.Github("invitee", token=var["invitee_token"]) example_user_invitation_accepter = github.UserInvitationAccepter("exampleUserInvitationAccepter", invitation_id=example_repository_collaborator.invitation_id, - opts=ResourceOptions(provider="github.invitee")) + opts=pulumi.ResourceOptions(provider="github.invitee")) ``` :param str resource_name: The name of the resource. @@ -60,7 +60,7 @@ def __init__(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() - if invitation_id is None: + if invitation_id is None and not opts.urn: raise TypeError("Missing required property 'invitation_id'") __props__['invitation_id'] = invitation_id super(UserInvitationAccepter, __self__).__init__( diff --git a/sdk/python/pulumi_github/user_ssh_key.py b/sdk/python/pulumi_github/user_ssh_key.py index 5f69d7aa..2dfd1469 100644 --- a/sdk/python/pulumi_github/user_ssh_key.py +++ b/sdk/python/pulumi_github/user_ssh_key.py @@ -66,10 +66,10 @@ def __init__(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = dict() - if key is None: + if key is None and not opts.urn: raise TypeError("Missing required property 'key'") __props__['key'] = key - if title is None: + if title is None and not opts.urn: raise TypeError("Missing required property 'title'") __props__['title'] = title __props__['etag'] = None diff --git a/sdk/python/setup.py b/sdk/python/setup.py index 9222b2a5..77e9ecac 100644 --- a/sdk/python/setup.py +++ b/sdk/python/setup.py @@ -53,7 +53,7 @@ def readme(): }, install_requires=[ 'parver>=0.2.1', - 'pulumi>=2.9.0,<3.0.0', + 'pulumi>=2.15.0,<3.0.0', 'semver>=2.8.1' ], zip_safe=False)