// Copyright 2023 The go-github AUTHORS. All rights reserved.//// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package githubimport ()// ActionsEnabledOnEnterpriseRepos represents all the repositories in an enterprise for which Actions is enabled.typeActionsEnabledOnEnterpriseReposstruct { TotalCount int`json:"total_count"` Organizations []*Organization`json:"organizations"`}// ActionsPermissionsEnterprise represents a policy for allowed actions in an enterprise.//// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissionstypeActionsPermissionsEnterprisestruct { EnabledOrganizations *string`json:"enabled_organizations,omitempty"` AllowedActions *string`json:"allowed_actions,omitempty"` SelectedActionsURL *string`json:"selected_actions_url,omitempty"`}func ( ActionsPermissionsEnterprise) () string {returnStringify()}// DefaultWorkflowPermissionEnterprise represents the default permissions for GitHub Actions workflows for an enterprise.//// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissionstypeDefaultWorkflowPermissionEnterprisestruct { DefaultWorkflowPermissions *string`json:"default_workflow_permissions,omitempty"` CanApprovePullRequestReviews *bool`json:"can_approve_pull_request_reviews,omitempty"`}// GetActionsPermissionsInEnterprise gets the GitHub Actions permissions policy for an enterprise.//// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-github-actions-permissions-for-an-enterprise////meta:operation GET /enterprises/{enterprise}/actions/permissionsfunc ( *ActionsService) ( context.Context, string) (*ActionsPermissionsEnterprise, *Response, error) { := fmt.Sprintf("enterprises/%v/actions/permissions", ) , := .client.NewRequest("GET", , nil)if != nil {returnnil, nil, } := new(ActionsPermissionsEnterprise) , := .client.Do(, , )if != nil {returnnil, , }return , , nil}// EditActionsPermissionsInEnterprise sets the permissions policy in an enterprise.//// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-github-actions-permissions-for-an-enterprise////meta:operation PUT /enterprises/{enterprise}/actions/permissionsfunc ( *ActionsService) ( context.Context, string, ActionsPermissionsEnterprise) (*ActionsPermissionsEnterprise, *Response, error) { := fmt.Sprintf("enterprises/%v/actions/permissions", ) , := .client.NewRequest("PUT", , )if != nil {returnnil, nil, } := new(ActionsPermissionsEnterprise) , := .client.Do(, , )if != nil {returnnil, , }return , , nil}// ListEnabledOrgsInEnterprise lists the selected organizations that are enabled for GitHub Actions in an enterprise.//// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise////meta:operation GET /enterprises/{enterprise}/actions/permissions/organizationsfunc ( *ActionsService) ( context.Context, string, *ListOptions) (*ActionsEnabledOnEnterpriseRepos, *Response, error) { := fmt.Sprintf("enterprises/%v/actions/permissions/organizations", ) , := addOptions(, )if != nil {returnnil, nil, } , := .client.NewRequest("GET", , nil)if != nil {returnnil, nil, } := &ActionsEnabledOnEnterpriseRepos{} , := .client.Do(, , )if != nil {returnnil, , }return , , nil}// SetEnabledOrgsInEnterprise replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise.//// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise////meta:operation PUT /enterprises/{enterprise}/actions/permissions/organizationsfunc ( *ActionsService) ( context.Context, string, []int64) (*Response, error) { := fmt.Sprintf("enterprises/%v/actions/permissions/organizations", ) , := .client.NewRequest("PUT", , struct { []int64`json:"selected_organization_ids"` }{: })if != nil {returnnil, } , := .client.Do(, , nil)if != nil {return , }return , nil}// AddEnabledOrgInEnterprise adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise.//// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise////meta:operation PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}func ( *ActionsService) ( context.Context, string, int64) (*Response, error) { := fmt.Sprintf("enterprises/%v/actions/permissions/organizations/%v", , ) , := .client.NewRequest("PUT", , nil)if != nil {returnnil, } , := .client.Do(, , nil)if != nil {return , }return , nil}// RemoveEnabledOrgInEnterprise removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise.//// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise////meta:operation DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}func ( *ActionsService) ( context.Context, string, int64) (*Response, error) { := fmt.Sprintf("enterprises/%v/actions/permissions/organizations/%v", , ) , := .client.NewRequest("DELETE", , nil)if != nil {returnnil, } , := .client.Do(, , nil)if != nil {return , }return , nil}// GetActionsAllowedInEnterprise gets the actions that are allowed in an enterprise.//// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise////meta:operation GET /enterprises/{enterprise}/actions/permissions/selected-actionsfunc ( *ActionsService) ( context.Context, string) (*ActionsAllowed, *Response, error) { := fmt.Sprintf("enterprises/%v/actions/permissions/selected-actions", ) , := .client.NewRequest("GET", , nil)if != nil {returnnil, nil, } := new(ActionsAllowed) , := .client.Do(, , )if != nil {returnnil, , }return , , nil}// EditActionsAllowedInEnterprise sets the actions that are allowed in an enterprise.//// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise////meta:operation PUT /enterprises/{enterprise}/actions/permissions/selected-actionsfunc ( *ActionsService) ( context.Context, string, ActionsAllowed) (*ActionsAllowed, *Response, error) { := fmt.Sprintf("enterprises/%v/actions/permissions/selected-actions", ) , := .client.NewRequest("PUT", , )if != nil {returnnil, nil, } := new(ActionsAllowed) , := .client.Do(, , )if != nil {returnnil, , }return , , nil}// GetDefaultWorkflowPermissionsInEnterprise gets the GitHub Actions default workflow permissions for an enterprise.//// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise////meta:operation GET /enterprises/{enterprise}/actions/permissions/workflowfunc ( *ActionsService) ( context.Context, string) (*DefaultWorkflowPermissionEnterprise, *Response, error) { := fmt.Sprintf("enterprises/%v/actions/permissions/workflow", ) , := .client.NewRequest("GET", , nil)if != nil {returnnil, nil, } := new(DefaultWorkflowPermissionEnterprise) , := .client.Do(, , )if != nil {returnnil, , }return , , nil}// EditDefaultWorkflowPermissionsInEnterprise sets the GitHub Actions default workflow permissions for an enterprise.//// GitHub API docs: https://docs.github.com/enterprise-cloud@latest/rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise////meta:operation PUT /enterprises/{enterprise}/actions/permissions/workflowfunc ( *ActionsService) ( context.Context, string, DefaultWorkflowPermissionEnterprise) (*DefaultWorkflowPermissionEnterprise, *Response, error) { := fmt.Sprintf("enterprises/%v/actions/permissions/workflow", ) , := .client.NewRequest("PUT", , )if != nil {returnnil, nil, } := new(DefaultWorkflowPermissionEnterprise) , := .client.Do(, , )if != nil {returnnil, , }return , , nil}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.