/
usage.ts
31 lines (29 loc) · 924 Bytes
/
usage.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
import type { AxiosInstance } from 'contentful-sdk-core'
import { CollectionProp, QueryParams } from '../../../common-types'
import { UsageProps } from '../../../entities/usage'
import { RestEndpoint } from '../types'
import * as raw from './raw'
export const getManyForSpace: RestEndpoint<'Usage', 'getManyForSpace'> = (
http: AxiosInstance,
params: { organizationId: string } & QueryParams
) => {
return raw.get<CollectionProp<UsageProps>>(
http,
`/organizations/${params.organizationId}/space_periodic_usages`,
{
params: params.query,
}
)
}
export const getManyForOrganization: RestEndpoint<'Usage', 'getManyForOrganization'> = (
http: AxiosInstance,
params: { organizationId: string } & QueryParams
) => {
return raw.get<CollectionProp<UsageProps>>(
http,
`/organizations/${params.organizationId}/organization_periodic_usages`,
{
params: params.query,
}
)
}