roles

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.13.0

type Client struct {
	// contains filtered or unexported fields
}

func NewClient added in v0.13.0

func NewClient(c *client.Client) *Client

func (*Client) Create added in v0.13.0

func (c *Client) Create(ctx context.Context, merchantCode string, body Create) (*Role, error)

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 (*Client) Delete added in v0.13.0

func (c *Client) Delete(ctx context.Context, merchantCode string, roleID string) error

Delete a custom role.

func (*Client) Get added in v0.13.0

func (c *Client) Get(ctx context.Context, merchantCode string, roleID string) (*Role, error)

Retrieve a custom role by ID.

func (*Client) List added in v0.13.0

func (c *Client) List(ctx context.Context, merchantCode string) (*ListMerchantRoles200Response, error)

List merchant's custom roles.

func (*Client) Update added in v0.13.0

func (c *Client) Update(ctx context.Context, merchantCode string, roleID string, body Update) (*Role, error)

Update a custom role.

type Create added in v0.12.0

type Create 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. Maximum of 64 parameters are allowed in the object.
	// Max properties: 64
	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"`
}

Create is a schema definition.

type ListMerchantRoles200Response

type ListMerchantRoles200Response struct {
	Items []Role `json:"items"`
}

ListMerchantRoles200Response is a schema definition.

type Metadata added in v0.13.0

type Metadata = shared.Metadata

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 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. Maximum of 64 parameters are allowed in the object.
	// Max properties: 64
	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"`
}

A custom role that can be used to assign set of permissions to members.

type Update added in v0.12.0

type Update 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"`
}

Update is a schema definition.

Jump to

Keyboard shortcuts

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