// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 // - protoc v4.25.7 // source: google/api/apikeys/v2/apikeys.proto package apikeyspb import ( longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" context "context" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 const ( ApiKeys_CreateKey_FullMethodName = "/google.api.apikeys.v2.ApiKeys/CreateKey" ApiKeys_ListKeys_FullMethodName = "/google.api.apikeys.v2.ApiKeys/ListKeys" ApiKeys_GetKey_FullMethodName = "/google.api.apikeys.v2.ApiKeys/GetKey" ApiKeys_GetKeyString_FullMethodName = "/google.api.apikeys.v2.ApiKeys/GetKeyString" ApiKeys_UpdateKey_FullMethodName = "/google.api.apikeys.v2.ApiKeys/UpdateKey" ApiKeys_DeleteKey_FullMethodName = "/google.api.apikeys.v2.ApiKeys/DeleteKey" ApiKeys_UndeleteKey_FullMethodName = "/google.api.apikeys.v2.ApiKeys/UndeleteKey" ApiKeys_LookupKey_FullMethodName = "/google.api.apikeys.v2.ApiKeys/LookupKey" ) // ApiKeysClient is the client API for ApiKeys service. // // 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. type ApiKeysClient interface { // Creates a new API key. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. CreateKey(ctx context.Context, in *CreateKeyRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) // Lists the API keys owned by a project. The key string of the API key // isn't included in the response. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. ListKeys(ctx context.Context, in *ListKeysRequest, opts ...grpc.CallOption) (*ListKeysResponse, error) // Gets the metadata for an API key. The key string of the API key // isn't included in the response. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. GetKey(ctx context.Context, in *GetKeyRequest, opts ...grpc.CallOption) (*Key, error) // Get the key string for an API key. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. GetKeyString(ctx context.Context, in *GetKeyStringRequest, opts ...grpc.CallOption) (*GetKeyStringResponse, error) // Patches the modifiable fields of an API key. // The key string of the API key isn't included in the response. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. UpdateKey(ctx context.Context, in *UpdateKeyRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) // Deletes an API key. Deleted key can be retrieved within 30 days of // deletion. Afterward, key will be purged from the project. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. DeleteKey(ctx context.Context, in *DeleteKeyRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) // Undeletes an API key which was deleted within 30 days. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. UndeleteKey(ctx context.Context, in *UndeleteKeyRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) // Find the parent project and resource name of the API // key that matches the key string in the request. If the API key has been // purged, resource name will not be set. // The service account must have the `apikeys.keys.lookup` permission // on the parent project. LookupKey(ctx context.Context, in *LookupKeyRequest, opts ...grpc.CallOption) (*LookupKeyResponse, error) } type apiKeysClient struct { cc grpc.ClientConnInterface } func NewApiKeysClient(cc grpc.ClientConnInterface) ApiKeysClient { return &apiKeysClient{cc} } func (c *apiKeysClient) CreateKey(ctx context.Context, in *CreateKeyRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { out := new(longrunningpb.Operation) err := c.cc.Invoke(ctx, ApiKeys_CreateKey_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *apiKeysClient) ListKeys(ctx context.Context, in *ListKeysRequest, opts ...grpc.CallOption) (*ListKeysResponse, error) { out := new(ListKeysResponse) err := c.cc.Invoke(ctx, ApiKeys_ListKeys_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *apiKeysClient) GetKey(ctx context.Context, in *GetKeyRequest, opts ...grpc.CallOption) (*Key, error) { out := new(Key) err := c.cc.Invoke(ctx, ApiKeys_GetKey_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *apiKeysClient) GetKeyString(ctx context.Context, in *GetKeyStringRequest, opts ...grpc.CallOption) (*GetKeyStringResponse, error) { out := new(GetKeyStringResponse) err := c.cc.Invoke(ctx, ApiKeys_GetKeyString_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *apiKeysClient) UpdateKey(ctx context.Context, in *UpdateKeyRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { out := new(longrunningpb.Operation) err := c.cc.Invoke(ctx, ApiKeys_UpdateKey_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *apiKeysClient) DeleteKey(ctx context.Context, in *DeleteKeyRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { out := new(longrunningpb.Operation) err := c.cc.Invoke(ctx, ApiKeys_DeleteKey_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *apiKeysClient) UndeleteKey(ctx context.Context, in *UndeleteKeyRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { out := new(longrunningpb.Operation) err := c.cc.Invoke(ctx, ApiKeys_UndeleteKey_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *apiKeysClient) LookupKey(ctx context.Context, in *LookupKeyRequest, opts ...grpc.CallOption) (*LookupKeyResponse, error) { out := new(LookupKeyResponse) err := c.cc.Invoke(ctx, ApiKeys_LookupKey_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } // ApiKeysServer is the server API for ApiKeys service. // All implementations should embed UnimplementedApiKeysServer // for forward compatibility type ApiKeysServer interface { // Creates a new API key. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. CreateKey(context.Context, *CreateKeyRequest) (*longrunningpb.Operation, error) // Lists the API keys owned by a project. The key string of the API key // isn't included in the response. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. ListKeys(context.Context, *ListKeysRequest) (*ListKeysResponse, error) // Gets the metadata for an API key. The key string of the API key // isn't included in the response. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. GetKey(context.Context, *GetKeyRequest) (*Key, error) // Get the key string for an API key. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. GetKeyString(context.Context, *GetKeyStringRequest) (*GetKeyStringResponse, error) // Patches the modifiable fields of an API key. // The key string of the API key isn't included in the response. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. UpdateKey(context.Context, *UpdateKeyRequest) (*longrunningpb.Operation, error) // Deletes an API key. Deleted key can be retrieved within 30 days of // deletion. Afterward, key will be purged from the project. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. DeleteKey(context.Context, *DeleteKeyRequest) (*longrunningpb.Operation, error) // Undeletes an API key which was deleted within 30 days. // // NOTE: Key is a global resource; hence the only supported value for // location is `global`. UndeleteKey(context.Context, *UndeleteKeyRequest) (*longrunningpb.Operation, error) // Find the parent project and resource name of the API // key that matches the key string in the request. If the API key has been // purged, resource name will not be set. // The service account must have the `apikeys.keys.lookup` permission // on the parent project. LookupKey(context.Context, *LookupKeyRequest) (*LookupKeyResponse, error) } // UnimplementedApiKeysServer should be embedded to have forward compatible implementations. type UnimplementedApiKeysServer struct { } func (UnimplementedApiKeysServer) CreateKey(context.Context, *CreateKeyRequest) (*longrunningpb.Operation, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateKey not implemented") } func (UnimplementedApiKeysServer) ListKeys(context.Context, *ListKeysRequest) (*ListKeysResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListKeys not implemented") } func (UnimplementedApiKeysServer) GetKey(context.Context, *GetKeyRequest) (*Key, error) { return nil, status.Errorf(codes.Unimplemented, "method GetKey not implemented") } func (UnimplementedApiKeysServer) GetKeyString(context.Context, *GetKeyStringRequest) (*GetKeyStringResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetKeyString not implemented") } func (UnimplementedApiKeysServer) UpdateKey(context.Context, *UpdateKeyRequest) (*longrunningpb.Operation, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateKey not implemented") } func (UnimplementedApiKeysServer) DeleteKey(context.Context, *DeleteKeyRequest) (*longrunningpb.Operation, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteKey not implemented") } func (UnimplementedApiKeysServer) UndeleteKey(context.Context, *UndeleteKeyRequest) (*longrunningpb.Operation, error) { return nil, status.Errorf(codes.Unimplemented, "method UndeleteKey not implemented") } func (UnimplementedApiKeysServer) LookupKey(context.Context, *LookupKeyRequest) (*LookupKeyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LookupKey not implemented") } // UnsafeApiKeysServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ApiKeysServer will // result in compilation errors. type UnsafeApiKeysServer interface { mustEmbedUnimplementedApiKeysServer() } func RegisterApiKeysServer(s grpc.ServiceRegistrar, srv ApiKeysServer) { s.RegisterService(&ApiKeys_ServiceDesc, srv) } func _ApiKeys_CreateKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateKeyRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ApiKeysServer).CreateKey(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: ApiKeys_CreateKey_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApiKeysServer).CreateKey(ctx, req.(*CreateKeyRequest)) } return interceptor(ctx, in, info, handler) } func _ApiKeys_ListKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListKeysRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ApiKeysServer).ListKeys(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: ApiKeys_ListKeys_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApiKeysServer).ListKeys(ctx, req.(*ListKeysRequest)) } return interceptor(ctx, in, info, handler) } func _ApiKeys_GetKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetKeyRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ApiKeysServer).GetKey(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: ApiKeys_GetKey_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApiKeysServer).GetKey(ctx, req.(*GetKeyRequest)) } return interceptor(ctx, in, info, handler) } func _ApiKeys_GetKeyString_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetKeyStringRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ApiKeysServer).GetKeyString(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: ApiKeys_GetKeyString_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApiKeysServer).GetKeyString(ctx, req.(*GetKeyStringRequest)) } return interceptor(ctx, in, info, handler) } func _ApiKeys_UpdateKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateKeyRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ApiKeysServer).UpdateKey(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: ApiKeys_UpdateKey_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApiKeysServer).UpdateKey(ctx, req.(*UpdateKeyRequest)) } return interceptor(ctx, in, info, handler) } func _ApiKeys_DeleteKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteKeyRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ApiKeysServer).DeleteKey(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: ApiKeys_DeleteKey_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApiKeysServer).DeleteKey(ctx, req.(*DeleteKeyRequest)) } return interceptor(ctx, in, info, handler) } func _ApiKeys_UndeleteKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UndeleteKeyRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ApiKeysServer).UndeleteKey(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: ApiKeys_UndeleteKey_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApiKeysServer).UndeleteKey(ctx, req.(*UndeleteKeyRequest)) } return interceptor(ctx, in, info, handler) } func _ApiKeys_LookupKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LookupKeyRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ApiKeysServer).LookupKey(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: ApiKeys_LookupKey_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ApiKeysServer).LookupKey(ctx, req.(*LookupKeyRequest)) } return interceptor(ctx, in, info, handler) } // ApiKeys_ServiceDesc is the grpc.ServiceDesc for ApiKeys service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var ApiKeys_ServiceDesc = grpc.ServiceDesc{ ServiceName: "google.api.apikeys.v2.ApiKeys", HandlerType: (*ApiKeysServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateKey", Handler: _ApiKeys_CreateKey_Handler, }, { MethodName: "ListKeys", Handler: _ApiKeys_ListKeys_Handler, }, { MethodName: "GetKey", Handler: _ApiKeys_GetKey_Handler, }, { MethodName: "GetKeyString", Handler: _ApiKeys_GetKeyString_Handler, }, { MethodName: "UpdateKey", Handler: _ApiKeys_UpdateKey_Handler, }, { MethodName: "DeleteKey", Handler: _ApiKeys_DeleteKey_Handler, }, { MethodName: "UndeleteKey", Handler: _ApiKeys_UndeleteKey_Handler, }, { MethodName: "LookupKey", Handler: _ApiKeys_LookupKey_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "google/api/apikeys/v2/apikeys.proto", }