File size: 1,533 Bytes
1477a90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
51
52
53
54
55
56
57
58
59
60
61
62
63
// Code generated by @openmeter/typespec-typescript. DO NOT EDIT.

import { z } from 'zod'
import * as schemas from '../schemas.js'
import type { AcceptDateStrings } from '../../lib/wire.js'
import type {
  CreatePlanRequestInput,
  ListPlansParamsFilter,
  Plan,
  PlanPagePaginatedResponse,
  SortQueryInput,
  UpsertPlanRequestInput,
} from '../types.js'

export interface ListPlansQuery {
  /** Determines which page of the collection to retrieve. */
  page?: { size?: number; number?: number }
  /**
   * Sort plans returned in the response. Supported sort attributes are:
   *
   * - `id`
   * - `key`
   * - `version`
   * - `created_at` (default)
   * - `updated_at`
   */
  sort?: SortQueryInput
  /** Filter plans returned in the response. */
  filter?: ListPlansParamsFilter
}

export type ListPlansRequest = AcceptDateStrings<ListPlansQuery>
export type ListPlansResponse = PlanPagePaginatedResponse

export type CreatePlanRequest = AcceptDateStrings<CreatePlanRequestInput>
export type CreatePlanResponse = Plan

export type UpdatePlanRequest = AcceptDateStrings<{
  planId: string
  body: UpsertPlanRequestInput
}>
export type UpdatePlanResponse = Plan

export type GetPlanRequest = {
  planId: string
}
export type GetPlanResponse = Plan

export type DeletePlanRequest = {
  planId: string
}
export type DeletePlanResponse = void

export type ArchivePlanRequest = {
  planId: string
}
export type ArchivePlanResponse = Plan

export type PublishPlanRequest = {
  planId: string
}
export type PublishPlanResponse = Plan