ddr_client 2.0.0.d9f2bd2b

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +168 -0
  4. data/Rakefile +8 -0
  5. data/ddr_client.gemspec +46 -0
  6. data/docs/BatchObjectsApi.md +125 -0
  7. data/docs/BatchesApi.md +305 -0
  8. data/docs/DdrAPIBatchEntity.md +24 -0
  9. data/docs/DdrAPIBatchEntityLogfile.md +11 -0
  10. data/docs/DdrAPIBatchObjectAttributeEntity.md +16 -0
  11. data/docs/DdrAPIBatchObjectDatastreamEntity.md +17 -0
  12. data/docs/DdrAPIBatchObjectEntity.md +26 -0
  13. data/docs/DdrAPIBatchObjectMessageEntity.md +13 -0
  14. data/docs/DdrAPIBatchObjectRelationshipEntity.md +15 -0
  15. data/docs/DdrAPIBatchObjectRoleEntity.md +15 -0
  16. data/docs/DdrAPIEventEntity.md +17 -0
  17. data/docs/DdrAPIFileEntity.md +11 -0
  18. data/docs/DdrAPIGroupEntity.md +10 -0
  19. data/docs/DdrAPIGroupMemberEntity.md +10 -0
  20. data/docs/DdrAPILinkEntity.md +9 -0
  21. data/docs/DdrAPIResourceEntity.md +17 -0
  22. data/docs/DdrAPIResourceEntityFiles.md +17 -0
  23. data/docs/DdrAPIResourceEntityMetadata.md +62 -0
  24. data/docs/DdrAPIResourceEntityRelated.md +11 -0
  25. data/docs/DdrAPIRoleEntity.md +10 -0
  26. data/docs/DdrAPITechnicalMetadataEntity.md +24 -0
  27. data/docs/DdrAPIUserEntity.md +19 -0
  28. data/docs/EventsApi.md +131 -0
  29. data/docs/GroupsApi.md +63 -0
  30. data/docs/IndexApi.md +161 -0
  31. data/docs/PatchResources.md +11 -0
  32. data/docs/PatchResourcesMetadata.md +62 -0
  33. data/docs/PatchResourcesRelated.md +11 -0
  34. data/docs/PatchResourcesRoles.md +10 -0
  35. data/docs/PostResources.md +12 -0
  36. data/docs/QueuesApi.md +102 -0
  37. data/docs/ReportsApi.md +177 -0
  38. data/docs/ResourcesApi.md +1003 -0
  39. data/docs/SchemaApi.md +128 -0
  40. data/docs/UsersApi.md +131 -0
  41. data/git_push.sh +55 -0
  42. data/lib/ddr_client/api/batch_objects_api.rb +138 -0
  43. data/lib/ddr_client/api/batches_api.rb +306 -0
  44. data/lib/ddr_client/api/events_api.rb +147 -0
  45. data/lib/ddr_client/api/groups_api.rb +70 -0
  46. data/lib/ddr_client/api/index_api.rb +164 -0
  47. data/lib/ddr_client/api/queues_api.rb +109 -0
  48. data/lib/ddr_client/api/reports_api.rb +179 -0
  49. data/lib/ddr_client/api/resources_api.rb +1098 -0
  50. data/lib/ddr_client/api/schema_api.rb +152 -0
  51. data/lib/ddr_client/api/users_api.rb +141 -0
  52. data/lib/ddr_client/api_client.rb +391 -0
  53. data/lib/ddr_client/api_error.rb +38 -0
  54. data/lib/ddr_client/configuration.rb +209 -0
  55. data/lib/ddr_client/models/ddr_api_batch_entity.rb +333 -0
  56. data/lib/ddr_client/models/ddr_api_batch_entity_logfile.rb +211 -0
  57. data/lib/ddr_client/models/ddr_api_batch_object_attribute_entity.rb +256 -0
  58. data/lib/ddr_client/models/ddr_api_batch_object_datastream_entity.rb +265 -0
  59. data/lib/ddr_client/models/ddr_api_batch_object_entity.rb +349 -0
  60. data/lib/ddr_client/models/ddr_api_batch_object_message_entity.rb +230 -0
  61. data/lib/ddr_client/models/ddr_api_batch_object_relationship_entity.rb +247 -0
  62. data/lib/ddr_client/models/ddr_api_batch_object_role_entity.rb +247 -0
  63. data/lib/ddr_client/models/ddr_api_event_entity.rb +325 -0
  64. data/lib/ddr_client/models/ddr_api_file_entity.rb +215 -0
  65. data/lib/ddr_client/models/ddr_api_group_entity.rb +203 -0
  66. data/lib/ddr_client/models/ddr_api_group_member_entity.rb +202 -0
  67. data/lib/ddr_client/models/ddr_api_link_entity.rb +193 -0
  68. data/lib/ddr_client/models/ddr_api_resource_entity.rb +310 -0
  69. data/lib/ddr_client/models/ddr_api_resource_entity_files.rb +276 -0
  70. data/lib/ddr_client/models/ddr_api_resource_entity_metadata.rb +874 -0
  71. data/lib/ddr_client/models/ddr_api_resource_entity_related.rb +216 -0
  72. data/lib/ddr_client/models/ddr_api_role_entity.rb +251 -0
  73. data/lib/ddr_client/models/ddr_api_technical_metadata_entity.rb +329 -0
  74. data/lib/ddr_client/models/ddr_api_user_entity.rb +296 -0
  75. data/lib/ddr_client/models/patch_resources.rb +221 -0
  76. data/lib/ddr_client/models/patch_resources_metadata.rb +726 -0
  77. data/lib/ddr_client/models/patch_resources_related.rb +216 -0
  78. data/lib/ddr_client/models/patch_resources_roles.rb +220 -0
  79. data/lib/ddr_client/models/post_resources.rb +265 -0
  80. data/lib/ddr_client/version.rb +15 -0
  81. data/lib/ddr_client.rb +74 -0
  82. data/spec/api/batch_objects_api_spec.rb +61 -0
  83. data/spec/api/batches_api_spec.rb +100 -0
  84. data/spec/api/events_api_spec.rb +64 -0
  85. data/spec/api/groups_api_spec.rb +46 -0
  86. data/spec/api/index_api_spec.rb +67 -0
  87. data/spec/api/queues_api_spec.rb +55 -0
  88. data/spec/api/reports_api_spec.rb +70 -0
  89. data/spec/api/resources_api_spec.rb +271 -0
  90. data/spec/api/schema_api_spec.rb +65 -0
  91. data/spec/api/users_api_spec.rb +64 -0
  92. data/spec/api_client_spec.rb +243 -0
  93. data/spec/configuration_spec.rb +42 -0
  94. data/spec/models/ddr_api_batch_entity_logfile_spec.rb +59 -0
  95. data/spec/models/ddr_api_batch_entity_spec.rb +137 -0
  96. data/spec/models/ddr_api_batch_object_attribute_entity_spec.rb +89 -0
  97. data/spec/models/ddr_api_batch_object_datastream_entity_spec.rb +95 -0
  98. data/spec/models/ddr_api_batch_object_entity_spec.rb +149 -0
  99. data/spec/models/ddr_api_batch_object_message_entity_spec.rb +71 -0
  100. data/spec/models/ddr_api_batch_object_relationship_entity_spec.rb +83 -0
  101. data/spec/models/ddr_api_batch_object_role_entity_spec.rb +83 -0
  102. data/spec/models/ddr_api_event_entity_spec.rb +103 -0
  103. data/spec/models/ddr_api_file_entity_spec.rb +59 -0
  104. data/spec/models/ddr_api_group_entity_spec.rb +53 -0
  105. data/spec/models/ddr_api_group_member_entity_spec.rb +53 -0
  106. data/spec/models/ddr_api_link_entity_spec.rb +47 -0
  107. data/spec/models/ddr_api_resource_entity_files_spec.rb +95 -0
  108. data/spec/models/ddr_api_resource_entity_metadata_spec.rb +389 -0
  109. data/spec/models/ddr_api_resource_entity_related_spec.rb +59 -0
  110. data/spec/models/ddr_api_resource_entity_spec.rb +99 -0
  111. data/spec/models/ddr_api_role_entity_spec.rb +61 -0
  112. data/spec/models/ddr_api_technical_metadata_entity_spec.rb +137 -0
  113. data/spec/models/ddr_api_user_entity_spec.rb +107 -0
  114. data/spec/models/patch_resources_metadata_spec.rb +365 -0
  115. data/spec/models/patch_resources_related_spec.rb +59 -0
  116. data/spec/models/patch_resources_roles_spec.rb +53 -0
  117. data/spec/models/patch_resources_spec.rb +59 -0
  118. data/spec/models/post_resources_spec.rb +69 -0
  119. data/spec/spec_helper.rb +111 -0
  120. metadata +399 -0
@@ -0,0 +1,306 @@
1
+ =begin
2
+ #Duke Digital Repository API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.36
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module DdrClient
16
+ class BatchesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List batches
23
+ # @param [Hash] opts the optional parameters
24
+ # @option opts [String] :outcome Filter by batch processing outcome
25
+ # @option opts [Integer] :user_id Filter by user ID associated with the batch
26
+ # @option opts [String] :status Filter by batch status
27
+ # @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
28
+ # @option opts [Object] :page JSON only: Page number of results to return (default: 1)
29
+ # @return [Array<DdrAPIBatchEntity>]
30
+ def get_batches(opts = {})
31
+ data, _status_code, _headers = get_batches_with_http_info(opts)
32
+ data
33
+ end
34
+
35
+ # List batches
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :outcome Filter by batch processing outcome
38
+ # @option opts [Integer] :user_id Filter by user ID associated with the batch
39
+ # @option opts [String] :status Filter by batch status
40
+ # @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
41
+ # @option opts [Object] :page JSON only: Page number of results to return (default: 1)
42
+ # @return [Array<(Array<DdrAPIBatchEntity>, Fixnum, Hash)>] Array<DdrAPIBatchEntity> data, response status code and response headers
43
+ def get_batches_with_http_info(opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: BatchesApi.get_batches ...'
46
+ end
47
+ if @api_client.config.client_side_validation && opts[:'outcome'] && !['SUCCESS', 'FAILURE'].include?(opts[:'outcome'])
48
+ fail ArgumentError, 'invalid value for "outcome", must be one of SUCCESS, FAILURE'
49
+ end
50
+ if @api_client.config.client_side_validation && opts[:'status'] && !['READY', 'VALIDATING', 'INVALID', 'VALIDATED', 'QUEUED', 'PROCESSING', 'RUNNING', 'FINISHED', 'INTERRUPTED', 'INTERRUPTED - RESTARTABLE', 'QUEUED FOR DELETION', 'DELETING'].include?(opts[:'status'])
51
+ fail ArgumentError, 'invalid value for "status", must be one of READY, VALIDATING, INVALID, VALIDATED, QUEUED, PROCESSING, RUNNING, FINISHED, INTERRUPTED, INTERRUPTED - RESTARTABLE, QUEUED FOR DELETION, DELETING'
52
+ end
53
+ # resource path
54
+ local_var_path = '/batches'
55
+
56
+ # query parameters
57
+ query_params = {}
58
+ query_params[:'outcome'] = opts[:'outcome'] if !opts[:'outcome'].nil?
59
+ query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].nil?
60
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
61
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
62
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
63
+
64
+ # header parameters
65
+ header_params = {}
66
+ # HTTP header 'Accept' (if needed)
67
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv'])
68
+
69
+ # form parameters
70
+ form_params = {}
71
+
72
+ # http body (model)
73
+ post_body = nil
74
+ auth_names = ['oauth']
75
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
76
+ :header_params => header_params,
77
+ :query_params => query_params,
78
+ :form_params => form_params,
79
+ :body => post_body,
80
+ :auth_names => auth_names,
81
+ :return_type => 'Array<DdrAPIBatchEntity>')
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "API called: BatchesApi#get_batches\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+ # Retrieve a batch record
88
+ # @param id
89
+ # @param [Hash] opts the optional parameters
90
+ # @option opts [BOOLEAN] :batch_objects Include related batch objects (not paginated) (default to false)
91
+ # @return [DdrAPIBatchEntity]
92
+ def get_batches_id(id, opts = {})
93
+ data, _status_code, _headers = get_batches_id_with_http_info(id, opts)
94
+ data
95
+ end
96
+
97
+ # Retrieve a batch record
98
+ # @param id
99
+ # @param [Hash] opts the optional parameters
100
+ # @option opts [BOOLEAN] :batch_objects Include related batch objects (not paginated)
101
+ # @return [Array<(DdrAPIBatchEntity, Fixnum, Hash)>] DdrAPIBatchEntity data, response status code and response headers
102
+ def get_batches_id_with_http_info(id, opts = {})
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug 'Calling API: BatchesApi.get_batches_id ...'
105
+ end
106
+ # verify the required parameter 'id' is set
107
+ if @api_client.config.client_side_validation && id.nil?
108
+ fail ArgumentError, "Missing the required parameter 'id' when calling BatchesApi.get_batches_id"
109
+ end
110
+ # resource path
111
+ local_var_path = '/batches/{id}'.sub('{' + 'id' + '}', id.to_s)
112
+
113
+ # query parameters
114
+ query_params = {}
115
+ query_params[:'batch_objects'] = opts[:'batch_objects'] if !opts[:'batch_objects'].nil?
116
+
117
+ # header parameters
118
+ header_params = {}
119
+ # HTTP header 'Accept' (if needed)
120
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
121
+
122
+ # form parameters
123
+ form_params = {}
124
+
125
+ # http body (model)
126
+ post_body = nil
127
+ auth_names = ['oauth']
128
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
129
+ :header_params => header_params,
130
+ :query_params => query_params,
131
+ :form_params => form_params,
132
+ :body => post_body,
133
+ :auth_names => auth_names,
134
+ :return_type => 'DdrAPIBatchEntity')
135
+ if @api_client.config.debugging
136
+ @api_client.config.logger.debug "API called: BatchesApi#get_batches_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
137
+ end
138
+ return data, status_code, headers
139
+ end
140
+ # Retrieve the batch objects for a batch
141
+ # @param id
142
+ # @param [Hash] opts the optional parameters
143
+ # @option opts [BOOLEAN] :batch_object_details JSON only: Include related attributes, files, messages, relationships, and roles for each batch object (default to true)
144
+ # @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
145
+ # @option opts [Object] :page JSON only: Page number of results to return (default: 1)
146
+ # @return [Array<DdrAPIBatchObjectEntity>]
147
+ def get_batches_id_batch_objects(id, opts = {})
148
+ data, _status_code, _headers = get_batches_id_batch_objects_with_http_info(id, opts)
149
+ data
150
+ end
151
+
152
+ # Retrieve the batch objects for a batch
153
+ # @param id
154
+ # @param [Hash] opts the optional parameters
155
+ # @option opts [BOOLEAN] :batch_object_details JSON only: Include related attributes, files, messages, relationships, and roles for each batch object
156
+ # @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
157
+ # @option opts [Object] :page JSON only: Page number of results to return (default: 1)
158
+ # @return [Array<(Array<DdrAPIBatchObjectEntity>, Fixnum, Hash)>] Array<DdrAPIBatchObjectEntity> data, response status code and response headers
159
+ def get_batches_id_batch_objects_with_http_info(id, opts = {})
160
+ if @api_client.config.debugging
161
+ @api_client.config.logger.debug 'Calling API: BatchesApi.get_batches_id_batch_objects ...'
162
+ end
163
+ # verify the required parameter 'id' is set
164
+ if @api_client.config.client_side_validation && id.nil?
165
+ fail ArgumentError, "Missing the required parameter 'id' when calling BatchesApi.get_batches_id_batch_objects"
166
+ end
167
+ # resource path
168
+ local_var_path = '/batches/{id}/batch_objects'.sub('{' + 'id' + '}', id.to_s)
169
+
170
+ # query parameters
171
+ query_params = {}
172
+ query_params[:'batch_object_details'] = opts[:'batch_object_details'] if !opts[:'batch_object_details'].nil?
173
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
174
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
175
+
176
+ # header parameters
177
+ header_params = {}
178
+ # HTTP header 'Accept' (if needed)
179
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv'])
180
+
181
+ # form parameters
182
+ form_params = {}
183
+
184
+ # http body (model)
185
+ post_body = nil
186
+ auth_names = ['oauth']
187
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
188
+ :header_params => header_params,
189
+ :query_params => query_params,
190
+ :form_params => form_params,
191
+ :body => post_body,
192
+ :auth_names => auth_names,
193
+ :return_type => 'Array<DdrAPIBatchObjectEntity>')
194
+ if @api_client.config.debugging
195
+ @api_client.config.logger.debug "API called: BatchesApi#get_batches_id_batch_objects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
196
+ end
197
+ return data, status_code, headers
198
+ end
199
+ # Download the batch log file
200
+ # @param id
201
+ # @param [Hash] opts the optional parameters
202
+ # @return [File]
203
+ def get_batches_id_log(id, opts = {})
204
+ data, _status_code, _headers = get_batches_id_log_with_http_info(id, opts)
205
+ data
206
+ end
207
+
208
+ # Download the batch log file
209
+ # @param id
210
+ # @param [Hash] opts the optional parameters
211
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
212
+ def get_batches_id_log_with_http_info(id, opts = {})
213
+ if @api_client.config.debugging
214
+ @api_client.config.logger.debug 'Calling API: BatchesApi.get_batches_id_log ...'
215
+ end
216
+ # verify the required parameter 'id' is set
217
+ if @api_client.config.client_side_validation && id.nil?
218
+ fail ArgumentError, "Missing the required parameter 'id' when calling BatchesApi.get_batches_id_log"
219
+ end
220
+ # resource path
221
+ local_var_path = '/batches/{id}/log'.sub('{' + 'id' + '}', id.to_s)
222
+
223
+ # query parameters
224
+ query_params = {}
225
+
226
+ # header parameters
227
+ header_params = {}
228
+ # HTTP header 'Accept' (if needed)
229
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain'])
230
+
231
+ # form parameters
232
+ form_params = {}
233
+
234
+ # http body (model)
235
+ post_body = nil
236
+ auth_names = ['oauth']
237
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
238
+ :header_params => header_params,
239
+ :query_params => query_params,
240
+ :form_params => form_params,
241
+ :body => post_body,
242
+ :auth_names => auth_names,
243
+ :return_type => 'File')
244
+ if @api_client.config.debugging
245
+ @api_client.config.logger.debug "API called: BatchesApi#get_batches_id_log\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
246
+ end
247
+ return data, status_code, headers
248
+ end
249
+ # Retrieve the batch object messages for a batch
250
+ # @param id
251
+ # @param [Hash] opts the optional parameters
252
+ # @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
253
+ # @option opts [Object] :page JSON only: Page number of results to return (default: 1)
254
+ # @return [Array<DdrAPIBatchObjectMessageEntity>]
255
+ def get_batches_id_messages(id, opts = {})
256
+ data, _status_code, _headers = get_batches_id_messages_with_http_info(id, opts)
257
+ data
258
+ end
259
+
260
+ # Retrieve the batch object messages for a batch
261
+ # @param id
262
+ # @param [Hash] opts the optional parameters
263
+ # @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
264
+ # @option opts [Object] :page JSON only: Page number of results to return (default: 1)
265
+ # @return [Array<(Array<DdrAPIBatchObjectMessageEntity>, Fixnum, Hash)>] Array<DdrAPIBatchObjectMessageEntity> data, response status code and response headers
266
+ def get_batches_id_messages_with_http_info(id, opts = {})
267
+ if @api_client.config.debugging
268
+ @api_client.config.logger.debug 'Calling API: BatchesApi.get_batches_id_messages ...'
269
+ end
270
+ # verify the required parameter 'id' is set
271
+ if @api_client.config.client_side_validation && id.nil?
272
+ fail ArgumentError, "Missing the required parameter 'id' when calling BatchesApi.get_batches_id_messages"
273
+ end
274
+ # resource path
275
+ local_var_path = '/batches/{id}/messages'.sub('{' + 'id' + '}', id.to_s)
276
+
277
+ # query parameters
278
+ query_params = {}
279
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
280
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
281
+
282
+ # header parameters
283
+ header_params = {}
284
+ # HTTP header 'Accept' (if needed)
285
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv'])
286
+
287
+ # form parameters
288
+ form_params = {}
289
+
290
+ # http body (model)
291
+ post_body = nil
292
+ auth_names = ['oauth']
293
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
294
+ :header_params => header_params,
295
+ :query_params => query_params,
296
+ :form_params => form_params,
297
+ :body => post_body,
298
+ :auth_names => auth_names,
299
+ :return_type => 'Array<DdrAPIBatchObjectMessageEntity>')
300
+ if @api_client.config.debugging
301
+ @api_client.config.logger.debug "API called: BatchesApi#get_batches_id_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
302
+ end
303
+ return data, status_code, headers
304
+ end
305
+ end
306
+ end
@@ -0,0 +1,147 @@
1
+ =begin
2
+ #Duke Digital Repository API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.36
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module DdrClient
16
+ class EventsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Retrieve events
23
+ # @param [Hash] opts the optional parameters
24
+ # @option opts [String] :resource_id Filter by resource (required for XML output)
25
+ # @option opts [String] :type Filter by event type
26
+ # @option opts [String] :outcome Filter by event outcome
27
+ # @option opts [String] :operator Filter by event operator (user name or \&quot;SYSTEM\&quot;)
28
+ # @option opts [DateTime] :since Filter events occurring since a point a time
29
+ # @option opts [DateTime] :before Filter events occurring up to (before) a point in time
30
+ # @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
31
+ # @option opts [Object] :page JSON only: Page number of results to return (default: 1)
32
+ # @return [Array<DdrAPIEventEntity>]
33
+ def get_events(opts = {})
34
+ data, _status_code, _headers = get_events_with_http_info(opts)
35
+ data
36
+ end
37
+
38
+ # Retrieve events
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [String] :resource_id Filter by resource (required for XML output)
41
+ # @option opts [String] :type Filter by event type
42
+ # @option opts [String] :outcome Filter by event outcome
43
+ # @option opts [String] :operator Filter by event operator (user name or \&quot;SYSTEM\&quot;)
44
+ # @option opts [DateTime] :since Filter events occurring since a point a time
45
+ # @option opts [DateTime] :before Filter events occurring up to (before) a point in time
46
+ # @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
47
+ # @option opts [Object] :page JSON only: Page number of results to return (default: 1)
48
+ # @return [Array<(Array<DdrAPIEventEntity>, Fixnum, Hash)>] Array<DdrAPIEventEntity> data, response status code and response headers
49
+ def get_events_with_http_info(opts = {})
50
+ if @api_client.config.debugging
51
+ @api_client.config.logger.debug 'Calling API: EventsApi.get_events ...'
52
+ end
53
+ if @api_client.config.client_side_validation && opts[:'type'] && !['Creation', 'Deaccession', 'Deletion', 'FixityCheck', 'Ingestion', 'Migration', 'Update', 'Validation', 'VirusCheck'].include?(opts[:'type'])
54
+ fail ArgumentError, 'invalid value for "type", must be one of Creation, Deaccession, Deletion, FixityCheck, Ingestion, Migration, Update, Validation, VirusCheck'
55
+ end
56
+ if @api_client.config.client_side_validation && opts[:'outcome'] && !['success', 'failure'].include?(opts[:'outcome'])
57
+ fail ArgumentError, 'invalid value for "outcome", must be one of success, failure'
58
+ end
59
+ # resource path
60
+ local_var_path = '/events'
61
+
62
+ # query parameters
63
+ query_params = {}
64
+ query_params[:'resource_id'] = opts[:'resource_id'] if !opts[:'resource_id'].nil?
65
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
66
+ query_params[:'outcome'] = opts[:'outcome'] if !opts[:'outcome'].nil?
67
+ query_params[:'operator'] = opts[:'operator'] if !opts[:'operator'].nil?
68
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
69
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
70
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
71
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
72
+
73
+ # header parameters
74
+ header_params = {}
75
+ # HTTP header 'Accept' (if needed)
76
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv', 'text/xml'])
77
+
78
+ # form parameters
79
+ form_params = {}
80
+
81
+ # http body (model)
82
+ post_body = nil
83
+ auth_names = ['oauth']
84
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
85
+ :header_params => header_params,
86
+ :query_params => query_params,
87
+ :form_params => form_params,
88
+ :body => post_body,
89
+ :auth_names => auth_names,
90
+ :return_type => 'Array<DdrAPIEventEntity>')
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug "API called: EventsApi#get_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
+ end
94
+ return data, status_code, headers
95
+ end
96
+ # Retrieve event
97
+ # @param id
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [DdrAPIEventEntity]
100
+ def get_events_id(id, opts = {})
101
+ data, _status_code, _headers = get_events_id_with_http_info(id, opts)
102
+ data
103
+ end
104
+
105
+ # Retrieve event
106
+ # @param id
107
+ # @param [Hash] opts the optional parameters
108
+ # @return [Array<(DdrAPIEventEntity, Fixnum, Hash)>] DdrAPIEventEntity data, response status code and response headers
109
+ def get_events_id_with_http_info(id, opts = {})
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: EventsApi.get_events_id ...'
112
+ end
113
+ # verify the required parameter 'id' is set
114
+ if @api_client.config.client_side_validation && id.nil?
115
+ fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.get_events_id"
116
+ end
117
+ # resource path
118
+ local_var_path = '/events/{id}'.sub('{' + 'id' + '}', id.to_s)
119
+
120
+ # query parameters
121
+ query_params = {}
122
+
123
+ # header parameters
124
+ header_params = {}
125
+ # HTTP header 'Accept' (if needed)
126
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
127
+
128
+ # form parameters
129
+ form_params = {}
130
+
131
+ # http body (model)
132
+ post_body = nil
133
+ auth_names = ['oauth']
134
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
135
+ :header_params => header_params,
136
+ :query_params => query_params,
137
+ :form_params => form_params,
138
+ :body => post_body,
139
+ :auth_names => auth_names,
140
+ :return_type => 'DdrAPIEventEntity')
141
+ if @api_client.config.debugging
142
+ @api_client.config.logger.debug "API called: EventsApi#get_events_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
+ end
144
+ return data, status_code, headers
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,70 @@
1
+ =begin
2
+ #Duke Digital Repository API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.36
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module DdrClient
16
+ class GroupsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List repository groups
23
+ # @param [Hash] opts the optional parameters
24
+ # @option opts [BOOLEAN] :include_members Include members for each group (default to false)
25
+ # @return [Array<DdrAPIGroupEntity>]
26
+ def get_groups(opts = {})
27
+ data, _status_code, _headers = get_groups_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # List repository groups
32
+ # @param [Hash] opts the optional parameters
33
+ # @option opts [BOOLEAN] :include_members Include members for each group
34
+ # @return [Array<(Array<DdrAPIGroupEntity>, Fixnum, Hash)>] Array<DdrAPIGroupEntity> data, response status code and response headers
35
+ def get_groups_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: GroupsApi.get_groups ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/groups'
41
+
42
+ # query parameters
43
+ query_params = {}
44
+ query_params[:'include_members'] = opts[:'include_members'] if !opts[:'include_members'].nil?
45
+
46
+ # header parameters
47
+ header_params = {}
48
+ # HTTP header 'Accept' (if needed)
49
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
50
+
51
+ # form parameters
52
+ form_params = {}
53
+
54
+ # http body (model)
55
+ post_body = nil
56
+ auth_names = ['oauth']
57
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
58
+ :header_params => header_params,
59
+ :query_params => query_params,
60
+ :form_params => form_params,
61
+ :body => post_body,
62
+ :auth_names => auth_names,
63
+ :return_type => 'Array<DdrAPIGroupEntity>')
64
+ if @api_client.config.debugging
65
+ @api_client.config.logger.debug "API called: GroupsApi#get_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
66
+ end
67
+ return data, status_code, headers
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,164 @@
1
+ =begin
2
+ #Duke Digital Repository API
3
+
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.36
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module DdrClient
16
+ class IndexApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Delete a document
23
+ # @param id
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [nil]
26
+ def delete_index_id(id, opts = {})
27
+ delete_index_id_with_http_info(id, opts)
28
+ nil
29
+ end
30
+
31
+ # Delete a document
32
+ # @param id
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
35
+ def delete_index_id_with_http_info(id, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: IndexApi.delete_index_id ...'
38
+ end
39
+ # verify the required parameter 'id' is set
40
+ if @api_client.config.client_side_validation && id.nil?
41
+ fail ArgumentError, "Missing the required parameter 'id' when calling IndexApi.delete_index_id"
42
+ end
43
+ # resource path
44
+ local_var_path = '/index/{id}'.sub('{' + 'id' + '}', id.to_s)
45
+
46
+ # query parameters
47
+ query_params = {}
48
+
49
+ # header parameters
50
+ header_params = {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
53
+
54
+ # form parameters
55
+ form_params = {}
56
+
57
+ # http body (model)
58
+ post_body = nil
59
+ auth_names = ['oauth']
60
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
61
+ :header_params => header_params,
62
+ :query_params => query_params,
63
+ :form_params => form_params,
64
+ :body => post_body,
65
+ :auth_names => auth_names)
66
+ if @api_client.config.debugging
67
+ @api_client.config.logger.debug "API called: IndexApi#delete_index_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
68
+ end
69
+ return data, status_code, headers
70
+ end
71
+ # Retrieve a document
72
+ # @param id
73
+ # @param [Hash] opts the optional parameters
74
+ # @return [nil]
75
+ def get_index_id(id, opts = {})
76
+ get_index_id_with_http_info(id, opts)
77
+ nil
78
+ end
79
+
80
+ # Retrieve a document
81
+ # @param id
82
+ # @param [Hash] opts the optional parameters
83
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
84
+ def get_index_id_with_http_info(id, opts = {})
85
+ if @api_client.config.debugging
86
+ @api_client.config.logger.debug 'Calling API: IndexApi.get_index_id ...'
87
+ end
88
+ # verify the required parameter 'id' is set
89
+ if @api_client.config.client_side_validation && id.nil?
90
+ fail ArgumentError, "Missing the required parameter 'id' when calling IndexApi.get_index_id"
91
+ end
92
+ # resource path
93
+ local_var_path = '/index/{id}'.sub('{' + 'id' + '}', id.to_s)
94
+
95
+ # query parameters
96
+ query_params = {}
97
+
98
+ # header parameters
99
+ header_params = {}
100
+ # HTTP header 'Accept' (if needed)
101
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
102
+
103
+ # form parameters
104
+ form_params = {}
105
+
106
+ # http body (model)
107
+ post_body = nil
108
+ auth_names = ['oauth']
109
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
110
+ :header_params => header_params,
111
+ :query_params => query_params,
112
+ :form_params => form_params,
113
+ :body => post_body,
114
+ :auth_names => auth_names)
115
+ if @api_client.config.debugging
116
+ @api_client.config.logger.debug "API called: IndexApi#get_index_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
117
+ end
118
+ return data, status_code, headers
119
+ end
120
+ # Retrieve the index schema
121
+ # @param [Hash] opts the optional parameters
122
+ # @return [nil]
123
+ def get_index_schema(opts = {})
124
+ get_index_schema_with_http_info(opts)
125
+ nil
126
+ end
127
+
128
+ # Retrieve the index schema
129
+ # @param [Hash] opts the optional parameters
130
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
131
+ def get_index_schema_with_http_info(opts = {})
132
+ if @api_client.config.debugging
133
+ @api_client.config.logger.debug 'Calling API: IndexApi.get_index_schema ...'
134
+ end
135
+ # resource path
136
+ local_var_path = '/index/schema'
137
+
138
+ # query parameters
139
+ query_params = {}
140
+
141
+ # header parameters
142
+ header_params = {}
143
+ # HTTP header 'Accept' (if needed)
144
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
145
+
146
+ # form parameters
147
+ form_params = {}
148
+
149
+ # http body (model)
150
+ post_body = nil
151
+ auth_names = ['oauth']
152
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
153
+ :header_params => header_params,
154
+ :query_params => query_params,
155
+ :form_params => form_params,
156
+ :body => post_body,
157
+ :auth_names => auth_names)
158
+ if @api_client.config.debugging
159
+ @api_client.config.logger.debug "API called: IndexApi#get_index_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
160
+ end
161
+ return data, status_code, headers
162
+ end
163
+ end
164
+ end