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

package iam

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 (
	OAuthClientSecretService_Get_FullMethodName    = "/yandex.cloud.iam.v1.OAuthClientSecretService/Get"
	OAuthClientSecretService_List_FullMethodName   = "/yandex.cloud.iam.v1.OAuthClientSecretService/List"
	OAuthClientSecretService_Create_FullMethodName = "/yandex.cloud.iam.v1.OAuthClientSecretService/Create"
	OAuthClientSecretService_Delete_FullMethodName = "/yandex.cloud.iam.v1.OAuthClientSecretService/Delete"
)

// OAuthClientSecretServiceClient is the client API for OAuthClientSecretService 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 OAuthClientSecret resources.
type OAuthClientSecretServiceClient interface {
	// Returns the sepcified OAuthClientSecret resource.
	//
	// To get the list of available OAuthClientSecret resources, make a [List] request.
	Get(ctx context.Context, in *GetOAuthClientSecretRequest, opts ...grpc.CallOption) (*OAuthClientSecret, error)
	// Retrieves the list of OAuthClientSecret resources of the specified OAuthClient.
	List(ctx context.Context, in *ListOAuthClientSecretsRequest, opts ...grpc.CallOption) (*ListOAuthClientSecretsResponse, error)
	// Creates an OAuthClientSecret resource for the specified OAuthClient.
	Create(ctx context.Context, in *CreateOAuthClientSecretRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Deletes the specified OAuthClientSecret resource.
	Delete(ctx context.Context, in *DeleteOAuthClientSecretRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type oAuthClientSecretServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewOAuthClientSecretServiceClient(cc grpc.ClientConnInterface) OAuthClientSecretServiceClient {
	return &oAuthClientSecretServiceClient{cc}
}

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

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

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

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

// OAuthClientSecretServiceServer is the server API for OAuthClientSecretService service.
// All implementations should embed UnimplementedOAuthClientSecretServiceServer
// for forward compatibility.
//
// A set of methods for managing OAuthClientSecret resources.
type OAuthClientSecretServiceServer interface {
	// Returns the sepcified OAuthClientSecret resource.
	//
	// To get the list of available OAuthClientSecret resources, make a [List] request.
	Get(context.Context, *GetOAuthClientSecretRequest) (*OAuthClientSecret, error)
	// Retrieves the list of OAuthClientSecret resources of the specified OAuthClient.
	List(context.Context, *ListOAuthClientSecretsRequest) (*ListOAuthClientSecretsResponse, error)
	// Creates an OAuthClientSecret resource for the specified OAuthClient.
	Create(context.Context, *CreateOAuthClientSecretRequest) (*operation.Operation, error)
	// Deletes the specified OAuthClientSecret resource.
	Delete(context.Context, *DeleteOAuthClientSecretRequest) (*operation.Operation, error)
}

// UnimplementedOAuthClientSecretServiceServer 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 UnimplementedOAuthClientSecretServiceServer struct{}

func (UnimplementedOAuthClientSecretServiceServer) Get(context.Context, *GetOAuthClientSecretRequest) (*OAuthClientSecret, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedOAuthClientSecretServiceServer) List(context.Context, *ListOAuthClientSecretsRequest) (*ListOAuthClientSecretsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedOAuthClientSecretServiceServer) Create(context.Context, *CreateOAuthClientSecretRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedOAuthClientSecretServiceServer) Delete(context.Context, *DeleteOAuthClientSecretRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedOAuthClientSecretServiceServer) testEmbeddedByValue() {}

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

func RegisterOAuthClientSecretServiceServer(s grpc.ServiceRegistrar, srv OAuthClientSecretServiceServer) {
	// If the following call panics, it indicates UnimplementedOAuthClientSecretServiceServer 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(&OAuthClientSecretService_ServiceDesc, srv)
}

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

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

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

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

// OAuthClientSecretService_ServiceDesc is the grpc.ServiceDesc for OAuthClientSecretService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var OAuthClientSecretService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.iam.v1.OAuthClientSecretService",
	HandlerType: (*OAuthClientSecretServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _OAuthClientSecretService_Get_Handler,
		},
		{
			MethodName: "List",
			Handler:    _OAuthClientSecretService_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _OAuthClientSecretService_Create_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _OAuthClientSecretService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/iam/v1/oauth_client_secret_service.proto",
}
