Class: CrelateClient::NotesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/crelate_client/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/crelate_client/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/crelate_client/api/notes_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#public_api_delete_note(note_id, api_key, opts = {}) ⇒ Object

delete a note

Parameters:

  • note_id

    identifier

  • api_key

    crelate api key

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

    the optional parameters

Returns:

  • (Object)


29
30
31
32
# File 'lib/crelate_client/api/notes_api.rb', line 29

def public_api_delete_note(note_id, api_key, opts = {})
  data, _status_code, _headers = public_api_delete_note_with_http_info(note_id, api_key, opts)
  return data
end

#public_api_delete_note_with_http_info(note_id, api_key, opts = {}) ⇒ Array<(Object, Fixnum, Hash)>

delete a note

Parameters:

  • note_id

    identifier

  • api_key

    crelate api key

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
# File 'lib/crelate_client/api/notes_api.rb', line 40

def public_api_delete_note_with_http_info(note_id, api_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: NotesApi.public_api_delete_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.public_api_delete_note"
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling NotesApi.public_api_delete_note"
  end
  # resource path
  local_var_path = "/api/pub/v1/notes/{noteId}".sub('{' + 'noteId' + '}', note_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'api_key'] = api_key

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

  # form parameters
  form_params = {}

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

#public_api_get_note(note_id, api_key, opts = {}) ⇒ PublicApiGetNoteResponse

retrieve a note

Parameters:

  • note_id

    identifier

  • api_key

    crelate api key

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

    the optional parameters

Returns:



89
90
91
92
# File 'lib/crelate_client/api/notes_api.rb', line 89

def public_api_get_note(note_id, api_key, opts = {})
  data, _status_code, _headers = public_api_get_note_with_http_info(note_id, api_key, opts)
  return data
end

#public_api_get_note_with_http_info(note_id, api_key, opts = {}) ⇒ Array<(PublicApiGetNoteResponse, Fixnum, Hash)>

retrieve a note

Parameters:

  • note_id

    identifier

  • api_key

    crelate api key

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

    the optional parameters

Returns:

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

    PublicApiGetNoteResponse data, response status code and response headers



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
139
140
141
# File 'lib/crelate_client/api/notes_api.rb', line 100

def public_api_get_note_with_http_info(note_id, api_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: NotesApi.public_api_get_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.public_api_get_note"
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling NotesApi.public_api_get_note"
  end
  # resource path
  local_var_path = "/api/pub/v1/notes/{noteId}".sub('{' + 'noteId' + '}', note_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'api_key'] = api_key

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/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 => 'PublicApiGetNoteResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotesApi#public_api_get_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#public_api_post_note(api_key, request, opts = {}) ⇒ PublicApiIdResponse

create a note

Parameters:

  • api_key

    crelate api key

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

    the optional parameters

Returns:



149
150
151
152
# File 'lib/crelate_client/api/notes_api.rb', line 149

def public_api_post_note(api_key, request, opts = {})
  data, _status_code, _headers = public_api_post_note_with_http_info(api_key, request, opts)
  return data
end

#public_api_post_note_with_http_info(api_key, request, opts = {}) ⇒ Array<(PublicApiIdResponse, Fixnum, Hash)>

create a note

Parameters:

  • api_key

    crelate api key

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

    the optional parameters

Returns:

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

    PublicApiIdResponse data, response status code and response headers



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
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/crelate_client/api/notes_api.rb', line 160

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

  # query parameters
  query_params = {}
  query_params[:'api_key'] = api_key

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(request)
  auth_names = []
  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 => 'PublicApiIdResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotesApi#public_api_post_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#public_api_put_note(note_id, api_key, request, opts = {}) ⇒ Object

update a note Replaces all fields. To partially update a note, first retrieve it using the GET method, apply changes and submit to the PUT method.

Parameters:

  • note_id

    identifier

  • api_key

    crelate api key

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

    the optional parameters

Returns:

  • (Object)


212
213
214
215
# File 'lib/crelate_client/api/notes_api.rb', line 212

def public_api_put_note(note_id, api_key, request, opts = {})
  data, _status_code, _headers = public_api_put_note_with_http_info(note_id, api_key, request, opts)
  return data
end

#public_api_put_note_with_http_info(note_id, api_key, request, opts = {}) ⇒ Array<(Object, Fixnum, Hash)>

update a note Replaces all fields. To partially update a note, first retrieve it using the GET method, apply changes and submit to the PUT method.

Parameters:

  • note_id

    identifier

  • api_key

    crelate api key

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

    the optional parameters

Returns:

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

    Object data, response status code and response headers



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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/crelate_client/api/notes_api.rb', line 224

def public_api_put_note_with_http_info(note_id, api_key, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: NotesApi.public_api_put_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.public_api_put_note"
  end
  # verify the required parameter 'api_key' is set
  if @api_client.config.client_side_validation && api_key.nil?
    fail ArgumentError, "Missing the required parameter 'api_key' when calling NotesApi.public_api_put_note"
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling NotesApi.public_api_put_note"
  end
  # resource path
  local_var_path = "/api/pub/v1/notes/{noteId}".sub('{' + 'noteId' + '}', note_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'api_key'] = api_key

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

  # form parameters
  form_params = {}

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