-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservices.gen.go
More file actions
446 lines (339 loc) · 24.1 KB
/
Copy pathservices.gen.go
File metadata and controls
446 lines (339 loc) · 24.1 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
// Code generated by generate-sdk-go.ts — DO NOT EDIT.
package pgbeam
import (
"context"
"fmt"
)
var _ = fmt.Sprintf
// Client is the PgBeam API client. Access operations through service fields.
type Client struct {
Projects *ProjectsService
Databases *DatabasesService
Policies *PoliciesService
Agents *AgentsService
Approvals *ApprovalsService
Webhooks *WebhooksService
Anomalies *AnomaliesService
Branches *BranchesService
Migrations *MigrationsService
Analytics *AnalyticsService
Platform *PlatformService
Account *AccountService
Honeytokens *HoneytokensService
Internal *InternalService
Schemaannotations *SchemaannotationsService
Support *SupportService
t *transport
}
// NewClient creates a new PgBeam API client.
func NewClient(opts *ClientOptions) *Client {
t := newTransport(opts)
c := &Client{t: t}
c.Projects = &ProjectsService{t: t}
c.Databases = &DatabasesService{t: t}
c.Policies = &PoliciesService{t: t}
c.Agents = &AgentsService{t: t}
c.Approvals = &ApprovalsService{t: t}
c.Webhooks = &WebhooksService{t: t}
c.Anomalies = &AnomaliesService{t: t}
c.Branches = &BranchesService{t: t}
c.Migrations = &MigrationsService{t: t}
c.Analytics = &AnalyticsService{t: t}
c.Platform = &PlatformService{t: t}
c.Account = &AccountService{t: t}
c.Honeytokens = &HoneytokensService{t: t}
c.Internal = &InternalService{t: t}
c.Schemaannotations = &SchemaannotationsService{t: t}
c.Support = &SupportService{t: t}
return c
}
// ProjectsService provides projects operations.
type ProjectsService struct{ t *transport }
func (s *ProjectsService) ListCacheRules(ctx context.Context, projectID string, databaseID string, params *ListCacheRulesParams) (*ListCacheRulesResponse, error) {
return doQuery[ListCacheRulesResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/databases/%s/cache-rules", projectID, databaseID), params)
}
func (s *ProjectsService) UpdateCacheRule(ctx context.Context, projectID string, databaseID string, queryHash string, body UpdateCacheRuleRequest) (*UpdateCacheRuleResponse, error) {
return doJSON[UpdateCacheRuleResponse](s.t, ctx, "PUT", fmt.Sprintf("/v1/projects/%s/databases/%s/cache-rules/%s", projectID, databaseID, queryHash), body)
}
func (s *ProjectsService) ListCustomDomains(ctx context.Context, projectID string, params *ListCustomDomainsParams) (*ListCustomDomainsResponse, error) {
return doQuery[ListCustomDomainsResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/domains", projectID), params)
}
func (s *ProjectsService) CreateCustomDomain(ctx context.Context, projectID string, body CreateCustomDomainRequest) (*CustomDomain, error) {
return doJSON[CustomDomain](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/domains", projectID), body)
}
func (s *ProjectsService) DeleteCustomDomain(ctx context.Context, projectID string, domainID string) error {
return doVoid(s.t, ctx, "DELETE", fmt.Sprintf("/v1/projects/%s/domains/%s", projectID, domainID), nil)
}
func (s *ProjectsService) VerifyCustomDomain(ctx context.Context, projectID string, domainID string) (*VerifyCustomDomainResponse, error) {
return doJSON[VerifyCustomDomainResponse](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/domains/%s/verify", projectID, domainID), nil)
}
func (s *ProjectsService) ListProjects(ctx context.Context, params *ListProjectsParams) (*ListProjectsResponse, error) {
return doQuery[ListProjectsResponse](s.t, ctx, "/v1/projects", params)
}
func (s *ProjectsService) CreateProject(ctx context.Context, body CreateProjectRequest) (*CreateProjectResponse, error) {
return doJSON[CreateProjectResponse](s.t, ctx, "POST", "/v1/projects", body)
}
func (s *ProjectsService) GetProject(ctx context.Context, projectID string) (*Project, error) {
return doJSON[Project](s.t, ctx, "GET", fmt.Sprintf("/v1/projects/%s", projectID), nil)
}
func (s *ProjectsService) UpdateProject(ctx context.Context, projectID string, body UpdateProjectRequest) (*Project, error) {
return doJSON[Project](s.t, ctx, "PATCH", fmt.Sprintf("/v1/projects/%s", projectID), body)
}
func (s *ProjectsService) DeleteProject(ctx context.Context, projectID string) error {
return doVoid(s.t, ctx, "DELETE", fmt.Sprintf("/v1/projects/%s", projectID), nil)
}
func (s *ProjectsService) GetProjectMetrics(ctx context.Context, projectID string, params *GetProjectMetricsParams) (*ProjectMetricsResponse, error) {
return doQuery[ProjectMetricsResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/metrics", projectID), params)
}
func (s *ProjectsService) ListReplicas(ctx context.Context, databaseID string) (*ListReplicasResponse, error) {
return doJSON[ListReplicasResponse](s.t, ctx, "GET", fmt.Sprintf("/v1/databases/%s/replicas", databaseID), nil)
}
func (s *ProjectsService) CreateReplica(ctx context.Context, databaseID string, body CreateReplicaRequest) (*Replica, error) {
return doJSON[Replica](s.t, ctx, "POST", fmt.Sprintf("/v1/databases/%s/replicas", databaseID), body)
}
func (s *ProjectsService) DeleteReplica(ctx context.Context, databaseID string, replicaID string) error {
return doVoid(s.t, ctx, "DELETE", fmt.Sprintf("/v1/databases/%s/replicas/%s", databaseID, replicaID), nil)
}
// DatabasesService provides databases operations.
type DatabasesService struct{ t *transport }
func (s *DatabasesService) ListDatabases(ctx context.Context, projectID string, params *ListDatabasesParams) (*ListDatabasesResponse, error) {
return doQuery[ListDatabasesResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/databases", projectID), params)
}
func (s *DatabasesService) CreateDatabase(ctx context.Context, projectID string, body CreateDatabaseRequest) (*Database, error) {
return doJSON[Database](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/databases", projectID), body)
}
func (s *DatabasesService) GetDatabase(ctx context.Context, projectID string, databaseID string) (*Database, error) {
return doJSON[Database](s.t, ctx, "GET", fmt.Sprintf("/v1/projects/%s/databases/%s", projectID, databaseID), nil)
}
func (s *DatabasesService) UpdateDatabase(ctx context.Context, projectID string, databaseID string, body UpdateDatabaseRequest) (*Database, error) {
return doJSON[Database](s.t, ctx, "PATCH", fmt.Sprintf("/v1/projects/%s/databases/%s", projectID, databaseID), body)
}
func (s *DatabasesService) DeleteDatabase(ctx context.Context, projectID string, databaseID string) error {
return doVoid(s.t, ctx, "DELETE", fmt.Sprintf("/v1/projects/%s/databases/%s", projectID, databaseID), nil)
}
func (s *DatabasesService) TestDatabaseConnection(ctx context.Context, projectID string, databaseID string) (*TestConnectionResult, error) {
return doJSON[TestConnectionResult](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/databases/%s/test-connection", projectID, databaseID), nil)
}
func (s *DatabasesService) ScanDatabaseForPii(ctx context.Context, projectID string, databaseID string) (*ScanPiiResult, error) {
return doJSON[ScanPiiResult](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/databases/%s/scan-pii", projectID, databaseID), nil)
}
func (s *DatabasesService) GetSchemaCatalog(ctx context.Context, projectID string, databaseID string) (*SchemaCatalog, error) {
return doJSON[SchemaCatalog](s.t, ctx, "GET", fmt.Sprintf("/v1/projects/%s/databases/%s/schema-catalog", projectID, databaseID), nil)
}
// PoliciesService provides policies operations.
type PoliciesService struct{ t *transport }
func (s *PoliciesService) RecommendAgentPolicy(ctx context.Context, projectID string, agentID string, body PolicyRecommendationInput) (*PolicyRecommendation, error) {
return doJSON[PolicyRecommendation](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/agents/%s/policy-recommendation", projectID, agentID), body)
}
func (s *PoliciesService) ListPolicyProfiles(ctx context.Context, projectID string, params *ListPolicyProfilesParams) (*ListPolicyProfilesResponse, error) {
return doQuery[ListPolicyProfilesResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/policies", projectID), params)
}
func (s *PoliciesService) CreatePolicyProfile(ctx context.Context, projectID string, body PolicyProfileInput) (*PolicyProfile, error) {
return doJSON[PolicyProfile](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/policies", projectID), body)
}
func (s *PoliciesService) GetPolicyProfile(ctx context.Context, projectID string, policyID string) (*PolicyProfile, error) {
return doJSON[PolicyProfile](s.t, ctx, "GET", fmt.Sprintf("/v1/projects/%s/policies/%s", projectID, policyID), nil)
}
func (s *PoliciesService) UpdatePolicyProfile(ctx context.Context, projectID string, policyID string, body PolicyProfileInput) (*PolicyProfile, error) {
return doJSON[PolicyProfile](s.t, ctx, "PUT", fmt.Sprintf("/v1/projects/%s/policies/%s", projectID, policyID), body)
}
func (s *PoliciesService) DeletePolicyProfile(ctx context.Context, projectID string, policyID string) error {
return doVoid(s.t, ctx, "DELETE", fmt.Sprintf("/v1/projects/%s/policies/%s", projectID, policyID), nil)
}
func (s *PoliciesService) DryEvalPolicy(ctx context.Context, projectID string, body DryEvalInput) (*DryEvalResult, error) {
return doJSON[DryEvalResult](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/policy-evaluations", projectID), body)
}
func (s *PoliciesService) ReplayPolicy(ctx context.Context, projectID string, body PolicyReplayInput) (*PolicyReplayResult, error) {
return doJSON[PolicyReplayResult](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/policy-replays", projectID), body)
}
// AgentsService provides agents operations.
type AgentsService struct{ t *transport }
func (s *AgentsService) ListAgentCredentials(ctx context.Context, projectID string, params *ListAgentCredentialsParams) (*ListAgentCredentialsResponse, error) {
return doQuery[ListAgentCredentialsResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/agents", projectID), params)
}
func (s *AgentsService) CreateAgentCredential(ctx context.Context, projectID string, body CreateAgentCredentialRequest) (*AgentCredentialSecrets, error) {
return doJSON[AgentCredentialSecrets](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/agents", projectID), body)
}
func (s *AgentsService) GetAgentCredential(ctx context.Context, projectID string, agentID string) (*AgentCredential, error) {
return doJSON[AgentCredential](s.t, ctx, "GET", fmt.Sprintf("/v1/projects/%s/agents/%s", projectID, agentID), nil)
}
func (s *AgentsService) UpdateAgentCredentialStatus(ctx context.Context, projectID string, agentID string, body UpdateAgentCredentialStatusRequest) (*AgentCredential, error) {
return doJSON[AgentCredential](s.t, ctx, "PATCH", fmt.Sprintf("/v1/projects/%s/agents/%s", projectID, agentID), body)
}
func (s *AgentsService) RevokeAgentCredential(ctx context.Context, projectID string, agentID string) error {
return doVoid(s.t, ctx, "DELETE", fmt.Sprintf("/v1/projects/%s/agents/%s", projectID, agentID), nil)
}
func (s *AgentsService) RotateAgentCredential(ctx context.Context, projectID string, agentID string) (*AgentCredentialSecrets, error) {
return doJSON[AgentCredentialSecrets](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/agents/%s/rotate", projectID, agentID), nil)
}
func (s *AgentsService) ListAuditLogs(ctx context.Context, projectID string, params *ListAuditLogsParams) (*ListAuditLogsResponse, error) {
return doQuery[ListAuditLogsResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/audit-logs", projectID), params)
}
func (s *AgentsService) ExportAuditLogs(ctx context.Context, projectID string, params *ExportAuditLogsParams) error {
return doVoid(s.t, ctx, "GET", fmt.Sprintf("/v1/projects/%s/audit-logs/export", projectID), nil)
}
func (s *AgentsService) VerifyAuditChain(ctx context.Context, projectID string, params *VerifyAuditChainParams) (*AuditChainVerification, error) {
return doQuery[AuditChainVerification](s.t, ctx, fmt.Sprintf("/v1/projects/%s/audit-logs/verify", projectID), params)
}
// ApprovalsService provides approvals operations.
type ApprovalsService struct{ t *transport }
func (s *ApprovalsService) ListApprovalRequests(ctx context.Context, projectID string, params *ListApprovalRequestsParams) (*ListApprovalRequestsResponse, error) {
return doQuery[ListApprovalRequestsResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/approvals", projectID), params)
}
func (s *ApprovalsService) ApproveApprovalRequest(ctx context.Context, projectID string, approvalID string, body ApprovalDecisionRequest) (*ApprovalRequest, error) {
return doJSON[ApprovalRequest](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/approvals/%s/approve", projectID, approvalID), body)
}
func (s *ApprovalsService) RejectApprovalRequest(ctx context.Context, projectID string, approvalID string, body ApprovalDecisionRequest) (*ApprovalRequest, error) {
return doJSON[ApprovalRequest](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/approvals/%s/reject", projectID, approvalID), body)
}
// WebhooksService provides webhooks operations.
type WebhooksService struct{ t *transport }
func (s *WebhooksService) ListWebhookEndpoints(ctx context.Context, projectID string, params *ListWebhookEndpointsParams) (*ListWebhookEndpointsResponse, error) {
return doQuery[ListWebhookEndpointsResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/webhooks", projectID), params)
}
func (s *WebhooksService) CreateWebhookEndpoint(ctx context.Context, projectID string, body WebhookEndpointInput) (*WebhookEndpoint, error) {
return doJSON[WebhookEndpoint](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/webhooks", projectID), body)
}
func (s *WebhooksService) GetWebhookEndpoint(ctx context.Context, projectID string, webhookID string) (*WebhookEndpoint, error) {
return doJSON[WebhookEndpoint](s.t, ctx, "GET", fmt.Sprintf("/v1/projects/%s/webhooks/%s", projectID, webhookID), nil)
}
func (s *WebhooksService) UpdateWebhookEndpoint(ctx context.Context, projectID string, webhookID string, body WebhookEndpointInput) (*WebhookEndpoint, error) {
return doJSON[WebhookEndpoint](s.t, ctx, "PUT", fmt.Sprintf("/v1/projects/%s/webhooks/%s", projectID, webhookID), body)
}
func (s *WebhooksService) DeleteWebhookEndpoint(ctx context.Context, projectID string, webhookID string) error {
return doVoid(s.t, ctx, "DELETE", fmt.Sprintf("/v1/projects/%s/webhooks/%s", projectID, webhookID), nil)
}
func (s *WebhooksService) TestWebhookEndpoint(ctx context.Context, projectID string, webhookID string) error {
return doVoid(s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/webhooks/%s/test", projectID, webhookID), nil)
}
// AnomaliesService provides anomalies operations.
type AnomaliesService struct{ t *transport }
func (s *AnomaliesService) ListAnomalyAlerts(ctx context.Context, projectID string, params *ListAnomalyAlertsParams) (*ListAnomalyAlertsResponse, error) {
return doQuery[ListAnomalyAlertsResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/anomalies", projectID), params)
}
func (s *AnomaliesService) UpdateAnomalyAlert(ctx context.Context, projectID string, anomalyID string, body UpdateAnomalyAlertRequest) (*AnomalyAlert, error) {
return doJSON[AnomalyAlert](s.t, ctx, "PATCH", fmt.Sprintf("/v1/projects/%s/anomalies/%s", projectID, anomalyID), body)
}
// BranchesService provides branches operations.
type BranchesService struct{ t *transport }
func (s *BranchesService) ListDatabaseBranches(ctx context.Context, projectID string, params *ListDatabaseBranchesParams) (*ListDatabaseBranchesResponse, error) {
return doQuery[ListDatabaseBranchesResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/branches", projectID), params)
}
func (s *BranchesService) DiscardDatabaseBranch(ctx context.Context, projectID string, branchID string) error {
return doVoid(s.t, ctx, "DELETE", fmt.Sprintf("/v1/projects/%s/branches/%s", projectID, branchID), nil)
}
// MigrationsService provides migrations operations.
type MigrationsService struct{ t *transport }
func (s *MigrationsService) LintMigration(ctx context.Context, projectID string, body MigrationLintRequest) (*MigrationLintResponse, error) {
return doJSON[MigrationLintResponse](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/migrations:lint", projectID), body)
}
// AnalyticsService provides analytics operations.
type AnalyticsService struct{ t *transport }
func (s *AnalyticsService) ListPlans(ctx context.Context) (*ListPlansResponse, error) {
return doJSON[ListPlansResponse](s.t, ctx, "GET", "/v1/plans", nil)
}
func (s *AnalyticsService) GetOrganizationPlan(ctx context.Context, orgID string) (*OrganizationPlan, error) {
return doJSON[OrganizationPlan](s.t, ctx, "GET", fmt.Sprintf("/v1/organizations/%s/plan", orgID), nil)
}
func (s *AnalyticsService) GetVercelInstallation(ctx context.Context, orgID string) (*VercelInstallationStatus, error) {
return doJSON[VercelInstallationStatus](s.t, ctx, "GET", fmt.Sprintf("/v1/organizations/%s/vercel-installation", orgID), nil)
}
func (s *AnalyticsService) UpdateSpendLimit(ctx context.Context, orgID string, body UpdateSpendLimitRequest) (*OrganizationPlan, error) {
return doJSON[OrganizationPlan](s.t, ctx, "PUT", fmt.Sprintf("/v1/organizations/%s/spend-limit", orgID), body)
}
func (s *AnalyticsService) SubmitCancellationFeedback(ctx context.Context, orgID string, body CancellationFeedbackRequest) error {
return doVoid(s.t, ctx, "POST", fmt.Sprintf("/v1/organizations/%s/cancellation-feedback", orgID), body)
}
func (s *AnalyticsService) GetProjectInsights(ctx context.Context, projectID string, params *GetProjectInsightsParams) (*ProjectInsights, error) {
return doQuery[ProjectInsights](s.t, ctx, fmt.Sprintf("/v1/projects/%s/insights", projectID), params)
}
func (s *AnalyticsService) GetOrganizationUsage(ctx context.Context, orgID string, params *GetOrganizationUsageParams) (*UsageResponse, error) {
return doQuery[UsageResponse](s.t, ctx, fmt.Sprintf("/v1/organizations/%s/usage", orgID), params)
}
func (s *AnalyticsService) GetProjectUsage(ctx context.Context, projectID string, params *GetProjectUsageParams) (*ProjectUsageResponse, error) {
return doQuery[ProjectUsageResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/usage", projectID), params)
}
// PlatformService provides platform operations.
type PlatformService struct{ t *transport }
func (s *PlatformService) GetHealth(ctx context.Context) (*HealthResponse, error) {
return doJSON[HealthResponse](s.t, ctx, "GET", "/v1/health", nil)
}
func (s *PlatformService) ListRegions(ctx context.Context) (*ListRegionsResponse, error) {
return doJSON[ListRegionsResponse](s.t, ctx, "GET", "/v1/regions", nil)
}
func (s *PlatformService) ListSelfHostEnrollments(ctx context.Context, orgID string) (*ListSelfHostEnrollmentsResponse, error) {
return doJSON[ListSelfHostEnrollmentsResponse](s.t, ctx, "GET", fmt.Sprintf("/v1/organizations/%s/self-host-enrollments", orgID), nil)
}
func (s *PlatformService) CreateSelfHostEnrollment(ctx context.Context, orgID string, body CreateSelfHostEnrollmentRequest) (*SelfHostEnrollmentSecret, error) {
return doJSON[SelfHostEnrollmentSecret](s.t, ctx, "POST", fmt.Sprintf("/v1/organizations/%s/self-host-enrollments", orgID), body)
}
func (s *PlatformService) RevokeSelfHostEnrollment(ctx context.Context, orgID string, enrollmentID string) error {
return doVoid(s.t, ctx, "DELETE", fmt.Sprintf("/v1/organizations/%s/self-host-enrollments/%s", orgID, enrollmentID), nil)
}
func (s *PlatformService) RotateSelfHostEnrollment(ctx context.Context, orgID string, enrollmentID string) (*SelfHostEnrollmentSecret, error) {
return doJSON[SelfHostEnrollmentSecret](s.t, ctx, "POST", fmt.Sprintf("/v1/organizations/%s/self-host-enrollments/%s/rotate", orgID, enrollmentID), nil)
}
// AccountService provides account operations.
type AccountService struct{ t *transport }
func (s *AccountService) ExportAccountData(ctx context.Context) (*AccountExport, error) {
return doJSON[AccountExport](s.t, ctx, "GET", "/v1/account/export", nil)
}
func (s *AccountService) GetOnboardingProgress(ctx context.Context, orgID string) (*OnboardingProgress, error) {
return doJSON[OnboardingProgress](s.t, ctx, "GET", fmt.Sprintf("/v1/organizations/%s/onboarding", orgID), nil)
}
func (s *AccountService) UpdateOnboardingProgress(ctx context.Context, orgID string, body UpdateOnboardingRequest) (*OnboardingProgress, error) {
return doJSON[OnboardingProgress](s.t, ctx, "PATCH", fmt.Sprintf("/v1/organizations/%s/onboarding", orgID), body)
}
func (s *AccountService) ListOrganizations(ctx context.Context) (*ListOrganizationsResponse, error) {
return doJSON[ListOrganizationsResponse](s.t, ctx, "GET", "/v1/organizations", nil)
}
// HoneytokensService provides honeytokens operations.
type HoneytokensService struct{ t *transport }
func (s *HoneytokensService) ListHoneytokens(ctx context.Context, projectID string, params *ListHoneytokensParams) (*ListHoneytokensResponse, error) {
return doQuery[ListHoneytokensResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/honeytokens", projectID), params)
}
func (s *HoneytokensService) CreateHoneytoken(ctx context.Context, projectID string, body HoneytokenInput) (*Honeytoken, error) {
return doJSON[Honeytoken](s.t, ctx, "POST", fmt.Sprintf("/v1/projects/%s/honeytokens", projectID), body)
}
func (s *HoneytokensService) GetHoneytoken(ctx context.Context, projectID string, honeytokenID string) (*Honeytoken, error) {
return doJSON[Honeytoken](s.t, ctx, "GET", fmt.Sprintf("/v1/projects/%s/honeytokens/%s", projectID, honeytokenID), nil)
}
func (s *HoneytokensService) UpdateHoneytoken(ctx context.Context, projectID string, honeytokenID string, body HoneytokenInput) (*Honeytoken, error) {
return doJSON[Honeytoken](s.t, ctx, "PUT", fmt.Sprintf("/v1/projects/%s/honeytokens/%s", projectID, honeytokenID), body)
}
func (s *HoneytokensService) DeleteHoneytoken(ctx context.Context, projectID string, honeytokenID string) error {
return doVoid(s.t, ctx, "DELETE", fmt.Sprintf("/v1/projects/%s/honeytokens/%s", projectID, honeytokenID), nil)
}
// InternalService provides internal operations.
type InternalService struct{ t *transport }
func (s *InternalService) HandleSlackSupportEvent(ctx context.Context, body SlackEventPayload) error {
return doVoid(s.t, ctx, "POST", "/v1/internal/support/slack-event", body)
}
// SchemaannotationsService provides schemaannotations operations.
type SchemaannotationsService struct{ t *transport }
func (s *SchemaannotationsService) ListSchemaAnnotations(ctx context.Context, projectID string, params *ListSchemaAnnotationsParams) (*ListSchemaAnnotationsResponse, error) {
return doQuery[ListSchemaAnnotationsResponse](s.t, ctx, fmt.Sprintf("/v1/projects/%s/schema-annotations", projectID), params)
}
func (s *SchemaannotationsService) PutSchemaAnnotation(ctx context.Context, projectID string, body SchemaAnnotationInput) (*SchemaAnnotation, error) {
return doJSON[SchemaAnnotation](s.t, ctx, "PUT", fmt.Sprintf("/v1/projects/%s/schema-annotations", projectID), body)
}
func (s *SchemaannotationsService) DeleteSchemaAnnotation(ctx context.Context, projectID string, params *DeleteSchemaAnnotationParams) error {
return doVoid(s.t, ctx, "DELETE", fmt.Sprintf("/v1/projects/%s/schema-annotations", projectID), nil)
}
// SupportService provides support operations.
type SupportService struct{ t *transport }
func (s *SupportService) ListSupportCases(ctx context.Context, orgID string, params *ListSupportCasesParams) (*ListSupportCasesResponse, error) {
return doQuery[ListSupportCasesResponse](s.t, ctx, fmt.Sprintf("/v1/organizations/%s/support/cases", orgID), params)
}
func (s *SupportService) CreateSupportCase(ctx context.Context, orgID string, body CreateSupportCaseRequest) (*SupportCase, error) {
return doJSON[SupportCase](s.t, ctx, "POST", fmt.Sprintf("/v1/organizations/%s/support/cases", orgID), body)
}
func (s *SupportService) GetSupportCase(ctx context.Context, orgID string, caseID string) (*GetSupportCaseResponse, error) {
return doJSON[GetSupportCaseResponse](s.t, ctx, "GET", fmt.Sprintf("/v1/organizations/%s/support/cases/%s", orgID, caseID), nil)
}
func (s *SupportService) UpdateSupportCase(ctx context.Context, orgID string, caseID string, body UpdateSupportCaseRequest) (*SupportCase, error) {
return doJSON[SupportCase](s.t, ctx, "PATCH", fmt.Sprintf("/v1/organizations/%s/support/cases/%s", orgID, caseID), body)
}
func (s *SupportService) CreateSupportMessage(ctx context.Context, orgID string, caseID string, body CreateSupportMessageRequest) (*SupportMessage, error) {
return doJSON[SupportMessage](s.t, ctx, "POST", fmt.Sprintf("/v1/organizations/%s/support/cases/%s/messages", orgID, caseID), body)
}