@tolt/api 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/errors/ContentTooLargeError.d.ts +7 -0
- package/dist/api/errors/ContentTooLargeError.js +17 -0
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/index.js +1 -0
- package/dist/api/resources/clicks/client/Client.d.ts +6 -1
- package/dist/api/resources/clicks/client/Client.js +15 -4
- package/dist/api/resources/clicks/client/requests/GetClicksRequest.d.ts +1 -1
- package/dist/api/resources/clicks/client/requests/ListClicksRequest.d.ts +10 -5
- package/dist/api/resources/clicks/types/ListClicksRequestOrder.d.ts +1 -0
- package/dist/api/resources/clicks/types/ListClicksRequestOrder.js +1 -0
- package/dist/api/resources/clicks/types/ListClicksRequestSort.d.ts +1 -1
- package/dist/api/resources/clicks/types/ListClicksRequestSort.js +1 -1
- package/dist/api/resources/commissions/client/Client.d.ts +29 -7
- package/dist/api/resources/commissions/client/Client.js +56 -16
- package/dist/api/resources/commissions/client/requests/ApproveCommissionsRequest.d.ts +1 -1
- package/dist/api/resources/commissions/client/requests/BulkApproveCommissionsRequest.d.ts +2 -2
- package/dist/api/resources/commissions/client/requests/BulkDeclineCommissionsRequest.d.ts +2 -2
- package/dist/api/resources/commissions/client/requests/DeclineCommissionsRequest.d.ts +1 -1
- package/dist/api/resources/commissions/client/requests/DeleteCommissionsRequest.d.ts +1 -1
- package/dist/api/resources/commissions/client/requests/GetCommissionsRequest.d.ts +1 -1
- package/dist/api/resources/commissions/client/requests/ListCommissionsRequest.d.ts +14 -5
- package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.d.ts +19 -4
- package/dist/api/resources/commissions/client/requests/UpdateCommissionsRequest.js +8 -1
- package/dist/api/resources/commissions/client/requests/index.d.ts +1 -1
- package/dist/api/resources/commissions/client/requests/index.js +1 -1
- package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.d.ts +1 -0
- package/dist/api/resources/commissions/types/ListCommissionsRequestOrder.js +1 -0
- package/dist/api/resources/commissions/types/ListCommissionsRequestSort.d.ts +1 -1
- package/dist/api/resources/commissions/types/ListCommissionsRequestSort.js +1 -1
- package/dist/api/resources/customers/client/Client.d.ts +27 -4
- package/dist/api/resources/customers/client/Client.js +42 -9
- package/dist/api/resources/customers/client/requests/CreateCustomersRequest.d.ts +20 -2
- package/dist/api/resources/customers/client/requests/CreateCustomersRequest.js +1 -0
- package/dist/api/resources/customers/client/requests/DeleteCustomersRequest.d.ts +1 -1
- package/dist/api/resources/customers/client/requests/GetCustomersRequest.d.ts +1 -1
- package/dist/api/resources/customers/client/requests/ListCustomersRequest.d.ts +14 -5
- package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.d.ts +15 -2
- package/dist/api/resources/customers/client/requests/UpdateCustomersRequest.js +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestOrder.d.ts +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestOrder.js +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestSort.d.ts +1 -1
- package/dist/api/resources/customers/types/ListCustomersRequestSort.js +1 -1
- package/dist/api/resources/customers/types/ListCustomersRequestStatus.d.ts +1 -0
- package/dist/api/resources/customers/types/ListCustomersRequestStatus.js +1 -0
- package/dist/api/resources/embed/client/Client.d.ts +5 -2
- package/dist/api/resources/embed/client/Client.js +9 -4
- package/dist/api/resources/embed/client/index.d.ts +1 -1
- package/dist/api/resources/embed/client/index.js +1 -1
- package/dist/api/resources/embed/types/CreateTokenEmbedRequest.d.ts +1 -0
- package/dist/api/resources/embed/types/index.d.ts +1 -0
- package/dist/api/resources/embed/types/index.js +1 -0
- package/dist/api/resources/flows/client/Client.d.ts +7 -1
- package/dist/api/resources/flows/client/Client.js +13 -3
- package/dist/api/resources/flows/client/requests/GetFlowsRequest.d.ts +1 -1
- package/dist/api/resources/flows/client/requests/ListFlowsRequest.d.ts +13 -5
- package/dist/api/resources/flows/types/ListFlowsRequestActive.d.ts +1 -0
- package/dist/api/resources/flows/types/ListFlowsRequestActive.js +1 -0
- package/dist/api/resources/flows/types/ListFlowsRequestOrder.d.ts +1 -0
- package/dist/api/resources/flows/types/ListFlowsRequestOrder.js +1 -0
- package/dist/api/resources/flows/types/ListFlowsRequestSort.d.ts +1 -1
- package/dist/api/resources/flows/types/ListFlowsRequestSort.js +1 -1
- package/dist/api/resources/groups/client/Client.d.ts +7 -1
- package/dist/api/resources/groups/client/Client.js +13 -3
- package/dist/api/resources/groups/client/requests/GetGroupsRequest.d.ts +1 -1
- package/dist/api/resources/groups/client/requests/ListGroupsRequest.d.ts +10 -5
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.d.ts +1 -0
- package/dist/api/resources/groups/types/ListGroupsRequestDefault.js +1 -0
- package/dist/api/resources/groups/types/ListGroupsRequestOrder.d.ts +1 -0
- package/dist/api/resources/groups/types/ListGroupsRequestOrder.js +1 -0
- package/dist/api/resources/groups/types/ListGroupsRequestSort.d.ts +1 -1
- package/dist/api/resources/groups/types/ListGroupsRequestSort.js +1 -1
- package/dist/api/resources/index.d.ts +0 -1
- package/dist/api/resources/index.js +0 -1
- package/dist/api/resources/links/client/Client.d.ts +17 -5
- package/dist/api/resources/links/client/Client.js +37 -11
- package/dist/api/resources/links/client/requests/CreateLinksRequest.d.ts +6 -2
- package/dist/api/resources/links/client/requests/DeleteLinksRequest.d.ts +1 -1
- package/dist/api/resources/links/client/requests/GetLinksRequest.d.ts +1 -1
- package/dist/api/resources/links/client/requests/ListLinksRequest.d.ts +12 -5
- package/dist/api/resources/links/client/requests/UpdateLinksRequest.d.ts +6 -2
- package/dist/api/resources/links/types/ListLinksRequestOrder.d.ts +1 -0
- package/dist/api/resources/links/types/ListLinksRequestOrder.js +1 -0
- package/dist/api/resources/links/types/ListLinksRequestSort.d.ts +1 -1
- package/dist/api/resources/links/types/ListLinksRequestSort.js +1 -1
- package/dist/api/resources/partners/client/Client.d.ts +39 -10
- package/dist/api/resources/partners/client/Client.js +66 -21
- package/dist/api/resources/partners/client/requests/ApprovePartnersRequest.d.ts +1 -1
- package/dist/api/resources/partners/client/requests/BulkApprovePartnersRequest.d.ts +2 -2
- package/dist/api/resources/partners/client/requests/BulkRejectPartnersRequest.d.ts +4 -2
- package/dist/api/resources/partners/client/requests/CreatePartnersRequest.d.ts +21 -7
- package/dist/api/resources/partners/client/requests/CreatePartnersRequest.js +1 -0
- package/dist/api/resources/partners/client/requests/GetPartnersRequest.d.ts +1 -1
- package/dist/api/resources/partners/client/requests/ListPartnersRequest.d.ts +11 -5
- package/dist/api/resources/partners/client/requests/RejectPartnersRequest.d.ts +2 -1
- package/dist/api/resources/partners/client/requests/SuspendPartnersRequest.d.ts +2 -1
- package/dist/api/resources/partners/client/requests/UpdatePartnersRequest.d.ts +10 -2
- package/dist/api/resources/partners/types/ListPartnersRequestOrder.d.ts +1 -0
- package/dist/api/resources/partners/types/ListPartnersRequestOrder.js +1 -0
- package/dist/api/resources/partners/types/ListPartnersRequestSort.d.ts +1 -1
- package/dist/api/resources/partners/types/ListPartnersRequestSort.js +1 -1
- package/dist/api/resources/partners/types/ListPartnersRequestStatus.d.ts +1 -0
- package/dist/api/resources/partners/types/ListPartnersRequestStatus.js +1 -0
- package/dist/api/resources/programs/client/Client.d.ts +7 -1
- package/dist/api/resources/programs/client/Client.js +13 -3
- package/dist/api/resources/programs/client/requests/GetProgramsRequest.d.ts +1 -1
- package/dist/api/resources/programs/client/requests/ListProgramsRequest.d.ts +8 -5
- package/dist/api/resources/programs/types/ListProgramsRequestOrder.d.ts +1 -0
- package/dist/api/resources/programs/types/ListProgramsRequestOrder.js +1 -0
- package/dist/api/resources/programs/types/ListProgramsRequestSort.d.ts +1 -1
- package/dist/api/resources/programs/types/ListProgramsRequestSort.js +1 -1
- package/dist/api/resources/promotionCodes/client/Client.d.ts +27 -5
- package/dist/api/resources/promotionCodes/client/Client.js +46 -10
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.d.ts +9 -2
- package/dist/api/resources/promotionCodes/client/requests/CreatePromotionCodesRequest.js +1 -0
- package/dist/api/resources/promotionCodes/client/requests/DeletePromotionCodesRequest.d.ts +1 -1
- package/dist/api/resources/promotionCodes/client/requests/GetPromotionCodesRequest.d.ts +1 -1
- package/dist/api/resources/promotionCodes/client/requests/ListPromotionCodesRequest.d.ts +11 -5
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.d.ts +8 -1
- package/dist/api/resources/promotionCodes/client/requests/UpdatePromotionCodesRequest.js +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.d.ts +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestOrder.js +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.d.ts +1 -1
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestSort.js +1 -1
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.d.ts +1 -0
- package/dist/api/resources/promotionCodes/types/ListPromotionCodesRequestType.js +1 -0
- package/dist/api/resources/reports/client/Client.d.ts +15 -0
- package/dist/api/resources/reports/client/Client.js +30 -5
- package/dist/api/resources/reports/client/requests/CustomerStatsReportsRequest.d.ts +3 -0
- package/dist/api/resources/reports/client/requests/LinksReportsRequest.d.ts +8 -0
- package/dist/api/resources/reports/client/requests/OverviewReportsRequest.d.ts +3 -0
- package/dist/api/resources/reports/client/requests/PartnersReportsRequest.d.ts +8 -0
- package/dist/api/resources/reports/client/requests/TimeseriesReportsRequest.d.ts +5 -0
- package/dist/api/resources/reports/types/LinksReportsRequestOrder.d.ts +1 -0
- package/dist/api/resources/reports/types/LinksReportsRequestOrder.js +1 -0
- package/dist/api/resources/reports/types/LinksReportsRequestSort.d.ts +1 -0
- package/dist/api/resources/reports/types/LinksReportsRequestSort.js +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestOrder.d.ts +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestOrder.js +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestSort.d.ts +1 -0
- package/dist/api/resources/reports/types/PartnersReportsRequestSort.js +1 -0
- package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.d.ts +1 -0
- package/dist/api/resources/reports/types/TimeseriesReportsRequestGranularity.js +1 -0
- package/dist/api/resources/transactions/client/Client.d.ts +30 -7
- package/dist/api/resources/transactions/client/Client.js +53 -14
- package/dist/api/resources/transactions/client/requests/CreateTransactionsRequest.d.ts +17 -3
- package/dist/api/resources/transactions/client/requests/DeleteTransactionsRequest.d.ts +1 -1
- package/dist/api/resources/transactions/client/requests/GetTransactionsRequest.d.ts +1 -1
- package/dist/api/resources/transactions/client/requests/ListTransactionsRequest.d.ts +12 -5
- package/dist/api/resources/transactions/client/requests/RefundTransactionsRequest.d.ts +1 -1
- package/dist/api/resources/transactions/client/requests/RerunFlowsTransactionsRequest.d.ts +1 -1
- package/dist/api/resources/transactions/client/requests/UpdateTransactionsRequest.d.ts +13 -2
- package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.d.ts +1 -0
- package/dist/api/resources/transactions/types/ListTransactionsRequestOrder.js +1 -0
- package/dist/api/resources/transactions/types/ListTransactionsRequestSort.d.ts +1 -1
- package/dist/api/resources/transactions/types/ListTransactionsRequestSort.js +1 -1
- package/dist/api/types/Commission.d.ts +1 -1
- package/dist/api/types/Customer.d.ts +2 -2
- package/dist/api/types/Error_.d.ts +1 -0
- package/dist/api/types/Error_.js +1 -0
- package/dist/environments.d.ts +2 -2
- package/dist/environments.js +1 -1
- package/package.json +1 -1
- package/dist/api/resources/embed/client/requests/CreateTokenEmbedRequest.d.ts +0 -14
- package/dist/api/resources/embed/client/requests/index.d.ts +0 -1
- package/dist/api/resources/embed/client/requests/index.js +0 -1
- /package/dist/api/resources/embed/{client/requests → types}/CreateTokenEmbedRequest.js +0 -0
|
@@ -4,25 +4,32 @@ import type * as ToltApi from "../../../../index.js";
|
|
|
4
4
|
* {}
|
|
5
5
|
*/
|
|
6
6
|
export interface ListLinksRequest {
|
|
7
|
+
/** How many rows to return in one page. */
|
|
7
8
|
limit?: number;
|
|
9
|
+
/** Ranking direction: desc puts the most recently created or updated rows first. */
|
|
8
10
|
order?: ToltApi.ListLinksRequestOrder;
|
|
9
|
-
/**
|
|
11
|
+
/** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
|
|
10
12
|
sort?: ToltApi.ListLinksRequestSort;
|
|
11
13
|
/** Continue after a position: the next_cursor of a previous page, or an item id when sorting by created_at. Cannot be combined with ending_before. */
|
|
12
14
|
starting_after?: string;
|
|
13
15
|
/** Page backward from a position: the prev_cursor of a previous page, or an item id when sorting by created_at. Cannot be combined with starting_after. */
|
|
14
16
|
ending_before?: string;
|
|
15
|
-
/**
|
|
17
|
+
/** Start of a window on when items were created: items created at this time or later are included, for example 2026-01-01T00:00:00Z. Leave it out for no lower bound. */
|
|
16
18
|
created_after?: string;
|
|
17
|
-
/**
|
|
19
|
+
/** End of a window on when items were created: only items created before this time are included. Leave it out for no upper bound. */
|
|
18
20
|
created_before?: string;
|
|
19
|
-
/** Only items
|
|
21
|
+
/** Only items last changed at or after this moment; with sort=updated_at, use it to fetch what changed since a previous sync. */
|
|
20
22
|
updated_after?: string;
|
|
21
|
-
/** Only items
|
|
23
|
+
/** Only items last changed before this moment; pair it with updated_after to fetch what changed in a period. */
|
|
22
24
|
updated_before?: string;
|
|
25
|
+
/** Limit to one program, by its id (prg_...) as returned when listing programs. */
|
|
23
26
|
program_id?: string;
|
|
27
|
+
/** Limit to one partner, by its id (part_...) as returned when listing partners. */
|
|
24
28
|
partner_id?: string;
|
|
29
|
+
/** Only links using this URL parameter name exactly, such as `ref` in `?ref=sam`. */
|
|
25
30
|
param?: string;
|
|
31
|
+
/** Only links with this exact slug, such as `sam` in `?ref=sam`. */
|
|
26
32
|
value?: string;
|
|
33
|
+
/** Text matched anywhere in the link's slug (value) or parameter name, ignoring case. */
|
|
27
34
|
search?: string;
|
|
28
35
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* id: "
|
|
4
|
+
* id: "lnk_mtTeeckFa1vMdvDFXretQNs6",
|
|
5
|
+
* param: "ref",
|
|
6
|
+
* value: "sam"
|
|
5
7
|
* }
|
|
6
8
|
*/
|
|
7
9
|
export interface UpdateLinksRequest {
|
|
8
10
|
id: string;
|
|
9
|
-
|
|
11
|
+
/** New query parameter of the link, e.g. `ref` in `?ref=sam`. URLs with the old parameter stop matching this link. */
|
|
12
|
+
param?: string;
|
|
13
|
+
/** New slug, e.g. `sam` in `?ref=sam`, stored lowercased. URLs using the old slug stop matching this link. */
|
|
10
14
|
value?: string;
|
|
11
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
|
|
2
2
|
export declare const ListLinksRequestSort: {
|
|
3
3
|
readonly CreatedAt: "created_at";
|
|
4
4
|
readonly UpdatedAt: "updated_at";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
/**
|
|
2
|
+
/** Timestamp to order and page by: created_at follows creation order, updated_at follows each item's most recent change. */
|
|
3
3
|
export const ListLinksRequestSort = {
|
|
4
4
|
CreatedAt: "created_at",
|
|
5
5
|
UpdatedAt: "updated_at",
|
|
@@ -18,13 +18,14 @@ export declare class PartnersClient {
|
|
|
18
18
|
*
|
|
19
19
|
* @throws {@link ToltApi.BadRequestError}
|
|
20
20
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
21
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
21
22
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
22
23
|
* @throws {@link errors.ToltApiError}
|
|
23
24
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
24
25
|
*
|
|
25
26
|
* @example
|
|
26
27
|
* await client.partners.bulkApprove({
|
|
27
|
-
* ids: ["
|
|
28
|
+
* ids: ["part_NLYzgNKuSuASvrvoxNtau6SY", "part_9fQ2xLLmN3kP8dRvT1wYbHcS"]
|
|
28
29
|
* })
|
|
29
30
|
*/
|
|
30
31
|
bulkApprove(request: ToltApi.BulkApprovePartnersRequest, requestOptions?: PartnersClient.RequestOptions): core.HttpResponsePromise<ToltApi.BulkApprovePartnersResponse>;
|
|
@@ -37,23 +38,28 @@ export declare class PartnersClient {
|
|
|
37
38
|
*
|
|
38
39
|
* @throws {@link ToltApi.BadRequestError}
|
|
39
40
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
41
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
40
42
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
41
43
|
* @throws {@link errors.ToltApiError}
|
|
42
44
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
43
45
|
*
|
|
44
46
|
* @example
|
|
45
47
|
* await client.partners.bulkReject({
|
|
46
|
-
* ids: ["
|
|
48
|
+
* ids: ["part_NLYzgNKuSuASvrvoxNtau6SY", "part_9fQ2xLLmN3kP8dRvT1wYbHcS"],
|
|
49
|
+
* rejection_note: "Site does not match our audience."
|
|
47
50
|
* })
|
|
48
51
|
*/
|
|
49
52
|
bulkReject(request: ToltApi.BulkRejectPartnersRequest, requestOptions?: PartnersClient.RequestOptions): core.HttpResponsePromise<ToltApi.BulkRejectPartnersResponse>;
|
|
50
53
|
private __bulkReject;
|
|
51
54
|
/**
|
|
55
|
+
* Lists onboarded partners. Filter by status, program or group, search by name, email or company, and page with cursors.
|
|
56
|
+
*
|
|
52
57
|
* @param {ToltApi.ListPartnersRequest} request
|
|
53
58
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
59
|
*
|
|
55
60
|
* @throws {@link ToltApi.BadRequestError}
|
|
56
61
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
62
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
57
63
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
58
64
|
* @throws {@link errors.ToltApiError}
|
|
59
65
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
@@ -72,31 +78,42 @@ export declare class PartnersClient {
|
|
|
72
78
|
* @throws {@link ToltApi.BadRequestError}
|
|
73
79
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
74
80
|
* @throws {@link ToltApi.ConflictError}
|
|
81
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
75
82
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
76
83
|
* @throws {@link errors.ToltApiError}
|
|
77
84
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
78
85
|
*
|
|
79
86
|
* @example
|
|
80
87
|
* await client.partners.create({
|
|
81
|
-
* email: "sam@
|
|
82
|
-
* program_id: "
|
|
88
|
+
* email: "sam@example.com",
|
|
89
|
+
* program_id: "prg_T6z8aRW3XCmvFWP972RKxpAd",
|
|
90
|
+
* first_name: "Sam",
|
|
91
|
+
* last_name: "Taylor",
|
|
92
|
+
* group_id: "grp_zUQ8Pt281MsbNDApmDPN3Y2a",
|
|
93
|
+
* link: {
|
|
94
|
+
* value: "sam",
|
|
95
|
+
* param: "ref"
|
|
96
|
+
* }
|
|
83
97
|
* })
|
|
84
98
|
*/
|
|
85
99
|
create(request: ToltApi.CreatePartnersRequest, requestOptions?: PartnersClient.RequestOptions): core.HttpResponsePromise<ToltApi.CreatePartnersResponse>;
|
|
86
100
|
private __create;
|
|
87
101
|
/**
|
|
102
|
+
* Gets a partner by ID, with their profile, status, group and program.
|
|
103
|
+
*
|
|
88
104
|
* @param {ToltApi.GetPartnersRequest} request
|
|
89
105
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
90
106
|
*
|
|
91
107
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
92
108
|
* @throws {@link ToltApi.NotFoundError}
|
|
109
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
93
110
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
94
111
|
* @throws {@link errors.ToltApiError}
|
|
95
112
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
96
113
|
*
|
|
97
114
|
* @example
|
|
98
115
|
* await client.partners.get({
|
|
99
|
-
* id: "
|
|
116
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
100
117
|
* })
|
|
101
118
|
*/
|
|
102
119
|
get(request: ToltApi.GetPartnersRequest, requestOptions?: PartnersClient.RequestOptions): core.HttpResponsePromise<ToltApi.GetPartnersResponse>;
|
|
@@ -110,67 +127,79 @@ export declare class PartnersClient {
|
|
|
110
127
|
* @throws {@link ToltApi.BadRequestError}
|
|
111
128
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
112
129
|
* @throws {@link ToltApi.NotFoundError}
|
|
113
|
-
* @throws {@link ToltApi.
|
|
130
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
114
131
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
115
132
|
* @throws {@link errors.ToltApiError}
|
|
116
133
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
117
134
|
*
|
|
118
135
|
* @example
|
|
119
136
|
* await client.partners.update({
|
|
120
|
-
* id: "
|
|
137
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY",
|
|
138
|
+
* first_name: "Sam",
|
|
139
|
+
* last_name: "Taylor",
|
|
140
|
+
* group_id: "grp_zUQ8Pt281MsbNDApmDPN3Y2a"
|
|
121
141
|
* })
|
|
122
142
|
*/
|
|
123
143
|
update(request: ToltApi.UpdatePartnersRequest, requestOptions?: PartnersClient.RequestOptions): core.HttpResponsePromise<ToltApi.UpdatePartnersResponse>;
|
|
124
144
|
private __update;
|
|
125
145
|
/**
|
|
146
|
+
* Makes the partner active. A partner who was not already active is sent the program's approval email.
|
|
147
|
+
*
|
|
126
148
|
* @param {ToltApi.ApprovePartnersRequest} request
|
|
127
149
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
128
150
|
*
|
|
129
151
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
130
152
|
* @throws {@link ToltApi.NotFoundError}
|
|
153
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
131
154
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
132
155
|
* @throws {@link errors.ToltApiError}
|
|
133
156
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
134
157
|
*
|
|
135
158
|
* @example
|
|
136
159
|
* await client.partners.approve({
|
|
137
|
-
* id: "
|
|
160
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
138
161
|
* })
|
|
139
162
|
*/
|
|
140
163
|
approve(request: ToltApi.ApprovePartnersRequest, requestOptions?: PartnersClient.RequestOptions): core.HttpResponsePromise<ToltApi.ApprovePartnersResponse>;
|
|
141
164
|
private __approve;
|
|
142
165
|
/**
|
|
166
|
+
* Rejects the partner. A partner who was not already rejected is sent the program's rejection email with the note.
|
|
167
|
+
*
|
|
143
168
|
* @param {ToltApi.RejectPartnersRequest} request
|
|
144
169
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
145
170
|
*
|
|
146
171
|
* @throws {@link ToltApi.BadRequestError}
|
|
147
172
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
148
173
|
* @throws {@link ToltApi.NotFoundError}
|
|
174
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
149
175
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
150
176
|
* @throws {@link errors.ToltApiError}
|
|
151
177
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
152
178
|
*
|
|
153
179
|
* @example
|
|
154
180
|
* await client.partners.reject({
|
|
155
|
-
* id: "
|
|
181
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
156
182
|
* })
|
|
157
183
|
*/
|
|
158
184
|
reject(request: ToltApi.RejectPartnersRequest, requestOptions?: PartnersClient.RequestOptions): core.HttpResponsePromise<ToltApi.RejectPartnersResponse>;
|
|
159
185
|
private __reject;
|
|
160
186
|
/**
|
|
187
|
+
* Suspends the partner, with an optional suspension_reason. Use the approve action to make them active again.
|
|
188
|
+
*
|
|
161
189
|
* @param {ToltApi.SuspendPartnersRequest} request
|
|
162
190
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
163
191
|
*
|
|
164
192
|
* @throws {@link ToltApi.BadRequestError}
|
|
165
193
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
166
194
|
* @throws {@link ToltApi.NotFoundError}
|
|
195
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
167
196
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
168
197
|
* @throws {@link errors.ToltApiError}
|
|
169
198
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
170
199
|
*
|
|
171
200
|
* @example
|
|
172
201
|
* await client.partners.suspend({
|
|
173
|
-
* id: "
|
|
202
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
174
203
|
* })
|
|
175
204
|
*/
|
|
176
205
|
suspend(request: ToltApi.SuspendPartnersRequest, requestOptions?: PartnersClient.RequestOptions): core.HttpResponsePromise<ToltApi.SuspendPartnersResponse>;
|
|
@@ -19,13 +19,14 @@ export class PartnersClient {
|
|
|
19
19
|
*
|
|
20
20
|
* @throws {@link ToltApi.BadRequestError}
|
|
21
21
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
22
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
22
23
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
23
24
|
* @throws {@link errors.ToltApiError}
|
|
24
25
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
25
26
|
*
|
|
26
27
|
* @example
|
|
27
28
|
* await client.partners.bulkApprove({
|
|
28
|
-
* ids: ["
|
|
29
|
+
* ids: ["part_NLYzgNKuSuASvrvoxNtau6SY", "part_9fQ2xLLmN3kP8dRvT1wYbHcS"]
|
|
29
30
|
* })
|
|
30
31
|
*/
|
|
31
32
|
bulkApprove(request, requestOptions) {
|
|
@@ -37,7 +38,7 @@ export class PartnersClient {
|
|
|
37
38
|
const _response = await core.fetcher({
|
|
38
39
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
39
40
|
(await core.Supplier.get(this._options.environment)) ??
|
|
40
|
-
environments.ToltApiEnvironment.
|
|
41
|
+
environments.ToltApiEnvironment.Default, "v2/partners/bulk/approve"),
|
|
41
42
|
method: "POST",
|
|
42
43
|
headers: _headers,
|
|
43
44
|
contentType: "application/json",
|
|
@@ -59,6 +60,8 @@ export class PartnersClient {
|
|
|
59
60
|
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
60
61
|
case 401:
|
|
61
62
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
63
|
+
case 413:
|
|
64
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
62
65
|
case 429:
|
|
63
66
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
64
67
|
default:
|
|
@@ -79,13 +82,15 @@ export class PartnersClient {
|
|
|
79
82
|
*
|
|
80
83
|
* @throws {@link ToltApi.BadRequestError}
|
|
81
84
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
85
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
82
86
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
83
87
|
* @throws {@link errors.ToltApiError}
|
|
84
88
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
85
89
|
*
|
|
86
90
|
* @example
|
|
87
91
|
* await client.partners.bulkReject({
|
|
88
|
-
* ids: ["
|
|
92
|
+
* ids: ["part_NLYzgNKuSuASvrvoxNtau6SY", "part_9fQ2xLLmN3kP8dRvT1wYbHcS"],
|
|
93
|
+
* rejection_note: "Site does not match our audience."
|
|
89
94
|
* })
|
|
90
95
|
*/
|
|
91
96
|
bulkReject(request, requestOptions) {
|
|
@@ -97,7 +102,7 @@ export class PartnersClient {
|
|
|
97
102
|
const _response = await core.fetcher({
|
|
98
103
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
99
104
|
(await core.Supplier.get(this._options.environment)) ??
|
|
100
|
-
environments.ToltApiEnvironment.
|
|
105
|
+
environments.ToltApiEnvironment.Default, "v2/partners/bulk/reject"),
|
|
101
106
|
method: "POST",
|
|
102
107
|
headers: _headers,
|
|
103
108
|
contentType: "application/json",
|
|
@@ -119,6 +124,8 @@ export class PartnersClient {
|
|
|
119
124
|
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
120
125
|
case 401:
|
|
121
126
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
127
|
+
case 413:
|
|
128
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
122
129
|
case 429:
|
|
123
130
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
124
131
|
default:
|
|
@@ -132,11 +139,14 @@ export class PartnersClient {
|
|
|
132
139
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/partners/bulk/reject");
|
|
133
140
|
}
|
|
134
141
|
/**
|
|
142
|
+
* Lists onboarded partners. Filter by status, program or group, search by name, email or company, and page with cursors.
|
|
143
|
+
*
|
|
135
144
|
* @param {ToltApi.ListPartnersRequest} request
|
|
136
145
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
137
146
|
*
|
|
138
147
|
* @throws {@link ToltApi.BadRequestError}
|
|
139
148
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
149
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
140
150
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
141
151
|
* @throws {@link errors.ToltApiError}
|
|
142
152
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
@@ -169,7 +179,7 @@ export class PartnersClient {
|
|
|
169
179
|
const _response = await core.fetcher({
|
|
170
180
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
171
181
|
(await core.Supplier.get(this._options.environment)) ??
|
|
172
|
-
environments.ToltApiEnvironment.
|
|
182
|
+
environments.ToltApiEnvironment.Default, "v2/partners"),
|
|
173
183
|
method: "GET",
|
|
174
184
|
headers: _headers,
|
|
175
185
|
queryString: core.url
|
|
@@ -192,6 +202,8 @@ export class PartnersClient {
|
|
|
192
202
|
throw new ToltApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
193
203
|
case 401:
|
|
194
204
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
205
|
+
case 413:
|
|
206
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
195
207
|
case 429:
|
|
196
208
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
197
209
|
default:
|
|
@@ -213,14 +225,22 @@ export class PartnersClient {
|
|
|
213
225
|
* @throws {@link ToltApi.BadRequestError}
|
|
214
226
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
215
227
|
* @throws {@link ToltApi.ConflictError}
|
|
228
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
216
229
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
217
230
|
* @throws {@link errors.ToltApiError}
|
|
218
231
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
219
232
|
*
|
|
220
233
|
* @example
|
|
221
234
|
* await client.partners.create({
|
|
222
|
-
* email: "sam@
|
|
223
|
-
* program_id: "
|
|
235
|
+
* email: "sam@example.com",
|
|
236
|
+
* program_id: "prg_T6z8aRW3XCmvFWP972RKxpAd",
|
|
237
|
+
* first_name: "Sam",
|
|
238
|
+
* last_name: "Taylor",
|
|
239
|
+
* group_id: "grp_zUQ8Pt281MsbNDApmDPN3Y2a",
|
|
240
|
+
* link: {
|
|
241
|
+
* value: "sam",
|
|
242
|
+
* param: "ref"
|
|
243
|
+
* }
|
|
224
244
|
* })
|
|
225
245
|
*/
|
|
226
246
|
create(request, requestOptions) {
|
|
@@ -232,7 +252,7 @@ export class PartnersClient {
|
|
|
232
252
|
const _response = await core.fetcher({
|
|
233
253
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
234
254
|
(await core.Supplier.get(this._options.environment)) ??
|
|
235
|
-
environments.ToltApiEnvironment.
|
|
255
|
+
environments.ToltApiEnvironment.Default, "v2/partners"),
|
|
236
256
|
method: "POST",
|
|
237
257
|
headers: _headers,
|
|
238
258
|
contentType: "application/json",
|
|
@@ -256,6 +276,8 @@ export class PartnersClient {
|
|
|
256
276
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
257
277
|
case 409:
|
|
258
278
|
throw new ToltApi.ConflictError(_response.error.body, _response.rawResponse);
|
|
279
|
+
case 413:
|
|
280
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
259
281
|
case 429:
|
|
260
282
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
261
283
|
default:
|
|
@@ -269,18 +291,21 @@ export class PartnersClient {
|
|
|
269
291
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/partners");
|
|
270
292
|
}
|
|
271
293
|
/**
|
|
294
|
+
* Gets a partner by ID, with their profile, status, group and program.
|
|
295
|
+
*
|
|
272
296
|
* @param {ToltApi.GetPartnersRequest} request
|
|
273
297
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
274
298
|
*
|
|
275
299
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
276
300
|
* @throws {@link ToltApi.NotFoundError}
|
|
301
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
277
302
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
278
303
|
* @throws {@link errors.ToltApiError}
|
|
279
304
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
280
305
|
*
|
|
281
306
|
* @example
|
|
282
307
|
* await client.partners.get({
|
|
283
|
-
* id: "
|
|
308
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
284
309
|
* })
|
|
285
310
|
*/
|
|
286
311
|
get(request, requestOptions) {
|
|
@@ -293,7 +318,7 @@ export class PartnersClient {
|
|
|
293
318
|
const _response = await core.fetcher({
|
|
294
319
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
295
320
|
(await core.Supplier.get(this._options.environment)) ??
|
|
296
|
-
environments.ToltApiEnvironment.
|
|
321
|
+
environments.ToltApiEnvironment.Default, `v2/partners/${core.url.encodePathParam(id)}`),
|
|
297
322
|
method: "GET",
|
|
298
323
|
headers: _headers,
|
|
299
324
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -312,6 +337,8 @@ export class PartnersClient {
|
|
|
312
337
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
313
338
|
case 404:
|
|
314
339
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
340
|
+
case 413:
|
|
341
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
315
342
|
case 429:
|
|
316
343
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
317
344
|
default:
|
|
@@ -333,14 +360,17 @@ export class PartnersClient {
|
|
|
333
360
|
* @throws {@link ToltApi.BadRequestError}
|
|
334
361
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
335
362
|
* @throws {@link ToltApi.NotFoundError}
|
|
336
|
-
* @throws {@link ToltApi.
|
|
363
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
337
364
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
338
365
|
* @throws {@link errors.ToltApiError}
|
|
339
366
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
340
367
|
*
|
|
341
368
|
* @example
|
|
342
369
|
* await client.partners.update({
|
|
343
|
-
* id: "
|
|
370
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY",
|
|
371
|
+
* first_name: "Sam",
|
|
372
|
+
* last_name: "Taylor",
|
|
373
|
+
* group_id: "grp_zUQ8Pt281MsbNDApmDPN3Y2a"
|
|
344
374
|
* })
|
|
345
375
|
*/
|
|
346
376
|
update(request, requestOptions) {
|
|
@@ -353,7 +383,7 @@ export class PartnersClient {
|
|
|
353
383
|
const _response = await core.fetcher({
|
|
354
384
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
355
385
|
(await core.Supplier.get(this._options.environment)) ??
|
|
356
|
-
environments.ToltApiEnvironment.
|
|
386
|
+
environments.ToltApiEnvironment.Default, `v2/partners/${core.url.encodePathParam(id)}`),
|
|
357
387
|
method: "PUT",
|
|
358
388
|
headers: _headers,
|
|
359
389
|
contentType: "application/json",
|
|
@@ -377,8 +407,8 @@ export class PartnersClient {
|
|
|
377
407
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
378
408
|
case 404:
|
|
379
409
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
380
|
-
case
|
|
381
|
-
throw new ToltApi.
|
|
410
|
+
case 413:
|
|
411
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
382
412
|
case 429:
|
|
383
413
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
384
414
|
default:
|
|
@@ -392,18 +422,21 @@ export class PartnersClient {
|
|
|
392
422
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v2/partners/{id}");
|
|
393
423
|
}
|
|
394
424
|
/**
|
|
425
|
+
* Makes the partner active. A partner who was not already active is sent the program's approval email.
|
|
426
|
+
*
|
|
395
427
|
* @param {ToltApi.ApprovePartnersRequest} request
|
|
396
428
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
397
429
|
*
|
|
398
430
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
399
431
|
* @throws {@link ToltApi.NotFoundError}
|
|
432
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
400
433
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
401
434
|
* @throws {@link errors.ToltApiError}
|
|
402
435
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
403
436
|
*
|
|
404
437
|
* @example
|
|
405
438
|
* await client.partners.approve({
|
|
406
|
-
* id: "
|
|
439
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
407
440
|
* })
|
|
408
441
|
*/
|
|
409
442
|
approve(request, requestOptions) {
|
|
@@ -416,7 +449,7 @@ export class PartnersClient {
|
|
|
416
449
|
const _response = await core.fetcher({
|
|
417
450
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
418
451
|
(await core.Supplier.get(this._options.environment)) ??
|
|
419
|
-
environments.ToltApiEnvironment.
|
|
452
|
+
environments.ToltApiEnvironment.Default, `v2/partners/${core.url.encodePathParam(id)}/approve`),
|
|
420
453
|
method: "POST",
|
|
421
454
|
headers: _headers,
|
|
422
455
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
@@ -435,6 +468,8 @@ export class PartnersClient {
|
|
|
435
468
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
436
469
|
case 404:
|
|
437
470
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
471
|
+
case 413:
|
|
472
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
438
473
|
case 429:
|
|
439
474
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
440
475
|
default:
|
|
@@ -448,19 +483,22 @@ export class PartnersClient {
|
|
|
448
483
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/partners/{id}/approve");
|
|
449
484
|
}
|
|
450
485
|
/**
|
|
486
|
+
* Rejects the partner. A partner who was not already rejected is sent the program's rejection email with the note.
|
|
487
|
+
*
|
|
451
488
|
* @param {ToltApi.RejectPartnersRequest} request
|
|
452
489
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
453
490
|
*
|
|
454
491
|
* @throws {@link ToltApi.BadRequestError}
|
|
455
492
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
456
493
|
* @throws {@link ToltApi.NotFoundError}
|
|
494
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
457
495
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
458
496
|
* @throws {@link errors.ToltApiError}
|
|
459
497
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
460
498
|
*
|
|
461
499
|
* @example
|
|
462
500
|
* await client.partners.reject({
|
|
463
|
-
* id: "
|
|
501
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
464
502
|
* })
|
|
465
503
|
*/
|
|
466
504
|
reject(request, requestOptions) {
|
|
@@ -473,7 +511,7 @@ export class PartnersClient {
|
|
|
473
511
|
const _response = await core.fetcher({
|
|
474
512
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
475
513
|
(await core.Supplier.get(this._options.environment)) ??
|
|
476
|
-
environments.ToltApiEnvironment.
|
|
514
|
+
environments.ToltApiEnvironment.Default, `v2/partners/${core.url.encodePathParam(id)}/reject`),
|
|
477
515
|
method: "POST",
|
|
478
516
|
headers: _headers,
|
|
479
517
|
contentType: "application/json",
|
|
@@ -497,6 +535,8 @@ export class PartnersClient {
|
|
|
497
535
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
498
536
|
case 404:
|
|
499
537
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
538
|
+
case 413:
|
|
539
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
500
540
|
case 429:
|
|
501
541
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
502
542
|
default:
|
|
@@ -510,19 +550,22 @@ export class PartnersClient {
|
|
|
510
550
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v2/partners/{id}/reject");
|
|
511
551
|
}
|
|
512
552
|
/**
|
|
553
|
+
* Suspends the partner, with an optional suspension_reason. Use the approve action to make them active again.
|
|
554
|
+
*
|
|
513
555
|
* @param {ToltApi.SuspendPartnersRequest} request
|
|
514
556
|
* @param {PartnersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
515
557
|
*
|
|
516
558
|
* @throws {@link ToltApi.BadRequestError}
|
|
517
559
|
* @throws {@link ToltApi.UnauthorizedError}
|
|
518
560
|
* @throws {@link ToltApi.NotFoundError}
|
|
561
|
+
* @throws {@link ToltApi.ContentTooLargeError}
|
|
519
562
|
* @throws {@link ToltApi.TooManyRequestsError}
|
|
520
563
|
* @throws {@link errors.ToltApiError}
|
|
521
564
|
* @throws {@link errors.ToltApiTimeoutError}
|
|
522
565
|
*
|
|
523
566
|
* @example
|
|
524
567
|
* await client.partners.suspend({
|
|
525
|
-
* id: "
|
|
568
|
+
* id: "part_NLYzgNKuSuASvrvoxNtau6SY"
|
|
526
569
|
* })
|
|
527
570
|
*/
|
|
528
571
|
suspend(request, requestOptions) {
|
|
@@ -535,7 +578,7 @@ export class PartnersClient {
|
|
|
535
578
|
const _response = await core.fetcher({
|
|
536
579
|
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
537
580
|
(await core.Supplier.get(this._options.environment)) ??
|
|
538
|
-
environments.ToltApiEnvironment.
|
|
581
|
+
environments.ToltApiEnvironment.Default, `v2/partners/${core.url.encodePathParam(id)}/suspend`),
|
|
539
582
|
method: "POST",
|
|
540
583
|
headers: _headers,
|
|
541
584
|
contentType: "application/json",
|
|
@@ -559,6 +602,8 @@ export class PartnersClient {
|
|
|
559
602
|
throw new ToltApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
560
603
|
case 404:
|
|
561
604
|
throw new ToltApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
605
|
+
case 413:
|
|
606
|
+
throw new ToltApi.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
562
607
|
case 429:
|
|
563
608
|
throw new ToltApi.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
564
609
|
default:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* ids: ["
|
|
4
|
+
* ids: ["part_NLYzgNKuSuASvrvoxNtau6SY", "part_9fQ2xLLmN3kP8dRvT1wYbHcS"]
|
|
5
5
|
* }
|
|
6
6
|
*/
|
|
7
7
|
export interface BulkApprovePartnersRequest {
|
|
8
|
-
/**
|
|
8
|
+
/** Ids of the partners to act on, as returned when listing partners. Each one succeeds or fails on its own and gets its own entry in results. */
|
|
9
9
|
ids: string[];
|
|
10
10
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
|
-
* ids: ["
|
|
4
|
+
* ids: ["part_NLYzgNKuSuASvrvoxNtau6SY", "part_9fQ2xLLmN3kP8dRvT1wYbHcS"],
|
|
5
|
+
* rejection_note: "Site does not match our audience."
|
|
5
6
|
* }
|
|
6
7
|
*/
|
|
7
8
|
export interface BulkRejectPartnersRequest {
|
|
8
|
-
/**
|
|
9
|
+
/** Ids of the partners to act on, as returned when listing partners. Each one succeeds or fails on its own and gets its own entry in results. */
|
|
9
10
|
ids: string[];
|
|
11
|
+
/** Reason for the rejection, shown to the partner in the partner portal. Null clears an earlier note. */
|
|
10
12
|
rejection_note?: string | null;
|
|
11
13
|
}
|