UNPKG

@ringer-tel/ivy

Version:
129 lines (115 loc) 3.95 kB
/* tslint:disable */ /* eslint-disable */ /** * Ringer Business API * This API provides comprehensive endpoints for the Ringer Business system. It includes functionality for managing customer accounts, addresses, sites, phone numbers, payments, users, and other business resources. Operations typically require authentication and appropriate permissions. * * The version of the OpenAPI document: 1.0.5 * Contact: support@ringer.tel * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { mapValues } from '../runtime'; /** * Parameters for requesting an OAuth 2.0 access token. Required fields vary by grant_type. * @export * @interface TokenRequest */ export interface TokenRequest { /** * The OAuth 2.0 grant type. * @type {string} * @memberof TokenRequest */ grantType: TokenRequestGrantTypeEnum; /** * User's email address (required for `password` grant). * @type {string} * @memberof TokenRequest */ username?: string | null; /** * User's password (required for `password` grant). * @type {string} * @memberof TokenRequest */ password?: string | null; /** * Refresh token (required for `refresh_token` grant). * @type {string} * @memberof TokenRequest */ refreshToken?: string | null; /** * The application's client ID. * @type {string} * @memberof TokenRequest */ clientId: string; /** * The application's client secret. * @type {string} * @memberof TokenRequest */ clientSecret: string; /** * (Optional) A space-separated list of requested scopes. The granted scopes may differ. * @type {string} * @memberof TokenRequest */ scope?: string | null; } /** * @export */ export const TokenRequestGrantTypeEnum = { Password: 'password', ClientCredentials: 'client_credentials', RefreshToken: 'refresh_token' } as const; export type TokenRequestGrantTypeEnum = typeof TokenRequestGrantTypeEnum[keyof typeof TokenRequestGrantTypeEnum]; /** * Check if a given object implements the TokenRequest interface. */ export function instanceOfTokenRequest(value: object): value is TokenRequest { if (!('grantType' in value) || value['grantType'] === undefined) return false; if (!('clientId' in value) || value['clientId'] === undefined) return false; if (!('clientSecret' in value) || value['clientSecret'] === undefined) return false; return true; } export function TokenRequestFromJSON(json: any): TokenRequest { return TokenRequestFromJSONTyped(json, false); } export function TokenRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TokenRequest { if (json == null) { return json; } return { 'grantType': json['grant_type'], 'username': json['username'] == null ? undefined : json['username'], 'password': json['password'] == null ? undefined : json['password'], 'refreshToken': json['refresh_token'] == null ? undefined : json['refresh_token'], 'clientId': json['client_id'], 'clientSecret': json['client_secret'], 'scope': json['scope'] == null ? undefined : json['scope'], }; } export function TokenRequestToJSON(json: any): TokenRequest { return TokenRequestToJSONTyped(json, false); } export function TokenRequestToJSONTyped(value?: TokenRequest | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'grant_type': value['grantType'], 'username': value['username'], 'password': value['password'], 'refresh_token': value['refreshToken'], 'client_id': value['clientId'], 'client_secret': value['clientSecret'], 'scope': value['scope'], }; }