roles

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProjectRole

type ProjectRole struct {
	Name            string              `json:"name"`
	Users           []ProjectRoleMember `json:"users"`
	ServiceAccounts []ProjectRoleMember `json:"service_accounts"`
}

ProjectRole represents a role and its members

type ProjectRoleMember

type ProjectRoleMember struct {
	ID    string `json:"id"`
	Email string `json:"email,omitempty"`
}

ProjectRoleMember represents a user or service account

type ProjectRoles

type ProjectRoles struct {
	ProjectID string        `json:"projectID"`
	Roles     []ProjectRole `json:"roles"`
}

ProjectRoles is the main response struct representing a project, its roles and members that belong to the role

type RolesService

type RolesService common.Service

RolesService is the service that handles CRUD functionality for users in roles in a STACKIT project

func New

func New(c common.Client) *RolesService

New returns a new handler for the service

func (*RolesService) AddUsers

func (svc *RolesService) AddUsers(ctx context.Context, projectID, role string, users []string, serviceAccounts []string) error

AddUsers adds users and/or service accounts to a given project role

func (*RolesService) DeleteUsers

func (svc *RolesService) DeleteUsers(ctx context.Context, projectID, role string, users []string, serviceAccounts []string) error

DeleteUsers removes users from a given role Reference: https://api.stackit.schwarz/membership-service/openapi.v1.html#operation/patch-projects-projectId-roles

func (*RolesService) Get

func (svc *RolesService) Get(ctx context.Context, projectID string) (ProjectRoles, error)

Get returns the project roles Reference: https://api.stackit.schwarz/membership-service/openapi.v1.html#operation/get-projects-projectId-roles

Jump to

Keyboard shortcuts

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