enterprise_team_organizations
Creates, updates, deletes, gets or lists an enterprise_team_organizations resource.
Overview
| Name | enterprise_team_organizations |
| Type | Resource |
| Id | github.enterprise_team_organizations.enterprise_team_organizations |
Fields
The following fields are returned by SELECT queries:
- get_assignment
- get_assignments
The team is assigned to the organization
| Name | Datatype | Description |
|---|---|---|
id | integer | |
node_id | string | (example: MDEyOk9yZ2FuaXphdGlvbjE=) |
avatar_url | string | (example: https://github.com/images/error/octocat_happy.gif) |
description | string | (example: A great organization) |
events_url | string (uri) | (example: https://api.github.com/orgs/github/events) |
hooks_url | string | (example: https://api.github.com/orgs/github/hooks) |
issues_url | string | (example: https://api.github.com/orgs/github/issues) |
login | string | (example: github) |
members_url | string | (example: https://api.github.com/orgs/github/members{/member}) |
public_members_url | string | (example: https://api.github.com/orgs/github/public_members{/member}) |
repos_url | string (uri) | (example: https://api.github.com/orgs/github/repos) |
url | string (uri) | (example: https://api.github.com/orgs/github) |
An array of organizations the team is assigned to
| Name | Datatype | Description |
|---|---|---|
id | integer | |
node_id | string | (example: MDEyOk9yZ2FuaXphdGlvbjE=) |
avatar_url | string | (example: https://github.com/images/error/octocat_happy.gif) |
description | string | (example: A great organization) |
events_url | string (uri) | (example: https://api.github.com/orgs/github/events) |
hooks_url | string | (example: https://api.github.com/orgs/github/hooks) |
issues_url | string | (example: https://api.github.com/orgs/github/issues) |
login | string | (example: github) |
members_url | string | (example: https://api.github.com/orgs/github/members{/member}) |
public_members_url | string | (example: https://api.github.com/orgs/github/public_members{/member}) |
repos_url | string (uri) | (example: https://api.github.com/orgs/github/repos) |
url | string (uri) | (example: https://api.github.com/orgs/github) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_assignment | select | enterprise, enterprise-team, org | Check if an enterprise team is assigned to an organization | |
get_assignments | select | enterprise, enterprise-team | per_page, page | Get all organizations assigned to an enterprise team |
add | replace | enterprise, enterprise-team, org | Assign an enterprise team to an organization. | |
delete | delete | enterprise, enterprise-team, org | Unassign 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.
| Name | Datatype | Description |
|---|---|---|
enterprise | string | The slug version of the enterprise name. |
enterprise-team | string | The slug version of the enterprise team name. You can also substitute this value with the enterprise team id. |
org | string | The organization name. The name is not case sensitive. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- get_assignment
- get_assignments
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
;
Get all organizations assigned to an enterprise team
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 per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
REPLACE examples
- add
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
- delete
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
;