Documentation
¶
Index ¶
- type Attributes
- type CreateMerchantMemberBody
- type Invite
- type ListMerchantMembers200Response
- type ListMerchantMembersParams
- type Member
- type MembersService
- func (s *MembersService) Create(ctx context.Context, merchantCode string, body CreateMerchantMemberBody) (*Member, error)
- func (s *MembersService) Delete(ctx context.Context, merchantCode string, memberId string) error
- func (s *MembersService) Get(ctx context.Context, merchantCode string, memberId string) (*Member, error)
- func (s *MembersService) List(ctx context.Context, merchantCode string, params ListMerchantMembersParams) (*ListMerchantMembers200Response, error)
- func (s *MembersService) Update(ctx context.Context, merchantCode string, memberId string, ...) (*Member, error)
- type MembershipStatus
- type MembershipUser
- type MembershipUserClassic
- type Metadata
- type UpdateMerchantMemberBody
- type UpdateMerchantMemberBodyUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶ added in v0.13.0
Attributes: Object attributes that modifiable only by SumUp applications.
type CreateMerchantMemberBody ¶
type CreateMerchantMemberBody struct {
// Object attributes that modifiable only by SumUp applications.
Attributes *Attributes `json:"attributes,omitempty"`
// Email address of the member to add.
// Format: email
Email string `json:"email"`
// True if the user is managed by the merchant. In this case, we'll created a virtual user with the provided password
// and nickname.
IsManagedUser *bool `json:"is_managed_user,omitempty"`
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata.
Metadata *Metadata `json:"metadata,omitempty"`
// Nickname of the member to add. Only used if `is_managed_user` is true. Used for display purposes only.
Nickname *string `json:"nickname,omitempty"`
// Password of the member to add. Only used if `is_managed_user` is true.
// Format: password
// Min length: 8
Password *string `json:"password,omitempty"`
// List of roles to assign to the new member.
Roles []string `json:"roles"`
}
CreateMerchantMemberBody is a schema definition.
type Invite ¶ added in v0.13.0
type Invite struct {
// Email address of the invited user.
// Format: email
Email string `json:"email"`
ExpiresAt time.Time `json:"expires_at"`
}
Invite: Pending invitation for membership.
type ListMerchantMembers200Response ¶
type ListMerchantMembers200Response struct {
Items []Member `json:"items"`
TotalCount *int `json:"total_count,omitempty"`
}
ListMerchantMembers200Response is a schema definition.
type ListMerchantMembersParams ¶
type ListMerchantMembersParams struct {
// Filter the returned users by email address prefix.
Email *string
// Maximum number of member to return.
Limit *int
// Offset of the first member to return.
Offset *int
// Filter the returned users by role.
Roles *[]string
// Indicates to skip count query.
Scroll *bool
// Filter the returned members by the membership status.
Status *MembershipStatus
}
ListMerchantMembersParams: query parameters for ListMerchantMembers
func (*ListMerchantMembersParams) QueryValues ¶
func (p *ListMerchantMembersParams) QueryValues() url.Values
QueryValues converts ListMerchantMembersParams into url.Values.
type Member ¶
type Member struct {
// Object attributes that modifiable only by SumUp applications.
Attributes *Attributes `json:"attributes,omitempty"`
CreatedAt time.Time `json:"created_at"`
// ID of the member.
Id string `json:"id"`
// Pending invitation for membership.
Invite *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.
Metadata *Metadata `json:"metadata,omitempty"`
// User's permissions.
Permissions []string `json:"permissions"`
// User's roles.
Roles []string `json:"roles"`
Status MembershipStatus `json:"status"`
UpdatedAt time.Time `json:"updated_at"`
// User information.
User *MembershipUser `json:"user,omitempty"`
}
Member: A member is user within specific resource identified by resource id, resource type, and associated roles.
type MembersService ¶
type MembersService struct {
// contains filtered or unexported fields
}
func NewMembersService ¶
func NewMembersService(c *client.Client) *MembersService
func (*MembersService) Create ¶
func (s *MembersService) Create(ctx context.Context, merchantCode string, body CreateMerchantMemberBody) (*Member, error)
Create: Create a merchant member.
func (*MembersService) Get ¶
func (s *MembersService) Get(ctx context.Context, merchantCode string, memberId string) (*Member, error)
Get: Get merchant member Returns merchant member details.
func (*MembersService) List ¶
func (s *MembersService) List(ctx context.Context, merchantCode string, params ListMerchantMembersParams) (*ListMerchantMembers200Response, error)
List: List members Lists merchant members with their roles and permissions.
func (*MembersService) Update ¶
func (s *MembersService) Update(ctx context.Context, merchantCode string, memberId string, body UpdateMerchantMemberBody) (*Member, error)
Update: Update merchant member Update assigned roles of the member.
type MembershipStatus ¶ added in v0.13.0
type MembershipStatus string
MembershipStatus is a schema definition.
const ( MembershipStatusAccepted MembershipStatus = "accepted" MembershipStatusDisabled MembershipStatus = "disabled" MembershipStatusExpired MembershipStatus = "expired" MembershipStatusPending MembershipStatus = "pending" MembershipStatusUnknown MembershipStatus = "unknown" )
type MembershipUser ¶
type MembershipUser struct {
// Classic identifiers of the user.
Classic *MembershipUserClassic `json:"classic,omitempty"`
// Time when the user has been disabled. Applies only to virtual users (`virtual_user: true`).
DisabledAt *time.Time `json:"disabled_at,omitempty"`
// End-User's preferred e-mail address. Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. The
// RP MUST NOT rely upon this value being unique, for unique identification use ID instead.
Email string `json:"email"`
// Identifier for the End-User (also called Subject).
Id string `json:"id"`
// True if the user has enabled MFA on login.
MfaOnLoginEnabled bool `json:"mfa_on_login_enabled"`
// User's preferred name. Used for display purposes only.
Nickname *string `json:"nickname,omitempty"`
// URL of the End-User's profile picture. This URL refers to an image file (for example, a PNG, JPEG, or GIF
// image file), rather than to a Web page containing an image.
// Format: uri
Picture *string `json:"picture,omitempty"`
// True if the user is a virtual user (operator).
VirtualUser bool `json:"virtual_user"`
}
MembershipUser: User information.
type MembershipUserClassic ¶
type MembershipUserClassic struct {
// Format: int32
UserId int `json:"user_id"`
}
MembershipUserClassic: Classic identifiers of the user.
type Metadata ¶ added in v0.13.0
Metadata: Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata.
type UpdateMerchantMemberBody ¶
type UpdateMerchantMemberBody struct {
// Object attributes that modifiable only by SumUp applications.
Attributes *Attributes `json:"attributes,omitempty"`
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata.
Metadata *Metadata `json:"metadata,omitempty"`
Roles *[]string `json:"roles,omitempty"`
// Allows you to update user data of managed users.
User *UpdateMerchantMemberBodyUser `json:"user,omitempty"`
}
UpdateMerchantMemberBody is a schema definition.
type UpdateMerchantMemberBodyUser ¶
type UpdateMerchantMemberBodyUser struct {
// User's preferred name. Used for display purposes only.
Nickname *string `json:"nickname,omitempty"`
// Password of the member to add. Only used if `is_managed_user` is true.
// Format: password
// Min length: 8
Password *string `json:"password,omitempty"`
}
UpdateMerchantMemberBodyUser: Allows you to update user data of managed users.