@sumup/sdk
Version:
The official TypeScript SDK for the SumUp API
99 lines • 2.58 kB
TypeScript
import * as Core from "../../core.js";
/**
* Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata.
*/
export type Metadata = Record<string, 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 roles
*/
list(merchantCode: string, params?: Core.FetchParams): Core.APIPromise<ListMerchantRolesResponse>;
/**
* Create a role
*/
create(merchantCode: string, body: CreateMerchantRoleParams, params?: Core.FetchParams): Core.APIPromise<Role>;
/**
* Retrieve a role
*/
get(merchantCode: string, roleId: string, params?: Core.FetchParams): Core.APIPromise<Role>;
/**
* Delete a role
*/
delete(merchantCode: string, roleId: string, params?: Core.FetchParams): Core.APIPromise<void>;
/**
* Update a role
*/
update(merchantCode: string, roleId: string, body: UpdateMerchantRoleParams, params?: Core.FetchParams): Core.APIPromise<Role>;
}
export declare namespace Roles {
export type { CreateMerchantRoleParams, Metadata, Role, UpdateMerchantRoleParams, };
}
//# sourceMappingURL=index.d.ts.map