@sumup/sdk
Version:
The official TypeScript SDK for the SumUp API
127 lines • 3.5 kB
TypeScript
import * as Core from "../../core";
/**
* A RFC 9457 problem details object.
*
* Additional properties specific to the problem type may be present.
*
*/
export type Problem = {
/**
* A URI reference that identifies the problem type.
*/
type: string;
/**
* A short, human-readable summary of the problem type.
*/
title?: string;
/**
* The HTTP status code generated by the origin server for this occurrence of the problem.
*/
status?: number;
/**
* A human-readable explanation specific to this occurrence of the problem.
*/
detail?: string;
/**
* A URI reference that identifies the specific occurrence of the problem.
*/
instance?: string;
};
/**
* 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.
*/
export type Metadata = Record<string, unknown>;
/**
* Role
*
* A custom role that can be used to assign set of permissions to members.
*/
export type Role = {
/**
* Unique identifier of the role.
*/
id: string;
/**
* User-defined name of the role.
*/
name: string;
/**
* User-defined description of the role.
*/
description?: string;
/**
* List of permission granted by this role.
*/
permissions: string[];
/**
* True if the role is provided by SumUp.
*/
is_predefined: boolean;
metadata?: Metadata;
/**
* The timestamp of when the role was created.
*/
created_at: string;
/**
* The timestamp of when the role was last updated.
*/
updated_at: string;
};
export type ListMerchantRolesResponse = {
items: Role[];
};
export type CreateMerchantRoleParams = {
/**
* User-defined name of the role.
*/
name: string;
/**
* User's permissions.
*/
permissions: string[];
metadata?: Metadata;
/**
* User-defined description of the role.
*/
description?: string;
};
export type UpdateMerchantRoleParams = {
/**
* User-defined name of the role.
*/
name?: string;
/**
* User's permissions.
*/
permissions?: string[];
/**
* User-defined description of the role.
*/
description?: string;
};
export declare class Roles extends Core.APIResource {
/**
* List merchant's custom roles.
*/
list(merchantCode: string, params?: Core.FetchParams): Core.APIPromise<ListMerchantRolesResponse>;
/**
* 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.
*/
create(merchantCode: string, body: CreateMerchantRoleParams, params?: Core.FetchParams): Core.APIPromise<Role>;
/**
* Retrieve a custom role by ID.
*/
get(merchantCode: string, roleId: string, params?: Core.FetchParams): Core.APIPromise<Role>;
/**
* Delete a custom role.
*/
delete(merchantCode: string, roleId: string, params?: Core.FetchParams): Core.APIPromise<void>;
/**
* Update a custom role.
*/
update(merchantCode: string, roleId: string, body: UpdateMerchantRoleParams, params?: Core.FetchParams): Core.APIPromise<Role>;
}
export declare namespace Roles {
export type { CreateMerchantRoleParams, Metadata, Problem, Role, UpdateMerchantRoleParams, };
}
//# sourceMappingURL=index.d.ts.map