11package api
22
3- import "context"
3+ import (
4+ "context"
5+
6+ v1pb "buf.build/gen/go/bytebase/bytebase/protocolbuffers/go/v1"
7+ )
48
59// Client is the API message for Bytebase OpenAPI client.
610type Client interface {
711 // Auth
812 // Login will login the user and get the response.
9- Login () (* AuthResponse , error )
13+ Login () (* v1pb. LoginResponse , error )
1014
1115 // Environment
1216 // 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 )
1418 // 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 )
1620 // ListEnvironment finds all environments.
17- ListEnvironment (ctx context.Context , showDeleted bool ) (* ListEnvironmentMessage , error )
21+ ListEnvironment (ctx context.Context , showDeleted bool ) (* v1pb. ListEnvironmentsResponse , error )
1822 // 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 )
2024 // DeleteEnvironment deletes the environment.
2125 DeleteEnvironment (ctx context.Context , environmentName string ) error
2226 // UndeleteEnvironment undeletes the environment.
23- UndeleteEnvironment (ctx context.Context , environmentName string ) (* EnvironmentMessage , error )
27+ UndeleteEnvironment (ctx context.Context , environmentName string ) (* v1pb. Environment , error )
2428
2529 // Instance
2630 // ListInstance will return instances.
27- ListInstance (ctx context.Context , find * InstanceFindMessage ) (* ListInstanceMessage , error )
31+ ListInstance (ctx context.Context , showDeleted bool ) (* v1pb. ListInstancesResponse , error )
2832 // 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 )
3034 // 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 )
3236 // 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 )
3438 // DeleteInstance deletes the instance.
3539 DeleteInstance (ctx context.Context , instanceName string ) error
3640 // UndeleteInstance undeletes the instance.
37- UndeleteInstance (ctx context.Context , instanceName string ) (* InstanceMessage , error )
41+ UndeleteInstance (ctx context.Context , instanceName string ) (* v1pb. Instance , error )
3842 // SyncInstanceSchema will trigger the schema sync for an instance.
3943 SyncInstanceSchema (ctx context.Context , instanceName string ) error
4044
@@ -50,23 +54,23 @@ type Client interface {
5054
5155 // Database
5256 // 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 )
5458 // ListDatabase list the databases.
55- ListDatabase (ctx context.Context , find * DatabaseFindMessage ) (* ListDatabaseMessage , error )
59+ ListDatabase (ctx context.Context , instanceID , filter string ) (* v1pb. ListDatabasesResponse , error )
5660 // 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 )
5862
5963 // Project
6064 // 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 )
6266 // ListProject list the projects,
63- ListProject (ctx context.Context , showDeleted bool ) (* ListProjectMessage , error )
67+ ListProject (ctx context.Context , showDeleted bool ) (* v1pb. ListProjectsResponse , error )
6468 // 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 )
6670 // 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 )
6872 // DeleteProject deletes the project.
6973 DeleteProject (ctx context.Context , projectName string ) error
7074 // UndeleteProject undeletes the project.
71- UndeleteProject (ctx context.Context , projectName string ) (* ProjectMessage , error )
75+ UndeleteProject (ctx context.Context , projectName string ) (* v1pb. Project , error )
7276}
0 commit comments