members

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 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 AddMembersRequest

type AddMembersRequest struct {
	ResourceType string   `json:"resourceType"`
	Members      []Member `json:"members"`
}

AddMembersRequest structure representing the request body for adding or updating members in a resource

type Member

type Member struct {
	Subject   string `json:"subject"`
	Role      string `json:"role"`
	Condition struct {
		ExpiresAt string `json:"expiresAt"`
	} `json:"condition,omitempty"`
}

Member struct represents a single member

type MembersService

type MembersService common.Service

MembersService is the service that handles CRUD functionality for membership

func New

New returns a new handler for the service

func (*MembersService) Add

func (svc *MembersService) Add(ctx context.Context, resourceID, resourceType string, members []Member) (res ResourceMembers, err error)

Add members to a resource https://api.stackit.schwarz/membership-service/openapi.v2.html#operation/patch-members

func (*MembersService) Get

func (svc *MembersService) Get(ctx context.Context, resourceID, resourceType string) (members ResourceMembers, err error)

Get returns the members belonging to a resource Reference: https://api.stackit.schwarz/membership-service/openapi.v2.html#operation/get-members

func (*MembersService) Remove

func (svc *MembersService) Remove(ctx context.Context, resourceID, resourceType string, members []Member) (res ResourceMembers, err error)

Remove removes members from a resource https://api.stackit.schwarz/membership-service/openapi.v2.html#operation/post-members-remove

func (*MembersService) Replace

func (svc *MembersService) Replace(ctx context.Context, resourceID, resourceType string, members []Member) (res ResourceMembers, err error)

Replace overrides resource members https://api.stackit.schwarz/membership-service/openapi.v2.html#operation/put-members

func (*MembersService) Validate

func (svc *MembersService) Validate(ctx context.Context, resourceID, resourceType string, members []Member) (res ResourceMembers, err error)

Validate validates if members are allowed to be added to a resource If one or more members are not allowed, an error is returned https://api.stackit.schwarz/membership-service/openapi.v2.html#operation/post-members-validate

type ResourceMembers

type ResourceMembers struct {
	ResourceID   string   `json:"resourceId,omitempty"`
	ResourceType string   `json:"resourceType,omitempty"`
	Members      []Member `json:"members"`
}

ResourceMembers struct represents member in a resource

Jump to

Keyboard shortcuts

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