class CrelateClient::NotesApi
Attributes
Public Class Methods
# File lib/crelate_client/api/notes_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
delete a note
@param note_id identifier @param api_key crelate api key @param [Hash] opts the optional parameters @return [Object]
# 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
delete a note
@param note_id identifier @param api_key crelate api key @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# 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
retrieve a note
@param note_id identifier @param api_key crelate api key @param [Hash] opts the optional parameters @return [PublicApiGetNoteResponse]
# 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
retrieve a note
@param note_id identifier @param api_key crelate api key @param [Hash] opts the optional parameters @return [Array<(PublicApiGetNoteResponse
, Fixnum, Hash)>] PublicApiGetNoteResponse
data, response status code and response headers
# 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
create a note
@param api_key crelate api key @param request @param [Hash] opts the optional parameters @return [PublicApiIdResponse]
# 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
create a note
@param api_key crelate api key @param request @param [Hash] opts the optional parameters @return [Array<(PublicApiIdResponse
, Fixnum, Hash)>] PublicApiIdResponse
data, response status code and response headers
# 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
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. @param note_id identifier @param api_key crelate api key @param request @param [Hash] opts the optional parameters @return [Object]
# 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
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. @param note_id identifier @param api_key crelate api key @param request @param [Hash] opts the optional parameters @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers
# 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