// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v3.21.12
// source: yandex/cloud/iam/v1/awscompatibility/access_key_service.proto

package awscompatibility

import (
	context "context"
	operation "github.com/yandex-cloud/go-genproto/yandex/cloud/operation"
	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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	AccessKeyService_List_FullMethodName           = "/yandex.cloud.iam.v1.awscompatibility.AccessKeyService/List"
	AccessKeyService_Get_FullMethodName            = "/yandex.cloud.iam.v1.awscompatibility.AccessKeyService/Get"
	AccessKeyService_Create_FullMethodName         = "/yandex.cloud.iam.v1.awscompatibility.AccessKeyService/Create"
	AccessKeyService_Update_FullMethodName         = "/yandex.cloud.iam.v1.awscompatibility.AccessKeyService/Update"
	AccessKeyService_Delete_FullMethodName         = "/yandex.cloud.iam.v1.awscompatibility.AccessKeyService/Delete"
	AccessKeyService_ListOperations_FullMethodName = "/yandex.cloud.iam.v1.awscompatibility.AccessKeyService/ListOperations"
)

// AccessKeyServiceClient is the client API for AccessKeyService 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.
//
// A set of methods for managing access keys.
type AccessKeyServiceClient interface {
	// Retrieves the list of access keys for the specified service account.
	List(ctx context.Context, in *ListAccessKeysRequest, opts ...grpc.CallOption) (*ListAccessKeysResponse, error)
	// Returns the specified access key.
	//
	// To get the list of available access keys, make a [List] request.
	Get(ctx context.Context, in *GetAccessKeyRequest, opts ...grpc.CallOption) (*AccessKey, error)
	// Creates an access key for the specified service account.
	Create(ctx context.Context, in *CreateAccessKeyRequest, opts ...grpc.CallOption) (*CreateAccessKeyResponse, error)
	// Updates the specified access key.
	Update(ctx context.Context, in *UpdateAccessKeyRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Deletes the specified access key.
	Delete(ctx context.Context, in *DeleteAccessKeyRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Retrieves the list of operations for the specified access key.
	ListOperations(ctx context.Context, in *ListAccessKeyOperationsRequest, opts ...grpc.CallOption) (*ListAccessKeyOperationsResponse, error)
}

type accessKeyServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAccessKeyServiceClient(cc grpc.ClientConnInterface) AccessKeyServiceClient {
	return &accessKeyServiceClient{cc}
}

func (c *accessKeyServiceClient) List(ctx context.Context, in *ListAccessKeysRequest, opts ...grpc.CallOption) (*ListAccessKeysResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListAccessKeysResponse)
	err := c.cc.Invoke(ctx, AccessKeyService_List_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *accessKeyServiceClient) Get(ctx context.Context, in *GetAccessKeyRequest, opts ...grpc.CallOption) (*AccessKey, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AccessKey)
	err := c.cc.Invoke(ctx, AccessKeyService_Get_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *accessKeyServiceClient) Create(ctx context.Context, in *CreateAccessKeyRequest, opts ...grpc.CallOption) (*CreateAccessKeyResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CreateAccessKeyResponse)
	err := c.cc.Invoke(ctx, AccessKeyService_Create_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *accessKeyServiceClient) Update(ctx context.Context, in *UpdateAccessKeyRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, AccessKeyService_Update_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *accessKeyServiceClient) Delete(ctx context.Context, in *DeleteAccessKeyRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, AccessKeyService_Delete_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *accessKeyServiceClient) ListOperations(ctx context.Context, in *ListAccessKeyOperationsRequest, opts ...grpc.CallOption) (*ListAccessKeyOperationsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListAccessKeyOperationsResponse)
	err := c.cc.Invoke(ctx, AccessKeyService_ListOperations_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AccessKeyServiceServer is the server API for AccessKeyService service.
// All implementations should embed UnimplementedAccessKeyServiceServer
// for forward compatibility.
//
// A set of methods for managing access keys.
type AccessKeyServiceServer interface {
	// Retrieves the list of access keys for the specified service account.
	List(context.Context, *ListAccessKeysRequest) (*ListAccessKeysResponse, error)
	// Returns the specified access key.
	//
	// To get the list of available access keys, make a [List] request.
	Get(context.Context, *GetAccessKeyRequest) (*AccessKey, error)
	// Creates an access key for the specified service account.
	Create(context.Context, *CreateAccessKeyRequest) (*CreateAccessKeyResponse, error)
	// Updates the specified access key.
	Update(context.Context, *UpdateAccessKeyRequest) (*operation.Operation, error)
	// Deletes the specified access key.
	Delete(context.Context, *DeleteAccessKeyRequest) (*operation.Operation, error)
	// Retrieves the list of operations for the specified access key.
	ListOperations(context.Context, *ListAccessKeyOperationsRequest) (*ListAccessKeyOperationsResponse, error)
}

// UnimplementedAccessKeyServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAccessKeyServiceServer struct{}

func (UnimplementedAccessKeyServiceServer) List(context.Context, *ListAccessKeysRequest) (*ListAccessKeysResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedAccessKeyServiceServer) Get(context.Context, *GetAccessKeyRequest) (*AccessKey, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedAccessKeyServiceServer) Create(context.Context, *CreateAccessKeyRequest) (*CreateAccessKeyResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedAccessKeyServiceServer) Update(context.Context, *UpdateAccessKeyRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedAccessKeyServiceServer) Delete(context.Context, *DeleteAccessKeyRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedAccessKeyServiceServer) ListOperations(context.Context, *ListAccessKeyOperationsRequest) (*ListAccessKeyOperationsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListOperations not implemented")
}
func (UnimplementedAccessKeyServiceServer) testEmbeddedByValue() {}

// UnsafeAccessKeyServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AccessKeyServiceServer will
// result in compilation errors.
type UnsafeAccessKeyServiceServer interface {
	mustEmbedUnimplementedAccessKeyServiceServer()
}

func RegisterAccessKeyServiceServer(s grpc.ServiceRegistrar, srv AccessKeyServiceServer) {
	// If the following call pancis, it indicates UnimplementedAccessKeyServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&AccessKeyService_ServiceDesc, srv)
}

func _AccessKeyService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListAccessKeysRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AccessKeyServiceServer).List(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AccessKeyService_List_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AccessKeyServiceServer).List(ctx, req.(*ListAccessKeysRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AccessKeyService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetAccessKeyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AccessKeyServiceServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AccessKeyService_Get_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AccessKeyServiceServer).Get(ctx, req.(*GetAccessKeyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AccessKeyService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateAccessKeyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AccessKeyServiceServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AccessKeyService_Create_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AccessKeyServiceServer).Create(ctx, req.(*CreateAccessKeyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AccessKeyService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateAccessKeyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AccessKeyServiceServer).Update(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AccessKeyService_Update_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AccessKeyServiceServer).Update(ctx, req.(*UpdateAccessKeyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AccessKeyService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteAccessKeyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AccessKeyServiceServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AccessKeyService_Delete_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AccessKeyServiceServer).Delete(ctx, req.(*DeleteAccessKeyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AccessKeyService_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListAccessKeyOperationsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AccessKeyServiceServer).ListOperations(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AccessKeyService_ListOperations_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AccessKeyServiceServer).ListOperations(ctx, req.(*ListAccessKeyOperationsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// AccessKeyService_ServiceDesc is the grpc.ServiceDesc for AccessKeyService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AccessKeyService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.iam.v1.awscompatibility.AccessKeyService",
	HandlerType: (*AccessKeyServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _AccessKeyService_List_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _AccessKeyService_Get_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _AccessKeyService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _AccessKeyService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _AccessKeyService_Delete_Handler,
		},
		{
			MethodName: "ListOperations",
			Handler:    _AccessKeyService_ListOperations_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/iam/v1/awscompatibility/access_key_service.proto",
}
