users

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2026 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommandsTo

func AddCommandsTo(rootCmd *cobra.Command)

AddCommandsTo builds the users commands and adds them to the root command

func CreateUser

func CreateUser(cmd *cobra.Command, args []string, noColor bool) error

func DeactivateUser

func DeactivateUser(cmd *cobra.Command, args []string, noColor bool) error

func DeleteUser

func DeleteUser(cmd *cobra.Command, args []string, noColor bool) error

func GetUser

func GetUser(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error

func GetUserActivity

func GetUserActivity(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error

func ListUsers

func ListUsers(cmd *cobra.Command, args []string, noColor bool, outputFormat string) error

func UpdateUser

func UpdateUser(cmd *cobra.Command, args []string, noColor bool) error

Types

type MockUserManagementService

type MockUserManagementService struct {
	CreateUserErr    error
	CreateUserResult *megaport.CreateUserResponse
	GetUserErr       error
	GetUserResult    *megaport.User
	ListUsersErr     error
	ListUsersResult  []*megaport.User
	UpdateUserErr    error
	DeleteUserErr    error
	DeactivateErr    error
	ActivityErr      error
	ActivityResult   []*megaport.UserActivity

	CapturedCreateReq   *megaport.CreateUserRequest
	CapturedUpdateReq   *megaport.UpdateUserRequest
	CapturedEmployeeID  int
	CapturedActivityReq *megaport.GetUserActivityRequest
	ForceNilGetUser     bool
}

func (*MockUserManagementService) CreateUser

func (*MockUserManagementService) DeactivateUser

func (m *MockUserManagementService) DeactivateUser(ctx context.Context, employeeID int) error

func (*MockUserManagementService) DeleteUser

func (m *MockUserManagementService) DeleteUser(ctx context.Context, employeeID int) error

func (*MockUserManagementService) GetUser

func (m *MockUserManagementService) GetUser(ctx context.Context, employeeID int) (*megaport.User, error)

func (*MockUserManagementService) GetUserActivity

func (*MockUserManagementService) ListCompanyUsers

func (m *MockUserManagementService) ListCompanyUsers(ctx context.Context) ([]*megaport.User, error)

func (*MockUserManagementService) UpdateUser

func (m *MockUserManagementService) UpdateUser(ctx context.Context, employeeID int, req *megaport.UpdateUserRequest) error

type Module

type Module struct{}

Module implements the registry.Module interface for user management commands

func NewModule

func NewModule() *Module

NewModule creates a new users module

func (*Module) Name

func (m *Module) Name() string

Name returns the module name

func (*Module) RegisterCommands

func (m *Module) RegisterCommands(rootCmd *cobra.Command)

RegisterCommands adds user management commands to the root command

type UserActivityOutput

type UserActivityOutput struct {
	output.Output `json:"-" header:"-"`
	LoginName     string `json:"login_name" header:"Login Name"`
	Description   string `json:"description" header:"Description"`
	Name          string `json:"name" header:"Activity"`
	CreateDate    string `json:"create_date" header:"Date"`
	UserType      string `json:"user_type" header:"User Type"`
}

type UserOutput

type UserOutput struct {
	output.Output `json:"-" header:"-"`
	EmployeeID    int    `json:"employee_id" header:"Employee ID"`
	FirstName     string `json:"first_name" header:"First Name"`
	LastName      string `json:"last_name" header:"Last Name"`
	Email         string `json:"email" header:"Email"`
	Position      string `json:"position" header:"Position"`
	Active        bool   `json:"active" header:"Active"`
}

func ToUserOutput

func ToUserOutput(user *megaport.User) (UserOutput, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL