Documentation
¶
Index ¶
- type Attributes
- type Client
- func (c *Client) Create(ctx context.Context, merchantCode string, body Create) (*Member, error)
- func (c *Client) Delete(ctx context.Context, merchantCode string, memberID string) error
- func (c *Client) Get(ctx context.Context, merchantCode string, memberID string) (*Member, error)
- func (c *Client) List(ctx context.Context, merchantCode string, params ListParams) (*ListMerchantMembers200Response, error)
- func (c *Client) Update(ctx context.Context, merchantCode string, memberID string, body Update) (*Member, error)
- type Create
- type Invite
- type ListMerchantMembers200Response
- type ListParams
- type Member
- type MembershipStatus
- type MembershipUser
- type MembershipUserClassic
- type Metadata
- type Update
- type UpdateUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶ added in v0.13.0
type Attributes = shared.Attributes
Object attributes that are modifiable only by SumUp applications.
type Client ¶ added in v0.13.0
type Client struct {
// contains filtered or unexported fields
}
func (*Client) List ¶ added in v0.13.0
func (c *Client) List(ctx context.Context, merchantCode string, params ListParams) (*ListMerchantMembers200Response, error)
Lists merchant members.
type Create ¶ added in v0.12.0
type Create struct {
// Object attributes that are 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"`
// 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"`
// 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 *secret.Secret `json:"password,omitempty"`
// List of roles to assign to the new member.
Roles []string `json:"roles"`
}
Create 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 ListParams ¶ added in v0.12.0
type ListParams 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
// Search for a member by user id.
UserID *string
}
ListParams are query parameters for ListMerchantMembers.
func (*ListParams) QueryValues ¶ added in v0.12.0
func (p *ListParams) QueryValues() url.Values
QueryValues converts ListParams into url.Values.
type Member ¶
type Member struct {
// Object attributes that are 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. 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
// roles within a given resource and the permissions these roles grant.
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"`
}
A member is user within specific resource identified by resource id, resource type, and associated roles.
type MembershipStatus ¶ added in v0.13.0
type MembershipStatus = shared.MembershipStatus
The status of the membership.
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"`
}
Information about the user associated with the membership.
type MembershipUserClassic ¶
type MembershipUserClassic struct {
// Format: int32
UserID int32 `json:"user_id"`
}
Classic identifiers of the user. Deprecated: this operation is deprecated
type Metadata ¶ added in v0.13.0
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
type Update ¶ added in v0.12.0
type Update struct {
// Object attributes that are 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. Maximum of 64 parameters are allowed in the object.
// Max properties: 64
Metadata shared.Metadata `json:"metadata,omitempty"`
Roles []string `json:"roles,omitempty"`
// Allows you to update user data of managed users.
User *UpdateUser `json:"user,omitempty"`
}
Update is a schema definition.
type UpdateUser ¶ added in v0.12.0
type UpdateUser 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 *secret.Secret `json:"password,omitempty"`
}
Allows you to update user data of managed users.