Documentation ¶
Index ¶
- type AddMembersRequest
- type Condition
- type Member
- type MembersService
- func (svc *MembersService) Add(ctx context.Context, resourceID, resourceType string, members []Member) (res ResourceMembers, err error)
- func (svc *MembersService) Get(ctx context.Context, resourceID, resourceType string) (members ResourceMembers, err error)
- func (svc *MembersService) Remove(ctx context.Context, resourceID, resourceType string, members []Member) (res ResourceMembers, err error)
- func (svc *MembersService) Replace(ctx context.Context, resourceID, resourceType string, members []Member) (res ResourceMembers, err error)
- func (svc *MembersService) Validate(ctx context.Context, resourceID, resourceType string, members []Member) (res ResourceMembers, err error)
- type ResourceMembers
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 Condition ¶ added in v1.0.2
type Condition struct {
ExpiresAt string `json:"expiresAt"`
}
Condition struct for member
type Member ¶
type Member struct { Subject string `json:"subject"` Role string `json:"role"` Condition *Condition `json:"condition,omitempty"` }
Member struct represents a single member
type MembersService ¶
MembersService is the service that handles CRUD functionality for membership
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