// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import * as BusinessPartnersAPI from '../business-partners'; import * as ExclusionMembersAPI from './exclusion-members'; import { ExclusionMemberListParams, ExclusionMemberUpdateParams, ExclusionMemberUpdateResponse, ExclusionMembers, } from './exclusion-members'; import * as InclusionMembersAPI from './inclusion-members'; import { InclusionMemberListParams, InclusionMemberUpdateParams, InclusionMemberUpdateResponse, InclusionMembers, } from './inclusion-members'; import * as MembersAPI from './members'; import { MemberListParams, Members } from './members'; import { APIPromise } from '../../core/api-promise'; import { PageCursorURL, PagePromise } from '../../core/pagination'; import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; /** * Supergroups used by the company */ export class Supergroups extends APIResource { members: MembersAPI.Members = new MembersAPI.Members(this._client); inclusionMembers: InclusionMembersAPI.InclusionMembers = new InclusionMembersAPI.InclusionMembers( this._client, ); exclusionMembers: ExclusionMembersAPI.ExclusionMembers = new ExclusionMembersAPI.ExclusionMembers( this._client, ); /** * Retrieve supergroups matching the input parameters. * * - Requires: `API Tier 1` * - Filterable fields: `app_owner_id`, `group_type` * - Sortable fields: `id`, `created_at`, `updated_at` * * @example HTTP * Representative request and response shapes. * ``` * GET /supergroups/?filter=filter&order_by=order_by&limit=50&cursor=cursor HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * { * "name": "date_of_birth", * "reason": "Insufficient entitlements" * } * ] * }, * "results": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "display_name": "string", * "name": "string", * "app_owner_id": "string", * "group_type": "string", * "sub_group_type": "string", * "read_only": false, * "description": "string", * "parent": "string", * "mutually_exclusive_key": "string", * "cumulatively_exhaustive_default": false, * "include_terminated": false, * "allow_non_employees": false, * "can_override_role_states": false, * "priority": 0, * "is_invisible": false, * "ignore_prov_group_matching": false * } * ], * "next_link": "string" * } * ``` */ list( query: SupergroupListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/supergroups/', PageCursorURL, { query, ...options }); } /** * Retrieve a specific supergroup. * * @example HTTP * Representative request and response shapes. * ``` * GET /supergroups/{id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * {} * ] * } * } * ``` */ retrieve(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/supergroups/${id}/`, options); } } export type SupergroupsPageCursorURL = PageCursorURL; export interface Supergroup { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Whether the group allows non employees */ allow_non_employees?: boolean; /** * The id of the group's app owner. */ app_owner_id?: string; /** * Whether the group can override role states */ can_override_role_states?: boolean; /** * Whether the group is the cumulatively exhaustive default */ cumulatively_exhaustive_default?: boolean; /** * The group's description. */ description?: string; /** * The group's display name. */ display_name?: string; /** * The group type */ group_type?: string; /** * Whether to ignore provisioning group matching when determining group membership */ ignore_prov_group_matching?: boolean; /** * Whether the group include terminated roles */ include_terminated?: boolean; /** * Whether the group is invisible */ is_invisible?: boolean; /** * The group's mutually exclusive key */ mutually_exclusive_key?: string; /** * The group's name. */ name?: string; /** * The group's parent. */ parent?: string; /** * The group's priority when calculating mutual exclusivity */ priority?: number; /** * Whether the group is read only. */ read_only?: boolean; /** * The sub group type */ sub_group_type?: string; } /** * Meta information for the response. */ export interface SupergroupRetrieveResponse extends BusinessPartnersAPI.Meta, Supergroup {} export interface SupergroupListParams { cursor?: string; filter?: string; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; order_by?: string; } Supergroups.Members = Members; Supergroups.InclusionMembers = InclusionMembers; Supergroups.ExclusionMembers = ExclusionMembers; export declare namespace Supergroups { export { type Supergroup as Supergroup, type SupergroupRetrieveResponse as SupergroupRetrieveResponse, type SupergroupsPageCursorURL as SupergroupsPageCursorURL, type SupergroupListParams as SupergroupListParams, }; export { Members as Members, type MemberListParams as MemberListParams }; export { InclusionMembers as InclusionMembers, type InclusionMemberUpdateResponse as InclusionMemberUpdateResponse, type InclusionMemberListParams as InclusionMemberListParams, type InclusionMemberUpdateParams as InclusionMemberUpdateParams, }; export { ExclusionMembers as ExclusionMembers, type ExclusionMemberUpdateResponse as ExclusionMemberUpdateResponse, type ExclusionMemberListParams as ExclusionMemberListParams, type ExclusionMemberUpdateParams as ExclusionMemberUpdateParams, }; }