From e0b94a4a3551669849c97a329dcd2bf3280f79b6 Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Fri, 8 Sep 2023 11:16:12 -0500 Subject: [PATCH] feat: `User#enterprises()` (#822) --- schema.d.ts | 59 +++++++++++ schema.graphql | 125 ++++++++++++++++++++++ schema.json | 278 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 462 insertions(+) diff --git a/schema.d.ts b/schema.d.ts index ec0c99121..5633a0407 100644 --- a/schema.d.ts +++ b/schema.d.ts @@ -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>>; + /** A list of nodes. */ + nodes?: Maybe>>; + /** 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. */ @@ -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; +}; + /** The possible values for an enabled/disabled enterprise setting. */ export type EnterpriseEnabledDisabledSettingValue = /** The setting is disabled for organizations in the enterprise. */ @@ -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'; @@ -27927,6 +27973,8 @@ export type User = Actor & Node & PackageOwner & ProfileOwner & ProjectOwner & P databaseId?: Maybe; /** The user's publicly visible profile email. */ email: Scalars['String']['output']; + /** A list of enterprises that the user belongs to. */ + enterprises?: Maybe; /** 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. */ @@ -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; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + membershipType?: InputMaybe; + orderBy?: InputMaybe; +}; + + /** A user is an individual's account on GitHub that owns repositories and can make new content. */ export type UserFollowersArgs = { after?: InputMaybe; diff --git a/schema.graphql b/schema.graphql index 2f9ecf4e0..233e6816f 100644 --- a/schema.graphql +++ b/schema.graphql @@ -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. """ @@ -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. """ @@ -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. """ @@ -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). """ diff --git a/schema.json b/schema.json index 1b10bfeba..c9612b0b5 100644 --- a/schema.json +++ b/schema.json @@ -31367,6 +31367,81 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "EnterpriseConnection", + "description": "The connection type for Enterprise.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "EnterpriseEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Enterprise", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "ENUM", "name": "EnterpriseDefaultRepositoryPermissionSettingValue", @@ -31408,6 +31483,45 @@ ], "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "EnterpriseEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Enterprise", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "ENUM", "name": "EnterpriseEnabledDisabledSettingValue", @@ -32063,6 +32177,97 @@ ], "possibleTypes": null }, + { + "kind": "ENUM", + "name": "EnterpriseMembershipType", + "description": "The possible values we have for filtering Platform::Objects::User#enterprises.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ALL", + "description": "Returns all enterprises in which the user is a member, admin, or billing manager.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ADMIN", + "description": "Returns all enterprises in which the user is an admin.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BILLING_MANAGER", + "description": "Returns all enterprises in which the user is a billing manager.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ORG_MEMBERSHIP", + "description": "Returns all enterprises in which the user is a member of an org that is owned by the enterprise.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "EnterpriseOrder", + "description": "Ordering options for enterprises.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The field to order enterprises by.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "EnterpriseOrderField", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "direction", + "description": "The ordering direction.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderDirection", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "EnterpriseOrderField", + "description": "Properties by which enterprise connections can be ordered.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "NAME", + "description": "Order enterprises by name", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, { "kind": "OBJECT", "name": "EnterpriseOrganizationMembershipConnection", @@ -146124,6 +146329,79 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "enterprises", + "description": "A list of enterprises that the user belongs to.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "orderBy", + "description": "Ordering options for the User's enterprises.", + "type": { + "kind": "INPUT_OBJECT", + "name": "EnterpriseOrder", + "ofType": null + }, + "defaultValue": "{field: NAME, direction: ASC}" + }, + { + "name": "membershipType", + "description": "Filter enterprises returned based on the user's membership type.", + "type": { + "kind": "ENUM", + "name": "EnterpriseMembershipType", + "ofType": null + }, + "defaultValue": "ALL" + } + ], + "type": { + "kind": "OBJECT", + "name": "EnterpriseConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "estimatedNextSponsorsPayoutInCents", "description": "The estimated next GitHub Sponsors payout for this user/organization in cents (USD).",