docusign_webforms 1.0.2.rc12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +34 -0
  3. data/Gemfile +7 -0
  4. data/README.md +131 -0
  5. data/Rakefile +8 -0
  6. data/docusign_webforms.gemspec +48 -0
  7. data/lib/docusign_webforms/api/form_instance_management_api.rb +272 -0
  8. data/lib/docusign_webforms/api/form_management_api.rb +192 -0
  9. data/lib/docusign_webforms/client/api_client.rb +600 -0
  10. data/lib/docusign_webforms/client/api_error.rb +37 -0
  11. data/lib/docusign_webforms/client/auth/oauth.rb +1061 -0
  12. data/lib/docusign_webforms/configuration.rb +203 -0
  13. data/lib/docusign_webforms/models/account_id.rb +175 -0
  14. data/lib/docusign_webforms/models/assertion_id.rb +175 -0
  15. data/lib/docusign_webforms/models/authentication_instant.rb +175 -0
  16. data/lib/docusign_webforms/models/authentication_method.rb +175 -0
  17. data/lib/docusign_webforms/models/brand_id.rb +175 -0
  18. data/lib/docusign_webforms/models/client_user_id.rb +175 -0
  19. data/lib/docusign_webforms/models/component_key.rb +174 -0
  20. data/lib/docusign_webforms/models/count.rb +175 -0
  21. data/lib/docusign_webforms/models/create_instance_request_body.rb +264 -0
  22. data/lib/docusign_webforms/models/created_date_time.rb +175 -0
  23. data/lib/docusign_webforms/models/date_time.rb +174 -0
  24. data/lib/docusign_webforms/models/envelope_id.rb +175 -0
  25. data/lib/docusign_webforms/models/expiration_date_time.rb +175 -0
  26. data/lib/docusign_webforms/models/expiration_offset.rb +175 -0
  27. data/lib/docusign_webforms/models/form_sort_by.rb +175 -0
  28. data/lib/docusign_webforms/models/form_url.rb +175 -0
  29. data/lib/docusign_webforms/models/guid.rb +174 -0
  30. data/lib/docusign_webforms/models/http_error.rb +195 -0
  31. data/lib/docusign_webforms/models/http_success.rb +184 -0
  32. data/lib/docusign_webforms/models/instance_id.rb +175 -0
  33. data/lib/docusign_webforms/models/instance_source.rb +31 -0
  34. data/lib/docusign_webforms/models/instance_status.rb +31 -0
  35. data/lib/docusign_webforms/models/instance_token.rb +175 -0
  36. data/lib/docusign_webforms/models/is_private_access.rb +175 -0
  37. data/lib/docusign_webforms/models/is_published.rb +175 -0
  38. data/lib/docusign_webforms/models/is_standalone.rb +175 -0
  39. data/lib/docusign_webforms/models/last_modified_date_time.rb +175 -0
  40. data/lib/docusign_webforms/models/return_url.rb +175 -0
  41. data/lib/docusign_webforms/models/search_text.rb +175 -0
  42. data/lib/docusign_webforms/models/security_domain.rb +175 -0
  43. data/lib/docusign_webforms/models/source.rb +31 -0
  44. data/lib/docusign_webforms/models/start_position.rb +175 -0
  45. data/lib/docusign_webforms/models/tags.rb +175 -0
  46. data/lib/docusign_webforms/models/template_properties.rb +217 -0
  47. data/lib/docusign_webforms/models/token_expiration_date_time.rb +175 -0
  48. data/lib/docusign_webforms/models/update_instance_request_body.rb +184 -0
  49. data/lib/docusign_webforms/models/user_filter.rb +30 -0
  50. data/lib/docusign_webforms/models/user_id.rb +175 -0
  51. data/lib/docusign_webforms/models/web_form.rb +268 -0
  52. data/lib/docusign_webforms/models/web_form_adm_type.rb +39 -0
  53. data/lib/docusign_webforms/models/web_form_component.rb +248 -0
  54. data/lib/docusign_webforms/models/web_form_component_type.rb +34 -0
  55. data/lib/docusign_webforms/models/web_form_components_map.rb +175 -0
  56. data/lib/docusign_webforms/models/web_form_content.rb +217 -0
  57. data/lib/docusign_webforms/models/web_form_id.rb +175 -0
  58. data/lib/docusign_webforms/models/web_form_instance.rb +295 -0
  59. data/lib/docusign_webforms/models/web_form_instance_envelopes.rb +183 -0
  60. data/lib/docusign_webforms/models/web_form_instance_list.rb +187 -0
  61. data/lib/docusign_webforms/models/web_form_instance_metadata.rb +237 -0
  62. data/lib/docusign_webforms/models/web_form_metadata.rb +377 -0
  63. data/lib/docusign_webforms/models/web_form_name.rb +175 -0
  64. data/lib/docusign_webforms/models/web_form_properties.rb +193 -0
  65. data/lib/docusign_webforms/models/web_form_published_names.rb +175 -0
  66. data/lib/docusign_webforms/models/web_form_source.rb +29 -0
  67. data/lib/docusign_webforms/models/web_form_state.rb +29 -0
  68. data/lib/docusign_webforms/models/web_form_summary.rb +250 -0
  69. data/lib/docusign_webforms/models/web_form_summary_list.rb +247 -0
  70. data/lib/docusign_webforms/models/web_form_user_info.rb +209 -0
  71. data/lib/docusign_webforms/models/web_form_values.rb +175 -0
  72. data/lib/docusign_webforms/models/web_form_version_id.rb +175 -0
  73. data/lib/docusign_webforms/version.rb +14 -0
  74. data/lib/docusign_webforms.rb +64 -0
  75. data/runLinter.sh +1 -0
  76. data/tests/Gemfile +5 -0
  77. data/tests/spec/unit_tests_using_jwt_spec.rb +38 -0
  78. metadata +382 -0
@@ -0,0 +1,192 @@
1
+ =begin
2
+ #Web Forms API version 1.1
3
+
4
+ #The Web Forms API facilitates generating semantic HTML forms around everyday contracts.
5
+
6
+ OpenAPI spec version: 1.1.0
7
+ Contact: devcenter@docusign.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require "uri"
13
+
14
+ module DocuSign_WebForms
15
+
16
+ class GetFormOptions
17
+ # The state of the web form configuration
18
+ attr_accessor :state
19
+
20
+ def self.default
21
+ @@default ||= GetFormOptions.new
22
+ end
23
+ end
24
+
25
+ class ListFormsOptions
26
+ # Filter which forms are returned
27
+ attr_accessor :user_filter
28
+
29
+ # Is the form a standalone form
30
+ attr_accessor :is_standalone
31
+
32
+ # Has the form been published
33
+ attr_accessor :is_published
34
+
35
+ # Sort result set in mentioned sort property:order. Default is lastModifiedDateTime:desc. Default sort is descending if not mentioned.
36
+ attr_accessor :sort_by
37
+
38
+ # Search through form names
39
+ attr_accessor :search
40
+
41
+ # Starting position for desired page of results.
42
+ attr_accessor :start_position
43
+
44
+ # Number of results to return per page.
45
+ attr_accessor :count
46
+
47
+ def self.default
48
+ @@default ||= ListFormsOptions.new
49
+ end
50
+ end
51
+
52
+
53
+ class FormManagementApi
54
+ attr_accessor :api_client
55
+
56
+ def initialize(api_client = FormManagementApi.default)
57
+ @api_client = api_client
58
+ end
59
+
60
+ # Get Form
61
+ # Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`.
62
+ # @param account_id Account identifier in which the web form resides
63
+ # @param form_id Unique identifier for a web form that is consistent for it's lifetime
64
+ # @param DocuSign_WebForms::GetFormOptions Options for modifying the behavior of the function.
65
+ # @return [WebForm]
66
+ def get_form(account_id, form_id, options = DocuSign_WebForms::GetFormOptions.default)
67
+ data, _status_code, _headers = get_form_with_http_info(account_id, form_id, options)
68
+ return data
69
+ end
70
+
71
+ # Get Form
72
+ # Retrieves form information filter by form id and state. The `state` parameter is optional and can accept value from `draft, active`.
73
+ # @param account_id Account identifier in which the web form resides
74
+ # @param form_id Unique identifier for a web form that is consistent for it's lifetime
75
+ # @param DocuSign_WebForms::GetFormOptions Options for modifying the behavior of the function.
76
+ # @return [Array<(WebForm, Fixnum, Hash)>] WebForm data, response status code and response headers
77
+ def get_form_with_http_info(account_id, form_id, options = DocuSign_WebForms::GetFormOptions.default)
78
+ if @api_client.config.debugging
79
+ @api_client.config.logger.debug "Calling API: FormManagementApi.get_form ..."
80
+ end
81
+ # verify the required parameter 'account_id' is set
82
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling FormManagementApi.get_form" if account_id.nil?
83
+ # verify the required parameter 'form_id' is set
84
+ fail ArgumentError, "Missing the required parameter 'form_id' when calling FormManagementApi.get_form" if form_id.nil?
85
+ if options.state && !['active', 'draft'].include?(options.state)
86
+ fail ArgumentError, 'invalid value for "state", must be one of active, draft'
87
+ end
88
+ if !options.state.nil? && options.state.to_s.length > 15
89
+ fail ArgumentError, 'invalid value for "options[:"state"]" when calling FormManagementApi.get_form, the character length must be smaller than or equal to 15.'
90
+ end
91
+
92
+ # resource path
93
+ local_var_path = "/accounts/{account_id}/forms/{form_id}".sub('{format}','json').sub('{' + 'account_id' + '}', account_id.to_s).sub('{' + 'form_id' + '}', form_id.to_s)
94
+
95
+ # query parameters
96
+ query_params = {}
97
+ query_params[:'state'] = options.state if !options.state.nil?
98
+
99
+ # header parameters
100
+ header_params = {}
101
+ # HTTP header 'Accept' (if needed)
102
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
103
+ # HTTP header 'Content-Type'
104
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
105
+
106
+ # form parameters
107
+ form_params = {}
108
+
109
+ # http body (model)
110
+ post_body = nil
111
+ auth_names = []
112
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
113
+ :header_params => header_params,
114
+ :query_params => query_params,
115
+ :form_params => form_params,
116
+ :body => post_body,
117
+ :auth_names => auth_names,
118
+ :return_type => 'WebForm')
119
+ if @api_client.config.debugging
120
+ @api_client.config.logger.debug "API called: FormManagementApi#get_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
121
+ end
122
+ return data, status_code, headers
123
+ end
124
+
125
+ # List Forms
126
+ # List all the forms for the active user that can be in an active or draft state
127
+ # @param account_id Account identifier in which the webform resides
128
+ # @param DocuSign_WebForms::ListFormsOptions Options for modifying the behavior of the function.
129
+ # @return [WebFormSummaryList]
130
+ def list_forms(account_id, options = DocuSign_WebForms::ListFormsOptions.default)
131
+ data, _status_code, _headers = list_forms_with_http_info(account_id, options)
132
+ return data
133
+ end
134
+
135
+ # List Forms
136
+ # List all the forms for the active user that can be in an active or draft state
137
+ # @param account_id Account identifier in which the webform resides
138
+ # @param DocuSign_WebForms::ListFormsOptions Options for modifying the behavior of the function.
139
+ # @return [Array<(WebFormSummaryList, Fixnum, Hash)>] WebFormSummaryList data, response status code and response headers
140
+ def list_forms_with_http_info(account_id, options = DocuSign_WebForms::ListFormsOptions.default)
141
+ if @api_client.config.debugging
142
+ @api_client.config.logger.debug "Calling API: FormManagementApi.list_forms ..."
143
+ end
144
+ # verify the required parameter 'account_id' is set
145
+ fail ArgumentError, "Missing the required parameter 'account_id' when calling FormManagementApi.list_forms" if account_id.nil?
146
+ if options.user_filter && !['owned_by_me', 'all'].include?(options.user_filter)
147
+ fail ArgumentError, 'invalid value for "user_filter", must be one of owned_by_me, all'
148
+ end
149
+ if !options.sort_by.nil? && options.sort_by.to_s.length > 50
150
+ fail ArgumentError, 'invalid value for "options[:"sort_by"]" when calling FormManagementApi.list_forms, the character length must be smaller than or equal to 50.'
151
+ end
152
+
153
+ # resource path
154
+ local_var_path = "/accounts/{account_id}/forms".sub('{format}','json').sub('{' + 'account_id' + '}', account_id.to_s)
155
+
156
+ # query parameters
157
+ query_params = {}
158
+ query_params[:'user_filter'] = options.user_filter if !options.user_filter.nil?
159
+ query_params[:'is_standalone'] = options.is_standalone if !options.is_standalone.nil?
160
+ query_params[:'is_published'] = options.is_published if !options.is_published.nil?
161
+ query_params[:'sort_by'] = options.sort_by if !options.sort_by.nil?
162
+ query_params[:'search'] = options.search if !options.search.nil?
163
+ query_params[:'start_position'] = options.start_position if !options.start_position.nil?
164
+ query_params[:'count'] = options.count if !options.count.nil?
165
+
166
+ # header parameters
167
+ header_params = {}
168
+ # HTTP header 'Accept' (if needed)
169
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
170
+ # HTTP header 'Content-Type'
171
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
172
+
173
+ # form parameters
174
+ form_params = {}
175
+
176
+ # http body (model)
177
+ post_body = nil
178
+ auth_names = []
179
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
180
+ :header_params => header_params,
181
+ :query_params => query_params,
182
+ :form_params => form_params,
183
+ :body => post_body,
184
+ :auth_names => auth_names,
185
+ :return_type => 'WebFormSummaryList')
186
+ if @api_client.config.debugging
187
+ @api_client.config.logger.debug "API called: FormManagementApi#list_forms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
188
+ end
189
+ return data, status_code, headers
190
+ end
191
+ end
192
+ end