boldsign 1.0.3 → 2.0.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.
Files changed (533) hide show
  1. package/.openapi-generator/FILES +157 -156
  2. package/.openapi-generator/VERSION +1 -1
  3. package/.openapi-generator-ignore +23 -23
  4. package/LICENSE +21 -21
  5. package/README.md +307 -306
  6. package/api/apis.ts +163 -163
  7. package/api/brandingApi.ts +1193 -1183
  8. package/api/contactsApi.ts +772 -772
  9. package/api/customFieldApi.ts +817 -817
  10. package/api/documentApi.ts +2953 -2953
  11. package/api/identityVerificationApi.ts +586 -586
  12. package/api/index.ts +36 -36
  13. package/api/planApi.ts +274 -274
  14. package/api/senderIdentitiesApi.ts +898 -898
  15. package/api/teamsApi.ts +661 -661
  16. package/api/templateApi.ts +1915 -1915
  17. package/api/userApi.ts +968 -968
  18. package/api.ts +3 -3
  19. package/boldsign-2.0.0.tgz +0 -0
  20. package/dist/api/apis.d.ts +1 -1
  21. package/dist/api/apis.js +1 -1
  22. package/dist/api/brandingApi.d.ts +2 -2
  23. package/dist/api/brandingApi.js +10 -4
  24. package/dist/api/brandingApi.js.map +1 -1
  25. package/dist/model/auditTrail.d.ts +3 -1
  26. package/dist/model/auditTrail.js +2 -0
  27. package/dist/model/auditTrail.js.map +1 -1
  28. package/dist/model/collaborationSettings.d.ts +17 -0
  29. package/dist/model/collaborationSettings.js +33 -0
  30. package/dist/model/collaborationSettings.js.map +1 -0
  31. package/dist/model/createTemplateRequest.d.ts +1 -1
  32. package/dist/model/createTemplateRequest.js +5 -5
  33. package/dist/model/createTemplateRequest.js.map +1 -1
  34. package/dist/model/documentFiles.d.ts +1 -0
  35. package/dist/model/documentFiles.js +5 -0
  36. package/dist/model/documentFiles.js.map +1 -1
  37. package/dist/model/documentFormFields.d.ts +4 -0
  38. package/dist/model/documentFormFields.js +15 -0
  39. package/dist/model/documentFormFields.js.map +1 -1
  40. package/dist/model/documentSigner.d.ts +1 -0
  41. package/dist/model/documentSigner.js +5 -0
  42. package/dist/model/documentSigner.js.map +1 -1
  43. package/dist/model/documentSignerDetails.d.ts +1 -0
  44. package/dist/model/documentSignerDetails.js +5 -0
  45. package/dist/model/documentSignerDetails.js.map +1 -1
  46. package/dist/model/embeddedCreateTemplateRequest.d.ts +1 -1
  47. package/dist/model/embeddedCreateTemplateRequest.js +5 -5
  48. package/dist/model/embeddedCreateTemplateRequest.js.map +1 -1
  49. package/dist/model/embeddedDocumentRequest.d.ts +1 -1
  50. package/dist/model/embeddedDocumentRequest.js +5 -5
  51. package/dist/model/embeddedDocumentRequest.js.map +1 -1
  52. package/dist/model/embeddedMergeTemplateFormRequest.d.ts +1 -1
  53. package/dist/model/embeddedMergeTemplateFormRequest.js +5 -5
  54. package/dist/model/embeddedMergeTemplateFormRequest.js.map +1 -1
  55. package/dist/model/embeddedSendTemplateFormRequest.d.ts +1 -1
  56. package/dist/model/embeddedSendTemplateFormRequest.js +5 -5
  57. package/dist/model/embeddedSendTemplateFormRequest.js.map +1 -1
  58. package/dist/model/formField.d.ts +2 -0
  59. package/dist/model/formField.js +5 -0
  60. package/dist/model/formField.js.map +1 -1
  61. package/dist/model/index.d.ts +2 -1
  62. package/dist/model/index.js +6 -3
  63. package/dist/model/index.js.map +1 -1
  64. package/dist/model/mergeAndSendForSignForm.d.ts +1 -1
  65. package/dist/model/mergeAndSendForSignForm.js +5 -5
  66. package/dist/model/mergeAndSendForSignForm.js.map +1 -1
  67. package/dist/model/sendForSign.d.ts +1 -1
  68. package/dist/model/sendForSign.js +5 -5
  69. package/dist/model/sendForSign.js.map +1 -1
  70. package/dist/model/sendForSignFromTemplateForm.d.ts +1 -1
  71. package/dist/model/sendForSignFromTemplateForm.js +5 -5
  72. package/dist/model/sendForSignFromTemplateForm.js.map +1 -1
  73. package/dist/model/templateFormFields.d.ts +2 -0
  74. package/dist/model/templateFormFields.js +5 -0
  75. package/dist/model/templateFormFields.js.map +1 -1
  76. package/dist/model/textTagDefinition.d.ts +2 -0
  77. package/dist/model/textTagDefinition.js +5 -0
  78. package/dist/model/textTagDefinition.js.map +1 -1
  79. package/dist/model/viewBrandDetails.d.ts +1 -0
  80. package/dist/model/viewBrandDetails.js +5 -0
  81. package/dist/model/viewBrandDetails.js.map +1 -1
  82. package/dist/tests/config.d.ts +5 -0
  83. package/dist/tests/config.js +43 -0
  84. package/dist/tests/config.js.map +1 -0
  85. package/dist/tests/integration/BrandingApiTest.spec.d.ts +1 -0
  86. package/dist/tests/integration/BrandingApiTest.spec.js +310 -0
  87. package/dist/tests/integration/BrandingApiTest.spec.js.map +1 -0
  88. package/dist/tests/integration/ContactsApiTest.spec.d.ts +1 -0
  89. package/dist/tests/integration/ContactsApiTest.spec.js +249 -0
  90. package/dist/tests/integration/ContactsApiTest.spec.js.map +1 -0
  91. package/dist/tests/integration/CustomFieldApiTest.spec.d.ts +1 -0
  92. package/dist/tests/integration/CustomFieldApiTest.spec.js +289 -0
  93. package/dist/tests/integration/CustomFieldApiTest.spec.js.map +1 -0
  94. package/dist/tests/integration/DocumentApiTest.spec.d.ts +1 -0
  95. package/dist/tests/integration/DocumentApiTest.spec.js +1710 -0
  96. package/dist/tests/integration/DocumentApiTest.spec.js.map +1 -0
  97. package/dist/tests/integration/IdentityVerificationApiTest.spec.d.ts +1 -0
  98. package/dist/tests/integration/IdentityVerificationApiTest.spec.js +160 -0
  99. package/dist/tests/integration/IdentityVerificationApiTest.spec.js.map +1 -0
  100. package/dist/tests/integration/TemplateApiTest.spec.d.ts +1 -0
  101. package/dist/tests/integration/TemplateApiTest.spec.js +1518 -0
  102. package/dist/tests/integration/TemplateApiTest.spec.js.map +1 -0
  103. package/dist/tests/integration/planApiTest.spec.d.ts +1 -0
  104. package/dist/tests/integration/planApiTest.spec.js +41 -0
  105. package/dist/tests/integration/planApiTest.spec.js.map +1 -0
  106. package/dist/tests/integration/senderIdentity.spec.d.ts +1 -0
  107. package/dist/tests/integration/senderIdentity.spec.js +481 -0
  108. package/dist/tests/integration/senderIdentity.spec.js.map +1 -0
  109. package/dist/tests/integration/teamsApiTest.spec.d.ts +1 -0
  110. package/dist/tests/integration/teamsApiTest.spec.js +230 -0
  111. package/dist/tests/integration/teamsApiTest.spec.js.map +1 -0
  112. package/dist/tests/integration/usersApiTest.spec.d.ts +1 -0
  113. package/dist/tests/integration/usersApiTest.spec.js +290 -0
  114. package/dist/tests/integration/usersApiTest.spec.js.map +1 -0
  115. package/dist/tests/performance/performanceApiTest.spec.d.ts +1 -0
  116. package/dist/tests/performance/performanceApiTest.spec.js +368 -0
  117. package/dist/tests/performance/performanceApiTest.spec.js.map +1 -0
  118. package/dist/tests/unit/brandingApi.spec.d.ts +1 -0
  119. package/dist/tests/unit/brandingApi.spec.js +174 -0
  120. package/dist/tests/unit/brandingApi.spec.js.map +1 -0
  121. package/dist/tests/unit/contactsApi.spec.d.ts +1 -0
  122. package/dist/tests/unit/contactsApi.spec.js +154 -0
  123. package/dist/tests/unit/contactsApi.spec.js.map +1 -0
  124. package/dist/tests/unit/customFieldApi.spec.d.ts +1 -0
  125. package/dist/tests/unit/customFieldApi.spec.js +140 -0
  126. package/dist/tests/unit/customFieldApi.spec.js.map +1 -0
  127. package/dist/tests/unit/documentApi.spec.d.ts +1 -0
  128. package/dist/tests/unit/documentApi.spec.js +476 -0
  129. package/dist/tests/unit/documentApi.spec.js.map +1 -0
  130. package/dist/tests/unit/planApi.spec.d.ts +1 -0
  131. package/dist/tests/unit/planApi.spec.js +69 -0
  132. package/dist/tests/unit/planApi.spec.js.map +1 -0
  133. package/dist/tests/unit/senderIdentitiesApi.spec.d.ts +1 -0
  134. package/dist/tests/unit/senderIdentitiesApi.spec.js +148 -0
  135. package/dist/tests/unit/senderIdentitiesApi.spec.js.map +1 -0
  136. package/dist/tests/unit/teamApi.spec.d.ts +1 -0
  137. package/dist/tests/unit/teamApi.spec.js +116 -0
  138. package/dist/tests/unit/teamApi.spec.js.map +1 -0
  139. package/dist/tests/unit/templateApi.spec.d.ts +1 -0
  140. package/dist/tests/unit/templateApi.spec.js +285 -0
  141. package/dist/tests/unit/templateApi.spec.js.map +1 -0
  142. package/dist/tests/unit/userApi.spec.d.ts +1 -0
  143. package/dist/tests/unit/userApi.spec.js +163 -0
  144. package/dist/tests/unit/userApi.spec.js.map +1 -0
  145. package/docs/AccessCodeDetail.md +19 -19
  146. package/docs/AccessCodeDetails.md +13 -13
  147. package/docs/Added.md +13 -13
  148. package/docs/Address.md +16 -16
  149. package/docs/AttachmentInfo.md +14 -14
  150. package/docs/AuditTrail.md +21 -21
  151. package/docs/AuthenticationSettings.md +11 -11
  152. package/docs/Base64File.md +12 -12
  153. package/docs/BehalfDocument.md +27 -27
  154. package/docs/BehalfDocumentRecords.md +12 -12
  155. package/docs/BehalfOf.md +12 -12
  156. package/docs/BillingViewModel.md +11 -11
  157. package/docs/BrandCreated.md +11 -11
  158. package/docs/BrandCustomFieldDetails.md +16 -16
  159. package/docs/BrandingApi.md +260 -258
  160. package/docs/BrandingMessage.md +11 -11
  161. package/docs/BrandingRecords.md +11 -11
  162. package/docs/ChangeRecipient.md +18 -18
  163. package/docs/CollaborationSettings.md +14 -0
  164. package/docs/ConditionalRule.md +13 -13
  165. package/docs/ContactCreated.md +12 -12
  166. package/docs/ContactDetails.md +15 -15
  167. package/docs/ContactPageDetails.md +13 -13
  168. package/docs/ContactsApi.md +176 -176
  169. package/docs/ContactsDetails.md +16 -16
  170. package/docs/ContactsList.md +12 -12
  171. package/docs/CreateContactResponse.md +11 -11
  172. package/docs/CreateSenderIdentityRequest.md +16 -16
  173. package/docs/CreateTeamRequest.md +11 -11
  174. package/docs/CreateTemplateRequest.md +35 -35
  175. package/docs/CreateUser.md +14 -14
  176. package/docs/CustomDomainSettings.md +12 -12
  177. package/docs/CustomFieldApi.md +174 -174
  178. package/docs/CustomFieldCollection.md +11 -11
  179. package/docs/CustomFieldMessage.md +12 -12
  180. package/docs/CustomFormField.md +43 -43
  181. package/docs/Date.md +13 -13
  182. package/docs/DeleteCustomFieldReply.md +11 -11
  183. package/docs/Document.md +26 -26
  184. package/docs/DocumentApi.md +756 -756
  185. package/docs/DocumentCC.md +11 -11
  186. package/docs/DocumentCcDetails.md +12 -12
  187. package/docs/DocumentCreated.md +11 -11
  188. package/docs/DocumentExpirySettings.md +16 -16
  189. package/docs/DocumentFiles.md +14 -13
  190. package/docs/DocumentFormFields.md +52 -49
  191. package/docs/DocumentInfo.md +14 -14
  192. package/docs/DocumentProperties.md +50 -50
  193. package/docs/DocumentReassign.md +13 -13
  194. package/docs/DocumentRecords.md +12 -12
  195. package/docs/DocumentSenderDetail.md +14 -14
  196. package/docs/DocumentSigner.md +32 -31
  197. package/docs/DocumentSignerDetails.md +38 -37
  198. package/docs/DocumentTags.md +12 -12
  199. package/docs/DownloadImageRequest.md +16 -16
  200. package/docs/EditSenderIdentityRequest.md +14 -14
  201. package/docs/EditTemplateRequest.md +29 -29
  202. package/docs/EditableDateFieldSettings.md +13 -13
  203. package/docs/EmbeddedCreateTemplateRequest.md +46 -46
  204. package/docs/EmbeddedCustomFieldCreated.md +11 -11
  205. package/docs/EmbeddedDocumentRequest.md +55 -55
  206. package/docs/EmbeddedFileDetails.md +16 -16
  207. package/docs/EmbeddedFileLink.md +11 -11
  208. package/docs/EmbeddedMergeTemplateFormRequest.md +56 -56
  209. package/docs/EmbeddedSendCreated.md +12 -12
  210. package/docs/EmbeddedSendTemplateFormRequest.md +53 -53
  211. package/docs/EmbeddedSigningLink.md +11 -11
  212. package/docs/EmbeddedTemplateCreated.md +12 -12
  213. package/docs/EmbeddedTemplateEditRequest.md +21 -21
  214. package/docs/EmbeddedTemplateEdited.md +11 -11
  215. package/docs/Error.md +12 -12
  216. package/docs/ErrorResult.md +11 -11
  217. package/docs/ExistingFormField.md +15 -15
  218. package/docs/ExtendExpiry.md +14 -14
  219. package/docs/FileInfo.md +14 -14
  220. package/docs/Font.md +18 -18
  221. package/docs/FormField.md +51 -50
  222. package/docs/FormGroup.md +15 -15
  223. package/docs/FormulaFieldSettings.md +12 -12
  224. package/docs/IdDocument.md +21 -21
  225. package/docs/IdReport.md +14 -14
  226. package/docs/IdVerification.md +18 -18
  227. package/docs/IdentityVerificationApi.md +109 -109
  228. package/docs/IdentityVerificationSettings.md +16 -16
  229. package/docs/ImageInfo.md +13 -13
  230. package/docs/MergeAndSendForSignForm.md +46 -46
  231. package/docs/ModificationDetails.md +12 -12
  232. package/docs/NotificationSettings.md +22 -22
  233. package/docs/PageDetails.md +16 -16
  234. package/docs/PhoneNumber.md +12 -12
  235. package/docs/PlanApi.md +38 -38
  236. package/docs/PrefillField.md +12 -12
  237. package/docs/PrefillFieldRequest.md +12 -12
  238. package/docs/ProblemDetails.md +15 -15
  239. package/docs/RecipientChangeLog.md +12 -12
  240. package/docs/RecipientNotificationSettings.md +22 -22
  241. package/docs/Rectangle.md +14 -14
  242. package/docs/ReminderMessage.md +13 -13
  243. package/docs/ReminderSettings.md +13 -13
  244. package/docs/RemoveAuthentication.md +14 -14
  245. package/docs/Removed.md +13 -13
  246. package/docs/RevokeDocument.md +12 -12
  247. package/docs/Role.md +33 -33
  248. package/docs/Roles.md +33 -33
  249. package/docs/SendForSign.md +45 -45
  250. package/docs/SendForSignFromTemplateForm.md +43 -43
  251. package/docs/SenderIdentitiesApi.md +209 -209
  252. package/docs/SenderIdentityCreated.md +11 -11
  253. package/docs/SenderIdentityList.md +12 -12
  254. package/docs/SenderIdentityViewModel.md +19 -19
  255. package/docs/SignerAuthenticationSettings.md +12 -12
  256. package/docs/Size.md +12 -12
  257. package/docs/TeamCreated.md +11 -11
  258. package/docs/TeamDocumentRecords.md +12 -12
  259. package/docs/TeamListResponse.md +12 -12
  260. package/docs/TeamPageDetails.md +12 -12
  261. package/docs/TeamResponse.md +15 -15
  262. package/docs/TeamUpdateRequest.md +12 -12
  263. package/docs/TeamUsers.md +16 -16
  264. package/docs/Teams.md +14 -14
  265. package/docs/TeamsApi.md +141 -141
  266. package/docs/Template.md +29 -29
  267. package/docs/TemplateApi.md +484 -484
  268. package/docs/TemplateCC.md +12 -12
  269. package/docs/TemplateCreated.md +11 -11
  270. package/docs/TemplateFormFields.md +51 -50
  271. package/docs/TemplateProperties.md +37 -37
  272. package/docs/TemplateRecords.md +12 -12
  273. package/docs/TemplateRole.md +28 -28
  274. package/docs/TemplateSenderDetail.md +12 -12
  275. package/docs/TemplateSenderDetails.md +13 -13
  276. package/docs/TemplateSharedTemplateDetail.md +12 -12
  277. package/docs/TemplateSignerDetails.md +27 -27
  278. package/docs/TemplateTag.md +14 -14
  279. package/docs/TextTagDefinition.md +41 -40
  280. package/docs/TextTagOffset.md +12 -12
  281. package/docs/UpdateUser.md +14 -14
  282. package/docs/UpdateUserMetaData.md +12 -12
  283. package/docs/UserApi.md +240 -240
  284. package/docs/UserPageDetails.md +12 -12
  285. package/docs/UserProperties.md +21 -21
  286. package/docs/UserRecords.md +12 -12
  287. package/docs/UsersDetails.md +21 -21
  288. package/docs/Validation.md +13 -13
  289. package/docs/VerificationDataRequest.md +15 -15
  290. package/docs/ViewBrandDetails.md +35 -34
  291. package/docs/ViewCustomFieldDetails.md +17 -17
  292. package/examples/DocumentProperties.ts +14 -14
  293. package/examples/brandCreate.ts +28 -28
  294. package/examples/brandDelete.ts +14 -14
  295. package/examples/brandGet.ts +14 -14
  296. package/examples/brandList.ts +13 -13
  297. package/examples/brandResetDefault.ts +14 -14
  298. package/examples/brandUpdate.ts +20 -20
  299. package/examples/contactCreate.ts +25 -25
  300. package/examples/contactDelete.ts +14 -14
  301. package/examples/contactGet.ts +14 -14
  302. package/examples/contactList.ts +15 -15
  303. package/examples/contactUpdate.ts +25 -25
  304. package/examples/customFieldCreate.ts +27 -27
  305. package/examples/customFieldDelete.ts +14 -14
  306. package/examples/customFieldEdit.ts +29 -29
  307. package/examples/customFieldEmbeddedCreateUrl.ts +18 -18
  308. package/examples/customFieldList.ts +14 -14
  309. package/examples/documentAddAuthentication.ts +19 -19
  310. package/examples/documentAddTags.ts +18 -18
  311. package/examples/documentChangeAccessCode.ts +19 -19
  312. package/examples/documentChangeRecipients.ts +21 -21
  313. package/examples/documentDelete.ts +15 -15
  314. package/examples/documentDeleteTags.ts +18 -18
  315. package/examples/documentDownload.ts +15 -15
  316. package/examples/documentDownloadAttachment.ts +16 -16
  317. package/examples/documentDownloadAuditTrial.ts +15 -15
  318. package/examples/documentEmbeddedRequestLink.ts +48 -48
  319. package/examples/documentEmbeddedSignLink.ts +22 -22
  320. package/examples/documentExtendExpiry.ts +19 -19
  321. package/examples/documentList.ts +18 -18
  322. package/examples/documentListBehalf.ts +14 -14
  323. package/examples/documentListTeam.ts +14 -14
  324. package/examples/documentPrefillFieldCheckBox.ts +22 -22
  325. package/examples/documentPrefillFieldDropDown.ts +22 -22
  326. package/examples/documentPrefillFieldEditableDate.ts +22 -22
  327. package/examples/documentPrefillFieldImage.ts +22 -22
  328. package/examples/documentPrefillFieldRadioButton.ts +22 -22
  329. package/examples/documentPrefillFieldTextBox.ts +22 -22
  330. package/examples/documentRemoveAuthentication.ts +18 -18
  331. package/examples/documentRevoke.ts +18 -18
  332. package/examples/documentSend.ts +46 -46
  333. package/examples/documentSendOnBehalf.ts +52 -52
  334. package/examples/documentSendReminder.ts +19 -19
  335. package/examples/embeddedManualVerification.ts +22 -22
  336. package/examples/identityVerificationImage.ts +23 -23
  337. package/examples/identityVerificationReport.ts +21 -21
  338. package/examples/listTemplate.ts +15 -15
  339. package/examples/plan.ts +13 -13
  340. package/examples/senderIdentityCreate.ts +20 -20
  341. package/examples/senderIdentityDelete.ts +14 -14
  342. package/examples/senderIdentityList.ts +15 -15
  343. package/examples/senderIdentityRerequest.ts +14 -14
  344. package/examples/senderIdentityResendInvitation.ts +14 -14
  345. package/examples/senderIdentityUpdate.ts +19 -19
  346. package/examples/teamCreate.ts +17 -17
  347. package/examples/teamGet.ts +14 -14
  348. package/examples/teamList.ts +15 -15
  349. package/examples/teamUpdate.ts +18 -18
  350. package/examples/templateAddTag.ts +19 -19
  351. package/examples/templateCreate.ts +28 -28
  352. package/examples/templateDelete.ts +14 -14
  353. package/examples/templateDeleteTag.ts +19 -19
  354. package/examples/templateDetails.ts +14 -14
  355. package/examples/templateDownload.ts +14 -14
  356. package/examples/templateEdit.ts +21 -21
  357. package/examples/templateEmbeddedCreate.ts +28 -28
  358. package/examples/templateEmbeddedEdit.ts +23 -23
  359. package/examples/templateEmbeddedRequestLink.ts +33 -33
  360. package/examples/templateMergerEmbeddedRequestUrl.ts +36 -36
  361. package/examples/templateSendDocument.ts +59 -59
  362. package/examples/templateSendDocumentUsingMultipleTemplate.ts +39 -39
  363. package/examples/userCreate.ts +19 -19
  364. package/examples/userGet.ts +14 -14
  365. package/examples/userInvitationCancel.ts +14 -14
  366. package/examples/userList.ts +15 -15
  367. package/examples/userResendInvitation.ts +14 -14
  368. package/examples/userUpdateRole.ts +18 -18
  369. package/git_push.sh +57 -57
  370. package/model/accessCodeDetail.ts +91 -91
  371. package/model/accessCodeDetails.ts +44 -44
  372. package/model/added.ts +43 -43
  373. package/model/address.ts +61 -61
  374. package/model/attachmentInfo.ts +49 -49
  375. package/model/auditTrail.ts +177 -175
  376. package/model/authenticationSettings.ts +40 -40
  377. package/model/base64File.ts +37 -37
  378. package/model/behalfDocument.ts +142 -142
  379. package/model/behalfDocumentRecords.ts +39 -39
  380. package/model/behalfOf.ts +37 -37
  381. package/model/billingViewModel.ts +31 -31
  382. package/model/brandCreated.ts +31 -31
  383. package/model/brandCustomFieldDetails.ts +62 -62
  384. package/model/brandingMessage.ts +31 -31
  385. package/model/brandingRecords.ts +32 -32
  386. package/model/changeRecipient.ts +74 -74
  387. package/model/collaborationSettings.ts +49 -0
  388. package/model/conditionalRule.ts +43 -43
  389. package/model/contactCreated.ts +37 -37
  390. package/model/contactDetails.ts +56 -56
  391. package/model/contactPageDetails.ts +43 -43
  392. package/model/contactsDetails.ts +62 -62
  393. package/model/contactsList.ts +39 -39
  394. package/model/createContactResponse.ts +32 -32
  395. package/model/createSenderIdentityRequest.ts +62 -62
  396. package/model/createTeamRequest.ts +31 -31
  397. package/model/createTemplateRequest.ts +181 -181
  398. package/model/createUser.ts +56 -56
  399. package/model/customDomainSettings.ts +37 -37
  400. package/model/customFieldCollection.ts +32 -32
  401. package/model/customFieldMessage.ts +37 -37
  402. package/model/customFormField.ts +275 -275
  403. package/model/deleteCustomFieldReply.ts +31 -31
  404. package/model/document.ts +135 -135
  405. package/model/documentCC.ts +31 -31
  406. package/model/documentCcDetails.ts +37 -37
  407. package/model/documentCreated.ts +31 -31
  408. package/model/documentExpirySettings.ts +69 -69
  409. package/model/documentFiles.ts +49 -43
  410. package/model/documentFormFields.ts +311 -292
  411. package/model/documentInfo.ts +90 -90
  412. package/model/documentProperties.ts +316 -316
  413. package/model/documentReassign.ts +43 -43
  414. package/model/documentRecords.ts +39 -39
  415. package/model/documentSenderDetail.ts +49 -49
  416. package/model/documentSigner.ts +221 -215
  417. package/model/documentSignerDetails.ts +265 -259
  418. package/model/documentTags.ts +37 -37
  419. package/model/downloadImageRequest.ts +61 -61
  420. package/model/editSenderIdentityRequest.ts +50 -50
  421. package/model/editTemplateRequest.ts +144 -144
  422. package/model/editableDateFieldSettings.ts +43 -43
  423. package/model/embeddedCreateTemplateRequest.ts +271 -271
  424. package/model/embeddedCustomFieldCreated.ts +31 -31
  425. package/model/embeddedDocumentRequest.ts +337 -337
  426. package/model/embeddedFileDetails.ts +61 -61
  427. package/model/embeddedFileLink.ts +31 -31
  428. package/model/embeddedMergeTemplateFormRequest.ts +343 -343
  429. package/model/embeddedSendCreated.ts +37 -37
  430. package/model/embeddedSendTemplateFormRequest.ts +324 -324
  431. package/model/embeddedSigningLink.ts +31 -31
  432. package/model/embeddedTemplateCreated.ts +37 -37
  433. package/model/embeddedTemplateEditRequest.ts +115 -115
  434. package/model/embeddedTemplateEdited.ts +31 -31
  435. package/model/errorResult.ts +31 -31
  436. package/model/existingFormField.ts +55 -55
  437. package/model/extendExpiry.ts +49 -49
  438. package/model/fileInfo.ts +49 -49
  439. package/model/font.ts +89 -89
  440. package/model/formField.ts +327 -320
  441. package/model/formGroup.ts +63 -63
  442. package/model/formulaFieldSettings.ts +37 -37
  443. package/model/idDocument.ts +93 -93
  444. package/model/idReport.ts +50 -50
  445. package/model/idVerification.ts +73 -73
  446. package/model/identityVerificationSettings.ts +75 -75
  447. package/model/imageInfo.ts +43 -43
  448. package/model/index.ts +546 -543
  449. package/model/mergeAndSendForSignForm.ts +261 -261
  450. package/model/modelDate.ts +43 -43
  451. package/model/modelError.ts +37 -37
  452. package/model/models.ts +244 -244
  453. package/model/modificationDetails.ts +37 -37
  454. package/model/notificationSettings.ts +97 -97
  455. package/model/pageDetails.ts +61 -61
  456. package/model/phoneNumber.ts +37 -37
  457. package/model/prefillField.ts +37 -37
  458. package/model/prefillFieldRequest.ts +38 -38
  459. package/model/problemDetails.ts +55 -55
  460. package/model/recipientChangeLog.ts +39 -39
  461. package/model/recipientNotificationSettings.ts +97 -97
  462. package/model/rectangle.ts +49 -49
  463. package/model/reminderMessage.ts +44 -44
  464. package/model/reminderSettings.ts +43 -43
  465. package/model/removeAuthentication.ts +50 -50
  466. package/model/removed.ts +43 -43
  467. package/model/revokeDocument.ts +37 -37
  468. package/model/role.ts +229 -229
  469. package/model/roles.ts +225 -225
  470. package/model/sendForSign.ts +255 -255
  471. package/model/sendForSignFromTemplateForm.ts +242 -242
  472. package/model/senderIdentityCreated.ts +31 -31
  473. package/model/senderIdentityList.ts +39 -39
  474. package/model/senderIdentityViewModel.ts +80 -80
  475. package/model/signerAuthenticationSettings.ts +37 -37
  476. package/model/size.ts +37 -37
  477. package/model/teamCreated.ts +31 -31
  478. package/model/teamDocumentRecords.ts +39 -39
  479. package/model/teamListResponse.ts +39 -39
  480. package/model/teamPageDetails.ts +37 -37
  481. package/model/teamResponse.ts +56 -56
  482. package/model/teamUpdateRequest.ts +37 -37
  483. package/model/teamUsers.ts +73 -73
  484. package/model/teams.ts +49 -49
  485. package/model/template.ts +159 -159
  486. package/model/templateCC.ts +37 -37
  487. package/model/templateCreated.ts +31 -31
  488. package/model/templateFormFields.ts +304 -297
  489. package/model/templateProperties.ts +202 -202
  490. package/model/templateRecords.ts +39 -39
  491. package/model/templateRole.ts +195 -195
  492. package/model/templateSenderDetail.ts +37 -37
  493. package/model/templateSenderDetails.ts +43 -43
  494. package/model/templateSharedTemplateDetail.ts +43 -43
  495. package/model/templateSignerDetails.ts +160 -160
  496. package/model/templateTag.ts +49 -49
  497. package/model/textTagDefinition.ts +255 -248
  498. package/model/textTagOffset.ts +37 -37
  499. package/model/updateUser.ts +60 -60
  500. package/model/updateUserMetaData.ts +37 -37
  501. package/model/userPageDetails.ts +37 -37
  502. package/model/userProperties.ts +91 -91
  503. package/model/userRecords.ts +39 -39
  504. package/model/usersDetails.ts +91 -91
  505. package/model/validation.ts +52 -52
  506. package/model/verificationDataRequest.ts +55 -55
  507. package/model/viewBrandDetails.ts +183 -177
  508. package/model/viewCustomFieldDetails.ts +68 -68
  509. package/package.json +52 -52
  510. package/tests/config.ts +20 -0
  511. package/tests/documents/agreement.pdf +0 -0
  512. package/tests/documents/logo.jpg +0 -0
  513. package/tests/integration/BrandingApiTest.spec.ts +254 -0
  514. package/tests/integration/ContactsApiTest.spec.ts +222 -0
  515. package/tests/integration/CustomFieldApiTest.spec.ts +231 -0
  516. package/tests/integration/DocumentApiTest.spec.ts +1624 -0
  517. package/tests/integration/IdentityVerificationApiTest.spec.ts +114 -0
  518. package/tests/integration/TemplateApiTest.spec.ts +1420 -0
  519. package/tests/integration/planApiTest.spec.ts +26 -0
  520. package/tests/integration/senderIdentity.spec.ts +397 -0
  521. package/tests/integration/teamsApiTest.spec.ts +226 -0
  522. package/tests/integration/usersApiTest.spec.ts +251 -0
  523. package/tests/performance/performanceApiTest.spec.ts +362 -0
  524. package/tests/unit/brandingApi.spec.ts +163 -0
  525. package/tests/unit/contactsApi.spec.ts +143 -0
  526. package/tests/unit/customFieldApi.spec.ts +123 -0
  527. package/tests/unit/documentApi.spec.ts +545 -0
  528. package/tests/unit/planApi.spec.ts +34 -0
  529. package/tests/unit/senderIdentitiesApi.spec.ts +148 -0
  530. package/tests/unit/teamApi.spec.ts +94 -0
  531. package/tests/unit/templateApi.spec.ts +307 -0
  532. package/tests/unit/userApi.spec.ts +162 -0
  533. package/tsconfig.json +24 -24
@@ -1,817 +1,817 @@
1
- /**
2
- * BoldSign API
3
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
- *
5
- * The version of the OpenAPI document: 1
6
- *
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
-
13
- import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
14
-
15
- import {
16
- ObjectSerializer, Authentication, VoidAuth, Interceptor,
17
- HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, RequestFile,
18
- BrandCustomFieldDetails,CustomFieldCollection,CustomFieldMessage,DeleteCustomFieldReply,EmbeddedCustomFieldCreated,ErrorResult,
19
- } from '../model';
20
-
21
- import {
22
- HttpError,
23
- optionsI,
24
- returnTypeT,
25
- returnTypeI,
26
- generateFormData,
27
- toFormData,
28
- queryParamsSerializer,
29
- USER_AGENT,
30
- } from './';
31
-
32
- let defaultBasePath = 'https://api.boldsign.com';
33
-
34
- // ===============================================
35
- // This file is autogenerated - Please do not edit
36
- // ===============================================
37
-
38
-
39
- export class CustomFieldApi {
40
- protected _basePath = defaultBasePath;
41
- protected _defaultHeaders : any = { 'User-Agent': USER_AGENT };
42
- protected _useQuerystring : boolean = true;
43
-
44
- protected authentications = {
45
- 'default': <Authentication>new VoidAuth(),
46
- 'Bearer': new ApiKeyAuth('header', 'Authorization'),
47
- 'X-API-KEY': new ApiKeyAuth('header', 'X-API-KEY'),
48
- }
49
-
50
- protected interceptors: Interceptor[] = [];
51
-
52
- constructor(basePath?: string) {
53
- if (basePath) {
54
- this.basePath = basePath;
55
- }
56
- }
57
-
58
- set useQuerystring(value: boolean) {
59
- this._useQuerystring = value;
60
- }
61
-
62
- set basePath(basePath: string) {
63
- this._basePath = basePath;
64
- }
65
-
66
- set defaultHeaders(defaultHeaders: any) {
67
- this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT };
68
- }
69
-
70
- get defaultHeaders() {
71
- return this._defaultHeaders;
72
- }
73
-
74
- get basePath() {
75
- return this._basePath;
76
- }
77
-
78
- public setDefaultAuthentication(auth: Authentication) {
79
- this.authentications.default = auth;
80
- }
81
-
82
- public setApiKey(apikey: string) {
83
- this.authentications["X-API-KEY"].apiKey = apikey;
84
- }
85
-
86
- public setAccessToken(accessToken: string) {
87
- this.authentications["Bearer"].apiKey = 'bearer ' + accessToken;
88
- }
89
-
90
- public addInterceptor(interceptor: Interceptor) {
91
- this.interceptors.push(interceptor);
92
- }
93
-
94
- /**
95
- *
96
- * @summary Create the custom field.
97
- * @param brandCustomFieldDetails The custom field details.
98
- * @param options
99
- */
100
- public async createCustomField (brandCustomFieldDetails: BrandCustomFieldDetails, options: optionsI = {headers: {}}) : Promise<CustomFieldMessage> {
101
- brandCustomFieldDetails = deserializeIfNeeded(brandCustomFieldDetails, "BrandCustomFieldDetails");
102
- const localVarPath = this.basePath + '/v1/customField/create';
103
- let localVarQueryParameters: any = {};
104
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
105
- const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
106
- // give precedence to 'application/json'
107
- if (produces.indexOf('application/json') >= 0) {
108
- localVarHeaderParams['content-type'] = 'application/json';
109
- } else {
110
- localVarHeaderParams['content-type'] = produces.join(',');
111
- }
112
- let localVarFormParams: any = {};
113
- let localVarBodyParams: any = undefined;
114
-
115
- // verify required parameter 'brandCustomFieldDetails' is not null or undefined
116
- if (brandCustomFieldDetails === null || brandCustomFieldDetails === undefined) {
117
- throw new Error('Required parameter brandCustomFieldDetails was null or undefined when calling createCustomField.');
118
- }
119
-
120
- (<any>Object).assign(localVarHeaderParams, options.headers);
121
-
122
- let localVarUseFormData = false;
123
-
124
- const result = generateFormData(brandCustomFieldDetails, BrandCustomFieldDetails);
125
- localVarUseFormData = result.localVarUseFormData;
126
-
127
- let data = {};
128
- if (localVarUseFormData) {
129
- const formData = toFormData(result.data);
130
- data = formData;
131
- localVarHeaderParams = {
132
- ...localVarHeaderParams,
133
- ...formData.getHeaders(),
134
- };
135
- } else {
136
- data = ObjectSerializer.serialize(
137
- brandCustomFieldDetails,
138
- "BrandCustomFieldDetails"
139
- );
140
- }
141
-
142
- let localVarRequestOptions: AxiosRequestConfig = {
143
- method: 'POST',
144
- params: localVarQueryParameters,
145
- headers: localVarHeaderParams,
146
- url: localVarPath,
147
- paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
148
- maxContentLength: Infinity,
149
- maxBodyLength: Infinity,
150
- responseType: "json",
151
- };
152
-
153
- if (localVarRequestOptions.method !== 'GET') {
154
- localVarRequestOptions.data = data;
155
- }
156
- let authenticationPromise = Promise.resolve();
157
-
158
- if (this.authentications["X-API-KEY"].apiKey) {
159
- authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
160
- }
161
- if (this.authentications["Bearer"].apiKey) {
162
- authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
163
- }
164
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
165
-
166
- let interceptorPromise = authenticationPromise;
167
- for (const interceptor of this.interceptors) {
168
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
169
- }
170
-
171
- return interceptorPromise.then(() => {
172
- return new Promise<CustomFieldMessage>((resolve, reject) => {
173
- axios.request(localVarRequestOptions)
174
- .then((response) => {
175
- handleSuccessfulResponse<CustomFieldMessage>(
176
- resolve,
177
- reject,
178
- response,
179
- "CustomFieldMessage",
180
- );
181
- }, (error: AxiosError) => {
182
- if (error.response == null) {
183
- reject(error);
184
- return;
185
- }
186
-
187
- if (handleErrorCodeResponse(
188
- reject,
189
- error.response,
190
- 200,
191
- "CustomFieldMessage",
192
- )) {
193
- return;
194
- }
195
- if (handleErrorCodeResponse(
196
- reject,
197
- error.response,
198
- 401,
199
- "ErrorResult",
200
- )) {
201
- return;
202
- }
203
- if (handleErrorCodeResponse(
204
- reject,
205
- error.response,
206
- 403,
207
- "ErrorResult",
208
- )) {
209
- return;
210
- }
211
- if (handleErrorCodeResponse(
212
- reject,
213
- error.response,
214
- 422,
215
- "ErrorResult",
216
- )) {
217
- return;
218
- }
219
-
220
-
221
- reject(error);
222
- });
223
- });
224
- });
225
- }
226
- /**
227
- *
228
- * @summary List the custom fields respective to the brand id.
229
- * @param brandId The brand id.
230
- * @param options
231
- */
232
- public async customFieldsList (brandId: string, options: optionsI = {headers: {}}) : Promise<CustomFieldCollection> {
233
- const localVarPath = this.basePath + '/v1/customField/list';
234
- let localVarQueryParameters: any = {};
235
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
236
- const produces = ['application/json'];
237
- // give precedence to 'application/json'
238
- if (produces.indexOf('application/json') >= 0) {
239
- localVarHeaderParams['content-type'] = 'application/json';
240
- } else {
241
- localVarHeaderParams['content-type'] = produces.join(',');
242
- }
243
- let localVarFormParams: any = {};
244
- let localVarBodyParams: any = undefined;
245
-
246
- // verify required parameter 'brandId' is not null or undefined
247
- if (brandId === null || brandId === undefined) {
248
- throw new Error('Required parameter brandId was null or undefined when calling customFieldsList.');
249
- }
250
-
251
- if (brandId !== undefined) {
252
- localVarQueryParameters['brandId'] = ObjectSerializer.serialize(brandId, "string");
253
- }
254
-
255
- (<any>Object).assign(localVarHeaderParams, options.headers);
256
-
257
- let localVarUseFormData = false;
258
-
259
- let data = {};
260
- if (localVarUseFormData) {
261
- const formData = toFormData(localVarFormParams);
262
- data = formData;
263
- localVarHeaderParams = {
264
- ...localVarHeaderParams,
265
- ...formData.getHeaders(),
266
- };
267
- }
268
-
269
- let localVarRequestOptions: AxiosRequestConfig = {
270
- method: 'GET',
271
- params: localVarQueryParameters,
272
- headers: localVarHeaderParams,
273
- url: localVarPath,
274
- paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
275
- maxContentLength: Infinity,
276
- maxBodyLength: Infinity,
277
- responseType: "json",
278
- };
279
-
280
- if (localVarRequestOptions.method !== 'GET') {
281
- localVarRequestOptions.data = data;
282
- }
283
- let authenticationPromise = Promise.resolve();
284
-
285
- if (this.authentications["X-API-KEY"].apiKey) {
286
- authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
287
- }
288
- if (this.authentications["Bearer"].apiKey) {
289
- authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
290
- }
291
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
292
-
293
- let interceptorPromise = authenticationPromise;
294
- for (const interceptor of this.interceptors) {
295
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
296
- }
297
-
298
- return interceptorPromise.then(() => {
299
- return new Promise<CustomFieldCollection>((resolve, reject) => {
300
- axios.request(localVarRequestOptions)
301
- .then((response) => {
302
- handleSuccessfulResponse<CustomFieldCollection>(
303
- resolve,
304
- reject,
305
- response,
306
- "CustomFieldCollection",
307
- );
308
- }, (error: AxiosError) => {
309
- if (error.response == null) {
310
- reject(error);
311
- return;
312
- }
313
-
314
- if (handleErrorCodeResponse(
315
- reject,
316
- error.response,
317
- 200,
318
- "CustomFieldCollection",
319
- )) {
320
- return;
321
- }
322
- if (handleErrorCodeResponse(
323
- reject,
324
- error.response,
325
- 401,
326
- "ErrorResult",
327
- )) {
328
- return;
329
- }
330
- if (handleErrorCodeResponse(
331
- reject,
332
- error.response,
333
- 403,
334
- "ErrorResult",
335
- )) {
336
- return;
337
- }
338
-
339
-
340
- reject(error);
341
- });
342
- });
343
- });
344
- }
345
- /**
346
- *
347
- * @summary Delete the custom field.
348
- * @param customFieldId The custom field id.
349
- * @param options
350
- */
351
- public async deleteCustomField (customFieldId: string, options: optionsI = {headers: {}}) : Promise<DeleteCustomFieldReply> {
352
- const localVarPath = this.basePath + '/v1/customField/delete';
353
- let localVarQueryParameters: any = {};
354
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
355
- const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
356
- // give precedence to 'application/json'
357
- if (produces.indexOf('application/json') >= 0) {
358
- localVarHeaderParams['content-type'] = 'application/json';
359
- } else {
360
- localVarHeaderParams['content-type'] = produces.join(',');
361
- }
362
- let localVarFormParams: any = {};
363
- let localVarBodyParams: any = undefined;
364
-
365
- // verify required parameter 'customFieldId' is not null or undefined
366
- if (customFieldId === null || customFieldId === undefined) {
367
- throw new Error('Required parameter customFieldId was null or undefined when calling deleteCustomField.');
368
- }
369
-
370
- if (customFieldId !== undefined) {
371
- localVarQueryParameters['customFieldId'] = ObjectSerializer.serialize(customFieldId, "string");
372
- }
373
-
374
- (<any>Object).assign(localVarHeaderParams, options.headers);
375
-
376
- let localVarUseFormData = false;
377
-
378
- let data = {};
379
- if (localVarUseFormData) {
380
- const formData = toFormData(localVarFormParams);
381
- data = formData;
382
- localVarHeaderParams = {
383
- ...localVarHeaderParams,
384
- ...formData.getHeaders(),
385
- };
386
- }
387
-
388
- let localVarRequestOptions: AxiosRequestConfig = {
389
- method: 'DELETE',
390
- params: localVarQueryParameters,
391
- headers: localVarHeaderParams,
392
- url: localVarPath,
393
- paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
394
- maxContentLength: Infinity,
395
- maxBodyLength: Infinity,
396
- responseType: "json",
397
- };
398
-
399
- if (localVarRequestOptions.method !== 'GET') {
400
- localVarRequestOptions.data = data;
401
- }
402
- let authenticationPromise = Promise.resolve();
403
-
404
- if (this.authentications["X-API-KEY"].apiKey) {
405
- authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
406
- }
407
- if (this.authentications["Bearer"].apiKey) {
408
- authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
409
- }
410
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
411
-
412
- let interceptorPromise = authenticationPromise;
413
- for (const interceptor of this.interceptors) {
414
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
415
- }
416
-
417
- return interceptorPromise.then(() => {
418
- return new Promise<DeleteCustomFieldReply>((resolve, reject) => {
419
- axios.request(localVarRequestOptions)
420
- .then((response) => {
421
- handleSuccessfulResponse<DeleteCustomFieldReply>(
422
- resolve,
423
- reject,
424
- response,
425
- "DeleteCustomFieldReply",
426
- );
427
- }, (error: AxiosError) => {
428
- if (error.response == null) {
429
- reject(error);
430
- return;
431
- }
432
-
433
- if (handleErrorCodeResponse(
434
- reject,
435
- error.response,
436
- 200,
437
- "DeleteCustomFieldReply",
438
- )) {
439
- return;
440
- }
441
- if (handleErrorCodeResponse(
442
- reject,
443
- error.response,
444
- 401,
445
- "ErrorResult",
446
- )) {
447
- return;
448
- }
449
- if (handleErrorCodeResponse(
450
- reject,
451
- error.response,
452
- 403,
453
- "ErrorResult",
454
- )) {
455
- return;
456
- }
457
- if (handleErrorCodeResponse(
458
- reject,
459
- error.response,
460
- 422,
461
- "ErrorResult",
462
- )) {
463
- return;
464
- }
465
-
466
-
467
- reject(error);
468
- });
469
- });
470
- });
471
- }
472
- /**
473
- *
474
- * @summary Edit the custom field.
475
- * @param customFieldId The custom field id.
476
- * @param brandCustomFieldDetails The custom field details.
477
- * @param options
478
- */
479
- public async editCustomField (customFieldId: string, brandCustomFieldDetails: BrandCustomFieldDetails, options: optionsI = {headers: {}}) : Promise<CustomFieldMessage> {
480
- brandCustomFieldDetails = deserializeIfNeeded(brandCustomFieldDetails, "BrandCustomFieldDetails");
481
- const localVarPath = this.basePath + '/v1/customField/edit';
482
- let localVarQueryParameters: any = {};
483
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
484
- const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
485
- // give precedence to 'application/json'
486
- if (produces.indexOf('application/json') >= 0) {
487
- localVarHeaderParams['content-type'] = 'application/json';
488
- } else {
489
- localVarHeaderParams['content-type'] = produces.join(',');
490
- }
491
- let localVarFormParams: any = {};
492
- let localVarBodyParams: any = undefined;
493
-
494
- // verify required parameter 'customFieldId' is not null or undefined
495
- if (customFieldId === null || customFieldId === undefined) {
496
- throw new Error('Required parameter customFieldId was null or undefined when calling editCustomField.');
497
- }
498
-
499
- // verify required parameter 'brandCustomFieldDetails' is not null or undefined
500
- if (brandCustomFieldDetails === null || brandCustomFieldDetails === undefined) {
501
- throw new Error('Required parameter brandCustomFieldDetails was null or undefined when calling editCustomField.');
502
- }
503
-
504
- if (customFieldId !== undefined) {
505
- localVarQueryParameters['customFieldId'] = ObjectSerializer.serialize(customFieldId, "string");
506
- }
507
-
508
- (<any>Object).assign(localVarHeaderParams, options.headers);
509
-
510
- let localVarUseFormData = false;
511
-
512
- const result = generateFormData(brandCustomFieldDetails, BrandCustomFieldDetails);
513
- localVarUseFormData = result.localVarUseFormData;
514
-
515
- let data = {};
516
- if (localVarUseFormData) {
517
- const formData = toFormData(result.data);
518
- data = formData;
519
- localVarHeaderParams = {
520
- ...localVarHeaderParams,
521
- ...formData.getHeaders(),
522
- };
523
- } else {
524
- data = ObjectSerializer.serialize(
525
- brandCustomFieldDetails,
526
- "BrandCustomFieldDetails"
527
- );
528
- }
529
-
530
- let localVarRequestOptions: AxiosRequestConfig = {
531
- method: 'POST',
532
- params: localVarQueryParameters,
533
- headers: localVarHeaderParams,
534
- url: localVarPath,
535
- paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
536
- maxContentLength: Infinity,
537
- maxBodyLength: Infinity,
538
- responseType: "json",
539
- };
540
-
541
- if (localVarRequestOptions.method !== 'GET') {
542
- localVarRequestOptions.data = data;
543
- }
544
- let authenticationPromise = Promise.resolve();
545
-
546
- if (this.authentications["X-API-KEY"].apiKey) {
547
- authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
548
- }
549
- if (this.authentications["Bearer"].apiKey) {
550
- authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
551
- }
552
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
553
-
554
- let interceptorPromise = authenticationPromise;
555
- for (const interceptor of this.interceptors) {
556
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
557
- }
558
-
559
- return interceptorPromise.then(() => {
560
- return new Promise<CustomFieldMessage>((resolve, reject) => {
561
- axios.request(localVarRequestOptions)
562
- .then((response) => {
563
- handleSuccessfulResponse<CustomFieldMessage>(
564
- resolve,
565
- reject,
566
- response,
567
- "CustomFieldMessage",
568
- );
569
- }, (error: AxiosError) => {
570
- if (error.response == null) {
571
- reject(error);
572
- return;
573
- }
574
-
575
- if (handleErrorCodeResponse(
576
- reject,
577
- error.response,
578
- 200,
579
- "CustomFieldMessage",
580
- )) {
581
- return;
582
- }
583
- if (handleErrorCodeResponse(
584
- reject,
585
- error.response,
586
- 401,
587
- "ErrorResult",
588
- )) {
589
- return;
590
- }
591
- if (handleErrorCodeResponse(
592
- reject,
593
- error.response,
594
- 403,
595
- "ErrorResult",
596
- )) {
597
- return;
598
- }
599
- if (handleErrorCodeResponse(
600
- reject,
601
- error.response,
602
- 422,
603
- "ErrorResult",
604
- )) {
605
- return;
606
- }
607
-
608
-
609
- reject(error);
610
- });
611
- });
612
- });
613
- }
614
- /**
615
- *
616
- * @summary Generates a URL for creating or modifying custom fields within your application\'s embedded Designer.
617
- * @param brandId The Brand ID for custom fields must be configured
618
- * @param linkValidTill This property is used to set the validity of the generated URL. Its maximum validity is 30 days
619
- * @param options
620
- */
621
- public async embedCustomField (brandId: string, linkValidTill?: Date, options: optionsI = {headers: {}}) : Promise<EmbeddedCustomFieldCreated> {
622
- const localVarPath = this.basePath + '/v1/customField/createEmbeddedCustomFieldUrl';
623
- let localVarQueryParameters: any = {};
624
- let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
625
- const produces = ['application/json'];
626
- // give precedence to 'application/json'
627
- if (produces.indexOf('application/json') >= 0) {
628
- localVarHeaderParams['content-type'] = 'application/json';
629
- } else {
630
- localVarHeaderParams['content-type'] = produces.join(',');
631
- }
632
- let localVarFormParams: any = {};
633
- let localVarBodyParams: any = undefined;
634
-
635
- // verify required parameter 'brandId' is not null or undefined
636
- if (brandId === null || brandId === undefined) {
637
- throw new Error('Required parameter brandId was null or undefined when calling embedCustomField.');
638
- }
639
-
640
- if (brandId !== undefined) {
641
- localVarQueryParameters['BrandId'] = ObjectSerializer.serialize(brandId, "string");
642
- }
643
-
644
- if (linkValidTill !== undefined) {
645
- localVarQueryParameters['LinkValidTill'] = ObjectSerializer.serialize(linkValidTill, "Date");
646
- }
647
-
648
- (<any>Object).assign(localVarHeaderParams, options.headers);
649
-
650
- let localVarUseFormData = false;
651
-
652
- let data = {};
653
- if (localVarUseFormData) {
654
- const formData = toFormData(localVarFormParams);
655
- data = formData;
656
- localVarHeaderParams = {
657
- ...localVarHeaderParams,
658
- ...formData.getHeaders(),
659
- };
660
- }
661
-
662
- let localVarRequestOptions: AxiosRequestConfig = {
663
- method: 'POST',
664
- params: localVarQueryParameters,
665
- headers: localVarHeaderParams,
666
- url: localVarPath,
667
- paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
668
- maxContentLength: Infinity,
669
- maxBodyLength: Infinity,
670
- responseType: "json",
671
- };
672
-
673
- if (localVarRequestOptions.method !== 'GET') {
674
- localVarRequestOptions.data = data;
675
- }
676
- let authenticationPromise = Promise.resolve();
677
-
678
- if (this.authentications["X-API-KEY"].apiKey) {
679
- authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
680
- }
681
- if (this.authentications["Bearer"].apiKey) {
682
- authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
683
- }
684
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
685
-
686
- let interceptorPromise = authenticationPromise;
687
- for (const interceptor of this.interceptors) {
688
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
689
- }
690
-
691
- return interceptorPromise.then(() => {
692
- return new Promise<EmbeddedCustomFieldCreated>((resolve, reject) => {
693
- axios.request(localVarRequestOptions)
694
- .then((response) => {
695
- handleSuccessfulResponse<EmbeddedCustomFieldCreated>(
696
- resolve,
697
- reject,
698
- response,
699
- "EmbeddedCustomFieldCreated",
700
- );
701
- }, (error: AxiosError) => {
702
- if (error.response == null) {
703
- reject(error);
704
- return;
705
- }
706
-
707
- if (handleErrorCodeResponse(
708
- reject,
709
- error.response,
710
- 200,
711
- "EmbeddedCustomFieldCreated",
712
- )) {
713
- return;
714
- }
715
- if (handleErrorCodeResponse(
716
- reject,
717
- error.response,
718
- 401,
719
- "ErrorResult",
720
- )) {
721
- return;
722
- }
723
- if (handleErrorCodeResponse(
724
- reject,
725
- error.response,
726
- 403,
727
- "ErrorResult",
728
- )) {
729
- return;
730
- }
731
-
732
-
733
- reject(error);
734
- });
735
- });
736
- });
737
- }
738
- }
739
-
740
- function deserializeIfNeeded<T> (obj: T, classname: string): T {
741
- if (obj !== null && obj !== undefined && obj.constructor.name !== classname) {
742
- return ObjectSerializer.deserialize(obj, classname);
743
- }
744
-
745
- return obj;
746
- }
747
-
748
- type AxiosResolve<T> = (
749
- value: (T | PromiseLike<T>),
750
- ) => void
751
-
752
- type AxiosReject = (reason?: any) => void;
753
-
754
- function handleSuccessfulResponse<T>(
755
- resolve: AxiosResolve<T>,
756
- reject: AxiosReject,
757
- response: AxiosResponse,
758
- returnType?: string,
759
- ) {
760
- let body = response.data;
761
-
762
- if (
763
- response.status &&
764
- response.status >= 200 &&
765
- response.status <= 299
766
- ) {
767
- if (returnType) {
768
- body = ObjectSerializer.deserialize(body, returnType);
769
- }
770
-
771
- resolve(body);
772
- } else {
773
- reject(new HttpError(response, body, response.status));
774
- }
775
- }
776
-
777
- function handleErrorCodeResponse(
778
- reject: AxiosReject,
779
- response: AxiosResponse,
780
- code: number,
781
- returnType: string
782
- ): boolean {
783
- if (response.status !== code) {
784
- return false;
785
- }
786
-
787
- let body = response.data;
788
- if(code === 401) {
789
- body = "Unauthorized request (401): Invalid authentication.";
790
- }
791
- reject(new HttpError(response, body, response.status));
792
-
793
- return true;
794
- }
795
-
796
- function handleErrorRangeResponse(
797
- reject: AxiosReject,
798
- response: AxiosResponse,
799
- code: string,
800
- returnType: string
801
- ): boolean {
802
- let rangeCodeLeft = Number(code[0] + "00");
803
- let rangeCodeRight = Number(code[0] + "99");
804
-
805
- if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) {
806
- const body = ObjectSerializer.deserialize(
807
- response.data,
808
- returnType,
809
- );
810
-
811
- reject(new HttpError(response, body, response.status));
812
-
813
- return true;
814
- }
815
-
816
- return false;
817
- }
1
+ /**
2
+ * BoldSign API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+
13
+ import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
14
+
15
+ import {
16
+ ObjectSerializer, Authentication, VoidAuth, Interceptor,
17
+ HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, RequestFile,
18
+ BrandCustomFieldDetails,CustomFieldCollection,CustomFieldMessage,DeleteCustomFieldReply,EmbeddedCustomFieldCreated,ErrorResult,
19
+ } from '../model';
20
+
21
+ import {
22
+ HttpError,
23
+ optionsI,
24
+ returnTypeT,
25
+ returnTypeI,
26
+ generateFormData,
27
+ toFormData,
28
+ queryParamsSerializer,
29
+ USER_AGENT,
30
+ } from './';
31
+
32
+ let defaultBasePath = 'https://api.boldsign.com';
33
+
34
+ // ===============================================
35
+ // This file is autogenerated - Please do not edit
36
+ // ===============================================
37
+
38
+
39
+ export class CustomFieldApi {
40
+ protected _basePath = defaultBasePath;
41
+ protected _defaultHeaders : any = { 'User-Agent': USER_AGENT };
42
+ protected _useQuerystring : boolean = true;
43
+
44
+ protected authentications = {
45
+ 'default': <Authentication>new VoidAuth(),
46
+ 'Bearer': new ApiKeyAuth('header', 'Authorization'),
47
+ 'X-API-KEY': new ApiKeyAuth('header', 'X-API-KEY'),
48
+ }
49
+
50
+ protected interceptors: Interceptor[] = [];
51
+
52
+ constructor(basePath?: string) {
53
+ if (basePath) {
54
+ this.basePath = basePath;
55
+ }
56
+ }
57
+
58
+ set useQuerystring(value: boolean) {
59
+ this._useQuerystring = value;
60
+ }
61
+
62
+ set basePath(basePath: string) {
63
+ this._basePath = basePath;
64
+ }
65
+
66
+ set defaultHeaders(defaultHeaders: any) {
67
+ this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT };
68
+ }
69
+
70
+ get defaultHeaders() {
71
+ return this._defaultHeaders;
72
+ }
73
+
74
+ get basePath() {
75
+ return this._basePath;
76
+ }
77
+
78
+ public setDefaultAuthentication(auth: Authentication) {
79
+ this.authentications.default = auth;
80
+ }
81
+
82
+ public setApiKey(apikey: string) {
83
+ this.authentications["X-API-KEY"].apiKey = apikey;
84
+ }
85
+
86
+ public setAccessToken(accessToken: string) {
87
+ this.authentications["Bearer"].apiKey = 'bearer ' + accessToken;
88
+ }
89
+
90
+ public addInterceptor(interceptor: Interceptor) {
91
+ this.interceptors.push(interceptor);
92
+ }
93
+
94
+ /**
95
+ *
96
+ * @summary Create the custom field.
97
+ * @param brandCustomFieldDetails The custom field details.
98
+ * @param options
99
+ */
100
+ public async createCustomField (brandCustomFieldDetails: BrandCustomFieldDetails, options: optionsI = {headers: {}}) : Promise<CustomFieldMessage> {
101
+ brandCustomFieldDetails = deserializeIfNeeded(brandCustomFieldDetails, "BrandCustomFieldDetails");
102
+ const localVarPath = this.basePath + '/v1/customField/create';
103
+ let localVarQueryParameters: any = {};
104
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
105
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
106
+ // give precedence to 'application/json'
107
+ if (produces.indexOf('application/json') >= 0) {
108
+ localVarHeaderParams['content-type'] = 'application/json';
109
+ } else {
110
+ localVarHeaderParams['content-type'] = produces.join(',');
111
+ }
112
+ let localVarFormParams: any = {};
113
+ let localVarBodyParams: any = undefined;
114
+
115
+ // verify required parameter 'brandCustomFieldDetails' is not null or undefined
116
+ if (brandCustomFieldDetails === null || brandCustomFieldDetails === undefined) {
117
+ throw new Error('Required parameter brandCustomFieldDetails was null or undefined when calling createCustomField.');
118
+ }
119
+
120
+ (<any>Object).assign(localVarHeaderParams, options.headers);
121
+
122
+ let localVarUseFormData = false;
123
+
124
+ const result = generateFormData(brandCustomFieldDetails, BrandCustomFieldDetails);
125
+ localVarUseFormData = result.localVarUseFormData;
126
+
127
+ let data = {};
128
+ if (localVarUseFormData) {
129
+ const formData = toFormData(result.data);
130
+ data = formData;
131
+ localVarHeaderParams = {
132
+ ...localVarHeaderParams,
133
+ ...formData.getHeaders(),
134
+ };
135
+ } else {
136
+ data = ObjectSerializer.serialize(
137
+ brandCustomFieldDetails,
138
+ "BrandCustomFieldDetails"
139
+ );
140
+ }
141
+
142
+ let localVarRequestOptions: AxiosRequestConfig = {
143
+ method: 'POST',
144
+ params: localVarQueryParameters,
145
+ headers: localVarHeaderParams,
146
+ url: localVarPath,
147
+ paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
148
+ maxContentLength: Infinity,
149
+ maxBodyLength: Infinity,
150
+ responseType: "json",
151
+ };
152
+
153
+ if (localVarRequestOptions.method !== 'GET') {
154
+ localVarRequestOptions.data = data;
155
+ }
156
+ let authenticationPromise = Promise.resolve();
157
+
158
+ if (this.authentications["X-API-KEY"].apiKey) {
159
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
160
+ }
161
+ if (this.authentications["Bearer"].apiKey) {
162
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
163
+ }
164
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
165
+
166
+ let interceptorPromise = authenticationPromise;
167
+ for (const interceptor of this.interceptors) {
168
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
169
+ }
170
+
171
+ return interceptorPromise.then(() => {
172
+ return new Promise<CustomFieldMessage>((resolve, reject) => {
173
+ axios.request(localVarRequestOptions)
174
+ .then((response) => {
175
+ handleSuccessfulResponse<CustomFieldMessage>(
176
+ resolve,
177
+ reject,
178
+ response,
179
+ "CustomFieldMessage",
180
+ );
181
+ }, (error: AxiosError) => {
182
+ if (error.response == null) {
183
+ reject(error);
184
+ return;
185
+ }
186
+
187
+ if (handleErrorCodeResponse(
188
+ reject,
189
+ error.response,
190
+ 200,
191
+ "CustomFieldMessage",
192
+ )) {
193
+ return;
194
+ }
195
+ if (handleErrorCodeResponse(
196
+ reject,
197
+ error.response,
198
+ 401,
199
+ "ErrorResult",
200
+ )) {
201
+ return;
202
+ }
203
+ if (handleErrorCodeResponse(
204
+ reject,
205
+ error.response,
206
+ 403,
207
+ "ErrorResult",
208
+ )) {
209
+ return;
210
+ }
211
+ if (handleErrorCodeResponse(
212
+ reject,
213
+ error.response,
214
+ 422,
215
+ "ErrorResult",
216
+ )) {
217
+ return;
218
+ }
219
+
220
+
221
+ reject(error);
222
+ });
223
+ });
224
+ });
225
+ }
226
+ /**
227
+ *
228
+ * @summary List the custom fields respective to the brand id.
229
+ * @param brandId The brand id.
230
+ * @param options
231
+ */
232
+ public async customFieldsList (brandId: string, options: optionsI = {headers: {}}) : Promise<CustomFieldCollection> {
233
+ const localVarPath = this.basePath + '/v1/customField/list';
234
+ let localVarQueryParameters: any = {};
235
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
236
+ const produces = ['application/json'];
237
+ // give precedence to 'application/json'
238
+ if (produces.indexOf('application/json') >= 0) {
239
+ localVarHeaderParams['content-type'] = 'application/json';
240
+ } else {
241
+ localVarHeaderParams['content-type'] = produces.join(',');
242
+ }
243
+ let localVarFormParams: any = {};
244
+ let localVarBodyParams: any = undefined;
245
+
246
+ // verify required parameter 'brandId' is not null or undefined
247
+ if (brandId === null || brandId === undefined) {
248
+ throw new Error('Required parameter brandId was null or undefined when calling customFieldsList.');
249
+ }
250
+
251
+ if (brandId !== undefined) {
252
+ localVarQueryParameters['brandId'] = ObjectSerializer.serialize(brandId, "string");
253
+ }
254
+
255
+ (<any>Object).assign(localVarHeaderParams, options.headers);
256
+
257
+ let localVarUseFormData = false;
258
+
259
+ let data = {};
260
+ if (localVarUseFormData) {
261
+ const formData = toFormData(localVarFormParams);
262
+ data = formData;
263
+ localVarHeaderParams = {
264
+ ...localVarHeaderParams,
265
+ ...formData.getHeaders(),
266
+ };
267
+ }
268
+
269
+ let localVarRequestOptions: AxiosRequestConfig = {
270
+ method: 'GET',
271
+ params: localVarQueryParameters,
272
+ headers: localVarHeaderParams,
273
+ url: localVarPath,
274
+ paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
275
+ maxContentLength: Infinity,
276
+ maxBodyLength: Infinity,
277
+ responseType: "json",
278
+ };
279
+
280
+ if (localVarRequestOptions.method !== 'GET') {
281
+ localVarRequestOptions.data = data;
282
+ }
283
+ let authenticationPromise = Promise.resolve();
284
+
285
+ if (this.authentications["X-API-KEY"].apiKey) {
286
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
287
+ }
288
+ if (this.authentications["Bearer"].apiKey) {
289
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
290
+ }
291
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
292
+
293
+ let interceptorPromise = authenticationPromise;
294
+ for (const interceptor of this.interceptors) {
295
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
296
+ }
297
+
298
+ return interceptorPromise.then(() => {
299
+ return new Promise<CustomFieldCollection>((resolve, reject) => {
300
+ axios.request(localVarRequestOptions)
301
+ .then((response) => {
302
+ handleSuccessfulResponse<CustomFieldCollection>(
303
+ resolve,
304
+ reject,
305
+ response,
306
+ "CustomFieldCollection",
307
+ );
308
+ }, (error: AxiosError) => {
309
+ if (error.response == null) {
310
+ reject(error);
311
+ return;
312
+ }
313
+
314
+ if (handleErrorCodeResponse(
315
+ reject,
316
+ error.response,
317
+ 200,
318
+ "CustomFieldCollection",
319
+ )) {
320
+ return;
321
+ }
322
+ if (handleErrorCodeResponse(
323
+ reject,
324
+ error.response,
325
+ 401,
326
+ "ErrorResult",
327
+ )) {
328
+ return;
329
+ }
330
+ if (handleErrorCodeResponse(
331
+ reject,
332
+ error.response,
333
+ 403,
334
+ "ErrorResult",
335
+ )) {
336
+ return;
337
+ }
338
+
339
+
340
+ reject(error);
341
+ });
342
+ });
343
+ });
344
+ }
345
+ /**
346
+ *
347
+ * @summary Delete the custom field.
348
+ * @param customFieldId The custom field id.
349
+ * @param options
350
+ */
351
+ public async deleteCustomField (customFieldId: string, options: optionsI = {headers: {}}) : Promise<DeleteCustomFieldReply> {
352
+ const localVarPath = this.basePath + '/v1/customField/delete';
353
+ let localVarQueryParameters: any = {};
354
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
355
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
356
+ // give precedence to 'application/json'
357
+ if (produces.indexOf('application/json') >= 0) {
358
+ localVarHeaderParams['content-type'] = 'application/json';
359
+ } else {
360
+ localVarHeaderParams['content-type'] = produces.join(',');
361
+ }
362
+ let localVarFormParams: any = {};
363
+ let localVarBodyParams: any = undefined;
364
+
365
+ // verify required parameter 'customFieldId' is not null or undefined
366
+ if (customFieldId === null || customFieldId === undefined) {
367
+ throw new Error('Required parameter customFieldId was null or undefined when calling deleteCustomField.');
368
+ }
369
+
370
+ if (customFieldId !== undefined) {
371
+ localVarQueryParameters['customFieldId'] = ObjectSerializer.serialize(customFieldId, "string");
372
+ }
373
+
374
+ (<any>Object).assign(localVarHeaderParams, options.headers);
375
+
376
+ let localVarUseFormData = false;
377
+
378
+ let data = {};
379
+ if (localVarUseFormData) {
380
+ const formData = toFormData(localVarFormParams);
381
+ data = formData;
382
+ localVarHeaderParams = {
383
+ ...localVarHeaderParams,
384
+ ...formData.getHeaders(),
385
+ };
386
+ }
387
+
388
+ let localVarRequestOptions: AxiosRequestConfig = {
389
+ method: 'DELETE',
390
+ params: localVarQueryParameters,
391
+ headers: localVarHeaderParams,
392
+ url: localVarPath,
393
+ paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
394
+ maxContentLength: Infinity,
395
+ maxBodyLength: Infinity,
396
+ responseType: "json",
397
+ };
398
+
399
+ if (localVarRequestOptions.method !== 'GET') {
400
+ localVarRequestOptions.data = data;
401
+ }
402
+ let authenticationPromise = Promise.resolve();
403
+
404
+ if (this.authentications["X-API-KEY"].apiKey) {
405
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
406
+ }
407
+ if (this.authentications["Bearer"].apiKey) {
408
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
409
+ }
410
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
411
+
412
+ let interceptorPromise = authenticationPromise;
413
+ for (const interceptor of this.interceptors) {
414
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
415
+ }
416
+
417
+ return interceptorPromise.then(() => {
418
+ return new Promise<DeleteCustomFieldReply>((resolve, reject) => {
419
+ axios.request(localVarRequestOptions)
420
+ .then((response) => {
421
+ handleSuccessfulResponse<DeleteCustomFieldReply>(
422
+ resolve,
423
+ reject,
424
+ response,
425
+ "DeleteCustomFieldReply",
426
+ );
427
+ }, (error: AxiosError) => {
428
+ if (error.response == null) {
429
+ reject(error);
430
+ return;
431
+ }
432
+
433
+ if (handleErrorCodeResponse(
434
+ reject,
435
+ error.response,
436
+ 200,
437
+ "DeleteCustomFieldReply",
438
+ )) {
439
+ return;
440
+ }
441
+ if (handleErrorCodeResponse(
442
+ reject,
443
+ error.response,
444
+ 401,
445
+ "ErrorResult",
446
+ )) {
447
+ return;
448
+ }
449
+ if (handleErrorCodeResponse(
450
+ reject,
451
+ error.response,
452
+ 403,
453
+ "ErrorResult",
454
+ )) {
455
+ return;
456
+ }
457
+ if (handleErrorCodeResponse(
458
+ reject,
459
+ error.response,
460
+ 422,
461
+ "ErrorResult",
462
+ )) {
463
+ return;
464
+ }
465
+
466
+
467
+ reject(error);
468
+ });
469
+ });
470
+ });
471
+ }
472
+ /**
473
+ *
474
+ * @summary Edit the custom field.
475
+ * @param customFieldId The custom field id.
476
+ * @param brandCustomFieldDetails The custom field details.
477
+ * @param options
478
+ */
479
+ public async editCustomField (customFieldId: string, brandCustomFieldDetails: BrandCustomFieldDetails, options: optionsI = {headers: {}}) : Promise<CustomFieldMessage> {
480
+ brandCustomFieldDetails = deserializeIfNeeded(brandCustomFieldDetails, "BrandCustomFieldDetails");
481
+ const localVarPath = this.basePath + '/v1/customField/edit';
482
+ let localVarQueryParameters: any = {};
483
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
484
+ const produces = ['application/json;odata.metadata=minimal;odata.streaming=true', 'application/json;odata.metadata=minimal;odata.streaming=false', 'application/json;odata.metadata=minimal', 'application/json;odata.metadata=full;odata.streaming=true', 'application/json;odata.metadata=full;odata.streaming=false', 'application/json;odata.metadata=full', 'application/json;odata.metadata=none;odata.streaming=true', 'application/json;odata.metadata=none;odata.streaming=false', 'application/json;odata.metadata=none', 'application/json;odata.streaming=true', 'application/json;odata.streaming=false', 'application/json', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=minimal;IEEE754Compatible=false', 'application/json;odata.metadata=minimal;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=full;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=full;IEEE754Compatible=false', 'application/json;odata.metadata=full;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=true', 'application/json;odata.metadata=none;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=false', 'application/json;odata.metadata=none;IEEE754Compatible=true', 'application/json;odata.streaming=true;IEEE754Compatible=false', 'application/json;odata.streaming=true;IEEE754Compatible=true', 'application/json;odata.streaming=false;IEEE754Compatible=false', 'application/json;odata.streaming=false;IEEE754Compatible=true', 'application/json;IEEE754Compatible=false', 'application/json;IEEE754Compatible=true', 'application/xml', 'text/plain', 'application/octet-stream', 'text/json'];
485
+ // give precedence to 'application/json'
486
+ if (produces.indexOf('application/json') >= 0) {
487
+ localVarHeaderParams['content-type'] = 'application/json';
488
+ } else {
489
+ localVarHeaderParams['content-type'] = produces.join(',');
490
+ }
491
+ let localVarFormParams: any = {};
492
+ let localVarBodyParams: any = undefined;
493
+
494
+ // verify required parameter 'customFieldId' is not null or undefined
495
+ if (customFieldId === null || customFieldId === undefined) {
496
+ throw new Error('Required parameter customFieldId was null or undefined when calling editCustomField.');
497
+ }
498
+
499
+ // verify required parameter 'brandCustomFieldDetails' is not null or undefined
500
+ if (brandCustomFieldDetails === null || brandCustomFieldDetails === undefined) {
501
+ throw new Error('Required parameter brandCustomFieldDetails was null or undefined when calling editCustomField.');
502
+ }
503
+
504
+ if (customFieldId !== undefined) {
505
+ localVarQueryParameters['customFieldId'] = ObjectSerializer.serialize(customFieldId, "string");
506
+ }
507
+
508
+ (<any>Object).assign(localVarHeaderParams, options.headers);
509
+
510
+ let localVarUseFormData = false;
511
+
512
+ const result = generateFormData(brandCustomFieldDetails, BrandCustomFieldDetails);
513
+ localVarUseFormData = result.localVarUseFormData;
514
+
515
+ let data = {};
516
+ if (localVarUseFormData) {
517
+ const formData = toFormData(result.data);
518
+ data = formData;
519
+ localVarHeaderParams = {
520
+ ...localVarHeaderParams,
521
+ ...formData.getHeaders(),
522
+ };
523
+ } else {
524
+ data = ObjectSerializer.serialize(
525
+ brandCustomFieldDetails,
526
+ "BrandCustomFieldDetails"
527
+ );
528
+ }
529
+
530
+ let localVarRequestOptions: AxiosRequestConfig = {
531
+ method: 'POST',
532
+ params: localVarQueryParameters,
533
+ headers: localVarHeaderParams,
534
+ url: localVarPath,
535
+ paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
536
+ maxContentLength: Infinity,
537
+ maxBodyLength: Infinity,
538
+ responseType: "json",
539
+ };
540
+
541
+ if (localVarRequestOptions.method !== 'GET') {
542
+ localVarRequestOptions.data = data;
543
+ }
544
+ let authenticationPromise = Promise.resolve();
545
+
546
+ if (this.authentications["X-API-KEY"].apiKey) {
547
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
548
+ }
549
+ if (this.authentications["Bearer"].apiKey) {
550
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
551
+ }
552
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
553
+
554
+ let interceptorPromise = authenticationPromise;
555
+ for (const interceptor of this.interceptors) {
556
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
557
+ }
558
+
559
+ return interceptorPromise.then(() => {
560
+ return new Promise<CustomFieldMessage>((resolve, reject) => {
561
+ axios.request(localVarRequestOptions)
562
+ .then((response) => {
563
+ handleSuccessfulResponse<CustomFieldMessage>(
564
+ resolve,
565
+ reject,
566
+ response,
567
+ "CustomFieldMessage",
568
+ );
569
+ }, (error: AxiosError) => {
570
+ if (error.response == null) {
571
+ reject(error);
572
+ return;
573
+ }
574
+
575
+ if (handleErrorCodeResponse(
576
+ reject,
577
+ error.response,
578
+ 200,
579
+ "CustomFieldMessage",
580
+ )) {
581
+ return;
582
+ }
583
+ if (handleErrorCodeResponse(
584
+ reject,
585
+ error.response,
586
+ 401,
587
+ "ErrorResult",
588
+ )) {
589
+ return;
590
+ }
591
+ if (handleErrorCodeResponse(
592
+ reject,
593
+ error.response,
594
+ 403,
595
+ "ErrorResult",
596
+ )) {
597
+ return;
598
+ }
599
+ if (handleErrorCodeResponse(
600
+ reject,
601
+ error.response,
602
+ 422,
603
+ "ErrorResult",
604
+ )) {
605
+ return;
606
+ }
607
+
608
+
609
+ reject(error);
610
+ });
611
+ });
612
+ });
613
+ }
614
+ /**
615
+ *
616
+ * @summary Generates a URL for creating or modifying custom fields within your application\'s embedded Designer.
617
+ * @param brandId The Brand ID for custom fields must be configured
618
+ * @param linkValidTill This property is used to set the validity of the generated URL. Its maximum validity is 30 days
619
+ * @param options
620
+ */
621
+ public async embedCustomField (brandId: string, linkValidTill?: Date, options: optionsI = {headers: {}}) : Promise<EmbeddedCustomFieldCreated> {
622
+ const localVarPath = this.basePath + '/v1/customField/createEmbeddedCustomFieldUrl';
623
+ let localVarQueryParameters: any = {};
624
+ let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
625
+ const produces = ['application/json'];
626
+ // give precedence to 'application/json'
627
+ if (produces.indexOf('application/json') >= 0) {
628
+ localVarHeaderParams['content-type'] = 'application/json';
629
+ } else {
630
+ localVarHeaderParams['content-type'] = produces.join(',');
631
+ }
632
+ let localVarFormParams: any = {};
633
+ let localVarBodyParams: any = undefined;
634
+
635
+ // verify required parameter 'brandId' is not null or undefined
636
+ if (brandId === null || brandId === undefined) {
637
+ throw new Error('Required parameter brandId was null or undefined when calling embedCustomField.');
638
+ }
639
+
640
+ if (brandId !== undefined) {
641
+ localVarQueryParameters['BrandId'] = ObjectSerializer.serialize(brandId, "string");
642
+ }
643
+
644
+ if (linkValidTill !== undefined) {
645
+ localVarQueryParameters['LinkValidTill'] = ObjectSerializer.serialize(linkValidTill, "Date");
646
+ }
647
+
648
+ (<any>Object).assign(localVarHeaderParams, options.headers);
649
+
650
+ let localVarUseFormData = false;
651
+
652
+ let data = {};
653
+ if (localVarUseFormData) {
654
+ const formData = toFormData(localVarFormParams);
655
+ data = formData;
656
+ localVarHeaderParams = {
657
+ ...localVarHeaderParams,
658
+ ...formData.getHeaders(),
659
+ };
660
+ }
661
+
662
+ let localVarRequestOptions: AxiosRequestConfig = {
663
+ method: 'POST',
664
+ params: localVarQueryParameters,
665
+ headers: localVarHeaderParams,
666
+ url: localVarPath,
667
+ paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
668
+ maxContentLength: Infinity,
669
+ maxBodyLength: Infinity,
670
+ responseType: "json",
671
+ };
672
+
673
+ if (localVarRequestOptions.method !== 'GET') {
674
+ localVarRequestOptions.data = data;
675
+ }
676
+ let authenticationPromise = Promise.resolve();
677
+
678
+ if (this.authentications["X-API-KEY"].apiKey) {
679
+ authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
680
+ }
681
+ if (this.authentications["Bearer"].apiKey) {
682
+ authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
683
+ }
684
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
685
+
686
+ let interceptorPromise = authenticationPromise;
687
+ for (const interceptor of this.interceptors) {
688
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
689
+ }
690
+
691
+ return interceptorPromise.then(() => {
692
+ return new Promise<EmbeddedCustomFieldCreated>((resolve, reject) => {
693
+ axios.request(localVarRequestOptions)
694
+ .then((response) => {
695
+ handleSuccessfulResponse<EmbeddedCustomFieldCreated>(
696
+ resolve,
697
+ reject,
698
+ response,
699
+ "EmbeddedCustomFieldCreated",
700
+ );
701
+ }, (error: AxiosError) => {
702
+ if (error.response == null) {
703
+ reject(error);
704
+ return;
705
+ }
706
+
707
+ if (handleErrorCodeResponse(
708
+ reject,
709
+ error.response,
710
+ 200,
711
+ "EmbeddedCustomFieldCreated",
712
+ )) {
713
+ return;
714
+ }
715
+ if (handleErrorCodeResponse(
716
+ reject,
717
+ error.response,
718
+ 401,
719
+ "ErrorResult",
720
+ )) {
721
+ return;
722
+ }
723
+ if (handleErrorCodeResponse(
724
+ reject,
725
+ error.response,
726
+ 403,
727
+ "ErrorResult",
728
+ )) {
729
+ return;
730
+ }
731
+
732
+
733
+ reject(error);
734
+ });
735
+ });
736
+ });
737
+ }
738
+ }
739
+
740
+ function deserializeIfNeeded<T> (obj: T, classname: string): T {
741
+ if (obj !== null && obj !== undefined && obj.constructor.name !== classname) {
742
+ return ObjectSerializer.deserialize(obj, classname);
743
+ }
744
+
745
+ return obj;
746
+ }
747
+
748
+ type AxiosResolve<T> = (
749
+ value: (T | PromiseLike<T>),
750
+ ) => void
751
+
752
+ type AxiosReject = (reason?: any) => void;
753
+
754
+ function handleSuccessfulResponse<T>(
755
+ resolve: AxiosResolve<T>,
756
+ reject: AxiosReject,
757
+ response: AxiosResponse,
758
+ returnType?: string,
759
+ ) {
760
+ let body = response.data;
761
+
762
+ if (
763
+ response.status &&
764
+ response.status >= 200 &&
765
+ response.status <= 299
766
+ ) {
767
+ if (returnType) {
768
+ body = ObjectSerializer.deserialize(body, returnType);
769
+ }
770
+
771
+ resolve(body);
772
+ } else {
773
+ reject(new HttpError(response, body, response.status));
774
+ }
775
+ }
776
+
777
+ function handleErrorCodeResponse(
778
+ reject: AxiosReject,
779
+ response: AxiosResponse,
780
+ code: number,
781
+ returnType: string
782
+ ): boolean {
783
+ if (response.status !== code) {
784
+ return false;
785
+ }
786
+
787
+ let body = response.data;
788
+ if(code === 401) {
789
+ body = "Unauthorized request (401): Invalid authentication.";
790
+ }
791
+ reject(new HttpError(response, body, response.status));
792
+
793
+ return true;
794
+ }
795
+
796
+ function handleErrorRangeResponse(
797
+ reject: AxiosReject,
798
+ response: AxiosResponse,
799
+ code: string,
800
+ returnType: string
801
+ ): boolean {
802
+ let rangeCodeLeft = Number(code[0] + "00");
803
+ let rangeCodeRight = Number(code[0] + "99");
804
+
805
+ if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) {
806
+ const body = ObjectSerializer.deserialize(
807
+ response.data,
808
+ returnType,
809
+ );
810
+
811
+ reject(new HttpError(response, body, response.status));
812
+
813
+ return true;
814
+ }
815
+
816
+ return false;
817
+ }