|
| 1 | +/* tslint:disable */ |
| 2 | +/* eslint-disable */ |
| 3 | +/** |
| 4 | + * Identity API |
| 5 | + * The Identity API provides an OIDC compliant interface for use with all official and 3rd party services and proxies. As its intended use is for multi-tenant cloud deployments, it acts as an aggregation layer for other 3rd party OIDC services, dispatching login requests to the required OIDC backend. Token introspection forms the basis of role based access control across all APIs. For security purposes, access tokens and refresh tokens are limited to a single session per client, thus if they are being consumed by a horizontally scalable platform care must be taken to ensure token rotation is handled atomically by a single process, and the tokens are distributed to each service instance synchronously. |
| 6 | + * |
| 7 | + * The version of the OpenAPI document: 1.11.0 |
| 8 | + * |
| 9 | + * |
| 10 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 11 | + * https://openapi-generator.tech |
| 12 | + * Do not edit the class manually. |
| 13 | + */ |
| 14 | + |
| 15 | +import { exists, mapValues } from '../runtime'; |
| 16 | +/** |
| 17 | + * Generic error message, compatible with oauth2. |
| 18 | + * @export |
| 19 | + * @interface Oauth2Error |
| 20 | + */ |
| 21 | +export interface Oauth2Error { |
| 22 | + /** |
| 23 | + * A terse error string expanding on the HTTP error code. Errors are based on the OAuth 2.02 specification, but are expanded with proprietary status codes for APIs other than those specified by OAuth 2.02. |
| 24 | + * @type {string} |
| 25 | + * @memberof Oauth2Error |
| 26 | + */ |
| 27 | + error: Oauth2ErrorErrorEnum; |
| 28 | + /** |
| 29 | + * Verbose message describing the error. |
| 30 | + * @type {string} |
| 31 | + * @memberof Oauth2Error |
| 32 | + */ |
| 33 | + errorDescription: string; |
| 34 | +} |
| 35 | + |
| 36 | + |
| 37 | +/** |
| 38 | + * @export |
| 39 | + */ |
| 40 | +export const Oauth2ErrorErrorEnum = { |
| 41 | + InvalidRequest: 'invalid_request', |
| 42 | + UnauthorizedClient: 'unauthorized_client', |
| 43 | + AccessDenied: 'access_denied', |
| 44 | + UnsupportedResponseType: 'unsupported_response_type', |
| 45 | + InvalidScope: 'invalid_scope', |
| 46 | + ServerError: 'server_error', |
| 47 | + TemporarilyUnavailable: 'temporarily_unavailable', |
| 48 | + InvalidClient: 'invalid_client', |
| 49 | + InvalidGrant: 'invalid_grant', |
| 50 | + UnsupportedGrantType: 'unsupported_grant_type' |
| 51 | +} as const; |
| 52 | +export type Oauth2ErrorErrorEnum = typeof Oauth2ErrorErrorEnum[keyof typeof Oauth2ErrorErrorEnum]; |
| 53 | + |
| 54 | + |
| 55 | +/** |
| 56 | + * Check if a given object implements the Oauth2Error interface. |
| 57 | + */ |
| 58 | +export function instanceOfOauth2Error(value: object): boolean { |
| 59 | + let isInstance = true; |
| 60 | + isInstance = isInstance && "error" in value; |
| 61 | + isInstance = isInstance && "errorDescription" in value; |
| 62 | + |
| 63 | + return isInstance; |
| 64 | +} |
| 65 | + |
| 66 | +export function Oauth2ErrorFromJSON(json: any): Oauth2Error { |
| 67 | + return Oauth2ErrorFromJSONTyped(json, false); |
| 68 | +} |
| 69 | + |
| 70 | +export function Oauth2ErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): Oauth2Error { |
| 71 | + if ((json === undefined) || (json === null)) { |
| 72 | + return json; |
| 73 | + } |
| 74 | + return { |
| 75 | + |
| 76 | + 'error': json['error'], |
| 77 | + 'errorDescription': json['error_description'], |
| 78 | + }; |
| 79 | +} |
| 80 | + |
| 81 | +export function Oauth2ErrorToJSON(value?: Oauth2Error | null): any { |
| 82 | + if (value === undefined) { |
| 83 | + return undefined; |
| 84 | + } |
| 85 | + if (value === null) { |
| 86 | + return null; |
| 87 | + } |
| 88 | + return { |
| 89 | + |
| 90 | + 'error': value.error, |
| 91 | + 'error_description': value.errorDescription, |
| 92 | + }; |
| 93 | +} |
| 94 | + |
0 commit comments