-
Notifications
You must be signed in to change notification settings - Fork 53
/
organizations.ts
50 lines (40 loc) · 1.12 KB
/
organizations.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { Endpoint } from '../endpoint'
import { EndpointClient, EndpointClientConfig } from '../endpoint-client'
export interface OrganizationUpdateRequest {
label?: string
warehouseGroupId?: string
}
export interface OrganizationCreateRequest extends OrganizationUpdateRequest {
name: string
manufacturerName?: string
mnid?: string
}
export interface OrganizationResponse extends OrganizationCreateRequest {
/**
* A generated UUID for an organization.
*/
organizationId: string
/**
* The user group for organization developers.
*/
developerGroupId?: string
/**
* The user group for organization admins.
*/
adminGroupId?: string
/**
* Denotes whether this is the default user org for the caller.
*/
isDefaultUserOrg?: boolean
}
export class OrganizationsEndpoint extends Endpoint {
constructor(config: EndpointClientConfig) {
super(new EndpointClient('organizations', config))
}
public list(): Promise<OrganizationResponse[]>{
return this.client.getPagedItems<OrganizationResponse>('')
}
public get(id: string): Promise<OrganizationResponse>{
return this.client.get<OrganizationResponse>(id)
}
}