// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        v3.19.0
// source: external/iam/v2/users.proto

package v2

import (
	context "context"
	_ "github.com/chef/automate/api/external/annotations/iam"
	request "github.com/chef/automate/api/external/iam/v2/request"
	response "github.com/chef/automate/api/external/iam/v2/response"
	_ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options"
	_ "google.golang.org/genproto/googleapis/api/annotations"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

var File_external_iam_v2_users_proto protoreflect.FileDescriptor

const file_external_iam_v2_users_proto_rawDesc = "" +
	"\n" +
	"\x1bexternal/iam/v2/users.proto\x12\x18chef.automate.api.iam.v2\x1a\x1cgoogle/api/annotations.proto\x1a,protoc-gen-swagger/options/annotations.proto\x1a#external/iam/v2/request/users.proto\x1a$external/iam/v2/response/users.proto\x1a*external/annotations/iam/annotations.proto2\xbc\v\n" +
	"\x05Users\x12\xb3\x02\n" +
	"\n" +
	"CreateUser\x12'.chef.automate.api.iam.v2.CreateUserReq\x1a(.chef.automate.api.iam.v2.CreateUserResp\"\xd1\x01\x92A\x8f\x01\n" +
	"\x05usersj\x85\x01\n" +
	"\x0ex-code-samples\x12s2q\n" +
	"o*m\n" +
	"\x0e\n" +
	"\x04lang\x12\x06\x1a\x04JSON\n" +
	"[\n" +
	"\x06source\x12Q\x1aO{\"name\": \"Display Name\", \"id\": \"username001rulez\", \"password\": \"aSafePassword\"}\x8a\xb5\x18\x1d\n" +
	"\tiam:users\x12\x10iam:users:create\x82\xd3\xe4\x93\x02\x17:\x01*\"\x12/apis/iam/v2/users\x12\xa1\x01\n" +
	"\tListUsers\x12&.chef.automate.api.iam.v2.ListUsersReq\x1a'.chef.automate.api.iam.v2.ListUsersResp\"C\x92A\a\n" +
	"\x05users\x8a\xb5\x18\x1b\n" +
	"\tiam:users\x12\x0eiam:users:list\x82\xd3\xe4\x93\x02\x14\x12\x12/apis/iam/v2/users\x12\xa4\x01\n" +
	"\aGetUser\x12$.chef.automate.api.iam.v2.GetUserReq\x1a%.chef.automate.api.iam.v2.GetUserResp\"L\x92A\a\n" +
	"\x05users\x8a\xb5\x18\x1f\n" +
	"\x0eiam:users:{id}\x12\riam:users:get\x82\xd3\xe4\x93\x02\x19\x12\x17/apis/iam/v2/users/{id}\x12\xb0\x01\n" +
	"\n" +
	"DeleteUser\x12'.chef.automate.api.iam.v2.DeleteUserReq\x1a(.chef.automate.api.iam.v2.DeleteUserResp\"O\x92A\a\n" +
	"\x05users\x8a\xb5\x18\"\n" +
	"\x0eiam:users:{id}\x12\x10iam:users:delete\x82\xd3\xe4\x93\x02\x19*\x17/apis/iam/v2/users/{id}\x12\x9d\x02\n" +
	"\n" +
	"UpdateUser\x12'.chef.automate.api.iam.v2.UpdateUserReq\x1a(.chef.automate.api.iam.v2.UpdateUserResp\"\xbb\x01\x92Ap\n" +
	"\x05usersjg\n" +
	"\x0ex-code-samples\x12U2S\n" +
	"Q*O\n" +
	"\x0e\n" +
	"\x04lang\x12\x06\x1a\x04JSON\n" +
	"=\n" +
	"\x06source\x123\x1a1{\"name\": \"New Name\", \"password\": \"aSafePassword\"}\x8a\xb5\x18\"\n" +
	"\x0eiam:users:{id}\x12\x10iam:users:update\x82\xd3\xe4\x93\x02\x1c:\x01*\x1a\x17/apis/iam/v2/users/{id}\x12\xde\x02\n" +
	"\n" +
	"UpdateSelf\x12'.chef.automate.api.iam.v2.UpdateSelfReq\x1a(.chef.automate.api.iam.v2.UpdateSelfResp\"\xfc\x01\x92A\xa9\x01\n" +
	"\x05usersj\x9f\x01\n" +
	"\x0ex-code-samples\x12\x8c\x012\x89\x01\n" +
	"\x86\x01*\x83\x01\n" +
	"\x0e\n" +
	"\x04lang\x12\x06\x1a\x04JSON\n" +
	"q\n" +
	"\x06source\x12g\x1ae{\"name\": \"My New Name\", \"password\": \"aNewSafePassword\", \"previous_password\": \"aPreviousSafePassword\"}\x8a\xb5\x18*\n" +
	"\x12iam:usersSelf:{id}\x12\x14iam:usersSelf:update\x82\xd3\xe4\x93\x02\x1b:\x01*\x1a\x16/apis/iam/v2/self/{id}B.Z,github.com/chef/automate/api/external/iam/v2b\x06proto3"

var file_external_iam_v2_users_proto_goTypes = []any{
	(*request.CreateUserReq)(nil),   // 0: chef.automate.api.iam.v2.CreateUserReq
	(*request.ListUsersReq)(nil),    // 1: chef.automate.api.iam.v2.ListUsersReq
	(*request.GetUserReq)(nil),      // 2: chef.automate.api.iam.v2.GetUserReq
	(*request.DeleteUserReq)(nil),   // 3: chef.automate.api.iam.v2.DeleteUserReq
	(*request.UpdateUserReq)(nil),   // 4: chef.automate.api.iam.v2.UpdateUserReq
	(*request.UpdateSelfReq)(nil),   // 5: chef.automate.api.iam.v2.UpdateSelfReq
	(*response.CreateUserResp)(nil), // 6: chef.automate.api.iam.v2.CreateUserResp
	(*response.ListUsersResp)(nil),  // 7: chef.automate.api.iam.v2.ListUsersResp
	(*response.GetUserResp)(nil),    // 8: chef.automate.api.iam.v2.GetUserResp
	(*response.DeleteUserResp)(nil), // 9: chef.automate.api.iam.v2.DeleteUserResp
	(*response.UpdateUserResp)(nil), // 10: chef.automate.api.iam.v2.UpdateUserResp
	(*response.UpdateSelfResp)(nil), // 11: chef.automate.api.iam.v2.UpdateSelfResp
}
var file_external_iam_v2_users_proto_depIdxs = []int32{
	0,  // 0: chef.automate.api.iam.v2.Users.CreateUser:input_type -> chef.automate.api.iam.v2.CreateUserReq
	1,  // 1: chef.automate.api.iam.v2.Users.ListUsers:input_type -> chef.automate.api.iam.v2.ListUsersReq
	2,  // 2: chef.automate.api.iam.v2.Users.GetUser:input_type -> chef.automate.api.iam.v2.GetUserReq
	3,  // 3: chef.automate.api.iam.v2.Users.DeleteUser:input_type -> chef.automate.api.iam.v2.DeleteUserReq
	4,  // 4: chef.automate.api.iam.v2.Users.UpdateUser:input_type -> chef.automate.api.iam.v2.UpdateUserReq
	5,  // 5: chef.automate.api.iam.v2.Users.UpdateSelf:input_type -> chef.automate.api.iam.v2.UpdateSelfReq
	6,  // 6: chef.automate.api.iam.v2.Users.CreateUser:output_type -> chef.automate.api.iam.v2.CreateUserResp
	7,  // 7: chef.automate.api.iam.v2.Users.ListUsers:output_type -> chef.automate.api.iam.v2.ListUsersResp
	8,  // 8: chef.automate.api.iam.v2.Users.GetUser:output_type -> chef.automate.api.iam.v2.GetUserResp
	9,  // 9: chef.automate.api.iam.v2.Users.DeleteUser:output_type -> chef.automate.api.iam.v2.DeleteUserResp
	10, // 10: chef.automate.api.iam.v2.Users.UpdateUser:output_type -> chef.automate.api.iam.v2.UpdateUserResp
	11, // 11: chef.automate.api.iam.v2.Users.UpdateSelf:output_type -> chef.automate.api.iam.v2.UpdateSelfResp
	6,  // [6:12] is the sub-list for method output_type
	0,  // [0:6] is the sub-list for method input_type
	0,  // [0:0] is the sub-list for extension type_name
	0,  // [0:0] is the sub-list for extension extendee
	0,  // [0:0] is the sub-list for field type_name
}

func init() { file_external_iam_v2_users_proto_init() }
func file_external_iam_v2_users_proto_init() {
	if File_external_iam_v2_users_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_iam_v2_users_proto_rawDesc), len(file_external_iam_v2_users_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   0,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_external_iam_v2_users_proto_goTypes,
		DependencyIndexes: file_external_iam_v2_users_proto_depIdxs,
	}.Build()
	File_external_iam_v2_users_proto = out.File
	file_external_iam_v2_users_proto_goTypes = nil
	file_external_iam_v2_users_proto_depIdxs = nil
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6

// UsersClient is the client API for Users service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type UsersClient interface {
	// Create a user
	//
	// Creates a local user that can sign in to Automate and be a member of IAM teams
	// and IAM policies.
	//
	// Authorization Action:
	// ```
	// ```
	//
	//iam:users:create
	CreateUser(ctx context.Context, in *request.CreateUserReq, opts ...grpc.CallOption) (*response.CreateUserResp, error)
	// List all users
	//
	// Lists all local users.
	//
	// Authorization Action:
	// ```
	// ```
	//
	//iam:users:list
	ListUsers(ctx context.Context, in *request.ListUsersReq, opts ...grpc.CallOption) (*response.ListUsersResp, error)
	// Get a user
	//
	// Returns the details for a local user.
	//
	// Authorization Action:
	// ```
	// ```
	//
	//iam:users:get
	GetUser(ctx context.Context, in *request.GetUserReq, opts ...grpc.CallOption) (*response.GetUserResp, error)
	// Delete a user
	//
	// Deletes a local user.
	//
	// Authorization Action:
	// ```
	// ```
	//
	//iam:users:delete
	DeleteUser(ctx context.Context, in *request.DeleteUserReq, opts ...grpc.CallOption) (*response.DeleteUserResp, error)
	// Update a user
	//
	// Updates a local user's name or password.
	//
	// Authorization Action:
	// ```
	// ```
	//
	//iam:users:update
	UpdateUser(ctx context.Context, in *request.UpdateUserReq, opts ...grpc.CallOption) (*response.UpdateUserResp, error)
	// Update self (as user)
	//
	// Updates a local user's own name or password.
	// If changing the password, both "password" and "previous_password" are required.
	//
	// Authorization Action:
	// ```
	// ```
	//
	//iam:usersSelf:update
	UpdateSelf(ctx context.Context, in *request.UpdateSelfReq, opts ...grpc.CallOption) (*response.UpdateSelfResp, error)
}

type usersClient struct {
	cc grpc.ClientConnInterface
}

func NewUsersClient(cc grpc.ClientConnInterface) UsersClient {
	return &usersClient{cc}
}

func (c *usersClient) CreateUser(ctx context.Context, in *request.CreateUserReq, opts ...grpc.CallOption) (*response.CreateUserResp, error) {
	out := new(response.CreateUserResp)
	err := c.cc.Invoke(ctx, "/chef.automate.api.iam.v2.Users/CreateUser", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *usersClient) ListUsers(ctx context.Context, in *request.ListUsersReq, opts ...grpc.CallOption) (*response.ListUsersResp, error) {
	out := new(response.ListUsersResp)
	err := c.cc.Invoke(ctx, "/chef.automate.api.iam.v2.Users/ListUsers", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *usersClient) GetUser(ctx context.Context, in *request.GetUserReq, opts ...grpc.CallOption) (*response.GetUserResp, error) {
	out := new(response.GetUserResp)
	err := c.cc.Invoke(ctx, "/chef.automate.api.iam.v2.Users/GetUser", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *usersClient) DeleteUser(ctx context.Context, in *request.DeleteUserReq, opts ...grpc.CallOption) (*response.DeleteUserResp, error) {
	out := new(response.DeleteUserResp)
	err := c.cc.Invoke(ctx, "/chef.automate.api.iam.v2.Users/DeleteUser", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *usersClient) UpdateUser(ctx context.Context, in *request.UpdateUserReq, opts ...grpc.CallOption) (*response.UpdateUserResp, error) {
	out := new(response.UpdateUserResp)
	err := c.cc.Invoke(ctx, "/chef.automate.api.iam.v2.Users/UpdateUser", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *usersClient) UpdateSelf(ctx context.Context, in *request.UpdateSelfReq, opts ...grpc.CallOption) (*response.UpdateSelfResp, error) {
	out := new(response.UpdateSelfResp)
	err := c.cc.Invoke(ctx, "/chef.automate.api.iam.v2.Users/UpdateSelf", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// UsersServer is the server API for Users service.
type UsersServer interface {
	// Create a user
	//
	// Creates a local user that can sign in to Automate and be a member of IAM teams
	// and IAM policies.
	//
	// Authorization Action:
	// ```
	// ```
	//
	//iam:users:create
	CreateUser(context.Context, *request.CreateUserReq) (*response.CreateUserResp, error)
	// List all users
	//
	// Lists all local users.
	//
	// Authorization Action:
	// ```
	// ```
	//
	//iam:users:list
	ListUsers(context.Context, *request.ListUsersReq) (*response.ListUsersResp, error)
	// Get a user
	//
	// Returns the details for a local user.
	//
	// Authorization Action:
	// ```
	// ```
	//
	//iam:users:get
	GetUser(context.Context, *request.GetUserReq) (*response.GetUserResp, error)
	// Delete a user
	//
	// Deletes a local user.
	//
	// Authorization Action:
	// ```
	// ```
	//
	//iam:users:delete
	DeleteUser(context.Context, *request.DeleteUserReq) (*response.DeleteUserResp, error)
	// Update a user
	//
	// Updates a local user's name or password.
	//
	// Authorization Action:
	// ```
	// ```
	//
	//iam:users:update
	UpdateUser(context.Context, *request.UpdateUserReq) (*response.UpdateUserResp, error)
	// Update self (as user)
	//
	// Updates a local user's own name or password.
	// If changing the password, both "password" and "previous_password" are required.
	//
	// Authorization Action:
	// ```
	// ```
	//
	//iam:usersSelf:update
	UpdateSelf(context.Context, *request.UpdateSelfReq) (*response.UpdateSelfResp, error)
}

// UnimplementedUsersServer can be embedded to have forward compatible implementations.
type UnimplementedUsersServer struct {
}

func (*UnimplementedUsersServer) CreateUser(context.Context, *request.CreateUserReq) (*response.CreateUserResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented")
}
func (*UnimplementedUsersServer) ListUsers(context.Context, *request.ListUsersReq) (*response.ListUsersResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListUsers not implemented")
}
func (*UnimplementedUsersServer) GetUser(context.Context, *request.GetUserReq) (*response.GetUserResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")
}
func (*UnimplementedUsersServer) DeleteUser(context.Context, *request.DeleteUserReq) (*response.DeleteUserResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented")
}
func (*UnimplementedUsersServer) UpdateUser(context.Context, *request.UpdateUserReq) (*response.UpdateUserResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented")
}
func (*UnimplementedUsersServer) UpdateSelf(context.Context, *request.UpdateSelfReq) (*response.UpdateSelfResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdateSelf not implemented")
}

func RegisterUsersServer(s *grpc.Server, srv UsersServer) {
	s.RegisterService(&_Users_serviceDesc, srv)
}

func _Users_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(request.CreateUserReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UsersServer).CreateUser(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.api.iam.v2.Users/CreateUser",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UsersServer).CreateUser(ctx, req.(*request.CreateUserReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _Users_ListUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(request.ListUsersReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UsersServer).ListUsers(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.api.iam.v2.Users/ListUsers",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UsersServer).ListUsers(ctx, req.(*request.ListUsersReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _Users_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(request.GetUserReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UsersServer).GetUser(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.api.iam.v2.Users/GetUser",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UsersServer).GetUser(ctx, req.(*request.GetUserReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _Users_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(request.DeleteUserReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UsersServer).DeleteUser(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.api.iam.v2.Users/DeleteUser",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UsersServer).DeleteUser(ctx, req.(*request.DeleteUserReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _Users_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(request.UpdateUserReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UsersServer).UpdateUser(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.api.iam.v2.Users/UpdateUser",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UsersServer).UpdateUser(ctx, req.(*request.UpdateUserReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _Users_UpdateSelf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(request.UpdateSelfReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UsersServer).UpdateSelf(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.api.iam.v2.Users/UpdateSelf",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UsersServer).UpdateSelf(ctx, req.(*request.UpdateSelfReq))
	}
	return interceptor(ctx, in, info, handler)
}

var _Users_serviceDesc = grpc.ServiceDesc{
	ServiceName: "chef.automate.api.iam.v2.Users",
	HandlerType: (*UsersServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateUser",
			Handler:    _Users_CreateUser_Handler,
		},
		{
			MethodName: "ListUsers",
			Handler:    _Users_ListUsers_Handler,
		},
		{
			MethodName: "GetUser",
			Handler:    _Users_GetUser_Handler,
		},
		{
			MethodName: "DeleteUser",
			Handler:    _Users_DeleteUser_Handler,
		},
		{
			MethodName: "UpdateUser",
			Handler:    _Users_UpdateUser_Handler,
		},
		{
			MethodName: "UpdateSelf",
			Handler:    _Users_UpdateSelf_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "external/iam/v2/users.proto",
}
