Skip to content

Commit

Permalink
feat: User#enterprises() (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
octokitbot authored Sep 8, 2023
1 parent 74c9bf6 commit e0b94a4
Show file tree
Hide file tree
Showing 3 changed files with 462 additions and 0 deletions.
59 changes: 59 additions & 0 deletions schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6229,6 +6229,19 @@ export type EnterpriseBillingInfo = {
totalLicenses: Scalars['Int']['output'];
};

/** The connection type for Enterprise. */
export type EnterpriseConnection = {
__typename?: 'EnterpriseConnection';
/** A list of edges. */
edges?: Maybe<Array<Maybe<EnterpriseEdge>>>;
/** A list of nodes. */
nodes?: Maybe<Array<Maybe<Enterprise>>>;
/** Information to aid in pagination. */
pageInfo: PageInfo;
/** Identifies the total count of items in the connection. */
totalCount: Scalars['Int']['output'];
};

/** The possible values for the enterprise base repository permission setting. */
export type EnterpriseDefaultRepositoryPermissionSettingValue =
/** Organization members will be able to clone, pull, push, and add new collaborators to all organization repositories. */
Expand All @@ -6242,6 +6255,15 @@ export type EnterpriseDefaultRepositoryPermissionSettingValue =
/** Organization members will be able to clone, pull, and push all organization repositories. */
| 'WRITE';

/** An edge in a connection. */
export type EnterpriseEdge = {
__typename?: 'EnterpriseEdge';
/** A cursor for use in pagination. */
cursor: Scalars['String']['output'];
/** The item at the end of the edge. */
node?: Maybe<Enterprise>;
};

/** The possible values for an enabled/disabled enterprise setting. */
export type EnterpriseEnabledDisabledSettingValue =
/** The setting is disabled for organizations in the enterprise. */
Expand Down Expand Up @@ -6384,6 +6406,30 @@ export type EnterpriseMembersCanMakePurchasesSettingValue =
/** The setting is enabled for organizations in the enterprise. */
| 'ENABLED';

/** The possible values we have for filtering Platform::Objects::User#enterprises. */
export type EnterpriseMembershipType =
/** Returns all enterprises in which the user is an admin. */
| 'ADMIN'
/** Returns all enterprises in which the user is a member, admin, or billing manager. */
| 'ALL'
/** Returns all enterprises in which the user is a billing manager. */
| 'BILLING_MANAGER'
/** Returns all enterprises in which the user is a member of an org that is owned by the enterprise. */
| 'ORG_MEMBERSHIP';

/** Ordering options for enterprises. */
export type EnterpriseOrder = {
/** The ordering direction. */
direction: OrderDirection;
/** The field to order enterprises by. */
field: EnterpriseOrderField;
};

/** Properties by which enterprise connections can be ordered. */
export type EnterpriseOrderField =
/** Order enterprises by name */
| 'NAME';

/** The connection type for Organization. */
export type EnterpriseOrganizationMembershipConnection = {
__typename?: 'EnterpriseOrganizationMembershipConnection';
Expand Down Expand Up @@ -27927,6 +27973,8 @@ export type User = Actor & Node & PackageOwner & ProfileOwner & ProjectOwner & P
databaseId?: Maybe<Scalars['Int']['output']>;
/** The user's publicly visible profile email. */
email: Scalars['String']['output'];
/** A list of enterprises that the user belongs to. */
enterprises?: Maybe<EnterpriseConnection>;
/** The estimated next GitHub Sponsors payout for this user/organization in cents (USD). */
estimatedNextSponsorsPayoutInCents: Scalars['Int']['output'];
/** A list of users the given user is followed by. */
Expand Down Expand Up @@ -28125,6 +28173,17 @@ export type UserContributionsCollectionArgs = {
};


/** A user is an individual's account on GitHub that owns repositories and can make new content. */
export type UserEnterprisesArgs = {
after?: InputMaybe<Scalars['String']['input']>;
before?: InputMaybe<Scalars['String']['input']>;
first?: InputMaybe<Scalars['Int']['input']>;
last?: InputMaybe<Scalars['Int']['input']>;
membershipType?: InputMaybe<EnterpriseMembershipType>;
orderBy?: InputMaybe<EnterpriseOrder>;
};


/** A user is an individual's account on GitHub that owns repositories and can make new content. */
export type UserFollowersArgs = {
after?: InputMaybe<Scalars['String']['input']>;
Expand Down
125 changes: 125 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -12050,6 +12050,31 @@ type EnterpriseBillingInfo {
totalLicenses: Int!
}

"""
The connection type for Enterprise.
"""
type EnterpriseConnection {
"""
A list of edges.
"""
edges: [EnterpriseEdge]

"""
A list of nodes.
"""
nodes: [Enterprise]

"""
Information to aid in pagination.
"""
pageInfo: PageInfo!

"""
Identifies the total count of items in the connection.
"""
totalCount: Int!
}

"""
The possible values for the enterprise base repository permission setting.
"""
Expand Down Expand Up @@ -12080,6 +12105,21 @@ enum EnterpriseDefaultRepositoryPermissionSettingValue {
WRITE
}

"""
An edge in a connection.
"""
type EnterpriseEdge {
"""
A cursor for use in pagination.
"""
cursor: String!

"""
The item at the end of the edge.
"""
node: Enterprise
}

"""
The possible values for an enabled/disabled enterprise setting.
"""
Expand Down Expand Up @@ -12363,6 +12403,56 @@ enum EnterpriseMembersCanMakePurchasesSettingValue {
ENABLED
}

"""
The possible values we have for filtering Platform::Objects::User#enterprises.
"""
enum EnterpriseMembershipType {
"""
Returns all enterprises in which the user is an admin.
"""
ADMIN

"""
Returns all enterprises in which the user is a member, admin, or billing manager.
"""
ALL

"""
Returns all enterprises in which the user is a billing manager.
"""
BILLING_MANAGER

"""
Returns all enterprises in which the user is a member of an org that is owned by the enterprise.
"""
ORG_MEMBERSHIP
}

"""
Ordering options for enterprises.
"""
input EnterpriseOrder {
"""
The ordering direction.
"""
direction: OrderDirection!

"""
The field to order enterprises by.
"""
field: EnterpriseOrderField!
}

"""
Properties by which enterprise connections can be ordered.
"""
enum EnterpriseOrderField {
"""
Order enterprises by name
"""
NAME
}

"""
The connection type for Organization.
"""
Expand Down Expand Up @@ -55966,6 +56056,41 @@ type User implements Actor & Node & PackageOwner & ProfileOwner & ProjectOwner &
"""
email: String!

"""
A list of enterprises that the user belongs to.
"""
enterprises(
"""
Returns the elements in the list that come after the specified cursor.
"""
after: String

"""
Returns the elements in the list that come before the specified cursor.
"""
before: String

"""
Returns the first _n_ elements from the list.
"""
first: Int

"""
Returns the last _n_ elements from the list.
"""
last: Int

"""
Filter enterprises returned based on the user's membership type.
"""
membershipType: EnterpriseMembershipType = ALL

"""
Ordering options for the User's enterprises.
"""
orderBy: EnterpriseOrder = {field: NAME, direction: ASC}
): EnterpriseConnection

"""
The estimated next GitHub Sponsors payout for this user/organization in cents (USD).
"""
Expand Down
Loading

0 comments on commit e0b94a4

Please sign in to comment.