group

package
v0.3.15-test Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCreateGroupInput

func GenerateCreateGroupInput(cr *v1alpha1.Group) (*sdkgo.Group, sets.Set[string], sets.Set[v1alpha1.ResourceShare])

GenerateCreateGroupInput returns sdkgo.Group and members that need to be added based on CR

func GenerateUpdateGroupInput

func GenerateUpdateGroupInput(cr *v1alpha1.Group, observedMemberIDs []string, observedShares []v1alpha1.ResourceShare) (*sdkgo.Group, MembersUpdateOp, SharesUpdateOp)

GenerateUpdateGroupInput returns sdkgo.Group and members that need to be added and deleted based or CR and observed member IDs

func IsGroupUpToDate

func IsGroupUpToDate(cr *v1alpha1.Group, observed sdkgo.Group) bool

IsGroupUpToDate returns true if the Group is up-to-date or false otherwise

Types

type APIClient

type APIClient struct {
	*clients.IonosServices
}

APIClient is a wrapper around IONOS Service

func (*APIClient) AddGroupMember

func (cp *APIClient) AddGroupMember(ctx context.Context, groupID, userID string) (*sdkgo.APIResponse, error)

AddGroupMember adds the User referenced by userID to the Group with groupID

func (*APIClient) AddResourceShare

func (cp *APIClient) AddResourceShare(ctx context.Context, groupID string, share v1alpha1.ResourceShare) (*sdkgo.APIResponse, error)

AddResourceShare adds a ResourceShare to the Group with groupID

func (*APIClient) CheckDuplicateGroup

func (cp *APIClient) CheckDuplicateGroup(ctx context.Context, groupName string) (string, error)

CheckDuplicateGroup based on groupName, returns the ID of the duplicate group if any, or an error if multiple duplicate name groups are found

func (*APIClient) CreateGroup

func (cp *APIClient) CreateGroup(ctx context.Context, group sdkgo.Group) (sdkgo.Group, *sdkgo.APIResponse, error)

CreateGroup based on Group properties

func (*APIClient) DeleteGroup

func (cp *APIClient) DeleteGroup(ctx context.Context, groupID string) (*sdkgo.APIResponse, error)

DeleteGroup based on groupID

func (*APIClient) GetAPIClient

func (cp *APIClient) GetAPIClient() *sdkgo.APIClient

GetAPIClient gets the APIClient

func (*APIClient) GetGroup

func (cp *APIClient) GetGroup(ctx context.Context, groupID string) (sdkgo.Group, *sdkgo.APIResponse, error)

GetGroup based on groupID

func (*APIClient) GetGroupMembers

func (cp *APIClient) GetGroupMembers(ctx context.Context, groupID string) ([]string, *sdkgo.APIResponse, error)

GetGroupMembers retrieves users that are added to the group

func (*APIClient) GetGroupResourceShares

func (cp *APIClient) GetGroupResourceShares(ctx context.Context, groupID string) ([]v1alpha1.ResourceShare, *sdkgo.APIResponse, error)

GetGroupResourceShares retrieves resources shares that have been added to the group

func (*APIClient) RemoveGroupMember

func (cp *APIClient) RemoveGroupMember(ctx context.Context, groupID, userID string) (*sdkgo.APIResponse, error)

RemoveGroupMember removes the User referenced by userID from the Group with groupID

func (*APIClient) RemoveResourceShare

func (cp *APIClient) RemoveResourceShare(ctx context.Context, groupID string, share v1alpha1.ResourceShare) (*sdkgo.APIResponse, error)

RemoveResourceShare removes a ResourceShare from the Group with groupID

func (*APIClient) UpdateGroup

func (cp *APIClient) UpdateGroup(ctx context.Context, groupID string, group sdkgo.Group) (sdkgo.Group, *sdkgo.APIResponse, error)

UpdateGroup based on groupID and Group properties

func (*APIClient) UpdateGroupMembers

func (cp *APIClient) UpdateGroupMembers(ctx context.Context, groupID string, membersIn MembersUpdateOp) error

UpdateGroupMembers updates the members of Group depending on modFn using the userIDs set

func (*APIClient) UpdateGroupResourceShares

func (cp *APIClient) UpdateGroupResourceShares(ctx context.Context, groupID string, sharesIn SharesUpdateOp) error

UpdateGroupResourceShares updates the shared resource set of the Group with groupID with the update data in sharesIn

func (*APIClient) UpdateResourceShare

func (cp *APIClient) UpdateResourceShare(ctx context.Context, groupID string, share v1alpha1.ResourceShare) (*sdkgo.APIResponse, error)

UpdateResourceShare updates a ResourceShare of the Group with groupID

type Client

type Client interface {
	CheckDuplicateGroup(ctx context.Context, groupName string) (string, error)
	GetGroup(ctx context.Context, groupID string) (sdkgo.Group, *sdkgo.APIResponse, error)
	GetGroupMembers(ctx context.Context, groupID string) ([]string, *sdkgo.APIResponse, error)
	GetGroupResourceShares(ctx context.Context, groupID string) ([]v1alpha1.ResourceShare, *sdkgo.APIResponse, error)
	CreateGroup(ctx context.Context, group sdkgo.Group) (sdkgo.Group, *sdkgo.APIResponse, error)
	UpdateGroup(ctx context.Context, groupID string, group sdkgo.Group) (sdkgo.Group, *sdkgo.APIResponse, error)
	AddGroupMember(ctx context.Context, groupID, userID string) (*sdkgo.APIResponse, error)
	RemoveGroupMember(ctx context.Context, groupID, userID string) (*sdkgo.APIResponse, error)
	UpdateGroupMembers(ctx context.Context, groupID string, membersIn MembersUpdateOp) error
	AddResourceShare(ctx context.Context, groupID string, share v1alpha1.ResourceShare) (*sdkgo.APIResponse, error)
	RemoveResourceShare(ctx context.Context, groupID string, share v1alpha1.ResourceShare) (*sdkgo.APIResponse, error)
	UpdateResourceShare(ctx context.Context, groupID string, share v1alpha1.ResourceShare) (*sdkgo.APIResponse, error)
	UpdateGroupResourceShares(ctx context.Context, groupID string, sharesIn SharesUpdateOp) error
	DeleteGroup(ctx context.Context, groupID string) (*sdkgo.APIResponse, error)
	GetAPIClient() *sdkgo.APIClient
}

Client is a wrapper around IONOS Service Group methods

type MembersUpdateOp

type MembersUpdateOp struct {
	Add, Remove sets.Set[string]
}

MembersUpdateOp groups memberIDs in sets depending on the operation in which they will be used

type SharesUpdateOp

type SharesUpdateOp struct {
	Add, Update, Remove sets.Set[v1alpha1.ResourceShare]
}

SharesUpdateOp groups resource shares in sets depending on the operation in which they will be used

Jump to

Keyboard shortcuts

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