Documentation
¶
Index ¶
- type CreateMerchantMemberBody
- 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 MembershipUser
- type MembershipUserClassic
- type UpdateMerchantMemberBody
- type UpdateMerchantMemberBodyUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateMerchantMemberBody ¶
type CreateMerchantMemberBody struct {
// Object attributes that modifiable only by SumUp applications.
Attributes *shared.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"`
// True if the user is a service account. It can later be used to create OAuth2 clients.
IsServiceAccount *bool `json:"is_service_account,omitempty"`
// Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always
// submit whole metadata.
Metadata *shared.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. In the case of service accounts, the
// password is not used and can not be defined by the caller.
// Format: password
// Min length: 8
Password *string `json:"password,omitempty"`
// List of roles to assign to the new member. In the case of service accounts, the roles are predefined.
Roles []string `json:"roles"`
}
CreateMerchantMemberBody is a schema definition.
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 members by email address prefix.
Email *string
// Maximum number of members to return.
Limit *int
// Offset of the first member to return.
Offset *int
// Filter the returned members by role.
Roles *[]string
// Indicates to skip count query.
Scroll *bool
// Filter the returned members by the membership status.
Status *shared.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 *shared.Attributes `json:"attributes,omitempty"`
// The timestamp of when the member was created.
CreatedAt time.Time `json:"created_at"`
// ID of the member.
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.
Metadata *shared.Metadata `json:"metadata,omitempty"`
// User's permissions.
Permissions []string `json:"permissions"`
// User's roles.
Roles []string `json:"roles"`
// The status of the membership.
Status shared.MembershipStatus `json:"status"`
// The timestamp of when the member was last updated.
UpdatedAt time.Time `json:"updated_at"`
// Information about the user associated with the membership.
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 member Create a merchant member.
func (*MembersService) Get ¶
func (s *MembersService) Get(ctx context.Context, merchantCode string, memberId string) (*Member, error)
Get: Retrieve a member Retrieve a merchant member.
func (*MembersService) List ¶
func (s *MembersService) List(ctx context.Context, merchantCode string, params ListMerchantMembersParams) (*ListMerchantMembers200Response, error)
List: List members Lists merchant members.
func (*MembersService) Update ¶
func (s *MembersService) Update(ctx context.Context, merchantCode string, memberId string, body UpdateMerchantMemberBody) (*Member, error)
Update: Update a member Update the merchant member.
type MembershipUser ¶
type MembershipUser struct {
// Classic identifiers of the user.
// Deprecated: this operation is deprecated
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 service account.
ServiceAccountUser bool `json:"service_account_user"`
// True if the user is a virtual user (operator).
VirtualUser bool `json:"virtual_user"`
}
MembershipUser: Information about the user associated with the membership.
type MembershipUserClassic ¶
type MembershipUserClassic struct {
// Format: int32
UserId int `json:"user_id"`
}
MembershipUserClassic: Classic identifiers of the user. Deprecated: this operation is deprecated
type UpdateMerchantMemberBody ¶
type UpdateMerchantMemberBody struct {
// Object attributes that modifiable only by SumUp applications.
Attributes *shared.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 *shared.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.