Class: DocuSign_WebForms::FormManagementApi

Inherits:
Object
  • Object
show all
Defined in:
lib/docusign_webforms/api/form_management_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = FormManagementApi.default) ⇒ FormManagementApi

Returns a new instance of FormManagementApi.



56
57
58
# File 'lib/docusign_webforms/api/form_management_api.rb', line 56

def initialize(api_client = FormManagementApi.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



54
55
56
# File 'lib/docusign_webforms/api/form_management_api.rb', line 54

def api_client
  @api_client
end

Instance Method Details

#get_form(account_id, form_id, options = DocuSign_WebForms::GetFormOptions.default) ⇒ WebForm

Get Form Retrieves form information filter by form id and state. The ‘state` parameter is optional and can accept value from `draft, active`.

Parameters:

  • account_id

    Account identifier in which the web form resides

  • form_id

    Unique identifier for a web form that is consistent for it’s lifetime

  • DocuSign_WebForms::GetFormOptions

    Options for modifying the behavior of the function.

Returns:



66
67
68
69
# File 'lib/docusign_webforms/api/form_management_api.rb', line 66

def get_form(, form_id, options = DocuSign_WebForms::GetFormOptions.default)
  data, _status_code, _headers = get_form_with_http_info(, form_id, options)
  return data
end

#get_form_with_http_info(account_id, form_id, options = DocuSign_WebForms::GetFormOptions.default) ⇒ Array<(WebForm, Fixnum, Hash)>

Get Form Retrieves form information filter by form id and state. The &#x60;state&#x60; parameter is optional and can accept value from &#x60;draft, active&#x60;.

Parameters:

  • account_id

    Account identifier in which the web form resides

  • form_id

    Unique identifier for a web form that is consistent for it’s lifetime

  • DocuSign_WebForms::GetFormOptions

    Options for modifying the behavior of the function.

Returns:

  • (Array<(WebForm, Fixnum, Hash)>)

    WebForm data, response status code and response headers



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/docusign_webforms/api/form_management_api.rb', line 77

def get_form_with_http_info(, form_id, options = DocuSign_WebForms::GetFormOptions.default)
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FormManagementApi.get_form ..."
  end
  # verify the required parameter 'account_id' is set
  fail ArgumentError, "Missing the required parameter 'account_id' when calling FormManagementApi.get_form" if .nil?
  # verify the required parameter 'form_id' is set
  fail ArgumentError, "Missing the required parameter 'form_id' when calling FormManagementApi.get_form" if form_id.nil?
  if options.state && !['active', 'draft'].include?(options.state)
    fail ArgumentError, 'invalid value for "state", must be one of active, draft'
  end
  if !options.state.nil? && options.state.to_s.length > 15
    fail ArgumentError, 'invalid value for "options[:"state"]" when calling FormManagementApi.get_form, the character length must be smaller than or equal to 15.'
  end

  # resource path
  local_var_path = "/accounts/{account_id}/forms/{form_id}".sub('{format}','json').sub('{' + 'account_id' + '}', .to_s).sub('{' + 'form_id' + '}', form_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'state'] = options.state if !options.state.nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'WebForm')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FormManagementApi#get_form\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_forms(account_id, options = DocuSign_WebForms::ListFormsOptions.default) ⇒ WebFormSummaryList

List Forms List all the forms for the active user that can be in an active or draft state

Parameters:

  • account_id

    Account identifier in which the webform resides

  • DocuSign_WebForms::ListFormsOptions

    Options for modifying the behavior of the function.

Returns:



130
131
132
133
# File 'lib/docusign_webforms/api/form_management_api.rb', line 130

def list_forms(, options = DocuSign_WebForms::ListFormsOptions.default)
  data, _status_code, _headers = list_forms_with_http_info(, options)
  return data
end

#list_forms_with_http_info(account_id, options = DocuSign_WebForms::ListFormsOptions.default) ⇒ Array<(WebFormSummaryList, Fixnum, Hash)>

List Forms List all the forms for the active user that can be in an active or draft state

Parameters:

  • account_id

    Account identifier in which the webform resides

  • DocuSign_WebForms::ListFormsOptions

    Options for modifying the behavior of the function.

Returns:

  • (Array<(WebFormSummaryList, Fixnum, Hash)>)

    WebFormSummaryList data, response status code and response headers



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/docusign_webforms/api/form_management_api.rb', line 140

def list_forms_with_http_info(, options = DocuSign_WebForms::ListFormsOptions.default)
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FormManagementApi.list_forms ..."
  end
  # verify the required parameter 'account_id' is set
  fail ArgumentError, "Missing the required parameter 'account_id' when calling FormManagementApi.list_forms" if .nil?
  if options.user_filter && !['owned_by_me', 'all'].include?(options.user_filter)
    fail ArgumentError, 'invalid value for "user_filter", must be one of owned_by_me, all'
  end
  if !options.sort_by.nil? && options.sort_by.to_s.length > 50
    fail ArgumentError, 'invalid value for "options[:"sort_by"]" when calling FormManagementApi.list_forms, the character length must be smaller than or equal to 50.'
  end

  # resource path
  local_var_path = "/accounts/{account_id}/forms".sub('{format}','json').sub('{' + 'account_id' + '}', .to_s)

  # query parameters
  query_params = {}
  query_params[:'user_filter'] = options.user_filter if !options.user_filter.nil?
  query_params[:'is_standalone'] = options.is_standalone if !options.is_standalone.nil?
  query_params[:'is_published'] = options.is_published if !options.is_published.nil?
  query_params[:'sort_by'] = options.sort_by if !options.sort_by.nil?
  query_params[:'search'] = options.search if !options.search.nil?
  query_params[:'start_position'] = options.start_position if !options.start_position.nil?
  query_params[:'count'] = options.count if !options.count.nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'WebFormSummaryList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FormManagementApi#list_forms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end