Class: DdrClient::EventsApi
- Inherits:
-
Object
- Object
- DdrClient::EventsApi
- Defined in:
- lib/ddr_client/api/events_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_events(opts = {}) ⇒ Array<DdrAPIEventEntity>
Retrieve events.
-
#get_events_id(id, opts = {}) ⇒ DdrAPIEventEntity
Retrieve event.
-
#get_events_id_with_http_info(id, opts = {}) ⇒ Array<(DdrAPIEventEntity, Fixnum, Hash)>
Retrieve event.
-
#get_events_with_http_info(opts = {}) ⇒ Array<(Array<DdrAPIEventEntity>, Fixnum, Hash)>
Retrieve events.
-
#initialize(api_client = ApiClient.default) ⇒ EventsApi
constructor
A new instance of EventsApi.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/ddr_client/api/events_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_events(opts = {}) ⇒ Array<DdrAPIEventEntity>
Retrieve events
33 34 35 36 |
# File 'lib/ddr_client/api/events_api.rb', line 33 def get_events(opts = {}) data, _status_code, _headers = get_events_with_http_info(opts) data end |
#get_events_id(id, opts = {}) ⇒ DdrAPIEventEntity
Retrieve event
100 101 102 103 |
# File 'lib/ddr_client/api/events_api.rb', line 100 def get_events_id(id, opts = {}) data, _status_code, _headers = get_events_id_with_http_info(id, opts) data end |
#get_events_id_with_http_info(id, opts = {}) ⇒ Array<(DdrAPIEventEntity, Fixnum, Hash)>
Retrieve event
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 142 143 144 145 |
# File 'lib/ddr_client/api/events_api.rb', line 109 def get_events_id_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventsApi.get_events_id ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.get_events_id" end # resource path local_var_path = '/events/{id}'.sub('{' + 'id' + '}', id.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', 'text/xml']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth'] 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 => 'DdrAPIEventEntity') if @api_client.config.debugging @api_client.config.logger.debug "API called: EventsApi#get_events_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_events_with_http_info(opts = {}) ⇒ Array<(Array<DdrAPIEventEntity>, Fixnum, Hash)>
Retrieve events
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 89 90 91 92 93 94 95 |
# File 'lib/ddr_client/api/events_api.rb', line 49 def get_events_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventsApi.get_events ...' end if @api_client.config.client_side_validation && opts[:'type'] && !['Creation', 'Deaccession', 'Deletion', 'FixityCheck', 'Ingestion', 'Migration', 'Update', 'Validation', 'VirusCheck'].include?(opts[:'type']) fail ArgumentError, 'invalid value for "type", must be one of Creation, Deaccession, Deletion, FixityCheck, Ingestion, Migration, Update, Validation, VirusCheck' end if @api_client.config.client_side_validation && opts[:'outcome'] && !['success', 'failure'].include?(opts[:'outcome']) fail ArgumentError, 'invalid value for "outcome", must be one of success, failure' end # resource path local_var_path = '/events' # query parameters query_params = {} query_params[:'resource_id'] = opts[:'resource_id'] if !opts[:'resource_id'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'outcome'] = opts[:'outcome'] if !opts[:'outcome'].nil? query_params[:'operator'] = opts[:'operator'] if !opts[:'operator'].nil? query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil? query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil? query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'text/xml']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth'] 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 => 'Array<DdrAPIEventEntity>') if @api_client.config.debugging @api_client.config.logger.debug "API called: EventsApi#get_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |