go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/deploy/api/rpcpb/assets_grpc.pb.go (about) 1 // Copyright 2022 The LUCI Authors. 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 v3.21.7 19 // source: go.chromium.org/luci/deploy/api/rpcpb/assets.proto 20 21 package rpcpb 22 23 import ( 24 context "context" 25 modelpb "go.chromium.org/luci/deploy/api/modelpb" 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 Assets_GetAsset_FullMethodName = "/deploy.service.Assets/GetAsset" 38 Assets_ListAssets_FullMethodName = "/deploy.service.Assets/ListAssets" 39 Assets_ListAssetHistory_FullMethodName = "/deploy.service.Assets/ListAssetHistory" 40 ) 41 42 // AssetsClient is the client API for Assets service. 43 // 44 // 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. 45 type AssetsClient interface { 46 // GetAsset returns an Asset given its ID. 47 GetAsset(ctx context.Context, in *GetAssetRequest, opts ...grpc.CallOption) (*modelpb.Asset, error) 48 // ListAssets lists assets matching specified filters (if any). 49 ListAssets(ctx context.Context, in *ListAssetsRequest, opts ...grpc.CallOption) (*ListAssetsResponse, error) 50 // ListAssetHistory fetches an asset and its actuation history. 51 ListAssetHistory(ctx context.Context, in *ListAssetHistoryRequest, opts ...grpc.CallOption) (*ListAssetHistoryResponse, error) 52 } 53 54 type assetsClient struct { 55 cc grpc.ClientConnInterface 56 } 57 58 func NewAssetsClient(cc grpc.ClientConnInterface) AssetsClient { 59 return &assetsClient{cc} 60 } 61 62 func (c *assetsClient) GetAsset(ctx context.Context, in *GetAssetRequest, opts ...grpc.CallOption) (*modelpb.Asset, error) { 63 out := new(modelpb.Asset) 64 err := c.cc.Invoke(ctx, Assets_GetAsset_FullMethodName, in, out, opts...) 65 if err != nil { 66 return nil, err 67 } 68 return out, nil 69 } 70 71 func (c *assetsClient) ListAssets(ctx context.Context, in *ListAssetsRequest, opts ...grpc.CallOption) (*ListAssetsResponse, error) { 72 out := new(ListAssetsResponse) 73 err := c.cc.Invoke(ctx, Assets_ListAssets_FullMethodName, in, out, opts...) 74 if err != nil { 75 return nil, err 76 } 77 return out, nil 78 } 79 80 func (c *assetsClient) ListAssetHistory(ctx context.Context, in *ListAssetHistoryRequest, opts ...grpc.CallOption) (*ListAssetHistoryResponse, error) { 81 out := new(ListAssetHistoryResponse) 82 err := c.cc.Invoke(ctx, Assets_ListAssetHistory_FullMethodName, in, out, opts...) 83 if err != nil { 84 return nil, err 85 } 86 return out, nil 87 } 88 89 // AssetsServer is the server API for Assets service. 90 // All implementations must embed UnimplementedAssetsServer 91 // for forward compatibility 92 type AssetsServer interface { 93 // GetAsset returns an Asset given its ID. 94 GetAsset(context.Context, *GetAssetRequest) (*modelpb.Asset, error) 95 // ListAssets lists assets matching specified filters (if any). 96 ListAssets(context.Context, *ListAssetsRequest) (*ListAssetsResponse, error) 97 // ListAssetHistory fetches an asset and its actuation history. 98 ListAssetHistory(context.Context, *ListAssetHistoryRequest) (*ListAssetHistoryResponse, error) 99 mustEmbedUnimplementedAssetsServer() 100 } 101 102 // UnimplementedAssetsServer must be embedded to have forward compatible implementations. 103 type UnimplementedAssetsServer struct { 104 } 105 106 func (UnimplementedAssetsServer) GetAsset(context.Context, *GetAssetRequest) (*modelpb.Asset, error) { 107 return nil, status.Errorf(codes.Unimplemented, "method GetAsset not implemented") 108 } 109 func (UnimplementedAssetsServer) ListAssets(context.Context, *ListAssetsRequest) (*ListAssetsResponse, error) { 110 return nil, status.Errorf(codes.Unimplemented, "method ListAssets not implemented") 111 } 112 func (UnimplementedAssetsServer) ListAssetHistory(context.Context, *ListAssetHistoryRequest) (*ListAssetHistoryResponse, error) { 113 return nil, status.Errorf(codes.Unimplemented, "method ListAssetHistory not implemented") 114 } 115 func (UnimplementedAssetsServer) mustEmbedUnimplementedAssetsServer() {} 116 117 // UnsafeAssetsServer may be embedded to opt out of forward compatibility for this service. 118 // Use of this interface is not recommended, as added methods to AssetsServer will 119 // result in compilation errors. 120 type UnsafeAssetsServer interface { 121 mustEmbedUnimplementedAssetsServer() 122 } 123 124 func RegisterAssetsServer(s grpc.ServiceRegistrar, srv AssetsServer) { 125 s.RegisterService(&Assets_ServiceDesc, srv) 126 } 127 128 func _Assets_GetAsset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 129 in := new(GetAssetRequest) 130 if err := dec(in); err != nil { 131 return nil, err 132 } 133 if interceptor == nil { 134 return srv.(AssetsServer).GetAsset(ctx, in) 135 } 136 info := &grpc.UnaryServerInfo{ 137 Server: srv, 138 FullMethod: Assets_GetAsset_FullMethodName, 139 } 140 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 141 return srv.(AssetsServer).GetAsset(ctx, req.(*GetAssetRequest)) 142 } 143 return interceptor(ctx, in, info, handler) 144 } 145 146 func _Assets_ListAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 147 in := new(ListAssetsRequest) 148 if err := dec(in); err != nil { 149 return nil, err 150 } 151 if interceptor == nil { 152 return srv.(AssetsServer).ListAssets(ctx, in) 153 } 154 info := &grpc.UnaryServerInfo{ 155 Server: srv, 156 FullMethod: Assets_ListAssets_FullMethodName, 157 } 158 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 159 return srv.(AssetsServer).ListAssets(ctx, req.(*ListAssetsRequest)) 160 } 161 return interceptor(ctx, in, info, handler) 162 } 163 164 func _Assets_ListAssetHistory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 165 in := new(ListAssetHistoryRequest) 166 if err := dec(in); err != nil { 167 return nil, err 168 } 169 if interceptor == nil { 170 return srv.(AssetsServer).ListAssetHistory(ctx, in) 171 } 172 info := &grpc.UnaryServerInfo{ 173 Server: srv, 174 FullMethod: Assets_ListAssetHistory_FullMethodName, 175 } 176 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 177 return srv.(AssetsServer).ListAssetHistory(ctx, req.(*ListAssetHistoryRequest)) 178 } 179 return interceptor(ctx, in, info, handler) 180 } 181 182 // Assets_ServiceDesc is the grpc.ServiceDesc for Assets service. 183 // It's only intended for direct use with grpc.RegisterService, 184 // and not to be introspected or modified (even as a copy) 185 var Assets_ServiceDesc = grpc.ServiceDesc{ 186 ServiceName: "deploy.service.Assets", 187 HandlerType: (*AssetsServer)(nil), 188 Methods: []grpc.MethodDesc{ 189 { 190 MethodName: "GetAsset", 191 Handler: _Assets_GetAsset_Handler, 192 }, 193 { 194 MethodName: "ListAssets", 195 Handler: _Assets_ListAssets_Handler, 196 }, 197 { 198 MethodName: "ListAssetHistory", 199 Handler: _Assets_ListAssetHistory_Handler, 200 }, 201 }, 202 Streams: []grpc.StreamDesc{}, 203 Metadata: "go.chromium.org/luci/deploy/api/rpcpb/assets.proto", 204 }