Organization
- class github.Organization.Organization
This class represents Organizations.
The reference can be found here https://docs.github.com/en/rest/reference/orgs
The OpenAPI schema can be found at
/components/schemas/actor
/components/schemas/nullable-organization-simple
/components/schemas/nullable-simple-user
/components/schemas/organization-full
/components/schemas/organization-simple
/components/schemas/team-organization
A CompletableGithubObject can be partially initialised (completed=False). Accessing attributes that are not initialized will then trigger a request to complete all attributes.
A partially initialized CompletableGithubObject (completed=False) can be completed via
complete(). This requires the url to be given via parameterurlorattributes.With a requester where
Requester.is_lazy == True, this CompletableGithubObjects is partially initialized. This requires the url to be given via parameterurlorattributes. Any CompletableGithubObject created from this lazy object will be lazy itself if created with parameterurlorattributes.- Parameters:
requester – requester
headers – response headers
attributes – attributes to initialize
completed – do not update non-initialized attributes when True
url – url of this instance, overrides attributes[‘url’]
accept – use this accept header when completing this instance
- create_fork(repo: Repository, name: Opt[str] = NotSet, default_branch_only: Opt[bool] = NotSet) Repository
- create_repo_from_template(name: str, repo: Repository, description: Opt[str] = NotSet, include_all_branches: Opt[bool] = NotSet, private: Opt[bool] = NotSet) Repository
self.name :calls: POST /repos/{template_owner}/{template_repo}/generate
- create_hook(name: str, config: dict[str, str], events: Opt[list[str]] = NotSet, active: Opt[bool] = NotSet) Hook
- Calls:
- Parameters:
name – string
config – dict
events – list of string
active – bool
- Return type:
- create_repo(name: str, description: str | _NotSetType = NotSet, homepage: str | _NotSetType = NotSet, private: bool | _NotSetType = NotSet, visibility: str | _NotSetType = NotSet, has_issues: bool | _NotSetType = NotSet, has_wiki: bool | _NotSetType = NotSet, has_downloads: bool | _NotSetType = NotSet, has_projects: bool | _NotSetType = NotSet, team_id: int | _NotSetType = NotSet, auto_init: bool | _NotSetType = NotSet, license_template: str | _NotSetType = NotSet, gitignore_template: str | _NotSetType = NotSet, allow_squash_merge: bool | _NotSetType = NotSet, allow_merge_commit: bool | _NotSetType = NotSet, allow_rebase_merge: bool | _NotSetType = NotSet, delete_branch_on_merge: bool | _NotSetType = NotSet, allow_update_branch: bool | _NotSetType = NotSet, is_template: bool | _NotSetType = NotSet, allow_auto_merge: bool | _NotSetType = NotSet, use_squash_pr_title_as_default: bool | _NotSetType = NotSet, squash_merge_commit_title: str | _NotSetType = NotSet, squash_merge_commit_message: str | _NotSetType = NotSet, merge_commit_title: str | _NotSetType = NotSet, merge_commit_message: str | _NotSetType = NotSet, custom_properties: dict[str, Any] | _NotSetType = NotSet) Repository
- Calls:
- create_secret(secret_name: str, unencrypted_value: str, visibility: str = 'all', selected_repositories: list[Repository] | _NotSetType = NotSet, secret_type: str = 'actions') OrganizationSecret
- Parameters:
secret_name – string name of the secret
unencrypted_value – string plain text value of the secret
visibility – string options all or selected
selected_repositories – list of repositrories that the secret will be available in
secret_type – string options actions or dependabot
- Calls:
- Calls:
- get_secrets(secret_type: str = 'actions') PaginatedList[OrganizationSecret]
Gets all organization secrets :param secret_type: string options actions or dependabot :rtype:
- Calls:
`GET /orgs/{org}/actions/secrets <https://docs.github.com/rest/actions/secrets#list-organization-
secrets>`_ :calls: GET /orgs/{org}/dependabot/secrets
- get_secret(secret_name: str, secret_type: str = 'actions') OrganizationSecret
- Calls:
- Calls:
- Parameters:
secret_name – string
secret_type – string options actions or dependabot
- Return type:
- create_team(name: str, repo_names: Opt[list[Repository]] = NotSet, permission: Opt[str] = NotSet, privacy: Opt[str] = NotSet, description: Opt[str] = NotSet, parent_team_id: Opt[int] = NotSet, maintainers: Opt[list[str]] = NotSet, notification_setting: Opt[str] = NotSet) Team
- Calls:
- Parameters:
name – string
repo_names – list of
github.Repository.Repositorypermission – string
privacy – string
description – string
parent_team_id – integer
maintainers – list of: integer
notification_setting – string
- Return type:
- create_variable(variable_name: str, value: str, visibility: str = 'all', selected_repositories: list[Repository] | _NotSetType = NotSet) OrganizationVariable
- Calls:
- Parameters:
variable_name – string
value – string
visibility – string
selected_repositories – list of
github.Repository.Repository
- Return type:
- get_variables() PaginatedList[OrganizationVariable]
Gets all organization variables :rtype:
PaginatedListofgithub.OrganizationVariable.OrganizationVariable
- get_variable(variable_name: str) OrganizationVariable
- Calls:
- Parameters:
variable_name – string
- Return type:
- delete_hook(id: int) None
- Calls:
- Parameters:
id – integer
- Return type:
None`
- edit(billing_email: str | _NotSetType = NotSet, blog: str | _NotSetType = NotSet, company: str | _NotSetType = NotSet, description: str | _NotSetType = NotSet, email: str | _NotSetType = NotSet, location: str | _NotSetType = NotSet, name: str | _NotSetType = NotSet) None
- Calls:
- edit_hook(id: int, name: str, config: dict[str, str], events: Opt[list[str]] = NotSet, active: Opt[bool] = NotSet) Hook
- get_events() PaginatedList[Event]
- Calls:
- Return type:
PaginatedListofgithub.Event.Event
- get_hooks() PaginatedList[Hook]
- Calls:
- get_hook_delivery(hook_id: int, delivery_id: int) HookDelivery
- Calls:
- Parameters:
hook_id – integer
delivery_id – integer
- Return type:
- get_hook_deliveries(hook_id: int) PaginatedList[HookDeliverySummary]
- Calls:
- Parameters:
hook_id – integer
- Return type:
PaginatedListofgithub.HookDelivery.HookDeliverySummary
- get_issues(filter: Opt[str] = NotSet, state: Opt[str] = NotSet, labels: Opt[list[Label]] = NotSet, sort: Opt[str] = NotSet, direction: Opt[str] = NotSet, since: Opt[datetime] = NotSet) PaginatedList[Issue]
- Calls:
- Return type:
PaginatedListofgithub.Issue.Issue- Parameters:
filter – string
state – string
labels – list of
github.Label.Labelsort – string
direction – string
since – datetime
- Return type:
PaginatedListofgithub.Issue.Issue
- get_members(filter_: Opt[str] = NotSet, role: Opt[str] = NotSet) PaginatedList[NamedUser]
- Calls:
- get_projects(state: Opt[str] = NotSet) PaginatedList[Project]
- Calls:
- get_public_members() PaginatedList[NamedUser]
- Calls:
- Return type:
PaginatedListofgithub.NamedUser.NamedUser
- get_outside_collaborators(filter_: Opt[str] = NotSet) PaginatedList[NamedUser]
- remove_outside_collaborator(collaborator: NamedUser) None
- Calls:
- Parameters:
collaborator –
github.NamedUser.NamedUser- Return type:
None
- convert_to_outside_collaborator(member: NamedUser) None
- Calls:
- Parameters:
member –
github.NamedUser.NamedUser- Return type:
None
- get_public_key(secret_type: str = 'actions') PublicKey
- Calls:
- Calls:
- Parameters:
secret_type – string options actions or dependabot
- Return type:
- get_copilot() Copilot
Provides various Copilot-related endpoints for this organization.
- Return type:
- get_repo(name: str) Repository
- Calls:
- Parameters:
name – string
- Return type:
- get_repos(type: Opt[str] = NotSet, sort: Opt[str] = NotSet, direction: Opt[str] = NotSet) PaginatedList[Repository]
- Calls:
- Parameters:
type – string (‘all’, ‘public’, ‘private’, ‘forks’, ‘sources’, ‘member’)
sort – string (‘created’, ‘updated’, ‘pushed’, ‘full_name’)
direction – string (‘asc’, desc’)
- get_teams() PaginatedList[Team]
- Calls:
- invitations() PaginatedList[OrganizationInvitation]
- Calls:
- invite_user(user: Opt[NamedUser] = NotSet, email: Opt[str] = NotSet, role: Opt[str] = NotSet, teams: Opt[list[Team]] = NotSet) None
- Calls:
- Parameters:
user –
github.NamedUser.NamedUseremail – string
role – string
teams – array of
github.Team.Team
- Return type:
None
- cancel_invitation(invitee: NamedUser) bool
- Calls:
- Parameters:
invitee –
github.NamedUser.NamedUser- Return type:
bool
- has_in_members(member: NamedUser) bool
- Calls:
- Parameters:
member –
github.NamedUser.NamedUser- Return type:
bool
- has_in_public_members(public_member: NamedUser) bool
- Calls:
- Parameters:
public_member –
github.NamedUser.NamedUser- Return type:
bool
- remove_from_membership(member: NamedUser) None
- Calls:
- Parameters:
member –
github.NamedUser.NamedUser- Return type:
None
- remove_from_members(member: NamedUser) None
- Calls:
- Parameters:
member –
github.NamedUser.NamedUser- Return type:
None
- remove_from_public_members(public_member: NamedUser) None
- Calls:
- Parameters:
public_member –
github.NamedUser.NamedUser- Return type:
None
- create_migration(repos: list[str], lock_repositories: Opt[bool] = NotSet, exclude_attachments: Opt[bool] = NotSet) Migration
- Calls:
- Parameters:
repos – list or tuple of str
lock_repositories – bool
exclude_attachments – bool
- Return type:
- get_migrations() PaginatedList[Migration]
- Calls:
- Return type:
PaginatedListofgithub.Migration.Migration
- get_installations() PaginatedList[Installation]
- Calls:
- Return type:
PaginatedListofgithub.Installation.Installation
- get_dependabot_alerts(state: Opt[str] = NotSet, severity: Opt[str] = NotSet, ecosystem: Opt[str] = NotSet, package: Opt[str] = NotSet, scope: Opt[str] = NotSet, sort: Opt[str] = NotSet, direction: Opt[str] = NotSet) PaginatedList[OrganizationDependabotAlert]
- Calls:
- Parameters:
state – Optional string
severity – Optional string
ecosystem – Optional string
package – Optional string
scope – Optional string
sort – Optional string
direction – Optional string
- Return type:
PaginatedListofgithub.DependabotAlert.DependabotAlert
- get_codescan_alerts(tool_name: Opt[str] = NotSet, tool_guid: Opt[str] = NotSet, ref: Opt[str] = NotSet, pr: Opt[int] = NotSet, sort: Opt[str] = NotSet, direction: Opt[str] = NotSet, state: Opt[str] = NotSet, severity: Opt[str] = NotSet) PaginatedList[OrganizationCodeScanAlert]
- Calls:
- Parameters:
tool_name – Optional string
tool_guid – Optional string
ref – Optional string
pr – Optional integer
sort – Optional string
direction – Optional string
state – Optional string
severity – Optional string
- Return type:
PaginatedListofgithub.CodeScanAlert.CodeScanAlert
- get_secret_scanning_alerts(state: Opt[str] = NotSet, secret_type: Opt[str] = NotSet, resolution: Opt[str] = NotSet, sort: Opt[str] = NotSet, direction: Opt[str] = NotSet, validity: Opt[str] = NotSet, is_publicly_leaked: Opt[bool] = NotSet, is_multi_repo: Opt[bool] = NotSet, hide_secret: Opt[bool] = NotSet) PaginatedList[OrganizationSecretScanAlert]
- Calls:
- Parameters:
state – Optional string
secret_type – Optional string
resolution – Optional string
sort – Optional string
direction – Optional string
validity – Optional string
is_publicly_leaked – Optional bool
is_multi_repo – Optional bool
hide_secret – Optional bool
- Return type:
PaginatedListofgithub.SecretScanAlert.SecretScanAlert
- get_custom_properties() PaginatedList[OrganizationCustomProperty]
- Calls:
- Return type:
PaginatedListofgithub.OrganizationCustomProperty.OrganizationCustomProperty
- get_custom_property(property_name: str) OrganizationCustomProperty
- Calls:
- Parameters:
property_name – string
- Return type:
github.OrganizationCustomProperty.OrganizationCustomProperty
- create_custom_properties(properties: list[CustomProperty]) list[OrganizationCustomProperty]
Create or update custom properties for an organization :calls: PATCH /orgs/{org}/properties/schema :param properties: list of
github.OrganizationCustomProperty.CustomProperty:rtype: list ofgithub.OrganizationCustomProperty.OrganizationCustomProperty
- create_custom_property(property: CustomProperty) OrganizationCustomProperty
Create or update a custom property for an organization :calls: PUT /orgs/{org}/properties/schema/{custom_property_name} :param property:
github.OrganizationCustomProperty.CustomProperty:rtype:github.OrganizationCustomProperty.OrganizationCustomProperty
- remove_custom_property(property_name: str) None
- Calls:
- Parameters:
property_name – string
- Return type:
None
- list_custom_property_values(repository_query: Opt[str] = NotSet) PaginatedList[RepositoryCustomPropertyValues]
- Calls:
- Return type:
PaginatedListof dict
- create_custom_property_values(repository_names: list[str], properties: dict[str, str | list | None]) None
Create or update custom property values for organization repositories :calls: PATCH /orgs/{org}/properties/values :param repository_names: list of strings :param properties: dict of string to string, list or None :rtype: None
- get_code_security_configs(target_type: Opt[str] = NotSet) PaginatedList[CodeSecurityConfig]
- Calls:
- Return type:
CodeSecurityConfig
- create_code_security_config(name: str, description: str, advanced_security: Opt[str] = NotSet, dependency_graph: Opt[str] = NotSet, dependency_graph_autosubmit_action: Opt[str] = NotSet, dependabot_alerts: Opt[str] = NotSet, dependabot_security_updates: Opt[str] = NotSet, code_scanning_default_setup: Opt[str] = NotSet, secret_scanning: Opt[str] = NotSet, secret_scanning_push_protection: Opt[str] = NotSet, secret_scanning_delegated_bypass: Opt[str] = NotSet, secret_scanning_validity_checks: Opt[str] = NotSet, secret_scanning_non_provider_patterns: Opt[str] = NotSet, private_vulnerability_reporting: Opt[str] = NotSet, enforcement: Opt[str] = NotSet) CodeSecurityConfig
- Calls:
- Return type:
PaginatedListof dict
- edit_code_security_config(id: int, name: Opt[str] = NotSet, description: Opt[str] = NotSet, advanced_security: Opt[str] = NotSet, dependency_graph: Opt[str] = NotSet, dependency_graph_autosubmit_action: Opt[str] = NotSet, dependabot_alerts: Opt[str] = NotSet, dependabot_security_updates: Opt[str] = NotSet, code_scanning_default_setup: Opt[str] = NotSet, secret_scanning: Opt[str] = NotSet, secret_scanning_push_protection: Opt[str] = NotSet, secret_scanning_delegated_bypass: Opt[str] = NotSet, secret_scanning_validity_checks: Opt[str] = NotSet, secret_scanning_non_provider_patterns: Opt[str] = NotSet, private_vulnerability_reporting: Opt[str] = NotSet, enforcement: Opt[str] = NotSet) CodeSecurityConfig
- delete_code_security_config(id: int) None
- Calls:
DELETE /orgs/{org}/code-security/configurations/{configuration_id}
- Parameters:
id – integer
- Return type:
None`
- get_code_security_config(id: int) CodeSecurityConfig
- Calls:
GET /orgs/{org}/code-security/configurations/{configuration_id}
- Parameters:
id – configuration_id
- Return type:
- set_default_code_security_config(id: int, default_for_new_repos: str | _NotSetType = NotSet) None
- get_default_code_security_configs() PaginatedList[DefaultCodeSecurityConfig]
- attach_security_config_to_repositories(id: int, scope: str, selected_repository_ids: list[int] | _NotSetType = NotSet) None
- detach_security_config_from_repositories(selected_repository_ids: list[int]) None
- get_repos_for_code_security_config(id: int, status: Opt[str] = NotSet) PaginatedList[CodeSecurityConfigRepository]
- get_self_hosted_runners(name: Opt[str] = NotSet) PaginatedList[SelfHostedActionsRunner]
- get_self_hosted_runner_applications() PaginatedList[SelfHostedActionsRunnerApplication]
- create_self_hosted_runner_jitconfig(name: str, runner_group_id: int, labels: list[str], work_folder: Opt[str] = NotSet) SelfHostedActionsRunnerJitConfig
- create_self_hosted_runner_registration_token() SelfHostedActionsRunnerToken
- create_self_hosted_runner_remove_token() SelfHostedActionsRunnerToken
- get_self_hosted_runner(runner_id: int) SelfHostedActionsRunner
- delete_self_hosted_runner(runner_id: int) None