roles

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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) Delete

func (s *RolesService) Delete(ctx context.Context, merchantCode string, roleId string) error

Delete: Delete a role Delete a custom role.

func (*RolesService) Get

func (s *RolesService) Get(ctx context.Context, merchantCode string, roleId string) (*Role, error)

Get: Retrieve a role Retrieve a custom role by ID.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL