@sumup/sdk
Version:
The official TypeScript SDK for the SumUp API
120 lines • 3.03 kB
TypeScript
import * as Core from "../../core.js";
/**
* The status of the membership.
*/
export type MembershipStatus = "accepted" | "pending" | "expired" | "disabled" | "unknown";
/**
* Invite
*
* Pending invitation for membership.
*/
export type Invite = {
/**
* Email address of the invited user.
*/
email: string;
expires_at: string;
};
/**
* 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>>;
/**
* Object attributes that modifiable only by SumUp applications.
*/
export type Attributes = Record<string, Record<string, unknown>>;
/**
* Resource
*
* Information about the resource the membership is in.
*/
export type MembershipResource = {
/**
* ID of the resource the membership is in.
*/
id: string;
type: "merchant";
/**
* Display name of the resource.
*/
name: string;
/**
* Logo fo the resource.
*/
logo?: string;
/**
* The timestamp of when the membership resource was created.
*/
created_at: string;
/**
* The timestamp of when the membership resource was last updated.
*/
updated_at: string;
attributes: Attributes;
};
/**
* Membership
*
* A membership associates a user with a resource, memberships is defined by user, resource, resource type, and associated roles.
*/
export type Membership = {
/**
* ID of the membership.
*/
id: string;
/**
* ID of the resource the membership is in.
*/
resource_id: string;
/**
* Type of the resource the membership is in.
*/
type: "merchant";
/**
* User's roles.
*/
roles: string[];
/**
* User's permissions.
*/
permissions: string[];
/**
* The timestamp of when the membership was created.
*/
created_at: string;
/**
* The timestamp of when the membership was last updated.
*/
updated_at: string;
invite?: Invite;
status: MembershipStatus;
metadata?: Metadata;
attributes?: Attributes;
resource: MembershipResource;
};
export type ListMembershipsQueryParams = {
offset?: number;
limit?: number;
/**
* The kind of the membership resource.
* Possible values are:
* * `merchant` - merchant account(s)
*/
kind?: "merchant";
"resource.attributes.sandbox"?: boolean;
"resource.name"?: string;
};
export type ListMembershipsResponse = {
items: Membership[];
total_count: number;
};
export declare class Memberships extends Core.APIResource {
/**
* List memberships
*/
list(query?: ListMembershipsQueryParams, params?: Core.FetchParams): Core.APIPromise<ListMembershipsResponse>;
}
export declare namespace Memberships {
export type { Attributes, Invite, ListMembershipsQueryParams, Membership, MembershipResource, MembershipStatus, Metadata, };
}
//# sourceMappingURL=index.d.ts.map