31 lines
843 B
TypeScript
31 lines
843 B
TypeScript
import { BaseInheritanceModel, DefaultClient, AKResponse, QueryArguments } from "./Client";
|
|
|
|
export class Provider implements BaseInheritanceModel {
|
|
pk: number;
|
|
name: string;
|
|
authorization_flow: string;
|
|
object_type: string;
|
|
|
|
assigned_application_slug?: string;
|
|
assigned_application_name?: string;
|
|
|
|
verbose_name: string;
|
|
verbose_name_plural: string;
|
|
|
|
constructor() {
|
|
throw Error();
|
|
}
|
|
|
|
static get(id: number): Promise<Provider> {
|
|
return DefaultClient.fetch<Provider>(["providers", "all", id.toString()]);
|
|
}
|
|
|
|
static list(filter?: QueryArguments): Promise<AKResponse<Provider>> {
|
|
return DefaultClient.fetch<AKResponse<Provider>>(["providers", "all"], filter);
|
|
}
|
|
|
|
static adminUrl(rest: string): string {
|
|
return `/administration/providers/${rest}`;
|
|
}
|
|
}
|