diff --git a/provider/cmd/pulumi-resource-github/bridge-metadata.json b/provider/cmd/pulumi-resource-github/bridge-metadata.json index b1023d48..786ffce6 100644 --- a/provider/cmd/pulumi-resource-github/bridge-metadata.json +++ b/provider/cmd/pulumi-resource-github/bridge-metadata.json @@ -221,6 +221,25 @@ } } }, + "github_codespaces_organization_secret": { + "current": "github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret", + "fields": { + "selected_repository_ids": { + "maxItemsOne": false + } + } + }, + "github_codespaces_secret": { + "current": "github:index/codespacesSecret:CodespacesSecret" + }, + "github_codespaces_user_secret": { + "current": "github:index/codespacesUserSecret:CodespacesUserSecret", + "fields": { + "selected_repository_ids": { + "maxItemsOne": false + } + } + }, "github_dependabot_organization_secret": { "current": "github:index/dependabotOrganizationSecret:DependabotOrganizationSecret", "fields": { @@ -271,6 +290,14 @@ "github_organization_block": { "current": "github:index/organizationBlock:OrganizationBlock" }, + "github_organization_custom_role": { + "current": "github:index/organizationCustomRole:OrganizationCustomRole", + "fields": { + "permissions": { + "maxItemsOne": false + } + } + }, "github_organization_project": { "current": "github:index/organizationProject:OrganizationProject" }, @@ -457,13 +484,28 @@ }, "datasources": { "github_actions_environment_secrets": { - "current": "github:index/getActionsEnvironmentSecrets:getActionsEnvironmentSecrets" + "current": "github:index/getActionsEnvironmentSecrets:getActionsEnvironmentSecrets", + "fields": { + "secrets": { + "maxItemsOne": false + } + } }, "github_actions_environment_variables": { - "current": "github:index/getActionsEnvironmentVariables:getActionsEnvironmentVariables" + "current": "github:index/getActionsEnvironmentVariables:getActionsEnvironmentVariables", + "fields": { + "variables": { + "maxItemsOne": false + } + } }, "github_actions_organization_oidc_subject_claim_customization_template": { - "current": "github:index/getActionsOrganizationOidcSubjectClaimCustomizationTemplate:getActionsOrganizationOidcSubjectClaimCustomizationTemplate" + "current": "github:index/getActionsOrganizationOidcSubjectClaimCustomizationTemplate:getActionsOrganizationOidcSubjectClaimCustomizationTemplate", + "fields": { + "include_claim_keys": { + "maxItemsOne": false + } + } }, "github_actions_organization_public_key": { "current": "github:index/getActionsOrganizationPublicKey:getActionsOrganizationPublicKey" @@ -472,10 +514,20 @@ "current": "github:index/getActionsOrganizationRegistrationToken:getActionsOrganizationRegistrationToken" }, "github_actions_organization_secrets": { - "current": "github:index/getActionsOrganizationSecrets:getActionsOrganizationSecrets" + "current": "github:index/getActionsOrganizationSecrets:getActionsOrganizationSecrets", + "fields": { + "secrets": { + "maxItemsOne": false + } + } }, "github_actions_organization_variables": { - "current": "github:index/getActionsOrganizationVariables:getActionsOrganizationVariables" + "current": "github:index/getActionsOrganizationVariables:getActionsOrganizationVariables", + "fields": { + "variables": { + "maxItemsOne": false + } + } }, "github_actions_public_key": { "current": "github:index/getActionsPublicKey:getActionsPublicKey" @@ -484,13 +536,28 @@ "current": "github:index/getActionsRegistrationToken:getActionsRegistrationToken" }, "github_actions_repository_oidc_subject_claim_customization_template": { - "current": "github:index/getActionsRepositoryOidcSubjectClaimCustomizationTemplate:getActionsRepositoryOidcSubjectClaimCustomizationTemplate" + "current": "github:index/getActionsRepositoryOidcSubjectClaimCustomizationTemplate:getActionsRepositoryOidcSubjectClaimCustomizationTemplate", + "fields": { + "include_claim_keys": { + "maxItemsOne": false + } + } }, "github_actions_secrets": { - "current": "github:index/getActionsSecrets:getActionsSecrets" + "current": "github:index/getActionsSecrets:getActionsSecrets", + "fields": { + "secrets": { + "maxItemsOne": false + } + } }, "github_actions_variables": { - "current": "github:index/getActionsVariables:getActionsVariables" + "current": "github:index/getActionsVariables:getActionsVariables", + "fields": { + "variables": { + "maxItemsOne": false + } + } }, "github_app": { "current": "github:index/getGithubApp:getGithubApp" @@ -502,79 +569,324 @@ "current": "github:index/getBranch:getBranch" }, "github_branch_protection_rules": { - "current": "github:index/getBranchProtectionRules:getBranchProtectionRules" + "current": "github:index/getBranchProtectionRules:getBranchProtectionRules", + "fields": { + "rules": { + "maxItemsOne": false + } + } + }, + "github_codespaces_organization_public_key": { + "current": "github:index/getCodespacesOrganizationPublicKey:getCodespacesOrganizationPublicKey" + }, + "github_codespaces_organization_secrets": { + "current": "github:index/getCodespacesOrganizationSecrets:getCodespacesOrganizationSecrets", + "fields": { + "secrets": { + "maxItemsOne": false + } + } + }, + "github_codespaces_public_key": { + "current": "github:index/getCodespacesPublicKey:getCodespacesPublicKey" + }, + "github_codespaces_secrets": { + "current": "github:index/getCodespacesSecrets:getCodespacesSecrets", + "fields": { + "secrets": { + "maxItemsOne": false + } + } + }, + "github_codespaces_user_public_key": { + "current": "github:index/getCodespacesUserPublicKey:getCodespacesUserPublicKey" + }, + "github_codespaces_user_secrets": { + "current": "github:index/getCodespacesUserSecrets:getCodespacesUserSecrets", + "fields": { + "secrets": { + "maxItemsOne": false + } + } }, "github_collaborators": { - "current": "github:index/getCollaborators:getCollaborators" + "current": "github:index/getCollaborators:getCollaborators", + "fields": { + "collaborator": { + "maxItemsOne": false + } + } }, "github_dependabot_organization_public_key": { "current": "github:index/getDependabotOrganizationPublicKey:getDependabotOrganizationPublicKey" }, "github_dependabot_organization_secrets": { - "current": "github:index/getDependabotOrganizationSecrets:getDependabotOrganizationSecrets" + "current": "github:index/getDependabotOrganizationSecrets:getDependabotOrganizationSecrets", + "fields": { + "secrets": { + "maxItemsOne": false + } + } }, "github_dependabot_public_key": { "current": "github:index/getDependabotPublicKey:getDependabotPublicKey" }, "github_dependabot_secrets": { - "current": "github:index/getDependabotSecrets:getDependabotSecrets" + "current": "github:index/getDependabotSecrets:getDependabotSecrets", + "fields": { + "secrets": { + "maxItemsOne": false + } + } }, "github_enterprise": { "current": "github:index/getEnterprise:getEnterprise" }, "github_external_groups": { - "current": "github:index/getExternalGroups:getExternalGroups" + "current": "github:index/getExternalGroups:getExternalGroups", + "fields": { + "external_groups": { + "maxItemsOne": false + } + } }, "github_ip_ranges": { - "current": "github:index/getIpRanges:getIpRanges" + "current": "github:index/getIpRanges:getIpRanges", + "fields": { + "actions": { + "maxItemsOne": false + }, + "actions_ipv4": { + "maxItemsOne": false + }, + "actions_ipv6": { + "maxItemsOne": false + }, + "api": { + "maxItemsOne": false + }, + "api_ipv4": { + "maxItemsOne": false + }, + "api_ipv6": { + "maxItemsOne": false + }, + "dependabot": { + "maxItemsOne": false + }, + "dependabot_ipv4": { + "maxItemsOne": false + }, + "dependabot_ipv6": { + "maxItemsOne": false + }, + "git": { + "maxItemsOne": false + }, + "git_ipv4": { + "maxItemsOne": false + }, + "git_ipv6": { + "maxItemsOne": false + }, + "hooks": { + "maxItemsOne": false + }, + "hooks_ipv4": { + "maxItemsOne": false + }, + "hooks_ipv6": { + "maxItemsOne": false + }, + "importer": { + "maxItemsOne": false + }, + "importer_ipv4": { + "maxItemsOne": false + }, + "importer_ipv6": { + "maxItemsOne": false + }, + "pages": { + "maxItemsOne": false + }, + "pages_ipv4": { + "maxItemsOne": false + }, + "pages_ipv6": { + "maxItemsOne": false + }, + "web": { + "maxItemsOne": false + }, + "web_ipv4": { + "maxItemsOne": false + }, + "web_ipv6": { + "maxItemsOne": false + } + } }, "github_issue_labels": { - "current": "github:index/getIssueLabels:getIssueLabels" + "current": "github:index/getIssueLabels:getIssueLabels", + "fields": { + "labels": { + "maxItemsOne": false + } + } }, "github_membership": { "current": "github:index/getMembership:getMembership" }, "github_organization": { - "current": "github:index/getOrganization:getOrganization" + "current": "github:index/getOrganization:getOrganization", + "fields": { + "members": { + "maxItemsOne": false + }, + "repositories": { + "maxItemsOne": false + }, + "users": { + "maxItemsOne": false + } + } + }, + "github_organization_custom_role": { + "current": "github:index/getOrganizationCustomRole:getOrganizationCustomRole", + "fields": { + "permissions": { + "maxItemsOne": false + } + } }, "github_organization_ip_allow_list": { - "current": "github:index/getOrganizationIpAllowList:getOrganizationIpAllowList" + "current": "github:index/getOrganizationIpAllowList:getOrganizationIpAllowList", + "fields": { + "ip_allow_list": { + "maxItemsOne": false + } + } }, "github_organization_team_sync_groups": { - "current": "github:index/getOrganizationTeamSyncGroups:getOrganizationTeamSyncGroups" + "current": "github:index/getOrganizationTeamSyncGroups:getOrganizationTeamSyncGroups", + "fields": { + "groups": { + "maxItemsOne": false + } + } }, "github_organization_teams": { - "current": "github:index/getOrganizationTeams:getOrganizationTeams" + "current": "github:index/getOrganizationTeams:getOrganizationTeams", + "fields": { + "teams": { + "maxItemsOne": false, + "elem": { + "fields": { + "members": { + "maxItemsOne": false + }, + "repositories": { + "maxItemsOne": false + } + } + } + } + } }, "github_organization_webhooks": { - "current": "github:index/getOrganizationWebhooks:getOrganizationWebhooks" + "current": "github:index/getOrganizationWebhooks:getOrganizationWebhooks", + "fields": { + "webhooks": { + "maxItemsOne": false + } + } }, "github_ref": { "current": "github:index/getRef:getRef" }, "github_release": { - "current": "github:index/getRelease:getRelease" + "current": "github:index/getRelease:getRelease", + "fields": { + "assets": { + "maxItemsOne": false + } + } }, "github_repositories": { - "current": "github:index/getRepositories:getRepositories" + "current": "github:index/getRepositories:getRepositories", + "fields": { + "full_names": { + "maxItemsOne": false + }, + "names": { + "maxItemsOne": false + }, + "repo_ids": { + "maxItemsOne": false + } + } }, "github_repository": { - "current": "github:index/getRepository:getRepository" + "current": "github:index/getRepository:getRepository", + "fields": { + "pages": { + "maxItemsOne": false, + "elem": { + "fields": { + "source": { + "maxItemsOne": false + } + } + } + }, + "template": { + "maxItemsOne": true + }, + "topics": { + "maxItemsOne": false + } + } }, "github_repository_autolink_references": { - "current": "github:index/getRepositoryAutolinkReferences:getRepositoryAutolinkReferences" + "current": "github:index/getRepositoryAutolinkReferences:getRepositoryAutolinkReferences", + "fields": { + "autolink_references": { + "maxItemsOne": false + } + } }, "github_repository_branches": { - "current": "github:index/getRepositoryBranches:getRepositoryBranches" + "current": "github:index/getRepositoryBranches:getRepositoryBranches", + "fields": { + "branches": { + "maxItemsOne": false + } + } }, "github_repository_deploy_keys": { - "current": "github:index/getRepositoryDeployKeys:getRepositoryDeployKeys" + "current": "github:index/getRepositoryDeployKeys:getRepositoryDeployKeys", + "fields": { + "keys": { + "maxItemsOne": false + } + } }, "github_repository_deployment_branch_policies": { - "current": "github:index/getRepositoryDeploymentBranchPolicies:getRepositoryDeploymentBranchPolicies" + "current": "github:index/getRepositoryDeploymentBranchPolicies:getRepositoryDeploymentBranchPolicies", + "fields": { + "deployment_branch_policies": { + "maxItemsOne": false + } + } }, "github_repository_environments": { - "current": "github:index/getRepositoryEnvironments:getRepositoryEnvironments" + "current": "github:index/getRepositoryEnvironments:getRepositoryEnvironments", + "fields": { + "environments": { + "maxItemsOne": false + } + } }, "github_repository_file": { "current": "github:index/getRepositoryFile:getRepositoryFile" @@ -583,34 +895,107 @@ "current": "github:index/getRepositoryMilestone:getRepositoryMilestone" }, "github_repository_pull_request": { - "current": "github:index/getRepositoryPullRequest:getRepositoryPullRequest" + "current": "github:index/getRepositoryPullRequest:getRepositoryPullRequest", + "fields": { + "labels": { + "maxItemsOne": false + } + } }, "github_repository_pull_requests": { - "current": "github:index/getRepositoryPullRequests:getRepositoryPullRequests" + "current": "github:index/getRepositoryPullRequests:getRepositoryPullRequests", + "fields": { + "results": { + "maxItemsOne": false, + "elem": { + "fields": { + "labels": { + "maxItemsOne": false + } + } + } + } + } }, "github_repository_teams": { - "current": "github:index/getRepositoryTeams:getRepositoryTeams" + "current": "github:index/getRepositoryTeams:getRepositoryTeams", + "fields": { + "teams": { + "maxItemsOne": false + } + } }, "github_repository_webhooks": { - "current": "github:index/getRepositoryWebhooks:getRepositoryWebhooks" + "current": "github:index/getRepositoryWebhooks:getRepositoryWebhooks", + "fields": { + "webhooks": { + "maxItemsOne": false + } + } }, "github_rest_api": { "current": "github:index/getRestApi:getRestApi" }, "github_ssh_keys": { - "current": "github:index/getSshKeys:getSshKeys" + "current": "github:index/getSshKeys:getSshKeys", + "fields": { + "keys": { + "maxItemsOne": false + } + } }, "github_team": { - "current": "github:index/getTeam:getTeam" + "current": "github:index/getTeam:getTeam", + "fields": { + "members": { + "maxItemsOne": false + }, + "repositories": { + "maxItemsOne": false + }, + "repositories_detailed": { + "maxItemsOne": false + } + } }, "github_tree": { - "current": "github:index/getTree:getTree" + "current": "github:index/getTree:getTree", + "fields": { + "entries": { + "maxItemsOne": false + } + } }, "github_user": { - "current": "github:index/getUser:getUser" + "current": "github:index/getUser:getUser", + "fields": { + "gpg_keys": { + "maxItemsOne": false + }, + "ssh_keys": { + "maxItemsOne": false + } + } }, "github_users": { - "current": "github:index/getUsers:getUsers" + "current": "github:index/getUsers:getUsers", + "fields": { + "emails": { + "maxItemsOne": false + }, + "logins": { + "maxItemsOne": false + }, + "node_ids": { + "maxItemsOne": false + }, + "unknown_logins": { + "maxItemsOne": false + }, + "usernames": { + "maxItemsOne": false + } + } } } }, @@ -635,6 +1020,9 @@ "github:index/branchDefault:BranchDefault": "github_branch_default", "github:index/branchProtection:BranchProtection": "github_branch_protection", "github:index/branchProtectionV3:BranchProtectionV3": "github_branch_protection_v3", + "github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret": "github_codespaces_organization_secret", + "github:index/codespacesSecret:CodespacesSecret": "github_codespaces_secret", + "github:index/codespacesUserSecret:CodespacesUserSecret": "github_codespaces_user_secret", "github:index/dependabotOrganizationSecret:DependabotOrganizationSecret": "github_dependabot_organization_secret", "github:index/dependabotOrganizationSecretRepositories:DependabotOrganizationSecretRepositories": "github_dependabot_organization_secret_repositories", "github:index/dependabotSecret:DependabotSecret": "github_dependabot_secret", @@ -644,6 +1032,7 @@ "github:index/issueLabel:IssueLabel": "github_issue_label", "github:index/membership:Membership": "github_membership", "github:index/organizationBlock:OrganizationBlock": "github_organization_block", + "github:index/organizationCustomRole:OrganizationCustomRole": "github_organization_custom_role", "github:index/organizationProject:OrganizationProject": "github_organization_project", "github:index/organizationSecurityManager:OrganizationSecurityManager": "github_organization_security_manager", "github:index/organizationSettings:OrganizationSettings": "github_organization_settings", @@ -690,6 +1079,12 @@ "github:index/getAppToken:getAppToken": "github_app_token", "github:index/getBranch:getBranch": "github_branch", "github:index/getBranchProtectionRules:getBranchProtectionRules": "github_branch_protection_rules", + "github:index/getCodespacesOrganizationPublicKey:getCodespacesOrganizationPublicKey": "github_codespaces_organization_public_key", + "github:index/getCodespacesOrganizationSecrets:getCodespacesOrganizationSecrets": "github_codespaces_organization_secrets", + "github:index/getCodespacesPublicKey:getCodespacesPublicKey": "github_codespaces_public_key", + "github:index/getCodespacesSecrets:getCodespacesSecrets": "github_codespaces_secrets", + "github:index/getCodespacesUserPublicKey:getCodespacesUserPublicKey": "github_codespaces_user_public_key", + "github:index/getCodespacesUserSecrets:getCodespacesUserSecrets": "github_codespaces_user_secrets", "github:index/getCollaborators:getCollaborators": "github_collaborators", "github:index/getDependabotOrganizationPublicKey:getDependabotOrganizationPublicKey": "github_dependabot_organization_public_key", "github:index/getDependabotOrganizationSecrets:getDependabotOrganizationSecrets": "github_dependabot_organization_secrets", @@ -702,6 +1097,7 @@ "github:index/getIssueLabels:getIssueLabels": "github_issue_labels", "github:index/getMembership:getMembership": "github_membership", "github:index/getOrganization:getOrganization": "github_organization", + "github:index/getOrganizationCustomRole:getOrganizationCustomRole": "github_organization_custom_role", "github:index/getOrganizationIpAllowList:getOrganizationIpAllowList": "github_organization_ip_allow_list", "github:index/getOrganizationTeamSyncGroups:getOrganizationTeamSyncGroups": "github_organization_team_sync_groups", "github:index/getOrganizationTeams:getOrganizationTeams": "github_organization_teams", @@ -911,6 +1307,29 @@ "requiredPullRequestReviews": "required_pull_request_reviews", "requiredStatusChecks": "required_status_checks" }, + "github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret": { + "createdAt": "created_at", + "encryptedValue": "encrypted_value", + "plaintextValue": "plaintext_value", + "secretName": "secret_name", + "selectedRepositoryIds": "selected_repository_ids", + "updatedAt": "updated_at" + }, + "github:index/codespacesSecret:CodespacesSecret": { + "createdAt": "created_at", + "encryptedValue": "encrypted_value", + "plaintextValue": "plaintext_value", + "secretName": "secret_name", + "updatedAt": "updated_at" + }, + "github:index/codespacesUserSecret:CodespacesUserSecret": { + "createdAt": "created_at", + "encryptedValue": "encrypted_value", + "plaintextValue": "plaintext_value", + "secretName": "secret_name", + "selectedRepositoryIds": "selected_repository_ids", + "updatedAt": "updated_at" + }, "github:index/dependabotOrganizationSecret:DependabotOrganizationSecret": { "createdAt": "created_at", "encryptedValue": "encrypted_value", @@ -999,6 +1418,30 @@ "installationId": "installation_id", "pemFile": "pem_file" }, + "github:index/getCodespacesOrganizationPublicKey:getCodespacesOrganizationPublicKey": { + "keyId": "key_id" + }, + "github:index/getCodespacesOrganizationSecretsSecret:getCodespacesOrganizationSecretsSecret": { + "createdAt": "created_at", + "updatedAt": "updated_at" + }, + "github:index/getCodespacesPublicKey:getCodespacesPublicKey": { + "keyId": "key_id" + }, + "github:index/getCodespacesSecrets:getCodespacesSecrets": { + "fullName": "full_name" + }, + "github:index/getCodespacesSecretsSecret:getCodespacesSecretsSecret": { + "createdAt": "created_at", + "updatedAt": "updated_at" + }, + "github:index/getCodespacesUserPublicKey:getCodespacesUserPublicKey": { + "keyId": "key_id" + }, + "github:index/getCodespacesUserSecretsSecret:getCodespacesUserSecretsSecret": { + "createdAt": "created_at", + "updatedAt": "updated_at" + }, "github:index/getCollaborators:getCollaborators": { "collaborators": "collaborator" }, @@ -1072,6 +1515,9 @@ "github:index/getOrganization:getOrganization": { "nodeId": "node_id" }, + "github:index/getOrganizationCustomRole:getOrganizationCustomRole": { + "baseRole": "base_role" + }, "github:index/getOrganizationIpAllowList:getOrganizationIpAllowList": { "ipAllowLists": "ip_allow_list" }, @@ -1251,6 +1697,9 @@ "issueId": "issue_id", "milestoneNumber": "milestone_number" }, + "github:index/organizationCustomRole:OrganizationCustomRole": { + "baseRole": "base_role" + }, "github:index/organizationSecurityManager:OrganizationSecurityManager": { "teamSlug": "team_slug" }, diff --git a/provider/cmd/pulumi-resource-github/schema.json b/provider/cmd/pulumi-resource-github/schema.json index d87d2b67..1ab3f5c8 100644 --- a/provider/cmd/pulumi-resource-github/schema.json +++ b/provider/cmd/pulumi-resource-github/schema.json @@ -887,6 +887,97 @@ } } }, + "github:index/getCodespacesOrganizationSecretsSecret:getCodespacesOrganizationSecretsSecret": { + "properties": { + "createdAt": { + "type": "string", + "description": "Timestamp of the secret creation\n" + }, + "name": { + "type": "string", + "description": "Secret name\n" + }, + "updatedAt": { + "type": "string", + "description": "Timestamp of the secret last update\n" + }, + "visibility": { + "type": "string", + "description": "Secret visibility\n" + } + }, + "type": "object", + "required": [ + "createdAt", + "name", + "updatedAt", + "visibility" + ], + "language": { + "nodejs": { + "requiredInputs": [] + } + } + }, + "github:index/getCodespacesSecretsSecret:getCodespacesSecretsSecret": { + "properties": { + "createdAt": { + "type": "string", + "description": "Timestamp of the secret creation\n" + }, + "name": { + "type": "string", + "description": "The name of the repository.\n" + }, + "updatedAt": { + "type": "string", + "description": "Timestamp of the secret last update\n" + } + }, + "type": "object", + "required": [ + "createdAt", + "name", + "updatedAt" + ], + "language": { + "nodejs": { + "requiredInputs": [] + } + } + }, + "github:index/getCodespacesUserSecretsSecret:getCodespacesUserSecretsSecret": { + "properties": { + "createdAt": { + "type": "string", + "description": "Timestamp of the secret creation\n" + }, + "name": { + "type": "string", + "description": "Secret name\n" + }, + "updatedAt": { + "type": "string", + "description": "Timestamp of the secret last update\n" + }, + "visibility": { + "type": "string", + "description": "Secret visibility\n" + } + }, + "type": "object", + "required": [ + "createdAt", + "name", + "updatedAt", + "visibility" + ], + "language": { + "nodejs": { + "requiredInputs": [] + } + } + }, "github:index/getCollaboratorsCollaborator:getCollaboratorsCollaborator": { "properties": { "eventsUrl": { @@ -3596,6 +3687,333 @@ "type": "object" } }, + "github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret": { + "description": "{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst exampleSecretCodespacesOrganizationSecret = new github.CodespacesOrganizationSecret(\"exampleSecretCodespacesOrganizationSecret\", {\n secretName: \"example_secret_name\",\n visibility: \"private\",\n plaintextValue: _var.some_secret_string,\n});\nconst exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new github.CodespacesOrganizationSecret(\"exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret\", {\n secretName: \"example_secret_name\",\n visibility: \"private\",\n encryptedValue: _var.some_encrypted_secret_string,\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret(\"exampleSecretCodespacesOrganizationSecret\",\n secret_name=\"example_secret_name\",\n visibility=\"private\",\n plaintext_value=var[\"some_secret_string\"])\nexample_secret_index_codespaces_organization_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret(\"exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret\",\n secret_name=\"example_secret_name\",\n visibility=\"private\",\n encrypted_value=var[\"some_encrypted_secret_string\"])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var exampleSecretCodespacesOrganizationSecret = new Github.CodespacesOrganizationSecret(\"exampleSecretCodespacesOrganizationSecret\", new()\n {\n SecretName = \"example_secret_name\",\n Visibility = \"private\",\n PlaintextValue = @var.Some_secret_string,\n });\n\n var exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new Github.CodespacesOrganizationSecret(\"exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret\", new()\n {\n SecretName = \"example_secret_name\",\n Visibility = \"private\",\n EncryptedValue = @var.Some_encrypted_secret_string,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.NewCodespacesOrganizationSecret(ctx, \"exampleSecretCodespacesOrganizationSecret\", \u0026github.CodespacesOrganizationSecretArgs{\n\t\t\tSecretName: pulumi.String(\"example_secret_name\"),\n\t\t\tVisibility: pulumi.String(\"private\"),\n\t\t\tPlaintextValue: pulumi.Any(_var.Some_secret_string),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewCodespacesOrganizationSecret(ctx, \"exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret\", \u0026github.CodespacesOrganizationSecretArgs{\n\t\t\tSecretName: pulumi.String(\"example_secret_name\"),\n\t\t\tVisibility: pulumi.String(\"private\"),\n\t\t\tEncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.CodespacesOrganizationSecret;\nimport com.pulumi.github.CodespacesOrganizationSecretArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var exampleSecretCodespacesOrganizationSecret = new CodespacesOrganizationSecret(\"exampleSecretCodespacesOrganizationSecret\", CodespacesOrganizationSecretArgs.builder() \n .secretName(\"example_secret_name\")\n .visibility(\"private\")\n .plaintextValue(var_.some_secret_string())\n .build());\n\n var exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new CodespacesOrganizationSecret(\"exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret\", CodespacesOrganizationSecretArgs.builder() \n .secretName(\"example_secret_name\")\n .visibility(\"private\")\n .encryptedValue(var_.some_encrypted_secret_string())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n exampleSecretCodespacesOrganizationSecret:\n type: github:CodespacesOrganizationSecret\n properties:\n secretName: example_secret_name\n visibility: private\n plaintextValue: ${var.some_secret_string}\n exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret:\n type: github:CodespacesOrganizationSecret\n properties:\n secretName: example_secret_name\n visibility: private\n encryptedValue: ${var.some_encrypted_secret_string}\n```\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst repo = github.getRepository({\n fullName: \"my-org/repo\",\n});\nconst exampleSecretCodespacesOrganizationSecret = new github.CodespacesOrganizationSecret(\"exampleSecretCodespacesOrganizationSecret\", {\n secretName: \"example_secret_name\",\n visibility: \"selected\",\n plaintextValue: _var.some_secret_string,\n selectedRepositoryIds: [repo.then(repo =\u003e repo.repoId)],\n});\nconst exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new github.CodespacesOrganizationSecret(\"exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret\", {\n secretName: \"example_secret_name\",\n visibility: \"selected\",\n encryptedValue: _var.some_encrypted_secret_string,\n selectedRepositoryIds: [repo.then(repo =\u003e repo.repoId)],\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nrepo = github.get_repository(full_name=\"my-org/repo\")\nexample_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret(\"exampleSecretCodespacesOrganizationSecret\",\n secret_name=\"example_secret_name\",\n visibility=\"selected\",\n plaintext_value=var[\"some_secret_string\"],\n selected_repository_ids=[repo.repo_id])\nexample_secret_index_codespaces_organization_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret(\"exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret\",\n secret_name=\"example_secret_name\",\n visibility=\"selected\",\n encrypted_value=var[\"some_encrypted_secret_string\"],\n selected_repository_ids=[repo.repo_id])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var repo = Github.GetRepository.Invoke(new()\n {\n FullName = \"my-org/repo\",\n });\n\n var exampleSecretCodespacesOrganizationSecret = new Github.CodespacesOrganizationSecret(\"exampleSecretCodespacesOrganizationSecret\", new()\n {\n SecretName = \"example_secret_name\",\n Visibility = \"selected\",\n PlaintextValue = @var.Some_secret_string,\n SelectedRepositoryIds = new[]\n {\n repo.Apply(getRepositoryResult =\u003e getRepositoryResult.RepoId),\n },\n });\n\n var exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new Github.CodespacesOrganizationSecret(\"exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret\", new()\n {\n SecretName = \"example_secret_name\",\n Visibility = \"selected\",\n EncryptedValue = @var.Some_encrypted_secret_string,\n SelectedRepositoryIds = new[]\n {\n repo.Apply(getRepositoryResult =\u003e getRepositoryResult.RepoId),\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\trepo, err := github.LookupRepository(ctx, \u0026github.LookupRepositoryArgs{\n\t\t\tFullName: pulumi.StringRef(\"my-org/repo\"),\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewCodespacesOrganizationSecret(ctx, \"exampleSecretCodespacesOrganizationSecret\", \u0026github.CodespacesOrganizationSecretArgs{\n\t\t\tSecretName: pulumi.String(\"example_secret_name\"),\n\t\t\tVisibility: pulumi.String(\"selected\"),\n\t\t\tPlaintextValue: pulumi.Any(_var.Some_secret_string),\n\t\t\tSelectedRepositoryIds: pulumi.IntArray{\n\t\t\t\t*pulumi.Int(repo.RepoId),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewCodespacesOrganizationSecret(ctx, \"exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret\", \u0026github.CodespacesOrganizationSecretArgs{\n\t\t\tSecretName: pulumi.String(\"example_secret_name\"),\n\t\t\tVisibility: pulumi.String(\"selected\"),\n\t\t\tEncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string),\n\t\t\tSelectedRepositoryIds: pulumi.IntArray{\n\t\t\t\t*pulumi.Int(repo.RepoId),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport com.pulumi.github.inputs.GetRepositoryArgs;\nimport com.pulumi.github.CodespacesOrganizationSecret;\nimport com.pulumi.github.CodespacesOrganizationSecretArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var repo = GithubFunctions.getRepository(GetRepositoryArgs.builder()\n .fullName(\"my-org/repo\")\n .build());\n\n var exampleSecretCodespacesOrganizationSecret = new CodespacesOrganizationSecret(\"exampleSecretCodespacesOrganizationSecret\", CodespacesOrganizationSecretArgs.builder() \n .secretName(\"example_secret_name\")\n .visibility(\"selected\")\n .plaintextValue(var_.some_secret_string())\n .selectedRepositoryIds(repo.applyValue(getRepositoryResult -\u003e getRepositoryResult.repoId()))\n .build());\n\n var exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new CodespacesOrganizationSecret(\"exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret\", CodespacesOrganizationSecretArgs.builder() \n .secretName(\"example_secret_name\")\n .visibility(\"selected\")\n .encryptedValue(var_.some_encrypted_secret_string())\n .selectedRepositoryIds(repo.applyValue(getRepositoryResult -\u003e getRepositoryResult.repoId()))\n .build());\n\n }\n}\n```\n```yaml\nresources:\n exampleSecretCodespacesOrganizationSecret:\n type: github:CodespacesOrganizationSecret\n properties:\n secretName: example_secret_name\n visibility: selected\n plaintextValue: ${var.some_secret_string}\n selectedRepositoryIds:\n - ${repo.repoId}\n exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret:\n type: github:CodespacesOrganizationSecret\n properties:\n secretName: example_secret_name\n visibility: selected\n encryptedValue: ${var.some_encrypted_secret_string}\n selectedRepositoryIds:\n - ${repo.repoId}\nvariables:\n repo:\n fn::invoke:\n Function: github:getRepository\n Arguments:\n fullName: my-org/repo\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nThis resource can be imported using an ID made up of the secret name\n\n```sh\n $ pulumi import github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret test_secret test_secret_name\n```\n\n NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. ", + "properties": { + "createdAt": { + "type": "string", + "description": "Date of codespaces_secret creation.\n" + }, + "encryptedValue": { + "type": "string", + "description": "Encrypted value of the secret using the GitHub public key in Base64 format.\n", + "secret": true + }, + "plaintextValue": { + "type": "string", + "description": "Plaintext value of the secret to be encrypted\n", + "secret": true + }, + "secretName": { + "type": "string", + "description": "Name of the secret\n" + }, + "selectedRepositoryIds": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of repository ids that can access the organization secret.\n" + }, + "updatedAt": { + "type": "string", + "description": "Date of codespaces_secret update.\n" + }, + "visibility": { + "type": "string", + "description": "Configures the access that repositories have to the organization secret.\nMust be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`.\n" + } + }, + "required": [ + "createdAt", + "secretName", + "updatedAt", + "visibility" + ], + "inputProperties": { + "encryptedValue": { + "type": "string", + "description": "Encrypted value of the secret using the GitHub public key in Base64 format.\n", + "secret": true, + "willReplaceOnChanges": true + }, + "plaintextValue": { + "type": "string", + "description": "Plaintext value of the secret to be encrypted\n", + "secret": true, + "willReplaceOnChanges": true + }, + "secretName": { + "type": "string", + "description": "Name of the secret\n", + "willReplaceOnChanges": true + }, + "selectedRepositoryIds": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of repository ids that can access the organization secret.\n" + }, + "visibility": { + "type": "string", + "description": "Configures the access that repositories have to the organization secret.\nMust be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`.\n", + "willReplaceOnChanges": true + } + }, + "requiredInputs": [ + "secretName", + "visibility" + ], + "stateInputs": { + "description": "Input properties used for looking up and filtering CodespacesOrganizationSecret resources.\n", + "properties": { + "createdAt": { + "type": "string", + "description": "Date of codespaces_secret creation.\n" + }, + "encryptedValue": { + "type": "string", + "description": "Encrypted value of the secret using the GitHub public key in Base64 format.\n", + "secret": true, + "willReplaceOnChanges": true + }, + "plaintextValue": { + "type": "string", + "description": "Plaintext value of the secret to be encrypted\n", + "secret": true, + "willReplaceOnChanges": true + }, + "secretName": { + "type": "string", + "description": "Name of the secret\n", + "willReplaceOnChanges": true + }, + "selectedRepositoryIds": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of repository ids that can access the organization secret.\n" + }, + "updatedAt": { + "type": "string", + "description": "Date of codespaces_secret update.\n" + }, + "visibility": { + "type": "string", + "description": "Configures the access that repositories have to the organization secret.\nMust be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`.\n", + "willReplaceOnChanges": true + } + }, + "type": "object" + } + }, + "github:index/codespacesSecret:CodespacesSecret": { + "description": "{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst examplePublicKey = github.getCodespacesPublicKey({\n repository: \"example_repository\",\n});\nconst exampleSecretCodespacesSecret = new github.CodespacesSecret(\"exampleSecretCodespacesSecret\", {\n repository: \"example_repository\",\n secretName: \"example_secret_name\",\n plaintextValue: _var.some_secret_string,\n});\nconst exampleSecretIndex_codespacesSecretCodespacesSecret = new github.CodespacesSecret(\"exampleSecretIndex/codespacesSecretCodespacesSecret\", {\n repository: \"example_repository\",\n secretName: \"example_secret_name\",\n encryptedValue: _var.some_encrypted_secret_string,\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample_public_key = github.get_codespaces_public_key(repository=\"example_repository\")\nexample_secret_codespaces_secret = github.CodespacesSecret(\"exampleSecretCodespacesSecret\",\n repository=\"example_repository\",\n secret_name=\"example_secret_name\",\n plaintext_value=var[\"some_secret_string\"])\nexample_secret_index_codespaces_secret_codespaces_secret = github.CodespacesSecret(\"exampleSecretIndex/codespacesSecretCodespacesSecret\",\n repository=\"example_repository\",\n secret_name=\"example_secret_name\",\n encrypted_value=var[\"some_encrypted_secret_string\"])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var examplePublicKey = Github.GetCodespacesPublicKey.Invoke(new()\n {\n Repository = \"example_repository\",\n });\n\n var exampleSecretCodespacesSecret = new Github.CodespacesSecret(\"exampleSecretCodespacesSecret\", new()\n {\n Repository = \"example_repository\",\n SecretName = \"example_secret_name\",\n PlaintextValue = @var.Some_secret_string,\n });\n\n var exampleSecretIndex_codespacesSecretCodespacesSecret = new Github.CodespacesSecret(\"exampleSecretIndex/codespacesSecretCodespacesSecret\", new()\n {\n Repository = \"example_repository\",\n SecretName = \"example_secret_name\",\n EncryptedValue = @var.Some_encrypted_secret_string,\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.GetCodespacesPublicKey(ctx, \u0026github.GetCodespacesPublicKeyArgs{\n\t\t\tRepository: \"example_repository\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewCodespacesSecret(ctx, \"exampleSecretCodespacesSecret\", \u0026github.CodespacesSecretArgs{\n\t\t\tRepository: pulumi.String(\"example_repository\"),\n\t\t\tSecretName: pulumi.String(\"example_secret_name\"),\n\t\t\tPlaintextValue: pulumi.Any(_var.Some_secret_string),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewCodespacesSecret(ctx, \"exampleSecretIndex/codespacesSecretCodespacesSecret\", \u0026github.CodespacesSecretArgs{\n\t\t\tRepository: pulumi.String(\"example_repository\"),\n\t\t\tSecretName: pulumi.String(\"example_secret_name\"),\n\t\t\tEncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport com.pulumi.github.inputs.GetCodespacesPublicKeyArgs;\nimport com.pulumi.github.CodespacesSecret;\nimport com.pulumi.github.CodespacesSecretArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var examplePublicKey = GithubFunctions.getCodespacesPublicKey(GetCodespacesPublicKeyArgs.builder()\n .repository(\"example_repository\")\n .build());\n\n var exampleSecretCodespacesSecret = new CodespacesSecret(\"exampleSecretCodespacesSecret\", CodespacesSecretArgs.builder() \n .repository(\"example_repository\")\n .secretName(\"example_secret_name\")\n .plaintextValue(var_.some_secret_string())\n .build());\n\n var exampleSecretIndex_codespacesSecretCodespacesSecret = new CodespacesSecret(\"exampleSecretIndex/codespacesSecretCodespacesSecret\", CodespacesSecretArgs.builder() \n .repository(\"example_repository\")\n .secretName(\"example_secret_name\")\n .encryptedValue(var_.some_encrypted_secret_string())\n .build());\n\n }\n}\n```\n```yaml\nresources:\n exampleSecretCodespacesSecret:\n type: github:CodespacesSecret\n properties:\n repository: example_repository\n secretName: example_secret_name\n plaintextValue: ${var.some_secret_string}\n exampleSecretIndex/codespacesSecretCodespacesSecret:\n type: github:CodespacesSecret\n properties:\n repository: example_repository\n secretName: example_secret_name\n encryptedValue: ${var.some_encrypted_secret_string}\nvariables:\n examplePublicKey:\n fn::invoke:\n Function: github:getCodespacesPublicKey\n Arguments:\n repository: example_repository\n```\n{{% /example %}}\n{{% /examples %}}", + "properties": { + "createdAt": { + "type": "string", + "description": "Date of actions_secret creation.\n" + }, + "encryptedValue": { + "type": "string", + "description": "Encrypted value of the secret using the GitHub public key in Base64 format.\n", + "secret": true + }, + "plaintextValue": { + "type": "string", + "description": "Plaintext value of the secret to be encrypted\n", + "secret": true + }, + "repository": { + "type": "string", + "description": "Name of the repository\n" + }, + "secretName": { + "type": "string", + "description": "Name of the secret\n" + }, + "updatedAt": { + "type": "string", + "description": "Date of actions_secret update.\n" + } + }, + "required": [ + "createdAt", + "repository", + "secretName", + "updatedAt" + ], + "inputProperties": { + "encryptedValue": { + "type": "string", + "description": "Encrypted value of the secret using the GitHub public key in Base64 format.\n", + "secret": true, + "willReplaceOnChanges": true + }, + "plaintextValue": { + "type": "string", + "description": "Plaintext value of the secret to be encrypted\n", + "secret": true, + "willReplaceOnChanges": true + }, + "repository": { + "type": "string", + "description": "Name of the repository\n" + }, + "secretName": { + "type": "string", + "description": "Name of the secret\n", + "willReplaceOnChanges": true + } + }, + "requiredInputs": [ + "repository", + "secretName" + ], + "stateInputs": { + "description": "Input properties used for looking up and filtering CodespacesSecret resources.\n", + "properties": { + "createdAt": { + "type": "string", + "description": "Date of actions_secret creation.\n" + }, + "encryptedValue": { + "type": "string", + "description": "Encrypted value of the secret using the GitHub public key in Base64 format.\n", + "secret": true, + "willReplaceOnChanges": true + }, + "plaintextValue": { + "type": "string", + "description": "Plaintext value of the secret to be encrypted\n", + "secret": true, + "willReplaceOnChanges": true + }, + "repository": { + "type": "string", + "description": "Name of the repository\n" + }, + "secretName": { + "type": "string", + "description": "Name of the secret\n", + "willReplaceOnChanges": true + }, + "updatedAt": { + "type": "string", + "description": "Date of actions_secret update.\n" + } + }, + "type": "object" + } + }, + "github:index/codespacesUserSecret:CodespacesUserSecret": { + "description": "{{% examples %}}\n## Example Usage\n{{% example %}}\n\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as github from \"@pulumi/github\";\n\nconst repo = github.getRepository({\n fullName: \"my-org/repo\",\n});\nconst exampleSecretCodespacesUserSecret = new github.CodespacesUserSecret(\"exampleSecretCodespacesUserSecret\", {\n secretName: \"example_secret_name\",\n plaintextValue: _var.some_secret_string,\n selectedRepositoryIds: [repo.then(repo =\u003e repo.repoId)],\n});\nconst exampleSecretIndex_codespacesUserSecretCodespacesUserSecret = new github.CodespacesUserSecret(\"exampleSecretIndex/codespacesUserSecretCodespacesUserSecret\", {\n secretName: \"example_secret_name\",\n encryptedValue: _var.some_encrypted_secret_string,\n selectedRepositoryIds: [repo.then(repo =\u003e repo.repoId)],\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nrepo = github.get_repository(full_name=\"my-org/repo\")\nexample_secret_codespaces_user_secret = github.CodespacesUserSecret(\"exampleSecretCodespacesUserSecret\",\n secret_name=\"example_secret_name\",\n plaintext_value=var[\"some_secret_string\"],\n selected_repository_ids=[repo.repo_id])\nexample_secret_index_codespaces_user_secret_codespaces_user_secret = github.CodespacesUserSecret(\"exampleSecretIndex/codespacesUserSecretCodespacesUserSecret\",\n secret_name=\"example_secret_name\",\n encrypted_value=var[\"some_encrypted_secret_string\"],\n selected_repository_ids=[repo.repo_id])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var repo = Github.GetRepository.Invoke(new()\n {\n FullName = \"my-org/repo\",\n });\n\n var exampleSecretCodespacesUserSecret = new Github.CodespacesUserSecret(\"exampleSecretCodespacesUserSecret\", new()\n {\n SecretName = \"example_secret_name\",\n PlaintextValue = @var.Some_secret_string,\n SelectedRepositoryIds = new[]\n {\n repo.Apply(getRepositoryResult =\u003e getRepositoryResult.RepoId),\n },\n });\n\n var exampleSecretIndex_codespacesUserSecretCodespacesUserSecret = new Github.CodespacesUserSecret(\"exampleSecretIndex/codespacesUserSecretCodespacesUserSecret\", new()\n {\n SecretName = \"example_secret_name\",\n EncryptedValue = @var.Some_encrypted_secret_string,\n SelectedRepositoryIds = new[]\n {\n repo.Apply(getRepositoryResult =\u003e getRepositoryResult.RepoId),\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\trepo, err := github.LookupRepository(ctx, \u0026github.LookupRepositoryArgs{\n\t\t\tFullName: pulumi.StringRef(\"my-org/repo\"),\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewCodespacesUserSecret(ctx, \"exampleSecretCodespacesUserSecret\", \u0026github.CodespacesUserSecretArgs{\n\t\t\tSecretName: pulumi.String(\"example_secret_name\"),\n\t\t\tPlaintextValue: pulumi.Any(_var.Some_secret_string),\n\t\t\tSelectedRepositoryIds: pulumi.IntArray{\n\t\t\t\t*pulumi.Int(repo.RepoId),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.NewCodespacesUserSecret(ctx, \"exampleSecretIndex/codespacesUserSecretCodespacesUserSecret\", \u0026github.CodespacesUserSecretArgs{\n\t\t\tSecretName: pulumi.String(\"example_secret_name\"),\n\t\t\tEncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string),\n\t\t\tSelectedRepositoryIds: pulumi.IntArray{\n\t\t\t\t*pulumi.Int(repo.RepoId),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport com.pulumi.github.inputs.GetRepositoryArgs;\nimport com.pulumi.github.CodespacesUserSecret;\nimport com.pulumi.github.CodespacesUserSecretArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var repo = GithubFunctions.getRepository(GetRepositoryArgs.builder()\n .fullName(\"my-org/repo\")\n .build());\n\n var exampleSecretCodespacesUserSecret = new CodespacesUserSecret(\"exampleSecretCodespacesUserSecret\", CodespacesUserSecretArgs.builder() \n .secretName(\"example_secret_name\")\n .plaintextValue(var_.some_secret_string())\n .selectedRepositoryIds(repo.applyValue(getRepositoryResult -\u003e getRepositoryResult.repoId()))\n .build());\n\n var exampleSecretIndex_codespacesUserSecretCodespacesUserSecret = new CodespacesUserSecret(\"exampleSecretIndex/codespacesUserSecretCodespacesUserSecret\", CodespacesUserSecretArgs.builder() \n .secretName(\"example_secret_name\")\n .encryptedValue(var_.some_encrypted_secret_string())\n .selectedRepositoryIds(repo.applyValue(getRepositoryResult -\u003e getRepositoryResult.repoId()))\n .build());\n\n }\n}\n```\n```yaml\nresources:\n exampleSecretCodespacesUserSecret:\n type: github:CodespacesUserSecret\n properties:\n secretName: example_secret_name\n plaintextValue: ${var.some_secret_string}\n selectedRepositoryIds:\n - ${repo.repoId}\n exampleSecretIndex/codespacesUserSecretCodespacesUserSecret:\n type: github:CodespacesUserSecret\n properties:\n secretName: example_secret_name\n encryptedValue: ${var.some_encrypted_secret_string}\n selectedRepositoryIds:\n - ${repo.repoId}\nvariables:\n repo:\n fn::invoke:\n Function: github:getRepository\n Arguments:\n fullName: my-org/repo\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nThis resource can be imported using an ID made up of the secret name\n\n```sh\n $ pulumi import github:index/codespacesUserSecret:CodespacesUserSecret test_secret test_secret_name\n```\n\n NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. ", + "properties": { + "createdAt": { + "type": "string", + "description": "Date of codespaces_secret creation.\n" + }, + "encryptedValue": { + "type": "string", + "description": "Encrypted value of the secret using the GitHub public key in Base64 format.\n", + "secret": true + }, + "plaintextValue": { + "type": "string", + "description": "Plaintext value of the secret to be encrypted\n", + "secret": true + }, + "secretName": { + "type": "string", + "description": "Name of the secret\n" + }, + "selectedRepositoryIds": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of repository ids that can access the user secret.\n" + }, + "updatedAt": { + "type": "string", + "description": "Date of codespaces_secret update.\n" + } + }, + "required": [ + "createdAt", + "secretName", + "updatedAt" + ], + "inputProperties": { + "encryptedValue": { + "type": "string", + "description": "Encrypted value of the secret using the GitHub public key in Base64 format.\n", + "secret": true, + "willReplaceOnChanges": true + }, + "plaintextValue": { + "type": "string", + "description": "Plaintext value of the secret to be encrypted\n", + "secret": true, + "willReplaceOnChanges": true + }, + "secretName": { + "type": "string", + "description": "Name of the secret\n", + "willReplaceOnChanges": true + }, + "selectedRepositoryIds": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of repository ids that can access the user secret.\n" + } + }, + "requiredInputs": [ + "secretName" + ], + "stateInputs": { + "description": "Input properties used for looking up and filtering CodespacesUserSecret resources.\n", + "properties": { + "createdAt": { + "type": "string", + "description": "Date of codespaces_secret creation.\n" + }, + "encryptedValue": { + "type": "string", + "description": "Encrypted value of the secret using the GitHub public key in Base64 format.\n", + "secret": true, + "willReplaceOnChanges": true + }, + "plaintextValue": { + "type": "string", + "description": "Plaintext value of the secret to be encrypted\n", + "secret": true, + "willReplaceOnChanges": true + }, + "secretName": { + "type": "string", + "description": "Name of the secret\n", + "willReplaceOnChanges": true + }, + "selectedRepositoryIds": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of repository ids that can access the user secret.\n" + }, + "updatedAt": { + "type": "string", + "description": "Date of codespaces_secret update.\n" + } + }, + "type": "object" + } + }, "github:index/dependabotOrganizationSecret:DependabotOrganizationSecret": { "properties": { "createdAt": { @@ -4297,41 +4715,120 @@ "type": "object" } }, - "github:index/organizationBlock:OrganizationBlock": { - "description": "This resource allows you to create and manage blocks for GitHub organizations.\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 example = new github.OrganizationBlock(\"example\", {username: \"paultyng\"});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample = github.OrganizationBlock(\"example\", username=\"paultyng\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = new Github.OrganizationBlock(\"example\", new()\n {\n Username = \"paultyng\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.NewOrganizationBlock(ctx, \"example\", \u0026github.OrganizationBlockArgs{\n\t\t\tUsername: pulumi.String(\"paultyng\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.OrganizationBlock;\nimport com.pulumi.github.OrganizationBlockArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var example = new OrganizationBlock(\"example\", OrganizationBlockArgs.builder() \n .username(\"paultyng\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n example:\n type: github:OrganizationBlock\n properties:\n username: paultyng\n```\n{{% /example %}}\n{{% /examples %}}", + "github:index/organizationBlock:OrganizationBlock": { + "description": "This resource allows you to create and manage blocks for GitHub organizations.\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 example = new github.OrganizationBlock(\"example\", {username: \"paultyng\"});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample = github.OrganizationBlock(\"example\", username=\"paultyng\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = new Github.OrganizationBlock(\"example\", new()\n {\n Username = \"paultyng\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.NewOrganizationBlock(ctx, \"example\", \u0026github.OrganizationBlockArgs{\n\t\t\tUsername: pulumi.String(\"paultyng\"),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.OrganizationBlock;\nimport com.pulumi.github.OrganizationBlockArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var example = new OrganizationBlock(\"example\", OrganizationBlockArgs.builder() \n .username(\"paultyng\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n example:\n type: github:OrganizationBlock\n properties:\n username: paultyng\n```\n{{% /example %}}\n{{% /examples %}}", + "properties": { + "etag": { + "type": "string" + }, + "username": { + "type": "string", + "description": "The name of the user to block.\n" + } + }, + "required": [ + "etag", + "username" + ], + "inputProperties": { + "username": { + "type": "string", + "description": "The name of the user to block.\n", + "willReplaceOnChanges": true + } + }, + "requiredInputs": [ + "username" + ], + "stateInputs": { + "description": "Input properties used for looking up and filtering OrganizationBlock resources.\n", + "properties": { + "etag": { + "type": "string" + }, + "username": { + "type": "string", + "description": "The name of the user to block.\n", + "willReplaceOnChanges": true + } + }, + "type": "object" + } + }, + "github:index/organizationCustomRole:OrganizationCustomRole": { + "description": "This resource allows you to create and manage custom roles in a GitHub Organization for use in repositories. \n\n\u003e Note: Custom roles are currently only available in GitHub Enterprise Cloud.\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 example = new github.OrganizationCustomRole(\"example\", {\n baseRole: \"read\",\n description: \"Example custom role that uses the read role as its base\",\n permissions: [\n \"add_assignee\",\n \"add_label\",\n \"bypass_branch_protection\",\n \"close_issue\",\n \"close_pull_request\",\n \"mark_as_duplicate\",\n \"create_tag\",\n \"delete_issue\",\n \"delete_tag\",\n \"manage_deploy_keys\",\n \"push_protected_branch\",\n \"read_code_scanning\",\n \"reopen_issue\",\n \"reopen_pull_request\",\n \"request_pr_review\",\n \"resolve_dependabot_alerts\",\n \"resolve_secret_scanning_alerts\",\n \"view_secret_scanning_alerts\",\n \"write_code_scanning\",\n ],\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample = github.OrganizationCustomRole(\"example\",\n base_role=\"read\",\n description=\"Example custom role that uses the read role as its base\",\n permissions=[\n \"add_assignee\",\n \"add_label\",\n \"bypass_branch_protection\",\n \"close_issue\",\n \"close_pull_request\",\n \"mark_as_duplicate\",\n \"create_tag\",\n \"delete_issue\",\n \"delete_tag\",\n \"manage_deploy_keys\",\n \"push_protected_branch\",\n \"read_code_scanning\",\n \"reopen_issue\",\n \"reopen_pull_request\",\n \"request_pr_review\",\n \"resolve_dependabot_alerts\",\n \"resolve_secret_scanning_alerts\",\n \"view_secret_scanning_alerts\",\n \"write_code_scanning\",\n ])\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = new Github.OrganizationCustomRole(\"example\", new()\n {\n BaseRole = \"read\",\n Description = \"Example custom role that uses the read role as its base\",\n Permissions = new[]\n {\n \"add_assignee\",\n \"add_label\",\n \"bypass_branch_protection\",\n \"close_issue\",\n \"close_pull_request\",\n \"mark_as_duplicate\",\n \"create_tag\",\n \"delete_issue\",\n \"delete_tag\",\n \"manage_deploy_keys\",\n \"push_protected_branch\",\n \"read_code_scanning\",\n \"reopen_issue\",\n \"reopen_pull_request\",\n \"request_pr_review\",\n \"resolve_dependabot_alerts\",\n \"resolve_secret_scanning_alerts\",\n \"view_secret_scanning_alerts\",\n \"write_code_scanning\",\n },\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.NewOrganizationCustomRole(ctx, \"example\", \u0026github.OrganizationCustomRoleArgs{\n\t\t\tBaseRole: pulumi.String(\"read\"),\n\t\t\tDescription: pulumi.String(\"Example custom role that uses the read role as its base\"),\n\t\t\tPermissions: pulumi.StringArray{\n\t\t\t\tpulumi.String(\"add_assignee\"),\n\t\t\t\tpulumi.String(\"add_label\"),\n\t\t\t\tpulumi.String(\"bypass_branch_protection\"),\n\t\t\t\tpulumi.String(\"close_issue\"),\n\t\t\t\tpulumi.String(\"close_pull_request\"),\n\t\t\t\tpulumi.String(\"mark_as_duplicate\"),\n\t\t\t\tpulumi.String(\"create_tag\"),\n\t\t\t\tpulumi.String(\"delete_issue\"),\n\t\t\t\tpulumi.String(\"delete_tag\"),\n\t\t\t\tpulumi.String(\"manage_deploy_keys\"),\n\t\t\t\tpulumi.String(\"push_protected_branch\"),\n\t\t\t\tpulumi.String(\"read_code_scanning\"),\n\t\t\t\tpulumi.String(\"reopen_issue\"),\n\t\t\t\tpulumi.String(\"reopen_pull_request\"),\n\t\t\t\tpulumi.String(\"request_pr_review\"),\n\t\t\t\tpulumi.String(\"resolve_dependabot_alerts\"),\n\t\t\t\tpulumi.String(\"resolve_secret_scanning_alerts\"),\n\t\t\t\tpulumi.String(\"view_secret_scanning_alerts\"),\n\t\t\t\tpulumi.String(\"write_code_scanning\"),\n\t\t\t},\n\t\t})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.OrganizationCustomRole;\nimport com.pulumi.github.OrganizationCustomRoleArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n var example = new OrganizationCustomRole(\"example\", OrganizationCustomRoleArgs.builder() \n .baseRole(\"read\")\n .description(\"Example custom role that uses the read role as its base\")\n .permissions( \n \"add_assignee\",\n \"add_label\",\n \"bypass_branch_protection\",\n \"close_issue\",\n \"close_pull_request\",\n \"mark_as_duplicate\",\n \"create_tag\",\n \"delete_issue\",\n \"delete_tag\",\n \"manage_deploy_keys\",\n \"push_protected_branch\",\n \"read_code_scanning\",\n \"reopen_issue\",\n \"reopen_pull_request\",\n \"request_pr_review\",\n \"resolve_dependabot_alerts\",\n \"resolve_secret_scanning_alerts\",\n \"view_secret_scanning_alerts\",\n \"write_code_scanning\")\n .build());\n\n }\n}\n```\n```yaml\nresources:\n example:\n type: github:OrganizationCustomRole\n properties:\n baseRole: read\n description: Example custom role that uses the read role as its base\n permissions:\n - add_assignee\n - add_label\n - bypass_branch_protection\n - close_issue\n - close_pull_request\n - mark_as_duplicate\n - create_tag\n - delete_issue\n - delete_tag\n - manage_deploy_keys\n - push_protected_branch\n - read_code_scanning\n - reopen_issue\n - reopen_pull_request\n - request_pr_review\n - resolve_dependabot_alerts\n - resolve_secret_scanning_alerts\n - view_secret_scanning_alerts\n - write_code_scanning\n```\n{{% /example %}}\n{{% /examples %}}\n\n## Import\n\nCustom roles can be imported using the `id` of the role. The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API.\n\n```sh\n $ pulumi import github:index/organizationCustomRole:OrganizationCustomRole example 1234\n```\n\n ", "properties": { - "etag": { - "type": "string" + "baseRole": { + "type": "string", + "description": "The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`.\n" }, - "username": { + "description": { "type": "string", - "description": "The name of the user to block.\n" + "description": "The description for the custom role.\n" + }, + "name": { + "type": "string", + "description": "The name of the custom role.\n" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API.\n" } }, "required": [ - "etag", - "username" + "baseRole", + "name", + "permissions" ], "inputProperties": { - "username": { + "baseRole": { "type": "string", - "description": "The name of the user to block.\n", - "willReplaceOnChanges": true + "description": "The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`.\n" + }, + "description": { + "type": "string", + "description": "The description for the custom role.\n" + }, + "name": { + "type": "string", + "description": "The name of the custom role.\n" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API.\n" } }, "requiredInputs": [ - "username" + "baseRole", + "permissions" ], "stateInputs": { - "description": "Input properties used for looking up and filtering OrganizationBlock resources.\n", + "description": "Input properties used for looking up and filtering OrganizationCustomRole resources.\n", "properties": { - "etag": { - "type": "string" + "baseRole": { + "type": "string", + "description": "The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`.\n" }, - "username": { + "description": { "type": "string", - "description": "The name of the user to block.\n", - "willReplaceOnChanges": true + "description": "The description for the custom role.\n" + }, + "name": { + "type": "string", + "description": "The name of the custom role.\n" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API.\n" } }, "type": "object" @@ -8086,6 +8583,196 @@ ] } }, + "github:index/getCodespacesOrganizationPublicKey:getCodespacesOrganizationPublicKey": { + "description": "Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions.\nNote that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key.\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 example = github.getCodespacesOrganizationPublicKey({});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample = github.get_codespaces_organization_public_key()\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = Github.GetCodespacesOrganizationPublicKey.Invoke();\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.GetCodespacesOrganizationPublicKey(ctx, nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var example = GithubFunctions.getCodespacesOrganizationPublicKey();\n\n }\n}\n```\n```yaml\nvariables:\n example:\n fn::invoke:\n Function: github:getCodespacesOrganizationPublicKey\n Arguments: {}\n```\n{{% /example %}}\n{{% /examples %}}", + "outputs": { + "description": "A collection of values returned by getCodespacesOrganizationPublicKey.\n", + "properties": { + "id": { + "type": "string", + "description": "The provider-assigned unique ID for this managed resource.\n" + }, + "key": { + "type": "string", + "description": "Actual key retrieved.\n" + }, + "keyId": { + "type": "string", + "description": "ID of the key that has been retrieved.\n" + } + }, + "type": "object", + "required": [ + "key", + "keyId", + "id" + ] + } + }, + "github:index/getCodespacesOrganizationSecrets:getCodespacesOrganizationSecrets": { + "description": "Use this data source to retrieve the list of codespaces secrets of the organization.\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 example = github.getCodespacesOrganizationSecrets({});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample = github.get_codespaces_organization_secrets()\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = Github.GetCodespacesOrganizationSecrets.Invoke();\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.GetCodespacesOrganizationSecrets(ctx, nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var example = GithubFunctions.getCodespacesOrganizationSecrets();\n\n }\n}\n```\n```yaml\nvariables:\n example:\n fn::invoke:\n Function: github:getCodespacesOrganizationSecrets\n Arguments: {}\n```\n{{% /example %}}\n{{% /examples %}}", + "outputs": { + "description": "A collection of values returned by getCodespacesOrganizationSecrets.\n", + "properties": { + "id": { + "type": "string", + "description": "The provider-assigned unique ID for this managed resource.\n" + }, + "secrets": { + "type": "array", + "items": { + "$ref": "#/types/github:index/getCodespacesOrganizationSecretsSecret:getCodespacesOrganizationSecretsSecret" + }, + "description": "list of secrets for the repository\n" + } + }, + "type": "object", + "required": [ + "secrets", + "id" + ] + } + }, + "github:index/getCodespacesPublicKey:getCodespacesPublicKey": { + "description": "Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions.\nNote that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key.\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 example = github.getCodespacesPublicKey({\n repository: \"example_repo\",\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample = github.get_codespaces_public_key(repository=\"example_repo\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = Github.GetCodespacesPublicKey.Invoke(new()\n {\n Repository = \"example_repo\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.GetCodespacesPublicKey(ctx, \u0026github.GetCodespacesPublicKeyArgs{\n\t\t\tRepository: \"example_repo\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport com.pulumi.github.inputs.GetCodespacesPublicKeyArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var example = GithubFunctions.getCodespacesPublicKey(GetCodespacesPublicKeyArgs.builder()\n .repository(\"example_repo\")\n .build());\n\n }\n}\n```\n```yaml\nvariables:\n example:\n fn::invoke:\n Function: github:getCodespacesPublicKey\n Arguments:\n repository: example_repo\n```\n{{% /example %}}\n{{% /examples %}}", + "inputs": { + "description": "A collection of arguments for invoking getCodespacesPublicKey.\n", + "properties": { + "repository": { + "type": "string", + "description": "Name of the repository to get public key from.\n" + } + }, + "type": "object", + "required": [ + "repository" + ] + }, + "outputs": { + "description": "A collection of values returned by getCodespacesPublicKey.\n", + "properties": { + "id": { + "type": "string", + "description": "The provider-assigned unique ID for this managed resource.\n" + }, + "key": { + "type": "string", + "description": "Actual key retrieved.\n" + }, + "keyId": { + "type": "string", + "description": "ID of the key that has been retrieved.\n" + }, + "repository": { + "type": "string" + } + }, + "type": "object", + "required": [ + "key", + "keyId", + "repository", + "id" + ] + } + }, + "github:index/getCodespacesSecrets:getCodespacesSecrets": { + "description": "Use this data source to retrieve the list of codespaces secrets for a GitHub repository.\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 example = github.getCodespacesSecrets({\n name: \"example_repository\",\n});\nconst example2 = github.getCodespacesSecrets({\n fullName: \"org/example_repository\",\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample = github.get_codespaces_secrets(name=\"example_repository\")\nexample2 = github.get_codespaces_secrets(full_name=\"org/example_repository\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = Github.GetCodespacesSecrets.Invoke(new()\n {\n Name = \"example_repository\",\n });\n\n var example2 = Github.GetCodespacesSecrets.Invoke(new()\n {\n FullName = \"org/example_repository\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.GetCodespacesSecrets(ctx, \u0026github.GetCodespacesSecretsArgs{\n\t\t\tName: pulumi.StringRef(\"example_repository\"),\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = github.GetCodespacesSecrets(ctx, \u0026github.GetCodespacesSecretsArgs{\n\t\t\tFullName: pulumi.StringRef(\"org/example_repository\"),\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport com.pulumi.github.inputs.GetCodespacesSecretsArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var example = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder()\n .name(\"example_repository\")\n .build());\n\n final var example2 = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder()\n .fullName(\"org/example_repository\")\n .build());\n\n }\n}\n```\n```yaml\nvariables:\n example:\n fn::invoke:\n Function: github:getCodespacesSecrets\n Arguments:\n name: example_repository\n example2:\n fn::invoke:\n Function: github:getCodespacesSecrets\n Arguments:\n fullName: org/example_repository\n```\n{{% /example %}}\n{{% /examples %}}", + "inputs": { + "description": "A collection of arguments for invoking getCodespacesSecrets.\n", + "properties": { + "fullName": { + "type": "string", + "description": "Full name of the repository (in `org/name` format).\n" + }, + "name": { + "type": "string", + "description": "The name of the repository.\n" + } + }, + "type": "object" + }, + "outputs": { + "description": "A collection of values returned by getCodespacesSecrets.\n", + "properties": { + "fullName": { + "type": "string" + }, + "id": { + "type": "string", + "description": "The provider-assigned unique ID for this managed resource.\n" + }, + "name": { + "type": "string", + "description": "Secret name\n" + }, + "secrets": { + "type": "array", + "items": { + "$ref": "#/types/github:index/getCodespacesSecretsSecret:getCodespacesSecretsSecret" + }, + "description": "list of codespaces secrets for the repository\n" + } + }, + "type": "object", + "required": [ + "fullName", + "name", + "secrets", + "id" + ] + } + }, + "github:index/getCodespacesUserPublicKey:getCodespacesUserPublicKey": { + "description": "Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions.\nNote that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key.\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 example = github.getCodespacesUserPublicKey({});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample = github.get_codespaces_user_public_key()\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = Github.GetCodespacesUserPublicKey.Invoke();\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.GetCodespacesUserPublicKey(ctx, nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var example = GithubFunctions.getCodespacesUserPublicKey();\n\n }\n}\n```\n```yaml\nvariables:\n example:\n fn::invoke:\n Function: github:getCodespacesUserPublicKey\n Arguments: {}\n```\n{{% /example %}}\n{{% /examples %}}", + "outputs": { + "description": "A collection of values returned by getCodespacesUserPublicKey.\n", + "properties": { + "id": { + "type": "string", + "description": "The provider-assigned unique ID for this managed resource.\n" + }, + "key": { + "type": "string", + "description": "Actual key retrieved.\n" + }, + "keyId": { + "type": "string", + "description": "ID of the key that has been retrieved.\n" + } + }, + "type": "object", + "required": [ + "key", + "keyId", + "id" + ] + } + }, + "github:index/getCodespacesUserSecrets:getCodespacesUserSecrets": { + "description": "Use this data source to retrieve the list of codespaces secrets of the user.\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 example = github.getCodespacesUserSecrets({});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample = github.get_codespaces_user_secrets()\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = Github.GetCodespacesUserSecrets.Invoke();\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.GetCodespacesUserSecrets(ctx, nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var example = GithubFunctions.getCodespacesUserSecrets();\n\n }\n}\n```\n```yaml\nvariables:\n example:\n fn::invoke:\n Function: github:getCodespacesUserSecrets\n Arguments: {}\n```\n{{% /example %}}\n{{% /examples %}}", + "outputs": { + "description": "A collection of values returned by getCodespacesUserSecrets.\n", + "properties": { + "id": { + "type": "string", + "description": "The provider-assigned unique ID for this managed resource.\n" + }, + "secrets": { + "type": "array", + "items": { + "$ref": "#/types/github:index/getCodespacesUserSecretsSecret:getCodespacesUserSecretsSecret" + }, + "description": "list of secrets for the repository\n" + } + }, + "type": "object", + "required": [ + "secrets", + "id" + ] + } + }, "github:index/getCollaborators:getCollaborators": { "description": "Use this data source to retrieve the collaborators for a given repository.\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 test = github.getCollaborators({\n owner: \"example_owner\",\n repository: \"example_repository\",\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\ntest = github.get_collaborators(owner=\"example_owner\",\n repository=\"example_repository\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var test = Github.GetCollaborators.Invoke(new()\n {\n Owner = \"example_owner\",\n Repository = \"example_repository\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.GetCollaborators(ctx, \u0026github.GetCollaboratorsArgs{\n\t\t\tOwner: \"example_owner\",\n\t\t\tRepository: \"example_repository\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport com.pulumi.github.inputs.GetCollaboratorsArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var test = GithubFunctions.getCollaborators(GetCollaboratorsArgs.builder()\n .owner(\"example_owner\")\n .repository(\"example_repository\")\n .build());\n\n }\n}\n```\n```yaml\nvariables:\n test:\n fn::invoke:\n Function: github:getCollaborators\n Arguments:\n owner: example_owner\n repository: example_repository\n```\n{{% /example %}}\n{{% /examples %}}", "inputs": { @@ -8797,6 +9484,57 @@ ] } }, + "github:index/getOrganizationCustomRole:getOrganizationCustomRole": { + "description": "Use this data source to retrieve information about a custom role in a GitHub Organization.\n\n\u003e Note: Custom roles are currently only available in GitHub Enterprise Cloud.\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 example = github.getOrganizationCustomRole({\n name: \"example\",\n});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nexample = github.get_organization_custom_role(name=\"example\")\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var example = Github.GetOrganizationCustomRole.Invoke(new()\n {\n Name = \"example\",\n });\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.LookupOrganizationCustomRole(ctx, \u0026github.LookupOrganizationCustomRoleArgs{\n\t\t\tName: \"example\",\n\t\t}, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport com.pulumi.github.inputs.GetOrganizationCustomRoleArgs;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var example = GithubFunctions.getOrganizationCustomRole(GetOrganizationCustomRoleArgs.builder()\n .name(\"example\")\n .build());\n\n }\n}\n```\n```yaml\nvariables:\n example:\n fn::invoke:\n Function: github:getOrganizationCustomRole\n Arguments:\n name: example\n```\n{{% /example %}}\n{{% /examples %}}", + "inputs": { + "description": "A collection of arguments for invoking getOrganizationCustomRole.\n", + "properties": { + "name": { + "type": "string", + "description": "The name of the custom role.\n" + } + }, + "type": "object", + "required": [ + "name" + ] + }, + "outputs": { + "description": "A collection of values returned by getOrganizationCustomRole.\n", + "properties": { + "baseRole": { + "type": "string", + "description": "The system role from which the role inherits permissions.\n" + }, + "description": { + "type": "string", + "description": "The description for the custom role.\n" + }, + "id": { + "type": "string", + "description": "The provider-assigned unique ID for this managed resource.\n" + }, + "name": { + "type": "string" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of additional permissions included in this role.\n" + } + }, + "type": "object", + "required": [ + "baseRole", + "description", + "name", + "permissions", + "id" + ] + } + }, "github:index/getOrganizationIpAllowList:getOrganizationIpAllowList": { "description": "Use this data source to retrieve information about the IP allow list of an organization.\nThe allow list for IP addresses will block access to private resources via the web, API,\nand Git from any IP addresses that are not on the allow list.\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 all = github.getOrganizationIpAllowList({});\n```\n```python\nimport pulumi\nimport pulumi_github as github\n\nall = github.get_organization_ip_allow_list()\n```\n```csharp\nusing System.Collections.Generic;\nusing System.Linq;\nusing Pulumi;\nusing Github = Pulumi.Github;\n\nreturn await Deployment.RunAsync(() =\u003e \n{\n var all = Github.GetOrganizationIpAllowList.Invoke();\n\n});\n```\n```go\npackage main\n\nimport (\n\t\"github.com/pulumi/pulumi-github/sdk/v5/go/github\"\n\t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n)\n\nfunc main() {\n\tpulumi.Run(func(ctx *pulumi.Context) error {\n\t\t_, err := github.GetOrganizationIpAllowList(ctx, nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n}\n```\n```java\npackage generated_program;\n\nimport com.pulumi.Context;\nimport com.pulumi.Pulumi;\nimport com.pulumi.core.Output;\nimport com.pulumi.github.GithubFunctions;\nimport java.util.List;\nimport java.util.ArrayList;\nimport java.util.Map;\nimport java.io.File;\nimport java.nio.file.Files;\nimport java.nio.file.Paths;\n\npublic class App {\n public static void main(String[] args) {\n Pulumi.run(App::stack);\n }\n\n public static void stack(Context ctx) {\n final var all = GithubFunctions.getOrganizationIpAllowList();\n\n }\n}\n```\n```yaml\nvariables:\n all:\n fn::invoke:\n Function: github:getOrganizationIpAllowList\n Arguments: {}\n```\n{{% /example %}}\n{{% /examples %}}", "outputs": { diff --git a/provider/go.mod b/provider/go.mod index 9ddf1b64..ca341cfc 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -4,9 +4,9 @@ go 1.19 require ( github.com/hashicorp/terraform-plugin-sdk v1.17.2 - github.com/integrations/terraform-provider-github/v5 v5.28.1 - github.com/pulumi/pulumi-terraform-bridge/v3 v3.50.1 - github.com/pulumi/pulumi/sdk/v3 v3.71.0 + github.com/integrations/terraform-provider-github/v5 v5.29.0 + github.com/pulumi/pulumi-terraform-bridge/v3 v3.51.0 + github.com/pulumi/pulumi/sdk/v3 v3.72.2 ) require ( @@ -159,9 +159,9 @@ require ( github.com/pulumi/pulumi-java/pkg v0.9.4 // indirect github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.4 // indirect github.com/pulumi/pulumi-yaml v1.1.1 // indirect - github.com/pulumi/pulumi/pkg/v3 v3.71.0 // indirect + github.com/pulumi/pulumi/pkg/v3 v3.72.2 // indirect github.com/pulumi/schema-tools v0.2.2 // indirect - github.com/pulumi/terraform-diff-reader v0.0.0-20201211191010-ad4715e9285e // indirect + github.com/pulumi/terraform-diff-reader v0.0.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect diff --git a/provider/go.sum b/provider/go.sum index d59b2423..49a00666 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -1511,8 +1511,8 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/integrations/terraform-provider-github/v5 v5.28.1 h1:Kvb1fxzEVstKki8PZBadC6Ag0nmUDkiSO/x7YkvlPUs= -github.com/integrations/terraform-provider-github/v5 v5.28.1/go.mod h1:dpm/QaM6qI7GMgBuOrnxxSBPytAb++f4o78eAINPc8A= +github.com/integrations/terraform-provider-github/v5 v5.29.0 h1:4SkZPoGxi7ARdUSsCcmu0QfRs1+HjhDqaOUbpJfDFzw= +github.com/integrations/terraform-provider-github/v5 v5.29.0/go.mod h1:dpm/QaM6qI7GMgBuOrnxxSBPytAb++f4o78eAINPc8A= github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= github.com/ionos-cloud/sdk-go/v6 v6.1.3/go.mod h1:Ox3W0iiEz0GHnfY9e5LmAxwklsxguuNFEUSu0gVRTME= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= @@ -1974,20 +1974,20 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/pulumi/pulumi-java/pkg v0.9.4 h1:gIQZmlUI1o9ye8CL2XFqtmAX6Lwr9uj/+HzjboiSmK4= github.com/pulumi/pulumi-java/pkg v0.9.4/go.mod h1:c6rSw/+q4O0IImgJ9axxoC6QesbPYWBaG5gimbHouUQ= github.com/pulumi/pulumi-terraform-bridge/testing v0.0.1 h1:SCg1gjfY9N4yn8U8peIUYATifjoDABkyR7H9lmefsfc= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.50.1 h1:3lfYzYjs/8ZtJuOm3xHhnGV9T5FQ+MObIOIcNEOQxEk= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.50.1/go.mod h1:ek2NJSTqeI5+V6wL2Cv8qy3f7S0Uc04UT/m6U582fSs= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.51.0 h1:8ofaNPTN0Zhx1qdwKNpzR6fV/lvskmXhx+JtXiOBBT4= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.51.0/go.mod h1:egk8TtYfFb1VqnBk8iXcn9G5gl8XN4ZrhSBx/iGsRPc= github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.4 h1:rIzMmtcVpPX8ynaz6/nW5AHNY63DiNfCohqmxWvMpM4= github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.4/go.mod h1:Kt8RIZWa/N8rW3+0g6NrqCBmF3o+HuIhFaZpssEkG6w= github.com/pulumi/pulumi-yaml v1.1.1 h1:8pyBNIU8+ym0wYpjhsCqN+cutygfK1XbhY2YEeNfyXY= github.com/pulumi/pulumi-yaml v1.1.1/go.mod h1:GhpdS6rFpwqvUtKdA+fQy8P28iNvncng39IXh5q68vE= -github.com/pulumi/pulumi/pkg/v3 v3.71.0 h1:SdmFCDKQGz6HxbHi+7CDTRQ9pQfWOJWmLL5Kh4ayQEk= -github.com/pulumi/pulumi/pkg/v3 v3.71.0/go.mod h1:U4IvxPAIezAbJwwyGl2faq09XC0BP3RxQbwZmBYy6fM= -github.com/pulumi/pulumi/sdk/v3 v3.71.0 h1:D/02vc3Xn/eKxwCDWuYmkxAO1Jm7waOeiuxercQQWLY= -github.com/pulumi/pulumi/sdk/v3 v3.71.0/go.mod h1:BUUBfQZsH0FPuznRfFHkR+b96VlXELnn+DgidFj4XSQ= +github.com/pulumi/pulumi/pkg/v3 v3.72.2 h1:H9DU5/D73a4UIWEeCrb7N3P1ZrZ/M7r2VYmOlpFbjFg= +github.com/pulumi/pulumi/pkg/v3 v3.72.2/go.mod h1:roPEZwkXjJ7SgTizApJjJoxFlmvS9Uc6PPhXnA4WuGU= +github.com/pulumi/pulumi/sdk/v3 v3.72.2 h1:hw/iiPW2JfeCAR38kRZl/XdyFEvSPPrB5HaU/DmsIDs= +github.com/pulumi/pulumi/sdk/v3 v3.72.2/go.mod h1:BUUBfQZsH0FPuznRfFHkR+b96VlXELnn+DgidFj4XSQ= github.com/pulumi/schema-tools v0.2.2 h1:KiH/OP/mFF5XjXcOtrPOZ2Z5Sjtb0mLAaHgjJMcjMi4= github.com/pulumi/schema-tools v0.2.2/go.mod h1:62lgj52Tzq11eqWTIaKd+EVyYAu5dEcDJxMhTjvMO/k= -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/pulumi/terraform-diff-reader v0.0.1 h1:d42TUgaQewDVt9bG3GksVZMoUlEEqF171ak66OZVMjE= +github.com/pulumi/terraform-diff-reader v0.0.1/go.mod h1:sZ9FUzGO+yM41hsQHs/yIcj/Y993qMdBxBU5mpDmAfQ= github.com/rakyll/embedmd v0.0.0-20171029212350-c8060a0752a2/go.mod h1:7jOTMgqac46PZcF54q6l2hkLEG8op93fZu61KmxWDV4= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= @@ -3310,7 +3310,7 @@ lukechampine.com/frand v1.4.2 h1:RzFIpOvkMXuPMBb9maa4ND4wjBn71E1Jpf8BzJHMaVw= lukechampine.com/frand v1.4.2/go.mod h1:4S/TM2ZgrKejMcKMbeLjISpJMO+/eZ1zu3vYX9dtj3s= mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA= +pgregory.net/rapid v0.6.1 h1:4eyrDxyht86tT4Ztm+kvlyNBLIk071gR+ZQdhphc9dQ= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/sdk/dotnet/CodespacesOrganizationSecret.cs b/sdk/dotnet/CodespacesOrganizationSecret.cs new file mode 100644 index 00000000..97d3fcd4 --- /dev/null +++ b/sdk/dotnet/CodespacesOrganizationSecret.cs @@ -0,0 +1,324 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github +{ + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var exampleSecretCodespacesOrganizationSecret = new Github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", new() + /// { + /// SecretName = "example_secret_name", + /// Visibility = "private", + /// PlaintextValue = @var.Some_secret_string, + /// }); + /// + /// var exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new Github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", new() + /// { + /// SecretName = "example_secret_name", + /// Visibility = "private", + /// EncryptedValue = @var.Some_encrypted_secret_string, + /// }); + /// + /// }); + /// ``` + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = Github.GetRepository.Invoke(new() + /// { + /// FullName = "my-org/repo", + /// }); + /// + /// var exampleSecretCodespacesOrganizationSecret = new Github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", new() + /// { + /// SecretName = "example_secret_name", + /// Visibility = "selected", + /// PlaintextValue = @var.Some_secret_string, + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// var exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new Github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", new() + /// { + /// SecretName = "example_secret_name", + /// Visibility = "selected", + /// EncryptedValue = @var.Some_encrypted_secret_string, + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// }); + /// ``` + /// + /// ## Import + /// + /// This resource can be imported using an ID made up of the secret name + /// + /// ```sh + /// $ pulumi import github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret test_secret test_secret_name + /// ``` + /// + /// NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. + /// + [GithubResourceType("github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret")] + public partial class CodespacesOrganizationSecret : global::Pulumi.CustomResource + { + /// + /// Date of codespaces_secret creation. + /// + [Output("createdAt")] + public Output CreatedAt { get; private set; } = null!; + + /// + /// Encrypted value of the secret using the GitHub public key in Base64 format. + /// + [Output("encryptedValue")] + public Output EncryptedValue { get; private set; } = null!; + + /// + /// Plaintext value of the secret to be encrypted + /// + [Output("plaintextValue")] + public Output PlaintextValue { get; private set; } = null!; + + /// + /// Name of the secret + /// + [Output("secretName")] + public Output SecretName { get; private set; } = null!; + + /// + /// An array of repository ids that can access the organization secret. + /// + [Output("selectedRepositoryIds")] + public Output> SelectedRepositoryIds { get; private set; } = null!; + + /// + /// Date of codespaces_secret update. + /// + [Output("updatedAt")] + public Output UpdatedAt { get; private set; } = null!; + + /// + /// Configures the access that repositories have to the organization secret. + /// Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + /// + [Output("visibility")] + public Output Visibility { get; private set; } = null!; + + + /// + /// Create a CodespacesOrganizationSecret resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public CodespacesOrganizationSecret(string name, CodespacesOrganizationSecretArgs args, CustomResourceOptions? options = null) + : base("github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret", name, args ?? new CodespacesOrganizationSecretArgs(), MakeResourceOptions(options, "")) + { + } + + private CodespacesOrganizationSecret(string name, Input id, CodespacesOrganizationSecretState? state = null, CustomResourceOptions? options = null) + : base("github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + AdditionalSecretOutputs = + { + "encryptedValue", + "plaintextValue", + }, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing CodespacesOrganizationSecret resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static CodespacesOrganizationSecret Get(string name, Input id, CodespacesOrganizationSecretState? state = null, CustomResourceOptions? options = null) + { + return new CodespacesOrganizationSecret(name, id, state, options); + } + } + + public sealed class CodespacesOrganizationSecretArgs : global::Pulumi.ResourceArgs + { + [Input("encryptedValue")] + private Input? _encryptedValue; + + /// + /// Encrypted value of the secret using the GitHub public key in Base64 format. + /// + public Input? EncryptedValue + { + get => _encryptedValue; + set + { + var emptySecret = Output.CreateSecret(0); + _encryptedValue = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + [Input("plaintextValue")] + private Input? _plaintextValue; + + /// + /// Plaintext value of the secret to be encrypted + /// + public Input? PlaintextValue + { + get => _plaintextValue; + set + { + var emptySecret = Output.CreateSecret(0); + _plaintextValue = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + /// + /// Name of the secret + /// + [Input("secretName", required: true)] + public Input SecretName { get; set; } = null!; + + [Input("selectedRepositoryIds")] + private InputList? _selectedRepositoryIds; + + /// + /// An array of repository ids that can access the organization secret. + /// + public InputList SelectedRepositoryIds + { + get => _selectedRepositoryIds ?? (_selectedRepositoryIds = new InputList()); + set => _selectedRepositoryIds = value; + } + + /// + /// Configures the access that repositories have to the organization secret. + /// Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + /// + [Input("visibility", required: true)] + public Input Visibility { get; set; } = null!; + + public CodespacesOrganizationSecretArgs() + { + } + public static new CodespacesOrganizationSecretArgs Empty => new CodespacesOrganizationSecretArgs(); + } + + public sealed class CodespacesOrganizationSecretState : global::Pulumi.ResourceArgs + { + /// + /// Date of codespaces_secret creation. + /// + [Input("createdAt")] + public Input? CreatedAt { get; set; } + + [Input("encryptedValue")] + private Input? _encryptedValue; + + /// + /// Encrypted value of the secret using the GitHub public key in Base64 format. + /// + public Input? EncryptedValue + { + get => _encryptedValue; + set + { + var emptySecret = Output.CreateSecret(0); + _encryptedValue = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + [Input("plaintextValue")] + private Input? _plaintextValue; + + /// + /// Plaintext value of the secret to be encrypted + /// + public Input? PlaintextValue + { + get => _plaintextValue; + set + { + var emptySecret = Output.CreateSecret(0); + _plaintextValue = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + /// + /// Name of the secret + /// + [Input("secretName")] + public Input? SecretName { get; set; } + + [Input("selectedRepositoryIds")] + private InputList? _selectedRepositoryIds; + + /// + /// An array of repository ids that can access the organization secret. + /// + public InputList SelectedRepositoryIds + { + get => _selectedRepositoryIds ?? (_selectedRepositoryIds = new InputList()); + set => _selectedRepositoryIds = value; + } + + /// + /// Date of codespaces_secret update. + /// + [Input("updatedAt")] + public Input? UpdatedAt { get; set; } + + /// + /// Configures the access that repositories have to the organization secret. + /// Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + /// + [Input("visibility")] + public Input? Visibility { get; set; } + + public CodespacesOrganizationSecretState() + { + } + public static new CodespacesOrganizationSecretState Empty => new CodespacesOrganizationSecretState(); + } +} diff --git a/sdk/dotnet/CodespacesSecret.cs b/sdk/dotnet/CodespacesSecret.cs new file mode 100644 index 00000000..7be162fd --- /dev/null +++ b/sdk/dotnet/CodespacesSecret.cs @@ -0,0 +1,248 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github +{ + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var examplePublicKey = Github.GetCodespacesPublicKey.Invoke(new() + /// { + /// Repository = "example_repository", + /// }); + /// + /// var exampleSecretCodespacesSecret = new Github.CodespacesSecret("exampleSecretCodespacesSecret", new() + /// { + /// Repository = "example_repository", + /// SecretName = "example_secret_name", + /// PlaintextValue = @var.Some_secret_string, + /// }); + /// + /// var exampleSecretIndex_codespacesSecretCodespacesSecret = new Github.CodespacesSecret("exampleSecretIndex/codespacesSecretCodespacesSecret", new() + /// { + /// Repository = "example_repository", + /// SecretName = "example_secret_name", + /// EncryptedValue = @var.Some_encrypted_secret_string, + /// }); + /// + /// }); + /// ``` + /// + [GithubResourceType("github:index/codespacesSecret:CodespacesSecret")] + public partial class CodespacesSecret : global::Pulumi.CustomResource + { + /// + /// Date of actions_secret creation. + /// + [Output("createdAt")] + public Output CreatedAt { get; private set; } = null!; + + /// + /// Encrypted value of the secret using the GitHub public key in Base64 format. + /// + [Output("encryptedValue")] + public Output EncryptedValue { get; private set; } = null!; + + /// + /// Plaintext value of the secret to be encrypted + /// + [Output("plaintextValue")] + public Output PlaintextValue { get; private set; } = null!; + + /// + /// Name of the repository + /// + [Output("repository")] + public Output Repository { get; private set; } = null!; + + /// + /// Name of the secret + /// + [Output("secretName")] + public Output SecretName { get; private set; } = null!; + + /// + /// Date of actions_secret update. + /// + [Output("updatedAt")] + public Output UpdatedAt { get; private set; } = null!; + + + /// + /// Create a CodespacesSecret resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public CodespacesSecret(string name, CodespacesSecretArgs args, CustomResourceOptions? options = null) + : base("github:index/codespacesSecret:CodespacesSecret", name, args ?? new CodespacesSecretArgs(), MakeResourceOptions(options, "")) + { + } + + private CodespacesSecret(string name, Input id, CodespacesSecretState? state = null, CustomResourceOptions? options = null) + : base("github:index/codespacesSecret:CodespacesSecret", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + AdditionalSecretOutputs = + { + "encryptedValue", + "plaintextValue", + }, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing CodespacesSecret resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static CodespacesSecret Get(string name, Input id, CodespacesSecretState? state = null, CustomResourceOptions? options = null) + { + return new CodespacesSecret(name, id, state, options); + } + } + + public sealed class CodespacesSecretArgs : global::Pulumi.ResourceArgs + { + [Input("encryptedValue")] + private Input? _encryptedValue; + + /// + /// Encrypted value of the secret using the GitHub public key in Base64 format. + /// + public Input? EncryptedValue + { + get => _encryptedValue; + set + { + var emptySecret = Output.CreateSecret(0); + _encryptedValue = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + [Input("plaintextValue")] + private Input? _plaintextValue; + + /// + /// Plaintext value of the secret to be encrypted + /// + public Input? PlaintextValue + { + get => _plaintextValue; + set + { + var emptySecret = Output.CreateSecret(0); + _plaintextValue = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + /// + /// Name of the repository + /// + [Input("repository", required: true)] + public Input Repository { get; set; } = null!; + + /// + /// Name of the secret + /// + [Input("secretName", required: true)] + public Input SecretName { get; set; } = null!; + + public CodespacesSecretArgs() + { + } + public static new CodespacesSecretArgs Empty => new CodespacesSecretArgs(); + } + + public sealed class CodespacesSecretState : global::Pulumi.ResourceArgs + { + /// + /// Date of actions_secret creation. + /// + [Input("createdAt")] + public Input? CreatedAt { get; set; } + + [Input("encryptedValue")] + private Input? _encryptedValue; + + /// + /// Encrypted value of the secret using the GitHub public key in Base64 format. + /// + public Input? EncryptedValue + { + get => _encryptedValue; + set + { + var emptySecret = Output.CreateSecret(0); + _encryptedValue = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + [Input("plaintextValue")] + private Input? _plaintextValue; + + /// + /// Plaintext value of the secret to be encrypted + /// + public Input? PlaintextValue + { + get => _plaintextValue; + set + { + var emptySecret = Output.CreateSecret(0); + _plaintextValue = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + /// + /// Name of the repository + /// + [Input("repository")] + public Input? Repository { get; set; } + + /// + /// Name of the secret + /// + [Input("secretName")] + public Input? SecretName { get; set; } + + /// + /// Date of actions_secret update. + /// + [Input("updatedAt")] + public Input? UpdatedAt { get; set; } + + public CodespacesSecretState() + { + } + public static new CodespacesSecretState Empty => new CodespacesSecretState(); + } +} diff --git a/sdk/dotnet/CodespacesUserSecret.cs b/sdk/dotnet/CodespacesUserSecret.cs new file mode 100644 index 00000000..b0d07d4b --- /dev/null +++ b/sdk/dotnet/CodespacesUserSecret.cs @@ -0,0 +1,276 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github +{ + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var repo = Github.GetRepository.Invoke(new() + /// { + /// FullName = "my-org/repo", + /// }); + /// + /// var exampleSecretCodespacesUserSecret = new Github.CodespacesUserSecret("exampleSecretCodespacesUserSecret", new() + /// { + /// SecretName = "example_secret_name", + /// PlaintextValue = @var.Some_secret_string, + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// var exampleSecretIndex_codespacesUserSecretCodespacesUserSecret = new Github.CodespacesUserSecret("exampleSecretIndex/codespacesUserSecretCodespacesUserSecret", new() + /// { + /// SecretName = "example_secret_name", + /// EncryptedValue = @var.Some_encrypted_secret_string, + /// SelectedRepositoryIds = new[] + /// { + /// repo.Apply(getRepositoryResult => getRepositoryResult.RepoId), + /// }, + /// }); + /// + /// }); + /// ``` + /// + /// ## Import + /// + /// This resource can be imported using an ID made up of the secret name + /// + /// ```sh + /// $ pulumi import github:index/codespacesUserSecret:CodespacesUserSecret test_secret test_secret_name + /// ``` + /// + /// NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. + /// + [GithubResourceType("github:index/codespacesUserSecret:CodespacesUserSecret")] + public partial class CodespacesUserSecret : global::Pulumi.CustomResource + { + /// + /// Date of codespaces_secret creation. + /// + [Output("createdAt")] + public Output CreatedAt { get; private set; } = null!; + + /// + /// Encrypted value of the secret using the GitHub public key in Base64 format. + /// + [Output("encryptedValue")] + public Output EncryptedValue { get; private set; } = null!; + + /// + /// Plaintext value of the secret to be encrypted + /// + [Output("plaintextValue")] + public Output PlaintextValue { get; private set; } = null!; + + /// + /// Name of the secret + /// + [Output("secretName")] + public Output SecretName { get; private set; } = null!; + + /// + /// An array of repository ids that can access the user secret. + /// + [Output("selectedRepositoryIds")] + public Output> SelectedRepositoryIds { get; private set; } = null!; + + /// + /// Date of codespaces_secret update. + /// + [Output("updatedAt")] + public Output UpdatedAt { get; private set; } = null!; + + + /// + /// Create a CodespacesUserSecret resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public CodespacesUserSecret(string name, CodespacesUserSecretArgs args, CustomResourceOptions? options = null) + : base("github:index/codespacesUserSecret:CodespacesUserSecret", name, args ?? new CodespacesUserSecretArgs(), MakeResourceOptions(options, "")) + { + } + + private CodespacesUserSecret(string name, Input id, CodespacesUserSecretState? state = null, CustomResourceOptions? options = null) + : base("github:index/codespacesUserSecret:CodespacesUserSecret", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + AdditionalSecretOutputs = + { + "encryptedValue", + "plaintextValue", + }, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing CodespacesUserSecret resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static CodespacesUserSecret Get(string name, Input id, CodespacesUserSecretState? state = null, CustomResourceOptions? options = null) + { + return new CodespacesUserSecret(name, id, state, options); + } + } + + public sealed class CodespacesUserSecretArgs : global::Pulumi.ResourceArgs + { + [Input("encryptedValue")] + private Input? _encryptedValue; + + /// + /// Encrypted value of the secret using the GitHub public key in Base64 format. + /// + public Input? EncryptedValue + { + get => _encryptedValue; + set + { + var emptySecret = Output.CreateSecret(0); + _encryptedValue = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + [Input("plaintextValue")] + private Input? _plaintextValue; + + /// + /// Plaintext value of the secret to be encrypted + /// + public Input? PlaintextValue + { + get => _plaintextValue; + set + { + var emptySecret = Output.CreateSecret(0); + _plaintextValue = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + /// + /// Name of the secret + /// + [Input("secretName", required: true)] + public Input SecretName { get; set; } = null!; + + [Input("selectedRepositoryIds")] + private InputList? _selectedRepositoryIds; + + /// + /// An array of repository ids that can access the user secret. + /// + public InputList SelectedRepositoryIds + { + get => _selectedRepositoryIds ?? (_selectedRepositoryIds = new InputList()); + set => _selectedRepositoryIds = value; + } + + public CodespacesUserSecretArgs() + { + } + public static new CodespacesUserSecretArgs Empty => new CodespacesUserSecretArgs(); + } + + public sealed class CodespacesUserSecretState : global::Pulumi.ResourceArgs + { + /// + /// Date of codespaces_secret creation. + /// + [Input("createdAt")] + public Input? CreatedAt { get; set; } + + [Input("encryptedValue")] + private Input? _encryptedValue; + + /// + /// Encrypted value of the secret using the GitHub public key in Base64 format. + /// + public Input? EncryptedValue + { + get => _encryptedValue; + set + { + var emptySecret = Output.CreateSecret(0); + _encryptedValue = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + [Input("plaintextValue")] + private Input? _plaintextValue; + + /// + /// Plaintext value of the secret to be encrypted + /// + public Input? PlaintextValue + { + get => _plaintextValue; + set + { + var emptySecret = Output.CreateSecret(0); + _plaintextValue = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); + } + } + + /// + /// Name of the secret + /// + [Input("secretName")] + public Input? SecretName { get; set; } + + [Input("selectedRepositoryIds")] + private InputList? _selectedRepositoryIds; + + /// + /// An array of repository ids that can access the user secret. + /// + public InputList SelectedRepositoryIds + { + get => _selectedRepositoryIds ?? (_selectedRepositoryIds = new InputList()); + set => _selectedRepositoryIds = value; + } + + /// + /// Date of codespaces_secret update. + /// + [Input("updatedAt")] + public Input? UpdatedAt { get; set; } + + public CodespacesUserSecretState() + { + } + public static new CodespacesUserSecretState Empty => new CodespacesUserSecretState(); + } +} diff --git a/sdk/dotnet/GetCodespacesOrganizationPublicKey.cs b/sdk/dotnet/GetCodespacesOrganizationPublicKey.cs new file mode 100644 index 00000000..a619fda6 --- /dev/null +++ b/sdk/dotnet/GetCodespacesOrganizationPublicKey.cs @@ -0,0 +1,71 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github +{ + public static class GetCodespacesOrganizationPublicKey + { + /// + /// Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. + /// Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesOrganizationPublicKey.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + public static Task InvokeAsync(InvokeOptions? options = null) + => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCodespacesOrganizationPublicKey:getCodespacesOrganizationPublicKey", InvokeArgs.Empty, options.WithDefaults()); + } + + + [OutputType] + public sealed class GetCodespacesOrganizationPublicKeyResult + { + /// + /// The provider-assigned unique ID for this managed resource. + /// + public readonly string Id; + /// + /// Actual key retrieved. + /// + public readonly string Key; + /// + /// ID of the key that has been retrieved. + /// + public readonly string KeyId; + + [OutputConstructor] + private GetCodespacesOrganizationPublicKeyResult( + string id, + + string key, + + string keyId) + { + Id = id; + Key = key; + KeyId = keyId; + } + } +} diff --git a/sdk/dotnet/GetCodespacesOrganizationSecrets.cs b/sdk/dotnet/GetCodespacesOrganizationSecrets.cs new file mode 100644 index 00000000..e9165626 --- /dev/null +++ b/sdk/dotnet/GetCodespacesOrganizationSecrets.cs @@ -0,0 +1,63 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github +{ + public static class GetCodespacesOrganizationSecrets + { + /// + /// Use this data source to retrieve the list of codespaces secrets of the organization. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesOrganizationSecrets.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + public static Task InvokeAsync(InvokeOptions? options = null) + => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCodespacesOrganizationSecrets:getCodespacesOrganizationSecrets", InvokeArgs.Empty, options.WithDefaults()); + } + + + [OutputType] + public sealed class GetCodespacesOrganizationSecretsResult + { + /// + /// The provider-assigned unique ID for this managed resource. + /// + public readonly string Id; + /// + /// list of secrets for the repository + /// + public readonly ImmutableArray Secrets; + + [OutputConstructor] + private GetCodespacesOrganizationSecretsResult( + string id, + + ImmutableArray secrets) + { + Id = id; + Secrets = secrets; + } + } +} diff --git a/sdk/dotnet/GetCodespacesPublicKey.cs b/sdk/dotnet/GetCodespacesPublicKey.cs new file mode 100644 index 00000000..6c814abd --- /dev/null +++ b/sdk/dotnet/GetCodespacesPublicKey.cs @@ -0,0 +1,136 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github +{ + public static class GetCodespacesPublicKey + { + /// + /// Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. + /// Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesPublicKey.Invoke(new() + /// { + /// Repository = "example_repo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + public static Task InvokeAsync(GetCodespacesPublicKeyArgs args, InvokeOptions? options = null) + => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCodespacesPublicKey:getCodespacesPublicKey", args ?? new GetCodespacesPublicKeyArgs(), options.WithDefaults()); + + /// + /// Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. + /// Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesPublicKey.Invoke(new() + /// { + /// Repository = "example_repo", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + public static Output Invoke(GetCodespacesPublicKeyInvokeArgs args, InvokeOptions? options = null) + => global::Pulumi.Deployment.Instance.Invoke("github:index/getCodespacesPublicKey:getCodespacesPublicKey", args ?? new GetCodespacesPublicKeyInvokeArgs(), options.WithDefaults()); + } + + + public sealed class GetCodespacesPublicKeyArgs : global::Pulumi.InvokeArgs + { + /// + /// Name of the repository to get public key from. + /// + [Input("repository", required: true)] + public string Repository { get; set; } = null!; + + public GetCodespacesPublicKeyArgs() + { + } + public static new GetCodespacesPublicKeyArgs Empty => new GetCodespacesPublicKeyArgs(); + } + + public sealed class GetCodespacesPublicKeyInvokeArgs : global::Pulumi.InvokeArgs + { + /// + /// Name of the repository to get public key from. + /// + [Input("repository", required: true)] + public Input Repository { get; set; } = null!; + + public GetCodespacesPublicKeyInvokeArgs() + { + } + public static new GetCodespacesPublicKeyInvokeArgs Empty => new GetCodespacesPublicKeyInvokeArgs(); + } + + + [OutputType] + public sealed class GetCodespacesPublicKeyResult + { + /// + /// The provider-assigned unique ID for this managed resource. + /// + public readonly string Id; + /// + /// Actual key retrieved. + /// + public readonly string Key; + /// + /// ID of the key that has been retrieved. + /// + public readonly string KeyId; + public readonly string Repository; + + [OutputConstructor] + private GetCodespacesPublicKeyResult( + string id, + + string key, + + string keyId, + + string repository) + { + Id = id; + Key = key; + KeyId = keyId; + Repository = repository; + } + } +} diff --git a/sdk/dotnet/GetCodespacesSecrets.cs b/sdk/dotnet/GetCodespacesSecrets.cs new file mode 100644 index 00000000..9bd0900a --- /dev/null +++ b/sdk/dotnet/GetCodespacesSecrets.cs @@ -0,0 +1,156 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github +{ + public static class GetCodespacesSecrets + { + /// + /// Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesSecrets.Invoke(new() + /// { + /// Name = "example_repository", + /// }); + /// + /// var example2 = Github.GetCodespacesSecrets.Invoke(new() + /// { + /// FullName = "org/example_repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + public static Task InvokeAsync(GetCodespacesSecretsArgs? args = null, InvokeOptions? options = null) + => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCodespacesSecrets:getCodespacesSecrets", args ?? new GetCodespacesSecretsArgs(), options.WithDefaults()); + + /// + /// Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesSecrets.Invoke(new() + /// { + /// Name = "example_repository", + /// }); + /// + /// var example2 = Github.GetCodespacesSecrets.Invoke(new() + /// { + /// FullName = "org/example_repository", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + public static Output Invoke(GetCodespacesSecretsInvokeArgs? args = null, InvokeOptions? options = null) + => global::Pulumi.Deployment.Instance.Invoke("github:index/getCodespacesSecrets:getCodespacesSecrets", args ?? new GetCodespacesSecretsInvokeArgs(), options.WithDefaults()); + } + + + public sealed class GetCodespacesSecretsArgs : global::Pulumi.InvokeArgs + { + /// + /// Full name of the repository (in `org/name` format). + /// + [Input("fullName")] + public string? FullName { get; set; } + + /// + /// The name of the repository. + /// + [Input("name")] + public string? Name { get; set; } + + public GetCodespacesSecretsArgs() + { + } + public static new GetCodespacesSecretsArgs Empty => new GetCodespacesSecretsArgs(); + } + + public sealed class GetCodespacesSecretsInvokeArgs : global::Pulumi.InvokeArgs + { + /// + /// Full name of the repository (in `org/name` format). + /// + [Input("fullName")] + public Input? FullName { get; set; } + + /// + /// The name of the repository. + /// + [Input("name")] + public Input? Name { get; set; } + + public GetCodespacesSecretsInvokeArgs() + { + } + public static new GetCodespacesSecretsInvokeArgs Empty => new GetCodespacesSecretsInvokeArgs(); + } + + + [OutputType] + public sealed class GetCodespacesSecretsResult + { + public readonly string FullName; + /// + /// The provider-assigned unique ID for this managed resource. + /// + public readonly string Id; + /// + /// Secret name + /// + public readonly string Name; + /// + /// list of codespaces secrets for the repository + /// + public readonly ImmutableArray Secrets; + + [OutputConstructor] + private GetCodespacesSecretsResult( + string fullName, + + string id, + + string name, + + ImmutableArray secrets) + { + FullName = fullName; + Id = id; + Name = name; + Secrets = secrets; + } + } +} diff --git a/sdk/dotnet/GetCodespacesUserPublicKey.cs b/sdk/dotnet/GetCodespacesUserPublicKey.cs new file mode 100644 index 00000000..8731a94f --- /dev/null +++ b/sdk/dotnet/GetCodespacesUserPublicKey.cs @@ -0,0 +1,71 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github +{ + public static class GetCodespacesUserPublicKey + { + /// + /// Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. + /// Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesUserPublicKey.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + public static Task InvokeAsync(InvokeOptions? options = null) + => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCodespacesUserPublicKey:getCodespacesUserPublicKey", InvokeArgs.Empty, options.WithDefaults()); + } + + + [OutputType] + public sealed class GetCodespacesUserPublicKeyResult + { + /// + /// The provider-assigned unique ID for this managed resource. + /// + public readonly string Id; + /// + /// Actual key retrieved. + /// + public readonly string Key; + /// + /// ID of the key that has been retrieved. + /// + public readonly string KeyId; + + [OutputConstructor] + private GetCodespacesUserPublicKeyResult( + string id, + + string key, + + string keyId) + { + Id = id; + Key = key; + KeyId = keyId; + } + } +} diff --git a/sdk/dotnet/GetCodespacesUserSecrets.cs b/sdk/dotnet/GetCodespacesUserSecrets.cs new file mode 100644 index 00000000..58c022ae --- /dev/null +++ b/sdk/dotnet/GetCodespacesUserSecrets.cs @@ -0,0 +1,63 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github +{ + public static class GetCodespacesUserSecrets + { + /// + /// Use this data source to retrieve the list of codespaces secrets of the user. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetCodespacesUserSecrets.Invoke(); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + public static Task InvokeAsync(InvokeOptions? options = null) + => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getCodespacesUserSecrets:getCodespacesUserSecrets", InvokeArgs.Empty, options.WithDefaults()); + } + + + [OutputType] + public sealed class GetCodespacesUserSecretsResult + { + /// + /// The provider-assigned unique ID for this managed resource. + /// + public readonly string Id; + /// + /// list of secrets for the repository + /// + public readonly ImmutableArray Secrets; + + [OutputConstructor] + private GetCodespacesUserSecretsResult( + string id, + + ImmutableArray secrets) + { + Id = id; + Secrets = secrets; + } + } +} diff --git a/sdk/dotnet/GetOrganizationCustomRole.cs b/sdk/dotnet/GetOrganizationCustomRole.cs new file mode 100644 index 00000000..71161e71 --- /dev/null +++ b/sdk/dotnet/GetOrganizationCustomRole.cs @@ -0,0 +1,145 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github +{ + public static class GetOrganizationCustomRole + { + /// + /// Use this data source to retrieve information about a custom role in a GitHub Organization. + /// + /// > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetOrganizationCustomRole.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + public static Task InvokeAsync(GetOrganizationCustomRoleArgs args, InvokeOptions? options = null) + => global::Pulumi.Deployment.Instance.InvokeAsync("github:index/getOrganizationCustomRole:getOrganizationCustomRole", args ?? new GetOrganizationCustomRoleArgs(), options.WithDefaults()); + + /// + /// Use this data source to retrieve information about a custom role in a GitHub Organization. + /// + /// > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + /// + /// {{% examples %}} + /// ## Example Usage + /// {{% example %}} + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = Github.GetOrganizationCustomRole.Invoke(new() + /// { + /// Name = "example", + /// }); + /// + /// }); + /// ``` + /// {{% /example %}} + /// {{% /examples %}} + /// + public static Output Invoke(GetOrganizationCustomRoleInvokeArgs args, InvokeOptions? options = null) + => global::Pulumi.Deployment.Instance.Invoke("github:index/getOrganizationCustomRole:getOrganizationCustomRole", args ?? new GetOrganizationCustomRoleInvokeArgs(), options.WithDefaults()); + } + + + public sealed class GetOrganizationCustomRoleArgs : global::Pulumi.InvokeArgs + { + /// + /// The name of the custom role. + /// + [Input("name", required: true)] + public string Name { get; set; } = null!; + + public GetOrganizationCustomRoleArgs() + { + } + public static new GetOrganizationCustomRoleArgs Empty => new GetOrganizationCustomRoleArgs(); + } + + public sealed class GetOrganizationCustomRoleInvokeArgs : global::Pulumi.InvokeArgs + { + /// + /// The name of the custom role. + /// + [Input("name", required: true)] + public Input Name { get; set; } = null!; + + public GetOrganizationCustomRoleInvokeArgs() + { + } + public static new GetOrganizationCustomRoleInvokeArgs Empty => new GetOrganizationCustomRoleInvokeArgs(); + } + + + [OutputType] + public sealed class GetOrganizationCustomRoleResult + { + /// + /// The system role from which the role inherits permissions. + /// + public readonly string BaseRole; + /// + /// The description for the custom role. + /// + public readonly string Description; + /// + /// The provider-assigned unique ID for this managed resource. + /// + public readonly string Id; + public readonly string Name; + /// + /// A list of additional permissions included in this role. + /// + public readonly ImmutableArray Permissions; + + [OutputConstructor] + private GetOrganizationCustomRoleResult( + string baseRole, + + string description, + + string id, + + string name, + + ImmutableArray permissions) + { + BaseRole = baseRole; + Description = description; + Id = id; + Name = name; + Permissions = permissions; + } + } +} diff --git a/sdk/dotnet/OrganizationCustomRole.cs b/sdk/dotnet/OrganizationCustomRole.cs new file mode 100644 index 00000000..547e094b --- /dev/null +++ b/sdk/dotnet/OrganizationCustomRole.cs @@ -0,0 +1,212 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github +{ + /// + /// This resource allows you to create and manage custom roles in a GitHub Organization for use in repositories. + /// + /// > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + /// + /// ## Example Usage + /// + /// ```csharp + /// using System.Collections.Generic; + /// using System.Linq; + /// using Pulumi; + /// using Github = Pulumi.Github; + /// + /// return await Deployment.RunAsync(() => + /// { + /// var example = new Github.OrganizationCustomRole("example", new() + /// { + /// BaseRole = "read", + /// Description = "Example custom role that uses the read role as its base", + /// Permissions = new[] + /// { + /// "add_assignee", + /// "add_label", + /// "bypass_branch_protection", + /// "close_issue", + /// "close_pull_request", + /// "mark_as_duplicate", + /// "create_tag", + /// "delete_issue", + /// "delete_tag", + /// "manage_deploy_keys", + /// "push_protected_branch", + /// "read_code_scanning", + /// "reopen_issue", + /// "reopen_pull_request", + /// "request_pr_review", + /// "resolve_dependabot_alerts", + /// "resolve_secret_scanning_alerts", + /// "view_secret_scanning_alerts", + /// "write_code_scanning", + /// }, + /// }); + /// + /// }); + /// ``` + /// + /// ## Import + /// + /// Custom roles can be imported using the `id` of the role. The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API. + /// + /// ```sh + /// $ pulumi import github:index/organizationCustomRole:OrganizationCustomRole example 1234 + /// ``` + /// + [GithubResourceType("github:index/organizationCustomRole:OrganizationCustomRole")] + public partial class OrganizationCustomRole : global::Pulumi.CustomResource + { + /// + /// The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + /// + [Output("baseRole")] + public Output BaseRole { get; private set; } = null!; + + /// + /// The description for the custom role. + /// + [Output("description")] + public Output Description { get; private set; } = null!; + + /// + /// The name of the custom role. + /// + [Output("name")] + public Output Name { get; private set; } = null!; + + /// + /// A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + /// + [Output("permissions")] + public Output> Permissions { get; private set; } = null!; + + + /// + /// Create a OrganizationCustomRole resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public OrganizationCustomRole(string name, OrganizationCustomRoleArgs args, CustomResourceOptions? options = null) + : base("github:index/organizationCustomRole:OrganizationCustomRole", name, args ?? new OrganizationCustomRoleArgs(), MakeResourceOptions(options, "")) + { + } + + private OrganizationCustomRole(string name, Input id, OrganizationCustomRoleState? state = null, CustomResourceOptions? options = null) + : base("github:index/organizationCustomRole:OrganizationCustomRole", name, state, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing OrganizationCustomRole resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// Any extra arguments used during the lookup. + /// A bag of options that control this resource's behavior + public static OrganizationCustomRole Get(string name, Input id, OrganizationCustomRoleState? state = null, CustomResourceOptions? options = null) + { + return new OrganizationCustomRole(name, id, state, options); + } + } + + public sealed class OrganizationCustomRoleArgs : global::Pulumi.ResourceArgs + { + /// + /// The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + /// + [Input("baseRole", required: true)] + public Input BaseRole { get; set; } = null!; + + /// + /// The description for the custom role. + /// + [Input("description")] + public Input? Description { get; set; } + + /// + /// The name of the custom role. + /// + [Input("name")] + public Input? Name { get; set; } + + [Input("permissions", required: true)] + private InputList? _permissions; + + /// + /// A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + /// + public InputList Permissions + { + get => _permissions ?? (_permissions = new InputList()); + set => _permissions = value; + } + + public OrganizationCustomRoleArgs() + { + } + public static new OrganizationCustomRoleArgs Empty => new OrganizationCustomRoleArgs(); + } + + public sealed class OrganizationCustomRoleState : global::Pulumi.ResourceArgs + { + /// + /// The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + /// + [Input("baseRole")] + public Input? BaseRole { get; set; } + + /// + /// The description for the custom role. + /// + [Input("description")] + public Input? Description { get; set; } + + /// + /// The name of the custom role. + /// + [Input("name")] + public Input? Name { get; set; } + + [Input("permissions")] + private InputList? _permissions; + + /// + /// A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + /// + public InputList Permissions + { + get => _permissions ?? (_permissions = new InputList()); + set => _permissions = value; + } + + public OrganizationCustomRoleState() + { + } + public static new OrganizationCustomRoleState Empty => new OrganizationCustomRoleState(); + } +} diff --git a/sdk/dotnet/Outputs/GetCodespacesOrganizationSecretsSecretResult.cs b/sdk/dotnet/Outputs/GetCodespacesOrganizationSecretsSecretResult.cs new file mode 100644 index 00000000..f9446b0c --- /dev/null +++ b/sdk/dotnet/Outputs/GetCodespacesOrganizationSecretsSecretResult.cs @@ -0,0 +1,49 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github.Outputs +{ + + [OutputType] + public sealed class GetCodespacesOrganizationSecretsSecretResult + { + /// + /// Timestamp of the secret creation + /// + public readonly string CreatedAt; + /// + /// Secret name + /// + public readonly string Name; + /// + /// Timestamp of the secret last update + /// + public readonly string UpdatedAt; + /// + /// Secret visibility + /// + public readonly string Visibility; + + [OutputConstructor] + private GetCodespacesOrganizationSecretsSecretResult( + string createdAt, + + string name, + + string updatedAt, + + string visibility) + { + CreatedAt = createdAt; + Name = name; + UpdatedAt = updatedAt; + Visibility = visibility; + } + } +} diff --git a/sdk/dotnet/Outputs/GetCodespacesSecretsSecretResult.cs b/sdk/dotnet/Outputs/GetCodespacesSecretsSecretResult.cs new file mode 100644 index 00000000..e3d66807 --- /dev/null +++ b/sdk/dotnet/Outputs/GetCodespacesSecretsSecretResult.cs @@ -0,0 +1,42 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github.Outputs +{ + + [OutputType] + public sealed class GetCodespacesSecretsSecretResult + { + /// + /// Timestamp of the secret creation + /// + public readonly string CreatedAt; + /// + /// The name of the repository. + /// + public readonly string Name; + /// + /// Timestamp of the secret last update + /// + public readonly string UpdatedAt; + + [OutputConstructor] + private GetCodespacesSecretsSecretResult( + string createdAt, + + string name, + + string updatedAt) + { + CreatedAt = createdAt; + Name = name; + UpdatedAt = updatedAt; + } + } +} diff --git a/sdk/dotnet/Outputs/GetCodespacesUserSecretsSecretResult.cs b/sdk/dotnet/Outputs/GetCodespacesUserSecretsSecretResult.cs new file mode 100644 index 00000000..8104165d --- /dev/null +++ b/sdk/dotnet/Outputs/GetCodespacesUserSecretsSecretResult.cs @@ -0,0 +1,49 @@ +// *** 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! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; + +namespace Pulumi.Github.Outputs +{ + + [OutputType] + public sealed class GetCodespacesUserSecretsSecretResult + { + /// + /// Timestamp of the secret creation + /// + public readonly string CreatedAt; + /// + /// Secret name + /// + public readonly string Name; + /// + /// Timestamp of the secret last update + /// + public readonly string UpdatedAt; + /// + /// Secret visibility + /// + public readonly string Visibility; + + [OutputConstructor] + private GetCodespacesUserSecretsSecretResult( + string createdAt, + + string name, + + string updatedAt, + + string visibility) + { + CreatedAt = createdAt; + Name = name; + UpdatedAt = updatedAt; + Visibility = visibility; + } + } +} diff --git a/sdk/go/github/codespacesOrganizationSecret.go b/sdk/go/github/codespacesOrganizationSecret.go new file mode 100644 index 00000000..1e0b2f95 --- /dev/null +++ b/sdk/go/github/codespacesOrganizationSecret.go @@ -0,0 +1,411 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package github + +import ( + "context" + "reflect" + + "errors" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewCodespacesOrganizationSecret(ctx, "exampleSecretCodespacesOrganizationSecret", &github.CodespacesOrganizationSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// Visibility: pulumi.String("private"), +// PlaintextValue: pulumi.Any(_var.Some_secret_string), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesOrganizationSecret(ctx, "exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", &github.CodespacesOrganizationSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// Visibility: pulumi.String("private"), +// EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// FullName: pulumi.StringRef("my-org/repo"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesOrganizationSecret(ctx, "exampleSecretCodespacesOrganizationSecret", &github.CodespacesOrganizationSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// Visibility: pulumi.String("selected"), +// PlaintextValue: pulumi.Any(_var.Some_secret_string), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesOrganizationSecret(ctx, "exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", &github.CodespacesOrganizationSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// Visibility: pulumi.String("selected"), +// EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ## Import +// +// # This resource can be imported using an ID made up of the secret name +// +// ```sh +// +// $ pulumi import github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret test_secret test_secret_name +// +// ``` +// +// NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. +type CodespacesOrganizationSecret struct { + pulumi.CustomResourceState + + // Date of codespacesSecret creation. + CreatedAt pulumi.StringOutput `pulumi:"createdAt"` + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue pulumi.StringPtrOutput `pulumi:"encryptedValue"` + // Plaintext value of the secret to be encrypted + PlaintextValue pulumi.StringPtrOutput `pulumi:"plaintextValue"` + // Name of the secret + SecretName pulumi.StringOutput `pulumi:"secretName"` + // An array of repository ids that can access the organization secret. + SelectedRepositoryIds pulumi.IntArrayOutput `pulumi:"selectedRepositoryIds"` + // Date of codespacesSecret update. + UpdatedAt pulumi.StringOutput `pulumi:"updatedAt"` + // Configures the access that repositories have to the organization secret. + // Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`. + Visibility pulumi.StringOutput `pulumi:"visibility"` +} + +// NewCodespacesOrganizationSecret registers a new resource with the given unique name, arguments, and options. +func NewCodespacesOrganizationSecret(ctx *pulumi.Context, + name string, args *CodespacesOrganizationSecretArgs, opts ...pulumi.ResourceOption) (*CodespacesOrganizationSecret, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.SecretName == nil { + return nil, errors.New("invalid value for required argument 'SecretName'") + } + if args.Visibility == nil { + return nil, errors.New("invalid value for required argument 'Visibility'") + } + if args.EncryptedValue != nil { + args.EncryptedValue = pulumi.ToSecret(args.EncryptedValue).(pulumi.StringPtrInput) + } + if args.PlaintextValue != nil { + args.PlaintextValue = pulumi.ToSecret(args.PlaintextValue).(pulumi.StringPtrInput) + } + secrets := pulumi.AdditionalSecretOutputs([]string{ + "encryptedValue", + "plaintextValue", + }) + opts = append(opts, secrets) + var resource CodespacesOrganizationSecret + err := ctx.RegisterResource("github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetCodespacesOrganizationSecret gets an existing CodespacesOrganizationSecret resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetCodespacesOrganizationSecret(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *CodespacesOrganizationSecretState, opts ...pulumi.ResourceOption) (*CodespacesOrganizationSecret, error) { + var resource CodespacesOrganizationSecret + err := ctx.ReadResource("github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering CodespacesOrganizationSecret resources. +type codespacesOrganizationSecretState struct { + // Date of codespacesSecret creation. + CreatedAt *string `pulumi:"createdAt"` + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue *string `pulumi:"encryptedValue"` + // Plaintext value of the secret to be encrypted + PlaintextValue *string `pulumi:"plaintextValue"` + // Name of the secret + SecretName *string `pulumi:"secretName"` + // An array of repository ids that can access the organization secret. + SelectedRepositoryIds []int `pulumi:"selectedRepositoryIds"` + // Date of codespacesSecret update. + UpdatedAt *string `pulumi:"updatedAt"` + // Configures the access that repositories have to the organization secret. + // Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`. + Visibility *string `pulumi:"visibility"` +} + +type CodespacesOrganizationSecretState struct { + // Date of codespacesSecret creation. + CreatedAt pulumi.StringPtrInput + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue pulumi.StringPtrInput + // Plaintext value of the secret to be encrypted + PlaintextValue pulumi.StringPtrInput + // Name of the secret + SecretName pulumi.StringPtrInput + // An array of repository ids that can access the organization secret. + SelectedRepositoryIds pulumi.IntArrayInput + // Date of codespacesSecret update. + UpdatedAt pulumi.StringPtrInput + // Configures the access that repositories have to the organization secret. + // Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`. + Visibility pulumi.StringPtrInput +} + +func (CodespacesOrganizationSecretState) ElementType() reflect.Type { + return reflect.TypeOf((*codespacesOrganizationSecretState)(nil)).Elem() +} + +type codespacesOrganizationSecretArgs struct { + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue *string `pulumi:"encryptedValue"` + // Plaintext value of the secret to be encrypted + PlaintextValue *string `pulumi:"plaintextValue"` + // Name of the secret + SecretName string `pulumi:"secretName"` + // An array of repository ids that can access the organization secret. + SelectedRepositoryIds []int `pulumi:"selectedRepositoryIds"` + // Configures the access that repositories have to the organization secret. + // Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`. + Visibility string `pulumi:"visibility"` +} + +// The set of arguments for constructing a CodespacesOrganizationSecret resource. +type CodespacesOrganizationSecretArgs struct { + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue pulumi.StringPtrInput + // Plaintext value of the secret to be encrypted + PlaintextValue pulumi.StringPtrInput + // Name of the secret + SecretName pulumi.StringInput + // An array of repository ids that can access the organization secret. + SelectedRepositoryIds pulumi.IntArrayInput + // Configures the access that repositories have to the organization secret. + // Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`. + Visibility pulumi.StringInput +} + +func (CodespacesOrganizationSecretArgs) ElementType() reflect.Type { + return reflect.TypeOf((*codespacesOrganizationSecretArgs)(nil)).Elem() +} + +type CodespacesOrganizationSecretInput interface { + pulumi.Input + + ToCodespacesOrganizationSecretOutput() CodespacesOrganizationSecretOutput + ToCodespacesOrganizationSecretOutputWithContext(ctx context.Context) CodespacesOrganizationSecretOutput +} + +func (*CodespacesOrganizationSecret) ElementType() reflect.Type { + return reflect.TypeOf((**CodespacesOrganizationSecret)(nil)).Elem() +} + +func (i *CodespacesOrganizationSecret) ToCodespacesOrganizationSecretOutput() CodespacesOrganizationSecretOutput { + return i.ToCodespacesOrganizationSecretOutputWithContext(context.Background()) +} + +func (i *CodespacesOrganizationSecret) ToCodespacesOrganizationSecretOutputWithContext(ctx context.Context) CodespacesOrganizationSecretOutput { + return pulumi.ToOutputWithContext(ctx, i).(CodespacesOrganizationSecretOutput) +} + +// CodespacesOrganizationSecretArrayInput is an input type that accepts CodespacesOrganizationSecretArray and CodespacesOrganizationSecretArrayOutput values. +// You can construct a concrete instance of `CodespacesOrganizationSecretArrayInput` via: +// +// CodespacesOrganizationSecretArray{ CodespacesOrganizationSecretArgs{...} } +type CodespacesOrganizationSecretArrayInput interface { + pulumi.Input + + ToCodespacesOrganizationSecretArrayOutput() CodespacesOrganizationSecretArrayOutput + ToCodespacesOrganizationSecretArrayOutputWithContext(context.Context) CodespacesOrganizationSecretArrayOutput +} + +type CodespacesOrganizationSecretArray []CodespacesOrganizationSecretInput + +func (CodespacesOrganizationSecretArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]*CodespacesOrganizationSecret)(nil)).Elem() +} + +func (i CodespacesOrganizationSecretArray) ToCodespacesOrganizationSecretArrayOutput() CodespacesOrganizationSecretArrayOutput { + return i.ToCodespacesOrganizationSecretArrayOutputWithContext(context.Background()) +} + +func (i CodespacesOrganizationSecretArray) ToCodespacesOrganizationSecretArrayOutputWithContext(ctx context.Context) CodespacesOrganizationSecretArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(CodespacesOrganizationSecretArrayOutput) +} + +// CodespacesOrganizationSecretMapInput is an input type that accepts CodespacesOrganizationSecretMap and CodespacesOrganizationSecretMapOutput values. +// You can construct a concrete instance of `CodespacesOrganizationSecretMapInput` via: +// +// CodespacesOrganizationSecretMap{ "key": CodespacesOrganizationSecretArgs{...} } +type CodespacesOrganizationSecretMapInput interface { + pulumi.Input + + ToCodespacesOrganizationSecretMapOutput() CodespacesOrganizationSecretMapOutput + ToCodespacesOrganizationSecretMapOutputWithContext(context.Context) CodespacesOrganizationSecretMapOutput +} + +type CodespacesOrganizationSecretMap map[string]CodespacesOrganizationSecretInput + +func (CodespacesOrganizationSecretMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*CodespacesOrganizationSecret)(nil)).Elem() +} + +func (i CodespacesOrganizationSecretMap) ToCodespacesOrganizationSecretMapOutput() CodespacesOrganizationSecretMapOutput { + return i.ToCodespacesOrganizationSecretMapOutputWithContext(context.Background()) +} + +func (i CodespacesOrganizationSecretMap) ToCodespacesOrganizationSecretMapOutputWithContext(ctx context.Context) CodespacesOrganizationSecretMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(CodespacesOrganizationSecretMapOutput) +} + +type CodespacesOrganizationSecretOutput struct{ *pulumi.OutputState } + +func (CodespacesOrganizationSecretOutput) ElementType() reflect.Type { + return reflect.TypeOf((**CodespacesOrganizationSecret)(nil)).Elem() +} + +func (o CodespacesOrganizationSecretOutput) ToCodespacesOrganizationSecretOutput() CodespacesOrganizationSecretOutput { + return o +} + +func (o CodespacesOrganizationSecretOutput) ToCodespacesOrganizationSecretOutputWithContext(ctx context.Context) CodespacesOrganizationSecretOutput { + return o +} + +// Date of codespacesSecret creation. +func (o CodespacesOrganizationSecretOutput) CreatedAt() pulumi.StringOutput { + return o.ApplyT(func(v *CodespacesOrganizationSecret) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput) +} + +// Encrypted value of the secret using the GitHub public key in Base64 format. +func (o CodespacesOrganizationSecretOutput) EncryptedValue() pulumi.StringPtrOutput { + return o.ApplyT(func(v *CodespacesOrganizationSecret) pulumi.StringPtrOutput { return v.EncryptedValue }).(pulumi.StringPtrOutput) +} + +// Plaintext value of the secret to be encrypted +func (o CodespacesOrganizationSecretOutput) PlaintextValue() pulumi.StringPtrOutput { + return o.ApplyT(func(v *CodespacesOrganizationSecret) pulumi.StringPtrOutput { return v.PlaintextValue }).(pulumi.StringPtrOutput) +} + +// Name of the secret +func (o CodespacesOrganizationSecretOutput) SecretName() pulumi.StringOutput { + return o.ApplyT(func(v *CodespacesOrganizationSecret) pulumi.StringOutput { return v.SecretName }).(pulumi.StringOutput) +} + +// An array of repository ids that can access the organization secret. +func (o CodespacesOrganizationSecretOutput) SelectedRepositoryIds() pulumi.IntArrayOutput { + return o.ApplyT(func(v *CodespacesOrganizationSecret) pulumi.IntArrayOutput { return v.SelectedRepositoryIds }).(pulumi.IntArrayOutput) +} + +// Date of codespacesSecret update. +func (o CodespacesOrganizationSecretOutput) UpdatedAt() pulumi.StringOutput { + return o.ApplyT(func(v *CodespacesOrganizationSecret) pulumi.StringOutput { return v.UpdatedAt }).(pulumi.StringOutput) +} + +// Configures the access that repositories have to the organization secret. +// Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`. +func (o CodespacesOrganizationSecretOutput) Visibility() pulumi.StringOutput { + return o.ApplyT(func(v *CodespacesOrganizationSecret) pulumi.StringOutput { return v.Visibility }).(pulumi.StringOutput) +} + +type CodespacesOrganizationSecretArrayOutput struct{ *pulumi.OutputState } + +func (CodespacesOrganizationSecretArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]*CodespacesOrganizationSecret)(nil)).Elem() +} + +func (o CodespacesOrganizationSecretArrayOutput) ToCodespacesOrganizationSecretArrayOutput() CodespacesOrganizationSecretArrayOutput { + return o +} + +func (o CodespacesOrganizationSecretArrayOutput) ToCodespacesOrganizationSecretArrayOutputWithContext(ctx context.Context) CodespacesOrganizationSecretArrayOutput { + return o +} + +func (o CodespacesOrganizationSecretArrayOutput) Index(i pulumi.IntInput) CodespacesOrganizationSecretOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CodespacesOrganizationSecret { + return vs[0].([]*CodespacesOrganizationSecret)[vs[1].(int)] + }).(CodespacesOrganizationSecretOutput) +} + +type CodespacesOrganizationSecretMapOutput struct{ *pulumi.OutputState } + +func (CodespacesOrganizationSecretMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*CodespacesOrganizationSecret)(nil)).Elem() +} + +func (o CodespacesOrganizationSecretMapOutput) ToCodespacesOrganizationSecretMapOutput() CodespacesOrganizationSecretMapOutput { + return o +} + +func (o CodespacesOrganizationSecretMapOutput) ToCodespacesOrganizationSecretMapOutputWithContext(ctx context.Context) CodespacesOrganizationSecretMapOutput { + return o +} + +func (o CodespacesOrganizationSecretMapOutput) MapIndex(k pulumi.StringInput) CodespacesOrganizationSecretOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CodespacesOrganizationSecret { + return vs[0].(map[string]*CodespacesOrganizationSecret)[vs[1].(string)] + }).(CodespacesOrganizationSecretOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*CodespacesOrganizationSecretInput)(nil)).Elem(), &CodespacesOrganizationSecret{}) + pulumi.RegisterInputType(reflect.TypeOf((*CodespacesOrganizationSecretArrayInput)(nil)).Elem(), CodespacesOrganizationSecretArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*CodespacesOrganizationSecretMapInput)(nil)).Elem(), CodespacesOrganizationSecretMap{}) + pulumi.RegisterOutputType(CodespacesOrganizationSecretOutput{}) + pulumi.RegisterOutputType(CodespacesOrganizationSecretArrayOutput{}) + pulumi.RegisterOutputType(CodespacesOrganizationSecretMapOutput{}) +} diff --git a/sdk/go/github/codespacesSecret.go b/sdk/go/github/codespacesSecret.go new file mode 100644 index 00000000..bfcdaa3a --- /dev/null +++ b/sdk/go/github/codespacesSecret.go @@ -0,0 +1,338 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package github + +import ( + "context" + "reflect" + + "errors" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesPublicKey(ctx, &github.GetCodespacesPublicKeyArgs{ +// Repository: "example_repository", +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesSecret(ctx, "exampleSecretCodespacesSecret", &github.CodespacesSecretArgs{ +// Repository: pulumi.String("example_repository"), +// SecretName: pulumi.String("example_secret_name"), +// PlaintextValue: pulumi.Any(_var.Some_secret_string), +// }) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesSecret(ctx, "exampleSecretIndex/codespacesSecretCodespacesSecret", &github.CodespacesSecretArgs{ +// Repository: pulumi.String("example_repository"), +// SecretName: pulumi.String("example_secret_name"), +// EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string), +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +type CodespacesSecret struct { + pulumi.CustomResourceState + + // Date of actionsSecret creation. + CreatedAt pulumi.StringOutput `pulumi:"createdAt"` + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue pulumi.StringPtrOutput `pulumi:"encryptedValue"` + // Plaintext value of the secret to be encrypted + PlaintextValue pulumi.StringPtrOutput `pulumi:"plaintextValue"` + // Name of the repository + Repository pulumi.StringOutput `pulumi:"repository"` + // Name of the secret + SecretName pulumi.StringOutput `pulumi:"secretName"` + // Date of actionsSecret update. + UpdatedAt pulumi.StringOutput `pulumi:"updatedAt"` +} + +// NewCodespacesSecret registers a new resource with the given unique name, arguments, and options. +func NewCodespacesSecret(ctx *pulumi.Context, + name string, args *CodespacesSecretArgs, opts ...pulumi.ResourceOption) (*CodespacesSecret, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.Repository == nil { + return nil, errors.New("invalid value for required argument 'Repository'") + } + if args.SecretName == nil { + return nil, errors.New("invalid value for required argument 'SecretName'") + } + if args.EncryptedValue != nil { + args.EncryptedValue = pulumi.ToSecret(args.EncryptedValue).(pulumi.StringPtrInput) + } + if args.PlaintextValue != nil { + args.PlaintextValue = pulumi.ToSecret(args.PlaintextValue).(pulumi.StringPtrInput) + } + secrets := pulumi.AdditionalSecretOutputs([]string{ + "encryptedValue", + "plaintextValue", + }) + opts = append(opts, secrets) + var resource CodespacesSecret + err := ctx.RegisterResource("github:index/codespacesSecret:CodespacesSecret", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetCodespacesSecret gets an existing CodespacesSecret resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetCodespacesSecret(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *CodespacesSecretState, opts ...pulumi.ResourceOption) (*CodespacesSecret, error) { + var resource CodespacesSecret + err := ctx.ReadResource("github:index/codespacesSecret:CodespacesSecret", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering CodespacesSecret resources. +type codespacesSecretState struct { + // Date of actionsSecret creation. + CreatedAt *string `pulumi:"createdAt"` + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue *string `pulumi:"encryptedValue"` + // Plaintext value of the secret to be encrypted + PlaintextValue *string `pulumi:"plaintextValue"` + // Name of the repository + Repository *string `pulumi:"repository"` + // Name of the secret + SecretName *string `pulumi:"secretName"` + // Date of actionsSecret update. + UpdatedAt *string `pulumi:"updatedAt"` +} + +type CodespacesSecretState struct { + // Date of actionsSecret creation. + CreatedAt pulumi.StringPtrInput + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue pulumi.StringPtrInput + // Plaintext value of the secret to be encrypted + PlaintextValue pulumi.StringPtrInput + // Name of the repository + Repository pulumi.StringPtrInput + // Name of the secret + SecretName pulumi.StringPtrInput + // Date of actionsSecret update. + UpdatedAt pulumi.StringPtrInput +} + +func (CodespacesSecretState) ElementType() reflect.Type { + return reflect.TypeOf((*codespacesSecretState)(nil)).Elem() +} + +type codespacesSecretArgs struct { + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue *string `pulumi:"encryptedValue"` + // Plaintext value of the secret to be encrypted + PlaintextValue *string `pulumi:"plaintextValue"` + // Name of the repository + Repository string `pulumi:"repository"` + // Name of the secret + SecretName string `pulumi:"secretName"` +} + +// The set of arguments for constructing a CodespacesSecret resource. +type CodespacesSecretArgs struct { + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue pulumi.StringPtrInput + // Plaintext value of the secret to be encrypted + PlaintextValue pulumi.StringPtrInput + // Name of the repository + Repository pulumi.StringInput + // Name of the secret + SecretName pulumi.StringInput +} + +func (CodespacesSecretArgs) ElementType() reflect.Type { + return reflect.TypeOf((*codespacesSecretArgs)(nil)).Elem() +} + +type CodespacesSecretInput interface { + pulumi.Input + + ToCodespacesSecretOutput() CodespacesSecretOutput + ToCodespacesSecretOutputWithContext(ctx context.Context) CodespacesSecretOutput +} + +func (*CodespacesSecret) ElementType() reflect.Type { + return reflect.TypeOf((**CodespacesSecret)(nil)).Elem() +} + +func (i *CodespacesSecret) ToCodespacesSecretOutput() CodespacesSecretOutput { + return i.ToCodespacesSecretOutputWithContext(context.Background()) +} + +func (i *CodespacesSecret) ToCodespacesSecretOutputWithContext(ctx context.Context) CodespacesSecretOutput { + return pulumi.ToOutputWithContext(ctx, i).(CodespacesSecretOutput) +} + +// CodespacesSecretArrayInput is an input type that accepts CodespacesSecretArray and CodespacesSecretArrayOutput values. +// You can construct a concrete instance of `CodespacesSecretArrayInput` via: +// +// CodespacesSecretArray{ CodespacesSecretArgs{...} } +type CodespacesSecretArrayInput interface { + pulumi.Input + + ToCodespacesSecretArrayOutput() CodespacesSecretArrayOutput + ToCodespacesSecretArrayOutputWithContext(context.Context) CodespacesSecretArrayOutput +} + +type CodespacesSecretArray []CodespacesSecretInput + +func (CodespacesSecretArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]*CodespacesSecret)(nil)).Elem() +} + +func (i CodespacesSecretArray) ToCodespacesSecretArrayOutput() CodespacesSecretArrayOutput { + return i.ToCodespacesSecretArrayOutputWithContext(context.Background()) +} + +func (i CodespacesSecretArray) ToCodespacesSecretArrayOutputWithContext(ctx context.Context) CodespacesSecretArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(CodespacesSecretArrayOutput) +} + +// CodespacesSecretMapInput is an input type that accepts CodespacesSecretMap and CodespacesSecretMapOutput values. +// You can construct a concrete instance of `CodespacesSecretMapInput` via: +// +// CodespacesSecretMap{ "key": CodespacesSecretArgs{...} } +type CodespacesSecretMapInput interface { + pulumi.Input + + ToCodespacesSecretMapOutput() CodespacesSecretMapOutput + ToCodespacesSecretMapOutputWithContext(context.Context) CodespacesSecretMapOutput +} + +type CodespacesSecretMap map[string]CodespacesSecretInput + +func (CodespacesSecretMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*CodespacesSecret)(nil)).Elem() +} + +func (i CodespacesSecretMap) ToCodespacesSecretMapOutput() CodespacesSecretMapOutput { + return i.ToCodespacesSecretMapOutputWithContext(context.Background()) +} + +func (i CodespacesSecretMap) ToCodespacesSecretMapOutputWithContext(ctx context.Context) CodespacesSecretMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(CodespacesSecretMapOutput) +} + +type CodespacesSecretOutput struct{ *pulumi.OutputState } + +func (CodespacesSecretOutput) ElementType() reflect.Type { + return reflect.TypeOf((**CodespacesSecret)(nil)).Elem() +} + +func (o CodespacesSecretOutput) ToCodespacesSecretOutput() CodespacesSecretOutput { + return o +} + +func (o CodespacesSecretOutput) ToCodespacesSecretOutputWithContext(ctx context.Context) CodespacesSecretOutput { + return o +} + +// Date of actionsSecret creation. +func (o CodespacesSecretOutput) CreatedAt() pulumi.StringOutput { + return o.ApplyT(func(v *CodespacesSecret) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput) +} + +// Encrypted value of the secret using the GitHub public key in Base64 format. +func (o CodespacesSecretOutput) EncryptedValue() pulumi.StringPtrOutput { + return o.ApplyT(func(v *CodespacesSecret) pulumi.StringPtrOutput { return v.EncryptedValue }).(pulumi.StringPtrOutput) +} + +// Plaintext value of the secret to be encrypted +func (o CodespacesSecretOutput) PlaintextValue() pulumi.StringPtrOutput { + return o.ApplyT(func(v *CodespacesSecret) pulumi.StringPtrOutput { return v.PlaintextValue }).(pulumi.StringPtrOutput) +} + +// Name of the repository +func (o CodespacesSecretOutput) Repository() pulumi.StringOutput { + return o.ApplyT(func(v *CodespacesSecret) pulumi.StringOutput { return v.Repository }).(pulumi.StringOutput) +} + +// Name of the secret +func (o CodespacesSecretOutput) SecretName() pulumi.StringOutput { + return o.ApplyT(func(v *CodespacesSecret) pulumi.StringOutput { return v.SecretName }).(pulumi.StringOutput) +} + +// Date of actionsSecret update. +func (o CodespacesSecretOutput) UpdatedAt() pulumi.StringOutput { + return o.ApplyT(func(v *CodespacesSecret) pulumi.StringOutput { return v.UpdatedAt }).(pulumi.StringOutput) +} + +type CodespacesSecretArrayOutput struct{ *pulumi.OutputState } + +func (CodespacesSecretArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]*CodespacesSecret)(nil)).Elem() +} + +func (o CodespacesSecretArrayOutput) ToCodespacesSecretArrayOutput() CodespacesSecretArrayOutput { + return o +} + +func (o CodespacesSecretArrayOutput) ToCodespacesSecretArrayOutputWithContext(ctx context.Context) CodespacesSecretArrayOutput { + return o +} + +func (o CodespacesSecretArrayOutput) Index(i pulumi.IntInput) CodespacesSecretOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CodespacesSecret { + return vs[0].([]*CodespacesSecret)[vs[1].(int)] + }).(CodespacesSecretOutput) +} + +type CodespacesSecretMapOutput struct{ *pulumi.OutputState } + +func (CodespacesSecretMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*CodespacesSecret)(nil)).Elem() +} + +func (o CodespacesSecretMapOutput) ToCodespacesSecretMapOutput() CodespacesSecretMapOutput { + return o +} + +func (o CodespacesSecretMapOutput) ToCodespacesSecretMapOutputWithContext(ctx context.Context) CodespacesSecretMapOutput { + return o +} + +func (o CodespacesSecretMapOutput) MapIndex(k pulumi.StringInput) CodespacesSecretOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CodespacesSecret { + return vs[0].(map[string]*CodespacesSecret)[vs[1].(string)] + }).(CodespacesSecretOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*CodespacesSecretInput)(nil)).Elem(), &CodespacesSecret{}) + pulumi.RegisterInputType(reflect.TypeOf((*CodespacesSecretArrayInput)(nil)).Elem(), CodespacesSecretArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*CodespacesSecretMapInput)(nil)).Elem(), CodespacesSecretMap{}) + pulumi.RegisterOutputType(CodespacesSecretOutput{}) + pulumi.RegisterOutputType(CodespacesSecretArrayOutput{}) + pulumi.RegisterOutputType(CodespacesSecretMapOutput{}) +} diff --git a/sdk/go/github/codespacesUserSecret.go b/sdk/go/github/codespacesUserSecret.go new file mode 100644 index 00000000..ed8baac4 --- /dev/null +++ b/sdk/go/github/codespacesUserSecret.go @@ -0,0 +1,351 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package github + +import ( + "context" + "reflect" + + "errors" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{ +// FullName: pulumi.StringRef("my-org/repo"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesUserSecret(ctx, "exampleSecretCodespacesUserSecret", &github.CodespacesUserSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// PlaintextValue: pulumi.Any(_var.Some_secret_string), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// _, err = github.NewCodespacesUserSecret(ctx, "exampleSecretIndex/codespacesUserSecretCodespacesUserSecret", &github.CodespacesUserSecretArgs{ +// SecretName: pulumi.String("example_secret_name"), +// EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string), +// SelectedRepositoryIds: pulumi.IntArray{ +// *pulumi.Int(repo.RepoId), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ## Import +// +// # This resource can be imported using an ID made up of the secret name +// +// ```sh +// +// $ pulumi import github:index/codespacesUserSecret:CodespacesUserSecret test_secret test_secret_name +// +// ``` +// +// NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. +type CodespacesUserSecret struct { + pulumi.CustomResourceState + + // Date of codespacesSecret creation. + CreatedAt pulumi.StringOutput `pulumi:"createdAt"` + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue pulumi.StringPtrOutput `pulumi:"encryptedValue"` + // Plaintext value of the secret to be encrypted + PlaintextValue pulumi.StringPtrOutput `pulumi:"plaintextValue"` + // Name of the secret + SecretName pulumi.StringOutput `pulumi:"secretName"` + // An array of repository ids that can access the user secret. + SelectedRepositoryIds pulumi.IntArrayOutput `pulumi:"selectedRepositoryIds"` + // Date of codespacesSecret update. + UpdatedAt pulumi.StringOutput `pulumi:"updatedAt"` +} + +// NewCodespacesUserSecret registers a new resource with the given unique name, arguments, and options. +func NewCodespacesUserSecret(ctx *pulumi.Context, + name string, args *CodespacesUserSecretArgs, opts ...pulumi.ResourceOption) (*CodespacesUserSecret, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.SecretName == nil { + return nil, errors.New("invalid value for required argument 'SecretName'") + } + if args.EncryptedValue != nil { + args.EncryptedValue = pulumi.ToSecret(args.EncryptedValue).(pulumi.StringPtrInput) + } + if args.PlaintextValue != nil { + args.PlaintextValue = pulumi.ToSecret(args.PlaintextValue).(pulumi.StringPtrInput) + } + secrets := pulumi.AdditionalSecretOutputs([]string{ + "encryptedValue", + "plaintextValue", + }) + opts = append(opts, secrets) + var resource CodespacesUserSecret + err := ctx.RegisterResource("github:index/codespacesUserSecret:CodespacesUserSecret", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetCodespacesUserSecret gets an existing CodespacesUserSecret resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetCodespacesUserSecret(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *CodespacesUserSecretState, opts ...pulumi.ResourceOption) (*CodespacesUserSecret, error) { + var resource CodespacesUserSecret + err := ctx.ReadResource("github:index/codespacesUserSecret:CodespacesUserSecret", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering CodespacesUserSecret resources. +type codespacesUserSecretState struct { + // Date of codespacesSecret creation. + CreatedAt *string `pulumi:"createdAt"` + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue *string `pulumi:"encryptedValue"` + // Plaintext value of the secret to be encrypted + PlaintextValue *string `pulumi:"plaintextValue"` + // Name of the secret + SecretName *string `pulumi:"secretName"` + // An array of repository ids that can access the user secret. + SelectedRepositoryIds []int `pulumi:"selectedRepositoryIds"` + // Date of codespacesSecret update. + UpdatedAt *string `pulumi:"updatedAt"` +} + +type CodespacesUserSecretState struct { + // Date of codespacesSecret creation. + CreatedAt pulumi.StringPtrInput + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue pulumi.StringPtrInput + // Plaintext value of the secret to be encrypted + PlaintextValue pulumi.StringPtrInput + // Name of the secret + SecretName pulumi.StringPtrInput + // An array of repository ids that can access the user secret. + SelectedRepositoryIds pulumi.IntArrayInput + // Date of codespacesSecret update. + UpdatedAt pulumi.StringPtrInput +} + +func (CodespacesUserSecretState) ElementType() reflect.Type { + return reflect.TypeOf((*codespacesUserSecretState)(nil)).Elem() +} + +type codespacesUserSecretArgs struct { + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue *string `pulumi:"encryptedValue"` + // Plaintext value of the secret to be encrypted + PlaintextValue *string `pulumi:"plaintextValue"` + // Name of the secret + SecretName string `pulumi:"secretName"` + // An array of repository ids that can access the user secret. + SelectedRepositoryIds []int `pulumi:"selectedRepositoryIds"` +} + +// The set of arguments for constructing a CodespacesUserSecret resource. +type CodespacesUserSecretArgs struct { + // Encrypted value of the secret using the GitHub public key in Base64 format. + EncryptedValue pulumi.StringPtrInput + // Plaintext value of the secret to be encrypted + PlaintextValue pulumi.StringPtrInput + // Name of the secret + SecretName pulumi.StringInput + // An array of repository ids that can access the user secret. + SelectedRepositoryIds pulumi.IntArrayInput +} + +func (CodespacesUserSecretArgs) ElementType() reflect.Type { + return reflect.TypeOf((*codespacesUserSecretArgs)(nil)).Elem() +} + +type CodespacesUserSecretInput interface { + pulumi.Input + + ToCodespacesUserSecretOutput() CodespacesUserSecretOutput + ToCodespacesUserSecretOutputWithContext(ctx context.Context) CodespacesUserSecretOutput +} + +func (*CodespacesUserSecret) ElementType() reflect.Type { + return reflect.TypeOf((**CodespacesUserSecret)(nil)).Elem() +} + +func (i *CodespacesUserSecret) ToCodespacesUserSecretOutput() CodespacesUserSecretOutput { + return i.ToCodespacesUserSecretOutputWithContext(context.Background()) +} + +func (i *CodespacesUserSecret) ToCodespacesUserSecretOutputWithContext(ctx context.Context) CodespacesUserSecretOutput { + return pulumi.ToOutputWithContext(ctx, i).(CodespacesUserSecretOutput) +} + +// CodespacesUserSecretArrayInput is an input type that accepts CodespacesUserSecretArray and CodespacesUserSecretArrayOutput values. +// You can construct a concrete instance of `CodespacesUserSecretArrayInput` via: +// +// CodespacesUserSecretArray{ CodespacesUserSecretArgs{...} } +type CodespacesUserSecretArrayInput interface { + pulumi.Input + + ToCodespacesUserSecretArrayOutput() CodespacesUserSecretArrayOutput + ToCodespacesUserSecretArrayOutputWithContext(context.Context) CodespacesUserSecretArrayOutput +} + +type CodespacesUserSecretArray []CodespacesUserSecretInput + +func (CodespacesUserSecretArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]*CodespacesUserSecret)(nil)).Elem() +} + +func (i CodespacesUserSecretArray) ToCodespacesUserSecretArrayOutput() CodespacesUserSecretArrayOutput { + return i.ToCodespacesUserSecretArrayOutputWithContext(context.Background()) +} + +func (i CodespacesUserSecretArray) ToCodespacesUserSecretArrayOutputWithContext(ctx context.Context) CodespacesUserSecretArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(CodespacesUserSecretArrayOutput) +} + +// CodespacesUserSecretMapInput is an input type that accepts CodespacesUserSecretMap and CodespacesUserSecretMapOutput values. +// You can construct a concrete instance of `CodespacesUserSecretMapInput` via: +// +// CodespacesUserSecretMap{ "key": CodespacesUserSecretArgs{...} } +type CodespacesUserSecretMapInput interface { + pulumi.Input + + ToCodespacesUserSecretMapOutput() CodespacesUserSecretMapOutput + ToCodespacesUserSecretMapOutputWithContext(context.Context) CodespacesUserSecretMapOutput +} + +type CodespacesUserSecretMap map[string]CodespacesUserSecretInput + +func (CodespacesUserSecretMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*CodespacesUserSecret)(nil)).Elem() +} + +func (i CodespacesUserSecretMap) ToCodespacesUserSecretMapOutput() CodespacesUserSecretMapOutput { + return i.ToCodespacesUserSecretMapOutputWithContext(context.Background()) +} + +func (i CodespacesUserSecretMap) ToCodespacesUserSecretMapOutputWithContext(ctx context.Context) CodespacesUserSecretMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(CodespacesUserSecretMapOutput) +} + +type CodespacesUserSecretOutput struct{ *pulumi.OutputState } + +func (CodespacesUserSecretOutput) ElementType() reflect.Type { + return reflect.TypeOf((**CodespacesUserSecret)(nil)).Elem() +} + +func (o CodespacesUserSecretOutput) ToCodespacesUserSecretOutput() CodespacesUserSecretOutput { + return o +} + +func (o CodespacesUserSecretOutput) ToCodespacesUserSecretOutputWithContext(ctx context.Context) CodespacesUserSecretOutput { + return o +} + +// Date of codespacesSecret creation. +func (o CodespacesUserSecretOutput) CreatedAt() pulumi.StringOutput { + return o.ApplyT(func(v *CodespacesUserSecret) pulumi.StringOutput { return v.CreatedAt }).(pulumi.StringOutput) +} + +// Encrypted value of the secret using the GitHub public key in Base64 format. +func (o CodespacesUserSecretOutput) EncryptedValue() pulumi.StringPtrOutput { + return o.ApplyT(func(v *CodespacesUserSecret) pulumi.StringPtrOutput { return v.EncryptedValue }).(pulumi.StringPtrOutput) +} + +// Plaintext value of the secret to be encrypted +func (o CodespacesUserSecretOutput) PlaintextValue() pulumi.StringPtrOutput { + return o.ApplyT(func(v *CodespacesUserSecret) pulumi.StringPtrOutput { return v.PlaintextValue }).(pulumi.StringPtrOutput) +} + +// Name of the secret +func (o CodespacesUserSecretOutput) SecretName() pulumi.StringOutput { + return o.ApplyT(func(v *CodespacesUserSecret) pulumi.StringOutput { return v.SecretName }).(pulumi.StringOutput) +} + +// An array of repository ids that can access the user secret. +func (o CodespacesUserSecretOutput) SelectedRepositoryIds() pulumi.IntArrayOutput { + return o.ApplyT(func(v *CodespacesUserSecret) pulumi.IntArrayOutput { return v.SelectedRepositoryIds }).(pulumi.IntArrayOutput) +} + +// Date of codespacesSecret update. +func (o CodespacesUserSecretOutput) UpdatedAt() pulumi.StringOutput { + return o.ApplyT(func(v *CodespacesUserSecret) pulumi.StringOutput { return v.UpdatedAt }).(pulumi.StringOutput) +} + +type CodespacesUserSecretArrayOutput struct{ *pulumi.OutputState } + +func (CodespacesUserSecretArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]*CodespacesUserSecret)(nil)).Elem() +} + +func (o CodespacesUserSecretArrayOutput) ToCodespacesUserSecretArrayOutput() CodespacesUserSecretArrayOutput { + return o +} + +func (o CodespacesUserSecretArrayOutput) ToCodespacesUserSecretArrayOutputWithContext(ctx context.Context) CodespacesUserSecretArrayOutput { + return o +} + +func (o CodespacesUserSecretArrayOutput) Index(i pulumi.IntInput) CodespacesUserSecretOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CodespacesUserSecret { + return vs[0].([]*CodespacesUserSecret)[vs[1].(int)] + }).(CodespacesUserSecretOutput) +} + +type CodespacesUserSecretMapOutput struct{ *pulumi.OutputState } + +func (CodespacesUserSecretMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*CodespacesUserSecret)(nil)).Elem() +} + +func (o CodespacesUserSecretMapOutput) ToCodespacesUserSecretMapOutput() CodespacesUserSecretMapOutput { + return o +} + +func (o CodespacesUserSecretMapOutput) ToCodespacesUserSecretMapOutputWithContext(ctx context.Context) CodespacesUserSecretMapOutput { + return o +} + +func (o CodespacesUserSecretMapOutput) MapIndex(k pulumi.StringInput) CodespacesUserSecretOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CodespacesUserSecret { + return vs[0].(map[string]*CodespacesUserSecret)[vs[1].(string)] + }).(CodespacesUserSecretOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*CodespacesUserSecretInput)(nil)).Elem(), &CodespacesUserSecret{}) + pulumi.RegisterInputType(reflect.TypeOf((*CodespacesUserSecretArrayInput)(nil)).Elem(), CodespacesUserSecretArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*CodespacesUserSecretMapInput)(nil)).Elem(), CodespacesUserSecretMap{}) + pulumi.RegisterOutputType(CodespacesUserSecretOutput{}) + pulumi.RegisterOutputType(CodespacesUserSecretArrayOutput{}) + pulumi.RegisterOutputType(CodespacesUserSecretMapOutput{}) +} diff --git a/sdk/go/github/getCodespacesOrganizationPublicKey.go b/sdk/go/github/getCodespacesOrganizationPublicKey.go new file mode 100644 index 00000000..b61b104b --- /dev/null +++ b/sdk/go/github/getCodespacesOrganizationPublicKey.go @@ -0,0 +1,53 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package github + +import ( + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. +// Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesOrganizationPublicKey(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetCodespacesOrganizationPublicKey(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetCodespacesOrganizationPublicKeyResult, error) { + var rv GetCodespacesOrganizationPublicKeyResult + err := ctx.Invoke("github:index/getCodespacesOrganizationPublicKey:getCodespacesOrganizationPublicKey", nil, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of values returned by getCodespacesOrganizationPublicKey. +type GetCodespacesOrganizationPublicKeyResult struct { + // The provider-assigned unique ID for this managed resource. + Id string `pulumi:"id"` + // Actual key retrieved. + Key string `pulumi:"key"` + // ID of the key that has been retrieved. + KeyId string `pulumi:"keyId"` +} diff --git a/sdk/go/github/getCodespacesOrganizationSecrets.go b/sdk/go/github/getCodespacesOrganizationSecrets.go new file mode 100644 index 00000000..85ae76bd --- /dev/null +++ b/sdk/go/github/getCodespacesOrganizationSecrets.go @@ -0,0 +1,50 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package github + +import ( + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to retrieve the list of codespaces secrets of the organization. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesOrganizationSecrets(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetCodespacesOrganizationSecrets(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetCodespacesOrganizationSecretsResult, error) { + var rv GetCodespacesOrganizationSecretsResult + err := ctx.Invoke("github:index/getCodespacesOrganizationSecrets:getCodespacesOrganizationSecrets", nil, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of values returned by getCodespacesOrganizationSecrets. +type GetCodespacesOrganizationSecretsResult struct { + // The provider-assigned unique ID for this managed resource. + Id string `pulumi:"id"` + // list of secrets for the repository + Secrets []GetCodespacesOrganizationSecretsSecret `pulumi:"secrets"` +} diff --git a/sdk/go/github/getCodespacesPublicKey.go b/sdk/go/github/getCodespacesPublicKey.go new file mode 100644 index 00000000..325da2e3 --- /dev/null +++ b/sdk/go/github/getCodespacesPublicKey.go @@ -0,0 +1,126 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package github + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. +// Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesPublicKey(ctx, &github.GetCodespacesPublicKeyArgs{ +// Repository: "example_repo", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetCodespacesPublicKey(ctx *pulumi.Context, args *GetCodespacesPublicKeyArgs, opts ...pulumi.InvokeOption) (*GetCodespacesPublicKeyResult, error) { + var rv GetCodespacesPublicKeyResult + err := ctx.Invoke("github:index/getCodespacesPublicKey:getCodespacesPublicKey", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getCodespacesPublicKey. +type GetCodespacesPublicKeyArgs struct { + // Name of the repository to get public key from. + Repository string `pulumi:"repository"` +} + +// A collection of values returned by getCodespacesPublicKey. +type GetCodespacesPublicKeyResult struct { + // The provider-assigned unique ID for this managed resource. + Id string `pulumi:"id"` + // Actual key retrieved. + Key string `pulumi:"key"` + // ID of the key that has been retrieved. + KeyId string `pulumi:"keyId"` + Repository string `pulumi:"repository"` +} + +func GetCodespacesPublicKeyOutput(ctx *pulumi.Context, args GetCodespacesPublicKeyOutputArgs, opts ...pulumi.InvokeOption) GetCodespacesPublicKeyResultOutput { + return pulumi.ToOutputWithContext(context.Background(), args). + ApplyT(func(v interface{}) (GetCodespacesPublicKeyResult, error) { + args := v.(GetCodespacesPublicKeyArgs) + r, err := GetCodespacesPublicKey(ctx, &args, opts...) + var s GetCodespacesPublicKeyResult + if r != nil { + s = *r + } + return s, err + }).(GetCodespacesPublicKeyResultOutput) +} + +// A collection of arguments for invoking getCodespacesPublicKey. +type GetCodespacesPublicKeyOutputArgs struct { + // Name of the repository to get public key from. + Repository pulumi.StringInput `pulumi:"repository"` +} + +func (GetCodespacesPublicKeyOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetCodespacesPublicKeyArgs)(nil)).Elem() +} + +// A collection of values returned by getCodespacesPublicKey. +type GetCodespacesPublicKeyResultOutput struct{ *pulumi.OutputState } + +func (GetCodespacesPublicKeyResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetCodespacesPublicKeyResult)(nil)).Elem() +} + +func (o GetCodespacesPublicKeyResultOutput) ToGetCodespacesPublicKeyResultOutput() GetCodespacesPublicKeyResultOutput { + return o +} + +func (o GetCodespacesPublicKeyResultOutput) ToGetCodespacesPublicKeyResultOutputWithContext(ctx context.Context) GetCodespacesPublicKeyResultOutput { + return o +} + +// The provider-assigned unique ID for this managed resource. +func (o GetCodespacesPublicKeyResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesPublicKeyResult) string { return v.Id }).(pulumi.StringOutput) +} + +// Actual key retrieved. +func (o GetCodespacesPublicKeyResultOutput) Key() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesPublicKeyResult) string { return v.Key }).(pulumi.StringOutput) +} + +// ID of the key that has been retrieved. +func (o GetCodespacesPublicKeyResultOutput) KeyId() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesPublicKeyResult) string { return v.KeyId }).(pulumi.StringOutput) +} + +func (o GetCodespacesPublicKeyResultOutput) Repository() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesPublicKeyResult) string { return v.Repository }).(pulumi.StringOutput) +} + +func init() { + pulumi.RegisterOutputType(GetCodespacesPublicKeyResultOutput{}) +} diff --git a/sdk/go/github/getCodespacesSecrets.go b/sdk/go/github/getCodespacesSecrets.go new file mode 100644 index 00000000..f43d9c16 --- /dev/null +++ b/sdk/go/github/getCodespacesSecrets.go @@ -0,0 +1,135 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package github + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to retrieve the list of codespaces secrets for a GitHub repository. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesSecrets(ctx, &github.GetCodespacesSecretsArgs{ +// Name: pulumi.StringRef("example_repository"), +// }, nil) +// if err != nil { +// return err +// } +// _, err = github.GetCodespacesSecrets(ctx, &github.GetCodespacesSecretsArgs{ +// FullName: pulumi.StringRef("org/example_repository"), +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetCodespacesSecrets(ctx *pulumi.Context, args *GetCodespacesSecretsArgs, opts ...pulumi.InvokeOption) (*GetCodespacesSecretsResult, error) { + var rv GetCodespacesSecretsResult + err := ctx.Invoke("github:index/getCodespacesSecrets:getCodespacesSecrets", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getCodespacesSecrets. +type GetCodespacesSecretsArgs struct { + // Full name of the repository (in `org/name` format). + FullName *string `pulumi:"fullName"` + // The name of the repository. + Name *string `pulumi:"name"` +} + +// A collection of values returned by getCodespacesSecrets. +type GetCodespacesSecretsResult struct { + FullName string `pulumi:"fullName"` + // The provider-assigned unique ID for this managed resource. + Id string `pulumi:"id"` + // Secret name + Name string `pulumi:"name"` + // list of codespaces secrets for the repository + Secrets []GetCodespacesSecretsSecret `pulumi:"secrets"` +} + +func GetCodespacesSecretsOutput(ctx *pulumi.Context, args GetCodespacesSecretsOutputArgs, opts ...pulumi.InvokeOption) GetCodespacesSecretsResultOutput { + return pulumi.ToOutputWithContext(context.Background(), args). + ApplyT(func(v interface{}) (GetCodespacesSecretsResult, error) { + args := v.(GetCodespacesSecretsArgs) + r, err := GetCodespacesSecrets(ctx, &args, opts...) + var s GetCodespacesSecretsResult + if r != nil { + s = *r + } + return s, err + }).(GetCodespacesSecretsResultOutput) +} + +// A collection of arguments for invoking getCodespacesSecrets. +type GetCodespacesSecretsOutputArgs struct { + // Full name of the repository (in `org/name` format). + FullName pulumi.StringPtrInput `pulumi:"fullName"` + // The name of the repository. + Name pulumi.StringPtrInput `pulumi:"name"` +} + +func (GetCodespacesSecretsOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetCodespacesSecretsArgs)(nil)).Elem() +} + +// A collection of values returned by getCodespacesSecrets. +type GetCodespacesSecretsResultOutput struct{ *pulumi.OutputState } + +func (GetCodespacesSecretsResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetCodespacesSecretsResult)(nil)).Elem() +} + +func (o GetCodespacesSecretsResultOutput) ToGetCodespacesSecretsResultOutput() GetCodespacesSecretsResultOutput { + return o +} + +func (o GetCodespacesSecretsResultOutput) ToGetCodespacesSecretsResultOutputWithContext(ctx context.Context) GetCodespacesSecretsResultOutput { + return o +} + +func (o GetCodespacesSecretsResultOutput) FullName() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesSecretsResult) string { return v.FullName }).(pulumi.StringOutput) +} + +// The provider-assigned unique ID for this managed resource. +func (o GetCodespacesSecretsResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesSecretsResult) string { return v.Id }).(pulumi.StringOutput) +} + +// Secret name +func (o GetCodespacesSecretsResultOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesSecretsResult) string { return v.Name }).(pulumi.StringOutput) +} + +// list of codespaces secrets for the repository +func (o GetCodespacesSecretsResultOutput) Secrets() GetCodespacesSecretsSecretArrayOutput { + return o.ApplyT(func(v GetCodespacesSecretsResult) []GetCodespacesSecretsSecret { return v.Secrets }).(GetCodespacesSecretsSecretArrayOutput) +} + +func init() { + pulumi.RegisterOutputType(GetCodespacesSecretsResultOutput{}) +} diff --git a/sdk/go/github/getCodespacesUserPublicKey.go b/sdk/go/github/getCodespacesUserPublicKey.go new file mode 100644 index 00000000..63c84dd3 --- /dev/null +++ b/sdk/go/github/getCodespacesUserPublicKey.go @@ -0,0 +1,53 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package github + +import ( + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. +// Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesUserPublicKey(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetCodespacesUserPublicKey(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetCodespacesUserPublicKeyResult, error) { + var rv GetCodespacesUserPublicKeyResult + err := ctx.Invoke("github:index/getCodespacesUserPublicKey:getCodespacesUserPublicKey", nil, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of values returned by getCodespacesUserPublicKey. +type GetCodespacesUserPublicKeyResult struct { + // The provider-assigned unique ID for this managed resource. + Id string `pulumi:"id"` + // Actual key retrieved. + Key string `pulumi:"key"` + // ID of the key that has been retrieved. + KeyId string `pulumi:"keyId"` +} diff --git a/sdk/go/github/getCodespacesUserSecrets.go b/sdk/go/github/getCodespacesUserSecrets.go new file mode 100644 index 00000000..d7703898 --- /dev/null +++ b/sdk/go/github/getCodespacesUserSecrets.go @@ -0,0 +1,50 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package github + +import ( + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to retrieve the list of codespaces secrets of the user. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.GetCodespacesUserSecrets(ctx, nil, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func GetCodespacesUserSecrets(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetCodespacesUserSecretsResult, error) { + var rv GetCodespacesUserSecretsResult + err := ctx.Invoke("github:index/getCodespacesUserSecrets:getCodespacesUserSecrets", nil, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of values returned by getCodespacesUserSecrets. +type GetCodespacesUserSecretsResult struct { + // The provider-assigned unique ID for this managed resource. + Id string `pulumi:"id"` + // list of secrets for the repository + Secrets []GetCodespacesUserSecretsSecret `pulumi:"secrets"` +} diff --git a/sdk/go/github/getOrganizationCustomRole.go b/sdk/go/github/getOrganizationCustomRole.go new file mode 100644 index 00000000..b5c82589 --- /dev/null +++ b/sdk/go/github/getOrganizationCustomRole.go @@ -0,0 +1,134 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package github + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// Use this data source to retrieve information about a custom role in a GitHub Organization. +// +// > Note: Custom roles are currently only available in GitHub Enterprise Cloud. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.LookupOrganizationCustomRole(ctx, &github.LookupOrganizationCustomRoleArgs{ +// Name: "example", +// }, nil) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +func LookupOrganizationCustomRole(ctx *pulumi.Context, args *LookupOrganizationCustomRoleArgs, opts ...pulumi.InvokeOption) (*LookupOrganizationCustomRoleResult, error) { + var rv LookupOrganizationCustomRoleResult + err := ctx.Invoke("github:index/getOrganizationCustomRole:getOrganizationCustomRole", args, &rv, opts...) + if err != nil { + return nil, err + } + return &rv, nil +} + +// A collection of arguments for invoking getOrganizationCustomRole. +type LookupOrganizationCustomRoleArgs struct { + // The name of the custom role. + Name string `pulumi:"name"` +} + +// A collection of values returned by getOrganizationCustomRole. +type LookupOrganizationCustomRoleResult struct { + // The system role from which the role inherits permissions. + BaseRole string `pulumi:"baseRole"` + // The description for the custom role. + Description string `pulumi:"description"` + // The provider-assigned unique ID for this managed resource. + Id string `pulumi:"id"` + Name string `pulumi:"name"` + // A list of additional permissions included in this role. + Permissions []string `pulumi:"permissions"` +} + +func LookupOrganizationCustomRoleOutput(ctx *pulumi.Context, args LookupOrganizationCustomRoleOutputArgs, opts ...pulumi.InvokeOption) LookupOrganizationCustomRoleResultOutput { + return pulumi.ToOutputWithContext(context.Background(), args). + ApplyT(func(v interface{}) (LookupOrganizationCustomRoleResult, error) { + args := v.(LookupOrganizationCustomRoleArgs) + r, err := LookupOrganizationCustomRole(ctx, &args, opts...) + var s LookupOrganizationCustomRoleResult + if r != nil { + s = *r + } + return s, err + }).(LookupOrganizationCustomRoleResultOutput) +} + +// A collection of arguments for invoking getOrganizationCustomRole. +type LookupOrganizationCustomRoleOutputArgs struct { + // The name of the custom role. + Name pulumi.StringInput `pulumi:"name"` +} + +func (LookupOrganizationCustomRoleOutputArgs) ElementType() reflect.Type { + return reflect.TypeOf((*LookupOrganizationCustomRoleArgs)(nil)).Elem() +} + +// A collection of values returned by getOrganizationCustomRole. +type LookupOrganizationCustomRoleResultOutput struct{ *pulumi.OutputState } + +func (LookupOrganizationCustomRoleResultOutput) ElementType() reflect.Type { + return reflect.TypeOf((*LookupOrganizationCustomRoleResult)(nil)).Elem() +} + +func (o LookupOrganizationCustomRoleResultOutput) ToLookupOrganizationCustomRoleResultOutput() LookupOrganizationCustomRoleResultOutput { + return o +} + +func (o LookupOrganizationCustomRoleResultOutput) ToLookupOrganizationCustomRoleResultOutputWithContext(ctx context.Context) LookupOrganizationCustomRoleResultOutput { + return o +} + +// The system role from which the role inherits permissions. +func (o LookupOrganizationCustomRoleResultOutput) BaseRole() pulumi.StringOutput { + return o.ApplyT(func(v LookupOrganizationCustomRoleResult) string { return v.BaseRole }).(pulumi.StringOutput) +} + +// The description for the custom role. +func (o LookupOrganizationCustomRoleResultOutput) Description() pulumi.StringOutput { + return o.ApplyT(func(v LookupOrganizationCustomRoleResult) string { return v.Description }).(pulumi.StringOutput) +} + +// The provider-assigned unique ID for this managed resource. +func (o LookupOrganizationCustomRoleResultOutput) Id() pulumi.StringOutput { + return o.ApplyT(func(v LookupOrganizationCustomRoleResult) string { return v.Id }).(pulumi.StringOutput) +} + +func (o LookupOrganizationCustomRoleResultOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v LookupOrganizationCustomRoleResult) string { return v.Name }).(pulumi.StringOutput) +} + +// A list of additional permissions included in this role. +func (o LookupOrganizationCustomRoleResultOutput) Permissions() pulumi.StringArrayOutput { + return o.ApplyT(func(v LookupOrganizationCustomRoleResult) []string { return v.Permissions }).(pulumi.StringArrayOutput) +} + +func init() { + pulumi.RegisterOutputType(LookupOrganizationCustomRoleResultOutput{}) +} diff --git a/sdk/go/github/init.go b/sdk/go/github/init.go index 4c73494a..01ae1c5e 100644 --- a/sdk/go/github/init.go +++ b/sdk/go/github/init.go @@ -58,6 +58,12 @@ func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi r = &BranchProtection{} case "github:index/branchProtectionV3:BranchProtectionV3": r = &BranchProtectionV3{} + case "github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret": + r = &CodespacesOrganizationSecret{} + case "github:index/codespacesSecret:CodespacesSecret": + r = &CodespacesSecret{} + case "github:index/codespacesUserSecret:CodespacesUserSecret": + r = &CodespacesUserSecret{} case "github:index/dependabotOrganizationSecret:DependabotOrganizationSecret": r = &DependabotOrganizationSecret{} case "github:index/dependabotOrganizationSecretRepositories:DependabotOrganizationSecretRepositories": @@ -76,6 +82,8 @@ func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi r = &Membership{} case "github:index/organizationBlock:OrganizationBlock": r = &OrganizationBlock{} + case "github:index/organizationCustomRole:OrganizationCustomRole": + r = &OrganizationCustomRole{} case "github:index/organizationProject:OrganizationProject": r = &OrganizationProject{} case "github:index/organizationSecurityManager:OrganizationSecurityManager": @@ -257,6 +265,21 @@ func init() { "index/branchProtectionV3", &module{version}, ) + pulumi.RegisterResourceModule( + "github", + "index/codespacesOrganizationSecret", + &module{version}, + ) + pulumi.RegisterResourceModule( + "github", + "index/codespacesSecret", + &module{version}, + ) + pulumi.RegisterResourceModule( + "github", + "index/codespacesUserSecret", + &module{version}, + ) pulumi.RegisterResourceModule( "github", "index/dependabotOrganizationSecret", @@ -302,6 +325,11 @@ func init() { "index/organizationBlock", &module{version}, ) + pulumi.RegisterResourceModule( + "github", + "index/organizationCustomRole", + &module{version}, + ) pulumi.RegisterResourceModule( "github", "index/organizationProject", diff --git a/sdk/go/github/organizationCustomRole.go b/sdk/go/github/organizationCustomRole.go new file mode 100644 index 00000000..e68743de --- /dev/null +++ b/sdk/go/github/organizationCustomRole.go @@ -0,0 +1,325 @@ +// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package github + +import ( + "context" + "reflect" + + "errors" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +// This resource allows you to create and manage custom roles in a GitHub Organization for use in repositories. +// +// > Note: Custom roles are currently only available in GitHub Enterprise Cloud. +// +// ## Example Usage +// +// ```go +// package main +// +// import ( +// +// "github.com/pulumi/pulumi-github/sdk/v5/go/github" +// "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +// +// ) +// +// func main() { +// pulumi.Run(func(ctx *pulumi.Context) error { +// _, err := github.NewOrganizationCustomRole(ctx, "example", &github.OrganizationCustomRoleArgs{ +// BaseRole: pulumi.String("read"), +// Description: pulumi.String("Example custom role that uses the read role as its base"), +// Permissions: pulumi.StringArray{ +// pulumi.String("add_assignee"), +// pulumi.String("add_label"), +// pulumi.String("bypass_branch_protection"), +// pulumi.String("close_issue"), +// pulumi.String("close_pull_request"), +// pulumi.String("mark_as_duplicate"), +// pulumi.String("create_tag"), +// pulumi.String("delete_issue"), +// pulumi.String("delete_tag"), +// pulumi.String("manage_deploy_keys"), +// pulumi.String("push_protected_branch"), +// pulumi.String("read_code_scanning"), +// pulumi.String("reopen_issue"), +// pulumi.String("reopen_pull_request"), +// pulumi.String("request_pr_review"), +// pulumi.String("resolve_dependabot_alerts"), +// pulumi.String("resolve_secret_scanning_alerts"), +// pulumi.String("view_secret_scanning_alerts"), +// pulumi.String("write_code_scanning"), +// }, +// }) +// if err != nil { +// return err +// } +// return nil +// }) +// } +// +// ``` +// +// ## Import +// +// Custom roles can be imported using the `id` of the role. The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API. +// +// ```sh +// +// $ pulumi import github:index/organizationCustomRole:OrganizationCustomRole example 1234 +// +// ``` +type OrganizationCustomRole struct { + pulumi.CustomResourceState + + // The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + BaseRole pulumi.StringOutput `pulumi:"baseRole"` + // The description for the custom role. + Description pulumi.StringPtrOutput `pulumi:"description"` + // The name of the custom role. + Name pulumi.StringOutput `pulumi:"name"` + // A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + Permissions pulumi.StringArrayOutput `pulumi:"permissions"` +} + +// NewOrganizationCustomRole registers a new resource with the given unique name, arguments, and options. +func NewOrganizationCustomRole(ctx *pulumi.Context, + name string, args *OrganizationCustomRoleArgs, opts ...pulumi.ResourceOption) (*OrganizationCustomRole, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.BaseRole == nil { + return nil, errors.New("invalid value for required argument 'BaseRole'") + } + if args.Permissions == nil { + return nil, errors.New("invalid value for required argument 'Permissions'") + } + var resource OrganizationCustomRole + err := ctx.RegisterResource("github:index/organizationCustomRole:OrganizationCustomRole", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetOrganizationCustomRole gets an existing OrganizationCustomRole resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetOrganizationCustomRole(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *OrganizationCustomRoleState, opts ...pulumi.ResourceOption) (*OrganizationCustomRole, error) { + var resource OrganizationCustomRole + err := ctx.ReadResource("github:index/organizationCustomRole:OrganizationCustomRole", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering OrganizationCustomRole resources. +type organizationCustomRoleState struct { + // The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + BaseRole *string `pulumi:"baseRole"` + // The description for the custom role. + Description *string `pulumi:"description"` + // The name of the custom role. + Name *string `pulumi:"name"` + // A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + Permissions []string `pulumi:"permissions"` +} + +type OrganizationCustomRoleState struct { + // The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + BaseRole pulumi.StringPtrInput + // The description for the custom role. + Description pulumi.StringPtrInput + // The name of the custom role. + Name pulumi.StringPtrInput + // A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + Permissions pulumi.StringArrayInput +} + +func (OrganizationCustomRoleState) ElementType() reflect.Type { + return reflect.TypeOf((*organizationCustomRoleState)(nil)).Elem() +} + +type organizationCustomRoleArgs struct { + // The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + BaseRole string `pulumi:"baseRole"` + // The description for the custom role. + Description *string `pulumi:"description"` + // The name of the custom role. + Name *string `pulumi:"name"` + // A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + Permissions []string `pulumi:"permissions"` +} + +// The set of arguments for constructing a OrganizationCustomRole resource. +type OrganizationCustomRoleArgs struct { + // The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + BaseRole pulumi.StringInput + // The description for the custom role. + Description pulumi.StringPtrInput + // The name of the custom role. + Name pulumi.StringPtrInput + // A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + Permissions pulumi.StringArrayInput +} + +func (OrganizationCustomRoleArgs) ElementType() reflect.Type { + return reflect.TypeOf((*organizationCustomRoleArgs)(nil)).Elem() +} + +type OrganizationCustomRoleInput interface { + pulumi.Input + + ToOrganizationCustomRoleOutput() OrganizationCustomRoleOutput + ToOrganizationCustomRoleOutputWithContext(ctx context.Context) OrganizationCustomRoleOutput +} + +func (*OrganizationCustomRole) ElementType() reflect.Type { + return reflect.TypeOf((**OrganizationCustomRole)(nil)).Elem() +} + +func (i *OrganizationCustomRole) ToOrganizationCustomRoleOutput() OrganizationCustomRoleOutput { + return i.ToOrganizationCustomRoleOutputWithContext(context.Background()) +} + +func (i *OrganizationCustomRole) ToOrganizationCustomRoleOutputWithContext(ctx context.Context) OrganizationCustomRoleOutput { + return pulumi.ToOutputWithContext(ctx, i).(OrganizationCustomRoleOutput) +} + +// OrganizationCustomRoleArrayInput is an input type that accepts OrganizationCustomRoleArray and OrganizationCustomRoleArrayOutput values. +// You can construct a concrete instance of `OrganizationCustomRoleArrayInput` via: +// +// OrganizationCustomRoleArray{ OrganizationCustomRoleArgs{...} } +type OrganizationCustomRoleArrayInput interface { + pulumi.Input + + ToOrganizationCustomRoleArrayOutput() OrganizationCustomRoleArrayOutput + ToOrganizationCustomRoleArrayOutputWithContext(context.Context) OrganizationCustomRoleArrayOutput +} + +type OrganizationCustomRoleArray []OrganizationCustomRoleInput + +func (OrganizationCustomRoleArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]*OrganizationCustomRole)(nil)).Elem() +} + +func (i OrganizationCustomRoleArray) ToOrganizationCustomRoleArrayOutput() OrganizationCustomRoleArrayOutput { + return i.ToOrganizationCustomRoleArrayOutputWithContext(context.Background()) +} + +func (i OrganizationCustomRoleArray) ToOrganizationCustomRoleArrayOutputWithContext(ctx context.Context) OrganizationCustomRoleArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(OrganizationCustomRoleArrayOutput) +} + +// OrganizationCustomRoleMapInput is an input type that accepts OrganizationCustomRoleMap and OrganizationCustomRoleMapOutput values. +// You can construct a concrete instance of `OrganizationCustomRoleMapInput` via: +// +// OrganizationCustomRoleMap{ "key": OrganizationCustomRoleArgs{...} } +type OrganizationCustomRoleMapInput interface { + pulumi.Input + + ToOrganizationCustomRoleMapOutput() OrganizationCustomRoleMapOutput + ToOrganizationCustomRoleMapOutputWithContext(context.Context) OrganizationCustomRoleMapOutput +} + +type OrganizationCustomRoleMap map[string]OrganizationCustomRoleInput + +func (OrganizationCustomRoleMap) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*OrganizationCustomRole)(nil)).Elem() +} + +func (i OrganizationCustomRoleMap) ToOrganizationCustomRoleMapOutput() OrganizationCustomRoleMapOutput { + return i.ToOrganizationCustomRoleMapOutputWithContext(context.Background()) +} + +func (i OrganizationCustomRoleMap) ToOrganizationCustomRoleMapOutputWithContext(ctx context.Context) OrganizationCustomRoleMapOutput { + return pulumi.ToOutputWithContext(ctx, i).(OrganizationCustomRoleMapOutput) +} + +type OrganizationCustomRoleOutput struct{ *pulumi.OutputState } + +func (OrganizationCustomRoleOutput) ElementType() reflect.Type { + return reflect.TypeOf((**OrganizationCustomRole)(nil)).Elem() +} + +func (o OrganizationCustomRoleOutput) ToOrganizationCustomRoleOutput() OrganizationCustomRoleOutput { + return o +} + +func (o OrganizationCustomRoleOutput) ToOrganizationCustomRoleOutputWithContext(ctx context.Context) OrganizationCustomRoleOutput { + return o +} + +// The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. +func (o OrganizationCustomRoleOutput) BaseRole() pulumi.StringOutput { + return o.ApplyT(func(v *OrganizationCustomRole) pulumi.StringOutput { return v.BaseRole }).(pulumi.StringOutput) +} + +// The description for the custom role. +func (o OrganizationCustomRoleOutput) Description() pulumi.StringPtrOutput { + return o.ApplyT(func(v *OrganizationCustomRole) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) +} + +// The name of the custom role. +func (o OrganizationCustomRoleOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v *OrganizationCustomRole) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) +} + +// A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. +func (o OrganizationCustomRoleOutput) Permissions() pulumi.StringArrayOutput { + return o.ApplyT(func(v *OrganizationCustomRole) pulumi.StringArrayOutput { return v.Permissions }).(pulumi.StringArrayOutput) +} + +type OrganizationCustomRoleArrayOutput struct{ *pulumi.OutputState } + +func (OrganizationCustomRoleArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]*OrganizationCustomRole)(nil)).Elem() +} + +func (o OrganizationCustomRoleArrayOutput) ToOrganizationCustomRoleArrayOutput() OrganizationCustomRoleArrayOutput { + return o +} + +func (o OrganizationCustomRoleArrayOutput) ToOrganizationCustomRoleArrayOutputWithContext(ctx context.Context) OrganizationCustomRoleArrayOutput { + return o +} + +func (o OrganizationCustomRoleArrayOutput) Index(i pulumi.IntInput) OrganizationCustomRoleOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) *OrganizationCustomRole { + return vs[0].([]*OrganizationCustomRole)[vs[1].(int)] + }).(OrganizationCustomRoleOutput) +} + +type OrganizationCustomRoleMapOutput struct{ *pulumi.OutputState } + +func (OrganizationCustomRoleMapOutput) ElementType() reflect.Type { + return reflect.TypeOf((*map[string]*OrganizationCustomRole)(nil)).Elem() +} + +func (o OrganizationCustomRoleMapOutput) ToOrganizationCustomRoleMapOutput() OrganizationCustomRoleMapOutput { + return o +} + +func (o OrganizationCustomRoleMapOutput) ToOrganizationCustomRoleMapOutputWithContext(ctx context.Context) OrganizationCustomRoleMapOutput { + return o +} + +func (o OrganizationCustomRoleMapOutput) MapIndex(k pulumi.StringInput) OrganizationCustomRoleOutput { + return pulumi.All(o, k).ApplyT(func(vs []interface{}) *OrganizationCustomRole { + return vs[0].(map[string]*OrganizationCustomRole)[vs[1].(string)] + }).(OrganizationCustomRoleOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*OrganizationCustomRoleInput)(nil)).Elem(), &OrganizationCustomRole{}) + pulumi.RegisterInputType(reflect.TypeOf((*OrganizationCustomRoleArrayInput)(nil)).Elem(), OrganizationCustomRoleArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*OrganizationCustomRoleMapInput)(nil)).Elem(), OrganizationCustomRoleMap{}) + pulumi.RegisterOutputType(OrganizationCustomRoleOutput{}) + pulumi.RegisterOutputType(OrganizationCustomRoleArrayOutput{}) + pulumi.RegisterOutputType(OrganizationCustomRoleMapOutput{}) +} diff --git a/sdk/go/github/pulumiTypes.go b/sdk/go/github/pulumiTypes.go index 93e2fff7..5009cd7e 100644 --- a/sdk/go/github/pulumiTypes.go +++ b/sdk/go/github/pulumiTypes.go @@ -5004,6 +5004,369 @@ func (o GetBranchProtectionRulesRuleArrayOutput) Index(i pulumi.IntInput) GetBra }).(GetBranchProtectionRulesRuleOutput) } +type GetCodespacesOrganizationSecretsSecret struct { + // Timestamp of the secret creation + CreatedAt string `pulumi:"createdAt"` + // Secret name + Name string `pulumi:"name"` + // Timestamp of the secret last update + UpdatedAt string `pulumi:"updatedAt"` + // Secret visibility + Visibility string `pulumi:"visibility"` +} + +// GetCodespacesOrganizationSecretsSecretInput is an input type that accepts GetCodespacesOrganizationSecretsSecretArgs and GetCodespacesOrganizationSecretsSecretOutput values. +// You can construct a concrete instance of `GetCodespacesOrganizationSecretsSecretInput` via: +// +// GetCodespacesOrganizationSecretsSecretArgs{...} +type GetCodespacesOrganizationSecretsSecretInput interface { + pulumi.Input + + ToGetCodespacesOrganizationSecretsSecretOutput() GetCodespacesOrganizationSecretsSecretOutput + ToGetCodespacesOrganizationSecretsSecretOutputWithContext(context.Context) GetCodespacesOrganizationSecretsSecretOutput +} + +type GetCodespacesOrganizationSecretsSecretArgs struct { + // Timestamp of the secret creation + CreatedAt pulumi.StringInput `pulumi:"createdAt"` + // Secret name + Name pulumi.StringInput `pulumi:"name"` + // Timestamp of the secret last update + UpdatedAt pulumi.StringInput `pulumi:"updatedAt"` + // Secret visibility + Visibility pulumi.StringInput `pulumi:"visibility"` +} + +func (GetCodespacesOrganizationSecretsSecretArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetCodespacesOrganizationSecretsSecret)(nil)).Elem() +} + +func (i GetCodespacesOrganizationSecretsSecretArgs) ToGetCodespacesOrganizationSecretsSecretOutput() GetCodespacesOrganizationSecretsSecretOutput { + return i.ToGetCodespacesOrganizationSecretsSecretOutputWithContext(context.Background()) +} + +func (i GetCodespacesOrganizationSecretsSecretArgs) ToGetCodespacesOrganizationSecretsSecretOutputWithContext(ctx context.Context) GetCodespacesOrganizationSecretsSecretOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetCodespacesOrganizationSecretsSecretOutput) +} + +// GetCodespacesOrganizationSecretsSecretArrayInput is an input type that accepts GetCodespacesOrganizationSecretsSecretArray and GetCodespacesOrganizationSecretsSecretArrayOutput values. +// You can construct a concrete instance of `GetCodespacesOrganizationSecretsSecretArrayInput` via: +// +// GetCodespacesOrganizationSecretsSecretArray{ GetCodespacesOrganizationSecretsSecretArgs{...} } +type GetCodespacesOrganizationSecretsSecretArrayInput interface { + pulumi.Input + + ToGetCodespacesOrganizationSecretsSecretArrayOutput() GetCodespacesOrganizationSecretsSecretArrayOutput + ToGetCodespacesOrganizationSecretsSecretArrayOutputWithContext(context.Context) GetCodespacesOrganizationSecretsSecretArrayOutput +} + +type GetCodespacesOrganizationSecretsSecretArray []GetCodespacesOrganizationSecretsSecretInput + +func (GetCodespacesOrganizationSecretsSecretArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetCodespacesOrganizationSecretsSecret)(nil)).Elem() +} + +func (i GetCodespacesOrganizationSecretsSecretArray) ToGetCodespacesOrganizationSecretsSecretArrayOutput() GetCodespacesOrganizationSecretsSecretArrayOutput { + return i.ToGetCodespacesOrganizationSecretsSecretArrayOutputWithContext(context.Background()) +} + +func (i GetCodespacesOrganizationSecretsSecretArray) ToGetCodespacesOrganizationSecretsSecretArrayOutputWithContext(ctx context.Context) GetCodespacesOrganizationSecretsSecretArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetCodespacesOrganizationSecretsSecretArrayOutput) +} + +type GetCodespacesOrganizationSecretsSecretOutput struct{ *pulumi.OutputState } + +func (GetCodespacesOrganizationSecretsSecretOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetCodespacesOrganizationSecretsSecret)(nil)).Elem() +} + +func (o GetCodespacesOrganizationSecretsSecretOutput) ToGetCodespacesOrganizationSecretsSecretOutput() GetCodespacesOrganizationSecretsSecretOutput { + return o +} + +func (o GetCodespacesOrganizationSecretsSecretOutput) ToGetCodespacesOrganizationSecretsSecretOutputWithContext(ctx context.Context) GetCodespacesOrganizationSecretsSecretOutput { + return o +} + +// Timestamp of the secret creation +func (o GetCodespacesOrganizationSecretsSecretOutput) CreatedAt() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesOrganizationSecretsSecret) string { return v.CreatedAt }).(pulumi.StringOutput) +} + +// Secret name +func (o GetCodespacesOrganizationSecretsSecretOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesOrganizationSecretsSecret) string { return v.Name }).(pulumi.StringOutput) +} + +// Timestamp of the secret last update +func (o GetCodespacesOrganizationSecretsSecretOutput) UpdatedAt() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesOrganizationSecretsSecret) string { return v.UpdatedAt }).(pulumi.StringOutput) +} + +// Secret visibility +func (o GetCodespacesOrganizationSecretsSecretOutput) Visibility() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesOrganizationSecretsSecret) string { return v.Visibility }).(pulumi.StringOutput) +} + +type GetCodespacesOrganizationSecretsSecretArrayOutput struct{ *pulumi.OutputState } + +func (GetCodespacesOrganizationSecretsSecretArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetCodespacesOrganizationSecretsSecret)(nil)).Elem() +} + +func (o GetCodespacesOrganizationSecretsSecretArrayOutput) ToGetCodespacesOrganizationSecretsSecretArrayOutput() GetCodespacesOrganizationSecretsSecretArrayOutput { + return o +} + +func (o GetCodespacesOrganizationSecretsSecretArrayOutput) ToGetCodespacesOrganizationSecretsSecretArrayOutputWithContext(ctx context.Context) GetCodespacesOrganizationSecretsSecretArrayOutput { + return o +} + +func (o GetCodespacesOrganizationSecretsSecretArrayOutput) Index(i pulumi.IntInput) GetCodespacesOrganizationSecretsSecretOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) GetCodespacesOrganizationSecretsSecret { + return vs[0].([]GetCodespacesOrganizationSecretsSecret)[vs[1].(int)] + }).(GetCodespacesOrganizationSecretsSecretOutput) +} + +type GetCodespacesSecretsSecret struct { + // Timestamp of the secret creation + CreatedAt string `pulumi:"createdAt"` + // The name of the repository. + Name string `pulumi:"name"` + // Timestamp of the secret last update + UpdatedAt string `pulumi:"updatedAt"` +} + +// GetCodespacesSecretsSecretInput is an input type that accepts GetCodespacesSecretsSecretArgs and GetCodespacesSecretsSecretOutput values. +// You can construct a concrete instance of `GetCodespacesSecretsSecretInput` via: +// +// GetCodespacesSecretsSecretArgs{...} +type GetCodespacesSecretsSecretInput interface { + pulumi.Input + + ToGetCodespacesSecretsSecretOutput() GetCodespacesSecretsSecretOutput + ToGetCodespacesSecretsSecretOutputWithContext(context.Context) GetCodespacesSecretsSecretOutput +} + +type GetCodespacesSecretsSecretArgs struct { + // Timestamp of the secret creation + CreatedAt pulumi.StringInput `pulumi:"createdAt"` + // The name of the repository. + Name pulumi.StringInput `pulumi:"name"` + // Timestamp of the secret last update + UpdatedAt pulumi.StringInput `pulumi:"updatedAt"` +} + +func (GetCodespacesSecretsSecretArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetCodespacesSecretsSecret)(nil)).Elem() +} + +func (i GetCodespacesSecretsSecretArgs) ToGetCodespacesSecretsSecretOutput() GetCodespacesSecretsSecretOutput { + return i.ToGetCodespacesSecretsSecretOutputWithContext(context.Background()) +} + +func (i GetCodespacesSecretsSecretArgs) ToGetCodespacesSecretsSecretOutputWithContext(ctx context.Context) GetCodespacesSecretsSecretOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetCodespacesSecretsSecretOutput) +} + +// GetCodespacesSecretsSecretArrayInput is an input type that accepts GetCodespacesSecretsSecretArray and GetCodespacesSecretsSecretArrayOutput values. +// You can construct a concrete instance of `GetCodespacesSecretsSecretArrayInput` via: +// +// GetCodespacesSecretsSecretArray{ GetCodespacesSecretsSecretArgs{...} } +type GetCodespacesSecretsSecretArrayInput interface { + pulumi.Input + + ToGetCodespacesSecretsSecretArrayOutput() GetCodespacesSecretsSecretArrayOutput + ToGetCodespacesSecretsSecretArrayOutputWithContext(context.Context) GetCodespacesSecretsSecretArrayOutput +} + +type GetCodespacesSecretsSecretArray []GetCodespacesSecretsSecretInput + +func (GetCodespacesSecretsSecretArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetCodespacesSecretsSecret)(nil)).Elem() +} + +func (i GetCodespacesSecretsSecretArray) ToGetCodespacesSecretsSecretArrayOutput() GetCodespacesSecretsSecretArrayOutput { + return i.ToGetCodespacesSecretsSecretArrayOutputWithContext(context.Background()) +} + +func (i GetCodespacesSecretsSecretArray) ToGetCodespacesSecretsSecretArrayOutputWithContext(ctx context.Context) GetCodespacesSecretsSecretArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetCodespacesSecretsSecretArrayOutput) +} + +type GetCodespacesSecretsSecretOutput struct{ *pulumi.OutputState } + +func (GetCodespacesSecretsSecretOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetCodespacesSecretsSecret)(nil)).Elem() +} + +func (o GetCodespacesSecretsSecretOutput) ToGetCodespacesSecretsSecretOutput() GetCodespacesSecretsSecretOutput { + return o +} + +func (o GetCodespacesSecretsSecretOutput) ToGetCodespacesSecretsSecretOutputWithContext(ctx context.Context) GetCodespacesSecretsSecretOutput { + return o +} + +// Timestamp of the secret creation +func (o GetCodespacesSecretsSecretOutput) CreatedAt() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesSecretsSecret) string { return v.CreatedAt }).(pulumi.StringOutput) +} + +// The name of the repository. +func (o GetCodespacesSecretsSecretOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesSecretsSecret) string { return v.Name }).(pulumi.StringOutput) +} + +// Timestamp of the secret last update +func (o GetCodespacesSecretsSecretOutput) UpdatedAt() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesSecretsSecret) string { return v.UpdatedAt }).(pulumi.StringOutput) +} + +type GetCodespacesSecretsSecretArrayOutput struct{ *pulumi.OutputState } + +func (GetCodespacesSecretsSecretArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetCodespacesSecretsSecret)(nil)).Elem() +} + +func (o GetCodespacesSecretsSecretArrayOutput) ToGetCodespacesSecretsSecretArrayOutput() GetCodespacesSecretsSecretArrayOutput { + return o +} + +func (o GetCodespacesSecretsSecretArrayOutput) ToGetCodespacesSecretsSecretArrayOutputWithContext(ctx context.Context) GetCodespacesSecretsSecretArrayOutput { + return o +} + +func (o GetCodespacesSecretsSecretArrayOutput) Index(i pulumi.IntInput) GetCodespacesSecretsSecretOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) GetCodespacesSecretsSecret { + return vs[0].([]GetCodespacesSecretsSecret)[vs[1].(int)] + }).(GetCodespacesSecretsSecretOutput) +} + +type GetCodespacesUserSecretsSecret struct { + // Timestamp of the secret creation + CreatedAt string `pulumi:"createdAt"` + // Secret name + Name string `pulumi:"name"` + // Timestamp of the secret last update + UpdatedAt string `pulumi:"updatedAt"` + // Secret visibility + Visibility string `pulumi:"visibility"` +} + +// GetCodespacesUserSecretsSecretInput is an input type that accepts GetCodespacesUserSecretsSecretArgs and GetCodespacesUserSecretsSecretOutput values. +// You can construct a concrete instance of `GetCodespacesUserSecretsSecretInput` via: +// +// GetCodespacesUserSecretsSecretArgs{...} +type GetCodespacesUserSecretsSecretInput interface { + pulumi.Input + + ToGetCodespacesUserSecretsSecretOutput() GetCodespacesUserSecretsSecretOutput + ToGetCodespacesUserSecretsSecretOutputWithContext(context.Context) GetCodespacesUserSecretsSecretOutput +} + +type GetCodespacesUserSecretsSecretArgs struct { + // Timestamp of the secret creation + CreatedAt pulumi.StringInput `pulumi:"createdAt"` + // Secret name + Name pulumi.StringInput `pulumi:"name"` + // Timestamp of the secret last update + UpdatedAt pulumi.StringInput `pulumi:"updatedAt"` + // Secret visibility + Visibility pulumi.StringInput `pulumi:"visibility"` +} + +func (GetCodespacesUserSecretsSecretArgs) ElementType() reflect.Type { + return reflect.TypeOf((*GetCodespacesUserSecretsSecret)(nil)).Elem() +} + +func (i GetCodespacesUserSecretsSecretArgs) ToGetCodespacesUserSecretsSecretOutput() GetCodespacesUserSecretsSecretOutput { + return i.ToGetCodespacesUserSecretsSecretOutputWithContext(context.Background()) +} + +func (i GetCodespacesUserSecretsSecretArgs) ToGetCodespacesUserSecretsSecretOutputWithContext(ctx context.Context) GetCodespacesUserSecretsSecretOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetCodespacesUserSecretsSecretOutput) +} + +// GetCodespacesUserSecretsSecretArrayInput is an input type that accepts GetCodespacesUserSecretsSecretArray and GetCodespacesUserSecretsSecretArrayOutput values. +// You can construct a concrete instance of `GetCodespacesUserSecretsSecretArrayInput` via: +// +// GetCodespacesUserSecretsSecretArray{ GetCodespacesUserSecretsSecretArgs{...} } +type GetCodespacesUserSecretsSecretArrayInput interface { + pulumi.Input + + ToGetCodespacesUserSecretsSecretArrayOutput() GetCodespacesUserSecretsSecretArrayOutput + ToGetCodespacesUserSecretsSecretArrayOutputWithContext(context.Context) GetCodespacesUserSecretsSecretArrayOutput +} + +type GetCodespacesUserSecretsSecretArray []GetCodespacesUserSecretsSecretInput + +func (GetCodespacesUserSecretsSecretArray) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetCodespacesUserSecretsSecret)(nil)).Elem() +} + +func (i GetCodespacesUserSecretsSecretArray) ToGetCodespacesUserSecretsSecretArrayOutput() GetCodespacesUserSecretsSecretArrayOutput { + return i.ToGetCodespacesUserSecretsSecretArrayOutputWithContext(context.Background()) +} + +func (i GetCodespacesUserSecretsSecretArray) ToGetCodespacesUserSecretsSecretArrayOutputWithContext(ctx context.Context) GetCodespacesUserSecretsSecretArrayOutput { + return pulumi.ToOutputWithContext(ctx, i).(GetCodespacesUserSecretsSecretArrayOutput) +} + +type GetCodespacesUserSecretsSecretOutput struct{ *pulumi.OutputState } + +func (GetCodespacesUserSecretsSecretOutput) ElementType() reflect.Type { + return reflect.TypeOf((*GetCodespacesUserSecretsSecret)(nil)).Elem() +} + +func (o GetCodespacesUserSecretsSecretOutput) ToGetCodespacesUserSecretsSecretOutput() GetCodespacesUserSecretsSecretOutput { + return o +} + +func (o GetCodespacesUserSecretsSecretOutput) ToGetCodespacesUserSecretsSecretOutputWithContext(ctx context.Context) GetCodespacesUserSecretsSecretOutput { + return o +} + +// Timestamp of the secret creation +func (o GetCodespacesUserSecretsSecretOutput) CreatedAt() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesUserSecretsSecret) string { return v.CreatedAt }).(pulumi.StringOutput) +} + +// Secret name +func (o GetCodespacesUserSecretsSecretOutput) Name() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesUserSecretsSecret) string { return v.Name }).(pulumi.StringOutput) +} + +// Timestamp of the secret last update +func (o GetCodespacesUserSecretsSecretOutput) UpdatedAt() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesUserSecretsSecret) string { return v.UpdatedAt }).(pulumi.StringOutput) +} + +// Secret visibility +func (o GetCodespacesUserSecretsSecretOutput) Visibility() pulumi.StringOutput { + return o.ApplyT(func(v GetCodespacesUserSecretsSecret) string { return v.Visibility }).(pulumi.StringOutput) +} + +type GetCodespacesUserSecretsSecretArrayOutput struct{ *pulumi.OutputState } + +func (GetCodespacesUserSecretsSecretArrayOutput) ElementType() reflect.Type { + return reflect.TypeOf((*[]GetCodespacesUserSecretsSecret)(nil)).Elem() +} + +func (o GetCodespacesUserSecretsSecretArrayOutput) ToGetCodespacesUserSecretsSecretArrayOutput() GetCodespacesUserSecretsSecretArrayOutput { + return o +} + +func (o GetCodespacesUserSecretsSecretArrayOutput) ToGetCodespacesUserSecretsSecretArrayOutputWithContext(ctx context.Context) GetCodespacesUserSecretsSecretArrayOutput { + return o +} + +func (o GetCodespacesUserSecretsSecretArrayOutput) Index(i pulumi.IntInput) GetCodespacesUserSecretsSecretOutput { + return pulumi.All(o, i).ApplyT(func(vs []interface{}) GetCodespacesUserSecretsSecret { + return vs[0].([]GetCodespacesUserSecretsSecret)[vs[1].(int)] + }).(GetCodespacesUserSecretsSecretOutput) +} + type GetCollaboratorsCollaborator struct { // The GitHub API URL for the collaborator's events. EventsUrl string `pulumi:"eventsUrl"` @@ -8061,6 +8424,12 @@ func init() { pulumi.RegisterInputType(reflect.TypeOf((*GetActionsVariablesVariableArrayInput)(nil)).Elem(), GetActionsVariablesVariableArray{}) pulumi.RegisterInputType(reflect.TypeOf((*GetBranchProtectionRulesRuleInput)(nil)).Elem(), GetBranchProtectionRulesRuleArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*GetBranchProtectionRulesRuleArrayInput)(nil)).Elem(), GetBranchProtectionRulesRuleArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetCodespacesOrganizationSecretsSecretInput)(nil)).Elem(), GetCodespacesOrganizationSecretsSecretArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetCodespacesOrganizationSecretsSecretArrayInput)(nil)).Elem(), GetCodespacesOrganizationSecretsSecretArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetCodespacesSecretsSecretInput)(nil)).Elem(), GetCodespacesSecretsSecretArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetCodespacesSecretsSecretArrayInput)(nil)).Elem(), GetCodespacesSecretsSecretArray{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetCodespacesUserSecretsSecretInput)(nil)).Elem(), GetCodespacesUserSecretsSecretArgs{}) + pulumi.RegisterInputType(reflect.TypeOf((*GetCodespacesUserSecretsSecretArrayInput)(nil)).Elem(), GetCodespacesUserSecretsSecretArray{}) pulumi.RegisterInputType(reflect.TypeOf((*GetCollaboratorsCollaboratorInput)(nil)).Elem(), GetCollaboratorsCollaboratorArgs{}) pulumi.RegisterInputType(reflect.TypeOf((*GetCollaboratorsCollaboratorArrayInput)(nil)).Elem(), GetCollaboratorsCollaboratorArray{}) pulumi.RegisterInputType(reflect.TypeOf((*GetDependabotOrganizationSecretsSecretInput)(nil)).Elem(), GetDependabotOrganizationSecretsSecretArgs{}) @@ -8172,6 +8541,12 @@ func init() { pulumi.RegisterOutputType(GetActionsVariablesVariableArrayOutput{}) pulumi.RegisterOutputType(GetBranchProtectionRulesRuleOutput{}) pulumi.RegisterOutputType(GetBranchProtectionRulesRuleArrayOutput{}) + pulumi.RegisterOutputType(GetCodespacesOrganizationSecretsSecretOutput{}) + pulumi.RegisterOutputType(GetCodespacesOrganizationSecretsSecretArrayOutput{}) + pulumi.RegisterOutputType(GetCodespacesSecretsSecretOutput{}) + pulumi.RegisterOutputType(GetCodespacesSecretsSecretArrayOutput{}) + pulumi.RegisterOutputType(GetCodespacesUserSecretsSecretOutput{}) + pulumi.RegisterOutputType(GetCodespacesUserSecretsSecretArrayOutput{}) pulumi.RegisterOutputType(GetCollaboratorsCollaboratorOutput{}) pulumi.RegisterOutputType(GetCollaboratorsCollaboratorArrayOutput{}) pulumi.RegisterOutputType(GetDependabotOrganizationSecretsSecretOutput{}) diff --git a/sdk/java/src/main/java/com/pulumi/github/CodespacesOrganizationSecret.java b/sdk/java/src/main/java/com/pulumi/github/CodespacesOrganizationSecret.java new file mode 100644 index 00000000..e9b97920 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/CodespacesOrganizationSecret.java @@ -0,0 +1,268 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Export; +import com.pulumi.core.annotations.ResourceType; +import com.pulumi.core.internal.Codegen; +import com.pulumi.github.CodespacesOrganizationSecretArgs; +import com.pulumi.github.Utilities; +import com.pulumi.github.inputs.CodespacesOrganizationSecretState; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Optional; +import javax.annotation.Nullable; + +/** + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.CodespacesOrganizationSecret; + * import com.pulumi.github.CodespacesOrganizationSecretArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var exampleSecretCodespacesOrganizationSecret = new CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", CodespacesOrganizationSecretArgs.builder() + * .secretName("example_secret_name") + * .visibility("private") + * .plaintextValue(var_.some_secret_string()) + * .build()); + * + * var exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", CodespacesOrganizationSecretArgs.builder() + * .secretName("example_secret_name") + * .visibility("private") + * .encryptedValue(var_.some_encrypted_secret_string()) + * .build()); + * + * } + * } + * ``` + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetRepositoryArgs; + * import com.pulumi.github.CodespacesOrganizationSecret; + * import com.pulumi.github.CodespacesOrganizationSecretArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var repo = GithubFunctions.getRepository(GetRepositoryArgs.builder() + * .fullName("my-org/repo") + * .build()); + * + * var exampleSecretCodespacesOrganizationSecret = new CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", CodespacesOrganizationSecretArgs.builder() + * .secretName("example_secret_name") + * .visibility("selected") + * .plaintextValue(var_.some_secret_string()) + * .selectedRepositoryIds(repo.applyValue(getRepositoryResult -> getRepositoryResult.repoId())) + * .build()); + * + * var exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", CodespacesOrganizationSecretArgs.builder() + * .secretName("example_secret_name") + * .visibility("selected") + * .encryptedValue(var_.some_encrypted_secret_string()) + * .selectedRepositoryIds(repo.applyValue(getRepositoryResult -> getRepositoryResult.repoId())) + * .build()); + * + * } + * } + * ``` + * + * ## Import + * + * This resource can be imported using an ID made up of the secret name + * + * ```sh + * $ pulumi import github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret test_secret test_secret_name + * ``` + * + * NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. + * + */ +@ResourceType(type="github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret") +public class CodespacesOrganizationSecret extends com.pulumi.resources.CustomResource { + /** + * Date of codespaces_secret creation. + * + */ + @Export(name="createdAt", type=String.class, parameters={}) + private Output createdAt; + + /** + * @return Date of codespaces_secret creation. + * + */ + public Output createdAt() { + return this.createdAt; + } + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + @Export(name="encryptedValue", type=String.class, parameters={}) + private Output encryptedValue; + + /** + * @return Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + public Output> encryptedValue() { + return Codegen.optional(this.encryptedValue); + } + /** + * Plaintext value of the secret to be encrypted + * + */ + @Export(name="plaintextValue", type=String.class, parameters={}) + private Output plaintextValue; + + /** + * @return Plaintext value of the secret to be encrypted + * + */ + public Output> plaintextValue() { + return Codegen.optional(this.plaintextValue); + } + /** + * Name of the secret + * + */ + @Export(name="secretName", type=String.class, parameters={}) + private Output secretName; + + /** + * @return Name of the secret + * + */ + public Output secretName() { + return this.secretName; + } + /** + * An array of repository ids that can access the organization secret. + * + */ + @Export(name="selectedRepositoryIds", type=List.class, parameters={Integer.class}) + private Output> selectedRepositoryIds; + + /** + * @return An array of repository ids that can access the organization secret. + * + */ + public Output>> selectedRepositoryIds() { + return Codegen.optional(this.selectedRepositoryIds); + } + /** + * Date of codespaces_secret update. + * + */ + @Export(name="updatedAt", type=String.class, parameters={}) + private Output updatedAt; + + /** + * @return Date of codespaces_secret update. + * + */ + public Output updatedAt() { + return this.updatedAt; + } + /** + * Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + * + */ + @Export(name="visibility", type=String.class, parameters={}) + private Output visibility; + + /** + * @return Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + * + */ + public Output visibility() { + return this.visibility; + } + + /** + * + * @param name The _unique_ name of the resulting resource. + */ + public CodespacesOrganizationSecret(String name) { + this(name, CodespacesOrganizationSecretArgs.Empty); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + */ + public CodespacesOrganizationSecret(String name, CodespacesOrganizationSecretArgs args) { + this(name, args, null); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + * @param options A bag of options that control this resource's behavior. + */ + public CodespacesOrganizationSecret(String name, CodespacesOrganizationSecretArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret", name, args == null ? CodespacesOrganizationSecretArgs.Empty : args, makeResourceOptions(options, Codegen.empty())); + } + + private CodespacesOrganizationSecret(String name, Output id, @Nullable CodespacesOrganizationSecretState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret", name, state, makeResourceOptions(options, id)); + } + + private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { + var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() + .version(Utilities.getVersion()) + .additionalSecretOutputs(List.of( + "encryptedValue", + "plaintextValue" + )) + .build(); + return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); + } + + /** + * Get an existing Host resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state + * @param options Optional settings to control the behavior of the CustomResource. + */ + public static CodespacesOrganizationSecret get(String name, Output id, @Nullable CodespacesOrganizationSecretState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { + return new CodespacesOrganizationSecret(name, id, state, options); + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/CodespacesOrganizationSecretArgs.java b/sdk/java/src/main/java/com/pulumi/github/CodespacesOrganizationSecretArgs.java new file mode 100644 index 00000000..80b4e97b --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/CodespacesOrganizationSecretArgs.java @@ -0,0 +1,249 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class CodespacesOrganizationSecretArgs extends com.pulumi.resources.ResourceArgs { + + public static final CodespacesOrganizationSecretArgs Empty = new CodespacesOrganizationSecretArgs(); + + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + @Import(name="encryptedValue") + private @Nullable Output encryptedValue; + + /** + * @return Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + public Optional> encryptedValue() { + return Optional.ofNullable(this.encryptedValue); + } + + /** + * Plaintext value of the secret to be encrypted + * + */ + @Import(name="plaintextValue") + private @Nullable Output plaintextValue; + + /** + * @return Plaintext value of the secret to be encrypted + * + */ + public Optional> plaintextValue() { + return Optional.ofNullable(this.plaintextValue); + } + + /** + * Name of the secret + * + */ + @Import(name="secretName", required=true) + private Output secretName; + + /** + * @return Name of the secret + * + */ + public Output secretName() { + return this.secretName; + } + + /** + * An array of repository ids that can access the organization secret. + * + */ + @Import(name="selectedRepositoryIds") + private @Nullable Output> selectedRepositoryIds; + + /** + * @return An array of repository ids that can access the organization secret. + * + */ + public Optional>> selectedRepositoryIds() { + return Optional.ofNullable(this.selectedRepositoryIds); + } + + /** + * Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + * + */ + @Import(name="visibility", required=true) + private Output visibility; + + /** + * @return Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + * + */ + public Output visibility() { + return this.visibility; + } + + private CodespacesOrganizationSecretArgs() {} + + private CodespacesOrganizationSecretArgs(CodespacesOrganizationSecretArgs $) { + this.encryptedValue = $.encryptedValue; + this.plaintextValue = $.plaintextValue; + this.secretName = $.secretName; + this.selectedRepositoryIds = $.selectedRepositoryIds; + this.visibility = $.visibility; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(CodespacesOrganizationSecretArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private CodespacesOrganizationSecretArgs $; + + public Builder() { + $ = new CodespacesOrganizationSecretArgs(); + } + + public Builder(CodespacesOrganizationSecretArgs defaults) { + $ = new CodespacesOrganizationSecretArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param encryptedValue Encrypted value of the secret using the GitHub public key in Base64 format. + * + * @return builder + * + */ + public Builder encryptedValue(@Nullable Output encryptedValue) { + $.encryptedValue = encryptedValue; + return this; + } + + /** + * @param encryptedValue Encrypted value of the secret using the GitHub public key in Base64 format. + * + * @return builder + * + */ + public Builder encryptedValue(String encryptedValue) { + return encryptedValue(Output.of(encryptedValue)); + } + + /** + * @param plaintextValue Plaintext value of the secret to be encrypted + * + * @return builder + * + */ + public Builder plaintextValue(@Nullable Output plaintextValue) { + $.plaintextValue = plaintextValue; + return this; + } + + /** + * @param plaintextValue Plaintext value of the secret to be encrypted + * + * @return builder + * + */ + public Builder plaintextValue(String plaintextValue) { + return plaintextValue(Output.of(plaintextValue)); + } + + /** + * @param secretName Name of the secret + * + * @return builder + * + */ + public Builder secretName(Output secretName) { + $.secretName = secretName; + return this; + } + + /** + * @param secretName Name of the secret + * + * @return builder + * + */ + public Builder secretName(String secretName) { + return secretName(Output.of(secretName)); + } + + /** + * @param selectedRepositoryIds An array of repository ids that can access the organization secret. + * + * @return builder + * + */ + public Builder selectedRepositoryIds(@Nullable Output> selectedRepositoryIds) { + $.selectedRepositoryIds = selectedRepositoryIds; + return this; + } + + /** + * @param selectedRepositoryIds An array of repository ids that can access the organization secret. + * + * @return builder + * + */ + public Builder selectedRepositoryIds(List selectedRepositoryIds) { + return selectedRepositoryIds(Output.of(selectedRepositoryIds)); + } + + /** + * @param selectedRepositoryIds An array of repository ids that can access the organization secret. + * + * @return builder + * + */ + public Builder selectedRepositoryIds(Integer... selectedRepositoryIds) { + return selectedRepositoryIds(List.of(selectedRepositoryIds)); + } + + /** + * @param visibility Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + * + * @return builder + * + */ + public Builder visibility(Output visibility) { + $.visibility = visibility; + return this; + } + + /** + * @param visibility Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + * + * @return builder + * + */ + public Builder visibility(String visibility) { + return visibility(Output.of(visibility)); + } + + public CodespacesOrganizationSecretArgs build() { + $.secretName = Objects.requireNonNull($.secretName, "expected parameter 'secretName' to be non-null"); + $.visibility = Objects.requireNonNull($.visibility, "expected parameter 'visibility' to be non-null"); + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/CodespacesSecret.java b/sdk/java/src/main/java/com/pulumi/github/CodespacesSecret.java new file mode 100644 index 00000000..bdae712b --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/CodespacesSecret.java @@ -0,0 +1,203 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Export; +import com.pulumi.core.annotations.ResourceType; +import com.pulumi.core.internal.Codegen; +import com.pulumi.github.CodespacesSecretArgs; +import com.pulumi.github.Utilities; +import com.pulumi.github.inputs.CodespacesSecretState; +import java.lang.String; +import java.util.List; +import java.util.Optional; +import javax.annotation.Nullable; + +/** + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetCodespacesPublicKeyArgs; + * import com.pulumi.github.CodespacesSecret; + * import com.pulumi.github.CodespacesSecretArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var examplePublicKey = GithubFunctions.getCodespacesPublicKey(GetCodespacesPublicKeyArgs.builder() + * .repository("example_repository") + * .build()); + * + * var exampleSecretCodespacesSecret = new CodespacesSecret("exampleSecretCodespacesSecret", CodespacesSecretArgs.builder() + * .repository("example_repository") + * .secretName("example_secret_name") + * .plaintextValue(var_.some_secret_string()) + * .build()); + * + * var exampleSecretIndex_codespacesSecretCodespacesSecret = new CodespacesSecret("exampleSecretIndex/codespacesSecretCodespacesSecret", CodespacesSecretArgs.builder() + * .repository("example_repository") + * .secretName("example_secret_name") + * .encryptedValue(var_.some_encrypted_secret_string()) + * .build()); + * + * } + * } + * ``` + * + */ +@ResourceType(type="github:index/codespacesSecret:CodespacesSecret") +public class CodespacesSecret extends com.pulumi.resources.CustomResource { + /** + * Date of actions_secret creation. + * + */ + @Export(name="createdAt", type=String.class, parameters={}) + private Output createdAt; + + /** + * @return Date of actions_secret creation. + * + */ + public Output createdAt() { + return this.createdAt; + } + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + @Export(name="encryptedValue", type=String.class, parameters={}) + private Output encryptedValue; + + /** + * @return Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + public Output> encryptedValue() { + return Codegen.optional(this.encryptedValue); + } + /** + * Plaintext value of the secret to be encrypted + * + */ + @Export(name="plaintextValue", type=String.class, parameters={}) + private Output plaintextValue; + + /** + * @return Plaintext value of the secret to be encrypted + * + */ + public Output> plaintextValue() { + return Codegen.optional(this.plaintextValue); + } + /** + * Name of the repository + * + */ + @Export(name="repository", type=String.class, parameters={}) + private Output repository; + + /** + * @return Name of the repository + * + */ + public Output repository() { + return this.repository; + } + /** + * Name of the secret + * + */ + @Export(name="secretName", type=String.class, parameters={}) + private Output secretName; + + /** + * @return Name of the secret + * + */ + public Output secretName() { + return this.secretName; + } + /** + * Date of actions_secret update. + * + */ + @Export(name="updatedAt", type=String.class, parameters={}) + private Output updatedAt; + + /** + * @return Date of actions_secret update. + * + */ + public Output updatedAt() { + return this.updatedAt; + } + + /** + * + * @param name The _unique_ name of the resulting resource. + */ + public CodespacesSecret(String name) { + this(name, CodespacesSecretArgs.Empty); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + */ + public CodespacesSecret(String name, CodespacesSecretArgs args) { + this(name, args, null); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + * @param options A bag of options that control this resource's behavior. + */ + public CodespacesSecret(String name, CodespacesSecretArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("github:index/codespacesSecret:CodespacesSecret", name, args == null ? CodespacesSecretArgs.Empty : args, makeResourceOptions(options, Codegen.empty())); + } + + private CodespacesSecret(String name, Output id, @Nullable CodespacesSecretState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("github:index/codespacesSecret:CodespacesSecret", name, state, makeResourceOptions(options, id)); + } + + private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { + var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() + .version(Utilities.getVersion()) + .additionalSecretOutputs(List.of( + "encryptedValue", + "plaintextValue" + )) + .build(); + return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); + } + + /** + * Get an existing Host resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state + * @param options Optional settings to control the behavior of the CustomResource. + */ + public static CodespacesSecret get(String name, Output id, @Nullable CodespacesSecretState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { + return new CodespacesSecret(name, id, state, options); + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/CodespacesSecretArgs.java b/sdk/java/src/main/java/com/pulumi/github/CodespacesSecretArgs.java new file mode 100644 index 00000000..ae41a5c6 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/CodespacesSecretArgs.java @@ -0,0 +1,196 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class CodespacesSecretArgs extends com.pulumi.resources.ResourceArgs { + + public static final CodespacesSecretArgs Empty = new CodespacesSecretArgs(); + + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + @Import(name="encryptedValue") + private @Nullable Output encryptedValue; + + /** + * @return Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + public Optional> encryptedValue() { + return Optional.ofNullable(this.encryptedValue); + } + + /** + * Plaintext value of the secret to be encrypted + * + */ + @Import(name="plaintextValue") + private @Nullable Output plaintextValue; + + /** + * @return Plaintext value of the secret to be encrypted + * + */ + public Optional> plaintextValue() { + return Optional.ofNullable(this.plaintextValue); + } + + /** + * Name of the repository + * + */ + @Import(name="repository", required=true) + private Output repository; + + /** + * @return Name of the repository + * + */ + public Output repository() { + return this.repository; + } + + /** + * Name of the secret + * + */ + @Import(name="secretName", required=true) + private Output secretName; + + /** + * @return Name of the secret + * + */ + public Output secretName() { + return this.secretName; + } + + private CodespacesSecretArgs() {} + + private CodespacesSecretArgs(CodespacesSecretArgs $) { + this.encryptedValue = $.encryptedValue; + this.plaintextValue = $.plaintextValue; + this.repository = $.repository; + this.secretName = $.secretName; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(CodespacesSecretArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private CodespacesSecretArgs $; + + public Builder() { + $ = new CodespacesSecretArgs(); + } + + public Builder(CodespacesSecretArgs defaults) { + $ = new CodespacesSecretArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param encryptedValue Encrypted value of the secret using the GitHub public key in Base64 format. + * + * @return builder + * + */ + public Builder encryptedValue(@Nullable Output encryptedValue) { + $.encryptedValue = encryptedValue; + return this; + } + + /** + * @param encryptedValue Encrypted value of the secret using the GitHub public key in Base64 format. + * + * @return builder + * + */ + public Builder encryptedValue(String encryptedValue) { + return encryptedValue(Output.of(encryptedValue)); + } + + /** + * @param plaintextValue Plaintext value of the secret to be encrypted + * + * @return builder + * + */ + public Builder plaintextValue(@Nullable Output plaintextValue) { + $.plaintextValue = plaintextValue; + return this; + } + + /** + * @param plaintextValue Plaintext value of the secret to be encrypted + * + * @return builder + * + */ + public Builder plaintextValue(String plaintextValue) { + return plaintextValue(Output.of(plaintextValue)); + } + + /** + * @param repository Name of the repository + * + * @return builder + * + */ + public Builder repository(Output repository) { + $.repository = repository; + return this; + } + + /** + * @param repository Name of the repository + * + * @return builder + * + */ + public Builder repository(String repository) { + return repository(Output.of(repository)); + } + + /** + * @param secretName Name of the secret + * + * @return builder + * + */ + public Builder secretName(Output secretName) { + $.secretName = secretName; + return this; + } + + /** + * @param secretName Name of the secret + * + * @return builder + * + */ + public Builder secretName(String secretName) { + return secretName(Output.of(secretName)); + } + + public CodespacesSecretArgs build() { + $.repository = Objects.requireNonNull($.repository, "expected parameter 'repository' to be non-null"); + $.secretName = Objects.requireNonNull($.secretName, "expected parameter 'secretName' to be non-null"); + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/CodespacesUserSecret.java b/sdk/java/src/main/java/com/pulumi/github/CodespacesUserSecret.java new file mode 100644 index 00000000..fa5d6067 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/CodespacesUserSecret.java @@ -0,0 +1,214 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Export; +import com.pulumi.core.annotations.ResourceType; +import com.pulumi.core.internal.Codegen; +import com.pulumi.github.CodespacesUserSecretArgs; +import com.pulumi.github.Utilities; +import com.pulumi.github.inputs.CodespacesUserSecretState; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Optional; +import javax.annotation.Nullable; + +/** + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetRepositoryArgs; + * import com.pulumi.github.CodespacesUserSecret; + * import com.pulumi.github.CodespacesUserSecretArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var repo = GithubFunctions.getRepository(GetRepositoryArgs.builder() + * .fullName("my-org/repo") + * .build()); + * + * var exampleSecretCodespacesUserSecret = new CodespacesUserSecret("exampleSecretCodespacesUserSecret", CodespacesUserSecretArgs.builder() + * .secretName("example_secret_name") + * .plaintextValue(var_.some_secret_string()) + * .selectedRepositoryIds(repo.applyValue(getRepositoryResult -> getRepositoryResult.repoId())) + * .build()); + * + * var exampleSecretIndex_codespacesUserSecretCodespacesUserSecret = new CodespacesUserSecret("exampleSecretIndex/codespacesUserSecretCodespacesUserSecret", CodespacesUserSecretArgs.builder() + * .secretName("example_secret_name") + * .encryptedValue(var_.some_encrypted_secret_string()) + * .selectedRepositoryIds(repo.applyValue(getRepositoryResult -> getRepositoryResult.repoId())) + * .build()); + * + * } + * } + * ``` + * + * ## Import + * + * This resource can be imported using an ID made up of the secret name + * + * ```sh + * $ pulumi import github:index/codespacesUserSecret:CodespacesUserSecret test_secret test_secret_name + * ``` + * + * NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. + * + */ +@ResourceType(type="github:index/codespacesUserSecret:CodespacesUserSecret") +public class CodespacesUserSecret extends com.pulumi.resources.CustomResource { + /** + * Date of codespaces_secret creation. + * + */ + @Export(name="createdAt", type=String.class, parameters={}) + private Output createdAt; + + /** + * @return Date of codespaces_secret creation. + * + */ + public Output createdAt() { + return this.createdAt; + } + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + @Export(name="encryptedValue", type=String.class, parameters={}) + private Output encryptedValue; + + /** + * @return Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + public Output> encryptedValue() { + return Codegen.optional(this.encryptedValue); + } + /** + * Plaintext value of the secret to be encrypted + * + */ + @Export(name="plaintextValue", type=String.class, parameters={}) + private Output plaintextValue; + + /** + * @return Plaintext value of the secret to be encrypted + * + */ + public Output> plaintextValue() { + return Codegen.optional(this.plaintextValue); + } + /** + * Name of the secret + * + */ + @Export(name="secretName", type=String.class, parameters={}) + private Output secretName; + + /** + * @return Name of the secret + * + */ + public Output secretName() { + return this.secretName; + } + /** + * An array of repository ids that can access the user secret. + * + */ + @Export(name="selectedRepositoryIds", type=List.class, parameters={Integer.class}) + private Output> selectedRepositoryIds; + + /** + * @return An array of repository ids that can access the user secret. + * + */ + public Output>> selectedRepositoryIds() { + return Codegen.optional(this.selectedRepositoryIds); + } + /** + * Date of codespaces_secret update. + * + */ + @Export(name="updatedAt", type=String.class, parameters={}) + private Output updatedAt; + + /** + * @return Date of codespaces_secret update. + * + */ + public Output updatedAt() { + return this.updatedAt; + } + + /** + * + * @param name The _unique_ name of the resulting resource. + */ + public CodespacesUserSecret(String name) { + this(name, CodespacesUserSecretArgs.Empty); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + */ + public CodespacesUserSecret(String name, CodespacesUserSecretArgs args) { + this(name, args, null); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + * @param options A bag of options that control this resource's behavior. + */ + public CodespacesUserSecret(String name, CodespacesUserSecretArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("github:index/codespacesUserSecret:CodespacesUserSecret", name, args == null ? CodespacesUserSecretArgs.Empty : args, makeResourceOptions(options, Codegen.empty())); + } + + private CodespacesUserSecret(String name, Output id, @Nullable CodespacesUserSecretState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("github:index/codespacesUserSecret:CodespacesUserSecret", name, state, makeResourceOptions(options, id)); + } + + private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { + var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() + .version(Utilities.getVersion()) + .additionalSecretOutputs(List.of( + "encryptedValue", + "plaintextValue" + )) + .build(); + return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); + } + + /** + * Get an existing Host resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state + * @param options Optional settings to control the behavior of the CustomResource. + */ + public static CodespacesUserSecret get(String name, Output id, @Nullable CodespacesUserSecretState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { + return new CodespacesUserSecret(name, id, state, options); + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/CodespacesUserSecretArgs.java b/sdk/java/src/main/java/com/pulumi/github/CodespacesUserSecretArgs.java new file mode 100644 index 00000000..e311b048 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/CodespacesUserSecretArgs.java @@ -0,0 +1,207 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class CodespacesUserSecretArgs extends com.pulumi.resources.ResourceArgs { + + public static final CodespacesUserSecretArgs Empty = new CodespacesUserSecretArgs(); + + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + @Import(name="encryptedValue") + private @Nullable Output encryptedValue; + + /** + * @return Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + public Optional> encryptedValue() { + return Optional.ofNullable(this.encryptedValue); + } + + /** + * Plaintext value of the secret to be encrypted + * + */ + @Import(name="plaintextValue") + private @Nullable Output plaintextValue; + + /** + * @return Plaintext value of the secret to be encrypted + * + */ + public Optional> plaintextValue() { + return Optional.ofNullable(this.plaintextValue); + } + + /** + * Name of the secret + * + */ + @Import(name="secretName", required=true) + private Output secretName; + + /** + * @return Name of the secret + * + */ + public Output secretName() { + return this.secretName; + } + + /** + * An array of repository ids that can access the user secret. + * + */ + @Import(name="selectedRepositoryIds") + private @Nullable Output> selectedRepositoryIds; + + /** + * @return An array of repository ids that can access the user secret. + * + */ + public Optional>> selectedRepositoryIds() { + return Optional.ofNullable(this.selectedRepositoryIds); + } + + private CodespacesUserSecretArgs() {} + + private CodespacesUserSecretArgs(CodespacesUserSecretArgs $) { + this.encryptedValue = $.encryptedValue; + this.plaintextValue = $.plaintextValue; + this.secretName = $.secretName; + this.selectedRepositoryIds = $.selectedRepositoryIds; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(CodespacesUserSecretArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private CodespacesUserSecretArgs $; + + public Builder() { + $ = new CodespacesUserSecretArgs(); + } + + public Builder(CodespacesUserSecretArgs defaults) { + $ = new CodespacesUserSecretArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param encryptedValue Encrypted value of the secret using the GitHub public key in Base64 format. + * + * @return builder + * + */ + public Builder encryptedValue(@Nullable Output encryptedValue) { + $.encryptedValue = encryptedValue; + return this; + } + + /** + * @param encryptedValue Encrypted value of the secret using the GitHub public key in Base64 format. + * + * @return builder + * + */ + public Builder encryptedValue(String encryptedValue) { + return encryptedValue(Output.of(encryptedValue)); + } + + /** + * @param plaintextValue Plaintext value of the secret to be encrypted + * + * @return builder + * + */ + public Builder plaintextValue(@Nullable Output plaintextValue) { + $.plaintextValue = plaintextValue; + return this; + } + + /** + * @param plaintextValue Plaintext value of the secret to be encrypted + * + * @return builder + * + */ + public Builder plaintextValue(String plaintextValue) { + return plaintextValue(Output.of(plaintextValue)); + } + + /** + * @param secretName Name of the secret + * + * @return builder + * + */ + public Builder secretName(Output secretName) { + $.secretName = secretName; + return this; + } + + /** + * @param secretName Name of the secret + * + * @return builder + * + */ + public Builder secretName(String secretName) { + return secretName(Output.of(secretName)); + } + + /** + * @param selectedRepositoryIds An array of repository ids that can access the user secret. + * + * @return builder + * + */ + public Builder selectedRepositoryIds(@Nullable Output> selectedRepositoryIds) { + $.selectedRepositoryIds = selectedRepositoryIds; + return this; + } + + /** + * @param selectedRepositoryIds An array of repository ids that can access the user secret. + * + * @return builder + * + */ + public Builder selectedRepositoryIds(List selectedRepositoryIds) { + return selectedRepositoryIds(Output.of(selectedRepositoryIds)); + } + + /** + * @param selectedRepositoryIds An array of repository ids that can access the user secret. + * + * @return builder + * + */ + public Builder selectedRepositoryIds(Integer... selectedRepositoryIds) { + return selectedRepositoryIds(List.of(selectedRepositoryIds)); + } + + public CodespacesUserSecretArgs build() { + $.secretName = Objects.requireNonNull($.secretName, "expected parameter 'secretName' to be non-null"); + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/GithubFunctions.java b/sdk/java/src/main/java/com/pulumi/github/GithubFunctions.java index e9cd7955..3c164ea5 100644 --- a/sdk/java/src/main/java/com/pulumi/github/GithubFunctions.java +++ b/sdk/java/src/main/java/com/pulumi/github/GithubFunctions.java @@ -28,6 +28,10 @@ import com.pulumi.github.inputs.GetBranchPlainArgs; import com.pulumi.github.inputs.GetBranchProtectionRulesArgs; import com.pulumi.github.inputs.GetBranchProtectionRulesPlainArgs; +import com.pulumi.github.inputs.GetCodespacesPublicKeyArgs; +import com.pulumi.github.inputs.GetCodespacesPublicKeyPlainArgs; +import com.pulumi.github.inputs.GetCodespacesSecretsArgs; +import com.pulumi.github.inputs.GetCodespacesSecretsPlainArgs; import com.pulumi.github.inputs.GetCollaboratorsArgs; import com.pulumi.github.inputs.GetCollaboratorsPlainArgs; import com.pulumi.github.inputs.GetDependabotPublicKeyArgs; @@ -43,6 +47,8 @@ import com.pulumi.github.inputs.GetMembershipArgs; import com.pulumi.github.inputs.GetMembershipPlainArgs; import com.pulumi.github.inputs.GetOrganizationArgs; +import com.pulumi.github.inputs.GetOrganizationCustomRoleArgs; +import com.pulumi.github.inputs.GetOrganizationCustomRolePlainArgs; import com.pulumi.github.inputs.GetOrganizationPlainArgs; import com.pulumi.github.inputs.GetOrganizationTeamsArgs; import com.pulumi.github.inputs.GetOrganizationTeamsPlainArgs; @@ -101,6 +107,12 @@ import com.pulumi.github.outputs.GetAppTokenResult; import com.pulumi.github.outputs.GetBranchProtectionRulesResult; import com.pulumi.github.outputs.GetBranchResult; +import com.pulumi.github.outputs.GetCodespacesOrganizationPublicKeyResult; +import com.pulumi.github.outputs.GetCodespacesOrganizationSecretsResult; +import com.pulumi.github.outputs.GetCodespacesPublicKeyResult; +import com.pulumi.github.outputs.GetCodespacesSecretsResult; +import com.pulumi.github.outputs.GetCodespacesUserPublicKeyResult; +import com.pulumi.github.outputs.GetCodespacesUserSecretsResult; import com.pulumi.github.outputs.GetCollaboratorsResult; import com.pulumi.github.outputs.GetDependabotOrganizationPublicKeyResult; import com.pulumi.github.outputs.GetDependabotOrganizationSecretsResult; @@ -112,6 +124,7 @@ import com.pulumi.github.outputs.GetIpRangesResult; import com.pulumi.github.outputs.GetIssueLabelsResult; import com.pulumi.github.outputs.GetMembershipResult; +import com.pulumi.github.outputs.GetOrganizationCustomRoleResult; import com.pulumi.github.outputs.GetOrganizationIpAllowListResult; import com.pulumi.github.outputs.GetOrganizationResult; import com.pulumi.github.outputs.GetOrganizationTeamSyncGroupsResult; @@ -2820,6 +2833,1232 @@ public static Output getBranchProtectionRules(Ge public static CompletableFuture getBranchProtectionRulesPlain(GetBranchProtectionRulesPlainArgs args, InvokeOptions options) { return Deployment.getInstance().invokeAsync("github:index/getBranchProtectionRules:getBranchProtectionRules", TypeShape.of(GetBranchProtectionRulesResult.class), args, Utilities.withVersion(options)); } + /** + * Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesOrganizationPublicKey(); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesOrganizationPublicKey() { + return getCodespacesOrganizationPublicKey(InvokeArgs.Empty, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesOrganizationPublicKey(); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesOrganizationPublicKeyPlain() { + return getCodespacesOrganizationPublicKeyPlain(InvokeArgs.Empty, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesOrganizationPublicKey(); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesOrganizationPublicKey(InvokeArgs args) { + return getCodespacesOrganizationPublicKey(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesOrganizationPublicKey(); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesOrganizationPublicKeyPlain(InvokeArgs args) { + return getCodespacesOrganizationPublicKeyPlain(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesOrganizationPublicKey(); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesOrganizationPublicKey(InvokeArgs args, InvokeOptions options) { + return Deployment.getInstance().invoke("github:index/getCodespacesOrganizationPublicKey:getCodespacesOrganizationPublicKey", TypeShape.of(GetCodespacesOrganizationPublicKeyResult.class), args, Utilities.withVersion(options)); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesOrganizationPublicKey(); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesOrganizationPublicKeyPlain(InvokeArgs args, InvokeOptions options) { + return Deployment.getInstance().invokeAsync("github:index/getCodespacesOrganizationPublicKey:getCodespacesOrganizationPublicKey", TypeShape.of(GetCodespacesOrganizationPublicKeyResult.class), args, Utilities.withVersion(options)); + } + /** + * Use this data source to retrieve the list of codespaces secrets of the organization. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesOrganizationSecrets(); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesOrganizationSecrets() { + return getCodespacesOrganizationSecrets(InvokeArgs.Empty, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve the list of codespaces secrets of the organization. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesOrganizationSecrets(); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesOrganizationSecretsPlain() { + return getCodespacesOrganizationSecretsPlain(InvokeArgs.Empty, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve the list of codespaces secrets of the organization. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesOrganizationSecrets(); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesOrganizationSecrets(InvokeArgs args) { + return getCodespacesOrganizationSecrets(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve the list of codespaces secrets of the organization. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesOrganizationSecrets(); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesOrganizationSecretsPlain(InvokeArgs args) { + return getCodespacesOrganizationSecretsPlain(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve the list of codespaces secrets of the organization. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesOrganizationSecrets(); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesOrganizationSecrets(InvokeArgs args, InvokeOptions options) { + return Deployment.getInstance().invoke("github:index/getCodespacesOrganizationSecrets:getCodespacesOrganizationSecrets", TypeShape.of(GetCodespacesOrganizationSecretsResult.class), args, Utilities.withVersion(options)); + } + /** + * Use this data source to retrieve the list of codespaces secrets of the organization. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesOrganizationSecrets(); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesOrganizationSecretsPlain(InvokeArgs args, InvokeOptions options) { + return Deployment.getInstance().invokeAsync("github:index/getCodespacesOrganizationSecrets:getCodespacesOrganizationSecrets", TypeShape.of(GetCodespacesOrganizationSecretsResult.class), args, Utilities.withVersion(options)); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetCodespacesPublicKeyArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesPublicKey(GetCodespacesPublicKeyArgs.builder() + * .repository("example_repo") + * .build()); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesPublicKey(GetCodespacesPublicKeyArgs args) { + return getCodespacesPublicKey(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetCodespacesPublicKeyArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesPublicKey(GetCodespacesPublicKeyArgs.builder() + * .repository("example_repo") + * .build()); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesPublicKeyPlain(GetCodespacesPublicKeyPlainArgs args) { + return getCodespacesPublicKeyPlain(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetCodespacesPublicKeyArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesPublicKey(GetCodespacesPublicKeyArgs.builder() + * .repository("example_repo") + * .build()); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesPublicKey(GetCodespacesPublicKeyArgs args, InvokeOptions options) { + return Deployment.getInstance().invoke("github:index/getCodespacesPublicKey:getCodespacesPublicKey", TypeShape.of(GetCodespacesPublicKeyResult.class), args, Utilities.withVersion(options)); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetCodespacesPublicKeyArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesPublicKey(GetCodespacesPublicKeyArgs.builder() + * .repository("example_repo") + * .build()); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesPublicKeyPlain(GetCodespacesPublicKeyPlainArgs args, InvokeOptions options) { + return Deployment.getInstance().invokeAsync("github:index/getCodespacesPublicKey:getCodespacesPublicKey", TypeShape.of(GetCodespacesPublicKeyResult.class), args, Utilities.withVersion(options)); + } + /** + * Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetCodespacesSecretsArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder() + * .name("example_repository") + * .build()); + * + * final var example2 = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder() + * .fullName("org/example_repository") + * .build()); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesSecrets() { + return getCodespacesSecrets(GetCodespacesSecretsArgs.Empty, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetCodespacesSecretsArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder() + * .name("example_repository") + * .build()); + * + * final var example2 = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder() + * .fullName("org/example_repository") + * .build()); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesSecretsPlain() { + return getCodespacesSecretsPlain(GetCodespacesSecretsPlainArgs.Empty, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetCodespacesSecretsArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder() + * .name("example_repository") + * .build()); + * + * final var example2 = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder() + * .fullName("org/example_repository") + * .build()); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesSecrets(GetCodespacesSecretsArgs args) { + return getCodespacesSecrets(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetCodespacesSecretsArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder() + * .name("example_repository") + * .build()); + * + * final var example2 = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder() + * .fullName("org/example_repository") + * .build()); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesSecretsPlain(GetCodespacesSecretsPlainArgs args) { + return getCodespacesSecretsPlain(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetCodespacesSecretsArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder() + * .name("example_repository") + * .build()); + * + * final var example2 = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder() + * .fullName("org/example_repository") + * .build()); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesSecrets(GetCodespacesSecretsArgs args, InvokeOptions options) { + return Deployment.getInstance().invoke("github:index/getCodespacesSecrets:getCodespacesSecrets", TypeShape.of(GetCodespacesSecretsResult.class), args, Utilities.withVersion(options)); + } + /** + * Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetCodespacesSecretsArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder() + * .name("example_repository") + * .build()); + * + * final var example2 = GithubFunctions.getCodespacesSecrets(GetCodespacesSecretsArgs.builder() + * .fullName("org/example_repository") + * .build()); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesSecretsPlain(GetCodespacesSecretsPlainArgs args, InvokeOptions options) { + return Deployment.getInstance().invokeAsync("github:index/getCodespacesSecrets:getCodespacesSecrets", TypeShape.of(GetCodespacesSecretsResult.class), args, Utilities.withVersion(options)); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesUserPublicKey(); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesUserPublicKey() { + return getCodespacesUserPublicKey(InvokeArgs.Empty, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesUserPublicKey(); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesUserPublicKeyPlain() { + return getCodespacesUserPublicKeyPlain(InvokeArgs.Empty, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesUserPublicKey(); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesUserPublicKey(InvokeArgs args) { + return getCodespacesUserPublicKey(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesUserPublicKey(); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesUserPublicKeyPlain(InvokeArgs args) { + return getCodespacesUserPublicKeyPlain(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesUserPublicKey(); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesUserPublicKey(InvokeArgs args, InvokeOptions options) { + return Deployment.getInstance().invoke("github:index/getCodespacesUserPublicKey:getCodespacesUserPublicKey", TypeShape.of(GetCodespacesUserPublicKeyResult.class), args, Utilities.withVersion(options)); + } + /** + * Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesUserPublicKey(); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesUserPublicKeyPlain(InvokeArgs args, InvokeOptions options) { + return Deployment.getInstance().invokeAsync("github:index/getCodespacesUserPublicKey:getCodespacesUserPublicKey", TypeShape.of(GetCodespacesUserPublicKeyResult.class), args, Utilities.withVersion(options)); + } + /** + * Use this data source to retrieve the list of codespaces secrets of the user. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesUserSecrets(); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesUserSecrets() { + return getCodespacesUserSecrets(InvokeArgs.Empty, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve the list of codespaces secrets of the user. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesUserSecrets(); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesUserSecretsPlain() { + return getCodespacesUserSecretsPlain(InvokeArgs.Empty, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve the list of codespaces secrets of the user. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesUserSecrets(); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesUserSecrets(InvokeArgs args) { + return getCodespacesUserSecrets(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve the list of codespaces secrets of the user. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesUserSecrets(); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesUserSecretsPlain(InvokeArgs args) { + return getCodespacesUserSecretsPlain(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve the list of codespaces secrets of the user. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesUserSecrets(); + * + * } + * } + * ``` + * + */ + public static Output getCodespacesUserSecrets(InvokeArgs args, InvokeOptions options) { + return Deployment.getInstance().invoke("github:index/getCodespacesUserSecrets:getCodespacesUserSecrets", TypeShape.of(GetCodespacesUserSecretsResult.class), args, Utilities.withVersion(options)); + } + /** + * Use this data source to retrieve the list of codespaces secrets of the user. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getCodespacesUserSecrets(); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getCodespacesUserSecretsPlain(InvokeArgs args, InvokeOptions options) { + return Deployment.getInstance().invokeAsync("github:index/getCodespacesUserSecrets:getCodespacesUserSecrets", TypeShape.of(GetCodespacesUserSecretsResult.class), args, Utilities.withVersion(options)); + } /** * Use this data source to retrieve the collaborators for a given repository. * @@ -4678,6 +5917,162 @@ public static Output getOrganization(GetOrganizationArgs public static CompletableFuture getOrganizationPlain(GetOrganizationPlainArgs args, InvokeOptions options) { return Deployment.getInstance().invokeAsync("github:index/getOrganization:getOrganization", TypeShape.of(GetOrganizationResult.class), args, Utilities.withVersion(options)); } + /** + * Use this data source to retrieve information about a custom role in a GitHub Organization. + * + * > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetOrganizationCustomRoleArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getOrganizationCustomRole(GetOrganizationCustomRoleArgs.builder() + * .name("example") + * .build()); + * + * } + * } + * ``` + * + */ + public static Output getOrganizationCustomRole(GetOrganizationCustomRoleArgs args) { + return getOrganizationCustomRole(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve information about a custom role in a GitHub Organization. + * + * > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetOrganizationCustomRoleArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getOrganizationCustomRole(GetOrganizationCustomRoleArgs.builder() + * .name("example") + * .build()); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getOrganizationCustomRolePlain(GetOrganizationCustomRolePlainArgs args) { + return getOrganizationCustomRolePlain(args, InvokeOptions.Empty); + } + /** + * Use this data source to retrieve information about a custom role in a GitHub Organization. + * + * > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetOrganizationCustomRoleArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getOrganizationCustomRole(GetOrganizationCustomRoleArgs.builder() + * .name("example") + * .build()); + * + * } + * } + * ``` + * + */ + public static Output getOrganizationCustomRole(GetOrganizationCustomRoleArgs args, InvokeOptions options) { + return Deployment.getInstance().invoke("github:index/getOrganizationCustomRole:getOrganizationCustomRole", TypeShape.of(GetOrganizationCustomRoleResult.class), args, Utilities.withVersion(options)); + } + /** + * Use this data source to retrieve information about a custom role in a GitHub Organization. + * + * > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.GithubFunctions; + * import com.pulumi.github.inputs.GetOrganizationCustomRoleArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * final var example = GithubFunctions.getOrganizationCustomRole(GetOrganizationCustomRoleArgs.builder() + * .name("example") + * .build()); + * + * } + * } + * ``` + * + */ + public static CompletableFuture getOrganizationCustomRolePlain(GetOrganizationCustomRolePlainArgs args, InvokeOptions options) { + return Deployment.getInstance().invokeAsync("github:index/getOrganizationCustomRole:getOrganizationCustomRole", TypeShape.of(GetOrganizationCustomRoleResult.class), args, Utilities.withVersion(options)); + } /** * Use this data source to retrieve information about the IP allow list of an organization. * The allow list for IP addresses will block access to private resources via the web, API, diff --git a/sdk/java/src/main/java/com/pulumi/github/OrganizationCustomRole.java b/sdk/java/src/main/java/com/pulumi/github/OrganizationCustomRole.java new file mode 100644 index 00000000..755bd43b --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/OrganizationCustomRole.java @@ -0,0 +1,190 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Export; +import com.pulumi.core.annotations.ResourceType; +import com.pulumi.core.internal.Codegen; +import com.pulumi.github.OrganizationCustomRoleArgs; +import com.pulumi.github.Utilities; +import com.pulumi.github.inputs.OrganizationCustomRoleState; +import java.lang.String; +import java.util.List; +import java.util.Optional; +import javax.annotation.Nullable; + +/** + * This resource allows you to create and manage custom roles in a GitHub Organization for use in repositories. + * + * > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + * + * ## Example Usage + * ```java + * package generated_program; + * + * import com.pulumi.Context; + * import com.pulumi.Pulumi; + * import com.pulumi.core.Output; + * import com.pulumi.github.OrganizationCustomRole; + * import com.pulumi.github.OrganizationCustomRoleArgs; + * import java.util.List; + * import java.util.ArrayList; + * import java.util.Map; + * import java.io.File; + * import java.nio.file.Files; + * import java.nio.file.Paths; + * + * public class App { + * public static void main(String[] args) { + * Pulumi.run(App::stack); + * } + * + * public static void stack(Context ctx) { + * var example = new OrganizationCustomRole("example", OrganizationCustomRoleArgs.builder() + * .baseRole("read") + * .description("Example custom role that uses the read role as its base") + * .permissions( + * "add_assignee", + * "add_label", + * "bypass_branch_protection", + * "close_issue", + * "close_pull_request", + * "mark_as_duplicate", + * "create_tag", + * "delete_issue", + * "delete_tag", + * "manage_deploy_keys", + * "push_protected_branch", + * "read_code_scanning", + * "reopen_issue", + * "reopen_pull_request", + * "request_pr_review", + * "resolve_dependabot_alerts", + * "resolve_secret_scanning_alerts", + * "view_secret_scanning_alerts", + * "write_code_scanning") + * .build()); + * + * } + * } + * ``` + * + * ## Import + * + * Custom roles can be imported using the `id` of the role. The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API. + * + * ```sh + * $ pulumi import github:index/organizationCustomRole:OrganizationCustomRole example 1234 + * ``` + * + */ +@ResourceType(type="github:index/organizationCustomRole:OrganizationCustomRole") +public class OrganizationCustomRole extends com.pulumi.resources.CustomResource { + /** + * The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + * + */ + @Export(name="baseRole", type=String.class, parameters={}) + private Output baseRole; + + /** + * @return The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + * + */ + public Output baseRole() { + return this.baseRole; + } + /** + * The description for the custom role. + * + */ + @Export(name="description", type=String.class, parameters={}) + private Output description; + + /** + * @return The description for the custom role. + * + */ + public Output> description() { + return Codegen.optional(this.description); + } + /** + * The name of the custom role. + * + */ + @Export(name="name", type=String.class, parameters={}) + private Output name; + + /** + * @return The name of the custom role. + * + */ + public Output name() { + return this.name; + } + /** + * A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + * + */ + @Export(name="permissions", type=List.class, parameters={String.class}) + private Output> permissions; + + /** + * @return A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + * + */ + public Output> permissions() { + return this.permissions; + } + + /** + * + * @param name The _unique_ name of the resulting resource. + */ + public OrganizationCustomRole(String name) { + this(name, OrganizationCustomRoleArgs.Empty); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + */ + public OrganizationCustomRole(String name, OrganizationCustomRoleArgs args) { + this(name, args, null); + } + /** + * + * @param name The _unique_ name of the resulting resource. + * @param args The arguments to use to populate this resource's properties. + * @param options A bag of options that control this resource's behavior. + */ + public OrganizationCustomRole(String name, OrganizationCustomRoleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("github:index/organizationCustomRole:OrganizationCustomRole", name, args == null ? OrganizationCustomRoleArgs.Empty : args, makeResourceOptions(options, Codegen.empty())); + } + + private OrganizationCustomRole(String name, Output id, @Nullable OrganizationCustomRoleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { + super("github:index/organizationCustomRole:OrganizationCustomRole", name, state, makeResourceOptions(options, id)); + } + + private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { + var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() + .version(Utilities.getVersion()) + .build(); + return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); + } + + /** + * Get an existing Host resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state + * @param options Optional settings to control the behavior of the CustomResource. + */ + public static OrganizationCustomRole get(String name, Output id, @Nullable OrganizationCustomRoleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { + return new OrganizationCustomRole(name, id, state, options); + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/OrganizationCustomRoleArgs.java b/sdk/java/src/main/java/com/pulumi/github/OrganizationCustomRoleArgs.java new file mode 100644 index 00000000..1fcfcd16 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/OrganizationCustomRoleArgs.java @@ -0,0 +1,207 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class OrganizationCustomRoleArgs extends com.pulumi.resources.ResourceArgs { + + public static final OrganizationCustomRoleArgs Empty = new OrganizationCustomRoleArgs(); + + /** + * The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + * + */ + @Import(name="baseRole", required=true) + private Output baseRole; + + /** + * @return The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + * + */ + public Output baseRole() { + return this.baseRole; + } + + /** + * The description for the custom role. + * + */ + @Import(name="description") + private @Nullable Output description; + + /** + * @return The description for the custom role. + * + */ + public Optional> description() { + return Optional.ofNullable(this.description); + } + + /** + * The name of the custom role. + * + */ + @Import(name="name") + private @Nullable Output name; + + /** + * @return The name of the custom role. + * + */ + public Optional> name() { + return Optional.ofNullable(this.name); + } + + /** + * A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + * + */ + @Import(name="permissions", required=true) + private Output> permissions; + + /** + * @return A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + * + */ + public Output> permissions() { + return this.permissions; + } + + private OrganizationCustomRoleArgs() {} + + private OrganizationCustomRoleArgs(OrganizationCustomRoleArgs $) { + this.baseRole = $.baseRole; + this.description = $.description; + this.name = $.name; + this.permissions = $.permissions; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(OrganizationCustomRoleArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private OrganizationCustomRoleArgs $; + + public Builder() { + $ = new OrganizationCustomRoleArgs(); + } + + public Builder(OrganizationCustomRoleArgs defaults) { + $ = new OrganizationCustomRoleArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param baseRole The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + * + * @return builder + * + */ + public Builder baseRole(Output baseRole) { + $.baseRole = baseRole; + return this; + } + + /** + * @param baseRole The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + * + * @return builder + * + */ + public Builder baseRole(String baseRole) { + return baseRole(Output.of(baseRole)); + } + + /** + * @param description The description for the custom role. + * + * @return builder + * + */ + public Builder description(@Nullable Output description) { + $.description = description; + return this; + } + + /** + * @param description The description for the custom role. + * + * @return builder + * + */ + public Builder description(String description) { + return description(Output.of(description)); + } + + /** + * @param name The name of the custom role. + * + * @return builder + * + */ + public Builder name(@Nullable Output name) { + $.name = name; + return this; + } + + /** + * @param name The name of the custom role. + * + * @return builder + * + */ + public Builder name(String name) { + return name(Output.of(name)); + } + + /** + * @param permissions A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + * + * @return builder + * + */ + public Builder permissions(Output> permissions) { + $.permissions = permissions; + return this; + } + + /** + * @param permissions A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + * + * @return builder + * + */ + public Builder permissions(List permissions) { + return permissions(Output.of(permissions)); + } + + /** + * @param permissions A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + * + * @return builder + * + */ + public Builder permissions(String... permissions) { + return permissions(List.of(permissions)); + } + + public OrganizationCustomRoleArgs build() { + $.baseRole = Objects.requireNonNull($.baseRole, "expected parameter 'baseRole' to be non-null"); + $.permissions = Objects.requireNonNull($.permissions, "expected parameter 'permissions' to be non-null"); + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/CodespacesOrganizationSecretState.java b/sdk/java/src/main/java/com/pulumi/github/inputs/CodespacesOrganizationSecretState.java new file mode 100644 index 00000000..8d89f926 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/CodespacesOrganizationSecretState.java @@ -0,0 +1,321 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class CodespacesOrganizationSecretState extends com.pulumi.resources.ResourceArgs { + + public static final CodespacesOrganizationSecretState Empty = new CodespacesOrganizationSecretState(); + + /** + * Date of codespaces_secret creation. + * + */ + @Import(name="createdAt") + private @Nullable Output createdAt; + + /** + * @return Date of codespaces_secret creation. + * + */ + public Optional> createdAt() { + return Optional.ofNullable(this.createdAt); + } + + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + @Import(name="encryptedValue") + private @Nullable Output encryptedValue; + + /** + * @return Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + public Optional> encryptedValue() { + return Optional.ofNullable(this.encryptedValue); + } + + /** + * Plaintext value of the secret to be encrypted + * + */ + @Import(name="plaintextValue") + private @Nullable Output plaintextValue; + + /** + * @return Plaintext value of the secret to be encrypted + * + */ + public Optional> plaintextValue() { + return Optional.ofNullable(this.plaintextValue); + } + + /** + * Name of the secret + * + */ + @Import(name="secretName") + private @Nullable Output secretName; + + /** + * @return Name of the secret + * + */ + public Optional> secretName() { + return Optional.ofNullable(this.secretName); + } + + /** + * An array of repository ids that can access the organization secret. + * + */ + @Import(name="selectedRepositoryIds") + private @Nullable Output> selectedRepositoryIds; + + /** + * @return An array of repository ids that can access the organization secret. + * + */ + public Optional>> selectedRepositoryIds() { + return Optional.ofNullable(this.selectedRepositoryIds); + } + + /** + * Date of codespaces_secret update. + * + */ + @Import(name="updatedAt") + private @Nullable Output updatedAt; + + /** + * @return Date of codespaces_secret update. + * + */ + public Optional> updatedAt() { + return Optional.ofNullable(this.updatedAt); + } + + /** + * Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + * + */ + @Import(name="visibility") + private @Nullable Output visibility; + + /** + * @return Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + * + */ + public Optional> visibility() { + return Optional.ofNullable(this.visibility); + } + + private CodespacesOrganizationSecretState() {} + + private CodespacesOrganizationSecretState(CodespacesOrganizationSecretState $) { + this.createdAt = $.createdAt; + this.encryptedValue = $.encryptedValue; + this.plaintextValue = $.plaintextValue; + this.secretName = $.secretName; + this.selectedRepositoryIds = $.selectedRepositoryIds; + this.updatedAt = $.updatedAt; + this.visibility = $.visibility; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(CodespacesOrganizationSecretState defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private CodespacesOrganizationSecretState $; + + public Builder() { + $ = new CodespacesOrganizationSecretState(); + } + + public Builder(CodespacesOrganizationSecretState defaults) { + $ = new CodespacesOrganizationSecretState(Objects.requireNonNull(defaults)); + } + + /** + * @param createdAt Date of codespaces_secret creation. + * + * @return builder + * + */ + public Builder createdAt(@Nullable Output createdAt) { + $.createdAt = createdAt; + return this; + } + + /** + * @param createdAt Date of codespaces_secret creation. + * + * @return builder + * + */ + public Builder createdAt(String createdAt) { + return createdAt(Output.of(createdAt)); + } + + /** + * @param encryptedValue Encrypted value of the secret using the GitHub public key in Base64 format. + * + * @return builder + * + */ + public Builder encryptedValue(@Nullable Output encryptedValue) { + $.encryptedValue = encryptedValue; + return this; + } + + /** + * @param encryptedValue Encrypted value of the secret using the GitHub public key in Base64 format. + * + * @return builder + * + */ + public Builder encryptedValue(String encryptedValue) { + return encryptedValue(Output.of(encryptedValue)); + } + + /** + * @param plaintextValue Plaintext value of the secret to be encrypted + * + * @return builder + * + */ + public Builder plaintextValue(@Nullable Output plaintextValue) { + $.plaintextValue = plaintextValue; + return this; + } + + /** + * @param plaintextValue Plaintext value of the secret to be encrypted + * + * @return builder + * + */ + public Builder plaintextValue(String plaintextValue) { + return plaintextValue(Output.of(plaintextValue)); + } + + /** + * @param secretName Name of the secret + * + * @return builder + * + */ + public Builder secretName(@Nullable Output secretName) { + $.secretName = secretName; + return this; + } + + /** + * @param secretName Name of the secret + * + * @return builder + * + */ + public Builder secretName(String secretName) { + return secretName(Output.of(secretName)); + } + + /** + * @param selectedRepositoryIds An array of repository ids that can access the organization secret. + * + * @return builder + * + */ + public Builder selectedRepositoryIds(@Nullable Output> selectedRepositoryIds) { + $.selectedRepositoryIds = selectedRepositoryIds; + return this; + } + + /** + * @param selectedRepositoryIds An array of repository ids that can access the organization secret. + * + * @return builder + * + */ + public Builder selectedRepositoryIds(List selectedRepositoryIds) { + return selectedRepositoryIds(Output.of(selectedRepositoryIds)); + } + + /** + * @param selectedRepositoryIds An array of repository ids that can access the organization secret. + * + * @return builder + * + */ + public Builder selectedRepositoryIds(Integer... selectedRepositoryIds) { + return selectedRepositoryIds(List.of(selectedRepositoryIds)); + } + + /** + * @param updatedAt Date of codespaces_secret update. + * + * @return builder + * + */ + public Builder updatedAt(@Nullable Output updatedAt) { + $.updatedAt = updatedAt; + return this; + } + + /** + * @param updatedAt Date of codespaces_secret update. + * + * @return builder + * + */ + public Builder updatedAt(String updatedAt) { + return updatedAt(Output.of(updatedAt)); + } + + /** + * @param visibility Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + * + * @return builder + * + */ + public Builder visibility(@Nullable Output visibility) { + $.visibility = visibility; + return this; + } + + /** + * @param visibility Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + * + * @return builder + * + */ + public Builder visibility(String visibility) { + return visibility(Output.of(visibility)); + } + + public CodespacesOrganizationSecretState build() { + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/CodespacesSecretState.java b/sdk/java/src/main/java/com/pulumi/github/inputs/CodespacesSecretState.java new file mode 100644 index 00000000..359c9c2e --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/CodespacesSecretState.java @@ -0,0 +1,268 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class CodespacesSecretState extends com.pulumi.resources.ResourceArgs { + + public static final CodespacesSecretState Empty = new CodespacesSecretState(); + + /** + * Date of actions_secret creation. + * + */ + @Import(name="createdAt") + private @Nullable Output createdAt; + + /** + * @return Date of actions_secret creation. + * + */ + public Optional> createdAt() { + return Optional.ofNullable(this.createdAt); + } + + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + @Import(name="encryptedValue") + private @Nullable Output encryptedValue; + + /** + * @return Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + public Optional> encryptedValue() { + return Optional.ofNullable(this.encryptedValue); + } + + /** + * Plaintext value of the secret to be encrypted + * + */ + @Import(name="plaintextValue") + private @Nullable Output plaintextValue; + + /** + * @return Plaintext value of the secret to be encrypted + * + */ + public Optional> plaintextValue() { + return Optional.ofNullable(this.plaintextValue); + } + + /** + * Name of the repository + * + */ + @Import(name="repository") + private @Nullable Output repository; + + /** + * @return Name of the repository + * + */ + public Optional> repository() { + return Optional.ofNullable(this.repository); + } + + /** + * Name of the secret + * + */ + @Import(name="secretName") + private @Nullable Output secretName; + + /** + * @return Name of the secret + * + */ + public Optional> secretName() { + return Optional.ofNullable(this.secretName); + } + + /** + * Date of actions_secret update. + * + */ + @Import(name="updatedAt") + private @Nullable Output updatedAt; + + /** + * @return Date of actions_secret update. + * + */ + public Optional> updatedAt() { + return Optional.ofNullable(this.updatedAt); + } + + private CodespacesSecretState() {} + + private CodespacesSecretState(CodespacesSecretState $) { + this.createdAt = $.createdAt; + this.encryptedValue = $.encryptedValue; + this.plaintextValue = $.plaintextValue; + this.repository = $.repository; + this.secretName = $.secretName; + this.updatedAt = $.updatedAt; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(CodespacesSecretState defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private CodespacesSecretState $; + + public Builder() { + $ = new CodespacesSecretState(); + } + + public Builder(CodespacesSecretState defaults) { + $ = new CodespacesSecretState(Objects.requireNonNull(defaults)); + } + + /** + * @param createdAt Date of actions_secret creation. + * + * @return builder + * + */ + public Builder createdAt(@Nullable Output createdAt) { + $.createdAt = createdAt; + return this; + } + + /** + * @param createdAt Date of actions_secret creation. + * + * @return builder + * + */ + public Builder createdAt(String createdAt) { + return createdAt(Output.of(createdAt)); + } + + /** + * @param encryptedValue Encrypted value of the secret using the GitHub public key in Base64 format. + * + * @return builder + * + */ + public Builder encryptedValue(@Nullable Output encryptedValue) { + $.encryptedValue = encryptedValue; + return this; + } + + /** + * @param encryptedValue Encrypted value of the secret using the GitHub public key in Base64 format. + * + * @return builder + * + */ + public Builder encryptedValue(String encryptedValue) { + return encryptedValue(Output.of(encryptedValue)); + } + + /** + * @param plaintextValue Plaintext value of the secret to be encrypted + * + * @return builder + * + */ + public Builder plaintextValue(@Nullable Output plaintextValue) { + $.plaintextValue = plaintextValue; + return this; + } + + /** + * @param plaintextValue Plaintext value of the secret to be encrypted + * + * @return builder + * + */ + public Builder plaintextValue(String plaintextValue) { + return plaintextValue(Output.of(plaintextValue)); + } + + /** + * @param repository Name of the repository + * + * @return builder + * + */ + public Builder repository(@Nullable Output repository) { + $.repository = repository; + return this; + } + + /** + * @param repository Name of the repository + * + * @return builder + * + */ + public Builder repository(String repository) { + return repository(Output.of(repository)); + } + + /** + * @param secretName Name of the secret + * + * @return builder + * + */ + public Builder secretName(@Nullable Output secretName) { + $.secretName = secretName; + return this; + } + + /** + * @param secretName Name of the secret + * + * @return builder + * + */ + public Builder secretName(String secretName) { + return secretName(Output.of(secretName)); + } + + /** + * @param updatedAt Date of actions_secret update. + * + * @return builder + * + */ + public Builder updatedAt(@Nullable Output updatedAt) { + $.updatedAt = updatedAt; + return this; + } + + /** + * @param updatedAt Date of actions_secret update. + * + * @return builder + * + */ + public Builder updatedAt(String updatedAt) { + return updatedAt(Output.of(updatedAt)); + } + + public CodespacesSecretState build() { + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/CodespacesUserSecretState.java b/sdk/java/src/main/java/com/pulumi/github/inputs/CodespacesUserSecretState.java new file mode 100644 index 00000000..c3a21133 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/CodespacesUserSecretState.java @@ -0,0 +1,280 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class CodespacesUserSecretState extends com.pulumi.resources.ResourceArgs { + + public static final CodespacesUserSecretState Empty = new CodespacesUserSecretState(); + + /** + * Date of codespaces_secret creation. + * + */ + @Import(name="createdAt") + private @Nullable Output createdAt; + + /** + * @return Date of codespaces_secret creation. + * + */ + public Optional> createdAt() { + return Optional.ofNullable(this.createdAt); + } + + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + @Import(name="encryptedValue") + private @Nullable Output encryptedValue; + + /** + * @return Encrypted value of the secret using the GitHub public key in Base64 format. + * + */ + public Optional> encryptedValue() { + return Optional.ofNullable(this.encryptedValue); + } + + /** + * Plaintext value of the secret to be encrypted + * + */ + @Import(name="plaintextValue") + private @Nullable Output plaintextValue; + + /** + * @return Plaintext value of the secret to be encrypted + * + */ + public Optional> plaintextValue() { + return Optional.ofNullable(this.plaintextValue); + } + + /** + * Name of the secret + * + */ + @Import(name="secretName") + private @Nullable Output secretName; + + /** + * @return Name of the secret + * + */ + public Optional> secretName() { + return Optional.ofNullable(this.secretName); + } + + /** + * An array of repository ids that can access the user secret. + * + */ + @Import(name="selectedRepositoryIds") + private @Nullable Output> selectedRepositoryIds; + + /** + * @return An array of repository ids that can access the user secret. + * + */ + public Optional>> selectedRepositoryIds() { + return Optional.ofNullable(this.selectedRepositoryIds); + } + + /** + * Date of codespaces_secret update. + * + */ + @Import(name="updatedAt") + private @Nullable Output updatedAt; + + /** + * @return Date of codespaces_secret update. + * + */ + public Optional> updatedAt() { + return Optional.ofNullable(this.updatedAt); + } + + private CodespacesUserSecretState() {} + + private CodespacesUserSecretState(CodespacesUserSecretState $) { + this.createdAt = $.createdAt; + this.encryptedValue = $.encryptedValue; + this.plaintextValue = $.plaintextValue; + this.secretName = $.secretName; + this.selectedRepositoryIds = $.selectedRepositoryIds; + this.updatedAt = $.updatedAt; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(CodespacesUserSecretState defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private CodespacesUserSecretState $; + + public Builder() { + $ = new CodespacesUserSecretState(); + } + + public Builder(CodespacesUserSecretState defaults) { + $ = new CodespacesUserSecretState(Objects.requireNonNull(defaults)); + } + + /** + * @param createdAt Date of codespaces_secret creation. + * + * @return builder + * + */ + public Builder createdAt(@Nullable Output createdAt) { + $.createdAt = createdAt; + return this; + } + + /** + * @param createdAt Date of codespaces_secret creation. + * + * @return builder + * + */ + public Builder createdAt(String createdAt) { + return createdAt(Output.of(createdAt)); + } + + /** + * @param encryptedValue Encrypted value of the secret using the GitHub public key in Base64 format. + * + * @return builder + * + */ + public Builder encryptedValue(@Nullable Output encryptedValue) { + $.encryptedValue = encryptedValue; + return this; + } + + /** + * @param encryptedValue Encrypted value of the secret using the GitHub public key in Base64 format. + * + * @return builder + * + */ + public Builder encryptedValue(String encryptedValue) { + return encryptedValue(Output.of(encryptedValue)); + } + + /** + * @param plaintextValue Plaintext value of the secret to be encrypted + * + * @return builder + * + */ + public Builder plaintextValue(@Nullable Output plaintextValue) { + $.plaintextValue = plaintextValue; + return this; + } + + /** + * @param plaintextValue Plaintext value of the secret to be encrypted + * + * @return builder + * + */ + public Builder plaintextValue(String plaintextValue) { + return plaintextValue(Output.of(plaintextValue)); + } + + /** + * @param secretName Name of the secret + * + * @return builder + * + */ + public Builder secretName(@Nullable Output secretName) { + $.secretName = secretName; + return this; + } + + /** + * @param secretName Name of the secret + * + * @return builder + * + */ + public Builder secretName(String secretName) { + return secretName(Output.of(secretName)); + } + + /** + * @param selectedRepositoryIds An array of repository ids that can access the user secret. + * + * @return builder + * + */ + public Builder selectedRepositoryIds(@Nullable Output> selectedRepositoryIds) { + $.selectedRepositoryIds = selectedRepositoryIds; + return this; + } + + /** + * @param selectedRepositoryIds An array of repository ids that can access the user secret. + * + * @return builder + * + */ + public Builder selectedRepositoryIds(List selectedRepositoryIds) { + return selectedRepositoryIds(Output.of(selectedRepositoryIds)); + } + + /** + * @param selectedRepositoryIds An array of repository ids that can access the user secret. + * + * @return builder + * + */ + public Builder selectedRepositoryIds(Integer... selectedRepositoryIds) { + return selectedRepositoryIds(List.of(selectedRepositoryIds)); + } + + /** + * @param updatedAt Date of codespaces_secret update. + * + * @return builder + * + */ + public Builder updatedAt(@Nullable Output updatedAt) { + $.updatedAt = updatedAt; + return this; + } + + /** + * @param updatedAt Date of codespaces_secret update. + * + * @return builder + * + */ + public Builder updatedAt(String updatedAt) { + return updatedAt(Output.of(updatedAt)); + } + + public CodespacesUserSecretState build() { + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/GetCodespacesPublicKeyArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/GetCodespacesPublicKeyArgs.java new file mode 100644 index 00000000..8140c337 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/GetCodespacesPublicKeyArgs.java @@ -0,0 +1,82 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Objects; + + +public final class GetCodespacesPublicKeyArgs extends com.pulumi.resources.InvokeArgs { + + public static final GetCodespacesPublicKeyArgs Empty = new GetCodespacesPublicKeyArgs(); + + /** + * Name of the repository to get public key from. + * + */ + @Import(name="repository", required=true) + private Output repository; + + /** + * @return Name of the repository to get public key from. + * + */ + public Output repository() { + return this.repository; + } + + private GetCodespacesPublicKeyArgs() {} + + private GetCodespacesPublicKeyArgs(GetCodespacesPublicKeyArgs $) { + this.repository = $.repository; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(GetCodespacesPublicKeyArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private GetCodespacesPublicKeyArgs $; + + public Builder() { + $ = new GetCodespacesPublicKeyArgs(); + } + + public Builder(GetCodespacesPublicKeyArgs defaults) { + $ = new GetCodespacesPublicKeyArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param repository Name of the repository to get public key from. + * + * @return builder + * + */ + public Builder repository(Output repository) { + $.repository = repository; + return this; + } + + /** + * @param repository Name of the repository to get public key from. + * + * @return builder + * + */ + public Builder repository(String repository) { + return repository(Output.of(repository)); + } + + public GetCodespacesPublicKeyArgs build() { + $.repository = Objects.requireNonNull($.repository, "expected parameter 'repository' to be non-null"); + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/GetCodespacesPublicKeyPlainArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/GetCodespacesPublicKeyPlainArgs.java new file mode 100644 index 00000000..f5d0ecf8 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/GetCodespacesPublicKeyPlainArgs.java @@ -0,0 +1,71 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Objects; + + +public final class GetCodespacesPublicKeyPlainArgs extends com.pulumi.resources.InvokeArgs { + + public static final GetCodespacesPublicKeyPlainArgs Empty = new GetCodespacesPublicKeyPlainArgs(); + + /** + * Name of the repository to get public key from. + * + */ + @Import(name="repository", required=true) + private String repository; + + /** + * @return Name of the repository to get public key from. + * + */ + public String repository() { + return this.repository; + } + + private GetCodespacesPublicKeyPlainArgs() {} + + private GetCodespacesPublicKeyPlainArgs(GetCodespacesPublicKeyPlainArgs $) { + this.repository = $.repository; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(GetCodespacesPublicKeyPlainArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private GetCodespacesPublicKeyPlainArgs $; + + public Builder() { + $ = new GetCodespacesPublicKeyPlainArgs(); + } + + public Builder(GetCodespacesPublicKeyPlainArgs defaults) { + $ = new GetCodespacesPublicKeyPlainArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param repository Name of the repository to get public key from. + * + * @return builder + * + */ + public Builder repository(String repository) { + $.repository = repository; + return this; + } + + public GetCodespacesPublicKeyPlainArgs build() { + $.repository = Objects.requireNonNull($.repository, "expected parameter 'repository' to be non-null"); + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/GetCodespacesSecretsArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/GetCodespacesSecretsArgs.java new file mode 100644 index 00000000..9e9db48a --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/GetCodespacesSecretsArgs.java @@ -0,0 +1,120 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class GetCodespacesSecretsArgs extends com.pulumi.resources.InvokeArgs { + + public static final GetCodespacesSecretsArgs Empty = new GetCodespacesSecretsArgs(); + + /** + * Full name of the repository (in `org/name` format). + * + */ + @Import(name="fullName") + private @Nullable Output fullName; + + /** + * @return Full name of the repository (in `org/name` format). + * + */ + public Optional> fullName() { + return Optional.ofNullable(this.fullName); + } + + /** + * The name of the repository. + * + */ + @Import(name="name") + private @Nullable Output name; + + /** + * @return The name of the repository. + * + */ + public Optional> name() { + return Optional.ofNullable(this.name); + } + + private GetCodespacesSecretsArgs() {} + + private GetCodespacesSecretsArgs(GetCodespacesSecretsArgs $) { + this.fullName = $.fullName; + this.name = $.name; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(GetCodespacesSecretsArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private GetCodespacesSecretsArgs $; + + public Builder() { + $ = new GetCodespacesSecretsArgs(); + } + + public Builder(GetCodespacesSecretsArgs defaults) { + $ = new GetCodespacesSecretsArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param fullName Full name of the repository (in `org/name` format). + * + * @return builder + * + */ + public Builder fullName(@Nullable Output fullName) { + $.fullName = fullName; + return this; + } + + /** + * @param fullName Full name of the repository (in `org/name` format). + * + * @return builder + * + */ + public Builder fullName(String fullName) { + return fullName(Output.of(fullName)); + } + + /** + * @param name The name of the repository. + * + * @return builder + * + */ + public Builder name(@Nullable Output name) { + $.name = name; + return this; + } + + /** + * @param name The name of the repository. + * + * @return builder + * + */ + public Builder name(String name) { + return name(Output.of(name)); + } + + public GetCodespacesSecretsArgs build() { + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/GetCodespacesSecretsPlainArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/GetCodespacesSecretsPlainArgs.java new file mode 100644 index 00000000..34658417 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/GetCodespacesSecretsPlainArgs.java @@ -0,0 +1,99 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class GetCodespacesSecretsPlainArgs extends com.pulumi.resources.InvokeArgs { + + public static final GetCodespacesSecretsPlainArgs Empty = new GetCodespacesSecretsPlainArgs(); + + /** + * Full name of the repository (in `org/name` format). + * + */ + @Import(name="fullName") + private @Nullable String fullName; + + /** + * @return Full name of the repository (in `org/name` format). + * + */ + public Optional fullName() { + return Optional.ofNullable(this.fullName); + } + + /** + * The name of the repository. + * + */ + @Import(name="name") + private @Nullable String name; + + /** + * @return The name of the repository. + * + */ + public Optional name() { + return Optional.ofNullable(this.name); + } + + private GetCodespacesSecretsPlainArgs() {} + + private GetCodespacesSecretsPlainArgs(GetCodespacesSecretsPlainArgs $) { + this.fullName = $.fullName; + this.name = $.name; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(GetCodespacesSecretsPlainArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private GetCodespacesSecretsPlainArgs $; + + public Builder() { + $ = new GetCodespacesSecretsPlainArgs(); + } + + public Builder(GetCodespacesSecretsPlainArgs defaults) { + $ = new GetCodespacesSecretsPlainArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param fullName Full name of the repository (in `org/name` format). + * + * @return builder + * + */ + public Builder fullName(@Nullable String fullName) { + $.fullName = fullName; + return this; + } + + /** + * @param name The name of the repository. + * + * @return builder + * + */ + public Builder name(@Nullable String name) { + $.name = name; + return this; + } + + public GetCodespacesSecretsPlainArgs build() { + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/GetOrganizationCustomRoleArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/GetOrganizationCustomRoleArgs.java new file mode 100644 index 00000000..3aaa5760 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/GetOrganizationCustomRoleArgs.java @@ -0,0 +1,82 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Objects; + + +public final class GetOrganizationCustomRoleArgs extends com.pulumi.resources.InvokeArgs { + + public static final GetOrganizationCustomRoleArgs Empty = new GetOrganizationCustomRoleArgs(); + + /** + * The name of the custom role. + * + */ + @Import(name="name", required=true) + private Output name; + + /** + * @return The name of the custom role. + * + */ + public Output name() { + return this.name; + } + + private GetOrganizationCustomRoleArgs() {} + + private GetOrganizationCustomRoleArgs(GetOrganizationCustomRoleArgs $) { + this.name = $.name; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(GetOrganizationCustomRoleArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private GetOrganizationCustomRoleArgs $; + + public Builder() { + $ = new GetOrganizationCustomRoleArgs(); + } + + public Builder(GetOrganizationCustomRoleArgs defaults) { + $ = new GetOrganizationCustomRoleArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param name The name of the custom role. + * + * @return builder + * + */ + public Builder name(Output name) { + $.name = name; + return this; + } + + /** + * @param name The name of the custom role. + * + * @return builder + * + */ + public Builder name(String name) { + return name(Output.of(name)); + } + + public GetOrganizationCustomRoleArgs build() { + $.name = Objects.requireNonNull($.name, "expected parameter 'name' to be non-null"); + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/GetOrganizationCustomRolePlainArgs.java b/sdk/java/src/main/java/com/pulumi/github/inputs/GetOrganizationCustomRolePlainArgs.java new file mode 100644 index 00000000..a5dd68b5 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/GetOrganizationCustomRolePlainArgs.java @@ -0,0 +1,71 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.Objects; + + +public final class GetOrganizationCustomRolePlainArgs extends com.pulumi.resources.InvokeArgs { + + public static final GetOrganizationCustomRolePlainArgs Empty = new GetOrganizationCustomRolePlainArgs(); + + /** + * The name of the custom role. + * + */ + @Import(name="name", required=true) + private String name; + + /** + * @return The name of the custom role. + * + */ + public String name() { + return this.name; + } + + private GetOrganizationCustomRolePlainArgs() {} + + private GetOrganizationCustomRolePlainArgs(GetOrganizationCustomRolePlainArgs $) { + this.name = $.name; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(GetOrganizationCustomRolePlainArgs defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private GetOrganizationCustomRolePlainArgs $; + + public Builder() { + $ = new GetOrganizationCustomRolePlainArgs(); + } + + public Builder(GetOrganizationCustomRolePlainArgs defaults) { + $ = new GetOrganizationCustomRolePlainArgs(Objects.requireNonNull(defaults)); + } + + /** + * @param name The name of the custom role. + * + * @return builder + * + */ + public Builder name(String name) { + $.name = name; + return this; + } + + public GetOrganizationCustomRolePlainArgs build() { + $.name = Objects.requireNonNull($.name, "expected parameter 'name' to be non-null"); + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationCustomRoleState.java b/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationCustomRoleState.java new file mode 100644 index 00000000..4f28d27a --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/inputs/OrganizationCustomRoleState.java @@ -0,0 +1,205 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.inputs; + +import com.pulumi.core.Output; +import com.pulumi.core.annotations.Import; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import javax.annotation.Nullable; + + +public final class OrganizationCustomRoleState extends com.pulumi.resources.ResourceArgs { + + public static final OrganizationCustomRoleState Empty = new OrganizationCustomRoleState(); + + /** + * The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + * + */ + @Import(name="baseRole") + private @Nullable Output baseRole; + + /** + * @return The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + * + */ + public Optional> baseRole() { + return Optional.ofNullable(this.baseRole); + } + + /** + * The description for the custom role. + * + */ + @Import(name="description") + private @Nullable Output description; + + /** + * @return The description for the custom role. + * + */ + public Optional> description() { + return Optional.ofNullable(this.description); + } + + /** + * The name of the custom role. + * + */ + @Import(name="name") + private @Nullable Output name; + + /** + * @return The name of the custom role. + * + */ + public Optional> name() { + return Optional.ofNullable(this.name); + } + + /** + * A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + * + */ + @Import(name="permissions") + private @Nullable Output> permissions; + + /** + * @return A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + * + */ + public Optional>> permissions() { + return Optional.ofNullable(this.permissions); + } + + private OrganizationCustomRoleState() {} + + private OrganizationCustomRoleState(OrganizationCustomRoleState $) { + this.baseRole = $.baseRole; + this.description = $.description; + this.name = $.name; + this.permissions = $.permissions; + } + + public static Builder builder() { + return new Builder(); + } + public static Builder builder(OrganizationCustomRoleState defaults) { + return new Builder(defaults); + } + + public static final class Builder { + private OrganizationCustomRoleState $; + + public Builder() { + $ = new OrganizationCustomRoleState(); + } + + public Builder(OrganizationCustomRoleState defaults) { + $ = new OrganizationCustomRoleState(Objects.requireNonNull(defaults)); + } + + /** + * @param baseRole The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + * + * @return builder + * + */ + public Builder baseRole(@Nullable Output baseRole) { + $.baseRole = baseRole; + return this; + } + + /** + * @param baseRole The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + * + * @return builder + * + */ + public Builder baseRole(String baseRole) { + return baseRole(Output.of(baseRole)); + } + + /** + * @param description The description for the custom role. + * + * @return builder + * + */ + public Builder description(@Nullable Output description) { + $.description = description; + return this; + } + + /** + * @param description The description for the custom role. + * + * @return builder + * + */ + public Builder description(String description) { + return description(Output.of(description)); + } + + /** + * @param name The name of the custom role. + * + * @return builder + * + */ + public Builder name(@Nullable Output name) { + $.name = name; + return this; + } + + /** + * @param name The name of the custom role. + * + * @return builder + * + */ + public Builder name(String name) { + return name(Output.of(name)); + } + + /** + * @param permissions A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + * + * @return builder + * + */ + public Builder permissions(@Nullable Output> permissions) { + $.permissions = permissions; + return this; + } + + /** + * @param permissions A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + * + * @return builder + * + */ + public Builder permissions(List permissions) { + return permissions(Output.of(permissions)); + } + + /** + * @param permissions A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + * + * @return builder + * + */ + public Builder permissions(String... permissions) { + return permissions(List.of(permissions)); + } + + public OrganizationCustomRoleState build() { + return $; + } + } + +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesOrganizationPublicKeyResult.java b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesOrganizationPublicKeyResult.java new file mode 100644 index 00000000..9a6d05bb --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesOrganizationPublicKeyResult.java @@ -0,0 +1,94 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import java.lang.String; +import java.util.Objects; + +@CustomType +public final class GetCodespacesOrganizationPublicKeyResult { + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + private String id; + /** + * @return Actual key retrieved. + * + */ + private String key; + /** + * @return ID of the key that has been retrieved. + * + */ + private String keyId; + + private GetCodespacesOrganizationPublicKeyResult() {} + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + public String id() { + return this.id; + } + /** + * @return Actual key retrieved. + * + */ + public String key() { + return this.key; + } + /** + * @return ID of the key that has been retrieved. + * + */ + public String keyId() { + return this.keyId; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(GetCodespacesOrganizationPublicKeyResult defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String id; + private String key; + private String keyId; + public Builder() {} + public Builder(GetCodespacesOrganizationPublicKeyResult defaults) { + Objects.requireNonNull(defaults); + this.id = defaults.id; + this.key = defaults.key; + this.keyId = defaults.keyId; + } + + @CustomType.Setter + public Builder id(String id) { + this.id = Objects.requireNonNull(id); + return this; + } + @CustomType.Setter + public Builder key(String key) { + this.key = Objects.requireNonNull(key); + return this; + } + @CustomType.Setter + public Builder keyId(String keyId) { + this.keyId = Objects.requireNonNull(keyId); + return this; + } + public GetCodespacesOrganizationPublicKeyResult build() { + final var o = new GetCodespacesOrganizationPublicKeyResult(); + o.id = id; + o.key = key; + o.keyId = keyId; + return o; + } + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesOrganizationSecretsResult.java b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesOrganizationSecretsResult.java new file mode 100644 index 00000000..75b41316 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesOrganizationSecretsResult.java @@ -0,0 +1,79 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import com.pulumi.github.outputs.GetCodespacesOrganizationSecretsSecret; +import java.lang.String; +import java.util.List; +import java.util.Objects; + +@CustomType +public final class GetCodespacesOrganizationSecretsResult { + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + private String id; + /** + * @return list of secrets for the repository + * + */ + private List secrets; + + private GetCodespacesOrganizationSecretsResult() {} + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + public String id() { + return this.id; + } + /** + * @return list of secrets for the repository + * + */ + public List secrets() { + return this.secrets; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(GetCodespacesOrganizationSecretsResult defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String id; + private List secrets; + public Builder() {} + public Builder(GetCodespacesOrganizationSecretsResult defaults) { + Objects.requireNonNull(defaults); + this.id = defaults.id; + this.secrets = defaults.secrets; + } + + @CustomType.Setter + public Builder id(String id) { + this.id = Objects.requireNonNull(id); + return this; + } + @CustomType.Setter + public Builder secrets(List secrets) { + this.secrets = Objects.requireNonNull(secrets); + return this; + } + public Builder secrets(GetCodespacesOrganizationSecretsSecret... secrets) { + return secrets(List.of(secrets)); + } + public GetCodespacesOrganizationSecretsResult build() { + final var o = new GetCodespacesOrganizationSecretsResult(); + o.id = id; + o.secrets = secrets; + return o; + } + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesOrganizationSecretsSecret.java b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesOrganizationSecretsSecret.java new file mode 100644 index 00000000..035f8fb8 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesOrganizationSecretsSecret.java @@ -0,0 +1,114 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import java.lang.String; +import java.util.Objects; + +@CustomType +public final class GetCodespacesOrganizationSecretsSecret { + /** + * @return Timestamp of the secret creation + * + */ + private String createdAt; + /** + * @return Secret name + * + */ + private String name; + /** + * @return Timestamp of the secret last update + * + */ + private String updatedAt; + /** + * @return Secret visibility + * + */ + private String visibility; + + private GetCodespacesOrganizationSecretsSecret() {} + /** + * @return Timestamp of the secret creation + * + */ + public String createdAt() { + return this.createdAt; + } + /** + * @return Secret name + * + */ + public String name() { + return this.name; + } + /** + * @return Timestamp of the secret last update + * + */ + public String updatedAt() { + return this.updatedAt; + } + /** + * @return Secret visibility + * + */ + public String visibility() { + return this.visibility; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(GetCodespacesOrganizationSecretsSecret defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String createdAt; + private String name; + private String updatedAt; + private String visibility; + public Builder() {} + public Builder(GetCodespacesOrganizationSecretsSecret defaults) { + Objects.requireNonNull(defaults); + this.createdAt = defaults.createdAt; + this.name = defaults.name; + this.updatedAt = defaults.updatedAt; + this.visibility = defaults.visibility; + } + + @CustomType.Setter + public Builder createdAt(String createdAt) { + this.createdAt = Objects.requireNonNull(createdAt); + return this; + } + @CustomType.Setter + public Builder name(String name) { + this.name = Objects.requireNonNull(name); + return this; + } + @CustomType.Setter + public Builder updatedAt(String updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt); + return this; + } + @CustomType.Setter + public Builder visibility(String visibility) { + this.visibility = Objects.requireNonNull(visibility); + return this; + } + public GetCodespacesOrganizationSecretsSecret build() { + final var o = new GetCodespacesOrganizationSecretsSecret(); + o.createdAt = createdAt; + o.name = name; + o.updatedAt = updatedAt; + o.visibility = visibility; + return o; + } + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesPublicKeyResult.java b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesPublicKeyResult.java new file mode 100644 index 00000000..5308ec91 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesPublicKeyResult.java @@ -0,0 +1,106 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import java.lang.String; +import java.util.Objects; + +@CustomType +public final class GetCodespacesPublicKeyResult { + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + private String id; + /** + * @return Actual key retrieved. + * + */ + private String key; + /** + * @return ID of the key that has been retrieved. + * + */ + private String keyId; + private String repository; + + private GetCodespacesPublicKeyResult() {} + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + public String id() { + return this.id; + } + /** + * @return Actual key retrieved. + * + */ + public String key() { + return this.key; + } + /** + * @return ID of the key that has been retrieved. + * + */ + public String keyId() { + return this.keyId; + } + public String repository() { + return this.repository; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(GetCodespacesPublicKeyResult defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String id; + private String key; + private String keyId; + private String repository; + public Builder() {} + public Builder(GetCodespacesPublicKeyResult defaults) { + Objects.requireNonNull(defaults); + this.id = defaults.id; + this.key = defaults.key; + this.keyId = defaults.keyId; + this.repository = defaults.repository; + } + + @CustomType.Setter + public Builder id(String id) { + this.id = Objects.requireNonNull(id); + return this; + } + @CustomType.Setter + public Builder key(String key) { + this.key = Objects.requireNonNull(key); + return this; + } + @CustomType.Setter + public Builder keyId(String keyId) { + this.keyId = Objects.requireNonNull(keyId); + return this; + } + @CustomType.Setter + public Builder repository(String repository) { + this.repository = Objects.requireNonNull(repository); + return this; + } + public GetCodespacesPublicKeyResult build() { + final var o = new GetCodespacesPublicKeyResult(); + o.id = id; + o.key = key; + o.keyId = keyId; + o.repository = repository; + return o; + } + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesSecretsResult.java b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesSecretsResult.java new file mode 100644 index 00000000..9137937e --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesSecretsResult.java @@ -0,0 +1,111 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import com.pulumi.github.outputs.GetCodespacesSecretsSecret; +import java.lang.String; +import java.util.List; +import java.util.Objects; + +@CustomType +public final class GetCodespacesSecretsResult { + private String fullName; + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + private String id; + /** + * @return Secret name + * + */ + private String name; + /** + * @return list of codespaces secrets for the repository + * + */ + private List secrets; + + private GetCodespacesSecretsResult() {} + public String fullName() { + return this.fullName; + } + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + public String id() { + return this.id; + } + /** + * @return Secret name + * + */ + public String name() { + return this.name; + } + /** + * @return list of codespaces secrets for the repository + * + */ + public List secrets() { + return this.secrets; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(GetCodespacesSecretsResult defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String fullName; + private String id; + private String name; + private List secrets; + public Builder() {} + public Builder(GetCodespacesSecretsResult defaults) { + Objects.requireNonNull(defaults); + this.fullName = defaults.fullName; + this.id = defaults.id; + this.name = defaults.name; + this.secrets = defaults.secrets; + } + + @CustomType.Setter + public Builder fullName(String fullName) { + this.fullName = Objects.requireNonNull(fullName); + return this; + } + @CustomType.Setter + public Builder id(String id) { + this.id = Objects.requireNonNull(id); + return this; + } + @CustomType.Setter + public Builder name(String name) { + this.name = Objects.requireNonNull(name); + return this; + } + @CustomType.Setter + public Builder secrets(List secrets) { + this.secrets = Objects.requireNonNull(secrets); + return this; + } + public Builder secrets(GetCodespacesSecretsSecret... secrets) { + return secrets(List.of(secrets)); + } + public GetCodespacesSecretsResult build() { + final var o = new GetCodespacesSecretsResult(); + o.fullName = fullName; + o.id = id; + o.name = name; + o.secrets = secrets; + return o; + } + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesSecretsSecret.java b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesSecretsSecret.java new file mode 100644 index 00000000..42dae138 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesSecretsSecret.java @@ -0,0 +1,94 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import java.lang.String; +import java.util.Objects; + +@CustomType +public final class GetCodespacesSecretsSecret { + /** + * @return Timestamp of the secret creation + * + */ + private String createdAt; + /** + * @return The name of the repository. + * + */ + private String name; + /** + * @return Timestamp of the secret last update + * + */ + private String updatedAt; + + private GetCodespacesSecretsSecret() {} + /** + * @return Timestamp of the secret creation + * + */ + public String createdAt() { + return this.createdAt; + } + /** + * @return The name of the repository. + * + */ + public String name() { + return this.name; + } + /** + * @return Timestamp of the secret last update + * + */ + public String updatedAt() { + return this.updatedAt; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(GetCodespacesSecretsSecret defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String createdAt; + private String name; + private String updatedAt; + public Builder() {} + public Builder(GetCodespacesSecretsSecret defaults) { + Objects.requireNonNull(defaults); + this.createdAt = defaults.createdAt; + this.name = defaults.name; + this.updatedAt = defaults.updatedAt; + } + + @CustomType.Setter + public Builder createdAt(String createdAt) { + this.createdAt = Objects.requireNonNull(createdAt); + return this; + } + @CustomType.Setter + public Builder name(String name) { + this.name = Objects.requireNonNull(name); + return this; + } + @CustomType.Setter + public Builder updatedAt(String updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt); + return this; + } + public GetCodespacesSecretsSecret build() { + final var o = new GetCodespacesSecretsSecret(); + o.createdAt = createdAt; + o.name = name; + o.updatedAt = updatedAt; + return o; + } + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesUserPublicKeyResult.java b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesUserPublicKeyResult.java new file mode 100644 index 00000000..8d1cd5b6 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesUserPublicKeyResult.java @@ -0,0 +1,94 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import java.lang.String; +import java.util.Objects; + +@CustomType +public final class GetCodespacesUserPublicKeyResult { + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + private String id; + /** + * @return Actual key retrieved. + * + */ + private String key; + /** + * @return ID of the key that has been retrieved. + * + */ + private String keyId; + + private GetCodespacesUserPublicKeyResult() {} + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + public String id() { + return this.id; + } + /** + * @return Actual key retrieved. + * + */ + public String key() { + return this.key; + } + /** + * @return ID of the key that has been retrieved. + * + */ + public String keyId() { + return this.keyId; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(GetCodespacesUserPublicKeyResult defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String id; + private String key; + private String keyId; + public Builder() {} + public Builder(GetCodespacesUserPublicKeyResult defaults) { + Objects.requireNonNull(defaults); + this.id = defaults.id; + this.key = defaults.key; + this.keyId = defaults.keyId; + } + + @CustomType.Setter + public Builder id(String id) { + this.id = Objects.requireNonNull(id); + return this; + } + @CustomType.Setter + public Builder key(String key) { + this.key = Objects.requireNonNull(key); + return this; + } + @CustomType.Setter + public Builder keyId(String keyId) { + this.keyId = Objects.requireNonNull(keyId); + return this; + } + public GetCodespacesUserPublicKeyResult build() { + final var o = new GetCodespacesUserPublicKeyResult(); + o.id = id; + o.key = key; + o.keyId = keyId; + return o; + } + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesUserSecretsResult.java b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesUserSecretsResult.java new file mode 100644 index 00000000..63ec6eb2 --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesUserSecretsResult.java @@ -0,0 +1,79 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import com.pulumi.github.outputs.GetCodespacesUserSecretsSecret; +import java.lang.String; +import java.util.List; +import java.util.Objects; + +@CustomType +public final class GetCodespacesUserSecretsResult { + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + private String id; + /** + * @return list of secrets for the repository + * + */ + private List secrets; + + private GetCodespacesUserSecretsResult() {} + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + public String id() { + return this.id; + } + /** + * @return list of secrets for the repository + * + */ + public List secrets() { + return this.secrets; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(GetCodespacesUserSecretsResult defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String id; + private List secrets; + public Builder() {} + public Builder(GetCodespacesUserSecretsResult defaults) { + Objects.requireNonNull(defaults); + this.id = defaults.id; + this.secrets = defaults.secrets; + } + + @CustomType.Setter + public Builder id(String id) { + this.id = Objects.requireNonNull(id); + return this; + } + @CustomType.Setter + public Builder secrets(List secrets) { + this.secrets = Objects.requireNonNull(secrets); + return this; + } + public Builder secrets(GetCodespacesUserSecretsSecret... secrets) { + return secrets(List.of(secrets)); + } + public GetCodespacesUserSecretsResult build() { + final var o = new GetCodespacesUserSecretsResult(); + o.id = id; + o.secrets = secrets; + return o; + } + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesUserSecretsSecret.java b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesUserSecretsSecret.java new file mode 100644 index 00000000..47b6824a --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/GetCodespacesUserSecretsSecret.java @@ -0,0 +1,114 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import java.lang.String; +import java.util.Objects; + +@CustomType +public final class GetCodespacesUserSecretsSecret { + /** + * @return Timestamp of the secret creation + * + */ + private String createdAt; + /** + * @return Secret name + * + */ + private String name; + /** + * @return Timestamp of the secret last update + * + */ + private String updatedAt; + /** + * @return Secret visibility + * + */ + private String visibility; + + private GetCodespacesUserSecretsSecret() {} + /** + * @return Timestamp of the secret creation + * + */ + public String createdAt() { + return this.createdAt; + } + /** + * @return Secret name + * + */ + public String name() { + return this.name; + } + /** + * @return Timestamp of the secret last update + * + */ + public String updatedAt() { + return this.updatedAt; + } + /** + * @return Secret visibility + * + */ + public String visibility() { + return this.visibility; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(GetCodespacesUserSecretsSecret defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String createdAt; + private String name; + private String updatedAt; + private String visibility; + public Builder() {} + public Builder(GetCodespacesUserSecretsSecret defaults) { + Objects.requireNonNull(defaults); + this.createdAt = defaults.createdAt; + this.name = defaults.name; + this.updatedAt = defaults.updatedAt; + this.visibility = defaults.visibility; + } + + @CustomType.Setter + public Builder createdAt(String createdAt) { + this.createdAt = Objects.requireNonNull(createdAt); + return this; + } + @CustomType.Setter + public Builder name(String name) { + this.name = Objects.requireNonNull(name); + return this; + } + @CustomType.Setter + public Builder updatedAt(String updatedAt) { + this.updatedAt = Objects.requireNonNull(updatedAt); + return this; + } + @CustomType.Setter + public Builder visibility(String visibility) { + this.visibility = Objects.requireNonNull(visibility); + return this; + } + public GetCodespacesUserSecretsSecret build() { + final var o = new GetCodespacesUserSecretsSecret(); + o.createdAt = createdAt; + o.name = name; + o.updatedAt = updatedAt; + o.visibility = visibility; + return o; + } + } +} diff --git a/sdk/java/src/main/java/com/pulumi/github/outputs/GetOrganizationCustomRoleResult.java b/sdk/java/src/main/java/com/pulumi/github/outputs/GetOrganizationCustomRoleResult.java new file mode 100644 index 00000000..e71fa1dc --- /dev/null +++ b/sdk/java/src/main/java/com/pulumi/github/outputs/GetOrganizationCustomRoleResult.java @@ -0,0 +1,130 @@ +// *** WARNING: this file was generated by pulumi-java-gen. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package com.pulumi.github.outputs; + +import com.pulumi.core.annotations.CustomType; +import java.lang.String; +import java.util.List; +import java.util.Objects; + +@CustomType +public final class GetOrganizationCustomRoleResult { + /** + * @return The system role from which the role inherits permissions. + * + */ + private String baseRole; + /** + * @return The description for the custom role. + * + */ + private String description; + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + private String id; + private String name; + /** + * @return A list of additional permissions included in this role. + * + */ + private List permissions; + + private GetOrganizationCustomRoleResult() {} + /** + * @return The system role from which the role inherits permissions. + * + */ + public String baseRole() { + return this.baseRole; + } + /** + * @return The description for the custom role. + * + */ + public String description() { + return this.description; + } + /** + * @return The provider-assigned unique ID for this managed resource. + * + */ + public String id() { + return this.id; + } + public String name() { + return this.name; + } + /** + * @return A list of additional permissions included in this role. + * + */ + public List permissions() { + return this.permissions; + } + + public static Builder builder() { + return new Builder(); + } + + public static Builder builder(GetOrganizationCustomRoleResult defaults) { + return new Builder(defaults); + } + @CustomType.Builder + public static final class Builder { + private String baseRole; + private String description; + private String id; + private String name; + private List permissions; + public Builder() {} + public Builder(GetOrganizationCustomRoleResult defaults) { + Objects.requireNonNull(defaults); + this.baseRole = defaults.baseRole; + this.description = defaults.description; + this.id = defaults.id; + this.name = defaults.name; + this.permissions = defaults.permissions; + } + + @CustomType.Setter + public Builder baseRole(String baseRole) { + this.baseRole = Objects.requireNonNull(baseRole); + return this; + } + @CustomType.Setter + public Builder description(String description) { + this.description = Objects.requireNonNull(description); + return this; + } + @CustomType.Setter + public Builder id(String id) { + this.id = Objects.requireNonNull(id); + return this; + } + @CustomType.Setter + public Builder name(String name) { + this.name = Objects.requireNonNull(name); + return this; + } + @CustomType.Setter + public Builder permissions(List permissions) { + this.permissions = Objects.requireNonNull(permissions); + return this; + } + public Builder permissions(String... permissions) { + return permissions(List.of(permissions)); + } + public GetOrganizationCustomRoleResult build() { + final var o = new GetOrganizationCustomRoleResult(); + o.baseRole = baseRole; + o.description = description; + o.id = id; + o.name = name; + o.permissions = permissions; + return o; + } + } +} diff --git a/sdk/nodejs/codespacesOrganizationSecret.ts b/sdk/nodejs/codespacesOrganizationSecret.ts new file mode 100644 index 00000000..e6cab680 --- /dev/null +++ b/sdk/nodejs/codespacesOrganizationSecret.ts @@ -0,0 +1,218 @@ +// *** 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"; + +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const exampleSecretCodespacesOrganizationSecret = new github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", { + * secretName: "example_secret_name", + * visibility: "private", + * plaintextValue: _var.some_secret_string, + * }); + * const exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", { + * secretName: "example_secret_name", + * visibility: "private", + * encryptedValue: _var.some_encrypted_secret_string, + * }); + * ``` + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = github.getRepository({ + * fullName: "my-org/repo", + * }); + * const exampleSecretCodespacesOrganizationSecret = new github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", { + * secretName: "example_secret_name", + * visibility: "selected", + * plaintextValue: _var.some_secret_string, + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * const exampleSecretIndex_codespacesOrganizationSecretCodespacesOrganizationSecret = new github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", { + * secretName: "example_secret_name", + * visibility: "selected", + * encryptedValue: _var.some_encrypted_secret_string, + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * ``` + * + * ## Import + * + * This resource can be imported using an ID made up of the secret name + * + * ```sh + * $ pulumi import github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret test_secret test_secret_name + * ``` + * + * NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. + */ +export class CodespacesOrganizationSecret extends pulumi.CustomResource { + /** + * Get an existing CodespacesOrganizationSecret resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state Any extra arguments used during the lookup. + * @param opts Optional settings to control the behavior of the CustomResource. + */ + public static get(name: string, id: pulumi.Input, state?: CodespacesOrganizationSecretState, opts?: pulumi.CustomResourceOptions): CodespacesOrganizationSecret { + return new CodespacesOrganizationSecret(name, state, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret'; + + /** + * Returns true if the given object is an instance of CodespacesOrganizationSecret. This is designed to work even + * when multiple copies of the Pulumi SDK have been loaded into the same process. + */ + public static isInstance(obj: any): obj is CodespacesOrganizationSecret { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === CodespacesOrganizationSecret.__pulumiType; + } + + /** + * Date of codespacesSecret creation. + */ + public /*out*/ readonly createdAt!: pulumi.Output; + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + */ + public readonly encryptedValue!: pulumi.Output; + /** + * Plaintext value of the secret to be encrypted + */ + public readonly plaintextValue!: pulumi.Output; + /** + * Name of the secret + */ + public readonly secretName!: pulumi.Output; + /** + * An array of repository ids that can access the organization secret. + */ + public readonly selectedRepositoryIds!: pulumi.Output; + /** + * Date of codespacesSecret update. + */ + public /*out*/ readonly updatedAt!: pulumi.Output; + /** + * Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`. + */ + public readonly visibility!: pulumi.Output; + + /** + * Create a CodespacesOrganizationSecret resource with the given unique name, arguments, and options. + * + * @param name The _unique_ name of the resource. + * @param args The arguments to use to populate this resource's properties. + * @param opts A bag of options that control this resource's behavior. + */ + constructor(name: string, args: CodespacesOrganizationSecretArgs, opts?: pulumi.CustomResourceOptions) + constructor(name: string, argsOrState?: CodespacesOrganizationSecretArgs | CodespacesOrganizationSecretState, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (opts.id) { + const state = argsOrState as CodespacesOrganizationSecretState | undefined; + resourceInputs["createdAt"] = state ? state.createdAt : undefined; + resourceInputs["encryptedValue"] = state ? state.encryptedValue : undefined; + resourceInputs["plaintextValue"] = state ? state.plaintextValue : undefined; + resourceInputs["secretName"] = state ? state.secretName : undefined; + resourceInputs["selectedRepositoryIds"] = state ? state.selectedRepositoryIds : undefined; + resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; + resourceInputs["visibility"] = state ? state.visibility : undefined; + } else { + const args = argsOrState as CodespacesOrganizationSecretArgs | undefined; + if ((!args || args.secretName === undefined) && !opts.urn) { + throw new Error("Missing required property 'secretName'"); + } + if ((!args || args.visibility === undefined) && !opts.urn) { + throw new Error("Missing required property 'visibility'"); + } + resourceInputs["encryptedValue"] = args?.encryptedValue ? pulumi.secret(args.encryptedValue) : undefined; + resourceInputs["plaintextValue"] = args?.plaintextValue ? pulumi.secret(args.plaintextValue) : undefined; + resourceInputs["secretName"] = args ? args.secretName : undefined; + resourceInputs["selectedRepositoryIds"] = args ? args.selectedRepositoryIds : undefined; + resourceInputs["visibility"] = args ? args.visibility : undefined; + resourceInputs["createdAt"] = undefined /*out*/; + resourceInputs["updatedAt"] = undefined /*out*/; + } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + const secretOpts = { additionalSecretOutputs: ["encryptedValue", "plaintextValue"] }; + opts = pulumi.mergeOptions(opts, secretOpts); + super(CodespacesOrganizationSecret.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * Input properties used for looking up and filtering CodespacesOrganizationSecret resources. + */ +export interface CodespacesOrganizationSecretState { + /** + * Date of codespacesSecret creation. + */ + createdAt?: pulumi.Input; + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + */ + encryptedValue?: pulumi.Input; + /** + * Plaintext value of the secret to be encrypted + */ + plaintextValue?: pulumi.Input; + /** + * Name of the secret + */ + secretName?: pulumi.Input; + /** + * An array of repository ids that can access the organization secret. + */ + selectedRepositoryIds?: pulumi.Input[]>; + /** + * Date of codespacesSecret update. + */ + updatedAt?: pulumi.Input; + /** + * Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`. + */ + visibility?: pulumi.Input; +} + +/** + * The set of arguments for constructing a CodespacesOrganizationSecret resource. + */ +export interface CodespacesOrganizationSecretArgs { + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + */ + encryptedValue?: pulumi.Input; + /** + * Plaintext value of the secret to be encrypted + */ + plaintextValue?: pulumi.Input; + /** + * Name of the secret + */ + secretName: pulumi.Input; + /** + * An array of repository ids that can access the organization secret. + */ + selectedRepositoryIds?: pulumi.Input[]>; + /** + * Configures the access that repositories have to the organization secret. + * Must be one of `all`, `private`, `selected`. `selectedRepositoryIds` is required if set to `selected`. + */ + visibility: pulumi.Input; +} diff --git a/sdk/nodejs/codespacesSecret.ts b/sdk/nodejs/codespacesSecret.ts new file mode 100644 index 00000000..cca1d986 --- /dev/null +++ b/sdk/nodejs/codespacesSecret.ts @@ -0,0 +1,173 @@ +// *** 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"; + +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const examplePublicKey = github.getCodespacesPublicKey({ + * repository: "example_repository", + * }); + * const exampleSecretCodespacesSecret = new github.CodespacesSecret("exampleSecretCodespacesSecret", { + * repository: "example_repository", + * secretName: "example_secret_name", + * plaintextValue: _var.some_secret_string, + * }); + * const exampleSecretIndex_codespacesSecretCodespacesSecret = new github.CodespacesSecret("exampleSecretIndex/codespacesSecretCodespacesSecret", { + * repository: "example_repository", + * secretName: "example_secret_name", + * encryptedValue: _var.some_encrypted_secret_string, + * }); + * ``` + */ +export class CodespacesSecret extends pulumi.CustomResource { + /** + * Get an existing CodespacesSecret resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state Any extra arguments used during the lookup. + * @param opts Optional settings to control the behavior of the CustomResource. + */ + public static get(name: string, id: pulumi.Input, state?: CodespacesSecretState, opts?: pulumi.CustomResourceOptions): CodespacesSecret { + return new CodespacesSecret(name, state, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'github:index/codespacesSecret:CodespacesSecret'; + + /** + * Returns true if the given object is an instance of CodespacesSecret. This is designed to work even + * when multiple copies of the Pulumi SDK have been loaded into the same process. + */ + public static isInstance(obj: any): obj is CodespacesSecret { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === CodespacesSecret.__pulumiType; + } + + /** + * Date of actionsSecret creation. + */ + public /*out*/ readonly createdAt!: pulumi.Output; + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + */ + public readonly encryptedValue!: pulumi.Output; + /** + * Plaintext value of the secret to be encrypted + */ + public readonly plaintextValue!: pulumi.Output; + /** + * Name of the repository + */ + public readonly repository!: pulumi.Output; + /** + * Name of the secret + */ + public readonly secretName!: pulumi.Output; + /** + * Date of actionsSecret update. + */ + public /*out*/ readonly updatedAt!: pulumi.Output; + + /** + * Create a CodespacesSecret resource with the given unique name, arguments, and options. + * + * @param name The _unique_ name of the resource. + * @param args The arguments to use to populate this resource's properties. + * @param opts A bag of options that control this resource's behavior. + */ + constructor(name: string, args: CodespacesSecretArgs, opts?: pulumi.CustomResourceOptions) + constructor(name: string, argsOrState?: CodespacesSecretArgs | CodespacesSecretState, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (opts.id) { + const state = argsOrState as CodespacesSecretState | undefined; + resourceInputs["createdAt"] = state ? state.createdAt : undefined; + resourceInputs["encryptedValue"] = state ? state.encryptedValue : undefined; + resourceInputs["plaintextValue"] = state ? state.plaintextValue : undefined; + resourceInputs["repository"] = state ? state.repository : undefined; + resourceInputs["secretName"] = state ? state.secretName : undefined; + resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; + } else { + const args = argsOrState as CodespacesSecretArgs | undefined; + if ((!args || args.repository === undefined) && !opts.urn) { + throw new Error("Missing required property 'repository'"); + } + if ((!args || args.secretName === undefined) && !opts.urn) { + throw new Error("Missing required property 'secretName'"); + } + resourceInputs["encryptedValue"] = args?.encryptedValue ? pulumi.secret(args.encryptedValue) : undefined; + resourceInputs["plaintextValue"] = args?.plaintextValue ? pulumi.secret(args.plaintextValue) : undefined; + resourceInputs["repository"] = args ? args.repository : undefined; + resourceInputs["secretName"] = args ? args.secretName : undefined; + resourceInputs["createdAt"] = undefined /*out*/; + resourceInputs["updatedAt"] = undefined /*out*/; + } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + const secretOpts = { additionalSecretOutputs: ["encryptedValue", "plaintextValue"] }; + opts = pulumi.mergeOptions(opts, secretOpts); + super(CodespacesSecret.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * Input properties used for looking up and filtering CodespacesSecret resources. + */ +export interface CodespacesSecretState { + /** + * Date of actionsSecret creation. + */ + createdAt?: pulumi.Input; + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + */ + encryptedValue?: pulumi.Input; + /** + * Plaintext value of the secret to be encrypted + */ + plaintextValue?: pulumi.Input; + /** + * Name of the repository + */ + repository?: pulumi.Input; + /** + * Name of the secret + */ + secretName?: pulumi.Input; + /** + * Date of actionsSecret update. + */ + updatedAt?: pulumi.Input; +} + +/** + * The set of arguments for constructing a CodespacesSecret resource. + */ +export interface CodespacesSecretArgs { + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + */ + encryptedValue?: pulumi.Input; + /** + * Plaintext value of the secret to be encrypted + */ + plaintextValue?: pulumi.Input; + /** + * Name of the repository + */ + repository: pulumi.Input; + /** + * Name of the secret + */ + secretName: pulumi.Input; +} diff --git a/sdk/nodejs/codespacesUserSecret.ts b/sdk/nodejs/codespacesUserSecret.ts new file mode 100644 index 00000000..e5dcf2cf --- /dev/null +++ b/sdk/nodejs/codespacesUserSecret.ts @@ -0,0 +1,180 @@ +// *** 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"; + +/** + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const repo = github.getRepository({ + * fullName: "my-org/repo", + * }); + * const exampleSecretCodespacesUserSecret = new github.CodespacesUserSecret("exampleSecretCodespacesUserSecret", { + * secretName: "example_secret_name", + * plaintextValue: _var.some_secret_string, + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * const exampleSecretIndex_codespacesUserSecretCodespacesUserSecret = new github.CodespacesUserSecret("exampleSecretIndex/codespacesUserSecretCodespacesUserSecret", { + * secretName: "example_secret_name", + * encryptedValue: _var.some_encrypted_secret_string, + * selectedRepositoryIds: [repo.then(repo => repo.repoId)], + * }); + * ``` + * + * ## Import + * + * This resource can be imported using an ID made up of the secret name + * + * ```sh + * $ pulumi import github:index/codespacesUserSecret:CodespacesUserSecret test_secret test_secret_name + * ``` + * + * NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. + */ +export class CodespacesUserSecret extends pulumi.CustomResource { + /** + * Get an existing CodespacesUserSecret resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state Any extra arguments used during the lookup. + * @param opts Optional settings to control the behavior of the CustomResource. + */ + public static get(name: string, id: pulumi.Input, state?: CodespacesUserSecretState, opts?: pulumi.CustomResourceOptions): CodespacesUserSecret { + return new CodespacesUserSecret(name, state, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'github:index/codespacesUserSecret:CodespacesUserSecret'; + + /** + * Returns true if the given object is an instance of CodespacesUserSecret. This is designed to work even + * when multiple copies of the Pulumi SDK have been loaded into the same process. + */ + public static isInstance(obj: any): obj is CodespacesUserSecret { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === CodespacesUserSecret.__pulumiType; + } + + /** + * Date of codespacesSecret creation. + */ + public /*out*/ readonly createdAt!: pulumi.Output; + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + */ + public readonly encryptedValue!: pulumi.Output; + /** + * Plaintext value of the secret to be encrypted + */ + public readonly plaintextValue!: pulumi.Output; + /** + * Name of the secret + */ + public readonly secretName!: pulumi.Output; + /** + * An array of repository ids that can access the user secret. + */ + public readonly selectedRepositoryIds!: pulumi.Output; + /** + * Date of codespacesSecret update. + */ + public /*out*/ readonly updatedAt!: pulumi.Output; + + /** + * Create a CodespacesUserSecret resource with the given unique name, arguments, and options. + * + * @param name The _unique_ name of the resource. + * @param args The arguments to use to populate this resource's properties. + * @param opts A bag of options that control this resource's behavior. + */ + constructor(name: string, args: CodespacesUserSecretArgs, opts?: pulumi.CustomResourceOptions) + constructor(name: string, argsOrState?: CodespacesUserSecretArgs | CodespacesUserSecretState, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (opts.id) { + const state = argsOrState as CodespacesUserSecretState | undefined; + resourceInputs["createdAt"] = state ? state.createdAt : undefined; + resourceInputs["encryptedValue"] = state ? state.encryptedValue : undefined; + resourceInputs["plaintextValue"] = state ? state.plaintextValue : undefined; + resourceInputs["secretName"] = state ? state.secretName : undefined; + resourceInputs["selectedRepositoryIds"] = state ? state.selectedRepositoryIds : undefined; + resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; + } else { + const args = argsOrState as CodespacesUserSecretArgs | undefined; + if ((!args || args.secretName === undefined) && !opts.urn) { + throw new Error("Missing required property 'secretName'"); + } + resourceInputs["encryptedValue"] = args?.encryptedValue ? pulumi.secret(args.encryptedValue) : undefined; + resourceInputs["plaintextValue"] = args?.plaintextValue ? pulumi.secret(args.plaintextValue) : undefined; + resourceInputs["secretName"] = args ? args.secretName : undefined; + resourceInputs["selectedRepositoryIds"] = args ? args.selectedRepositoryIds : undefined; + resourceInputs["createdAt"] = undefined /*out*/; + resourceInputs["updatedAt"] = undefined /*out*/; + } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + const secretOpts = { additionalSecretOutputs: ["encryptedValue", "plaintextValue"] }; + opts = pulumi.mergeOptions(opts, secretOpts); + super(CodespacesUserSecret.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * Input properties used for looking up and filtering CodespacesUserSecret resources. + */ +export interface CodespacesUserSecretState { + /** + * Date of codespacesSecret creation. + */ + createdAt?: pulumi.Input; + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + */ + encryptedValue?: pulumi.Input; + /** + * Plaintext value of the secret to be encrypted + */ + plaintextValue?: pulumi.Input; + /** + * Name of the secret + */ + secretName?: pulumi.Input; + /** + * An array of repository ids that can access the user secret. + */ + selectedRepositoryIds?: pulumi.Input[]>; + /** + * Date of codespacesSecret update. + */ + updatedAt?: pulumi.Input; +} + +/** + * The set of arguments for constructing a CodespacesUserSecret resource. + */ +export interface CodespacesUserSecretArgs { + /** + * Encrypted value of the secret using the GitHub public key in Base64 format. + */ + encryptedValue?: pulumi.Input; + /** + * Plaintext value of the secret to be encrypted + */ + plaintextValue?: pulumi.Input; + /** + * Name of the secret + */ + secretName: pulumi.Input; + /** + * An array of repository ids that can access the user secret. + */ + selectedRepositoryIds?: pulumi.Input[]>; +} diff --git a/sdk/nodejs/getCodespacesOrganizationPublicKey.ts b/sdk/nodejs/getCodespacesOrganizationPublicKey.ts new file mode 100644 index 00000000..27efe281 --- /dev/null +++ b/sdk/nodejs/getCodespacesOrganizationPublicKey.ts @@ -0,0 +1,43 @@ +// *** 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"; + +/** + * Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesOrganizationPublicKey({}); + * ``` + */ +export function getCodespacesOrganizationPublicKey(opts?: pulumi.InvokeOptions): Promise { + + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); + return pulumi.runtime.invoke("github:index/getCodespacesOrganizationPublicKey:getCodespacesOrganizationPublicKey", { + }, opts); +} + +/** + * A collection of values returned by getCodespacesOrganizationPublicKey. + */ +export interface GetCodespacesOrganizationPublicKeyResult { + /** + * The provider-assigned unique ID for this managed resource. + */ + readonly id: string; + /** + * Actual key retrieved. + */ + readonly key: string; + /** + * ID of the key that has been retrieved. + */ + readonly keyId: string; +} diff --git a/sdk/nodejs/getCodespacesOrganizationSecrets.ts b/sdk/nodejs/getCodespacesOrganizationSecrets.ts new file mode 100644 index 00000000..4a87e855 --- /dev/null +++ b/sdk/nodejs/getCodespacesOrganizationSecrets.ts @@ -0,0 +1,40 @@ +// *** 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 inputs from "./types/input"; +import * as outputs from "./types/output"; +import * as utilities from "./utilities"; + +/** + * Use this data source to retrieve the list of codespaces secrets of the organization. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesOrganizationSecrets({}); + * ``` + */ +export function getCodespacesOrganizationSecrets(opts?: pulumi.InvokeOptions): Promise { + + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); + return pulumi.runtime.invoke("github:index/getCodespacesOrganizationSecrets:getCodespacesOrganizationSecrets", { + }, opts); +} + +/** + * A collection of values returned by getCodespacesOrganizationSecrets. + */ +export interface GetCodespacesOrganizationSecretsResult { + /** + * The provider-assigned unique ID for this managed resource. + */ + readonly id: string; + /** + * list of secrets for the repository + */ + readonly secrets: outputs.GetCodespacesOrganizationSecretsSecret[]; +} diff --git a/sdk/nodejs/getCodespacesPublicKey.ts b/sdk/nodejs/getCodespacesPublicKey.ts new file mode 100644 index 00000000..7fa187b7 --- /dev/null +++ b/sdk/nodejs/getCodespacesPublicKey.ts @@ -0,0 +1,85 @@ +// *** 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"; + +/** + * Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesPublicKey({ + * repository: "example_repo", + * }); + * ``` + */ +export function getCodespacesPublicKey(args: GetCodespacesPublicKeyArgs, opts?: pulumi.InvokeOptions): Promise { + + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); + return pulumi.runtime.invoke("github:index/getCodespacesPublicKey:getCodespacesPublicKey", { + "repository": args.repository, + }, opts); +} + +/** + * A collection of arguments for invoking getCodespacesPublicKey. + */ +export interface GetCodespacesPublicKeyArgs { + /** + * Name of the repository to get public key from. + */ + repository: string; +} + +/** + * A collection of values returned by getCodespacesPublicKey. + */ +export interface GetCodespacesPublicKeyResult { + /** + * The provider-assigned unique ID for this managed resource. + */ + readonly id: string; + /** + * Actual key retrieved. + */ + readonly key: string; + /** + * ID of the key that has been retrieved. + */ + readonly keyId: string; + readonly repository: string; +} +/** + * Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesPublicKey({ + * repository: "example_repo", + * }); + * ``` + */ +export function getCodespacesPublicKeyOutput(args: GetCodespacesPublicKeyOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { + return pulumi.output(args).apply((a: any) => getCodespacesPublicKey(a, opts)) +} + +/** + * A collection of arguments for invoking getCodespacesPublicKey. + */ +export interface GetCodespacesPublicKeyOutputArgs { + /** + * Name of the repository to get public key from. + */ + repository: pulumi.Input; +} diff --git a/sdk/nodejs/getCodespacesSecrets.ts b/sdk/nodejs/getCodespacesSecrets.ts new file mode 100644 index 00000000..c5805b73 --- /dev/null +++ b/sdk/nodejs/getCodespacesSecrets.ts @@ -0,0 +1,101 @@ +// *** 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 inputs from "./types/input"; +import * as outputs from "./types/output"; +import * as utilities from "./utilities"; + +/** + * Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesSecrets({ + * name: "example_repository", + * }); + * const example2 = github.getCodespacesSecrets({ + * fullName: "org/example_repository", + * }); + * ``` + */ +export function getCodespacesSecrets(args?: GetCodespacesSecretsArgs, opts?: pulumi.InvokeOptions): Promise { + args = args || {}; + + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); + return pulumi.runtime.invoke("github:index/getCodespacesSecrets:getCodespacesSecrets", { + "fullName": args.fullName, + "name": args.name, + }, opts); +} + +/** + * A collection of arguments for invoking getCodespacesSecrets. + */ +export interface GetCodespacesSecretsArgs { + /** + * Full name of the repository (in `org/name` format). + */ + fullName?: string; + /** + * The name of the repository. + */ + name?: string; +} + +/** + * A collection of values returned by getCodespacesSecrets. + */ +export interface GetCodespacesSecretsResult { + readonly fullName: string; + /** + * The provider-assigned unique ID for this managed resource. + */ + readonly id: string; + /** + * Secret name + */ + readonly name: string; + /** + * list of codespaces secrets for the repository + */ + readonly secrets: outputs.GetCodespacesSecretsSecret[]; +} +/** + * Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesSecrets({ + * name: "example_repository", + * }); + * const example2 = github.getCodespacesSecrets({ + * fullName: "org/example_repository", + * }); + * ``` + */ +export function getCodespacesSecretsOutput(args?: GetCodespacesSecretsOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { + return pulumi.output(args).apply((a: any) => getCodespacesSecrets(a, opts)) +} + +/** + * A collection of arguments for invoking getCodespacesSecrets. + */ +export interface GetCodespacesSecretsOutputArgs { + /** + * Full name of the repository (in `org/name` format). + */ + fullName?: pulumi.Input; + /** + * The name of the repository. + */ + name?: pulumi.Input; +} diff --git a/sdk/nodejs/getCodespacesUserPublicKey.ts b/sdk/nodejs/getCodespacesUserPublicKey.ts new file mode 100644 index 00000000..ebb103e9 --- /dev/null +++ b/sdk/nodejs/getCodespacesUserPublicKey.ts @@ -0,0 +1,43 @@ +// *** 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"; + +/** + * Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. + * Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesUserPublicKey({}); + * ``` + */ +export function getCodespacesUserPublicKey(opts?: pulumi.InvokeOptions): Promise { + + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); + return pulumi.runtime.invoke("github:index/getCodespacesUserPublicKey:getCodespacesUserPublicKey", { + }, opts); +} + +/** + * A collection of values returned by getCodespacesUserPublicKey. + */ +export interface GetCodespacesUserPublicKeyResult { + /** + * The provider-assigned unique ID for this managed resource. + */ + readonly id: string; + /** + * Actual key retrieved. + */ + readonly key: string; + /** + * ID of the key that has been retrieved. + */ + readonly keyId: string; +} diff --git a/sdk/nodejs/getCodespacesUserSecrets.ts b/sdk/nodejs/getCodespacesUserSecrets.ts new file mode 100644 index 00000000..0b3fe869 --- /dev/null +++ b/sdk/nodejs/getCodespacesUserSecrets.ts @@ -0,0 +1,40 @@ +// *** 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 inputs from "./types/input"; +import * as outputs from "./types/output"; +import * as utilities from "./utilities"; + +/** + * Use this data source to retrieve the list of codespaces secrets of the user. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getCodespacesUserSecrets({}); + * ``` + */ +export function getCodespacesUserSecrets(opts?: pulumi.InvokeOptions): Promise { + + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); + return pulumi.runtime.invoke("github:index/getCodespacesUserSecrets:getCodespacesUserSecrets", { + }, opts); +} + +/** + * A collection of values returned by getCodespacesUserSecrets. + */ +export interface GetCodespacesUserSecretsResult { + /** + * The provider-assigned unique ID for this managed resource. + */ + readonly id: string; + /** + * list of secrets for the repository + */ + readonly secrets: outputs.GetCodespacesUserSecretsSecret[]; +} diff --git a/sdk/nodejs/getOrganizationCustomRole.ts b/sdk/nodejs/getOrganizationCustomRole.ts new file mode 100644 index 00000000..26ace55f --- /dev/null +++ b/sdk/nodejs/getOrganizationCustomRole.ts @@ -0,0 +1,91 @@ +// *** 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"; + +/** + * Use this data source to retrieve information about a custom role in a GitHub Organization. + * + * > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getOrganizationCustomRole({ + * name: "example", + * }); + * ``` + */ +export function getOrganizationCustomRole(args: GetOrganizationCustomRoleArgs, opts?: pulumi.InvokeOptions): Promise { + + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); + return pulumi.runtime.invoke("github:index/getOrganizationCustomRole:getOrganizationCustomRole", { + "name": args.name, + }, opts); +} + +/** + * A collection of arguments for invoking getOrganizationCustomRole. + */ +export interface GetOrganizationCustomRoleArgs { + /** + * The name of the custom role. + */ + name: string; +} + +/** + * A collection of values returned by getOrganizationCustomRole. + */ +export interface GetOrganizationCustomRoleResult { + /** + * The system role from which the role inherits permissions. + */ + readonly baseRole: string; + /** + * The description for the custom role. + */ + readonly description: string; + /** + * The provider-assigned unique ID for this managed resource. + */ + readonly id: string; + readonly name: string; + /** + * A list of additional permissions included in this role. + */ + readonly permissions: string[]; +} +/** + * Use this data source to retrieve information about a custom role in a GitHub Organization. + * + * > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = github.getOrganizationCustomRole({ + * name: "example", + * }); + * ``` + */ +export function getOrganizationCustomRoleOutput(args: GetOrganizationCustomRoleOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output { + return pulumi.output(args).apply((a: any) => getOrganizationCustomRole(a, opts)) +} + +/** + * A collection of arguments for invoking getOrganizationCustomRole. + */ +export interface GetOrganizationCustomRoleOutputArgs { + /** + * The name of the custom role. + */ + name: pulumi.Input; +} diff --git a/sdk/nodejs/index.ts b/sdk/nodejs/index.ts index a19aad50..5d73db70 100644 --- a/sdk/nodejs/index.ts +++ b/sdk/nodejs/index.ts @@ -100,6 +100,21 @@ export type BranchProtectionV3 = import("./branchProtectionV3").BranchProtection export const BranchProtectionV3: typeof import("./branchProtectionV3").BranchProtectionV3 = null as any; utilities.lazyLoad(exports, ["BranchProtectionV3"], () => require("./branchProtectionV3")); +export { CodespacesOrganizationSecretArgs, CodespacesOrganizationSecretState } from "./codespacesOrganizationSecret"; +export type CodespacesOrganizationSecret = import("./codespacesOrganizationSecret").CodespacesOrganizationSecret; +export const CodespacesOrganizationSecret: typeof import("./codespacesOrganizationSecret").CodespacesOrganizationSecret = null as any; +utilities.lazyLoad(exports, ["CodespacesOrganizationSecret"], () => require("./codespacesOrganizationSecret")); + +export { CodespacesSecretArgs, CodespacesSecretState } from "./codespacesSecret"; +export type CodespacesSecret = import("./codespacesSecret").CodespacesSecret; +export const CodespacesSecret: typeof import("./codespacesSecret").CodespacesSecret = null as any; +utilities.lazyLoad(exports, ["CodespacesSecret"], () => require("./codespacesSecret")); + +export { CodespacesUserSecretArgs, CodespacesUserSecretState } from "./codespacesUserSecret"; +export type CodespacesUserSecret = import("./codespacesUserSecret").CodespacesUserSecret; +export const CodespacesUserSecret: typeof import("./codespacesUserSecret").CodespacesUserSecret = null as any; +utilities.lazyLoad(exports, ["CodespacesUserSecret"], () => require("./codespacesUserSecret")); + export { DependabotOrganizationSecretArgs, DependabotOrganizationSecretState } from "./dependabotOrganizationSecret"; export type DependabotOrganizationSecret = import("./dependabotOrganizationSecret").DependabotOrganizationSecret; export const DependabotOrganizationSecret: typeof import("./dependabotOrganizationSecret").DependabotOrganizationSecret = null as any; @@ -195,6 +210,32 @@ export const getBranchProtectionRules: typeof import("./getBranchProtectionRules export const getBranchProtectionRulesOutput: typeof import("./getBranchProtectionRules").getBranchProtectionRulesOutput = null as any; utilities.lazyLoad(exports, ["getBranchProtectionRules","getBranchProtectionRulesOutput"], () => require("./getBranchProtectionRules")); +export { GetCodespacesOrganizationPublicKeyResult } from "./getCodespacesOrganizationPublicKey"; +export const getCodespacesOrganizationPublicKey: typeof import("./getCodespacesOrganizationPublicKey").getCodespacesOrganizationPublicKey = null as any; +utilities.lazyLoad(exports, ["getCodespacesOrganizationPublicKey"], () => require("./getCodespacesOrganizationPublicKey")); + +export { GetCodespacesOrganizationSecretsResult } from "./getCodespacesOrganizationSecrets"; +export const getCodespacesOrganizationSecrets: typeof import("./getCodespacesOrganizationSecrets").getCodespacesOrganizationSecrets = null as any; +utilities.lazyLoad(exports, ["getCodespacesOrganizationSecrets"], () => require("./getCodespacesOrganizationSecrets")); + +export { GetCodespacesPublicKeyArgs, GetCodespacesPublicKeyResult, GetCodespacesPublicKeyOutputArgs } from "./getCodespacesPublicKey"; +export const getCodespacesPublicKey: typeof import("./getCodespacesPublicKey").getCodespacesPublicKey = null as any; +export const getCodespacesPublicKeyOutput: typeof import("./getCodespacesPublicKey").getCodespacesPublicKeyOutput = null as any; +utilities.lazyLoad(exports, ["getCodespacesPublicKey","getCodespacesPublicKeyOutput"], () => require("./getCodespacesPublicKey")); + +export { GetCodespacesSecretsArgs, GetCodespacesSecretsResult, GetCodespacesSecretsOutputArgs } from "./getCodespacesSecrets"; +export const getCodespacesSecrets: typeof import("./getCodespacesSecrets").getCodespacesSecrets = null as any; +export const getCodespacesSecretsOutput: typeof import("./getCodespacesSecrets").getCodespacesSecretsOutput = null as any; +utilities.lazyLoad(exports, ["getCodespacesSecrets","getCodespacesSecretsOutput"], () => require("./getCodespacesSecrets")); + +export { GetCodespacesUserPublicKeyResult } from "./getCodespacesUserPublicKey"; +export const getCodespacesUserPublicKey: typeof import("./getCodespacesUserPublicKey").getCodespacesUserPublicKey = null as any; +utilities.lazyLoad(exports, ["getCodespacesUserPublicKey"], () => require("./getCodespacesUserPublicKey")); + +export { GetCodespacesUserSecretsResult } from "./getCodespacesUserSecrets"; +export const getCodespacesUserSecrets: typeof import("./getCodespacesUserSecrets").getCodespacesUserSecrets = null as any; +utilities.lazyLoad(exports, ["getCodespacesUserSecrets"], () => require("./getCodespacesUserSecrets")); + export { GetCollaboratorsArgs, GetCollaboratorsResult, GetCollaboratorsOutputArgs } from "./getCollaborators"; export const getCollaborators: typeof import("./getCollaborators").getCollaborators = null as any; export const getCollaboratorsOutput: typeof import("./getCollaborators").getCollaboratorsOutput = null as any; @@ -251,6 +292,11 @@ export const getOrganization: typeof import("./getOrganization").getOrganization export const getOrganizationOutput: typeof import("./getOrganization").getOrganizationOutput = null as any; utilities.lazyLoad(exports, ["getOrganization","getOrganizationOutput"], () => require("./getOrganization")); +export { GetOrganizationCustomRoleArgs, GetOrganizationCustomRoleResult, GetOrganizationCustomRoleOutputArgs } from "./getOrganizationCustomRole"; +export const getOrganizationCustomRole: typeof import("./getOrganizationCustomRole").getOrganizationCustomRole = null as any; +export const getOrganizationCustomRoleOutput: typeof import("./getOrganizationCustomRole").getOrganizationCustomRoleOutput = null as any; +utilities.lazyLoad(exports, ["getOrganizationCustomRole","getOrganizationCustomRoleOutput"], () => require("./getOrganizationCustomRole")); + export { GetOrganizationIpAllowListResult } from "./getOrganizationIpAllowList"; export const getOrganizationIpAllowList: typeof import("./getOrganizationIpAllowList").getOrganizationIpAllowList = null as any; utilities.lazyLoad(exports, ["getOrganizationIpAllowList"], () => require("./getOrganizationIpAllowList")); @@ -392,6 +438,11 @@ export type OrganizationBlock = import("./organizationBlock").OrganizationBlock; export const OrganizationBlock: typeof import("./organizationBlock").OrganizationBlock = null as any; utilities.lazyLoad(exports, ["OrganizationBlock"], () => require("./organizationBlock")); +export { OrganizationCustomRoleArgs, OrganizationCustomRoleState } from "./organizationCustomRole"; +export type OrganizationCustomRole = import("./organizationCustomRole").OrganizationCustomRole; +export const OrganizationCustomRole: typeof import("./organizationCustomRole").OrganizationCustomRole = null as any; +utilities.lazyLoad(exports, ["OrganizationCustomRole"], () => require("./organizationCustomRole")); + export { OrganizationProjectArgs, OrganizationProjectState } from "./organizationProject"; export type OrganizationProject = import("./organizationProject").OrganizationProject; export const OrganizationProject: typeof import("./organizationProject").OrganizationProject = null as any; @@ -594,6 +645,12 @@ const _module = { return new BranchProtection(name, undefined, { urn }) case "github:index/branchProtectionV3:BranchProtectionV3": return new BranchProtectionV3(name, undefined, { urn }) + case "github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret": + return new CodespacesOrganizationSecret(name, undefined, { urn }) + case "github:index/codespacesSecret:CodespacesSecret": + return new CodespacesSecret(name, undefined, { urn }) + case "github:index/codespacesUserSecret:CodespacesUserSecret": + return new CodespacesUserSecret(name, undefined, { urn }) case "github:index/dependabotOrganizationSecret:DependabotOrganizationSecret": return new DependabotOrganizationSecret(name, undefined, { urn }) case "github:index/dependabotOrganizationSecretRepositories:DependabotOrganizationSecretRepositories": @@ -612,6 +669,8 @@ const _module = { return new Membership(name, undefined, { urn }) case "github:index/organizationBlock:OrganizationBlock": return new OrganizationBlock(name, undefined, { urn }) + case "github:index/organizationCustomRole:OrganizationCustomRole": + return new OrganizationCustomRole(name, undefined, { urn }) case "github:index/organizationProject:OrganizationProject": return new OrganizationProject(name, undefined, { urn }) case "github:index/organizationSecurityManager:OrganizationSecurityManager": @@ -694,6 +753,9 @@ 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/branchProtectionV3", _module) +pulumi.runtime.registerResourceModule("github", "index/codespacesOrganizationSecret", _module) +pulumi.runtime.registerResourceModule("github", "index/codespacesSecret", _module) +pulumi.runtime.registerResourceModule("github", "index/codespacesUserSecret", _module) pulumi.runtime.registerResourceModule("github", "index/dependabotOrganizationSecret", _module) pulumi.runtime.registerResourceModule("github", "index/dependabotOrganizationSecretRepositories", _module) pulumi.runtime.registerResourceModule("github", "index/dependabotSecret", _module) @@ -703,6 +765,7 @@ pulumi.runtime.registerResourceModule("github", "index/issue", _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/organizationCustomRole", _module) pulumi.runtime.registerResourceModule("github", "index/organizationProject", _module) pulumi.runtime.registerResourceModule("github", "index/organizationSecurityManager", _module) pulumi.runtime.registerResourceModule("github", "index/organizationSettings", _module) diff --git a/sdk/nodejs/organizationCustomRole.ts b/sdk/nodejs/organizationCustomRole.ts new file mode 100644 index 00000000..e8a0d40b --- /dev/null +++ b/sdk/nodejs/organizationCustomRole.ts @@ -0,0 +1,175 @@ +// *** 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"; + +/** + * This resource allows you to create and manage custom roles in a GitHub Organization for use in repositories. + * + * > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + * + * ## Example Usage + * + * ```typescript + * import * as pulumi from "@pulumi/pulumi"; + * import * as github from "@pulumi/github"; + * + * const example = new github.OrganizationCustomRole("example", { + * baseRole: "read", + * description: "Example custom role that uses the read role as its base", + * permissions: [ + * "add_assignee", + * "add_label", + * "bypass_branch_protection", + * "close_issue", + * "close_pull_request", + * "mark_as_duplicate", + * "create_tag", + * "delete_issue", + * "delete_tag", + * "manage_deploy_keys", + * "push_protected_branch", + * "read_code_scanning", + * "reopen_issue", + * "reopen_pull_request", + * "request_pr_review", + * "resolve_dependabot_alerts", + * "resolve_secret_scanning_alerts", + * "view_secret_scanning_alerts", + * "write_code_scanning", + * ], + * }); + * ``` + * + * ## Import + * + * Custom roles can be imported using the `id` of the role. The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API. + * + * ```sh + * $ pulumi import github:index/organizationCustomRole:OrganizationCustomRole example 1234 + * ``` + */ +export class OrganizationCustomRole extends pulumi.CustomResource { + /** + * Get an existing OrganizationCustomRole resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param state Any extra arguments used during the lookup. + * @param opts Optional settings to control the behavior of the CustomResource. + */ + public static get(name: string, id: pulumi.Input, state?: OrganizationCustomRoleState, opts?: pulumi.CustomResourceOptions): OrganizationCustomRole { + return new OrganizationCustomRole(name, state, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'github:index/organizationCustomRole:OrganizationCustomRole'; + + /** + * Returns true if the given object is an instance of OrganizationCustomRole. This is designed to work even + * when multiple copies of the Pulumi SDK have been loaded into the same process. + */ + public static isInstance(obj: any): obj is OrganizationCustomRole { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === OrganizationCustomRole.__pulumiType; + } + + /** + * The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + */ + public readonly baseRole!: pulumi.Output; + /** + * The description for the custom role. + */ + public readonly description!: pulumi.Output; + /** + * The name of the custom role. + */ + public readonly name!: pulumi.Output; + /** + * A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + */ + public readonly permissions!: pulumi.Output; + + /** + * Create a OrganizationCustomRole resource with the given unique name, arguments, and options. + * + * @param name The _unique_ name of the resource. + * @param args The arguments to use to populate this resource's properties. + * @param opts A bag of options that control this resource's behavior. + */ + constructor(name: string, args: OrganizationCustomRoleArgs, opts?: pulumi.CustomResourceOptions) + constructor(name: string, argsOrState?: OrganizationCustomRoleArgs | OrganizationCustomRoleState, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (opts.id) { + const state = argsOrState as OrganizationCustomRoleState | undefined; + resourceInputs["baseRole"] = state ? state.baseRole : undefined; + resourceInputs["description"] = state ? state.description : undefined; + resourceInputs["name"] = state ? state.name : undefined; + resourceInputs["permissions"] = state ? state.permissions : undefined; + } else { + const args = argsOrState as OrganizationCustomRoleArgs | undefined; + if ((!args || args.baseRole === undefined) && !opts.urn) { + throw new Error("Missing required property 'baseRole'"); + } + if ((!args || args.permissions === undefined) && !opts.urn) { + throw new Error("Missing required property 'permissions'"); + } + resourceInputs["baseRole"] = args ? args.baseRole : undefined; + resourceInputs["description"] = args ? args.description : undefined; + resourceInputs["name"] = args ? args.name : undefined; + resourceInputs["permissions"] = args ? args.permissions : undefined; + } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + super(OrganizationCustomRole.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * Input properties used for looking up and filtering OrganizationCustomRole resources. + */ +export interface OrganizationCustomRoleState { + /** + * The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + */ + baseRole?: pulumi.Input; + /** + * The description for the custom role. + */ + description?: pulumi.Input; + /** + * The name of the custom role. + */ + name?: pulumi.Input; + /** + * A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + */ + permissions?: pulumi.Input[]>; +} + +/** + * The set of arguments for constructing a OrganizationCustomRole resource. + */ +export interface OrganizationCustomRoleArgs { + /** + * The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + */ + baseRole: pulumi.Input; + /** + * The description for the custom role. + */ + description?: pulumi.Input; + /** + * The name of the custom role. + */ + name?: pulumi.Input; + /** + * A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + */ + permissions: pulumi.Input[]>; +} diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index 39829561..5596eaf7 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -32,6 +32,9 @@ "branchDefault.ts", "branchProtection.ts", "branchProtectionV3.ts", + "codespacesOrganizationSecret.ts", + "codespacesSecret.ts", + "codespacesUserSecret.ts", "config/index.ts", "config/vars.ts", "dependabotOrganizationSecret.ts", @@ -54,6 +57,12 @@ "getAppToken.ts", "getBranch.ts", "getBranchProtectionRules.ts", + "getCodespacesOrganizationPublicKey.ts", + "getCodespacesOrganizationSecrets.ts", + "getCodespacesPublicKey.ts", + "getCodespacesSecrets.ts", + "getCodespacesUserPublicKey.ts", + "getCodespacesUserSecrets.ts", "getCollaborators.ts", "getDependabotOrganizationPublicKey.ts", "getDependabotOrganizationSecrets.ts", @@ -66,6 +75,7 @@ "getIssueLabels.ts", "getMembership.ts", "getOrganization.ts", + "getOrganizationCustomRole.ts", "getOrganizationIpAllowList.ts", "getOrganizationTeamSyncGroups.ts", "getOrganizationTeams.ts", @@ -96,6 +106,7 @@ "issueLabel.ts", "membership.ts", "organizationBlock.ts", + "organizationCustomRole.ts", "organizationProject.ts", "organizationSecurityManager.ts", "organizationSettings.ts", diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index 883e91bf..89178456 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -288,6 +288,59 @@ export interface GetBranchProtectionRulesRule { pattern: string; } +export interface GetCodespacesOrganizationSecretsSecret { + /** + * Timestamp of the secret creation + */ + createdAt: string; + /** + * Secret name + */ + name: string; + /** + * Timestamp of the secret last update + */ + updatedAt: string; + /** + * Secret visibility + */ + visibility: string; +} + +export interface GetCodespacesSecretsSecret { + /** + * Timestamp of the secret creation + */ + createdAt: string; + /** + * The name of the repository. + */ + name: string; + /** + * Timestamp of the secret last update + */ + updatedAt: string; +} + +export interface GetCodespacesUserSecretsSecret { + /** + * Timestamp of the secret creation + */ + createdAt: string; + /** + * Secret name + */ + name: string; + /** + * Timestamp of the secret last update + */ + updatedAt: string; + /** + * Secret visibility + */ + visibility: string; +} + export interface GetCollaboratorsCollaborator { /** * The GitHub API URL for the collaborator's events. diff --git a/sdk/python/pulumi_github/__init__.py b/sdk/python/pulumi_github/__init__.py index 63d283e9..4f87ca13 100644 --- a/sdk/python/pulumi_github/__init__.py +++ b/sdk/python/pulumi_github/__init__.py @@ -24,6 +24,9 @@ from .branch_default import * from .branch_protection import * from .branch_protection_v3 import * +from .codespaces_organization_secret import * +from .codespaces_secret import * +from .codespaces_user_secret import * from .dependabot_organization_secret import * from .dependabot_organization_secret_repositories import * from .dependabot_secret import * @@ -44,6 +47,12 @@ from .get_app_token import * from .get_branch import * from .get_branch_protection_rules import * +from .get_codespaces_organization_public_key import * +from .get_codespaces_organization_secrets import * +from .get_codespaces_public_key import * +from .get_codespaces_secrets import * +from .get_codespaces_user_public_key import * +from .get_codespaces_user_secrets import * from .get_collaborators import * from .get_dependabot_organization_public_key import * from .get_dependabot_organization_secrets import * @@ -56,6 +65,7 @@ from .get_issue_labels import * from .get_membership import * from .get_organization import * +from .get_organization_custom_role import * from .get_organization_ip_allow_list import * from .get_organization_team_sync_groups import * from .get_organization_teams import * @@ -85,6 +95,7 @@ from .issue_label import * from .membership import * from .organization_block import * +from .organization_custom_role import * from .organization_project import * from .organization_security_manager import * from .organization_settings import * @@ -280,6 +291,30 @@ "github:index/branchProtectionV3:BranchProtectionV3": "BranchProtectionV3" } }, + { + "pkg": "github", + "mod": "index/codespacesOrganizationSecret", + "fqn": "pulumi_github", + "classes": { + "github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret": "CodespacesOrganizationSecret" + } + }, + { + "pkg": "github", + "mod": "index/codespacesSecret", + "fqn": "pulumi_github", + "classes": { + "github:index/codespacesSecret:CodespacesSecret": "CodespacesSecret" + } + }, + { + "pkg": "github", + "mod": "index/codespacesUserSecret", + "fqn": "pulumi_github", + "classes": { + "github:index/codespacesUserSecret:CodespacesUserSecret": "CodespacesUserSecret" + } + }, { "pkg": "github", "mod": "index/dependabotOrganizationSecret", @@ -352,6 +387,14 @@ "github:index/organizationBlock:OrganizationBlock": "OrganizationBlock" } }, + { + "pkg": "github", + "mod": "index/organizationCustomRole", + "fqn": "pulumi_github", + "classes": { + "github:index/organizationCustomRole:OrganizationCustomRole": "OrganizationCustomRole" + } + }, { "pkg": "github", "mod": "index/organizationProject", diff --git a/sdk/python/pulumi_github/codespaces_organization_secret.py b/sdk/python/pulumi_github/codespaces_organization_secret.py new file mode 100644 index 00000000..d8d699d0 --- /dev/null +++ b/sdk/python/pulumi_github/codespaces_organization_secret.py @@ -0,0 +1,482 @@ +# coding=utf-8 +# *** 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 copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities + +__all__ = ['CodespacesOrganizationSecretArgs', 'CodespacesOrganizationSecret'] + +@pulumi.input_type +class CodespacesOrganizationSecretArgs: + def __init__(__self__, *, + secret_name: pulumi.Input[str], + visibility: pulumi.Input[str], + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + selected_repository_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None): + """ + The set of arguments for constructing a CodespacesOrganizationSecret resource. + :param pulumi.Input[str] secret_name: Name of the secret + :param pulumi.Input[str] visibility: Configures the access that repositories have to the organization secret. + Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + :param pulumi.Input[str] encrypted_value: Encrypted value of the secret using the GitHub public key in Base64 format. + :param pulumi.Input[str] plaintext_value: Plaintext value of the secret to be encrypted + :param pulumi.Input[Sequence[pulumi.Input[int]]] selected_repository_ids: An array of repository ids that can access the organization secret. + """ + pulumi.set(__self__, "secret_name", secret_name) + pulumi.set(__self__, "visibility", visibility) + if encrypted_value is not None: + pulumi.set(__self__, "encrypted_value", encrypted_value) + if plaintext_value is not None: + pulumi.set(__self__, "plaintext_value", plaintext_value) + if selected_repository_ids is not None: + pulumi.set(__self__, "selected_repository_ids", selected_repository_ids) + + @property + @pulumi.getter(name="secretName") + def secret_name(self) -> pulumi.Input[str]: + """ + Name of the secret + """ + return pulumi.get(self, "secret_name") + + @secret_name.setter + def secret_name(self, value: pulumi.Input[str]): + pulumi.set(self, "secret_name", value) + + @property + @pulumi.getter + def visibility(self) -> pulumi.Input[str]: + """ + Configures the access that repositories have to the organization secret. + Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + """ + return pulumi.get(self, "visibility") + + @visibility.setter + def visibility(self, value: pulumi.Input[str]): + pulumi.set(self, "visibility", value) + + @property + @pulumi.getter(name="encryptedValue") + def encrypted_value(self) -> Optional[pulumi.Input[str]]: + """ + Encrypted value of the secret using the GitHub public key in Base64 format. + """ + return pulumi.get(self, "encrypted_value") + + @encrypted_value.setter + def encrypted_value(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "encrypted_value", value) + + @property + @pulumi.getter(name="plaintextValue") + def plaintext_value(self) -> Optional[pulumi.Input[str]]: + """ + Plaintext value of the secret to be encrypted + """ + return pulumi.get(self, "plaintext_value") + + @plaintext_value.setter + def plaintext_value(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "plaintext_value", value) + + @property + @pulumi.getter(name="selectedRepositoryIds") + def selected_repository_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]: + """ + An array of repository ids that can access the organization secret. + """ + return pulumi.get(self, "selected_repository_ids") + + @selected_repository_ids.setter + def selected_repository_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]): + pulumi.set(self, "selected_repository_ids", value) + + +@pulumi.input_type +class _CodespacesOrganizationSecretState: + def __init__(__self__, *, + created_at: Optional[pulumi.Input[str]] = None, + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + secret_name: Optional[pulumi.Input[str]] = None, + selected_repository_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + updated_at: Optional[pulumi.Input[str]] = None, + visibility: Optional[pulumi.Input[str]] = None): + """ + Input properties used for looking up and filtering CodespacesOrganizationSecret resources. + :param pulumi.Input[str] created_at: Date of codespaces_secret creation. + :param pulumi.Input[str] encrypted_value: Encrypted value of the secret using the GitHub public key in Base64 format. + :param pulumi.Input[str] plaintext_value: Plaintext value of the secret to be encrypted + :param pulumi.Input[str] secret_name: Name of the secret + :param pulumi.Input[Sequence[pulumi.Input[int]]] selected_repository_ids: An array of repository ids that can access the organization secret. + :param pulumi.Input[str] updated_at: Date of codespaces_secret update. + :param pulumi.Input[str] visibility: Configures the access that repositories have to the organization secret. + Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + """ + if created_at is not None: + pulumi.set(__self__, "created_at", created_at) + if encrypted_value is not None: + pulumi.set(__self__, "encrypted_value", encrypted_value) + if plaintext_value is not None: + pulumi.set(__self__, "plaintext_value", plaintext_value) + if secret_name is not None: + pulumi.set(__self__, "secret_name", secret_name) + if selected_repository_ids is not None: + pulumi.set(__self__, "selected_repository_ids", selected_repository_ids) + if updated_at is not None: + pulumi.set(__self__, "updated_at", updated_at) + if visibility is not None: + pulumi.set(__self__, "visibility", visibility) + + @property + @pulumi.getter(name="createdAt") + def created_at(self) -> Optional[pulumi.Input[str]]: + """ + Date of codespaces_secret creation. + """ + return pulumi.get(self, "created_at") + + @created_at.setter + def created_at(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "created_at", value) + + @property + @pulumi.getter(name="encryptedValue") + def encrypted_value(self) -> Optional[pulumi.Input[str]]: + """ + Encrypted value of the secret using the GitHub public key in Base64 format. + """ + return pulumi.get(self, "encrypted_value") + + @encrypted_value.setter + def encrypted_value(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "encrypted_value", value) + + @property + @pulumi.getter(name="plaintextValue") + def plaintext_value(self) -> Optional[pulumi.Input[str]]: + """ + Plaintext value of the secret to be encrypted + """ + return pulumi.get(self, "plaintext_value") + + @plaintext_value.setter + def plaintext_value(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "plaintext_value", value) + + @property + @pulumi.getter(name="secretName") + def secret_name(self) -> Optional[pulumi.Input[str]]: + """ + Name of the secret + """ + return pulumi.get(self, "secret_name") + + @secret_name.setter + def secret_name(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "secret_name", value) + + @property + @pulumi.getter(name="selectedRepositoryIds") + def selected_repository_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]: + """ + An array of repository ids that can access the organization secret. + """ + return pulumi.get(self, "selected_repository_ids") + + @selected_repository_ids.setter + def selected_repository_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]): + pulumi.set(self, "selected_repository_ids", value) + + @property + @pulumi.getter(name="updatedAt") + def updated_at(self) -> Optional[pulumi.Input[str]]: + """ + Date of codespaces_secret update. + """ + return pulumi.get(self, "updated_at") + + @updated_at.setter + def updated_at(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "updated_at", value) + + @property + @pulumi.getter + def visibility(self) -> Optional[pulumi.Input[str]]: + """ + Configures the access that repositories have to the organization secret. + Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + """ + return pulumi.get(self, "visibility") + + @visibility.setter + def visibility(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "visibility", value) + + +class CodespacesOrganizationSecret(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + secret_name: Optional[pulumi.Input[str]] = None, + selected_repository_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + visibility: Optional[pulumi.Input[str]] = None, + __props__=None): + """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="private", + plaintext_value=var["some_secret_string"]) + example_secret_index_codespaces_organization_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="private", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + example_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="selected", + plaintext_value=var["some_secret_string"], + selected_repository_ids=[repo.repo_id]) + example_secret_index_codespaces_organization_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="selected", + encrypted_value=var["some_encrypted_secret_string"], + selected_repository_ids=[repo.repo_id]) + ``` + + ## Import + + This resource can be imported using an ID made up of the secret name + + ```sh + $ pulumi import github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret test_secret test_secret_name + ``` + + NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. + + :param str resource_name: The name of the resource. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[str] encrypted_value: Encrypted value of the secret using the GitHub public key in Base64 format. + :param pulumi.Input[str] plaintext_value: Plaintext value of the secret to be encrypted + :param pulumi.Input[str] secret_name: Name of the secret + :param pulumi.Input[Sequence[pulumi.Input[int]]] selected_repository_ids: An array of repository ids that can access the organization secret. + :param pulumi.Input[str] visibility: Configures the access that repositories have to the organization secret. + Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + """ + ... + @overload + def __init__(__self__, + resource_name: str, + args: CodespacesOrganizationSecretArgs, + opts: Optional[pulumi.ResourceOptions] = None): + """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="private", + plaintext_value=var["some_secret_string"]) + example_secret_index_codespaces_organization_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="private", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + example_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="selected", + plaintext_value=var["some_secret_string"], + selected_repository_ids=[repo.repo_id]) + example_secret_index_codespaces_organization_secret_codespaces_organization_secret = github.CodespacesOrganizationSecret("exampleSecretIndex/codespacesOrganizationSecretCodespacesOrganizationSecret", + secret_name="example_secret_name", + visibility="selected", + encrypted_value=var["some_encrypted_secret_string"], + selected_repository_ids=[repo.repo_id]) + ``` + + ## Import + + This resource can be imported using an ID made up of the secret name + + ```sh + $ pulumi import github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret test_secret test_secret_name + ``` + + NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. + + :param str resource_name: The name of the resource. + :param CodespacesOrganizationSecretArgs args: The arguments to use to populate this resource's properties. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + ... + def __init__(__self__, resource_name: str, *args, **kwargs): + resource_args, opts = _utilities.get_resource_args_opts(CodespacesOrganizationSecretArgs, pulumi.ResourceOptions, *args, **kwargs) + if resource_args is not None: + __self__._internal_init(resource_name, opts, **resource_args.__dict__) + else: + __self__._internal_init(resource_name, *args, **kwargs) + + def _internal_init(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + secret_name: Optional[pulumi.Input[str]] = None, + selected_repository_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + visibility: Optional[pulumi.Input[str]] = None, + __props__=None): + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) + if not isinstance(opts, pulumi.ResourceOptions): + raise TypeError('Expected resource options to be a ResourceOptions instance') + if opts.id is None: + if __props__ is not None: + raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') + __props__ = CodespacesOrganizationSecretArgs.__new__(CodespacesOrganizationSecretArgs) + + __props__.__dict__["encrypted_value"] = None if encrypted_value is None else pulumi.Output.secret(encrypted_value) + __props__.__dict__["plaintext_value"] = None if plaintext_value is None else pulumi.Output.secret(plaintext_value) + if secret_name is None and not opts.urn: + raise TypeError("Missing required property 'secret_name'") + __props__.__dict__["secret_name"] = secret_name + __props__.__dict__["selected_repository_ids"] = selected_repository_ids + if visibility is None and not opts.urn: + raise TypeError("Missing required property 'visibility'") + __props__.__dict__["visibility"] = visibility + __props__.__dict__["created_at"] = None + __props__.__dict__["updated_at"] = None + secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["encryptedValue", "plaintextValue"]) + opts = pulumi.ResourceOptions.merge(opts, secret_opts) + super(CodespacesOrganizationSecret, __self__).__init__( + 'github:index/codespacesOrganizationSecret:CodespacesOrganizationSecret', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None, + created_at: Optional[pulumi.Input[str]] = None, + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + secret_name: Optional[pulumi.Input[str]] = None, + selected_repository_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + updated_at: Optional[pulumi.Input[str]] = None, + visibility: Optional[pulumi.Input[str]] = None) -> 'CodespacesOrganizationSecret': + """ + Get an existing CodespacesOrganizationSecret resource's state with the given name, id, and optional extra + properties used to qualify the lookup. + + :param str resource_name: The unique name of the resulting resource. + :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[str] created_at: Date of codespaces_secret creation. + :param pulumi.Input[str] encrypted_value: Encrypted value of the secret using the GitHub public key in Base64 format. + :param pulumi.Input[str] plaintext_value: Plaintext value of the secret to be encrypted + :param pulumi.Input[str] secret_name: Name of the secret + :param pulumi.Input[Sequence[pulumi.Input[int]]] selected_repository_ids: An array of repository ids that can access the organization secret. + :param pulumi.Input[str] updated_at: Date of codespaces_secret update. + :param pulumi.Input[str] visibility: Configures the access that repositories have to the organization secret. + Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + """ + opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) + + __props__ = _CodespacesOrganizationSecretState.__new__(_CodespacesOrganizationSecretState) + + __props__.__dict__["created_at"] = created_at + __props__.__dict__["encrypted_value"] = encrypted_value + __props__.__dict__["plaintext_value"] = plaintext_value + __props__.__dict__["secret_name"] = secret_name + __props__.__dict__["selected_repository_ids"] = selected_repository_ids + __props__.__dict__["updated_at"] = updated_at + __props__.__dict__["visibility"] = visibility + return CodespacesOrganizationSecret(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter(name="createdAt") + def created_at(self) -> pulumi.Output[str]: + """ + Date of codespaces_secret creation. + """ + return pulumi.get(self, "created_at") + + @property + @pulumi.getter(name="encryptedValue") + def encrypted_value(self) -> pulumi.Output[Optional[str]]: + """ + Encrypted value of the secret using the GitHub public key in Base64 format. + """ + return pulumi.get(self, "encrypted_value") + + @property + @pulumi.getter(name="plaintextValue") + def plaintext_value(self) -> pulumi.Output[Optional[str]]: + """ + Plaintext value of the secret to be encrypted + """ + return pulumi.get(self, "plaintext_value") + + @property + @pulumi.getter(name="secretName") + def secret_name(self) -> pulumi.Output[str]: + """ + Name of the secret + """ + return pulumi.get(self, "secret_name") + + @property + @pulumi.getter(name="selectedRepositoryIds") + def selected_repository_ids(self) -> pulumi.Output[Optional[Sequence[int]]]: + """ + An array of repository ids that can access the organization secret. + """ + return pulumi.get(self, "selected_repository_ids") + + @property + @pulumi.getter(name="updatedAt") + def updated_at(self) -> pulumi.Output[str]: + """ + Date of codespaces_secret update. + """ + return pulumi.get(self, "updated_at") + + @property + @pulumi.getter + def visibility(self) -> pulumi.Output[str]: + """ + Configures the access that repositories have to the organization secret. + Must be one of `all`, `private`, `selected`. `selected_repository_ids` is required if set to `selected`. + """ + return pulumi.get(self, "visibility") + diff --git a/sdk/python/pulumi_github/codespaces_secret.py b/sdk/python/pulumi_github/codespaces_secret.py new file mode 100644 index 00000000..6ee8b628 --- /dev/null +++ b/sdk/python/pulumi_github/codespaces_secret.py @@ -0,0 +1,376 @@ +# coding=utf-8 +# *** 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 copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities + +__all__ = ['CodespacesSecretArgs', 'CodespacesSecret'] + +@pulumi.input_type +class CodespacesSecretArgs: + def __init__(__self__, *, + repository: pulumi.Input[str], + secret_name: pulumi.Input[str], + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None): + """ + The set of arguments for constructing a CodespacesSecret resource. + :param pulumi.Input[str] repository: Name of the repository + :param pulumi.Input[str] secret_name: Name of the secret + :param pulumi.Input[str] encrypted_value: Encrypted value of the secret using the GitHub public key in Base64 format. + :param pulumi.Input[str] plaintext_value: Plaintext value of the secret to be encrypted + """ + pulumi.set(__self__, "repository", repository) + pulumi.set(__self__, "secret_name", secret_name) + if encrypted_value is not None: + pulumi.set(__self__, "encrypted_value", encrypted_value) + if plaintext_value is not None: + pulumi.set(__self__, "plaintext_value", plaintext_value) + + @property + @pulumi.getter + def repository(self) -> pulumi.Input[str]: + """ + Name of the repository + """ + return pulumi.get(self, "repository") + + @repository.setter + def repository(self, value: pulumi.Input[str]): + pulumi.set(self, "repository", value) + + @property + @pulumi.getter(name="secretName") + def secret_name(self) -> pulumi.Input[str]: + """ + Name of the secret + """ + return pulumi.get(self, "secret_name") + + @secret_name.setter + def secret_name(self, value: pulumi.Input[str]): + pulumi.set(self, "secret_name", value) + + @property + @pulumi.getter(name="encryptedValue") + def encrypted_value(self) -> Optional[pulumi.Input[str]]: + """ + Encrypted value of the secret using the GitHub public key in Base64 format. + """ + return pulumi.get(self, "encrypted_value") + + @encrypted_value.setter + def encrypted_value(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "encrypted_value", value) + + @property + @pulumi.getter(name="plaintextValue") + def plaintext_value(self) -> Optional[pulumi.Input[str]]: + """ + Plaintext value of the secret to be encrypted + """ + return pulumi.get(self, "plaintext_value") + + @plaintext_value.setter + def plaintext_value(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "plaintext_value", value) + + +@pulumi.input_type +class _CodespacesSecretState: + def __init__(__self__, *, + created_at: Optional[pulumi.Input[str]] = None, + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + repository: Optional[pulumi.Input[str]] = None, + secret_name: Optional[pulumi.Input[str]] = None, + updated_at: Optional[pulumi.Input[str]] = None): + """ + Input properties used for looking up and filtering CodespacesSecret resources. + :param pulumi.Input[str] created_at: Date of actions_secret creation. + :param pulumi.Input[str] encrypted_value: Encrypted value of the secret using the GitHub public key in Base64 format. + :param pulumi.Input[str] plaintext_value: Plaintext value of the secret to be encrypted + :param pulumi.Input[str] repository: Name of the repository + :param pulumi.Input[str] secret_name: Name of the secret + :param pulumi.Input[str] updated_at: Date of actions_secret update. + """ + if created_at is not None: + pulumi.set(__self__, "created_at", created_at) + if encrypted_value is not None: + pulumi.set(__self__, "encrypted_value", encrypted_value) + if plaintext_value is not None: + pulumi.set(__self__, "plaintext_value", plaintext_value) + if repository is not None: + pulumi.set(__self__, "repository", repository) + if secret_name is not None: + pulumi.set(__self__, "secret_name", secret_name) + if updated_at is not None: + pulumi.set(__self__, "updated_at", updated_at) + + @property + @pulumi.getter(name="createdAt") + def created_at(self) -> Optional[pulumi.Input[str]]: + """ + Date of actions_secret creation. + """ + return pulumi.get(self, "created_at") + + @created_at.setter + def created_at(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "created_at", value) + + @property + @pulumi.getter(name="encryptedValue") + def encrypted_value(self) -> Optional[pulumi.Input[str]]: + """ + Encrypted value of the secret using the GitHub public key in Base64 format. + """ + return pulumi.get(self, "encrypted_value") + + @encrypted_value.setter + def encrypted_value(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "encrypted_value", value) + + @property + @pulumi.getter(name="plaintextValue") + def plaintext_value(self) -> Optional[pulumi.Input[str]]: + """ + Plaintext value of the secret to be encrypted + """ + return pulumi.get(self, "plaintext_value") + + @plaintext_value.setter + def plaintext_value(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "plaintext_value", value) + + @property + @pulumi.getter + def repository(self) -> Optional[pulumi.Input[str]]: + """ + Name of the repository + """ + return pulumi.get(self, "repository") + + @repository.setter + def repository(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "repository", value) + + @property + @pulumi.getter(name="secretName") + def secret_name(self) -> Optional[pulumi.Input[str]]: + """ + Name of the secret + """ + return pulumi.get(self, "secret_name") + + @secret_name.setter + def secret_name(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "secret_name", value) + + @property + @pulumi.getter(name="updatedAt") + def updated_at(self) -> Optional[pulumi.Input[str]]: + """ + Date of actions_secret update. + """ + return pulumi.get(self, "updated_at") + + @updated_at.setter + def updated_at(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "updated_at", value) + + +class CodespacesSecret(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + repository: Optional[pulumi.Input[str]] = None, + secret_name: Optional[pulumi.Input[str]] = None, + __props__=None): + """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_public_key = github.get_codespaces_public_key(repository="example_repository") + example_secret_codespaces_secret = github.CodespacesSecret("exampleSecretCodespacesSecret", + repository="example_repository", + secret_name="example_secret_name", + plaintext_value=var["some_secret_string"]) + example_secret_index_codespaces_secret_codespaces_secret = github.CodespacesSecret("exampleSecretIndex/codespacesSecretCodespacesSecret", + repository="example_repository", + secret_name="example_secret_name", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + + :param str resource_name: The name of the resource. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[str] encrypted_value: Encrypted value of the secret using the GitHub public key in Base64 format. + :param pulumi.Input[str] plaintext_value: Plaintext value of the secret to be encrypted + :param pulumi.Input[str] repository: Name of the repository + :param pulumi.Input[str] secret_name: Name of the secret + """ + ... + @overload + def __init__(__self__, + resource_name: str, + args: CodespacesSecretArgs, + opts: Optional[pulumi.ResourceOptions] = None): + """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example_public_key = github.get_codespaces_public_key(repository="example_repository") + example_secret_codespaces_secret = github.CodespacesSecret("exampleSecretCodespacesSecret", + repository="example_repository", + secret_name="example_secret_name", + plaintext_value=var["some_secret_string"]) + example_secret_index_codespaces_secret_codespaces_secret = github.CodespacesSecret("exampleSecretIndex/codespacesSecretCodespacesSecret", + repository="example_repository", + secret_name="example_secret_name", + encrypted_value=var["some_encrypted_secret_string"]) + ``` + + :param str resource_name: The name of the resource. + :param CodespacesSecretArgs args: The arguments to use to populate this resource's properties. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + ... + def __init__(__self__, resource_name: str, *args, **kwargs): + resource_args, opts = _utilities.get_resource_args_opts(CodespacesSecretArgs, pulumi.ResourceOptions, *args, **kwargs) + if resource_args is not None: + __self__._internal_init(resource_name, opts, **resource_args.__dict__) + else: + __self__._internal_init(resource_name, *args, **kwargs) + + def _internal_init(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + repository: Optional[pulumi.Input[str]] = None, + secret_name: Optional[pulumi.Input[str]] = None, + __props__=None): + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) + if not isinstance(opts, pulumi.ResourceOptions): + raise TypeError('Expected resource options to be a ResourceOptions instance') + if opts.id is None: + if __props__ is not None: + raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') + __props__ = CodespacesSecretArgs.__new__(CodespacesSecretArgs) + + __props__.__dict__["encrypted_value"] = None if encrypted_value is None else pulumi.Output.secret(encrypted_value) + __props__.__dict__["plaintext_value"] = None if plaintext_value is None else pulumi.Output.secret(plaintext_value) + if repository is None and not opts.urn: + raise TypeError("Missing required property 'repository'") + __props__.__dict__["repository"] = repository + if secret_name is None and not opts.urn: + raise TypeError("Missing required property 'secret_name'") + __props__.__dict__["secret_name"] = secret_name + __props__.__dict__["created_at"] = None + __props__.__dict__["updated_at"] = None + secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["encryptedValue", "plaintextValue"]) + opts = pulumi.ResourceOptions.merge(opts, secret_opts) + super(CodespacesSecret, __self__).__init__( + 'github:index/codespacesSecret:CodespacesSecret', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None, + created_at: Optional[pulumi.Input[str]] = None, + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + repository: Optional[pulumi.Input[str]] = None, + secret_name: Optional[pulumi.Input[str]] = None, + updated_at: Optional[pulumi.Input[str]] = None) -> 'CodespacesSecret': + """ + Get an existing CodespacesSecret resource's state with the given name, id, and optional extra + properties used to qualify the lookup. + + :param str resource_name: The unique name of the resulting resource. + :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[str] created_at: Date of actions_secret creation. + :param pulumi.Input[str] encrypted_value: Encrypted value of the secret using the GitHub public key in Base64 format. + :param pulumi.Input[str] plaintext_value: Plaintext value of the secret to be encrypted + :param pulumi.Input[str] repository: Name of the repository + :param pulumi.Input[str] secret_name: Name of the secret + :param pulumi.Input[str] updated_at: Date of actions_secret update. + """ + opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) + + __props__ = _CodespacesSecretState.__new__(_CodespacesSecretState) + + __props__.__dict__["created_at"] = created_at + __props__.__dict__["encrypted_value"] = encrypted_value + __props__.__dict__["plaintext_value"] = plaintext_value + __props__.__dict__["repository"] = repository + __props__.__dict__["secret_name"] = secret_name + __props__.__dict__["updated_at"] = updated_at + return CodespacesSecret(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter(name="createdAt") + def created_at(self) -> pulumi.Output[str]: + """ + Date of actions_secret creation. + """ + return pulumi.get(self, "created_at") + + @property + @pulumi.getter(name="encryptedValue") + def encrypted_value(self) -> pulumi.Output[Optional[str]]: + """ + Encrypted value of the secret using the GitHub public key in Base64 format. + """ + return pulumi.get(self, "encrypted_value") + + @property + @pulumi.getter(name="plaintextValue") + def plaintext_value(self) -> pulumi.Output[Optional[str]]: + """ + Plaintext value of the secret to be encrypted + """ + return pulumi.get(self, "plaintext_value") + + @property + @pulumi.getter + def repository(self) -> pulumi.Output[str]: + """ + Name of the repository + """ + return pulumi.get(self, "repository") + + @property + @pulumi.getter(name="secretName") + def secret_name(self) -> pulumi.Output[str]: + """ + Name of the secret + """ + return pulumi.get(self, "secret_name") + + @property + @pulumi.getter(name="updatedAt") + def updated_at(self) -> pulumi.Output[str]: + """ + Date of actions_secret update. + """ + return pulumi.get(self, "updated_at") + diff --git a/sdk/python/pulumi_github/codespaces_user_secret.py b/sdk/python/pulumi_github/codespaces_user_secret.py new file mode 100644 index 00000000..19b595cf --- /dev/null +++ b/sdk/python/pulumi_github/codespaces_user_secret.py @@ -0,0 +1,395 @@ +# coding=utf-8 +# *** 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 copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities + +__all__ = ['CodespacesUserSecretArgs', 'CodespacesUserSecret'] + +@pulumi.input_type +class CodespacesUserSecretArgs: + def __init__(__self__, *, + secret_name: pulumi.Input[str], + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + selected_repository_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None): + """ + The set of arguments for constructing a CodespacesUserSecret resource. + :param pulumi.Input[str] secret_name: Name of the secret + :param pulumi.Input[str] encrypted_value: Encrypted value of the secret using the GitHub public key in Base64 format. + :param pulumi.Input[str] plaintext_value: Plaintext value of the secret to be encrypted + :param pulumi.Input[Sequence[pulumi.Input[int]]] selected_repository_ids: An array of repository ids that can access the user secret. + """ + pulumi.set(__self__, "secret_name", secret_name) + if encrypted_value is not None: + pulumi.set(__self__, "encrypted_value", encrypted_value) + if plaintext_value is not None: + pulumi.set(__self__, "plaintext_value", plaintext_value) + if selected_repository_ids is not None: + pulumi.set(__self__, "selected_repository_ids", selected_repository_ids) + + @property + @pulumi.getter(name="secretName") + def secret_name(self) -> pulumi.Input[str]: + """ + Name of the secret + """ + return pulumi.get(self, "secret_name") + + @secret_name.setter + def secret_name(self, value: pulumi.Input[str]): + pulumi.set(self, "secret_name", value) + + @property + @pulumi.getter(name="encryptedValue") + def encrypted_value(self) -> Optional[pulumi.Input[str]]: + """ + Encrypted value of the secret using the GitHub public key in Base64 format. + """ + return pulumi.get(self, "encrypted_value") + + @encrypted_value.setter + def encrypted_value(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "encrypted_value", value) + + @property + @pulumi.getter(name="plaintextValue") + def plaintext_value(self) -> Optional[pulumi.Input[str]]: + """ + Plaintext value of the secret to be encrypted + """ + return pulumi.get(self, "plaintext_value") + + @plaintext_value.setter + def plaintext_value(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "plaintext_value", value) + + @property + @pulumi.getter(name="selectedRepositoryIds") + def selected_repository_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]: + """ + An array of repository ids that can access the user secret. + """ + return pulumi.get(self, "selected_repository_ids") + + @selected_repository_ids.setter + def selected_repository_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]): + pulumi.set(self, "selected_repository_ids", value) + + +@pulumi.input_type +class _CodespacesUserSecretState: + def __init__(__self__, *, + created_at: Optional[pulumi.Input[str]] = None, + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + secret_name: Optional[pulumi.Input[str]] = None, + selected_repository_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + updated_at: Optional[pulumi.Input[str]] = None): + """ + Input properties used for looking up and filtering CodespacesUserSecret resources. + :param pulumi.Input[str] created_at: Date of codespaces_secret creation. + :param pulumi.Input[str] encrypted_value: Encrypted value of the secret using the GitHub public key in Base64 format. + :param pulumi.Input[str] plaintext_value: Plaintext value of the secret to be encrypted + :param pulumi.Input[str] secret_name: Name of the secret + :param pulumi.Input[Sequence[pulumi.Input[int]]] selected_repository_ids: An array of repository ids that can access the user secret. + :param pulumi.Input[str] updated_at: Date of codespaces_secret update. + """ + if created_at is not None: + pulumi.set(__self__, "created_at", created_at) + if encrypted_value is not None: + pulumi.set(__self__, "encrypted_value", encrypted_value) + if plaintext_value is not None: + pulumi.set(__self__, "plaintext_value", plaintext_value) + if secret_name is not None: + pulumi.set(__self__, "secret_name", secret_name) + if selected_repository_ids is not None: + pulumi.set(__self__, "selected_repository_ids", selected_repository_ids) + if updated_at is not None: + pulumi.set(__self__, "updated_at", updated_at) + + @property + @pulumi.getter(name="createdAt") + def created_at(self) -> Optional[pulumi.Input[str]]: + """ + Date of codespaces_secret creation. + """ + return pulumi.get(self, "created_at") + + @created_at.setter + def created_at(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "created_at", value) + + @property + @pulumi.getter(name="encryptedValue") + def encrypted_value(self) -> Optional[pulumi.Input[str]]: + """ + Encrypted value of the secret using the GitHub public key in Base64 format. + """ + return pulumi.get(self, "encrypted_value") + + @encrypted_value.setter + def encrypted_value(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "encrypted_value", value) + + @property + @pulumi.getter(name="plaintextValue") + def plaintext_value(self) -> Optional[pulumi.Input[str]]: + """ + Plaintext value of the secret to be encrypted + """ + return pulumi.get(self, "plaintext_value") + + @plaintext_value.setter + def plaintext_value(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "plaintext_value", value) + + @property + @pulumi.getter(name="secretName") + def secret_name(self) -> Optional[pulumi.Input[str]]: + """ + Name of the secret + """ + return pulumi.get(self, "secret_name") + + @secret_name.setter + def secret_name(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "secret_name", value) + + @property + @pulumi.getter(name="selectedRepositoryIds") + def selected_repository_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]: + """ + An array of repository ids that can access the user secret. + """ + return pulumi.get(self, "selected_repository_ids") + + @selected_repository_ids.setter + def selected_repository_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]): + pulumi.set(self, "selected_repository_ids", value) + + @property + @pulumi.getter(name="updatedAt") + def updated_at(self) -> Optional[pulumi.Input[str]]: + """ + Date of codespaces_secret update. + """ + return pulumi.get(self, "updated_at") + + @updated_at.setter + def updated_at(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "updated_at", value) + + +class CodespacesUserSecret(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + secret_name: Optional[pulumi.Input[str]] = None, + selected_repository_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + __props__=None): + """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + example_secret_codespaces_user_secret = github.CodespacesUserSecret("exampleSecretCodespacesUserSecret", + secret_name="example_secret_name", + plaintext_value=var["some_secret_string"], + selected_repository_ids=[repo.repo_id]) + example_secret_index_codespaces_user_secret_codespaces_user_secret = github.CodespacesUserSecret("exampleSecretIndex/codespacesUserSecretCodespacesUserSecret", + secret_name="example_secret_name", + encrypted_value=var["some_encrypted_secret_string"], + selected_repository_ids=[repo.repo_id]) + ``` + + ## Import + + This resource can be imported using an ID made up of the secret name + + ```sh + $ pulumi import github:index/codespacesUserSecret:CodespacesUserSecret test_secret test_secret_name + ``` + + NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. + + :param str resource_name: The name of the resource. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[str] encrypted_value: Encrypted value of the secret using the GitHub public key in Base64 format. + :param pulumi.Input[str] plaintext_value: Plaintext value of the secret to be encrypted + :param pulumi.Input[str] secret_name: Name of the secret + :param pulumi.Input[Sequence[pulumi.Input[int]]] selected_repository_ids: An array of repository ids that can access the user secret. + """ + ... + @overload + def __init__(__self__, + resource_name: str, + args: CodespacesUserSecretArgs, + opts: Optional[pulumi.ResourceOptions] = None): + """ + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + repo = github.get_repository(full_name="my-org/repo") + example_secret_codespaces_user_secret = github.CodespacesUserSecret("exampleSecretCodespacesUserSecret", + secret_name="example_secret_name", + plaintext_value=var["some_secret_string"], + selected_repository_ids=[repo.repo_id]) + example_secret_index_codespaces_user_secret_codespaces_user_secret = github.CodespacesUserSecret("exampleSecretIndex/codespacesUserSecretCodespacesUserSecret", + secret_name="example_secret_name", + encrypted_value=var["some_encrypted_secret_string"], + selected_repository_ids=[repo.repo_id]) + ``` + + ## Import + + This resource can be imported using an ID made up of the secret name + + ```sh + $ pulumi import github:index/codespacesUserSecret:CodespacesUserSecret test_secret test_secret_name + ``` + + NOTEthe implementation is limited in that it won't fetch the value of the `plaintext_value` or `encrypted_value` fields when importing. You may need to ignore changes for these as a workaround. + + :param str resource_name: The name of the resource. + :param CodespacesUserSecretArgs args: The arguments to use to populate this resource's properties. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + ... + def __init__(__self__, resource_name: str, *args, **kwargs): + resource_args, opts = _utilities.get_resource_args_opts(CodespacesUserSecretArgs, pulumi.ResourceOptions, *args, **kwargs) + if resource_args is not None: + __self__._internal_init(resource_name, opts, **resource_args.__dict__) + else: + __self__._internal_init(resource_name, *args, **kwargs) + + def _internal_init(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + secret_name: Optional[pulumi.Input[str]] = None, + selected_repository_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + __props__=None): + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) + if not isinstance(opts, pulumi.ResourceOptions): + raise TypeError('Expected resource options to be a ResourceOptions instance') + if opts.id is None: + if __props__ is not None: + raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') + __props__ = CodespacesUserSecretArgs.__new__(CodespacesUserSecretArgs) + + __props__.__dict__["encrypted_value"] = None if encrypted_value is None else pulumi.Output.secret(encrypted_value) + __props__.__dict__["plaintext_value"] = None if plaintext_value is None else pulumi.Output.secret(plaintext_value) + if secret_name is None and not opts.urn: + raise TypeError("Missing required property 'secret_name'") + __props__.__dict__["secret_name"] = secret_name + __props__.__dict__["selected_repository_ids"] = selected_repository_ids + __props__.__dict__["created_at"] = None + __props__.__dict__["updated_at"] = None + secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["encryptedValue", "plaintextValue"]) + opts = pulumi.ResourceOptions.merge(opts, secret_opts) + super(CodespacesUserSecret, __self__).__init__( + 'github:index/codespacesUserSecret:CodespacesUserSecret', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None, + created_at: Optional[pulumi.Input[str]] = None, + encrypted_value: Optional[pulumi.Input[str]] = None, + plaintext_value: Optional[pulumi.Input[str]] = None, + secret_name: Optional[pulumi.Input[str]] = None, + selected_repository_ids: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None, + updated_at: Optional[pulumi.Input[str]] = None) -> 'CodespacesUserSecret': + """ + Get an existing CodespacesUserSecret resource's state with the given name, id, and optional extra + properties used to qualify the lookup. + + :param str resource_name: The unique name of the resulting resource. + :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[str] created_at: Date of codespaces_secret creation. + :param pulumi.Input[str] encrypted_value: Encrypted value of the secret using the GitHub public key in Base64 format. + :param pulumi.Input[str] plaintext_value: Plaintext value of the secret to be encrypted + :param pulumi.Input[str] secret_name: Name of the secret + :param pulumi.Input[Sequence[pulumi.Input[int]]] selected_repository_ids: An array of repository ids that can access the user secret. + :param pulumi.Input[str] updated_at: Date of codespaces_secret update. + """ + opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) + + __props__ = _CodespacesUserSecretState.__new__(_CodespacesUserSecretState) + + __props__.__dict__["created_at"] = created_at + __props__.__dict__["encrypted_value"] = encrypted_value + __props__.__dict__["plaintext_value"] = plaintext_value + __props__.__dict__["secret_name"] = secret_name + __props__.__dict__["selected_repository_ids"] = selected_repository_ids + __props__.__dict__["updated_at"] = updated_at + return CodespacesUserSecret(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter(name="createdAt") + def created_at(self) -> pulumi.Output[str]: + """ + Date of codespaces_secret creation. + """ + return pulumi.get(self, "created_at") + + @property + @pulumi.getter(name="encryptedValue") + def encrypted_value(self) -> pulumi.Output[Optional[str]]: + """ + Encrypted value of the secret using the GitHub public key in Base64 format. + """ + return pulumi.get(self, "encrypted_value") + + @property + @pulumi.getter(name="plaintextValue") + def plaintext_value(self) -> pulumi.Output[Optional[str]]: + """ + Plaintext value of the secret to be encrypted + """ + return pulumi.get(self, "plaintext_value") + + @property + @pulumi.getter(name="secretName") + def secret_name(self) -> pulumi.Output[str]: + """ + Name of the secret + """ + return pulumi.get(self, "secret_name") + + @property + @pulumi.getter(name="selectedRepositoryIds") + def selected_repository_ids(self) -> pulumi.Output[Optional[Sequence[int]]]: + """ + An array of repository ids that can access the user secret. + """ + return pulumi.get(self, "selected_repository_ids") + + @property + @pulumi.getter(name="updatedAt") + def updated_at(self) -> pulumi.Output[str]: + """ + Date of codespaces_secret update. + """ + return pulumi.get(self, "updated_at") + diff --git a/sdk/python/pulumi_github/get_codespaces_organization_public_key.py b/sdk/python/pulumi_github/get_codespaces_organization_public_key.py new file mode 100644 index 00000000..c1ef718a --- /dev/null +++ b/sdk/python/pulumi_github/get_codespaces_organization_public_key.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# *** 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 copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities + +__all__ = [ + 'GetCodespacesOrganizationPublicKeyResult', + 'AwaitableGetCodespacesOrganizationPublicKeyResult', + 'get_codespaces_organization_public_key', +] + +@pulumi.output_type +class GetCodespacesOrganizationPublicKeyResult: + """ + A collection of values returned by getCodespacesOrganizationPublicKey. + """ + def __init__(__self__, id=None, key=None, key_id=None): + if id and not isinstance(id, str): + raise TypeError("Expected argument 'id' to be a str") + pulumi.set(__self__, "id", id) + if key and not isinstance(key, str): + raise TypeError("Expected argument 'key' to be a str") + pulumi.set(__self__, "key", key) + if key_id and not isinstance(key_id, str): + raise TypeError("Expected argument 'key_id' to be a str") + pulumi.set(__self__, "key_id", key_id) + + @property + @pulumi.getter + def id(self) -> str: + """ + The provider-assigned unique ID for this managed resource. + """ + return pulumi.get(self, "id") + + @property + @pulumi.getter + def key(self) -> str: + """ + Actual key retrieved. + """ + return pulumi.get(self, "key") + + @property + @pulumi.getter(name="keyId") + def key_id(self) -> str: + """ + ID of the key that has been retrieved. + """ + return pulumi.get(self, "key_id") + + +class AwaitableGetCodespacesOrganizationPublicKeyResult(GetCodespacesOrganizationPublicKeyResult): + # pylint: disable=using-constant-test + def __await__(self): + if False: + yield self + return GetCodespacesOrganizationPublicKeyResult( + id=self.id, + key=self.key, + key_id=self.key_id) + + +def get_codespaces_organization_public_key(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCodespacesOrganizationPublicKeyResult: + """ + Use this data source to retrieve information about a GitHub Codespaces Organization public key. This data source is required to be used with other GitHub secrets interactions. + Note that the provider `token` must have admin rights to an organization to retrieve it's Codespaces public key. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_organization_public_key() + ``` + """ + __args__ = dict() + opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) + __ret__ = pulumi.runtime.invoke('github:index/getCodespacesOrganizationPublicKey:getCodespacesOrganizationPublicKey', __args__, opts=opts, typ=GetCodespacesOrganizationPublicKeyResult).value + + return AwaitableGetCodespacesOrganizationPublicKeyResult( + id=__ret__.id, + key=__ret__.key, + key_id=__ret__.key_id) diff --git a/sdk/python/pulumi_github/get_codespaces_organization_secrets.py b/sdk/python/pulumi_github/get_codespaces_organization_secrets.py new file mode 100644 index 00000000..ff033a8b --- /dev/null +++ b/sdk/python/pulumi_github/get_codespaces_organization_secrets.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# *** 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 copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities +from . import outputs + +__all__ = [ + 'GetCodespacesOrganizationSecretsResult', + 'AwaitableGetCodespacesOrganizationSecretsResult', + 'get_codespaces_organization_secrets', +] + +@pulumi.output_type +class GetCodespacesOrganizationSecretsResult: + """ + A collection of values returned by getCodespacesOrganizationSecrets. + """ + def __init__(__self__, id=None, secrets=None): + if id and not isinstance(id, str): + raise TypeError("Expected argument 'id' to be a str") + pulumi.set(__self__, "id", id) + if secrets and not isinstance(secrets, list): + raise TypeError("Expected argument 'secrets' to be a list") + pulumi.set(__self__, "secrets", secrets) + + @property + @pulumi.getter + def id(self) -> str: + """ + The provider-assigned unique ID for this managed resource. + """ + return pulumi.get(self, "id") + + @property + @pulumi.getter + def secrets(self) -> Sequence['outputs.GetCodespacesOrganizationSecretsSecretResult']: + """ + list of secrets for the repository + """ + return pulumi.get(self, "secrets") + + +class AwaitableGetCodespacesOrganizationSecretsResult(GetCodespacesOrganizationSecretsResult): + # pylint: disable=using-constant-test + def __await__(self): + if False: + yield self + return GetCodespacesOrganizationSecretsResult( + id=self.id, + secrets=self.secrets) + + +def get_codespaces_organization_secrets(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCodespacesOrganizationSecretsResult: + """ + Use this data source to retrieve the list of codespaces secrets of the organization. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_organization_secrets() + ``` + """ + __args__ = dict() + opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) + __ret__ = pulumi.runtime.invoke('github:index/getCodespacesOrganizationSecrets:getCodespacesOrganizationSecrets', __args__, opts=opts, typ=GetCodespacesOrganizationSecretsResult).value + + return AwaitableGetCodespacesOrganizationSecretsResult( + id=__ret__.id, + secrets=__ret__.secrets) diff --git a/sdk/python/pulumi_github/get_codespaces_public_key.py b/sdk/python/pulumi_github/get_codespaces_public_key.py new file mode 100644 index 00000000..3b17afc3 --- /dev/null +++ b/sdk/python/pulumi_github/get_codespaces_public_key.py @@ -0,0 +1,129 @@ +# coding=utf-8 +# *** 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 copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities + +__all__ = [ + 'GetCodespacesPublicKeyResult', + 'AwaitableGetCodespacesPublicKeyResult', + 'get_codespaces_public_key', + 'get_codespaces_public_key_output', +] + +@pulumi.output_type +class GetCodespacesPublicKeyResult: + """ + A collection of values returned by getCodespacesPublicKey. + """ + def __init__(__self__, id=None, key=None, key_id=None, repository=None): + if id and not isinstance(id, str): + raise TypeError("Expected argument 'id' to be a str") + pulumi.set(__self__, "id", id) + if key and not isinstance(key, str): + raise TypeError("Expected argument 'key' to be a str") + pulumi.set(__self__, "key", key) + if key_id and not isinstance(key_id, str): + raise TypeError("Expected argument 'key_id' to be a str") + pulumi.set(__self__, "key_id", key_id) + if repository and not isinstance(repository, str): + raise TypeError("Expected argument 'repository' to be a str") + pulumi.set(__self__, "repository", repository) + + @property + @pulumi.getter + def id(self) -> str: + """ + The provider-assigned unique ID for this managed resource. + """ + return pulumi.get(self, "id") + + @property + @pulumi.getter + def key(self) -> str: + """ + Actual key retrieved. + """ + return pulumi.get(self, "key") + + @property + @pulumi.getter(name="keyId") + def key_id(self) -> str: + """ + ID of the key that has been retrieved. + """ + return pulumi.get(self, "key_id") + + @property + @pulumi.getter + def repository(self) -> str: + return pulumi.get(self, "repository") + + +class AwaitableGetCodespacesPublicKeyResult(GetCodespacesPublicKeyResult): + # pylint: disable=using-constant-test + def __await__(self): + if False: + yield self + return GetCodespacesPublicKeyResult( + id=self.id, + key=self.key, + key_id=self.key_id, + repository=self.repository) + + +def get_codespaces_public_key(repository: Optional[str] = None, + opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCodespacesPublicKeyResult: + """ + Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. + Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_public_key(repository="example_repo") + ``` + + + :param str repository: Name of the repository to get public key from. + """ + __args__ = dict() + __args__['repository'] = repository + opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) + __ret__ = pulumi.runtime.invoke('github:index/getCodespacesPublicKey:getCodespacesPublicKey', __args__, opts=opts, typ=GetCodespacesPublicKeyResult).value + + return AwaitableGetCodespacesPublicKeyResult( + id=__ret__.id, + key=__ret__.key, + key_id=__ret__.key_id, + repository=__ret__.repository) + + +@_utilities.lift_output_func(get_codespaces_public_key) +def get_codespaces_public_key_output(repository: Optional[pulumi.Input[str]] = None, + opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetCodespacesPublicKeyResult]: + """ + Use this data source to retrieve information about a GitHub Codespaces public key. This data source is required to be used with other GitHub secrets interactions. + Note that the provider `token` must have admin rights to a repository to retrieve it's Codespaces public key. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_public_key(repository="example_repo") + ``` + + + :param str repository: Name of the repository to get public key from. + """ + ... diff --git a/sdk/python/pulumi_github/get_codespaces_secrets.py b/sdk/python/pulumi_github/get_codespaces_secrets.py new file mode 100644 index 00000000..59dba3c5 --- /dev/null +++ b/sdk/python/pulumi_github/get_codespaces_secrets.py @@ -0,0 +1,135 @@ +# coding=utf-8 +# *** 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 copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities +from . import outputs + +__all__ = [ + 'GetCodespacesSecretsResult', + 'AwaitableGetCodespacesSecretsResult', + 'get_codespaces_secrets', + 'get_codespaces_secrets_output', +] + +@pulumi.output_type +class GetCodespacesSecretsResult: + """ + A collection of values returned by getCodespacesSecrets. + """ + def __init__(__self__, full_name=None, id=None, name=None, secrets=None): + if full_name and not isinstance(full_name, str): + raise TypeError("Expected argument 'full_name' to be a str") + pulumi.set(__self__, "full_name", full_name) + if id and not isinstance(id, str): + raise TypeError("Expected argument 'id' to be a str") + pulumi.set(__self__, "id", id) + if name and not isinstance(name, str): + raise TypeError("Expected argument 'name' to be a str") + pulumi.set(__self__, "name", name) + if secrets and not isinstance(secrets, list): + raise TypeError("Expected argument 'secrets' to be a list") + pulumi.set(__self__, "secrets", secrets) + + @property + @pulumi.getter(name="fullName") + def full_name(self) -> str: + return pulumi.get(self, "full_name") + + @property + @pulumi.getter + def id(self) -> str: + """ + The provider-assigned unique ID for this managed resource. + """ + return pulumi.get(self, "id") + + @property + @pulumi.getter + def name(self) -> str: + """ + Secret name + """ + return pulumi.get(self, "name") + + @property + @pulumi.getter + def secrets(self) -> Sequence['outputs.GetCodespacesSecretsSecretResult']: + """ + list of codespaces secrets for the repository + """ + return pulumi.get(self, "secrets") + + +class AwaitableGetCodespacesSecretsResult(GetCodespacesSecretsResult): + # pylint: disable=using-constant-test + def __await__(self): + if False: + yield self + return GetCodespacesSecretsResult( + full_name=self.full_name, + id=self.id, + name=self.name, + secrets=self.secrets) + + +def get_codespaces_secrets(full_name: Optional[str] = None, + name: Optional[str] = None, + opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCodespacesSecretsResult: + """ + Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_secrets(name="example_repository") + example2 = github.get_codespaces_secrets(full_name="org/example_repository") + ``` + + + :param str full_name: Full name of the repository (in `org/name` format). + :param str name: The name of the repository. + """ + __args__ = dict() + __args__['fullName'] = full_name + __args__['name'] = name + opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) + __ret__ = pulumi.runtime.invoke('github:index/getCodespacesSecrets:getCodespacesSecrets', __args__, opts=opts, typ=GetCodespacesSecretsResult).value + + return AwaitableGetCodespacesSecretsResult( + full_name=__ret__.full_name, + id=__ret__.id, + name=__ret__.name, + secrets=__ret__.secrets) + + +@_utilities.lift_output_func(get_codespaces_secrets) +def get_codespaces_secrets_output(full_name: Optional[pulumi.Input[Optional[str]]] = None, + name: Optional[pulumi.Input[Optional[str]]] = None, + opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetCodespacesSecretsResult]: + """ + Use this data source to retrieve the list of codespaces secrets for a GitHub repository. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_secrets(name="example_repository") + example2 = github.get_codespaces_secrets(full_name="org/example_repository") + ``` + + + :param str full_name: Full name of the repository (in `org/name` format). + :param str name: The name of the repository. + """ + ... diff --git a/sdk/python/pulumi_github/get_codespaces_user_public_key.py b/sdk/python/pulumi_github/get_codespaces_user_public_key.py new file mode 100644 index 00000000..5bd7d1bc --- /dev/null +++ b/sdk/python/pulumi_github/get_codespaces_user_public_key.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# *** 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 copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities + +__all__ = [ + 'GetCodespacesUserPublicKeyResult', + 'AwaitableGetCodespacesUserPublicKeyResult', + 'get_codespaces_user_public_key', +] + +@pulumi.output_type +class GetCodespacesUserPublicKeyResult: + """ + A collection of values returned by getCodespacesUserPublicKey. + """ + def __init__(__self__, id=None, key=None, key_id=None): + if id and not isinstance(id, str): + raise TypeError("Expected argument 'id' to be a str") + pulumi.set(__self__, "id", id) + if key and not isinstance(key, str): + raise TypeError("Expected argument 'key' to be a str") + pulumi.set(__self__, "key", key) + if key_id and not isinstance(key_id, str): + raise TypeError("Expected argument 'key_id' to be a str") + pulumi.set(__self__, "key_id", key_id) + + @property + @pulumi.getter + def id(self) -> str: + """ + The provider-assigned unique ID for this managed resource. + """ + return pulumi.get(self, "id") + + @property + @pulumi.getter + def key(self) -> str: + """ + Actual key retrieved. + """ + return pulumi.get(self, "key") + + @property + @pulumi.getter(name="keyId") + def key_id(self) -> str: + """ + ID of the key that has been retrieved. + """ + return pulumi.get(self, "key_id") + + +class AwaitableGetCodespacesUserPublicKeyResult(GetCodespacesUserPublicKeyResult): + # pylint: disable=using-constant-test + def __await__(self): + if False: + yield self + return GetCodespacesUserPublicKeyResult( + id=self.id, + key=self.key, + key_id=self.key_id) + + +def get_codespaces_user_public_key(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCodespacesUserPublicKeyResult: + """ + Use this data source to retrieve information about a GitHub Codespaces User public key. This data source is required to be used with other GitHub secrets interactions. + Note that the provider `token` must have admin rights to an user to retrieve it's Codespaces public key. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_user_public_key() + ``` + """ + __args__ = dict() + opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) + __ret__ = pulumi.runtime.invoke('github:index/getCodespacesUserPublicKey:getCodespacesUserPublicKey', __args__, opts=opts, typ=GetCodespacesUserPublicKeyResult).value + + return AwaitableGetCodespacesUserPublicKeyResult( + id=__ret__.id, + key=__ret__.key, + key_id=__ret__.key_id) diff --git a/sdk/python/pulumi_github/get_codespaces_user_secrets.py b/sdk/python/pulumi_github/get_codespaces_user_secrets.py new file mode 100644 index 00000000..3352209c --- /dev/null +++ b/sdk/python/pulumi_github/get_codespaces_user_secrets.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# *** 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 copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities +from . import outputs + +__all__ = [ + 'GetCodespacesUserSecretsResult', + 'AwaitableGetCodespacesUserSecretsResult', + 'get_codespaces_user_secrets', +] + +@pulumi.output_type +class GetCodespacesUserSecretsResult: + """ + A collection of values returned by getCodespacesUserSecrets. + """ + def __init__(__self__, id=None, secrets=None): + if id and not isinstance(id, str): + raise TypeError("Expected argument 'id' to be a str") + pulumi.set(__self__, "id", id) + if secrets and not isinstance(secrets, list): + raise TypeError("Expected argument 'secrets' to be a list") + pulumi.set(__self__, "secrets", secrets) + + @property + @pulumi.getter + def id(self) -> str: + """ + The provider-assigned unique ID for this managed resource. + """ + return pulumi.get(self, "id") + + @property + @pulumi.getter + def secrets(self) -> Sequence['outputs.GetCodespacesUserSecretsSecretResult']: + """ + list of secrets for the repository + """ + return pulumi.get(self, "secrets") + + +class AwaitableGetCodespacesUserSecretsResult(GetCodespacesUserSecretsResult): + # pylint: disable=using-constant-test + def __await__(self): + if False: + yield self + return GetCodespacesUserSecretsResult( + id=self.id, + secrets=self.secrets) + + +def get_codespaces_user_secrets(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetCodespacesUserSecretsResult: + """ + Use this data source to retrieve the list of codespaces secrets of the user. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_codespaces_user_secrets() + ``` + """ + __args__ = dict() + opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) + __ret__ = pulumi.runtime.invoke('github:index/getCodespacesUserSecrets:getCodespacesUserSecrets', __args__, opts=opts, typ=GetCodespacesUserSecretsResult).value + + return AwaitableGetCodespacesUserSecretsResult( + id=__ret__.id, + secrets=__ret__.secrets) diff --git a/sdk/python/pulumi_github/get_organization_custom_role.py b/sdk/python/pulumi_github/get_organization_custom_role.py new file mode 100644 index 00000000..71766446 --- /dev/null +++ b/sdk/python/pulumi_github/get_organization_custom_role.py @@ -0,0 +1,144 @@ +# coding=utf-8 +# *** 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 copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities + +__all__ = [ + 'GetOrganizationCustomRoleResult', + 'AwaitableGetOrganizationCustomRoleResult', + 'get_organization_custom_role', + 'get_organization_custom_role_output', +] + +@pulumi.output_type +class GetOrganizationCustomRoleResult: + """ + A collection of values returned by getOrganizationCustomRole. + """ + def __init__(__self__, base_role=None, description=None, id=None, name=None, permissions=None): + if base_role and not isinstance(base_role, str): + raise TypeError("Expected argument 'base_role' to be a str") + pulumi.set(__self__, "base_role", base_role) + if description and not isinstance(description, str): + raise TypeError("Expected argument 'description' to be a str") + pulumi.set(__self__, "description", description) + if id and not isinstance(id, str): + raise TypeError("Expected argument 'id' to be a str") + pulumi.set(__self__, "id", id) + if name and not isinstance(name, str): + raise TypeError("Expected argument 'name' to be a str") + pulumi.set(__self__, "name", name) + if permissions and not isinstance(permissions, list): + raise TypeError("Expected argument 'permissions' to be a list") + pulumi.set(__self__, "permissions", permissions) + + @property + @pulumi.getter(name="baseRole") + def base_role(self) -> str: + """ + The system role from which the role inherits permissions. + """ + return pulumi.get(self, "base_role") + + @property + @pulumi.getter + def description(self) -> str: + """ + The description for the custom role. + """ + return pulumi.get(self, "description") + + @property + @pulumi.getter + def id(self) -> str: + """ + The provider-assigned unique ID for this managed resource. + """ + return pulumi.get(self, "id") + + @property + @pulumi.getter + def name(self) -> str: + return pulumi.get(self, "name") + + @property + @pulumi.getter + def permissions(self) -> Sequence[str]: + """ + A list of additional permissions included in this role. + """ + return pulumi.get(self, "permissions") + + +class AwaitableGetOrganizationCustomRoleResult(GetOrganizationCustomRoleResult): + # pylint: disable=using-constant-test + def __await__(self): + if False: + yield self + return GetOrganizationCustomRoleResult( + base_role=self.base_role, + description=self.description, + id=self.id, + name=self.name, + permissions=self.permissions) + + +def get_organization_custom_role(name: Optional[str] = None, + opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetOrganizationCustomRoleResult: + """ + Use this data source to retrieve information about a custom role in a GitHub Organization. + + > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_organization_custom_role(name="example") + ``` + + + :param str name: The name of the custom role. + """ + __args__ = dict() + __args__['name'] = name + opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts) + __ret__ = pulumi.runtime.invoke('github:index/getOrganizationCustomRole:getOrganizationCustomRole', __args__, opts=opts, typ=GetOrganizationCustomRoleResult).value + + return AwaitableGetOrganizationCustomRoleResult( + base_role=__ret__.base_role, + description=__ret__.description, + id=__ret__.id, + name=__ret__.name, + permissions=__ret__.permissions) + + +@_utilities.lift_output_func(get_organization_custom_role) +def get_organization_custom_role_output(name: Optional[pulumi.Input[str]] = None, + opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetOrganizationCustomRoleResult]: + """ + Use this data source to retrieve information about a custom role in a GitHub Organization. + + > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.get_organization_custom_role(name="example") + ``` + + + :param str name: The name of the custom role. + """ + ... diff --git a/sdk/python/pulumi_github/organization_custom_role.py b/sdk/python/pulumi_github/organization_custom_role.py new file mode 100644 index 00000000..94d977ac --- /dev/null +++ b/sdk/python/pulumi_github/organization_custom_role.py @@ -0,0 +1,372 @@ +# coding=utf-8 +# *** 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 copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from . import _utilities + +__all__ = ['OrganizationCustomRoleArgs', 'OrganizationCustomRole'] + +@pulumi.input_type +class OrganizationCustomRoleArgs: + def __init__(__self__, *, + base_role: pulumi.Input[str], + permissions: pulumi.Input[Sequence[pulumi.Input[str]]], + description: Optional[pulumi.Input[str]] = None, + name: Optional[pulumi.Input[str]] = None): + """ + The set of arguments for constructing a OrganizationCustomRole resource. + :param pulumi.Input[str] base_role: The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + :param pulumi.Input[Sequence[pulumi.Input[str]]] permissions: A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + :param pulumi.Input[str] description: The description for the custom role. + :param pulumi.Input[str] name: The name of the custom role. + """ + pulumi.set(__self__, "base_role", base_role) + pulumi.set(__self__, "permissions", permissions) + if description is not None: + pulumi.set(__self__, "description", description) + if name is not None: + pulumi.set(__self__, "name", name) + + @property + @pulumi.getter(name="baseRole") + def base_role(self) -> pulumi.Input[str]: + """ + The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + """ + return pulumi.get(self, "base_role") + + @base_role.setter + def base_role(self, value: pulumi.Input[str]): + pulumi.set(self, "base_role", value) + + @property + @pulumi.getter + def permissions(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]: + """ + A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + """ + return pulumi.get(self, "permissions") + + @permissions.setter + def permissions(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]): + pulumi.set(self, "permissions", value) + + @property + @pulumi.getter + def description(self) -> Optional[pulumi.Input[str]]: + """ + The description for the custom role. + """ + return pulumi.get(self, "description") + + @description.setter + def description(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "description", value) + + @property + @pulumi.getter + def name(self) -> Optional[pulumi.Input[str]]: + """ + The name of the custom role. + """ + return pulumi.get(self, "name") + + @name.setter + def name(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "name", value) + + +@pulumi.input_type +class _OrganizationCustomRoleState: + def __init__(__self__, *, + base_role: Optional[pulumi.Input[str]] = None, + description: Optional[pulumi.Input[str]] = None, + name: Optional[pulumi.Input[str]] = None, + permissions: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None): + """ + Input properties used for looking up and filtering OrganizationCustomRole resources. + :param pulumi.Input[str] base_role: The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + :param pulumi.Input[str] description: The description for the custom role. + :param pulumi.Input[str] name: The name of the custom role. + :param pulumi.Input[Sequence[pulumi.Input[str]]] permissions: A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + """ + if base_role is not None: + pulumi.set(__self__, "base_role", base_role) + if description is not None: + pulumi.set(__self__, "description", description) + if name is not None: + pulumi.set(__self__, "name", name) + if permissions is not None: + pulumi.set(__self__, "permissions", permissions) + + @property + @pulumi.getter(name="baseRole") + def base_role(self) -> Optional[pulumi.Input[str]]: + """ + The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + """ + return pulumi.get(self, "base_role") + + @base_role.setter + def base_role(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "base_role", value) + + @property + @pulumi.getter + def description(self) -> Optional[pulumi.Input[str]]: + """ + The description for the custom role. + """ + return pulumi.get(self, "description") + + @description.setter + def description(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "description", value) + + @property + @pulumi.getter + def name(self) -> Optional[pulumi.Input[str]]: + """ + The name of the custom role. + """ + return pulumi.get(self, "name") + + @name.setter + def name(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "name", value) + + @property + @pulumi.getter + def permissions(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: + """ + A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + """ + return pulumi.get(self, "permissions") + + @permissions.setter + def permissions(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): + pulumi.set(self, "permissions", value) + + +class OrganizationCustomRole(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + base_role: Optional[pulumi.Input[str]] = None, + description: Optional[pulumi.Input[str]] = None, + name: Optional[pulumi.Input[str]] = None, + permissions: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + __props__=None): + """ + This resource allows you to create and manage custom roles in a GitHub Organization for use in repositories. + + > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.OrganizationCustomRole("example", + base_role="read", + description="Example custom role that uses the read role as its base", + permissions=[ + "add_assignee", + "add_label", + "bypass_branch_protection", + "close_issue", + "close_pull_request", + "mark_as_duplicate", + "create_tag", + "delete_issue", + "delete_tag", + "manage_deploy_keys", + "push_protected_branch", + "read_code_scanning", + "reopen_issue", + "reopen_pull_request", + "request_pr_review", + "resolve_dependabot_alerts", + "resolve_secret_scanning_alerts", + "view_secret_scanning_alerts", + "write_code_scanning", + ]) + ``` + + ## Import + + Custom roles can be imported using the `id` of the role. The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API. + + ```sh + $ pulumi import github:index/organizationCustomRole:OrganizationCustomRole example 1234 + ``` + + :param str resource_name: The name of the resource. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[str] base_role: The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + :param pulumi.Input[str] description: The description for the custom role. + :param pulumi.Input[str] name: The name of the custom role. + :param pulumi.Input[Sequence[pulumi.Input[str]]] permissions: A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + """ + ... + @overload + def __init__(__self__, + resource_name: str, + args: OrganizationCustomRoleArgs, + opts: Optional[pulumi.ResourceOptions] = None): + """ + This resource allows you to create and manage custom roles in a GitHub Organization for use in repositories. + + > Note: Custom roles are currently only available in GitHub Enterprise Cloud. + + ## Example Usage + + ```python + import pulumi + import pulumi_github as github + + example = github.OrganizationCustomRole("example", + base_role="read", + description="Example custom role that uses the read role as its base", + permissions=[ + "add_assignee", + "add_label", + "bypass_branch_protection", + "close_issue", + "close_pull_request", + "mark_as_duplicate", + "create_tag", + "delete_issue", + "delete_tag", + "manage_deploy_keys", + "push_protected_branch", + "read_code_scanning", + "reopen_issue", + "reopen_pull_request", + "request_pr_review", + "resolve_dependabot_alerts", + "resolve_secret_scanning_alerts", + "view_secret_scanning_alerts", + "write_code_scanning", + ]) + ``` + + ## Import + + Custom roles can be imported using the `id` of the role. The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API. + + ```sh + $ pulumi import github:index/organizationCustomRole:OrganizationCustomRole example 1234 + ``` + + :param str resource_name: The name of the resource. + :param OrganizationCustomRoleArgs args: The arguments to use to populate this resource's properties. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + ... + def __init__(__self__, resource_name: str, *args, **kwargs): + resource_args, opts = _utilities.get_resource_args_opts(OrganizationCustomRoleArgs, pulumi.ResourceOptions, *args, **kwargs) + if resource_args is not None: + __self__._internal_init(resource_name, opts, **resource_args.__dict__) + else: + __self__._internal_init(resource_name, *args, **kwargs) + + def _internal_init(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + base_role: Optional[pulumi.Input[str]] = None, + description: Optional[pulumi.Input[str]] = None, + name: Optional[pulumi.Input[str]] = None, + permissions: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + __props__=None): + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) + if not isinstance(opts, pulumi.ResourceOptions): + raise TypeError('Expected resource options to be a ResourceOptions instance') + if opts.id is None: + if __props__ is not None: + raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') + __props__ = OrganizationCustomRoleArgs.__new__(OrganizationCustomRoleArgs) + + if base_role is None and not opts.urn: + raise TypeError("Missing required property 'base_role'") + __props__.__dict__["base_role"] = base_role + __props__.__dict__["description"] = description + __props__.__dict__["name"] = name + if permissions is None and not opts.urn: + raise TypeError("Missing required property 'permissions'") + __props__.__dict__["permissions"] = permissions + super(OrganizationCustomRole, __self__).__init__( + 'github:index/organizationCustomRole:OrganizationCustomRole', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None, + base_role: Optional[pulumi.Input[str]] = None, + description: Optional[pulumi.Input[str]] = None, + name: Optional[pulumi.Input[str]] = None, + permissions: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None) -> 'OrganizationCustomRole': + """ + Get an existing OrganizationCustomRole resource's state with the given name, id, and optional extra + properties used to qualify the lookup. + + :param str resource_name: The unique name of the resulting resource. + :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. + :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[str] base_role: The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + :param pulumi.Input[str] description: The description for the custom role. + :param pulumi.Input[str] name: The name of the custom role. + :param pulumi.Input[Sequence[pulumi.Input[str]]] permissions: A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + """ + opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) + + __props__ = _OrganizationCustomRoleState.__new__(_OrganizationCustomRoleState) + + __props__.__dict__["base_role"] = base_role + __props__.__dict__["description"] = description + __props__.__dict__["name"] = name + __props__.__dict__["permissions"] = permissions + return OrganizationCustomRole(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter(name="baseRole") + def base_role(self) -> pulumi.Output[str]: + """ + The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. + """ + return pulumi.get(self, "base_role") + + @property + @pulumi.getter + def description(self) -> pulumi.Output[Optional[str]]: + """ + The description for the custom role. + """ + return pulumi.get(self, "description") + + @property + @pulumi.getter + def name(self) -> pulumi.Output[str]: + """ + The name of the custom role. + """ + return pulumi.get(self, "name") + + @property + @pulumi.getter + def permissions(self) -> pulumi.Output[Sequence[str]]: + """ + A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. + """ + return pulumi.get(self, "permissions") + diff --git a/sdk/python/pulumi_github/outputs.py b/sdk/python/pulumi_github/outputs.py index d1bc0e7a..fa623742 100644 --- a/sdk/python/pulumi_github/outputs.py +++ b/sdk/python/pulumi_github/outputs.py @@ -43,6 +43,9 @@ 'GetActionsSecretsSecretResult', 'GetActionsVariablesVariableResult', 'GetBranchProtectionRulesRuleResult', + 'GetCodespacesOrganizationSecretsSecretResult', + 'GetCodespacesSecretsSecretResult', + 'GetCodespacesUserSecretsSecretResult', 'GetCollaboratorsCollaboratorResult', 'GetDependabotOrganizationSecretsSecretResult', 'GetDependabotSecretsSecretResult', @@ -1728,6 +1731,148 @@ def pattern(self) -> str: return pulumi.get(self, "pattern") +@pulumi.output_type +class GetCodespacesOrganizationSecretsSecretResult(dict): + def __init__(__self__, *, + created_at: str, + name: str, + updated_at: str, + visibility: str): + """ + :param str created_at: Timestamp of the secret creation + :param str name: Secret name + :param str updated_at: Timestamp of the secret last update + :param str visibility: Secret visibility + """ + pulumi.set(__self__, "created_at", created_at) + pulumi.set(__self__, "name", name) + pulumi.set(__self__, "updated_at", updated_at) + pulumi.set(__self__, "visibility", visibility) + + @property + @pulumi.getter(name="createdAt") + def created_at(self) -> str: + """ + Timestamp of the secret creation + """ + return pulumi.get(self, "created_at") + + @property + @pulumi.getter + def name(self) -> str: + """ + Secret name + """ + return pulumi.get(self, "name") + + @property + @pulumi.getter(name="updatedAt") + def updated_at(self) -> str: + """ + Timestamp of the secret last update + """ + return pulumi.get(self, "updated_at") + + @property + @pulumi.getter + def visibility(self) -> str: + """ + Secret visibility + """ + return pulumi.get(self, "visibility") + + +@pulumi.output_type +class GetCodespacesSecretsSecretResult(dict): + def __init__(__self__, *, + created_at: str, + name: str, + updated_at: str): + """ + :param str created_at: Timestamp of the secret creation + :param str name: The name of the repository. + :param str updated_at: Timestamp of the secret last update + """ + pulumi.set(__self__, "created_at", created_at) + pulumi.set(__self__, "name", name) + pulumi.set(__self__, "updated_at", updated_at) + + @property + @pulumi.getter(name="createdAt") + def created_at(self) -> str: + """ + Timestamp of the secret creation + """ + return pulumi.get(self, "created_at") + + @property + @pulumi.getter + def name(self) -> str: + """ + The name of the repository. + """ + return pulumi.get(self, "name") + + @property + @pulumi.getter(name="updatedAt") + def updated_at(self) -> str: + """ + Timestamp of the secret last update + """ + return pulumi.get(self, "updated_at") + + +@pulumi.output_type +class GetCodespacesUserSecretsSecretResult(dict): + def __init__(__self__, *, + created_at: str, + name: str, + updated_at: str, + visibility: str): + """ + :param str created_at: Timestamp of the secret creation + :param str name: Secret name + :param str updated_at: Timestamp of the secret last update + :param str visibility: Secret visibility + """ + pulumi.set(__self__, "created_at", created_at) + pulumi.set(__self__, "name", name) + pulumi.set(__self__, "updated_at", updated_at) + pulumi.set(__self__, "visibility", visibility) + + @property + @pulumi.getter(name="createdAt") + def created_at(self) -> str: + """ + Timestamp of the secret creation + """ + return pulumi.get(self, "created_at") + + @property + @pulumi.getter + def name(self) -> str: + """ + Secret name + """ + return pulumi.get(self, "name") + + @property + @pulumi.getter(name="updatedAt") + def updated_at(self) -> str: + """ + Timestamp of the secret last update + """ + return pulumi.get(self, "updated_at") + + @property + @pulumi.getter + def visibility(self) -> str: + """ + Secret visibility + """ + return pulumi.get(self, "visibility") + + @pulumi.output_type class GetCollaboratorsCollaboratorResult(dict): def __init__(__self__, *,