agentmail 0.5.21 → 0.5.22

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.
Files changed (189) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +6 -0
  3. package/dist/cjs/Client.js +36 -26
  4. package/dist/cjs/api/resources/accounts/client/Client.d.ts +37 -0
  5. package/dist/cjs/api/resources/accounts/client/Client.js +192 -0
  6. package/dist/cjs/api/resources/accounts/client/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/accounts/client/index.js +17 -0
  8. package/dist/cjs/api/resources/accounts/client/requests/ListAccountsRequest.d.ts +10 -0
  9. package/dist/cjs/api/resources/accounts/client/requests/ListAccountsRequest.js +3 -0
  10. package/dist/cjs/api/resources/accounts/client/requests/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/accounts/client/requests/index.js +2 -0
  12. package/dist/cjs/api/resources/accounts/exports.d.ts +2 -0
  13. package/dist/cjs/api/resources/accounts/exports.js +21 -0
  14. package/dist/cjs/api/resources/accounts/index.d.ts +2 -0
  15. package/dist/cjs/api/resources/accounts/index.js +18 -0
  16. package/dist/cjs/api/resources/accounts/types/Account.d.ts +19 -0
  17. package/dist/cjs/api/resources/accounts/types/Account.js +3 -0
  18. package/dist/cjs/api/resources/accounts/types/AccountId.d.ts +4 -0
  19. package/dist/cjs/api/resources/accounts/types/AccountId.js +3 -0
  20. package/dist/cjs/api/resources/accounts/types/ListAccountsResponse.d.ts +7 -0
  21. package/dist/cjs/api/resources/accounts/types/ListAccountsResponse.js +3 -0
  22. package/dist/cjs/api/resources/accounts/types/ProviderId.d.ts +4 -0
  23. package/dist/cjs/api/resources/accounts/types/ProviderId.js +3 -0
  24. package/dist/cjs/api/resources/accounts/types/index.d.ts +4 -0
  25. package/dist/cjs/api/resources/accounts/types/index.js +20 -0
  26. package/dist/cjs/api/resources/index.d.ts +6 -0
  27. package/dist/cjs/api/resources/index.js +10 -4
  28. package/dist/cjs/api/resources/providers/client/Client.d.ts +86 -0
  29. package/dist/cjs/api/resources/providers/client/Client.js +423 -0
  30. package/dist/cjs/api/resources/providers/client/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/providers/client/index.js +17 -0
  32. package/dist/cjs/api/resources/providers/client/requests/ListProviderAccountsRequest.d.ts +9 -0
  33. package/dist/cjs/api/resources/providers/client/requests/ListProviderAccountsRequest.js +3 -0
  34. package/dist/cjs/api/resources/providers/client/requests/ListProvidersRequest.d.ts +9 -0
  35. package/dist/cjs/api/resources/providers/client/requests/ListProvidersRequest.js +3 -0
  36. package/dist/cjs/api/resources/providers/client/requests/SearchProvidersRequest.d.ts +12 -0
  37. package/dist/cjs/api/resources/providers/client/requests/SearchProvidersRequest.js +3 -0
  38. package/dist/cjs/api/resources/providers/client/requests/index.d.ts +3 -0
  39. package/dist/cjs/api/resources/providers/client/requests/index.js +2 -0
  40. package/dist/cjs/api/resources/providers/exports.d.ts +2 -0
  41. package/dist/cjs/api/resources/providers/exports.js +21 -0
  42. package/dist/cjs/api/resources/providers/index.d.ts +2 -0
  43. package/dist/cjs/api/resources/providers/index.js +18 -0
  44. package/dist/cjs/api/resources/providers/types/ConnectProviderAccepted.d.ts +8 -0
  45. package/dist/cjs/api/resources/providers/types/ConnectProviderAccepted.js +3 -0
  46. package/dist/cjs/api/resources/providers/types/ConnectProviderBody.d.ts +7 -0
  47. package/dist/cjs/api/resources/providers/types/ConnectProviderBody.js +3 -0
  48. package/dist/cjs/api/resources/providers/types/ListProviderAccountsResponse.d.ts +8 -0
  49. package/dist/cjs/api/resources/providers/types/ListProviderAccountsResponse.js +3 -0
  50. package/dist/cjs/api/resources/providers/types/ListProvidersResponse.d.ts +7 -0
  51. package/dist/cjs/api/resources/providers/types/ListProvidersResponse.js +3 -0
  52. package/dist/cjs/api/resources/providers/types/Provider.d.ts +14 -0
  53. package/dist/cjs/api/resources/providers/types/Provider.js +3 -0
  54. package/dist/cjs/api/resources/providers/types/SearchProvidersResponse.d.ts +6 -0
  55. package/dist/cjs/api/resources/providers/types/SearchProvidersResponse.js +3 -0
  56. package/dist/cjs/api/resources/providers/types/index.d.ts +6 -0
  57. package/dist/cjs/api/resources/providers/types/index.js +22 -0
  58. package/dist/cjs/serialization/resources/accounts/index.d.ts +1 -0
  59. package/dist/cjs/serialization/resources/accounts/index.js +17 -0
  60. package/dist/cjs/serialization/resources/accounts/types/Account.d.ts +22 -0
  61. package/dist/cjs/serialization/resources/accounts/types/Account.js +54 -0
  62. package/dist/cjs/serialization/resources/accounts/types/AccountId.d.ts +7 -0
  63. package/dist/cjs/serialization/resources/accounts/types/AccountId.js +39 -0
  64. package/dist/cjs/serialization/resources/accounts/types/ListAccountsResponse.d.ts +16 -0
  65. package/dist/cjs/serialization/resources/accounts/types/ListAccountsResponse.js +48 -0
  66. package/dist/cjs/serialization/resources/accounts/types/ProviderId.d.ts +7 -0
  67. package/dist/cjs/serialization/resources/accounts/types/ProviderId.js +39 -0
  68. package/dist/cjs/serialization/resources/accounts/types/index.d.ts +4 -0
  69. package/dist/cjs/serialization/resources/accounts/types/index.js +20 -0
  70. package/dist/cjs/serialization/resources/index.d.ts +4 -0
  71. package/dist/cjs/serialization/resources/index.js +5 -1
  72. package/dist/cjs/serialization/resources/providers/client/connect.d.ts +8 -0
  73. package/dist/cjs/serialization/resources/providers/client/connect.js +6 -0
  74. package/dist/cjs/serialization/resources/providers/client/index.d.ts +1 -0
  75. package/dist/cjs/serialization/resources/providers/client/index.js +37 -0
  76. package/dist/cjs/serialization/resources/providers/index.d.ts +2 -0
  77. package/dist/cjs/serialization/resources/providers/index.js +18 -0
  78. package/dist/cjs/serialization/resources/providers/types/ConnectProviderAccepted.d.ts +11 -0
  79. package/dist/cjs/serialization/resources/providers/types/ConnectProviderAccepted.js +43 -0
  80. package/dist/cjs/serialization/resources/providers/types/ConnectProviderBody.d.ts +11 -0
  81. package/dist/cjs/serialization/resources/providers/types/ConnectProviderBody.js +43 -0
  82. package/dist/cjs/serialization/resources/providers/types/ListProviderAccountsResponse.d.ts +18 -0
  83. package/dist/cjs/serialization/resources/providers/types/ListProviderAccountsResponse.js +50 -0
  84. package/dist/cjs/serialization/resources/providers/types/ListProvidersResponse.d.ts +16 -0
  85. package/dist/cjs/serialization/resources/providers/types/ListProvidersResponse.js +48 -0
  86. package/dist/cjs/serialization/resources/providers/types/Provider.d.ts +16 -0
  87. package/dist/cjs/serialization/resources/providers/types/Provider.js +48 -0
  88. package/dist/cjs/serialization/resources/providers/types/SearchProvidersResponse.d.ts +14 -0
  89. package/dist/cjs/serialization/resources/providers/types/SearchProvidersResponse.js +46 -0
  90. package/dist/cjs/serialization/resources/providers/types/index.d.ts +6 -0
  91. package/dist/cjs/serialization/resources/providers/types/index.js +22 -0
  92. package/dist/cjs/version.d.ts +1 -1
  93. package/dist/cjs/version.js +1 -1
  94. package/dist/esm/BaseClient.mjs +2 -2
  95. package/dist/esm/Client.d.mts +6 -0
  96. package/dist/esm/Client.mjs +10 -0
  97. package/dist/esm/api/resources/accounts/client/Client.d.mts +37 -0
  98. package/dist/esm/api/resources/accounts/client/Client.mjs +155 -0
  99. package/dist/esm/api/resources/accounts/client/index.d.mts +1 -0
  100. package/dist/esm/api/resources/accounts/client/index.mjs +1 -0
  101. package/dist/esm/api/resources/accounts/client/requests/ListAccountsRequest.d.mts +10 -0
  102. package/dist/esm/api/resources/accounts/client/requests/ListAccountsRequest.mjs +2 -0
  103. package/dist/esm/api/resources/accounts/client/requests/index.d.mts +1 -0
  104. package/dist/esm/api/resources/accounts/client/requests/index.mjs +1 -0
  105. package/dist/esm/api/resources/accounts/exports.d.mts +2 -0
  106. package/dist/esm/api/resources/accounts/exports.mjs +3 -0
  107. package/dist/esm/api/resources/accounts/index.d.mts +2 -0
  108. package/dist/esm/api/resources/accounts/index.mjs +2 -0
  109. package/dist/esm/api/resources/accounts/types/Account.d.mts +19 -0
  110. package/dist/esm/api/resources/accounts/types/Account.mjs +2 -0
  111. package/dist/esm/api/resources/accounts/types/AccountId.d.mts +4 -0
  112. package/dist/esm/api/resources/accounts/types/AccountId.mjs +2 -0
  113. package/dist/esm/api/resources/accounts/types/ListAccountsResponse.d.mts +7 -0
  114. package/dist/esm/api/resources/accounts/types/ListAccountsResponse.mjs +2 -0
  115. package/dist/esm/api/resources/accounts/types/ProviderId.d.mts +4 -0
  116. package/dist/esm/api/resources/accounts/types/ProviderId.mjs +2 -0
  117. package/dist/esm/api/resources/accounts/types/index.d.mts +4 -0
  118. package/dist/esm/api/resources/accounts/types/index.mjs +4 -0
  119. package/dist/esm/api/resources/index.d.mts +6 -0
  120. package/dist/esm/api/resources/index.mjs +6 -0
  121. package/dist/esm/api/resources/providers/client/Client.d.mts +86 -0
  122. package/dist/esm/api/resources/providers/client/Client.mjs +386 -0
  123. package/dist/esm/api/resources/providers/client/index.d.mts +1 -0
  124. package/dist/esm/api/resources/providers/client/index.mjs +1 -0
  125. package/dist/esm/api/resources/providers/client/requests/ListProviderAccountsRequest.d.mts +9 -0
  126. package/dist/esm/api/resources/providers/client/requests/ListProviderAccountsRequest.mjs +2 -0
  127. package/dist/esm/api/resources/providers/client/requests/ListProvidersRequest.d.mts +9 -0
  128. package/dist/esm/api/resources/providers/client/requests/ListProvidersRequest.mjs +2 -0
  129. package/dist/esm/api/resources/providers/client/requests/SearchProvidersRequest.d.mts +12 -0
  130. package/dist/esm/api/resources/providers/client/requests/SearchProvidersRequest.mjs +2 -0
  131. package/dist/esm/api/resources/providers/client/requests/index.d.mts +3 -0
  132. package/dist/esm/api/resources/providers/client/requests/index.mjs +1 -0
  133. package/dist/esm/api/resources/providers/exports.d.mts +2 -0
  134. package/dist/esm/api/resources/providers/exports.mjs +3 -0
  135. package/dist/esm/api/resources/providers/index.d.mts +2 -0
  136. package/dist/esm/api/resources/providers/index.mjs +2 -0
  137. package/dist/esm/api/resources/providers/types/ConnectProviderAccepted.d.mts +8 -0
  138. package/dist/esm/api/resources/providers/types/ConnectProviderAccepted.mjs +2 -0
  139. package/dist/esm/api/resources/providers/types/ConnectProviderBody.d.mts +7 -0
  140. package/dist/esm/api/resources/providers/types/ConnectProviderBody.mjs +2 -0
  141. package/dist/esm/api/resources/providers/types/ListProviderAccountsResponse.d.mts +8 -0
  142. package/dist/esm/api/resources/providers/types/ListProviderAccountsResponse.mjs +2 -0
  143. package/dist/esm/api/resources/providers/types/ListProvidersResponse.d.mts +7 -0
  144. package/dist/esm/api/resources/providers/types/ListProvidersResponse.mjs +2 -0
  145. package/dist/esm/api/resources/providers/types/Provider.d.mts +14 -0
  146. package/dist/esm/api/resources/providers/types/Provider.mjs +2 -0
  147. package/dist/esm/api/resources/providers/types/SearchProvidersResponse.d.mts +6 -0
  148. package/dist/esm/api/resources/providers/types/SearchProvidersResponse.mjs +2 -0
  149. package/dist/esm/api/resources/providers/types/index.d.mts +6 -0
  150. package/dist/esm/api/resources/providers/types/index.mjs +6 -0
  151. package/dist/esm/serialization/resources/accounts/index.d.mts +1 -0
  152. package/dist/esm/serialization/resources/accounts/index.mjs +1 -0
  153. package/dist/esm/serialization/resources/accounts/types/Account.d.mts +22 -0
  154. package/dist/esm/serialization/resources/accounts/types/Account.mjs +18 -0
  155. package/dist/esm/serialization/resources/accounts/types/AccountId.d.mts +7 -0
  156. package/dist/esm/serialization/resources/accounts/types/AccountId.mjs +3 -0
  157. package/dist/esm/serialization/resources/accounts/types/ListAccountsResponse.d.mts +16 -0
  158. package/dist/esm/serialization/resources/accounts/types/ListAccountsResponse.mjs +12 -0
  159. package/dist/esm/serialization/resources/accounts/types/ProviderId.d.mts +7 -0
  160. package/dist/esm/serialization/resources/accounts/types/ProviderId.mjs +3 -0
  161. package/dist/esm/serialization/resources/accounts/types/index.d.mts +4 -0
  162. package/dist/esm/serialization/resources/accounts/types/index.mjs +4 -0
  163. package/dist/esm/serialization/resources/index.d.mts +4 -0
  164. package/dist/esm/serialization/resources/index.mjs +4 -0
  165. package/dist/esm/serialization/resources/providers/client/connect.d.mts +8 -0
  166. package/dist/esm/serialization/resources/providers/client/connect.mjs +3 -0
  167. package/dist/esm/serialization/resources/providers/client/index.d.mts +1 -0
  168. package/dist/esm/serialization/resources/providers/client/index.mjs +1 -0
  169. package/dist/esm/serialization/resources/providers/index.d.mts +2 -0
  170. package/dist/esm/serialization/resources/providers/index.mjs +2 -0
  171. package/dist/esm/serialization/resources/providers/types/ConnectProviderAccepted.d.mts +11 -0
  172. package/dist/esm/serialization/resources/providers/types/ConnectProviderAccepted.mjs +7 -0
  173. package/dist/esm/serialization/resources/providers/types/ConnectProviderBody.d.mts +11 -0
  174. package/dist/esm/serialization/resources/providers/types/ConnectProviderBody.mjs +7 -0
  175. package/dist/esm/serialization/resources/providers/types/ListProviderAccountsResponse.d.mts +18 -0
  176. package/dist/esm/serialization/resources/providers/types/ListProviderAccountsResponse.mjs +14 -0
  177. package/dist/esm/serialization/resources/providers/types/ListProvidersResponse.d.mts +16 -0
  178. package/dist/esm/serialization/resources/providers/types/ListProvidersResponse.mjs +12 -0
  179. package/dist/esm/serialization/resources/providers/types/Provider.d.mts +16 -0
  180. package/dist/esm/serialization/resources/providers/types/Provider.mjs +12 -0
  181. package/dist/esm/serialization/resources/providers/types/SearchProvidersResponse.d.mts +14 -0
  182. package/dist/esm/serialization/resources/providers/types/SearchProvidersResponse.mjs +10 -0
  183. package/dist/esm/serialization/resources/providers/types/index.d.mts +6 -0
  184. package/dist/esm/serialization/resources/providers/types/index.mjs +6 -0
  185. package/dist/esm/version.d.mts +1 -1
  186. package/dist/esm/version.mjs +1 -1
  187. package/dist/llms.txt +1 -0
  188. package/package.json +23 -1
  189. package/reference.md +435 -0
@@ -0,0 +1,10 @@
1
+ import type * as AgentMail from "../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface ListAccountsRequest {
7
+ limit?: AgentMail.Limit;
8
+ pageToken?: AgentMail.PageToken;
9
+ ascending?: AgentMail.Ascending;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type { ListAccountsRequest } from "./ListAccountsRequest.mjs";
@@ -0,0 +1,2 @@
1
+ export { AccountsClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { AccountsClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,19 @@
1
+ import type * as AgentMail from "../../../index.mjs";
2
+ /**
3
+ * One inbox signed in at one provider.
4
+ */
5
+ export interface Account {
6
+ accountId: AgentMail.AccountId;
7
+ providerId: AgentMail.ProviderId;
8
+ /** Display name of provider. */
9
+ providerName?: string;
10
+ inboxId: AgentMail.inboxes.InboxId;
11
+ podId: AgentMail.pods.PodId;
12
+ organizationId: AgentMail.OrganizationId;
13
+ /** Time of first sign-in at provider. */
14
+ firstSignedInAt: Date;
15
+ /** Time of most recent sign-in at provider. */
16
+ lastSignedInAt: Date;
17
+ /** Number of sign-ins at provider. */
18
+ signInCount: number;
19
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * ID of account.
3
+ */
4
+ export type AccountId = string;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ import type * as AgentMail from "../../../index.mjs";
2
+ export interface ListAccountsResponse {
3
+ count: AgentMail.Count;
4
+ limit: AgentMail.Limit;
5
+ nextPageToken?: AgentMail.PageToken;
6
+ accounts: AgentMail.Account[];
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * ID of provider.
3
+ */
4
+ export type ProviderId = string;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from "./Account.mjs";
2
+ export * from "./AccountId.mjs";
3
+ export * from "./ListAccountsResponse.mjs";
4
+ export * from "./ProviderId.mjs";
@@ -0,0 +1,4 @@
1
+ export * from "./Account.mjs";
2
+ export * from "./AccountId.mjs";
3
+ export * from "./ListAccountsResponse.mjs";
4
+ export * from "./ProviderId.mjs";
@@ -1,3 +1,6 @@
1
+ export * from "./accounts/client/requests/index.mjs";
2
+ export * as accounts from "./accounts/index.mjs";
3
+ export * from "./accounts/types/index.mjs";
1
4
  export * as agent from "./agent/index.mjs";
2
5
  export * from "./agent/types/index.mjs";
3
6
  export * from "./apiKeys/client/requests/index.mjs";
@@ -30,6 +33,9 @@ export * from "./metrics/types/index.mjs";
30
33
  export * as organizations from "./organizations/index.mjs";
31
34
  export * from "./organizations/types/index.mjs";
32
35
  export * as pods from "./pods/index.mjs";
36
+ export * from "./providers/client/requests/index.mjs";
37
+ export * as providers from "./providers/index.mjs";
38
+ export * from "./providers/types/index.mjs";
33
39
  export * from "./threads/client/requests/index.mjs";
34
40
  export * as threads from "./threads/index.mjs";
35
41
  export * from "./threads/types/index.mjs";
@@ -1,3 +1,6 @@
1
+ export * from "./accounts/client/requests/index.mjs";
2
+ export * as accounts from "./accounts/index.mjs";
3
+ export * from "./accounts/types/index.mjs";
1
4
  export * as agent from "./agent/index.mjs";
2
5
  export * from "./agent/types/index.mjs";
3
6
  export * from "./apiKeys/client/requests/index.mjs";
@@ -30,6 +33,9 @@ export * from "./metrics/types/index.mjs";
30
33
  export * as organizations from "./organizations/index.mjs";
31
34
  export * from "./organizations/types/index.mjs";
32
35
  export * as pods from "./pods/index.mjs";
36
+ export * from "./providers/client/requests/index.mjs";
37
+ export * as providers from "./providers/index.mjs";
38
+ export * from "./providers/types/index.mjs";
33
39
  export * from "./threads/client/requests/index.mjs";
34
40
  export * as threads from "./threads/index.mjs";
35
41
  export * from "./threads/types/index.mjs";
@@ -0,0 +1,86 @@
1
+ import type { BaseClientOptions, BaseIdempotentRequestOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
+ import * as core from "../../../../core/index.mjs";
4
+ import * as AgentMail from "../../../index.mjs";
5
+ export declare namespace ProvidersClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ interface IdempotentRequestOptions extends RequestOptions, BaseIdempotentRequestOptions {
10
+ }
11
+ }
12
+ export declare class ProvidersClient {
13
+ protected readonly _options: NormalizedClientOptionsWithAuth<ProvidersClient.Options>;
14
+ constructor(options?: ProvidersClient.Options);
15
+ /**
16
+ * Lists providers, most popular first.
17
+ *
18
+ * @param {AgentMail.ListProvidersRequest} request
19
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
20
+ *
21
+ * @throws {@link AgentMail.ValidationError}
22
+ *
23
+ * @example
24
+ * await client.providers.list()
25
+ */
26
+ list(request?: AgentMail.ListProvidersRequest, requestOptions?: ProvidersClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListProvidersResponse>;
27
+ private __list;
28
+ /**
29
+ * Searches providers by name prefix.
30
+ *
31
+ * @param {AgentMail.SearchProvidersRequest} request
32
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
33
+ *
34
+ * @throws {@link AgentMail.ValidationError}
35
+ *
36
+ * @example
37
+ * await client.providers.search({
38
+ * q: "q"
39
+ * })
40
+ */
41
+ search(request: AgentMail.SearchProvidersRequest, requestOptions?: ProvidersClient.RequestOptions): core.HttpResponsePromise<AgentMail.SearchProvidersResponse>;
42
+ private __search;
43
+ /**
44
+ * @param {AgentMail.ProviderId} provider_id
45
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
46
+ *
47
+ * @throws {@link AgentMail.NotFoundError}
48
+ *
49
+ * @example
50
+ * await client.providers.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
51
+ */
52
+ get(provider_id: AgentMail.ProviderId, requestOptions?: ProvidersClient.RequestOptions): core.HttpResponsePromise<AgentMail.Provider>;
53
+ private __get;
54
+ /**
55
+ * Lists accounts at one provider, most recent sign-in first.
56
+ *
57
+ * @param {AgentMail.ProviderId} provider_id
58
+ * @param {AgentMail.ListProviderAccountsRequest} request
59
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
60
+ *
61
+ * @throws {@link AgentMail.ValidationError}
62
+ *
63
+ * @example
64
+ * await client.providers.listAccounts("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
65
+ */
66
+ listAccounts(provider_id: AgentMail.ProviderId, request?: AgentMail.ListProviderAccountsRequest, requestOptions?: ProvidersClient.RequestOptions): core.HttpResponsePromise<AgentMail.ListProviderAccountsResponse>;
67
+ private __listAccounts;
68
+ /**
69
+ * Starts signing an inbox in to a provider. Returns a `magic_url` valid
70
+ * for five minutes; open it in the browser that will hold the sign-in.
71
+ * Requires `api_key_create` and an `Idempotency-Key` header.
72
+ *
73
+ * @param {AgentMail.ProviderId} provider_id
74
+ * @param {AgentMail.ConnectProviderBody} request
75
+ * @param {ProvidersClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
76
+ *
77
+ * @throws {@link AgentMail.ValidationError}
78
+ * @throws {@link AgentMail.NotFoundError}
79
+ * @throws {@link AgentMail.ConflictError}
80
+ *
81
+ * @example
82
+ * await client.providers.connect("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", undefined)
83
+ */
84
+ connect(provider_id: AgentMail.ProviderId, request?: AgentMail.ConnectProviderBody, requestOptions?: ProvidersClient.IdempotentRequestOptions): core.HttpResponsePromise<AgentMail.ConnectProviderAccepted>;
85
+ private __connect;
86
+ }
@@ -0,0 +1,386 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
13
+ import * as core from "../../../../core/index.mjs";
14
+ import * as environments from "../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../errors/index.mjs";
17
+ import * as serializers from "../../../../serialization/index.mjs";
18
+ import * as AgentMail from "../../../index.mjs";
19
+ export class ProvidersClient {
20
+ constructor(options = {}) {
21
+ this._options = normalizeClientOptionsWithAuth(options);
22
+ }
23
+ /**
24
+ * Lists providers, most popular first.
25
+ *
26
+ * @param {AgentMail.ListProvidersRequest} request
27
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
28
+ *
29
+ * @throws {@link AgentMail.ValidationError}
30
+ *
31
+ * @example
32
+ * await client.providers.list()
33
+ */
34
+ list(request = {}, requestOptions) {
35
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
36
+ }
37
+ __list() {
38
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
39
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40
+ const { limit, pageToken } = request;
41
+ const _queryParams = {
42
+ limit,
43
+ page_token: pageToken,
44
+ };
45
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
46
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
47
+ const _response = yield core.fetcher({
48
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
49
+ .http, "/v0/providers"),
50
+ method: "GET",
51
+ headers: _headers,
52
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
53
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
54
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
55
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
56
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
57
+ logging: this._options.logging,
58
+ });
59
+ if (_response.ok) {
60
+ return {
61
+ data: serializers.ListProvidersResponse.parseOrThrow(_response.body, {
62
+ unrecognizedObjectKeys: "passthrough",
63
+ allowUnrecognizedUnionMembers: true,
64
+ allowUnrecognizedEnumValues: true,
65
+ skipValidation: true,
66
+ breadcrumbsPrefix: ["response"],
67
+ }),
68
+ rawResponse: _response.rawResponse,
69
+ };
70
+ }
71
+ if (_response.error.reason === "status-code") {
72
+ switch (_response.error.statusCode) {
73
+ case 400:
74
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
75
+ unrecognizedObjectKeys: "passthrough",
76
+ allowUnrecognizedUnionMembers: true,
77
+ allowUnrecognizedEnumValues: true,
78
+ skipValidation: true,
79
+ breadcrumbsPrefix: ["response"],
80
+ }), _response.rawResponse);
81
+ default:
82
+ throw new errors.AgentMailError({
83
+ statusCode: _response.error.statusCode,
84
+ body: _response.error.body,
85
+ rawResponse: _response.rawResponse,
86
+ });
87
+ }
88
+ }
89
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/providers");
90
+ });
91
+ }
92
+ /**
93
+ * Searches providers by name prefix.
94
+ *
95
+ * @param {AgentMail.SearchProvidersRequest} request
96
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
97
+ *
98
+ * @throws {@link AgentMail.ValidationError}
99
+ *
100
+ * @example
101
+ * await client.providers.search({
102
+ * q: "q"
103
+ * })
104
+ */
105
+ search(request, requestOptions) {
106
+ return core.HttpResponsePromise.fromPromise(this.__search(request, requestOptions));
107
+ }
108
+ __search(request, requestOptions) {
109
+ return __awaiter(this, void 0, void 0, function* () {
110
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
111
+ const { q, limit } = request;
112
+ const _queryParams = {
113
+ q,
114
+ limit,
115
+ };
116
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
117
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
118
+ const _response = yield core.fetcher({
119
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
120
+ .http, "/v0/providers/search"),
121
+ method: "GET",
122
+ headers: _headers,
123
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
124
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
125
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
126
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
127
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
128
+ logging: this._options.logging,
129
+ });
130
+ if (_response.ok) {
131
+ return {
132
+ data: serializers.SearchProvidersResponse.parseOrThrow(_response.body, {
133
+ unrecognizedObjectKeys: "passthrough",
134
+ allowUnrecognizedUnionMembers: true,
135
+ allowUnrecognizedEnumValues: true,
136
+ skipValidation: true,
137
+ breadcrumbsPrefix: ["response"],
138
+ }),
139
+ rawResponse: _response.rawResponse,
140
+ };
141
+ }
142
+ if (_response.error.reason === "status-code") {
143
+ switch (_response.error.statusCode) {
144
+ case 400:
145
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
146
+ unrecognizedObjectKeys: "passthrough",
147
+ allowUnrecognizedUnionMembers: true,
148
+ allowUnrecognizedEnumValues: true,
149
+ skipValidation: true,
150
+ breadcrumbsPrefix: ["response"],
151
+ }), _response.rawResponse);
152
+ default:
153
+ throw new errors.AgentMailError({
154
+ statusCode: _response.error.statusCode,
155
+ body: _response.error.body,
156
+ rawResponse: _response.rawResponse,
157
+ });
158
+ }
159
+ }
160
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/providers/search");
161
+ });
162
+ }
163
+ /**
164
+ * @param {AgentMail.ProviderId} provider_id
165
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
166
+ *
167
+ * @throws {@link AgentMail.NotFoundError}
168
+ *
169
+ * @example
170
+ * await client.providers.get("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
171
+ */
172
+ get(provider_id, requestOptions) {
173
+ return core.HttpResponsePromise.fromPromise(this.__get(provider_id, requestOptions));
174
+ }
175
+ __get(provider_id, requestOptions) {
176
+ return __awaiter(this, void 0, void 0, function* () {
177
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
178
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
179
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
180
+ const _response = yield core.fetcher({
181
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
182
+ .http, `/v0/providers/${core.url.encodePathParam(serializers.ProviderId.jsonOrThrow(provider_id, { omitUndefined: true }))}`),
183
+ method: "GET",
184
+ headers: _headers,
185
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
186
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
187
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
188
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
189
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
190
+ logging: this._options.logging,
191
+ });
192
+ if (_response.ok) {
193
+ return {
194
+ data: serializers.Provider.parseOrThrow(_response.body, {
195
+ unrecognizedObjectKeys: "passthrough",
196
+ allowUnrecognizedUnionMembers: true,
197
+ allowUnrecognizedEnumValues: true,
198
+ skipValidation: true,
199
+ breadcrumbsPrefix: ["response"],
200
+ }),
201
+ rawResponse: _response.rawResponse,
202
+ };
203
+ }
204
+ if (_response.error.reason === "status-code") {
205
+ switch (_response.error.statusCode) {
206
+ case 404:
207
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
208
+ unrecognizedObjectKeys: "passthrough",
209
+ allowUnrecognizedUnionMembers: true,
210
+ allowUnrecognizedEnumValues: true,
211
+ skipValidation: true,
212
+ breadcrumbsPrefix: ["response"],
213
+ }), _response.rawResponse);
214
+ default:
215
+ throw new errors.AgentMailError({
216
+ statusCode: _response.error.statusCode,
217
+ body: _response.error.body,
218
+ rawResponse: _response.rawResponse,
219
+ });
220
+ }
221
+ }
222
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/providers/{provider_id}");
223
+ });
224
+ }
225
+ /**
226
+ * Lists accounts at one provider, most recent sign-in first.
227
+ *
228
+ * @param {AgentMail.ProviderId} provider_id
229
+ * @param {AgentMail.ListProviderAccountsRequest} request
230
+ * @param {ProvidersClient.RequestOptions} requestOptions - Request-specific configuration.
231
+ *
232
+ * @throws {@link AgentMail.ValidationError}
233
+ *
234
+ * @example
235
+ * await client.providers.listAccounts("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32")
236
+ */
237
+ listAccounts(provider_id, request = {}, requestOptions) {
238
+ return core.HttpResponsePromise.fromPromise(this.__listAccounts(provider_id, request, requestOptions));
239
+ }
240
+ __listAccounts(provider_id_1) {
241
+ return __awaiter(this, arguments, void 0, function* (provider_id, request = {}, requestOptions) {
242
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
243
+ const { limit, pageToken } = request;
244
+ const _queryParams = {
245
+ limit,
246
+ page_token: pageToken,
247
+ };
248
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
249
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
250
+ const _response = yield core.fetcher({
251
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
252
+ .http, `/v0/providers/${core.url.encodePathParam(serializers.ProviderId.jsonOrThrow(provider_id, { omitUndefined: true }))}/accounts`),
253
+ method: "GET",
254
+ headers: _headers,
255
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
256
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
257
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
258
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
259
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
260
+ logging: this._options.logging,
261
+ });
262
+ if (_response.ok) {
263
+ return {
264
+ data: serializers.ListProviderAccountsResponse.parseOrThrow(_response.body, {
265
+ unrecognizedObjectKeys: "passthrough",
266
+ allowUnrecognizedUnionMembers: true,
267
+ allowUnrecognizedEnumValues: true,
268
+ skipValidation: true,
269
+ breadcrumbsPrefix: ["response"],
270
+ }),
271
+ rawResponse: _response.rawResponse,
272
+ };
273
+ }
274
+ if (_response.error.reason === "status-code") {
275
+ switch (_response.error.statusCode) {
276
+ case 400:
277
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
278
+ unrecognizedObjectKeys: "passthrough",
279
+ allowUnrecognizedUnionMembers: true,
280
+ allowUnrecognizedEnumValues: true,
281
+ skipValidation: true,
282
+ breadcrumbsPrefix: ["response"],
283
+ }), _response.rawResponse);
284
+ default:
285
+ throw new errors.AgentMailError({
286
+ statusCode: _response.error.statusCode,
287
+ body: _response.error.body,
288
+ rawResponse: _response.rawResponse,
289
+ });
290
+ }
291
+ }
292
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/providers/{provider_id}/accounts");
293
+ });
294
+ }
295
+ /**
296
+ * Starts signing an inbox in to a provider. Returns a `magic_url` valid
297
+ * for five minutes; open it in the browser that will hold the sign-in.
298
+ * Requires `api_key_create` and an `Idempotency-Key` header.
299
+ *
300
+ * @param {AgentMail.ProviderId} provider_id
301
+ * @param {AgentMail.ConnectProviderBody} request
302
+ * @param {ProvidersClient.IdempotentRequestOptions} requestOptions - Request-specific configuration.
303
+ *
304
+ * @throws {@link AgentMail.ValidationError}
305
+ * @throws {@link AgentMail.NotFoundError}
306
+ * @throws {@link AgentMail.ConflictError}
307
+ *
308
+ * @example
309
+ * await client.providers.connect("d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", undefined)
310
+ */
311
+ connect(provider_id, request, requestOptions) {
312
+ return core.HttpResponsePromise.fromPromise(this.__connect(provider_id, request, requestOptions));
313
+ }
314
+ __connect(provider_id, request, requestOptions) {
315
+ return __awaiter(this, void 0, void 0, function* () {
316
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
317
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
318
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "Idempotency-Key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.idempotencyKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
319
+ const _response = yield core.fetcher({
320
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Prod)
321
+ .http, `/v0/providers/${core.url.encodePathParam(serializers.ProviderId.jsonOrThrow(provider_id, { omitUndefined: true }))}/connect`),
322
+ method: "POST",
323
+ headers: _headers,
324
+ contentType: "application/json",
325
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
326
+ requestType: "json",
327
+ body: serializers.providers.connect.Request.jsonOrThrow(request, {
328
+ unrecognizedObjectKeys: "strip",
329
+ omitUndefined: true,
330
+ }),
331
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
332
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
333
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
334
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
335
+ logging: this._options.logging,
336
+ });
337
+ if (_response.ok) {
338
+ return {
339
+ data: serializers.ConnectProviderAccepted.parseOrThrow(_response.body, {
340
+ unrecognizedObjectKeys: "passthrough",
341
+ allowUnrecognizedUnionMembers: true,
342
+ allowUnrecognizedEnumValues: true,
343
+ skipValidation: true,
344
+ breadcrumbsPrefix: ["response"],
345
+ }),
346
+ rawResponse: _response.rawResponse,
347
+ };
348
+ }
349
+ if (_response.error.reason === "status-code") {
350
+ switch (_response.error.statusCode) {
351
+ case 400:
352
+ throw new AgentMail.ValidationError(serializers.ValidationErrorResponse.parseOrThrow(_response.error.body, {
353
+ unrecognizedObjectKeys: "passthrough",
354
+ allowUnrecognizedUnionMembers: true,
355
+ allowUnrecognizedEnumValues: true,
356
+ skipValidation: true,
357
+ breadcrumbsPrefix: ["response"],
358
+ }), _response.rawResponse);
359
+ case 404:
360
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
361
+ unrecognizedObjectKeys: "passthrough",
362
+ allowUnrecognizedUnionMembers: true,
363
+ allowUnrecognizedEnumValues: true,
364
+ skipValidation: true,
365
+ breadcrumbsPrefix: ["response"],
366
+ }), _response.rawResponse);
367
+ case 409:
368
+ throw new AgentMail.ConflictError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
369
+ unrecognizedObjectKeys: "passthrough",
370
+ allowUnrecognizedUnionMembers: true,
371
+ allowUnrecognizedEnumValues: true,
372
+ skipValidation: true,
373
+ breadcrumbsPrefix: ["response"],
374
+ }), _response.rawResponse);
375
+ default:
376
+ throw new errors.AgentMailError({
377
+ statusCode: _response.error.statusCode,
378
+ body: _response.error.body,
379
+ rawResponse: _response.rawResponse,
380
+ });
381
+ }
382
+ }
383
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/providers/{provider_id}/connect");
384
+ });
385
+ }
386
+ }
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,9 @@
1
+ import type * as AgentMail from "../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface ListProviderAccountsRequest {
7
+ limit?: AgentMail.Limit;
8
+ pageToken?: AgentMail.PageToken;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};