// 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/vpc/v1/address_service.proto

package vpc

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 (
	AddressService_Get_FullMethodName            = "/yandex.cloud.vpc.v1.AddressService/Get"
	AddressService_GetByValue_FullMethodName     = "/yandex.cloud.vpc.v1.AddressService/GetByValue"
	AddressService_List_FullMethodName           = "/yandex.cloud.vpc.v1.AddressService/List"
	AddressService_Create_FullMethodName         = "/yandex.cloud.vpc.v1.AddressService/Create"
	AddressService_Update_FullMethodName         = "/yandex.cloud.vpc.v1.AddressService/Update"
	AddressService_Delete_FullMethodName         = "/yandex.cloud.vpc.v1.AddressService/Delete"
	AddressService_ListOperations_FullMethodName = "/yandex.cloud.vpc.v1.AddressService/ListOperations"
	AddressService_Move_FullMethodName           = "/yandex.cloud.vpc.v1.AddressService/Move"
)

// AddressServiceClient is the client API for AddressService 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 Address resources.
type AddressServiceClient interface {
	// Returns the specified Address resource.
	//
	// To get the list of all available Address resources, make a [List] request.
	Get(ctx context.Context, in *GetAddressRequest, opts ...grpc.CallOption) (*Address, error)
	// Returns the specified Address resource by a given value.
	//
	// To get the list of all available Address resources, make a [List] request.
	GetByValue(ctx context.Context, in *GetAddressByValueRequest, opts ...grpc.CallOption) (*Address, error)
	// Retrieves the list of Address resources in the specified folder.
	List(ctx context.Context, in *ListAddressesRequest, opts ...grpc.CallOption) (*ListAddressesResponse, error)
	// Creates an address in the specified folder and network.
	Create(ctx context.Context, in *CreateAddressRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Updates the specified address.
	Update(ctx context.Context, in *UpdateAddressRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Deletes the specified address.
	Delete(ctx context.Context, in *DeleteAddressRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// List operations for the specified address.
	ListOperations(ctx context.Context, in *ListAddressOperationsRequest, opts ...grpc.CallOption) (*ListAddressOperationsResponse, error)
	// Move an address to another folder
	Move(ctx context.Context, in *MoveAddressRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type addressServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAddressServiceClient(cc grpc.ClientConnInterface) AddressServiceClient {
	return &addressServiceClient{cc}
}

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

func (c *addressServiceClient) GetByValue(ctx context.Context, in *GetAddressByValueRequest, opts ...grpc.CallOption) (*Address, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Address)
	err := c.cc.Invoke(ctx, AddressService_GetByValue_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

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

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

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

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

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

// AddressServiceServer is the server API for AddressService service.
// All implementations should embed UnimplementedAddressServiceServer
// for forward compatibility.
//
// A set of methods for managing Address resources.
type AddressServiceServer interface {
	// Returns the specified Address resource.
	//
	// To get the list of all available Address resources, make a [List] request.
	Get(context.Context, *GetAddressRequest) (*Address, error)
	// Returns the specified Address resource by a given value.
	//
	// To get the list of all available Address resources, make a [List] request.
	GetByValue(context.Context, *GetAddressByValueRequest) (*Address, error)
	// Retrieves the list of Address resources in the specified folder.
	List(context.Context, *ListAddressesRequest) (*ListAddressesResponse, error)
	// Creates an address in the specified folder and network.
	Create(context.Context, *CreateAddressRequest) (*operation.Operation, error)
	// Updates the specified address.
	Update(context.Context, *UpdateAddressRequest) (*operation.Operation, error)
	// Deletes the specified address.
	Delete(context.Context, *DeleteAddressRequest) (*operation.Operation, error)
	// List operations for the specified address.
	ListOperations(context.Context, *ListAddressOperationsRequest) (*ListAddressOperationsResponse, error)
	// Move an address to another folder
	Move(context.Context, *MoveAddressRequest) (*operation.Operation, error)
}

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

func (UnimplementedAddressServiceServer) Get(context.Context, *GetAddressRequest) (*Address, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedAddressServiceServer) GetByValue(context.Context, *GetAddressByValueRequest) (*Address, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetByValue not implemented")
}
func (UnimplementedAddressServiceServer) List(context.Context, *ListAddressesRequest) (*ListAddressesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedAddressServiceServer) Create(context.Context, *CreateAddressRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedAddressServiceServer) Update(context.Context, *UpdateAddressRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedAddressServiceServer) Delete(context.Context, *DeleteAddressRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedAddressServiceServer) ListOperations(context.Context, *ListAddressOperationsRequest) (*ListAddressOperationsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListOperations not implemented")
}
func (UnimplementedAddressServiceServer) Move(context.Context, *MoveAddressRequest) (*operation.Operation, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Move not implemented")
}
func (UnimplementedAddressServiceServer) testEmbeddedByValue() {}

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

func RegisterAddressServiceServer(s grpc.ServiceRegistrar, srv AddressServiceServer) {
	// If the following call pancis, it indicates UnimplementedAddressServiceServer 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(&AddressService_ServiceDesc, srv)
}

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

func _AddressService_GetByValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetAddressByValueRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AddressServiceServer).GetByValue(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AddressService_GetByValue_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AddressServiceServer).GetByValue(ctx, req.(*GetAddressByValueRequest))
	}
	return interceptor(ctx, in, info, handler)
}

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

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

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

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

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

func _AddressService_Move_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(MoveAddressRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AddressServiceServer).Move(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AddressService_Move_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AddressServiceServer).Move(ctx, req.(*MoveAddressRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// AddressService_ServiceDesc is the grpc.ServiceDesc for AddressService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AddressService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.vpc.v1.AddressService",
	HandlerType: (*AddressServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _AddressService_Get_Handler,
		},
		{
			MethodName: "GetByValue",
			Handler:    _AddressService_GetByValue_Handler,
		},
		{
			MethodName: "List",
			Handler:    _AddressService_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _AddressService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _AddressService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _AddressService_Delete_Handler,
		},
		{
			MethodName: "ListOperations",
			Handler:    _AddressService_ListOperations_Handler,
		},
		{
			MethodName: "Move",
			Handler:    _AddressService_Move_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/vpc/v1/address_service.proto",
}
