// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; /** * Collection of utility methods for using Mux APIs. There's only one thing in here right now, maybe there will be more later. */ export class Utilities extends APIResource { /** * Retrieve information about your current access token, including organization, * environment, and permissions. Note that this can only be access with an access * token, and _all_ access tokens can access this route, regardless of what * permissions they have assigned. */ whoami(options?: RequestOptions): APIPromise { return ( this._client.get('/system/v1/whoami', { defaultBaseURL: 'https://api.mux.com', ...options, }) as APIPromise<{ data: UtilityWhoamiResponse }> )._thenUnwrap((obj) => obj.data); } } export interface WhoamiResponse { data: UtilityWhoamiResponse; } export interface UtilityWhoamiResponse { access_token_name: string; environment_id: string; environment_name: string; environment_type: string; organization_id: string; organization_name: string; permissions: Array; } export declare namespace Utilities { export { type WhoamiResponse as WhoamiResponse, type UtilityWhoamiResponse as UtilityWhoamiResponse }; }