Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions types/mailchimp__mailchimp_marketing/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
// Project: https://github.com/mailchimp/mailchimp-client-lib-codegen
// Definitions by: Jan Müller <https://github.com/rattkin>
// Jérémy Barbet <https://github.com/jeremybarbet>
// Daniel Castro <https://github.com/odanieldcs>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// API Documentation: https://mailchimp.com/developer/marketing/api/

export function setConfig(config: Config): void;

Expand Down Expand Up @@ -58,6 +60,17 @@ export interface SetListMemberBody {
merge_fields?: Record<string, any> | undefined;
}

export type StatusTag = 'active' | 'inactive';

export interface TagBody {
name: string;
status: StatusTag;
}

export interface MemberTagsBody {
tags: TagBody[];
}

/*~ If there are types, properties, or methods inside dotted names
*~ of the module, declare them inside a 'namespace'.
*/
Expand Down Expand Up @@ -88,4 +101,6 @@ export namespace lists {
): Promise<void>;

function deleteListMemberPermanent(listId: string, subscriberHash: string): Promise<void>;

function updateListMemberTags(listId: string, subscriberHash: string, body: any): Promise<void>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ const updateListMemberBody = {
email_address: 'test',
};

const updateListMemberTagsBody = {
tags: [
{
name: 'test',
status: 'active',
},
{
name: 'test2',
status: 'inactive',
},
],
};

// Promise<void>
mailchimp.lists.setListMember('test', 'test', setListMemberBody);

Expand All @@ -34,3 +47,6 @@ mailchimp.lists.updateListMember('test', 'test', updateListMemberBody);

// Promise<void>
mailchimp.lists.deleteListMemberPermanent('test', 'test');

// Promise<void>
mailchimp.lists.updateListMemberTags('test', 'test', updateListMemberTagsBody);