Documentation
¶
Index ¶
- type CreateMerchantRoleBody
- type ListMerchantRoles200Response
- type Role
- type RolesService
- func (s *RolesService) Create(ctx context.Context, merchantCode string, body CreateMerchantRoleBody) (*Role, error)
- func (s *RolesService) Delete(ctx context.Context, merchantCode string, roleId string) error
- func (s *RolesService) Get(ctx context.Context, merchantCode string, roleId string) (*Role, error)
- func (s *RolesService) List(ctx context.Context, merchantCode string) (*ListMerchantRoles200Response, error)
- func (s *RolesService) Update(ctx context.Context, merchantCode string, roleId string, ...) (*Role, error)
- type UpdateMerchantRoleBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateMerchantRoleBody ¶
type CreateMerchantRoleBody struct {
// User-defined description of the role.
Description *string `json:"description,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-defined name of the role.
Name string `json:"name"`
// User's permissions.
// Max items: 100
Permissions []string `json:"permissions"`
}
CreateMerchantRoleBody is a schema definition.
type ListMerchantRoles200Response ¶
type ListMerchantRoles200Response struct {
Items []Role `json:"items"`
}
ListMerchantRoles200Response is a schema definition.
type Role ¶
type Role struct {
// The timestamp of when the role was created.
CreatedAt time.Time `json:"created_at"`
// User-defined description of the role.
Description *string `json:"description,omitempty"`
// Unique identifier of the role.
Id string `json:"id"`
// True if the role is provided by SumUp.
IsPredefined bool `json:"is_predefined"`
// 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-defined name of the role.
Name string `json:"name"`
// List of permission granted by this role.
// Max items: 100
Permissions []string `json:"permissions"`
// The timestamp of when the role was last updated.
UpdatedAt time.Time `json:"updated_at"`
}
Role: A custom role that can be used to assign set of permissions to members.
type RolesService ¶
type RolesService struct {
// contains filtered or unexported fields
}
func NewRolesService ¶
func NewRolesService(c *client.Client) *RolesService
func (*RolesService) Create ¶
func (s *RolesService) Create(ctx context.Context, merchantCode string, body CreateMerchantRoleBody) (*Role, error)
Create: Create a role Create a custom role for the merchant. Roles are defined by the set of permissions that they grant to the members that they are assigned to.
func (*RolesService) List ¶
func (s *RolesService) List(ctx context.Context, merchantCode string) (*ListMerchantRoles200Response, error)
List: List roles List merchant's custom roles.
func (*RolesService) Update ¶
func (s *RolesService) Update(ctx context.Context, merchantCode string, roleId string, body UpdateMerchantRoleBody) (*Role, error)
Update: Update a role Update a custom role.
type UpdateMerchantRoleBody ¶
type UpdateMerchantRoleBody struct {
// User-defined description of the role.
Description *string `json:"description,omitempty"`
// User-defined name of the role.
Name *string `json:"name,omitempty"`
// User's permissions.
// Max items: 100
Permissions *[]string `json:"permissions,omitempty"`
}
UpdateMerchantRoleBody is a schema definition.
Click to show internal directories.
Click to hide internal directories.