@roarkanalytics/sdk 2.24.0 → 2.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/client.d.mts +8 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +7 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/index.d.mts +3 -1
  12. package/resources/index.d.mts.map +1 -1
  13. package/resources/index.d.ts +3 -1
  14. package/resources/index.d.ts.map +1 -1
  15. package/resources/index.js +5 -1
  16. package/resources/index.js.map +1 -1
  17. package/resources/index.mjs +3 -1
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/metric-collection-job.d.mts +237 -0
  20. package/resources/metric-collection-job.d.mts.map +1 -0
  21. package/resources/metric-collection-job.d.ts +237 -0
  22. package/resources/metric-collection-job.d.ts.map +1 -0
  23. package/resources/metric-collection-job.js +29 -0
  24. package/resources/metric-collection-job.js.map +1 -0
  25. package/resources/metric-collection-job.mjs +25 -0
  26. package/resources/metric-collection-job.mjs.map +1 -0
  27. package/resources/metric-policy.d.mts +502 -0
  28. package/resources/metric-policy.d.mts.map +1 -0
  29. package/resources/metric-policy.d.ts +502 -0
  30. package/resources/metric-policy.d.ts.map +1 -0
  31. package/resources/metric-policy.js +76 -0
  32. package/resources/metric-policy.js.map +1 -0
  33. package/resources/metric-policy.mjs +72 -0
  34. package/resources/metric-policy.mjs.map +1 -0
  35. package/resources/metric.d.mts +187 -1
  36. package/resources/metric.d.mts.map +1 -1
  37. package/resources/metric.d.ts +187 -1
  38. package/resources/metric.d.ts.map +1 -1
  39. package/resources/metric.js +21 -0
  40. package/resources/metric.js.map +1 -1
  41. package/resources/metric.mjs +21 -0
  42. package/resources/metric.mjs.map +1 -1
  43. package/resources/simulation-job.d.mts +34 -2
  44. package/resources/simulation-job.d.mts.map +1 -1
  45. package/resources/simulation-job.d.ts +34 -2
  46. package/resources/simulation-job.d.ts.map +1 -1
  47. package/resources/simulation-persona.d.mts +102 -6
  48. package/resources/simulation-persona.d.mts.map +1 -1
  49. package/resources/simulation-persona.d.ts +102 -6
  50. package/resources/simulation-persona.d.ts.map +1 -1
  51. package/resources/simulation-run-plan-job.d.mts +24 -7
  52. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  53. package/resources/simulation-run-plan-job.d.ts +24 -7
  54. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  55. package/resources/simulation-run-plan.d.mts +31 -1
  56. package/resources/simulation-run-plan.d.mts.map +1 -1
  57. package/resources/simulation-run-plan.d.ts +31 -1
  58. package/resources/simulation-run-plan.d.ts.map +1 -1
  59. package/resources/webhook.d.mts +4 -4
  60. package/resources/webhook.d.mts.map +1 -1
  61. package/resources/webhook.d.ts +4 -4
  62. package/resources/webhook.d.ts.map +1 -1
  63. package/src/client.ts +56 -2
  64. package/src/resources/index.ts +25 -1
  65. package/src/resources/metric-collection-job.ts +307 -0
  66. package/src/resources/metric-policy.ts +679 -0
  67. package/src/resources/metric.ts +232 -1
  68. package/src/resources/simulation-job.ts +42 -2
  69. package/src/resources/simulation-persona.ts +126 -6
  70. package/src/resources/simulation-run-plan-job.ts +32 -6
  71. package/src/resources/simulation-run-plan.ts +38 -1
  72. package/src/resources/webhook.ts +4 -0
  73. package/src/version.ts +1 -1
  74. package/version.d.mts +1 -1
  75. package/version.d.ts +1 -1
  76. package/version.js +1 -1
  77. package/version.mjs +1 -1
@@ -0,0 +1,237 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { RequestOptions } from "../internal/request-options.mjs";
4
+ export declare class MetricCollectionJob extends APIResource {
5
+ /**
6
+ * Creates a metric collection job for the specified calls and metrics, then
7
+ * triggers processing.
8
+ */
9
+ create(body: MetricCollectionJobCreateParams, options?: RequestOptions): APIPromise<MetricCollectionJobCreateResponse>;
10
+ /**
11
+ * Returns a paginated list of metric collection jobs for the project.
12
+ */
13
+ list(query?: MetricCollectionJobListParams | null | undefined, options?: RequestOptions): APIPromise<MetricCollectionJobListResponse>;
14
+ /**
15
+ * Returns a specific metric collection job with progress information.
16
+ */
17
+ getByID(jobID: string, options?: RequestOptions): APIPromise<MetricCollectionJobGetByIDResponse>;
18
+ }
19
+ export interface MetricCollectionJobCreateResponse {
20
+ /**
21
+ * A metric collection job that processes metrics for calls
22
+ */
23
+ data: MetricCollectionJobCreateResponse.Data;
24
+ }
25
+ export declare namespace MetricCollectionJobCreateResponse {
26
+ /**
27
+ * A metric collection job that processes metrics for calls
28
+ */
29
+ interface Data {
30
+ /**
31
+ * Unique identifier of the metric collection job
32
+ */
33
+ id: string;
34
+ /**
35
+ * When the job completed
36
+ */
37
+ completedAt: string | null;
38
+ /**
39
+ * Number of successfully completed items
40
+ */
41
+ completedItems: number;
42
+ /**
43
+ * When the job was created
44
+ */
45
+ createdAt: string;
46
+ /**
47
+ * Error message if the job failed
48
+ */
49
+ errorMessage: string | null;
50
+ /**
51
+ * Number of failed items
52
+ */
53
+ failedItems: number;
54
+ /**
55
+ * When the job started processing
56
+ */
57
+ startedAt: string | null;
58
+ /**
59
+ * Current status of the job
60
+ */
61
+ status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
62
+ /**
63
+ * Total number of call-metric pairs to process
64
+ */
65
+ totalItems: number;
66
+ /**
67
+ * What triggered this job
68
+ */
69
+ triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
70
+ /**
71
+ * When the job was last updated
72
+ */
73
+ updatedAt: string;
74
+ }
75
+ }
76
+ /**
77
+ * Paginated list of metric collection jobs
78
+ */
79
+ export interface MetricCollectionJobListResponse {
80
+ data: Array<MetricCollectionJobListResponse.Data>;
81
+ pagination: MetricCollectionJobListResponse.Pagination;
82
+ }
83
+ export declare namespace MetricCollectionJobListResponse {
84
+ /**
85
+ * A metric collection job that processes metrics for calls
86
+ */
87
+ interface Data {
88
+ /**
89
+ * Unique identifier of the metric collection job
90
+ */
91
+ id: string;
92
+ /**
93
+ * When the job completed
94
+ */
95
+ completedAt: string | null;
96
+ /**
97
+ * Number of successfully completed items
98
+ */
99
+ completedItems: number;
100
+ /**
101
+ * When the job was created
102
+ */
103
+ createdAt: string;
104
+ /**
105
+ * Error message if the job failed
106
+ */
107
+ errorMessage: string | null;
108
+ /**
109
+ * Number of failed items
110
+ */
111
+ failedItems: number;
112
+ /**
113
+ * When the job started processing
114
+ */
115
+ startedAt: string | null;
116
+ /**
117
+ * Current status of the job
118
+ */
119
+ status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
120
+ /**
121
+ * Total number of call-metric pairs to process
122
+ */
123
+ totalItems: number;
124
+ /**
125
+ * What triggered this job
126
+ */
127
+ triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
128
+ /**
129
+ * When the job was last updated
130
+ */
131
+ updatedAt: string;
132
+ }
133
+ interface Pagination {
134
+ /**
135
+ * Whether there are more items to fetch
136
+ */
137
+ hasMore: boolean;
138
+ /**
139
+ * Cursor for the next page of items
140
+ */
141
+ nextCursor: string | null;
142
+ /**
143
+ * Total number of items
144
+ */
145
+ total: number;
146
+ }
147
+ }
148
+ export interface MetricCollectionJobGetByIDResponse {
149
+ /**
150
+ * A metric collection job that processes metrics for calls
151
+ */
152
+ data: MetricCollectionJobGetByIDResponse.Data;
153
+ }
154
+ export declare namespace MetricCollectionJobGetByIDResponse {
155
+ /**
156
+ * A metric collection job that processes metrics for calls
157
+ */
158
+ interface Data {
159
+ /**
160
+ * Unique identifier of the metric collection job
161
+ */
162
+ id: string;
163
+ /**
164
+ * When the job completed
165
+ */
166
+ completedAt: string | null;
167
+ /**
168
+ * Number of successfully completed items
169
+ */
170
+ completedItems: number;
171
+ /**
172
+ * When the job was created
173
+ */
174
+ createdAt: string;
175
+ /**
176
+ * Error message if the job failed
177
+ */
178
+ errorMessage: string | null;
179
+ /**
180
+ * Number of failed items
181
+ */
182
+ failedItems: number;
183
+ /**
184
+ * When the job started processing
185
+ */
186
+ startedAt: string | null;
187
+ /**
188
+ * Current status of the job
189
+ */
190
+ status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
191
+ /**
192
+ * Total number of call-metric pairs to process
193
+ */
194
+ totalItems: number;
195
+ /**
196
+ * What triggered this job
197
+ */
198
+ triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
199
+ /**
200
+ * When the job was last updated
201
+ */
202
+ updatedAt: string;
203
+ }
204
+ }
205
+ export interface MetricCollectionJobCreateParams {
206
+ /**
207
+ * Call IDs to collect metrics for
208
+ */
209
+ callIds: Array<string>;
210
+ /**
211
+ * Metric definitions to collect
212
+ */
213
+ metrics: Array<MetricCollectionJobCreateParams.Metric>;
214
+ }
215
+ export declare namespace MetricCollectionJobCreateParams {
216
+ interface Metric {
217
+ id: string;
218
+ }
219
+ }
220
+ export interface MetricCollectionJobListParams {
221
+ /**
222
+ * Cursor for pagination - use the nextCursor value from a previous response
223
+ */
224
+ after?: string;
225
+ /**
226
+ * Maximum number of jobs to return (default: 20, max: 50)
227
+ */
228
+ limit?: number;
229
+ /**
230
+ * Filter by job status
231
+ */
232
+ status?: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
233
+ }
234
+ export declare namespace MetricCollectionJob {
235
+ export { type MetricCollectionJobCreateResponse as MetricCollectionJobCreateResponse, type MetricCollectionJobListResponse as MetricCollectionJobListResponse, type MetricCollectionJobGetByIDResponse as MetricCollectionJobGetByIDResponse, type MetricCollectionJobCreateParams as MetricCollectionJobCreateParams, type MetricCollectionJobListParams as MetricCollectionJobListParams, };
236
+ }
237
+ //# sourceMappingURL=metric-collection-job.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metric-collection-job.d.mts","sourceRoot":"","sources":["../src/resources/metric-collection-job.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,mBAAoB,SAAQ,WAAW;IAClD;;;OAGG;IACH,MAAM,CACJ,IAAI,EAAE,+BAA+B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iCAAiC,CAAC;IAIhD;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,6BAA6B,GAAG,IAAI,GAAG,SAAc,EAC5D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,+BAA+B,CAAC;IAI9C;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kCAAkC,CAAC;CAGjG;AAED,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,IAAI,EAAE,iCAAiC,CAAC,IAAI,CAAC;CAC9C;AAED,yBAAiB,iCAAiC,CAAC;IACjD;;OAEG;IACH,UAAiB,IAAI;QACnB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAE3B;;WAEG;QACH,cAAc,EAAE,MAAM,CAAC;QAEvB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAE5B;;WAEG;QACH,WAAW,EAAE,MAAM,CAAC;QAEpB;;WAEG;QACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QAEzB;;WAEG;QACH,MAAM,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;QAEvE;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,WAAW,EAAE,aAAa,GAAG,UA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C,EAC7E,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,6BAA6B,IAAI,6BAA6B,GACpE,CAAC;CACH"}
@@ -0,0 +1,237 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { RequestOptions } from "../internal/request-options.js";
4
+ export declare class MetricCollectionJob extends APIResource {
5
+ /**
6
+ * Creates a metric collection job for the specified calls and metrics, then
7
+ * triggers processing.
8
+ */
9
+ create(body: MetricCollectionJobCreateParams, options?: RequestOptions): APIPromise<MetricCollectionJobCreateResponse>;
10
+ /**
11
+ * Returns a paginated list of metric collection jobs for the project.
12
+ */
13
+ list(query?: MetricCollectionJobListParams | null | undefined, options?: RequestOptions): APIPromise<MetricCollectionJobListResponse>;
14
+ /**
15
+ * Returns a specific metric collection job with progress information.
16
+ */
17
+ getByID(jobID: string, options?: RequestOptions): APIPromise<MetricCollectionJobGetByIDResponse>;
18
+ }
19
+ export interface MetricCollectionJobCreateResponse {
20
+ /**
21
+ * A metric collection job that processes metrics for calls
22
+ */
23
+ data: MetricCollectionJobCreateResponse.Data;
24
+ }
25
+ export declare namespace MetricCollectionJobCreateResponse {
26
+ /**
27
+ * A metric collection job that processes metrics for calls
28
+ */
29
+ interface Data {
30
+ /**
31
+ * Unique identifier of the metric collection job
32
+ */
33
+ id: string;
34
+ /**
35
+ * When the job completed
36
+ */
37
+ completedAt: string | null;
38
+ /**
39
+ * Number of successfully completed items
40
+ */
41
+ completedItems: number;
42
+ /**
43
+ * When the job was created
44
+ */
45
+ createdAt: string;
46
+ /**
47
+ * Error message if the job failed
48
+ */
49
+ errorMessage: string | null;
50
+ /**
51
+ * Number of failed items
52
+ */
53
+ failedItems: number;
54
+ /**
55
+ * When the job started processing
56
+ */
57
+ startedAt: string | null;
58
+ /**
59
+ * Current status of the job
60
+ */
61
+ status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
62
+ /**
63
+ * Total number of call-metric pairs to process
64
+ */
65
+ totalItems: number;
66
+ /**
67
+ * What triggered this job
68
+ */
69
+ triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
70
+ /**
71
+ * When the job was last updated
72
+ */
73
+ updatedAt: string;
74
+ }
75
+ }
76
+ /**
77
+ * Paginated list of metric collection jobs
78
+ */
79
+ export interface MetricCollectionJobListResponse {
80
+ data: Array<MetricCollectionJobListResponse.Data>;
81
+ pagination: MetricCollectionJobListResponse.Pagination;
82
+ }
83
+ export declare namespace MetricCollectionJobListResponse {
84
+ /**
85
+ * A metric collection job that processes metrics for calls
86
+ */
87
+ interface Data {
88
+ /**
89
+ * Unique identifier of the metric collection job
90
+ */
91
+ id: string;
92
+ /**
93
+ * When the job completed
94
+ */
95
+ completedAt: string | null;
96
+ /**
97
+ * Number of successfully completed items
98
+ */
99
+ completedItems: number;
100
+ /**
101
+ * When the job was created
102
+ */
103
+ createdAt: string;
104
+ /**
105
+ * Error message if the job failed
106
+ */
107
+ errorMessage: string | null;
108
+ /**
109
+ * Number of failed items
110
+ */
111
+ failedItems: number;
112
+ /**
113
+ * When the job started processing
114
+ */
115
+ startedAt: string | null;
116
+ /**
117
+ * Current status of the job
118
+ */
119
+ status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
120
+ /**
121
+ * Total number of call-metric pairs to process
122
+ */
123
+ totalItems: number;
124
+ /**
125
+ * What triggered this job
126
+ */
127
+ triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
128
+ /**
129
+ * When the job was last updated
130
+ */
131
+ updatedAt: string;
132
+ }
133
+ interface Pagination {
134
+ /**
135
+ * Whether there are more items to fetch
136
+ */
137
+ hasMore: boolean;
138
+ /**
139
+ * Cursor for the next page of items
140
+ */
141
+ nextCursor: string | null;
142
+ /**
143
+ * Total number of items
144
+ */
145
+ total: number;
146
+ }
147
+ }
148
+ export interface MetricCollectionJobGetByIDResponse {
149
+ /**
150
+ * A metric collection job that processes metrics for calls
151
+ */
152
+ data: MetricCollectionJobGetByIDResponse.Data;
153
+ }
154
+ export declare namespace MetricCollectionJobGetByIDResponse {
155
+ /**
156
+ * A metric collection job that processes metrics for calls
157
+ */
158
+ interface Data {
159
+ /**
160
+ * Unique identifier of the metric collection job
161
+ */
162
+ id: string;
163
+ /**
164
+ * When the job completed
165
+ */
166
+ completedAt: string | null;
167
+ /**
168
+ * Number of successfully completed items
169
+ */
170
+ completedItems: number;
171
+ /**
172
+ * When the job was created
173
+ */
174
+ createdAt: string;
175
+ /**
176
+ * Error message if the job failed
177
+ */
178
+ errorMessage: string | null;
179
+ /**
180
+ * Number of failed items
181
+ */
182
+ failedItems: number;
183
+ /**
184
+ * When the job started processing
185
+ */
186
+ startedAt: string | null;
187
+ /**
188
+ * Current status of the job
189
+ */
190
+ status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
191
+ /**
192
+ * Total number of call-metric pairs to process
193
+ */
194
+ totalItems: number;
195
+ /**
196
+ * What triggered this job
197
+ */
198
+ triggeredBy: 'USER_MANUAL' | 'USER_API' | 'METRIC_POLICY' | 'SIMULATION';
199
+ /**
200
+ * When the job was last updated
201
+ */
202
+ updatedAt: string;
203
+ }
204
+ }
205
+ export interface MetricCollectionJobCreateParams {
206
+ /**
207
+ * Call IDs to collect metrics for
208
+ */
209
+ callIds: Array<string>;
210
+ /**
211
+ * Metric definitions to collect
212
+ */
213
+ metrics: Array<MetricCollectionJobCreateParams.Metric>;
214
+ }
215
+ export declare namespace MetricCollectionJobCreateParams {
216
+ interface Metric {
217
+ id: string;
218
+ }
219
+ }
220
+ export interface MetricCollectionJobListParams {
221
+ /**
222
+ * Cursor for pagination - use the nextCursor value from a previous response
223
+ */
224
+ after?: string;
225
+ /**
226
+ * Maximum number of jobs to return (default: 20, max: 50)
227
+ */
228
+ limit?: number;
229
+ /**
230
+ * Filter by job status
231
+ */
232
+ status?: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELED';
233
+ }
234
+ export declare namespace MetricCollectionJob {
235
+ export { type MetricCollectionJobCreateResponse as MetricCollectionJobCreateResponse, type MetricCollectionJobListResponse as MetricCollectionJobListResponse, type MetricCollectionJobGetByIDResponse as MetricCollectionJobGetByIDResponse, type MetricCollectionJobCreateParams as MetricCollectionJobCreateParams, type MetricCollectionJobListParams as MetricCollectionJobListParams, };
236
+ }
237
+ //# sourceMappingURL=metric-collection-job.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metric-collection-job.d.ts","sourceRoot":"","sources":["../src/resources/metric-collection-job.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,mBAAoB,SAAQ,WAAW;IAClD;;;OAGG;IACH,MAAM,CACJ,IAAI,EAAE,+BAA+B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iCAAiC,CAAC;IAIhD;;OAEG;IACH,IAAI,CACF,KAAK,GAAE,6BAA6B,GAAG,IAAI,GAAG,SAAc,EAC5D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,+BAA+B,CAAC;IAI9C;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kCAAkC,CAAC;CAGjG;AAED,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,IAAI,EAAE,iCAAiC,CAAC,IAAI,CAAC;CAC9C;AAED,yBAAiB,iCAAiC,CAAC;IACjD;;OAEG;IACH,UAAiB,IAAI;QACnB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAE3B;;WAEG;QACH,cAAc,EAAE,MAAM,CAAC;QAEvB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;WA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E,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;CACzE;AAED,MAAM,CAAC,OAAO,WAAW,mBAAmB,CAAC;IAC3C,OAAO,EACL,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,kCAAkC,IAAI,kCAAkC,EAC7E,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,6BAA6B,IAAI,6BAA6B,GACpE,CAAC;CACH"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.MetricCollectionJob = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const path_1 = require("../internal/utils/path.js");
7
+ class MetricCollectionJob extends resource_1.APIResource {
8
+ /**
9
+ * Creates a metric collection job for the specified calls and metrics, then
10
+ * triggers processing.
11
+ */
12
+ create(body, options) {
13
+ return this._client.post('/v1/metric/collection-jobs', { body, ...options });
14
+ }
15
+ /**
16
+ * Returns a paginated list of metric collection jobs for the project.
17
+ */
18
+ list(query = {}, options) {
19
+ return this._client.get('/v1/metric/collection-jobs', { query, ...options });
20
+ }
21
+ /**
22
+ * Returns a specific metric collection job with progress information.
23
+ */
24
+ getByID(jobID, options) {
25
+ return this._client.get((0, path_1.path) `/v1/metric/collection-jobs/${jobID}`, options);
26
+ }
27
+ }
28
+ exports.MetricCollectionJob = MetricCollectionJob;
29
+ //# sourceMappingURL=metric-collection-job.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metric-collection-job.js","sourceRoot":"","sources":["../src/resources/metric-collection-job.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,mBAAoB,SAAQ,sBAAW;IAClD;;;OAGG;IACH,MAAM,CACJ,IAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAA0D,EAAE,EAC5D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,KAAa,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,8BAA8B,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACF;AA5BD,kDA4BC"}
@@ -0,0 +1,25 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { path } from "../internal/utils/path.mjs";
4
+ export class MetricCollectionJob extends APIResource {
5
+ /**
6
+ * Creates a metric collection job for the specified calls and metrics, then
7
+ * triggers processing.
8
+ */
9
+ create(body, options) {
10
+ return this._client.post('/v1/metric/collection-jobs', { body, ...options });
11
+ }
12
+ /**
13
+ * Returns a paginated list of metric collection jobs for the project.
14
+ */
15
+ list(query = {}, options) {
16
+ return this._client.get('/v1/metric/collection-jobs', { query, ...options });
17
+ }
18
+ /**
19
+ * Returns a specific metric collection job with progress information.
20
+ */
21
+ getByID(jobID, options) {
22
+ return this._client.get(path `/v1/metric/collection-jobs/${jobID}`, options);
23
+ }
24
+ }
25
+ //# sourceMappingURL=metric-collection-job.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metric-collection-job.mjs","sourceRoot":"","sources":["../src/resources/metric-collection-job.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD;;;OAGG;IACH,MAAM,CACJ,IAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;OAEG;IACH,IAAI,CACF,QAA0D,EAAE,EAC5D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,KAAa,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,8BAA8B,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9E,CAAC;CACF"}