cloud.google.com/go/aiplatform@v1.106.0/apiv1/aiplatformpb/model_garden_service_grpc.pb.go (about) 1 // Copyright 2025 Google LLC 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 16 // versions: 17 // - protoc-gen-go-grpc v1.3.0 18 // - protoc v4.25.7 19 // source: google/cloud/aiplatform/v1/model_garden_service.proto 20 21 package aiplatformpb 22 23 import ( 24 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" 25 context "context" 26 grpc "google.golang.org/grpc" 27 codes "google.golang.org/grpc/codes" 28 status "google.golang.org/grpc/status" 29 ) 30 31 // This is a compile-time assertion to ensure that this generated file 32 // is compatible with the grpc package it is being compiled against. 33 // Requires gRPC-Go v1.32.0 or later. 34 const _ = grpc.SupportPackageIsVersion7 35 36 const ( 37 ModelGardenService_GetPublisherModel_FullMethodName = "/google.cloud.aiplatform.v1.ModelGardenService/GetPublisherModel" 38 ModelGardenService_Deploy_FullMethodName = "/google.cloud.aiplatform.v1.ModelGardenService/Deploy" 39 ) 40 41 // ModelGardenServiceClient is the client API for ModelGardenService service. 42 // 43 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 44 type ModelGardenServiceClient interface { 45 // Gets a Model Garden publisher model. 46 GetPublisherModel(ctx context.Context, in *GetPublisherModelRequest, opts ...grpc.CallOption) (*PublisherModel, error) 47 // Deploys a model to a new endpoint. 48 Deploy(ctx context.Context, in *DeployRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) 49 } 50 51 type modelGardenServiceClient struct { 52 cc grpc.ClientConnInterface 53 } 54 55 func NewModelGardenServiceClient(cc grpc.ClientConnInterface) ModelGardenServiceClient { 56 return &modelGardenServiceClient{cc} 57 } 58 59 func (c *modelGardenServiceClient) GetPublisherModel(ctx context.Context, in *GetPublisherModelRequest, opts ...grpc.CallOption) (*PublisherModel, error) { 60 out := new(PublisherModel) 61 err := c.cc.Invoke(ctx, ModelGardenService_GetPublisherModel_FullMethodName, in, out, opts...) 62 if err != nil { 63 return nil, err 64 } 65 return out, nil 66 } 67 68 func (c *modelGardenServiceClient) Deploy(ctx context.Context, in *DeployRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { 69 out := new(longrunningpb.Operation) 70 err := c.cc.Invoke(ctx, ModelGardenService_Deploy_FullMethodName, in, out, opts...) 71 if err != nil { 72 return nil, err 73 } 74 return out, nil 75 } 76 77 // ModelGardenServiceServer is the server API for ModelGardenService service. 78 // All implementations should embed UnimplementedModelGardenServiceServer 79 // for forward compatibility 80 type ModelGardenServiceServer interface { 81 // Gets a Model Garden publisher model. 82 GetPublisherModel(context.Context, *GetPublisherModelRequest) (*PublisherModel, error) 83 // Deploys a model to a new endpoint. 84 Deploy(context.Context, *DeployRequest) (*longrunningpb.Operation, error) 85 } 86 87 // UnimplementedModelGardenServiceServer should be embedded to have forward compatible implementations. 88 type UnimplementedModelGardenServiceServer struct { 89 } 90 91 func (UnimplementedModelGardenServiceServer) GetPublisherModel(context.Context, *GetPublisherModelRequest) (*PublisherModel, error) { 92 return nil, status.Errorf(codes.Unimplemented, "method GetPublisherModel not implemented") 93 } 94 func (UnimplementedModelGardenServiceServer) Deploy(context.Context, *DeployRequest) (*longrunningpb.Operation, error) { 95 return nil, status.Errorf(codes.Unimplemented, "method Deploy not implemented") 96 } 97 98 // UnsafeModelGardenServiceServer may be embedded to opt out of forward compatibility for this service. 99 // Use of this interface is not recommended, as added methods to ModelGardenServiceServer will 100 // result in compilation errors. 101 type UnsafeModelGardenServiceServer interface { 102 mustEmbedUnimplementedModelGardenServiceServer() 103 } 104 105 func RegisterModelGardenServiceServer(s grpc.ServiceRegistrar, srv ModelGardenServiceServer) { 106 s.RegisterService(&ModelGardenService_ServiceDesc, srv) 107 } 108 109 func _ModelGardenService_GetPublisherModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 110 in := new(GetPublisherModelRequest) 111 if err := dec(in); err != nil { 112 return nil, err 113 } 114 if interceptor == nil { 115 return srv.(ModelGardenServiceServer).GetPublisherModel(ctx, in) 116 } 117 info := &grpc.UnaryServerInfo{ 118 Server: srv, 119 FullMethod: ModelGardenService_GetPublisherModel_FullMethodName, 120 } 121 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 122 return srv.(ModelGardenServiceServer).GetPublisherModel(ctx, req.(*GetPublisherModelRequest)) 123 } 124 return interceptor(ctx, in, info, handler) 125 } 126 127 func _ModelGardenService_Deploy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 128 in := new(DeployRequest) 129 if err := dec(in); err != nil { 130 return nil, err 131 } 132 if interceptor == nil { 133 return srv.(ModelGardenServiceServer).Deploy(ctx, in) 134 } 135 info := &grpc.UnaryServerInfo{ 136 Server: srv, 137 FullMethod: ModelGardenService_Deploy_FullMethodName, 138 } 139 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 140 return srv.(ModelGardenServiceServer).Deploy(ctx, req.(*DeployRequest)) 141 } 142 return interceptor(ctx, in, info, handler) 143 } 144 145 // ModelGardenService_ServiceDesc is the grpc.ServiceDesc for ModelGardenService service. 146 // It's only intended for direct use with grpc.RegisterService, 147 // and not to be introspected or modified (even as a copy) 148 var ModelGardenService_ServiceDesc = grpc.ServiceDesc{ 149 ServiceName: "google.cloud.aiplatform.v1.ModelGardenService", 150 HandlerType: (*ModelGardenServiceServer)(nil), 151 Methods: []grpc.MethodDesc{ 152 { 153 MethodName: "GetPublisherModel", 154 Handler: _ModelGardenService_GetPublisherModel_Handler, 155 }, 156 { 157 MethodName: "Deploy", 158 Handler: _ModelGardenService_Deploy_Handler, 159 }, 160 }, 161 Streams: []grpc.StreamDesc{}, 162 Metadata: "google/cloud/aiplatform/v1/model_garden_service.proto", 163 }