signwell_sdk 0.0.1.pre.alpha.1

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 (227) hide show
  1. checksums.yaml +7 -0
  2. data/.ignore +2 -0
  3. data/CHANGELOG.md +24 -0
  4. data/README.md +398 -0
  5. data/SECURITY.md +23 -0
  6. data/lib/signwell_sdk/client.rb +72 -0
  7. data/lib/signwell_sdk/errors.rb +228 -0
  8. data/lib/signwell_sdk/file_part.rb +58 -0
  9. data/lib/signwell_sdk/internal/transport/base_client.rb +573 -0
  10. data/lib/signwell_sdk/internal/transport/pooled_net_requester.rb +210 -0
  11. data/lib/signwell_sdk/internal/type/array_of.rb +168 -0
  12. data/lib/signwell_sdk/internal/type/base_model.rb +531 -0
  13. data/lib/signwell_sdk/internal/type/base_page.rb +55 -0
  14. data/lib/signwell_sdk/internal/type/boolean.rb +77 -0
  15. data/lib/signwell_sdk/internal/type/converter.rb +327 -0
  16. data/lib/signwell_sdk/internal/type/enum.rb +156 -0
  17. data/lib/signwell_sdk/internal/type/file_input.rb +111 -0
  18. data/lib/signwell_sdk/internal/type/hash_of.rb +188 -0
  19. data/lib/signwell_sdk/internal/type/request_parameters.rb +42 -0
  20. data/lib/signwell_sdk/internal/type/union.rb +243 -0
  21. data/lib/signwell_sdk/internal/type/unknown.rb +81 -0
  22. data/lib/signwell_sdk/internal/util.rb +920 -0
  23. data/lib/signwell_sdk/internal.rb +20 -0
  24. data/lib/signwell_sdk/models/attachment_request_info.rb +34 -0
  25. data/lib/signwell_sdk/models/checkbox_group_info.rb +66 -0
  26. data/lib/signwell_sdk/models/checkbox_validation.rb +18 -0
  27. data/lib/signwell_sdk/models/copied_contact_info.rb +34 -0
  28. data/lib/signwell_sdk/models/date_format.rb +20 -0
  29. data/lib/signwell_sdk/models/field_type.rb +29 -0
  30. data/lib/signwell_sdk/models/file_info.rb +26 -0
  31. data/lib/signwell_sdk/models/label_info.rb +26 -0
  32. data/lib/signwell_sdk/models/text_validation.rb +25 -0
  33. data/lib/signwell_sdk/models/v1/api_application_delete_params.rb +16 -0
  34. data/lib/signwell_sdk/models/v1/api_application_retrieve_params.rb +16 -0
  35. data/lib/signwell_sdk/models/v1/attachment_request.rb +38 -0
  36. data/lib/signwell_sdk/models/v1/bulk_send_create_params.rb +107 -0
  37. data/lib/signwell_sdk/models/v1/bulk_send_list_params.rb +55 -0
  38. data/lib/signwell_sdk/models/v1/bulk_send_retrieve_csv_template_params.rb +39 -0
  39. data/lib/signwell_sdk/models/v1/bulk_send_retrieve_documents_params.rb +32 -0
  40. data/lib/signwell_sdk/models/v1/bulk_send_retrieve_params.rb +16 -0
  41. data/lib/signwell_sdk/models/v1/bulk_send_validate_csv_params.rb +39 -0
  42. data/lib/signwell_sdk/models/v1/checkbox_group.rb +80 -0
  43. data/lib/signwell_sdk/models/v1/copied_contact.rb +26 -0
  44. data/lib/signwell_sdk/models/v1/document.rb +543 -0
  45. data/lib/signwell_sdk/models/v1/document_create_from_template_params.rb +740 -0
  46. data/lib/signwell_sdk/models/v1/document_create_from_template_response.rb +500 -0
  47. data/lib/signwell_sdk/models/v1/document_create_params.rb +620 -0
  48. data/lib/signwell_sdk/models/v1/document_delete_params.rb +16 -0
  49. data/lib/signwell_sdk/models/v1/document_file.rb +34 -0
  50. data/lib/signwell_sdk/models/v1/document_list_params.rb +32 -0
  51. data/lib/signwell_sdk/models/v1/document_list_response.rb +50 -0
  52. data/lib/signwell_sdk/models/v1/document_remind_params.rb +49 -0
  53. data/lib/signwell_sdk/models/v1/document_retrieve_completed_pdf_params.rb +55 -0
  54. data/lib/signwell_sdk/models/v1/document_retrieve_completed_pdf_response.rb +22 -0
  55. data/lib/signwell_sdk/models/v1/document_retrieve_params.rb +16 -0
  56. data/lib/signwell_sdk/models/v1/document_send_params.rb +198 -0
  57. data/lib/signwell_sdk/models/v1/document_template.rb +503 -0
  58. data/lib/signwell_sdk/models/v1/document_template_create_params.rb +599 -0
  59. data/lib/signwell_sdk/models/v1/document_template_delete_params.rb +16 -0
  60. data/lib/signwell_sdk/models/v1/document_template_list_params.rb +32 -0
  61. data/lib/signwell_sdk/models/v1/document_template_list_response.rb +50 -0
  62. data/lib/signwell_sdk/models/v1/document_template_retrieve_params.rb +16 -0
  63. data/lib/signwell_sdk/models/v1/document_template_update_params.rb +162 -0
  64. data/lib/signwell_sdk/models/v1/hook_create_params.rb +32 -0
  65. data/lib/signwell_sdk/models/v1/hook_delete_params.rb +16 -0
  66. data/lib/signwell_sdk/models/v1/hook_list_params.rb +16 -0
  67. data/lib/signwell_sdk/models/v1/label.rb +22 -0
  68. data/lib/signwell_sdk/models/v1/template_checkbox_group.rb +80 -0
  69. data/lib/signwell_sdk/models/v1_me_params.rb +14 -0
  70. data/lib/signwell_sdk/models.rb +63 -0
  71. data/lib/signwell_sdk/request_options.rb +77 -0
  72. data/lib/signwell_sdk/resources/v1/api_applications.rb +59 -0
  73. data/lib/signwell_sdk/resources/v1/bulk_sends.rb +198 -0
  74. data/lib/signwell_sdk/resources/v1/document_templates.rb +204 -0
  75. data/lib/signwell_sdk/resources/v1/documents.rb +372 -0
  76. data/lib/signwell_sdk/resources/v1/hooks.rb +78 -0
  77. data/lib/signwell_sdk/resources/v1.rb +47 -0
  78. data/lib/signwell_sdk/version.rb +5 -0
  79. data/lib/signwell_sdk.rb +107 -0
  80. data/manifest.yaml +17 -0
  81. data/rbi/signwell_sdk/client.rbi +49 -0
  82. data/rbi/signwell_sdk/errors.rbi +205 -0
  83. data/rbi/signwell_sdk/file_part.rbi +37 -0
  84. data/rbi/signwell_sdk/internal/transport/base_client.rbi +302 -0
  85. data/rbi/signwell_sdk/internal/transport/pooled_net_requester.rbi +84 -0
  86. data/rbi/signwell_sdk/internal/type/array_of.rbi +104 -0
  87. data/rbi/signwell_sdk/internal/type/base_model.rbi +308 -0
  88. data/rbi/signwell_sdk/internal/type/base_page.rbi +43 -0
  89. data/rbi/signwell_sdk/internal/type/boolean.rbi +58 -0
  90. data/rbi/signwell_sdk/internal/type/converter.rbi +216 -0
  91. data/rbi/signwell_sdk/internal/type/enum.rbi +82 -0
  92. data/rbi/signwell_sdk/internal/type/file_input.rbi +59 -0
  93. data/rbi/signwell_sdk/internal/type/hash_of.rbi +104 -0
  94. data/rbi/signwell_sdk/internal/type/request_parameters.rbi +31 -0
  95. data/rbi/signwell_sdk/internal/type/union.rbi +128 -0
  96. data/rbi/signwell_sdk/internal/type/unknown.rbi +58 -0
  97. data/rbi/signwell_sdk/internal/util.rbi +487 -0
  98. data/rbi/signwell_sdk/internal.rbi +18 -0
  99. data/rbi/signwell_sdk/models/attachment_request_info.rbi +52 -0
  100. data/rbi/signwell_sdk/models/checkbox_group_info.rbi +89 -0
  101. data/rbi/signwell_sdk/models/checkbox_validation.rbi +27 -0
  102. data/rbi/signwell_sdk/models/copied_contact_info.rbi +50 -0
  103. data/rbi/signwell_sdk/models/date_format.rbi +26 -0
  104. data/rbi/signwell_sdk/models/field_type.rbi +41 -0
  105. data/rbi/signwell_sdk/models/file_info.rbi +36 -0
  106. data/rbi/signwell_sdk/models/label_info.rbi +40 -0
  107. data/rbi/signwell_sdk/models/text_validation.rbi +44 -0
  108. data/rbi/signwell_sdk/models/v1/api_application_delete_params.rbi +34 -0
  109. data/rbi/signwell_sdk/models/v1/api_application_retrieve_params.rbi +34 -0
  110. data/rbi/signwell_sdk/models/v1/attachment_request.rbi +59 -0
  111. data/rbi/signwell_sdk/models/v1/bulk_send_create_params.rbi +160 -0
  112. data/rbi/signwell_sdk/models/v1/bulk_send_list_params.rbi +92 -0
  113. data/rbi/signwell_sdk/models/v1/bulk_send_retrieve_csv_template_params.rbi +67 -0
  114. data/rbi/signwell_sdk/models/v1/bulk_send_retrieve_documents_params.rbi +62 -0
  115. data/rbi/signwell_sdk/models/v1/bulk_send_retrieve_params.rbi +34 -0
  116. data/rbi/signwell_sdk/models/v1/bulk_send_validate_csv_params.rbi +64 -0
  117. data/rbi/signwell_sdk/models/v1/checkbox_group.rbi +121 -0
  118. data/rbi/signwell_sdk/models/v1/copied_contact.rbi +41 -0
  119. data/rbi/signwell_sdk/models/v1/document.rbi +833 -0
  120. data/rbi/signwell_sdk/models/v1/document_create_from_template_params.rbi +1270 -0
  121. data/rbi/signwell_sdk/models/v1/document_create_from_template_response.rbi +856 -0
  122. data/rbi/signwell_sdk/models/v1/document_create_params.rbi +1019 -0
  123. data/rbi/signwell_sdk/models/v1/document_delete_params.rbi +34 -0
  124. data/rbi/signwell_sdk/models/v1/document_file.rbi +55 -0
  125. data/rbi/signwell_sdk/models/v1/document_list_params.rbi +62 -0
  126. data/rbi/signwell_sdk/models/v1/document_list_response.rbi +71 -0
  127. data/rbi/signwell_sdk/models/v1/document_remind_params.rbi +107 -0
  128. data/rbi/signwell_sdk/models/v1/document_retrieve_completed_pdf_params.rbi +123 -0
  129. data/rbi/signwell_sdk/models/v1/document_retrieve_completed_pdf_response.rbi +34 -0
  130. data/rbi/signwell_sdk/models/v1/document_retrieve_params.rbi +34 -0
  131. data/rbi/signwell_sdk/models/v1/document_send_params.rbi +307 -0
  132. data/rbi/signwell_sdk/models/v1/document_template.rbi +830 -0
  133. data/rbi/signwell_sdk/models/v1/document_template_create_params.rbi +1050 -0
  134. data/rbi/signwell_sdk/models/v1/document_template_delete_params.rbi +34 -0
  135. data/rbi/signwell_sdk/models/v1/document_template_list_params.rbi +62 -0
  136. data/rbi/signwell_sdk/models/v1/document_template_list_response.rbi +71 -0
  137. data/rbi/signwell_sdk/models/v1/document_template_retrieve_params.rbi +34 -0
  138. data/rbi/signwell_sdk/models/v1/document_template_update_params.rbi +257 -0
  139. data/rbi/signwell_sdk/models/v1/hook_create_params.rbi +59 -0
  140. data/rbi/signwell_sdk/models/v1/hook_delete_params.rbi +34 -0
  141. data/rbi/signwell_sdk/models/v1/hook_list_params.rbi +34 -0
  142. data/rbi/signwell_sdk/models/v1/label.rbi +29 -0
  143. data/rbi/signwell_sdk/models/v1/template_checkbox_group.rbi +121 -0
  144. data/rbi/signwell_sdk/models/v1_me_params.rbi +27 -0
  145. data/rbi/signwell_sdk/models.rbi +25 -0
  146. data/rbi/signwell_sdk/request_options.rbi +59 -0
  147. data/rbi/signwell_sdk/resources/v1/api_applications.rbi +45 -0
  148. data/rbi/signwell_sdk/resources/v1/bulk_sends.rbi +173 -0
  149. data/rbi/signwell_sdk/resources/v1/document_templates.rbi +276 -0
  150. data/rbi/signwell_sdk/resources/v1/documents.rbi +527 -0
  151. data/rbi/signwell_sdk/resources/v1/hooks.rbi +52 -0
  152. data/rbi/signwell_sdk/resources/v1.rbi +32 -0
  153. data/rbi/signwell_sdk/version.rbi +5 -0
  154. data/sig/signwell_sdk/client.rbs +26 -0
  155. data/sig/signwell_sdk/errors.rbs +117 -0
  156. data/sig/signwell_sdk/file_part.rbs +21 -0
  157. data/sig/signwell_sdk/internal/transport/base_client.rbs +133 -0
  158. data/sig/signwell_sdk/internal/transport/pooled_net_requester.rbs +48 -0
  159. data/sig/signwell_sdk/internal/type/array_of.rbs +48 -0
  160. data/sig/signwell_sdk/internal/type/base_model.rbs +102 -0
  161. data/sig/signwell_sdk/internal/type/base_page.rbs +24 -0
  162. data/sig/signwell_sdk/internal/type/boolean.rbs +26 -0
  163. data/sig/signwell_sdk/internal/type/converter.rbs +79 -0
  164. data/sig/signwell_sdk/internal/type/enum.rbs +32 -0
  165. data/sig/signwell_sdk/internal/type/file_input.rbs +25 -0
  166. data/sig/signwell_sdk/internal/type/hash_of.rbs +48 -0
  167. data/sig/signwell_sdk/internal/type/request_parameters.rbs +19 -0
  168. data/sig/signwell_sdk/internal/type/union.rbs +52 -0
  169. data/sig/signwell_sdk/internal/type/unknown.rbs +26 -0
  170. data/sig/signwell_sdk/internal/util.rbs +185 -0
  171. data/sig/signwell_sdk/internal.rbs +9 -0
  172. data/sig/signwell_sdk/models/attachment_request_info.rbs +19 -0
  173. data/sig/signwell_sdk/models/checkbox_group_info.rbs +52 -0
  174. data/sig/signwell_sdk/models/checkbox_validation.rbs +16 -0
  175. data/sig/signwell_sdk/models/copied_contact_info.rbs +21 -0
  176. data/sig/signwell_sdk/models/date_format.rbs +22 -0
  177. data/sig/signwell_sdk/models/field_type.rbs +42 -0
  178. data/sig/signwell_sdk/models/file_info.rbs +15 -0
  179. data/sig/signwell_sdk/models/label_info.rbs +19 -0
  180. data/sig/signwell_sdk/models/text_validation.rbs +34 -0
  181. data/sig/signwell_sdk/models/v1/api_application_delete_params.rbs +17 -0
  182. data/sig/signwell_sdk/models/v1/api_application_retrieve_params.rbs +17 -0
  183. data/sig/signwell_sdk/models/v1/attachment_request.rbs +26 -0
  184. data/sig/signwell_sdk/models/v1/bulk_send_create_params.rbs +89 -0
  185. data/sig/signwell_sdk/models/v1/bulk_send_list_params.rbs +51 -0
  186. data/sig/signwell_sdk/models/v1/bulk_send_retrieve_csv_template_params.rbs +32 -0
  187. data/sig/signwell_sdk/models/v1/bulk_send_retrieve_documents_params.rbs +34 -0
  188. data/sig/signwell_sdk/models/v1/bulk_send_retrieve_params.rbs +17 -0
  189. data/sig/signwell_sdk/models/v1/bulk_send_validate_csv_params.rbs +30 -0
  190. data/sig/signwell_sdk/models/v1/checkbox_group.rbs +69 -0
  191. data/sig/signwell_sdk/models/v1/copied_contact.rbs +19 -0
  192. data/sig/signwell_sdk/models/v1/document.rbs +563 -0
  193. data/sig/signwell_sdk/models/v1/document_create_from_template_params.rbs +570 -0
  194. data/sig/signwell_sdk/models/v1/document_create_from_template_response.rbs +518 -0
  195. data/sig/signwell_sdk/models/v1/document_create_params.rbs +473 -0
  196. data/sig/signwell_sdk/models/v1/document_delete_params.rbs +17 -0
  197. data/sig/signwell_sdk/models/v1/document_file.rbs +32 -0
  198. data/sig/signwell_sdk/models/v1/document_list_params.rbs +34 -0
  199. data/sig/signwell_sdk/models/v1/document_list_response.rbs +47 -0
  200. data/sig/signwell_sdk/models/v1/document_remind_params.rbs +48 -0
  201. data/sig/signwell_sdk/models/v1/document_retrieve_completed_pdf_params.rbs +57 -0
  202. data/sig/signwell_sdk/models/v1/document_retrieve_completed_pdf_response.rbs +15 -0
  203. data/sig/signwell_sdk/models/v1/document_retrieve_params.rbs +17 -0
  204. data/sig/signwell_sdk/models/v1/document_send_params.rbs +160 -0
  205. data/sig/signwell_sdk/models/v1/document_template.rbs +530 -0
  206. data/sig/signwell_sdk/models/v1/document_template_create_params.rbs +459 -0
  207. data/sig/signwell_sdk/models/v1/document_template_delete_params.rbs +17 -0
  208. data/sig/signwell_sdk/models/v1/document_template_list_params.rbs +34 -0
  209. data/sig/signwell_sdk/models/v1/document_template_list_response.rbs +47 -0
  210. data/sig/signwell_sdk/models/v1/document_template_retrieve_params.rbs +17 -0
  211. data/sig/signwell_sdk/models/v1/document_template_update_params.rbs +132 -0
  212. data/sig/signwell_sdk/models/v1/hook_create_params.rbs +32 -0
  213. data/sig/signwell_sdk/models/v1/hook_delete_params.rbs +17 -0
  214. data/sig/signwell_sdk/models/v1/hook_list_params.rbs +17 -0
  215. data/sig/signwell_sdk/models/v1/label.rbs +15 -0
  216. data/sig/signwell_sdk/models/v1/template_checkbox_group.rbs +69 -0
  217. data/sig/signwell_sdk/models/v1_me_params.rbs +14 -0
  218. data/sig/signwell_sdk/models.rbs +23 -0
  219. data/sig/signwell_sdk/request_options.rbs +36 -0
  220. data/sig/signwell_sdk/resources/v1/api_applications.rbs +19 -0
  221. data/sig/signwell_sdk/resources/v1/bulk_sends.rbs +55 -0
  222. data/sig/signwell_sdk/resources/v1/document_templates.rbs +71 -0
  223. data/sig/signwell_sdk/resources/v1/documents.rbs +130 -0
  224. data/sig/signwell_sdk/resources/v1/hooks.rbs +22 -0
  225. data/sig/signwell_sdk/resources/v1.rbs +19 -0
  226. data/sig/signwell_sdk/version.rbs +3 -0
  227. metadata +298 -0
@@ -0,0 +1,198 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SignwellSDK
4
+ module Resources
5
+ class V1
6
+ class BulkSends
7
+ # Some parameter documentations has been truncated, see
8
+ # {SignwellSDK::Models::V1::BulkSendCreateParams} for more details.
9
+ #
10
+ # Creates a bulk send, and it validates the CSV file before creating the bulk
11
+ # send.
12
+ #
13
+ # @overload create(bulk_send_csv:, template_ids:, api_application_id: nil, apply_signing_order: nil, custom_requester_email: nil, custom_requester_name: nil, message: nil, name: nil, skip_row_errors: nil, subject: nil, request_options: {})
14
+ #
15
+ # @param bulk_send_csv [String] A RFC 4648 base64 string of the template CSV file to be validated.
16
+ #
17
+ # @param template_ids [Array<String>] Unique identifiers for a list of templates.
18
+ #
19
+ # @param api_application_id [String] Unique identifier for API Application settings to use. API Applications are opti
20
+ #
21
+ # @param apply_signing_order [Boolean] When set to `true` recipients will sign one at a time in the order of the `recip
22
+ #
23
+ # @param custom_requester_email [String] Sets the custom requester email for the document. When set, this is the email us
24
+ #
25
+ # @param custom_requester_name [String] Sets the custom requester name for the document. When set, this is the name used
26
+ #
27
+ # @param message [String] Email message for the signature request that recipients will see. Defaults to th
28
+ #
29
+ # @param name [String] The name of the Bulk Send. Will be used as the document name for each of the doc
30
+ #
31
+ # @param skip_row_errors [Boolean] Whether to skip errors in the rows. Defaults to `false`.
32
+ #
33
+ # @param subject [String] Email subject for the signature request that recipients will see. Defaults to th
34
+ #
35
+ # @param request_options [SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil]
36
+ #
37
+ # @return [nil]
38
+ #
39
+ # @see SignwellSDK::Models::V1::BulkSendCreateParams
40
+ def create(params)
41
+ parsed, options = SignwellSDK::V1::BulkSendCreateParams.dump_request(params)
42
+ @client.request(
43
+ method: :post,
44
+ path: "api/v1/bulk_sends",
45
+ body: parsed,
46
+ model: NilClass,
47
+ options: options
48
+ )
49
+ end
50
+
51
+ # Returns information about the Bulk Send.
52
+ #
53
+ # @overload retrieve(id, request_options: {})
54
+ #
55
+ # @param id [String] Unique identifier for a bulk send.
56
+ #
57
+ # @param request_options [SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil]
58
+ #
59
+ # @return [nil]
60
+ #
61
+ # @see SignwellSDK::Models::V1::BulkSendRetrieveParams
62
+ def retrieve(id, params = {})
63
+ @client.request(
64
+ method: :get,
65
+ path: ["api/v1/bulk_sends/%1$s", id],
66
+ model: NilClass,
67
+ options: params[:request_options]
68
+ )
69
+ end
70
+
71
+ # Some parameter documentations has been truncated, see
72
+ # {SignwellSDK::Models::V1::BulkSendListParams} for more details.
73
+ #
74
+ # Returns information about the Bulk Send.
75
+ #
76
+ # @overload list(api_application_id: nil, limit: nil, page: nil, user_email: nil, request_options: {})
77
+ #
78
+ # @param api_application_id [String] Unique identifier for API Application settings to use. API Applications are opti
79
+ #
80
+ # @param limit [Integer] The number of documents to fetch. Defaults to 10, max is 50.
81
+ #
82
+ # @param page [Integer] The page number for pagination. Defaults to the first page.
83
+ #
84
+ # @param user_email [String] The email address of the user that sent the Bulk Send. Must have the `admin` or
85
+ #
86
+ # @param request_options [SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil]
87
+ #
88
+ # @return [nil]
89
+ #
90
+ # @see SignwellSDK::Models::V1::BulkSendListParams
91
+ def list(params = {})
92
+ parsed, options = SignwellSDK::V1::BulkSendListParams.dump_request(params)
93
+ @client.request(
94
+ method: :get,
95
+ path: "api/v1/bulk_sends",
96
+ query: parsed,
97
+ model: NilClass,
98
+ options: options
99
+ )
100
+ end
101
+
102
+ # Some parameter documentations has been truncated, see
103
+ # {SignwellSDK::Models::V1::BulkSendRetrieveCsvTemplateParams} for more details.
104
+ #
105
+ # Fetches a CSV template that corresponds to the provided document template IDs.
106
+ # CSV templates are blank CSV files that have columns containing required and
107
+ # optional data that can be sent when creating a bulk send. Fields can be
108
+ # referenced by the field label. Example: [placeholder name]\_[field label] could
109
+ # be something like customer_address or signer_company_name (if 'Customer' and
110
+ # 'Signer' were placeholder names for templates set up in SignWell).
111
+ #
112
+ # @overload retrieve_csv_template(template_ids:, base64: nil, request_options: {})
113
+ #
114
+ # @param template_ids [Array<String>] Specify one or more templates to generate a single blank CSV file that will cont
115
+ #
116
+ # @param base64 [String] A RFC 4648 base64 string of the template CSV file to be validated.
117
+ #
118
+ # @param request_options [SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil]
119
+ #
120
+ # @return [StringIO]
121
+ #
122
+ # @see SignwellSDK::Models::V1::BulkSendRetrieveCsvTemplateParams
123
+ def retrieve_csv_template(params)
124
+ parsed, options = SignwellSDK::V1::BulkSendRetrieveCsvTemplateParams.dump_request(params)
125
+ @client.request(
126
+ method: :get,
127
+ path: "api/v1/bulk_sends/csv_template",
128
+ query: parsed,
129
+ headers: {"accept" => "application/octet-stream"},
130
+ model: StringIO,
131
+ options: options
132
+ )
133
+ end
134
+
135
+ # Returns information about the Bulk Send.
136
+ #
137
+ # @overload retrieve_documents(id, limit: nil, page: nil, request_options: {})
138
+ #
139
+ # @param id [String] Unique identifier for a bulk send.
140
+ #
141
+ # @param limit [Integer] The number of documents to fetch. Defaults to 10, max is 50.
142
+ #
143
+ # @param page [Integer] The page number for pagination. Defaults to the first page.
144
+ #
145
+ # @param request_options [SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil]
146
+ #
147
+ # @return [nil]
148
+ #
149
+ # @see SignwellSDK::Models::V1::BulkSendRetrieveDocumentsParams
150
+ def retrieve_documents(id, params = {})
151
+ parsed, options = SignwellSDK::V1::BulkSendRetrieveDocumentsParams.dump_request(params)
152
+ @client.request(
153
+ method: :get,
154
+ path: ["api/v1/bulk_sends/%1$s/documents", id],
155
+ query: parsed,
156
+ model: NilClass,
157
+ options: options
158
+ )
159
+ end
160
+
161
+ # Some parameter documentations has been truncated, see
162
+ # {SignwellSDK::Models::V1::BulkSendValidateCsvParams} for more details.
163
+ #
164
+ # Validates a Bulk Send CSV file before creating the Bulk Send. It will check the
165
+ # structure of the CSV and the data it contains, and return any errors found.
166
+ #
167
+ # @overload validate_csv(bulk_send_csv:, template_ids:, request_options: {})
168
+ #
169
+ # @param bulk_send_csv [String] A RFC 4648 base64 string of the template CSV file to be validated.
170
+ #
171
+ # @param template_ids [Array<String>] Specify one or more templates to generate a single blank CSV file that will cont
172
+ #
173
+ # @param request_options [SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil]
174
+ #
175
+ # @return [nil]
176
+ #
177
+ # @see SignwellSDK::Models::V1::BulkSendValidateCsvParams
178
+ def validate_csv(params)
179
+ parsed, options = SignwellSDK::V1::BulkSendValidateCsvParams.dump_request(params)
180
+ @client.request(
181
+ method: :post,
182
+ path: "api/v1/bulk_sends/validate_csv",
183
+ body: parsed,
184
+ model: NilClass,
185
+ options: options
186
+ )
187
+ end
188
+
189
+ # @api private
190
+ #
191
+ # @param client [SignwellSDK::Client]
192
+ def initialize(client:)
193
+ @client = client
194
+ end
195
+ end
196
+ end
197
+ end
198
+ end
@@ -0,0 +1,204 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SignwellSDK
4
+ module Resources
5
+ class V1
6
+ class DocumentTemplates
7
+ # Some parameter documentations has been truncated, see
8
+ # {SignwellSDK::Models::V1::DocumentTemplateCreateParams} for more details.
9
+ #
10
+ # Creates a new template.
11
+ #
12
+ # @overload create(files:, placeholders:, allow_decline: nil, allow_reassign: nil, api_application_id: nil, apply_signing_order: nil, attachment_requests: nil, checkbox_groups: nil, copied_placeholders: nil, decline_redirect_url: nil, draft: nil, expires_in: nil, fields: nil, labels: nil, language: nil, message: nil, metadata: nil, name: nil, redirect_url: nil, reminders: nil, subject: nil, text_tags: nil, request_options: {})
13
+ #
14
+ # @param files [Array<SignwellSDK::Models::V1::DocumentFile>] Document files can be uploaded by specifying a file URL or base64 string. Either
15
+ #
16
+ # @param placeholders [Array<SignwellSDK::Models::V1::DocumentTemplateCreateParams::Placeholder>] Placeholders are generally job roles that must complete and/or sign the document
17
+ #
18
+ # @param allow_decline [Boolean] Whether to allow recipients the option to decline signing a document. If multipl
19
+ #
20
+ # @param allow_reassign [Boolean] In some cases a signer is not the right person to sign and may need to reassign
21
+ #
22
+ # @param api_application_id [String] Unique identifier for API Application settings to use. API Applications are opti
23
+ #
24
+ # @param apply_signing_order [Boolean] When set to `true` recipients will sign one at a time in the order of the `recip
25
+ #
26
+ # @param attachment_requests [Array<SignwellSDK::Models::V1::DocumentTemplateCreateParams::AttachmentRequest>] Attachments that a recipient must upload to complete the signing process. Attach
27
+ #
28
+ # @param checkbox_groups [Array<SignwellSDK::Models::V1::TemplateCheckboxGroup>] Checkbox fields that are placed on a document can be grouped with selection requ
29
+ #
30
+ # @param copied_placeholders [Array<SignwellSDK::Models::V1::DocumentTemplateCreateParams::CopiedPlaceholder>] Copied placeholders are emailed the final document once it has been completed by
31
+ #
32
+ # @param decline_redirect_url [String] A URL that recipients are redirected to if the document is declined.
33
+ #
34
+ # @param draft [Boolean] Whether the template can still be updated before it is ready for usage. If set t
35
+ #
36
+ # @param expires_in [Integer] Number of days before the signature request expires. Defaults to the account exp
37
+ #
38
+ # @param fields [Array<Array<SignwellSDK::Models::V1::DocumentTemplateCreateParams::Field>>] Document fields placed on a document for collecting data or signatures from reci
39
+ #
40
+ # @param labels [Array<SignwellSDK::Models::V1::Label>] Labels can be used to organize documents in a way that can make it easy to find
41
+ #
42
+ # @param language [String] Sets the language for the template and documents created from the template for a
43
+ #
44
+ # @param message [String] Email message for the signature request that recipients will see. Defaults to th
45
+ #
46
+ # @param metadata [Hash{Symbol=>String}] Optional key-value data that can be associated with the document. If set, will b
47
+ #
48
+ # @param name [String] The name of the template.
49
+ #
50
+ # @param redirect_url [String] A URL that recipients are redirected to after successfully signing a document.
51
+ #
52
+ # @param reminders [Boolean] Whether to send signing reminders to recipients. Reminders are sent on day 3, da
53
+ #
54
+ # @param subject [String] Email subject for the signature request that recipients will see. Defaults to th
55
+ #
56
+ # @param text_tags [Boolean] An alternative way (if you can’t use the recommended way) of placing fields in s
57
+ #
58
+ # @param request_options [SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil]
59
+ #
60
+ # @return [SignwellSDK::Models::V1::DocumentTemplate]
61
+ #
62
+ # @see SignwellSDK::Models::V1::DocumentTemplateCreateParams
63
+ def create(params)
64
+ parsed, options = SignwellSDK::V1::DocumentTemplateCreateParams.dump_request(params)
65
+ @client.request(
66
+ method: :post,
67
+ path: "api/v1/document_templates",
68
+ body: parsed,
69
+ model: SignwellSDK::V1::DocumentTemplate,
70
+ options: options
71
+ )
72
+ end
73
+
74
+ # Returns a template and all associated template data. Supply the unique template
75
+ # ID from either a Create Template request or template page URL.
76
+ #
77
+ # @overload retrieve(id, request_options: {})
78
+ #
79
+ # @param id [String] Unique identifier for a template.
80
+ #
81
+ # @param request_options [SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil]
82
+ #
83
+ # @return [SignwellSDK::Models::V1::DocumentTemplate]
84
+ #
85
+ # @see SignwellSDK::Models::V1::DocumentTemplateRetrieveParams
86
+ def retrieve(id, params = {})
87
+ @client.request(
88
+ method: :get,
89
+ path: ["api/v1/document_templates/%1$s", id],
90
+ model: SignwellSDK::V1::DocumentTemplate,
91
+ options: params[:request_options]
92
+ )
93
+ end
94
+
95
+ # Some parameter documentations has been truncated, see
96
+ # {SignwellSDK::Models::V1::DocumentTemplateUpdateParams} for more details.
97
+ #
98
+ # Updates an existing template.
99
+ #
100
+ # @overload update(id, allow_decline: nil, allow_reassign: nil, api_application_id: nil, apply_signing_order: nil, checkbox_groups: nil, decline_redirect_url: nil, draft: nil, expires_in: nil, labels: nil, message: nil, metadata: nil, name: nil, redirect_url: nil, reminders: nil, subject: nil, request_options: {})
101
+ #
102
+ # @param id [String] Unique identifier for a template.
103
+ #
104
+ # @param allow_decline [Boolean] Whether to allow recipients the option to decline signing a document. If multipl
105
+ #
106
+ # @param allow_reassign [Boolean] In some cases a signer is not the right person to sign and may need to reassign
107
+ #
108
+ # @param api_application_id [String] Unique identifier for API Application settings to use. API Applications are opti
109
+ #
110
+ # @param apply_signing_order [Boolean] When set to `true` recipients will sign one at a time in the order of the `recip
111
+ #
112
+ # @param checkbox_groups [Array<SignwellSDK::Models::V1::TemplateCheckboxGroup>] Checkbox fields that are placed on a document can be grouped with selection requ
113
+ #
114
+ # @param decline_redirect_url [String] A URL that recipients are redirected to if the document is declined.
115
+ #
116
+ # @param draft [Boolean] Whether the template can still be updated before it is ready for usage. If set t
117
+ #
118
+ # @param expires_in [Integer] Number of days before the signature request expires. Defaults to the account exp
119
+ #
120
+ # @param labels [Array<SignwellSDK::Models::V1::Label>] Labels can be used to organize documents in a way that can make it easy to find
121
+ #
122
+ # @param message [String] Email message for the signature request that recipients will see. Defaults to th
123
+ #
124
+ # @param metadata [Hash{Symbol=>String}] Optional key-value data that can be associated with the document. If set, will b
125
+ #
126
+ # @param name [String] The name of the template.
127
+ #
128
+ # @param redirect_url [String] A URL that recipients are redirected to after successfully signing a document.
129
+ #
130
+ # @param reminders [Boolean] Whether to send signing reminders to recipients. Reminders are sent on day 3, da
131
+ #
132
+ # @param subject [String] Email subject for the signature request that recipients will see. Defaults to th
133
+ #
134
+ # @param request_options [SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil]
135
+ #
136
+ # @return [SignwellSDK::Models::V1::DocumentTemplate]
137
+ #
138
+ # @see SignwellSDK::Models::V1::DocumentTemplateUpdateParams
139
+ def update(id, params = {})
140
+ parsed, options = SignwellSDK::V1::DocumentTemplateUpdateParams.dump_request(params)
141
+ @client.request(
142
+ method: :put,
143
+ path: ["api/v1/document_templates/%1$s", id],
144
+ body: parsed,
145
+ model: SignwellSDK::V1::DocumentTemplate,
146
+ options: options
147
+ )
148
+ end
149
+
150
+ # Returns a paginated list of templates for the authenticated account.
151
+ #
152
+ # @overload list(limit: nil, page: nil, request_options: {})
153
+ #
154
+ # @param limit [Integer] The number of documents to fetch. Defaults to 10, max is 50.
155
+ #
156
+ # @param page [Integer] The page number for pagination. Defaults to the first page.
157
+ #
158
+ # @param request_options [SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil]
159
+ #
160
+ # @return [SignwellSDK::Models::V1::DocumentTemplateListResponse]
161
+ #
162
+ # @see SignwellSDK::Models::V1::DocumentTemplateListParams
163
+ def list(params = {})
164
+ parsed, options = SignwellSDK::V1::DocumentTemplateListParams.dump_request(params)
165
+ @client.request(
166
+ method: :get,
167
+ path: "api/v1/document_templates",
168
+ query: parsed,
169
+ model: SignwellSDK::Models::V1::DocumentTemplateListResponse,
170
+ options: options
171
+ )
172
+ end
173
+
174
+ # Deletes a template. Supply the unique template ID from either a Create Template
175
+ # request or template page URL.
176
+ #
177
+ # @overload delete(id, request_options: {})
178
+ #
179
+ # @param id [String] Unique identifier for a template.
180
+ #
181
+ # @param request_options [SignwellSDK::RequestOptions, Hash{Symbol=>Object}, nil]
182
+ #
183
+ # @return [nil]
184
+ #
185
+ # @see SignwellSDK::Models::V1::DocumentTemplateDeleteParams
186
+ def delete(id, params = {})
187
+ @client.request(
188
+ method: :delete,
189
+ path: ["api/v1/document_templates/%1$s", id],
190
+ model: NilClass,
191
+ options: params[:request_options]
192
+ )
193
+ end
194
+
195
+ # @api private
196
+ #
197
+ # @param client [SignwellSDK::Client]
198
+ def initialize(client:)
199
+ @client = client
200
+ end
201
+ end
202
+ end
203
+ end
204
+ end