|
| 1 | +package clients |
| 2 | + |
| 3 | +import ( |
| 4 | + "context" |
| 5 | + |
| 6 | + lexatic_backend "github.com/rapidaai/rapida-go/rapida/clients/protos" |
| 7 | + "github.com/rapidaai/rapida-go/rapida/connections" |
| 8 | + "google.golang.org/grpc" |
| 9 | +) |
| 10 | + |
| 11 | +func GetEndpoint(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.GetEndpointRequest, opts ...grpc.CallOption) (*lexatic_backend.GetEndpointResponse, error) { |
| 12 | + |
| 13 | + client, err := connectionConfig.EndpointServiceClient() |
| 14 | + if err != nil { |
| 15 | + return nil, err |
| 16 | + } |
| 17 | + return client.GetEndpoint(connectionConfig.WithAuth(ctx), in, opts...) |
| 18 | +} |
| 19 | +func GetAllEndpoint(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.GetAllEndpointRequest, opts ...grpc.CallOption) (*lexatic_backend.GetAllEndpointResponse, error) { |
| 20 | + |
| 21 | + client, err := connectionConfig.EndpointServiceClient() |
| 22 | + if err != nil { |
| 23 | + return nil, err |
| 24 | + } |
| 25 | + return client.GetAllEndpoint(connectionConfig.WithAuth(ctx), in, opts...) |
| 26 | +} |
| 27 | +func GetAllEndpointProviderModel(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.GetAllEndpointProviderModelRequest, opts ...grpc.CallOption) (*lexatic_backend.GetAllEndpointProviderModelResponse, error) { |
| 28 | + |
| 29 | + client, err := connectionConfig.EndpointServiceClient() |
| 30 | + if err != nil { |
| 31 | + return nil, err |
| 32 | + } |
| 33 | + return client.GetAllEndpointProviderModel(connectionConfig.WithAuth(ctx), in, opts...) |
| 34 | +} |
| 35 | +func UpdateEndpointVersion(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.UpdateEndpointVersionRequest, opts ...grpc.CallOption) (*lexatic_backend.UpdateEndpointVersionResponse, error) { |
| 36 | + |
| 37 | + client, err := connectionConfig.EndpointServiceClient() |
| 38 | + if err != nil { |
| 39 | + return nil, err |
| 40 | + } |
| 41 | + return client.UpdateEndpointVersion(connectionConfig.WithAuth(ctx), in, opts...) |
| 42 | +} |
| 43 | +func CreateEndpoint(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.CreateEndpointRequest, opts ...grpc.CallOption) (*lexatic_backend.CreateEndpointResponse, error) { |
| 44 | + |
| 45 | + client, err := connectionConfig.EndpointServiceClient() |
| 46 | + if err != nil { |
| 47 | + return nil, err |
| 48 | + } |
| 49 | + return client.CreateEndpoint(connectionConfig.WithAuth(ctx), in, opts...) |
| 50 | +} |
| 51 | +func CreateEndpointProviderModel(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.CreateEndpointProviderModelRequest, opts ...grpc.CallOption) (*lexatic_backend.CreateEndpointProviderModelResponse, error) { |
| 52 | + |
| 53 | + client, err := connectionConfig.EndpointServiceClient() |
| 54 | + if err != nil { |
| 55 | + return nil, err |
| 56 | + } |
| 57 | + return client.CreateEndpointProviderModel(connectionConfig.WithAuth(ctx), in, opts...) |
| 58 | +} |
| 59 | +func CreateEndpointCacheConfiguration(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.CreateEndpointCacheConfigurationRequest, opts ...grpc.CallOption) (*lexatic_backend.CreateEndpointCacheConfigurationResponse, error) { |
| 60 | + |
| 61 | + client, err := connectionConfig.EndpointServiceClient() |
| 62 | + if err != nil { |
| 63 | + return nil, err |
| 64 | + } |
| 65 | + return client.CreateEndpointCacheConfiguration(connectionConfig.WithAuth(ctx), in, opts...) |
| 66 | +} |
| 67 | +func CreateEndpointRetryConfiguration(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.CreateEndpointRetryConfigurationRequest, opts ...grpc.CallOption) (*lexatic_backend.CreateEndpointRetryConfigurationResponse, error) { |
| 68 | + |
| 69 | + client, err := connectionConfig.EndpointServiceClient() |
| 70 | + if err != nil { |
| 71 | + return nil, err |
| 72 | + } |
| 73 | + return client.CreateEndpointRetryConfiguration(connectionConfig.WithAuth(ctx), in, opts...) |
| 74 | +} |
| 75 | +func CreateEndpointTag(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.CreateEndpointTagRequest, opts ...grpc.CallOption) (*lexatic_backend.GetEndpointResponse, error) { |
| 76 | + |
| 77 | + client, err := connectionConfig.EndpointServiceClient() |
| 78 | + if err != nil { |
| 79 | + return nil, err |
| 80 | + } |
| 81 | + return client.CreateEndpointTag(connectionConfig.WithAuth(ctx), in, opts...) |
| 82 | +} |
| 83 | +func ForkEndpoint(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.ForkEndpointRequest, opts ...grpc.CallOption) (*lexatic_backend.BaseResponse, error) { |
| 84 | + |
| 85 | + client, err := connectionConfig.EndpointServiceClient() |
| 86 | + if err != nil { |
| 87 | + return nil, err |
| 88 | + } |
| 89 | + return client.ForkEndpoint(connectionConfig.WithAuth(ctx), in, opts...) |
| 90 | +} |
| 91 | +func UpdateEndpointDetail(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.UpdateEndpointDetailRequest, opts ...grpc.CallOption) (*lexatic_backend.GetEndpointResponse, error) { |
| 92 | + |
| 93 | + client, err := connectionConfig.EndpointServiceClient() |
| 94 | + if err != nil { |
| 95 | + return nil, err |
| 96 | + } |
| 97 | + return client.UpdateEndpointDetail(connectionConfig.WithAuth(ctx), in, opts...) |
| 98 | +} |
| 99 | +func GetAllEndpointLog(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.GetAllEndpointLogRequest, opts ...grpc.CallOption) (*lexatic_backend.GetAllEndpointLogResponse, error) { |
| 100 | + |
| 101 | + client, err := connectionConfig.EndpointServiceClient() |
| 102 | + if err != nil { |
| 103 | + return nil, err |
| 104 | + } |
| 105 | + return client.GetAllEndpointLog(connectionConfig.WithAuth(ctx), in, opts...) |
| 106 | +} |
| 107 | +func GetEndpointLog(ctx context.Context, connectionConfig connections.ConnectionConfig, in *lexatic_backend.GetEndpointLogRequest, opts ...grpc.CallOption) (*lexatic_backend.GetEndpointLogResponse, error) { |
| 108 | + |
| 109 | + client, err := connectionConfig.EndpointServiceClient() |
| 110 | + if err != nil { |
| 111 | + return nil, err |
| 112 | + } |
| 113 | + return client.GetEndpointLog(connectionConfig.WithAuth(ctx), in, opts...) |
| 114 | +} |
0 commit comments