Repository navigation
Expand file tree
/
Copy pathfeedback.ts
More file actions
104 lines (90 loc) · 2.5 KB
/
Copy pathfeedback.ts
File metadata and controls
104 lines (90 loc) · 2.5 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
/**
* Report API issues and documentation mismatches.
*/
export class Feedback extends APIResource {
/**
* Report an API issue or documentation mismatch, including request IDs when
* available.
*
* @example
* ```ts
* const response = await client.feedback.submit({
* category: 'bug',
* note: 'Markdown drops the plan comparison table; expected all 4 rows.',
* request_id: '3f1c2a6e-8b4d-4c1e-9f0a-2d7b5e6c8a91',
* url: 'https://stripe.com/pricing',
* });
* ```
*/
submit(body: FeedbackSubmitParams, options?: RequestOptions): APIPromise<FeedbackSubmitResponse> {
return this._client.post('/feedback', { body, ...options });
}
}
export interface FeedbackSubmitResponse {
/**
* True when feedback for this request_id was already recorded; the original
* feedback_id is returned.
*/
already_submitted: boolean;
/**
* ID of the stored feedback.
*/
feedback_id: string;
/**
* Unique ID of this request, also in `X-Request-Id`. Include it when contacting
* support.
*/
request_id: string;
/**
* Credits this request used and your remaining balance.
*/
key_metadata?: FeedbackSubmitResponse.KeyMetadata;
}
export namespace FeedbackSubmitResponse {
/**
* Credits this request used and your remaining balance.
*/
export interface KeyMetadata {
/**
* Credits charged for this request.
*/
credits_consumed: number;
/**
* Credits remaining for your organization.
*/
credits_remaining: number;
}
}
export interface FeedbackSubmitParams {
/**
* Kind of issue.
*/
category: 'bug' | 'docs_mismatch' | 'friction' | 'feature_gap' | 'quality_degradation' | 'other';
/**
* What went wrong and what you expected instead.
*/
note: string;
/**
* The request_id of the API call the feedback is about, from its response body or
* X-Request-Id header.
*/
request_id?: string;
/**
* Labels for filtering usage in the dashboard.
*/
tags?: Array<string>;
/**
* The page the feedback is about, such as one page of a crawl or a docs page.
*/
url?: string;
}
export declare namespace Feedback {
export {
type FeedbackSubmitResponse as FeedbackSubmitResponse,
type FeedbackSubmitParams as FeedbackSubmitParams,
};
}