1
1
package api
2
2
3
- import "context"
3
+ import (
4
+ "context"
5
+
6
+ v1pb "buf.build/gen/go/bytebase/bytebase/protocolbuffers/go/v1"
7
+ )
4
8
5
9
// Client is the API message for Bytebase OpenAPI client.
6
10
type Client interface {
7
11
// Auth
8
12
// Login will login the user and get the response.
9
- Login () (* AuthResponse , error )
13
+ Login () (* v1pb. LoginResponse , error )
10
14
11
15
// Environment
12
16
// CreateEnvironment creates the environment.
13
- CreateEnvironment (ctx context.Context , environmentID string , create * EnvironmentMessage ) (* EnvironmentMessage , error )
17
+ CreateEnvironment (ctx context.Context , environmentID string , create * v1pb. Environment ) (* v1pb. Environment , error )
14
18
// GetEnvironment gets the environment by id.
15
- GetEnvironment (ctx context.Context , environmentName string ) (* EnvironmentMessage , error )
19
+ GetEnvironment (ctx context.Context , environmentName string ) (* v1pb. Environment , error )
16
20
// ListEnvironment finds all environments.
17
- ListEnvironment (ctx context.Context , showDeleted bool ) (* ListEnvironmentMessage , error )
21
+ ListEnvironment (ctx context.Context , showDeleted bool ) (* v1pb. ListEnvironmentsResponse , error )
18
22
// UpdateEnvironment updates the environment.
19
- UpdateEnvironment (ctx context.Context , patch * EnvironmentPatchMessage ) (* EnvironmentMessage , error )
23
+ UpdateEnvironment (ctx context.Context , patch * v1pb. Environment , updateMask [] string ) (* v1pb. Environment , error )
20
24
// DeleteEnvironment deletes the environment.
21
25
DeleteEnvironment (ctx context.Context , environmentName string ) error
22
26
// UndeleteEnvironment undeletes the environment.
23
- UndeleteEnvironment (ctx context.Context , environmentName string ) (* EnvironmentMessage , error )
27
+ UndeleteEnvironment (ctx context.Context , environmentName string ) (* v1pb. Environment , error )
24
28
25
29
// Instance
26
30
// ListInstance will return instances.
27
- ListInstance (ctx context.Context , find * InstanceFindMessage ) (* ListInstanceMessage , error )
31
+ ListInstance (ctx context.Context , showDeleted bool ) (* v1pb. ListInstancesResponse , error )
28
32
// GetInstance gets the instance by id.
29
- GetInstance (ctx context.Context , instanceName string ) (* InstanceMessage , error )
33
+ GetInstance (ctx context.Context , instanceName string ) (* v1pb. Instance , error )
30
34
// CreateInstance creates the instance.
31
- CreateInstance (ctx context.Context , instanceID string , instance * InstanceMessage ) (* InstanceMessage , error )
35
+ CreateInstance (ctx context.Context , instanceID string , instance * v1pb. Instance ) (* v1pb. Instance , error )
32
36
// UpdateInstance updates the instance.
33
- UpdateInstance (ctx context.Context , patch * InstancePatchMessage ) (* InstanceMessage , error )
37
+ UpdateInstance (ctx context.Context , patch * v1pb. Instance , updateMasks [] string ) (* v1pb. Instance , error )
34
38
// DeleteInstance deletes the instance.
35
39
DeleteInstance (ctx context.Context , instanceName string ) error
36
40
// UndeleteInstance undeletes the instance.
37
- UndeleteInstance (ctx context.Context , instanceName string ) (* InstanceMessage , error )
41
+ UndeleteInstance (ctx context.Context , instanceName string ) (* v1pb. Instance , error )
38
42
// SyncInstanceSchema will trigger the schema sync for an instance.
39
43
SyncInstanceSchema (ctx context.Context , instanceName string ) error
40
44
@@ -50,23 +54,23 @@ type Client interface {
50
54
51
55
// Database
52
56
// GetDatabase gets the database by instance resource id and the database name.
53
- GetDatabase (ctx context.Context , databaseName string ) (* DatabaseMessage , error )
57
+ GetDatabase (ctx context.Context , databaseName string ) (* v1pb. Database , error )
54
58
// ListDatabase list the databases.
55
- ListDatabase (ctx context.Context , find * DatabaseFindMessage ) (* ListDatabaseMessage , error )
59
+ ListDatabase (ctx context.Context , instanceID , filter string ) (* v1pb. ListDatabasesResponse , error )
56
60
// UpdateDatabase patches the database.
57
- UpdateDatabase (ctx context.Context , patch * DatabasePatchMessage ) (* DatabaseMessage , error )
61
+ UpdateDatabase (ctx context.Context , patch * v1pb. Database , updateMasks [] string ) (* v1pb. Database , error )
58
62
59
63
// Project
60
64
// GetProject gets the project by resource id.
61
- GetProject (ctx context.Context , projectName string ) (* ProjectMessage , error )
65
+ GetProject (ctx context.Context , projectName string ) (* v1pb. Project , error )
62
66
// ListProject list the projects,
63
- ListProject (ctx context.Context , showDeleted bool ) (* ListProjectMessage , error )
67
+ ListProject (ctx context.Context , showDeleted bool ) (* v1pb. ListProjectsResponse , error )
64
68
// CreateProject creates the project.
65
- CreateProject (ctx context.Context , projectID string , project * ProjectMessage ) (* ProjectMessage , error )
69
+ CreateProject (ctx context.Context , projectID string , project * v1pb. Project ) (* v1pb. Project , error )
66
70
// UpdateProject updates the project.
67
- UpdateProject (ctx context.Context , patch * ProjectPatchMessage ) (* ProjectMessage , error )
71
+ UpdateProject (ctx context.Context , patch * v1pb. Project , updateMask [] string ) (* v1pb. Project , error )
68
72
// DeleteProject deletes the project.
69
73
DeleteProject (ctx context.Context , projectName string ) error
70
74
// UndeleteProject undeletes the project.
71
- UndeleteProject (ctx context.Context , projectName string ) (* ProjectMessage , error )
75
+ UndeleteProject (ctx context.Context , projectName string ) (* v1pb. Project , error )
72
76
}
0 commit comments