1 | import type { MetaSysProps, DefaultElements, MetaLinkProps, MakeRequest } from '../common-types';
|
2 | export type OrganizationMembershipProps = {
|
3 | /**
|
4 | * System metadata
|
5 | */
|
6 | sys: MetaSysProps & {
|
7 | user: {
|
8 | sys: MetaLinkProps;
|
9 | };
|
10 | };
|
11 | /**
|
12 | * Role
|
13 | */
|
14 | role: string;
|
15 | /**
|
16 | * status
|
17 | */
|
18 | status: boolean;
|
19 | };
|
20 | export interface OrganizationMembership extends OrganizationMembershipProps, DefaultElements<OrganizationMembershipProps> {
|
21 | /**
|
22 | * Sends an update to the server with any changes made to the object's properties
|
23 | * @return Object returned from the server with updated changes.
|
24 | * @example ```javascript
|
25 | * const contentful = require('contentful-management')
|
26 | *
|
27 | * const client = contentful.createClient({
|
28 | * accessToken: '<content_management_api_key>'
|
29 | * })
|
30 | *
|
31 | * client.getOrganization('organization_id')
|
32 | * .then(org => org.getOrganizationMembership('organizationMembership_id'))
|
33 | * .then((organizationMembership) => {
|
34 | * organizationMembership.role = 'member';
|
35 | * organizationMembership.update();
|
36 | * })
|
37 | * .catch(console.error)
|
38 | */
|
39 | update(): Promise<OrganizationMembership>;
|
40 | /**
|
41 | * Deletes this object on the server.
|
42 | * @example```javascript
|
43 | * const contentful = require('contentful-management')
|
44 | *
|
45 | * const client = contentful.createClient({
|
46 | * accessToken: '<content_management_api_key>'
|
47 | * })
|
48 | *
|
49 | * client.getOrganization('organization_id')
|
50 | * .then(org => org.getOrganizationMembership('organizationMembership_id'))
|
51 | * .then((organizationMembership) => {
|
52 | * organizationMembership.delete();
|
53 | * })
|
54 | * .catch(console.error)
|
55 | * ```
|
56 | */
|
57 | delete(): Promise<void>;
|
58 | }
|
59 | /**
|
60 | * @private
|
61 | * @param {function} makeRequest - function to make requests via an adapter
|
62 | * @param {Object} data - Raw organization membership data
|
63 | * @return {OrganizationMembership} Wrapped organization membership data
|
64 | */
|
65 | export declare function wrapOrganizationMembership(makeRequest: MakeRequest, data: OrganizationMembershipProps, organizationId: string): OrganizationMembership;
|
66 | /**
|
67 | * @private
|
68 | */
|
69 | export declare const wrapOrganizationMembershipCollection: (makeRequest: MakeRequest, data: import("../common-types").CollectionProp<OrganizationMembershipProps>, organizationId: string) => import("../common-types").Collection<OrganizationMembership, OrganizationMembershipProps>;
|