Skip to main content

enterprise_team_organizations

Creates, updates, deletes, gets or lists an enterprise_team_organizations resource.

Overview

Nameenterprise_team_organizations
TypeResource
Idgithub.enterprise_team_organizations.enterprise_team_organizations

Fields

The following fields are returned by SELECT queries:

The team is assigned to the organization

NameDatatypeDescription
idinteger
node_idstring (example: MDEyOk9yZ2FuaXphdGlvbjE=)
avatar_urlstring (example: https://github.com/images/error/octocat_happy.gif)
descriptionstring (example: A great organization)
events_urlstring (uri) (example: https://api.github.com/orgs/github/events)
hooks_urlstring (example: https://api.github.com/orgs/github/hooks)
issues_urlstring (example: https://api.github.com/orgs/github/issues)
loginstring (example: github)
members_urlstring (example: https://api.github.com/orgs/github/members{/member})
public_members_urlstring (example: https://api.github.com/orgs/github/public_members{/member})
repos_urlstring (uri) (example: https://api.github.com/orgs/github/repos)
urlstring (uri) (example: https://api.github.com/orgs/github)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_assignmentselectenterprise, enterprise-team, orgCheck if an enterprise team is assigned to an organization
get_assignmentsselectenterprise, enterprise-teamper_page, pageGet all organizations assigned to an enterprise team
addreplaceenterprise, enterprise-team, orgAssign an enterprise team to an organization.
deletedeleteenterprise, enterprise-team, orgUnassign an enterprise team from an organization.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
enterprisestringThe slug version of the enterprise name.
enterprise-teamstringThe slug version of the enterprise team name. You can also substitute this value with the enterprise team id.
orgstringThe organization name. The name is not case sensitive.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

Check if an enterprise team is assigned to an organization

SELECT
id,
node_id,
avatar_url,
description,
events_url,
hooks_url,
issues_url,
login,
members_url,
public_members_url,
repos_url,
url
FROM github.enterprise_team_organizations.enterprise_team_organizations
WHERE enterprise = '{{ enterprise }}' -- required
AND enterprise-team = '{{ enterprise-team }}' -- required
AND org = '{{ org }}' -- required
;

REPLACE examples

Assign an enterprise team to an organization.

REPLACE github.enterprise_team_organizations.enterprise_team_organizations
SET
-- No updatable properties
WHERE
enterprise = '{{ enterprise }}' --required
AND enterprise-team = '{{ enterprise-team }}' --required
AND org = '{{ org }}' --required
RETURNING
id,
node_id,
avatar_url,
description,
events_url,
hooks_url,
issues_url,
login,
members_url,
public_members_url,
repos_url,
url;

DELETE examples

Unassign an enterprise team from an organization.

DELETE FROM github.enterprise_team_organizations.enterprise_team_organizations
WHERE enterprise = '{{ enterprise }}' --required
AND enterprise-team = '{{ enterprise-team }}' --required
AND org = '{{ org }}' --required
;