Class: SignRequestClient::DocumentAttachmentsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/signrequest_client/api/document_attachments_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DocumentAttachmentsApi

Returns a new instance of DocumentAttachmentsApi.



19
20
21
# File 'lib/signrequest_client/api/document_attachments_api.rb', line 19

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/signrequest_client/api/document_attachments_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#document_attachments_create(data, opts = {}) ⇒ DocumentAttachment

Create a Document Attachment

Parameters:

  • (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/signrequest_client/api/document_attachments_api.rb', line 27

def document_attachments_create(data, opts = {})
  data, _status_code, _headers = document_attachments_create_with_http_info(data, opts)
  data
end

#document_attachments_create_with_http_info(data, opts = {}) ⇒ Array<(DocumentAttachment, Fixnum, Hash)>

Create a Document Attachment

Parameters:

  • (defaults to: {})

    the optional parameters

Returns:

  • DocumentAttachment data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/signrequest_client/api/document_attachments_api.rb', line 37

def document_attachments_create_with_http_info(data, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DocumentAttachmentsApi.document_attachments_create ...'
  end
  # verify the required parameter 'data' is set
  if @api_client.config.client_side_validation && data.nil?
    fail ArgumentError, "Missing the required parameter 'data' when calling DocumentAttachmentsApi.document_attachments_create"
  end
  # resource path
  local_var_path = '/document-attachments/'

  # query parameters
  query_params = {}

  # 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 = @api_client.object_to_http_body(data)
  auth_names = ['Token']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'DocumentAttachment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DocumentAttachmentsApi#document_attachments_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#document_attachments_list(opts = {}) ⇒ InlineResponse2001

Retrieve a list of Document Attachments

Parameters:

  • (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :document__uuid (String)
  • :document__external_id (String)
  • :created (String)
  • :page (Integer)

    A page number within the paginated result set.

  • :limit (Integer)

    Number of results to return per page.

Returns:



85
86
87
88
# File 'lib/signrequest_client/api/document_attachments_api.rb', line 85

def document_attachments_list(opts = {})
  data, _status_code, _headers = document_attachments_list_with_http_info(opts)
  data
end

#document_attachments_list_with_http_info(opts = {}) ⇒ Array<(InlineResponse2001, Fixnum, Hash)>

Retrieve a list of Document Attachments

Parameters:

  • (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :document__uuid (String)
  • :document__external_id (String)
  • :created (String)
  • :page (Integer)

    A page number within the paginated result set.

  • :limit (Integer)

    Number of results to return per page.

Returns:

  • InlineResponse2001 data, response status code and response headers



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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/signrequest_client/api/document_attachments_api.rb', line 99

def document_attachments_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DocumentAttachmentsApi.document_attachments_list ...'
  end
  # resource path
  local_var_path = '/document-attachments/'

  # query parameters
  query_params = {}
  query_params[:'document__uuid'] = opts[:'document__uuid'] if !opts[:'document__uuid'].nil?
  query_params[:'document__external_id'] = opts[:'document__external_id'] if !opts[:'document__external_id'].nil?
  query_params[:'created'] = opts[:'created'] if !opts[:'created'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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 = ['Token']
  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 => 'InlineResponse2001')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DocumentAttachmentsApi#document_attachments_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#document_attachments_read(uuid, opts = {}) ⇒ DocumentAttachment

Retrieve a Document Attachment

Parameters:

  • (defaults to: {})

    the optional parameters

Returns:



144
145
146
147
# File 'lib/signrequest_client/api/document_attachments_api.rb', line 144

def document_attachments_read(uuid, opts = {})
  data, _status_code, _headers = document_attachments_read_with_http_info(uuid, opts)
  data
end

#document_attachments_read_with_http_info(uuid, opts = {}) ⇒ Array<(DocumentAttachment, Fixnum, Hash)>

Retrieve a Document Attachment

Parameters:

  • (defaults to: {})

    the optional parameters

Returns:

  • DocumentAttachment data, response status code and response headers



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
191
192
# File 'lib/signrequest_client/api/document_attachments_api.rb', line 154

def document_attachments_read_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DocumentAttachmentsApi.document_attachments_read ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling DocumentAttachmentsApi.document_attachments_read"
  end
  # resource path
  local_var_path = '/document-attachments/{uuid}/'.sub('{' + 'uuid' + '}', uuid.to_s)

  # query parameters
  query_params = {}

  # 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 = ['Token']
  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 => 'DocumentAttachment')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DocumentAttachmentsApi#document_attachments_read\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end