Class: SyncteraRubySdk::NotesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/synctera_ruby_sdk/api/notes_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ NotesApi

Returns a new instance of NotesApi.



19
20
21
# File 'lib/synctera_ruby_sdk/api/notes_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/synctera_ruby_sdk/api/notes_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_note(note_create, opts = {}) ⇒ NoteResponse

Create a note Create a note

Parameters:

  • note_create (NoteCreate)

    note to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/synctera_ruby_sdk/api/notes_api.rb', line 27

def create_note(note_create, opts = {})
  data, _status_code, _headers = create_note_with_http_info(note_create, opts)
  data
end

#create_note_with_http_info(note_create, opts = {}) ⇒ Array<(NoteResponse, Integer, Hash)>

Create a note Create a note

Parameters:

  • note_create (NoteCreate)

    note to create

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(NoteResponse, Integer, Hash)>)

    NoteResponse 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
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/synctera_ruby_sdk/api/notes_api.rb', line 37

def create_note_with_http_info(note_create, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotesApi.create_note ...'
  end
  # verify the required parameter 'note_create' is set
  if @api_client.config.client_side_validation && note_create.nil?
    fail ArgumentError, "Missing the required parameter 'note_create' when calling NotesApi.create_note"
  end
  # resource path
  local_var_path = '/notes'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(note_create)

  # return_type
  return_type = opts[:debug_return_type] || 'NoteResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"NotesApi.create_note",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotesApi#create_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_notes(opts = {}) ⇒ NoteList

List notes Get paginated list of notes

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :id (Array<String>)

    Return the note with the specified id. Multiple IDs can be provided as a comma-separated list.

  • :related_resource_id (Array<String>)

    Only return notes that have a related resource with the specified ID.

  • :related_resource_type (RelatedResourceType1)

    Only return notes that have a related resource with the specified type.

  • :author_user_id (String)
  • :tenant (String)
  • :limit (Integer) — default: default to 100
  • :page_token (String)

Returns:



101
102
103
104
# File 'lib/synctera_ruby_sdk/api/notes_api.rb', line 101

def list_notes(opts = {})
  data, _status_code, _headers = list_notes_with_http_info(opts)
  data
end

#list_notes_with_http_info(opts = {}) ⇒ Array<(NoteList, Integer, Hash)>

List notes Get paginated list of notes

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :id (Array<String>)

    Return the note with the specified id. Multiple IDs can be provided as a comma-separated list.

  • :related_resource_id (Array<String>)

    Only return notes that have a related resource with the specified ID.

  • :related_resource_type (RelatedResourceType1)

    Only return notes that have a related resource with the specified type.

  • :author_user_id (String)
  • :tenant (String)
  • :limit (Integer) — default: default to 100
  • :page_token (String)

Returns:

  • (Array<(NoteList, Integer, Hash)>)

    NoteList data, response status code and response headers



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
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
# File 'lib/synctera_ruby_sdk/api/notes_api.rb', line 117

def list_notes_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotesApi.list_notes ...'
  end
  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling NotesApi.list_notes, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/notes'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :csv) if !opts[:'id'].nil?
  query_params[:'related_resource_id'] = @api_client.build_collection_param(opts[:'related_resource_id'], :csv) if !opts[:'related_resource_id'].nil?
  query_params[:'related_resource_type'] = opts[:'related_resource_type'] if !opts[:'related_resource_type'].nil?
  query_params[:'author_user_id'] = opts[:'author_user_id'] if !opts[:'author_user_id'].nil?
  query_params[:'tenant'] = opts[:'tenant'] if !opts[:'tenant'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page_token'] = opts[:'page_token'] if !opts[:'page_token'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'NoteList'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"NotesApi.list_notes",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotesApi#list_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#patch_note(note_id, patch_note, opts = {}) ⇒ NoteResponse

Patch Note Update a Note by ID.

Parameters:

  • note_id (String)

    The unique identifier of a note

  • patch_note (PatchNote)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

  • :related_resource_type (RelatedResourceType1)

    Only return notes that have a related resource with the specified type.

Returns:



180
181
182
183
# File 'lib/synctera_ruby_sdk/api/notes_api.rb', line 180

def patch_note(note_id, patch_note, opts = {})
  data, _status_code, _headers = patch_note_with_http_info(note_id, patch_note, opts)
  data
end

#patch_note_with_http_info(note_id, patch_note, opts = {}) ⇒ Array<(NoteResponse, Integer, Hash)>

Patch Note Update a Note by ID.

Parameters:

  • note_id (String)

    The unique identifier of a note

  • patch_note (PatchNote)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    An idempotency key is an arbitrary unique value generated by client to detect subsequent retries of the same request. It is recommended that a UUID or a similar random identifier be used as an idempotency key. A different key must be used for each request, unless it is a retry.

  • :related_resource_type (RelatedResourceType1)

    Only return notes that have a related resource with the specified type.

Returns:

  • (Array<(NoteResponse, Integer, Hash)>)

    NoteResponse data, response status code and response headers



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/synctera_ruby_sdk/api/notes_api.rb', line 193

def patch_note_with_http_info(note_id, patch_note, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NotesApi.patch_note ...'
  end
  # verify the required parameter 'note_id' is set
  if @api_client.config.client_side_validation && note_id.nil?
    fail ArgumentError, "Missing the required parameter 'note_id' when calling NotesApi.patch_note"
  end
  # verify the required parameter 'patch_note' is set
  if @api_client.config.client_side_validation && patch_note.nil?
    fail ArgumentError, "Missing the required parameter 'patch_note' when calling NotesApi.patch_note"
  end
  # resource path
  local_var_path = '/notes/{note_id}'.sub('{' + 'note_id' + '}', CGI.escape(note_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'related_resource_type'] = opts[:'related_resource_type'] if !opts[:'related_resource_type'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
    header_params['Content-Type'] = content_type
  end
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_note)

  # return_type
  return_type = opts[:debug_return_type] || 'NoteResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearerAuth']

  new_options = opts.merge(
    :operation => :"NotesApi.patch_note",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotesApi#patch_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end