Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListMemberships200Response ¶
type ListMemberships200Response struct {
Items []Membership `json:"items"`
TotalCount int `json:"total_count"`
}
ListMemberships200Response is a schema definition.
type ListParams ¶ added in v0.12.0
type ListParams struct {
// Filter memberships by resource kind.
Kind *ResourceType
// Maximum number of members to return.
Limit *int
// Offset of the first member to return.
Offset *int
// Filter memberships by the sandbox status of the resource the membership is in.
ResourceAttributesSandbox *bool
// Filter memberships by the name of the resource the membership is in.
ResourceName *string
// Filter memberships by the parent of the resource the membership is in.
// When filtering by parent both `resource.parent.id` and `resource.parent.type` must be present. Pass explicit null
// to filter for resources without a parent.
ResourceParentID *string
// Filter memberships by the parent of the resource the membership is in.
// When filtering by parent both `resource.parent.id` and `resource.parent.type` must be present. Pass explicit null
// to filter for resources without a parent.
ResourceParentType *ResourceType
// Filter memberships by resource kind.
ResourceType *ResourceType
// Filter the returned memberships by role.
Roles []string
// Filter the returned memberships by the membership status.
Status *shared.MembershipStatus
}
ListParams are query parameters for ListMemberships.
func (*ListParams) QueryValues ¶ added in v0.12.0
func (p *ListParams) QueryValues() url.Values
QueryValues converts ListParams into url.Values.
type Membership ¶
type Membership struct {
// Object attributes that are modifiable only by SumUp applications.
Attributes shared.Attributes `json:"attributes,omitempty"`
// The timestamp of when the membership was created.
CreatedAt time.Time `json:"created_at"`
// ID of the membership.
ID string `json:"id"`
// Pending invitation for membership.
Invite *shared.Invite `json:"invite,omitempty"`
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata. Maximum of 64 parameters are allowed in the object.
// Max properties: 64
Metadata shared.Metadata `json:"metadata,omitempty"`
// User's permissions.
// Deprecated: Permissions include only legacy permissions, please use roles instead. Member access is based on
// their roles within a given resource and the permissions these roles grant.
Permissions []string `json:"permissions"`
// Information about the resource the membership is in.
Resource MembershipResource `json:"resource"`
// ID of the resource the membership is in.
ResourceID string `json:"resource_id"`
// User's roles.
Roles []string `json:"roles"`
// The status of the membership.
Status shared.MembershipStatus `json:"status"`
// The type of the membership resource.
// Possible values are:
// * `merchant` - merchant account(s)
// * `organization` - organization(s)
Type ResourceType `json:"type"`
// The timestamp of when the membership was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
A membership associates a user with a resource, memberships is defined by user, resource, resource type, and associated roles.
type MembershipResource ¶
type MembershipResource struct {
// Object attributes that are modifiable only by SumUp applications.
Attributes shared.Attributes `json:"attributes,omitempty"`
// The timestamp of when the membership resource was created.
CreatedAt time.Time `json:"created_at"`
// ID of the resource the membership is in.
ID string `json:"id"`
// Logo fo the resource.
// Format: uri
// Max length: 256
Logo *string `json:"logo,omitempty"`
// Display name of the resource.
Name string `json:"name"`
// The type of the membership resource.
// Possible values are:
// * `merchant` - merchant account(s)
// * `organization` - organization(s)
Type ResourceType `json:"type"`
// The timestamp of when the membership resource was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
Information about the resource the membership is in.
type MembershipsService ¶
type MembershipsService struct {
// contains filtered or unexported fields
}
func NewMembershipsService ¶
func NewMembershipsService(c *client.Client) *MembershipsService
func (*MembershipsService) List ¶
func (s *MembershipsService) List(ctx context.Context, params ListParams) (*ListMemberships200Response, error)
List memberships of the current user.
type ResourceType ¶ added in v0.3.0
type ResourceType string
The type of the membership resource. Possible values are: * `merchant` - merchant account(s) * `organization` - organization(s)
Click to show internal directories.
Click to hide internal directories.