ddr_client 2.0.0.d9f2bd2b
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +168 -0
- data/Rakefile +8 -0
- data/ddr_client.gemspec +46 -0
- data/docs/BatchObjectsApi.md +125 -0
- data/docs/BatchesApi.md +305 -0
- data/docs/DdrAPIBatchEntity.md +24 -0
- data/docs/DdrAPIBatchEntityLogfile.md +11 -0
- data/docs/DdrAPIBatchObjectAttributeEntity.md +16 -0
- data/docs/DdrAPIBatchObjectDatastreamEntity.md +17 -0
- data/docs/DdrAPIBatchObjectEntity.md +26 -0
- data/docs/DdrAPIBatchObjectMessageEntity.md +13 -0
- data/docs/DdrAPIBatchObjectRelationshipEntity.md +15 -0
- data/docs/DdrAPIBatchObjectRoleEntity.md +15 -0
- data/docs/DdrAPIEventEntity.md +17 -0
- data/docs/DdrAPIFileEntity.md +11 -0
- data/docs/DdrAPIGroupEntity.md +10 -0
- data/docs/DdrAPIGroupMemberEntity.md +10 -0
- data/docs/DdrAPILinkEntity.md +9 -0
- data/docs/DdrAPIResourceEntity.md +17 -0
- data/docs/DdrAPIResourceEntityFiles.md +17 -0
- data/docs/DdrAPIResourceEntityMetadata.md +62 -0
- data/docs/DdrAPIResourceEntityRelated.md +11 -0
- data/docs/DdrAPIRoleEntity.md +10 -0
- data/docs/DdrAPITechnicalMetadataEntity.md +24 -0
- data/docs/DdrAPIUserEntity.md +19 -0
- data/docs/EventsApi.md +131 -0
- data/docs/GroupsApi.md +63 -0
- data/docs/IndexApi.md +161 -0
- data/docs/PatchResources.md +11 -0
- data/docs/PatchResourcesMetadata.md +62 -0
- data/docs/PatchResourcesRelated.md +11 -0
- data/docs/PatchResourcesRoles.md +10 -0
- data/docs/PostResources.md +12 -0
- data/docs/QueuesApi.md +102 -0
- data/docs/ReportsApi.md +177 -0
- data/docs/ResourcesApi.md +1003 -0
- data/docs/SchemaApi.md +128 -0
- data/docs/UsersApi.md +131 -0
- data/git_push.sh +55 -0
- data/lib/ddr_client/api/batch_objects_api.rb +138 -0
- data/lib/ddr_client/api/batches_api.rb +306 -0
- data/lib/ddr_client/api/events_api.rb +147 -0
- data/lib/ddr_client/api/groups_api.rb +70 -0
- data/lib/ddr_client/api/index_api.rb +164 -0
- data/lib/ddr_client/api/queues_api.rb +109 -0
- data/lib/ddr_client/api/reports_api.rb +179 -0
- data/lib/ddr_client/api/resources_api.rb +1098 -0
- data/lib/ddr_client/api/schema_api.rb +152 -0
- data/lib/ddr_client/api/users_api.rb +141 -0
- data/lib/ddr_client/api_client.rb +391 -0
- data/lib/ddr_client/api_error.rb +38 -0
- data/lib/ddr_client/configuration.rb +209 -0
- data/lib/ddr_client/models/ddr_api_batch_entity.rb +333 -0
- data/lib/ddr_client/models/ddr_api_batch_entity_logfile.rb +211 -0
- data/lib/ddr_client/models/ddr_api_batch_object_attribute_entity.rb +256 -0
- data/lib/ddr_client/models/ddr_api_batch_object_datastream_entity.rb +265 -0
- data/lib/ddr_client/models/ddr_api_batch_object_entity.rb +349 -0
- data/lib/ddr_client/models/ddr_api_batch_object_message_entity.rb +230 -0
- data/lib/ddr_client/models/ddr_api_batch_object_relationship_entity.rb +247 -0
- data/lib/ddr_client/models/ddr_api_batch_object_role_entity.rb +247 -0
- data/lib/ddr_client/models/ddr_api_event_entity.rb +325 -0
- data/lib/ddr_client/models/ddr_api_file_entity.rb +215 -0
- data/lib/ddr_client/models/ddr_api_group_entity.rb +203 -0
- data/lib/ddr_client/models/ddr_api_group_member_entity.rb +202 -0
- data/lib/ddr_client/models/ddr_api_link_entity.rb +193 -0
- data/lib/ddr_client/models/ddr_api_resource_entity.rb +310 -0
- data/lib/ddr_client/models/ddr_api_resource_entity_files.rb +276 -0
- data/lib/ddr_client/models/ddr_api_resource_entity_metadata.rb +874 -0
- data/lib/ddr_client/models/ddr_api_resource_entity_related.rb +216 -0
- data/lib/ddr_client/models/ddr_api_role_entity.rb +251 -0
- data/lib/ddr_client/models/ddr_api_technical_metadata_entity.rb +329 -0
- data/lib/ddr_client/models/ddr_api_user_entity.rb +296 -0
- data/lib/ddr_client/models/patch_resources.rb +221 -0
- data/lib/ddr_client/models/patch_resources_metadata.rb +726 -0
- data/lib/ddr_client/models/patch_resources_related.rb +216 -0
- data/lib/ddr_client/models/patch_resources_roles.rb +220 -0
- data/lib/ddr_client/models/post_resources.rb +265 -0
- data/lib/ddr_client/version.rb +15 -0
- data/lib/ddr_client.rb +74 -0
- data/spec/api/batch_objects_api_spec.rb +61 -0
- data/spec/api/batches_api_spec.rb +100 -0
- data/spec/api/events_api_spec.rb +64 -0
- data/spec/api/groups_api_spec.rb +46 -0
- data/spec/api/index_api_spec.rb +67 -0
- data/spec/api/queues_api_spec.rb +55 -0
- data/spec/api/reports_api_spec.rb +70 -0
- data/spec/api/resources_api_spec.rb +271 -0
- data/spec/api/schema_api_spec.rb +65 -0
- data/spec/api/users_api_spec.rb +64 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/ddr_api_batch_entity_logfile_spec.rb +59 -0
- data/spec/models/ddr_api_batch_entity_spec.rb +137 -0
- data/spec/models/ddr_api_batch_object_attribute_entity_spec.rb +89 -0
- data/spec/models/ddr_api_batch_object_datastream_entity_spec.rb +95 -0
- data/spec/models/ddr_api_batch_object_entity_spec.rb +149 -0
- data/spec/models/ddr_api_batch_object_message_entity_spec.rb +71 -0
- data/spec/models/ddr_api_batch_object_relationship_entity_spec.rb +83 -0
- data/spec/models/ddr_api_batch_object_role_entity_spec.rb +83 -0
- data/spec/models/ddr_api_event_entity_spec.rb +103 -0
- data/spec/models/ddr_api_file_entity_spec.rb +59 -0
- data/spec/models/ddr_api_group_entity_spec.rb +53 -0
- data/spec/models/ddr_api_group_member_entity_spec.rb +53 -0
- data/spec/models/ddr_api_link_entity_spec.rb +47 -0
- data/spec/models/ddr_api_resource_entity_files_spec.rb +95 -0
- data/spec/models/ddr_api_resource_entity_metadata_spec.rb +389 -0
- data/spec/models/ddr_api_resource_entity_related_spec.rb +59 -0
- data/spec/models/ddr_api_resource_entity_spec.rb +99 -0
- data/spec/models/ddr_api_role_entity_spec.rb +61 -0
- data/spec/models/ddr_api_technical_metadata_entity_spec.rb +137 -0
- data/spec/models/ddr_api_user_entity_spec.rb +107 -0
- data/spec/models/patch_resources_metadata_spec.rb +365 -0
- data/spec/models/patch_resources_related_spec.rb +59 -0
- data/spec/models/patch_resources_roles_spec.rb +53 -0
- data/spec/models/patch_resources_spec.rb +59 -0
- data/spec/models/post_resources_spec.rb +69 -0
- data/spec/spec_helper.rb +111 -0
- metadata +399 -0
@@ -0,0 +1,1098 @@
|
|
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 ResourcesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Filter resources
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @option opts [String] :admin_set Limit to selected admin set
|
25
|
+
# @option opts [String] :original_filename Match by original file name
|
26
|
+
# @option opts [Array<String>] :sha1 Match by original file SHA1 digest
|
27
|
+
# @option opts [Array<String>] :model Limit to selected model type(s)
|
28
|
+
# @option opts [String] :workflow_state Filter by workflow state
|
29
|
+
# @option opts [DateTime] :modified_before Limit results to resources created or modified before a date/time
|
30
|
+
# @option opts [DateTime] :modified_since Limit results to resources created or modified since a date/time
|
31
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
32
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
33
|
+
# @option opts [Array<String>] :csv_fields CSV only: Include additional columns
|
34
|
+
# @option opts [Array<String>] :file_fields CSV only: Include file columns (row values: 'present', 'absent', or 'n/a')
|
35
|
+
# @option opts [BOOLEAN] :remove_empty_columns CSV only: Remove empty columns from CSV output table (default to false)
|
36
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
37
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
38
|
+
# @return [Array<DdrAPIResourceEntity>]
|
39
|
+
def get_resources(opts = {})
|
40
|
+
data, _status_code, _headers = get_resources_with_http_info(opts)
|
41
|
+
data
|
42
|
+
end
|
43
|
+
|
44
|
+
# Filter resources
|
45
|
+
# @param [Hash] opts the optional parameters
|
46
|
+
# @option opts [String] :admin_set Limit to selected admin set
|
47
|
+
# @option opts [String] :original_filename Match by original file name
|
48
|
+
# @option opts [Array<String>] :sha1 Match by original file SHA1 digest
|
49
|
+
# @option opts [Array<String>] :model Limit to selected model type(s)
|
50
|
+
# @option opts [String] :workflow_state Filter by workflow state
|
51
|
+
# @option opts [DateTime] :modified_before Limit results to resources created or modified before a date/time
|
52
|
+
# @option opts [DateTime] :modified_since Limit results to resources created or modified since a date/time
|
53
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
54
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
55
|
+
# @option opts [Array<String>] :csv_fields CSV only: Include additional columns
|
56
|
+
# @option opts [Array<String>] :file_fields CSV only: Include file columns (row values: 'present', 'absent', or 'n/a')
|
57
|
+
# @option opts [BOOLEAN] :remove_empty_columns CSV only: Remove empty columns from CSV output table
|
58
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
59
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
60
|
+
# @return [Array<(Array<DdrAPIResourceEntity>, Fixnum, Hash)>] Array<DdrAPIResourceEntity> data, response status code and response headers
|
61
|
+
def get_resources_with_http_info(opts = {})
|
62
|
+
if @api_client.config.debugging
|
63
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources ...'
|
64
|
+
end
|
65
|
+
if @api_client.config.client_side_validation && opts[:'admin_set'] && !['DUL Collections', 'Data and Visualization Services', 'Digital Collections', 'Duke Research Data', 'Duke Scholarship', 'Duke University School of Nursing Digital Archive', 'Electronic Books', 'NESCent: National Evolutionary Synthesis Center', 'Rubenstein Library'].include?(opts[:'admin_set'])
|
66
|
+
fail ArgumentError, 'invalid value for "admin_set", must be one of DUL Collections, Data and Visualization Services, Digital Collections, Duke Research Data, Duke Scholarship, Duke University School of Nursing Digital Archive, Electronic Books, NESCent: National Evolutionary Synthesis Center, Rubenstein Library'
|
67
|
+
end
|
68
|
+
if @api_client.config.client_side_validation && opts[:'model'] && !opts[:'model'].all? { |item| ['Collection', 'Item', 'Component', 'Target', 'Attachment'].include?(item) }
|
69
|
+
fail ArgumentError, 'invalid value for "model", must include one of Collection, Item, Component, Target, Attachment'
|
70
|
+
end
|
71
|
+
if @api_client.config.client_side_validation && opts[:'workflow_state'] && !['published', 'unpublished', 'nonpublishable'].include?(opts[:'workflow_state'])
|
72
|
+
fail ArgumentError, 'invalid value for "workflow_state", must be one of published, unpublished, nonpublishable'
|
73
|
+
end
|
74
|
+
if @api_client.config.client_side_validation && opts[:'fields'] && !opts[:'fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
75
|
+
fail ArgumentError, 'invalid value for "fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
76
|
+
end
|
77
|
+
if @api_client.config.client_side_validation && opts[:'exclude_fields'] && !opts[:'exclude_fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
78
|
+
fail ArgumentError, 'invalid value for "exclude_fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
79
|
+
end
|
80
|
+
if @api_client.config.client_side_validation && opts[:'csv_fields'] && !opts[:'csv_fields'].all? { |item| ['original_filename', 'sha1', 'collection_title', 'collection_id', 'parent_title', 'parent_id'].include?(item) }
|
81
|
+
fail ArgumentError, 'invalid value for "csv_fields", must include one of original_filename, sha1, collection_title, collection_id, parent_title, parent_id'
|
82
|
+
end
|
83
|
+
if @api_client.config.client_side_validation && opts[:'file_fields'] && !opts[:'file_fields'].all? { |item| ['caption', 'content', 'derived_image', 'extracted_text', 'fits_file', 'intermediate_file', 'multires_image', 'streamable_media', 'struct_metadata', 'thumbnail'].include?(item) }
|
84
|
+
fail ArgumentError, 'invalid value for "file_fields", must include one of caption, content, derived_image, extracted_text, fits_file, intermediate_file, multires_image, streamable_media, struct_metadata, thumbnail'
|
85
|
+
end
|
86
|
+
# resource path
|
87
|
+
local_var_path = '/resources'
|
88
|
+
|
89
|
+
# query parameters
|
90
|
+
query_params = {}
|
91
|
+
query_params[:'admin_set'] = opts[:'admin_set'] if !opts[:'admin_set'].nil?
|
92
|
+
query_params[:'original_filename'] = opts[:'original_filename'] if !opts[:'original_filename'].nil?
|
93
|
+
query_params[:'sha1'] = @api_client.build_collection_param(opts[:'sha1'], :csv) if !opts[:'sha1'].nil?
|
94
|
+
query_params[:'model'] = @api_client.build_collection_param(opts[:'model'], :csv) if !opts[:'model'].nil?
|
95
|
+
query_params[:'workflow_state'] = opts[:'workflow_state'] if !opts[:'workflow_state'].nil?
|
96
|
+
query_params[:'modified_before'] = opts[:'modified_before'] if !opts[:'modified_before'].nil?
|
97
|
+
query_params[:'modified_since'] = opts[:'modified_since'] if !opts[:'modified_since'].nil?
|
98
|
+
query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
|
99
|
+
query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
|
100
|
+
query_params[:'csv_fields'] = @api_client.build_collection_param(opts[:'csv_fields'], :csv) if !opts[:'csv_fields'].nil?
|
101
|
+
query_params[:'file_fields'] = @api_client.build_collection_param(opts[:'file_fields'], :csv) if !opts[:'file_fields'].nil?
|
102
|
+
query_params[:'remove_empty_columns'] = opts[:'remove_empty_columns'] if !opts[:'remove_empty_columns'].nil?
|
103
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
104
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
105
|
+
|
106
|
+
# header parameters
|
107
|
+
header_params = {}
|
108
|
+
# HTTP header 'Accept' (if needed)
|
109
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv'])
|
110
|
+
|
111
|
+
# form parameters
|
112
|
+
form_params = {}
|
113
|
+
|
114
|
+
# http body (model)
|
115
|
+
post_body = nil
|
116
|
+
auth_names = ['oauth']
|
117
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
118
|
+
:header_params => header_params,
|
119
|
+
:query_params => query_params,
|
120
|
+
:form_params => form_params,
|
121
|
+
:body => post_body,
|
122
|
+
:auth_names => auth_names,
|
123
|
+
:return_type => 'Array<DdrAPIResourceEntity>')
|
124
|
+
if @api_client.config.debugging
|
125
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
126
|
+
end
|
127
|
+
return data, status_code, headers
|
128
|
+
end
|
129
|
+
# Find resources by role
|
130
|
+
# @param [Hash] opts the optional parameters
|
131
|
+
# @option opts [String] :agent Person or group to whom access is granted
|
132
|
+
# @option opts [String] :role_type Type of access granted
|
133
|
+
# @option opts [String] :scope Scope of the access granted
|
134
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
135
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
136
|
+
# @option opts [Array<String>] :csv_fields CSV only: Include additional columns
|
137
|
+
# @option opts [Array<String>] :file_fields CSV only: Include file columns (row values: 'present', 'absent', or 'n/a')
|
138
|
+
# @option opts [BOOLEAN] :remove_empty_columns CSV only: Remove empty columns from CSV output table (default to false)
|
139
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
140
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
141
|
+
# @return [Array<DdrAPIResourceEntity>]
|
142
|
+
def get_resources_by_role(opts = {})
|
143
|
+
data, _status_code, _headers = get_resources_by_role_with_http_info(opts)
|
144
|
+
data
|
145
|
+
end
|
146
|
+
|
147
|
+
# Find resources by role
|
148
|
+
# @param [Hash] opts the optional parameters
|
149
|
+
# @option opts [String] :agent Person or group to whom access is granted
|
150
|
+
# @option opts [String] :role_type Type of access granted
|
151
|
+
# @option opts [String] :scope Scope of the access granted
|
152
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
153
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
154
|
+
# @option opts [Array<String>] :csv_fields CSV only: Include additional columns
|
155
|
+
# @option opts [Array<String>] :file_fields CSV only: Include file columns (row values: 'present', 'absent', or 'n/a')
|
156
|
+
# @option opts [BOOLEAN] :remove_empty_columns CSV only: Remove empty columns from CSV output table
|
157
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
158
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
159
|
+
# @return [Array<(Array<DdrAPIResourceEntity>, Fixnum, Hash)>] Array<DdrAPIResourceEntity> data, response status code and response headers
|
160
|
+
def get_resources_by_role_with_http_info(opts = {})
|
161
|
+
if @api_client.config.debugging
|
162
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_by_role ...'
|
163
|
+
end
|
164
|
+
if @api_client.config.client_side_validation && opts[:'role_type'] && !['Curator', 'Editor', 'MetadataEditor', 'Downloader', 'Viewer', 'MetadataViewer'].include?(opts[:'role_type'])
|
165
|
+
fail ArgumentError, 'invalid value for "role_type", must be one of Curator, Editor, MetadataEditor, Downloader, Viewer, MetadataViewer'
|
166
|
+
end
|
167
|
+
if @api_client.config.client_side_validation && opts[:'scope'] && !['resource', 'policy'].include?(opts[:'scope'])
|
168
|
+
fail ArgumentError, 'invalid value for "scope", must be one of resource, policy'
|
169
|
+
end
|
170
|
+
if @api_client.config.client_side_validation && opts[:'fields'] && !opts[:'fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
171
|
+
fail ArgumentError, 'invalid value for "fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
172
|
+
end
|
173
|
+
if @api_client.config.client_side_validation && opts[:'exclude_fields'] && !opts[:'exclude_fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
174
|
+
fail ArgumentError, 'invalid value for "exclude_fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
175
|
+
end
|
176
|
+
if @api_client.config.client_side_validation && opts[:'csv_fields'] && !opts[:'csv_fields'].all? { |item| ['original_filename', 'sha1', 'collection_title', 'collection_id', 'parent_title', 'parent_id'].include?(item) }
|
177
|
+
fail ArgumentError, 'invalid value for "csv_fields", must include one of original_filename, sha1, collection_title, collection_id, parent_title, parent_id'
|
178
|
+
end
|
179
|
+
if @api_client.config.client_side_validation && opts[:'file_fields'] && !opts[:'file_fields'].all? { |item| ['caption', 'content', 'derived_image', 'extracted_text', 'fits_file', 'intermediate_file', 'multires_image', 'streamable_media', 'struct_metadata', 'thumbnail'].include?(item) }
|
180
|
+
fail ArgumentError, 'invalid value for "file_fields", must include one of caption, content, derived_image, extracted_text, fits_file, intermediate_file, multires_image, streamable_media, struct_metadata, thumbnail'
|
181
|
+
end
|
182
|
+
# resource path
|
183
|
+
local_var_path = '/resources/by_role'
|
184
|
+
|
185
|
+
# query parameters
|
186
|
+
query_params = {}
|
187
|
+
query_params[:'agent'] = opts[:'agent'] if !opts[:'agent'].nil?
|
188
|
+
query_params[:'role_type'] = opts[:'role_type'] if !opts[:'role_type'].nil?
|
189
|
+
query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
|
190
|
+
query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
|
191
|
+
query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
|
192
|
+
query_params[:'csv_fields'] = @api_client.build_collection_param(opts[:'csv_fields'], :csv) if !opts[:'csv_fields'].nil?
|
193
|
+
query_params[:'file_fields'] = @api_client.build_collection_param(opts[:'file_fields'], :csv) if !opts[:'file_fields'].nil?
|
194
|
+
query_params[:'remove_empty_columns'] = opts[:'remove_empty_columns'] if !opts[:'remove_empty_columns'].nil?
|
195
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
196
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
197
|
+
|
198
|
+
# header parameters
|
199
|
+
header_params = {}
|
200
|
+
# HTTP header 'Accept' (if needed)
|
201
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv'])
|
202
|
+
|
203
|
+
# form parameters
|
204
|
+
form_params = {}
|
205
|
+
|
206
|
+
# http body (model)
|
207
|
+
post_body = nil
|
208
|
+
auth_names = ['oauth']
|
209
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
210
|
+
:header_params => header_params,
|
211
|
+
:query_params => query_params,
|
212
|
+
:form_params => form_params,
|
213
|
+
:body => post_body,
|
214
|
+
:auth_names => auth_names,
|
215
|
+
:return_type => 'Array<DdrAPIResourceEntity>')
|
216
|
+
if @api_client.config.debugging
|
217
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_by_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
218
|
+
end
|
219
|
+
return data, status_code, headers
|
220
|
+
end
|
221
|
+
# Retrieve a resource
|
222
|
+
# @param id
|
223
|
+
# @param [Hash] opts the optional parameters
|
224
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
225
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
226
|
+
# @return [DdrAPIResourceEntity]
|
227
|
+
def get_resources_id(id, opts = {})
|
228
|
+
data, _status_code, _headers = get_resources_id_with_http_info(id, opts)
|
229
|
+
data
|
230
|
+
end
|
231
|
+
|
232
|
+
# Retrieve a resource
|
233
|
+
# @param id
|
234
|
+
# @param [Hash] opts the optional parameters
|
235
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
236
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
237
|
+
# @return [Array<(DdrAPIResourceEntity, Fixnum, Hash)>] DdrAPIResourceEntity data, response status code and response headers
|
238
|
+
def get_resources_id_with_http_info(id, opts = {})
|
239
|
+
if @api_client.config.debugging
|
240
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_id ...'
|
241
|
+
end
|
242
|
+
# verify the required parameter 'id' is set
|
243
|
+
if @api_client.config.client_side_validation && id.nil?
|
244
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.get_resources_id"
|
245
|
+
end
|
246
|
+
if @api_client.config.client_side_validation && opts[:'fields'] && !opts[:'fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
247
|
+
fail ArgumentError, 'invalid value for "fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
248
|
+
end
|
249
|
+
if @api_client.config.client_side_validation && opts[:'exclude_fields'] && !opts[:'exclude_fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
250
|
+
fail ArgumentError, 'invalid value for "exclude_fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
251
|
+
end
|
252
|
+
# resource path
|
253
|
+
local_var_path = '/resources/{id}'.sub('{' + 'id' + '}', id.to_s)
|
254
|
+
|
255
|
+
# query parameters
|
256
|
+
query_params = {}
|
257
|
+
query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
|
258
|
+
query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
|
259
|
+
|
260
|
+
# header parameters
|
261
|
+
header_params = {}
|
262
|
+
# HTTP header 'Accept' (if needed)
|
263
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
264
|
+
|
265
|
+
# form parameters
|
266
|
+
form_params = {}
|
267
|
+
|
268
|
+
# http body (model)
|
269
|
+
post_body = nil
|
270
|
+
auth_names = ['oauth']
|
271
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
272
|
+
:header_params => header_params,
|
273
|
+
:query_params => query_params,
|
274
|
+
:form_params => form_params,
|
275
|
+
:body => post_body,
|
276
|
+
:auth_names => auth_names,
|
277
|
+
:return_type => 'DdrAPIResourceEntity')
|
278
|
+
if @api_client.config.debugging
|
279
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
280
|
+
end
|
281
|
+
return data, status_code, headers
|
282
|
+
end
|
283
|
+
# Get attachments to a Collection
|
284
|
+
# @param id
|
285
|
+
# @param [Hash] opts the optional parameters
|
286
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
287
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
288
|
+
# @option opts [Array<String>] :csv_fields CSV only: Include additional columns
|
289
|
+
# @option opts [Array<String>] :file_fields CSV only: Include file columns (row values: 'present', 'absent', or 'n/a')
|
290
|
+
# @option opts [BOOLEAN] :remove_empty_columns CSV only: Remove empty columns from CSV output table (default to false)
|
291
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
292
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
293
|
+
# @return [Array<DdrAPIResourceEntity>]
|
294
|
+
def get_resources_id_attachments(id, opts = {})
|
295
|
+
data, _status_code, _headers = get_resources_id_attachments_with_http_info(id, opts)
|
296
|
+
data
|
297
|
+
end
|
298
|
+
|
299
|
+
# Get attachments to a Collection
|
300
|
+
# @param id
|
301
|
+
# @param [Hash] opts the optional parameters
|
302
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
303
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
304
|
+
# @option opts [Array<String>] :csv_fields CSV only: Include additional columns
|
305
|
+
# @option opts [Array<String>] :file_fields CSV only: Include file columns (row values: 'present', 'absent', or 'n/a')
|
306
|
+
# @option opts [BOOLEAN] :remove_empty_columns CSV only: Remove empty columns from CSV output table
|
307
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
308
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
309
|
+
# @return [Array<(Array<DdrAPIResourceEntity>, Fixnum, Hash)>] Array<DdrAPIResourceEntity> data, response status code and response headers
|
310
|
+
def get_resources_id_attachments_with_http_info(id, opts = {})
|
311
|
+
if @api_client.config.debugging
|
312
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_id_attachments ...'
|
313
|
+
end
|
314
|
+
# verify the required parameter 'id' is set
|
315
|
+
if @api_client.config.client_side_validation && id.nil?
|
316
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.get_resources_id_attachments"
|
317
|
+
end
|
318
|
+
if @api_client.config.client_side_validation && opts[:'fields'] && !opts[:'fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
319
|
+
fail ArgumentError, 'invalid value for "fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
320
|
+
end
|
321
|
+
if @api_client.config.client_side_validation && opts[:'exclude_fields'] && !opts[:'exclude_fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
322
|
+
fail ArgumentError, 'invalid value for "exclude_fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
323
|
+
end
|
324
|
+
if @api_client.config.client_side_validation && opts[:'csv_fields'] && !opts[:'csv_fields'].all? { |item| ['original_filename', 'sha1', 'collection_title', 'collection_id', 'parent_title', 'parent_id'].include?(item) }
|
325
|
+
fail ArgumentError, 'invalid value for "csv_fields", must include one of original_filename, sha1, collection_title, collection_id, parent_title, parent_id'
|
326
|
+
end
|
327
|
+
if @api_client.config.client_side_validation && opts[:'file_fields'] && !opts[:'file_fields'].all? { |item| ['caption', 'content', 'derived_image', 'extracted_text', 'fits_file', 'intermediate_file', 'multires_image', 'streamable_media', 'struct_metadata', 'thumbnail'].include?(item) }
|
328
|
+
fail ArgumentError, 'invalid value for "file_fields", must include one of caption, content, derived_image, extracted_text, fits_file, intermediate_file, multires_image, streamable_media, struct_metadata, thumbnail'
|
329
|
+
end
|
330
|
+
# resource path
|
331
|
+
local_var_path = '/resources/{id}/attachments'.sub('{' + 'id' + '}', id.to_s)
|
332
|
+
|
333
|
+
# query parameters
|
334
|
+
query_params = {}
|
335
|
+
query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
|
336
|
+
query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
|
337
|
+
query_params[:'csv_fields'] = @api_client.build_collection_param(opts[:'csv_fields'], :csv) if !opts[:'csv_fields'].nil?
|
338
|
+
query_params[:'file_fields'] = @api_client.build_collection_param(opts[:'file_fields'], :csv) if !opts[:'file_fields'].nil?
|
339
|
+
query_params[:'remove_empty_columns'] = opts[:'remove_empty_columns'] if !opts[:'remove_empty_columns'].nil?
|
340
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
341
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
342
|
+
|
343
|
+
# header parameters
|
344
|
+
header_params = {}
|
345
|
+
# HTTP header 'Accept' (if needed)
|
346
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv'])
|
347
|
+
|
348
|
+
# form parameters
|
349
|
+
form_params = {}
|
350
|
+
|
351
|
+
# http body (model)
|
352
|
+
post_body = nil
|
353
|
+
auth_names = ['oauth']
|
354
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
355
|
+
:header_params => header_params,
|
356
|
+
:query_params => query_params,
|
357
|
+
:form_params => form_params,
|
358
|
+
:body => post_body,
|
359
|
+
:auth_names => auth_names,
|
360
|
+
:return_type => 'Array<DdrAPIResourceEntity>')
|
361
|
+
if @api_client.config.debugging
|
362
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_id_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
363
|
+
end
|
364
|
+
return data, status_code, headers
|
365
|
+
end
|
366
|
+
# Get batches associated with the resource (by batch collection_id or batch object resource_id)
|
367
|
+
# @param id
|
368
|
+
# @param [Hash] opts the optional parameters
|
369
|
+
# @option opts [BOOLEAN] :batch_objects Include batch objects for each batch (default to false)
|
370
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
371
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
372
|
+
# @return [Array<DdrAPIBatchEntity>]
|
373
|
+
def get_resources_id_batches(id, opts = {})
|
374
|
+
data, _status_code, _headers = get_resources_id_batches_with_http_info(id, opts)
|
375
|
+
data
|
376
|
+
end
|
377
|
+
|
378
|
+
# Get batches associated with the resource (by batch collection_id or batch object resource_id)
|
379
|
+
# @param id
|
380
|
+
# @param [Hash] opts the optional parameters
|
381
|
+
# @option opts [BOOLEAN] :batch_objects Include batch objects for each batch
|
382
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
383
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
384
|
+
# @return [Array<(Array<DdrAPIBatchEntity>, Fixnum, Hash)>] Array<DdrAPIBatchEntity> data, response status code and response headers
|
385
|
+
def get_resources_id_batches_with_http_info(id, opts = {})
|
386
|
+
if @api_client.config.debugging
|
387
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_id_batches ...'
|
388
|
+
end
|
389
|
+
# verify the required parameter 'id' is set
|
390
|
+
if @api_client.config.client_side_validation && id.nil?
|
391
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.get_resources_id_batches"
|
392
|
+
end
|
393
|
+
# resource path
|
394
|
+
local_var_path = '/resources/{id}/batches'.sub('{' + 'id' + '}', id.to_s)
|
395
|
+
|
396
|
+
# query parameters
|
397
|
+
query_params = {}
|
398
|
+
query_params[:'batch_objects'] = opts[:'batch_objects'] if !opts[:'batch_objects'].nil?
|
399
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
400
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
401
|
+
|
402
|
+
# header parameters
|
403
|
+
header_params = {}
|
404
|
+
# HTTP header 'Accept' (if needed)
|
405
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
406
|
+
|
407
|
+
# form parameters
|
408
|
+
form_params = {}
|
409
|
+
|
410
|
+
# http body (model)
|
411
|
+
post_body = nil
|
412
|
+
auth_names = ['oauth']
|
413
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
414
|
+
:header_params => header_params,
|
415
|
+
:query_params => query_params,
|
416
|
+
:form_params => form_params,
|
417
|
+
:body => post_body,
|
418
|
+
:auth_names => auth_names,
|
419
|
+
:return_type => 'Array<DdrAPIBatchEntity>')
|
420
|
+
if @api_client.config.debugging
|
421
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_id_batches\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
422
|
+
end
|
423
|
+
return data, status_code, headers
|
424
|
+
end
|
425
|
+
# Get children of a resource
|
426
|
+
# @param id
|
427
|
+
# @param [Hash] opts the optional parameters
|
428
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
429
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
430
|
+
# @option opts [Array<String>] :csv_fields CSV only: Include additional columns
|
431
|
+
# @option opts [Array<String>] :file_fields CSV only: Include file columns (row values: 'present', 'absent', or 'n/a')
|
432
|
+
# @option opts [BOOLEAN] :remove_empty_columns CSV only: Remove empty columns from CSV output table (default to false)
|
433
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
434
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
435
|
+
# @return [Array<DdrAPIResourceEntity>]
|
436
|
+
def get_resources_id_children(id, opts = {})
|
437
|
+
data, _status_code, _headers = get_resources_id_children_with_http_info(id, opts)
|
438
|
+
data
|
439
|
+
end
|
440
|
+
|
441
|
+
# Get children of a resource
|
442
|
+
# @param id
|
443
|
+
# @param [Hash] opts the optional parameters
|
444
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
445
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
446
|
+
# @option opts [Array<String>] :csv_fields CSV only: Include additional columns
|
447
|
+
# @option opts [Array<String>] :file_fields CSV only: Include file columns (row values: 'present', 'absent', or 'n/a')
|
448
|
+
# @option opts [BOOLEAN] :remove_empty_columns CSV only: Remove empty columns from CSV output table
|
449
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
450
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
451
|
+
# @return [Array<(Array<DdrAPIResourceEntity>, Fixnum, Hash)>] Array<DdrAPIResourceEntity> data, response status code and response headers
|
452
|
+
def get_resources_id_children_with_http_info(id, opts = {})
|
453
|
+
if @api_client.config.debugging
|
454
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_id_children ...'
|
455
|
+
end
|
456
|
+
# verify the required parameter 'id' is set
|
457
|
+
if @api_client.config.client_side_validation && id.nil?
|
458
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.get_resources_id_children"
|
459
|
+
end
|
460
|
+
if @api_client.config.client_side_validation && opts[:'fields'] && !opts[:'fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
461
|
+
fail ArgumentError, 'invalid value for "fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
462
|
+
end
|
463
|
+
if @api_client.config.client_side_validation && opts[:'exclude_fields'] && !opts[:'exclude_fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
464
|
+
fail ArgumentError, 'invalid value for "exclude_fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
465
|
+
end
|
466
|
+
if @api_client.config.client_side_validation && opts[:'csv_fields'] && !opts[:'csv_fields'].all? { |item| ['original_filename', 'sha1', 'collection_title', 'collection_id', 'parent_title', 'parent_id'].include?(item) }
|
467
|
+
fail ArgumentError, 'invalid value for "csv_fields", must include one of original_filename, sha1, collection_title, collection_id, parent_title, parent_id'
|
468
|
+
end
|
469
|
+
if @api_client.config.client_side_validation && opts[:'file_fields'] && !opts[:'file_fields'].all? { |item| ['caption', 'content', 'derived_image', 'extracted_text', 'fits_file', 'intermediate_file', 'multires_image', 'streamable_media', 'struct_metadata', 'thumbnail'].include?(item) }
|
470
|
+
fail ArgumentError, 'invalid value for "file_fields", must include one of caption, content, derived_image, extracted_text, fits_file, intermediate_file, multires_image, streamable_media, struct_metadata, thumbnail'
|
471
|
+
end
|
472
|
+
# resource path
|
473
|
+
local_var_path = '/resources/{id}/children'.sub('{' + 'id' + '}', id.to_s)
|
474
|
+
|
475
|
+
# query parameters
|
476
|
+
query_params = {}
|
477
|
+
query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
|
478
|
+
query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
|
479
|
+
query_params[:'csv_fields'] = @api_client.build_collection_param(opts[:'csv_fields'], :csv) if !opts[:'csv_fields'].nil?
|
480
|
+
query_params[:'file_fields'] = @api_client.build_collection_param(opts[:'file_fields'], :csv) if !opts[:'file_fields'].nil?
|
481
|
+
query_params[:'remove_empty_columns'] = opts[:'remove_empty_columns'] if !opts[:'remove_empty_columns'].nil?
|
482
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
483
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
484
|
+
|
485
|
+
# header parameters
|
486
|
+
header_params = {}
|
487
|
+
# HTTP header 'Accept' (if needed)
|
488
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv'])
|
489
|
+
|
490
|
+
# form parameters
|
491
|
+
form_params = {}
|
492
|
+
|
493
|
+
# http body (model)
|
494
|
+
post_body = nil
|
495
|
+
auth_names = ['oauth']
|
496
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
497
|
+
:header_params => header_params,
|
498
|
+
:query_params => query_params,
|
499
|
+
:form_params => form_params,
|
500
|
+
:body => post_body,
|
501
|
+
:auth_names => auth_names,
|
502
|
+
:return_type => 'Array<DdrAPIResourceEntity>')
|
503
|
+
if @api_client.config.debugging
|
504
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_id_children\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
505
|
+
end
|
506
|
+
return data, status_code, headers
|
507
|
+
end
|
508
|
+
# Download original file
|
509
|
+
# @param id
|
510
|
+
# @param [Hash] opts the optional parameters
|
511
|
+
# @return [File]
|
512
|
+
def get_resources_id_download(id, opts = {})
|
513
|
+
data, _status_code, _headers = get_resources_id_download_with_http_info(id, opts)
|
514
|
+
data
|
515
|
+
end
|
516
|
+
|
517
|
+
# Download original file
|
518
|
+
# @param id
|
519
|
+
# @param [Hash] opts the optional parameters
|
520
|
+
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
521
|
+
def get_resources_id_download_with_http_info(id, opts = {})
|
522
|
+
if @api_client.config.debugging
|
523
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_id_download ...'
|
524
|
+
end
|
525
|
+
# verify the required parameter 'id' is set
|
526
|
+
if @api_client.config.client_side_validation && id.nil?
|
527
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.get_resources_id_download"
|
528
|
+
end
|
529
|
+
# resource path
|
530
|
+
local_var_path = '/resources/{id}/download'.sub('{' + 'id' + '}', id.to_s)
|
531
|
+
|
532
|
+
# query parameters
|
533
|
+
query_params = {}
|
534
|
+
|
535
|
+
# header parameters
|
536
|
+
header_params = {}
|
537
|
+
# HTTP header 'Accept' (if needed)
|
538
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
539
|
+
|
540
|
+
# form parameters
|
541
|
+
form_params = {}
|
542
|
+
|
543
|
+
# http body (model)
|
544
|
+
post_body = nil
|
545
|
+
auth_names = ['oauth']
|
546
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
547
|
+
:header_params => header_params,
|
548
|
+
:query_params => query_params,
|
549
|
+
:form_params => form_params,
|
550
|
+
:body => post_body,
|
551
|
+
:auth_names => auth_names,
|
552
|
+
:return_type => 'File')
|
553
|
+
if @api_client.config.debugging
|
554
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_id_download\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
555
|
+
end
|
556
|
+
return data, status_code, headers
|
557
|
+
end
|
558
|
+
# Download a file attached to a resource
|
559
|
+
# @param id
|
560
|
+
# @param slug
|
561
|
+
# @param [Hash] opts the optional parameters
|
562
|
+
# @return [File]
|
563
|
+
def get_resources_id_files_slug(id, slug, opts = {})
|
564
|
+
data, _status_code, _headers = get_resources_id_files_slug_with_http_info(id, slug, opts)
|
565
|
+
data
|
566
|
+
end
|
567
|
+
|
568
|
+
# Download a file attached to a resource
|
569
|
+
# @param id
|
570
|
+
# @param slug
|
571
|
+
# @param [Hash] opts the optional parameters
|
572
|
+
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
573
|
+
def get_resources_id_files_slug_with_http_info(id, slug, opts = {})
|
574
|
+
if @api_client.config.debugging
|
575
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_id_files_slug ...'
|
576
|
+
end
|
577
|
+
# verify the required parameter 'id' is set
|
578
|
+
if @api_client.config.client_side_validation && id.nil?
|
579
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.get_resources_id_files_slug"
|
580
|
+
end
|
581
|
+
# verify the required parameter 'slug' is set
|
582
|
+
if @api_client.config.client_side_validation && slug.nil?
|
583
|
+
fail ArgumentError, "Missing the required parameter 'slug' when calling ResourcesApi.get_resources_id_files_slug"
|
584
|
+
end
|
585
|
+
# resource path
|
586
|
+
local_var_path = '/resources/{id}/files/{slug}'.sub('{' + 'id' + '}', id.to_s).sub('{' + 'slug' + '}', slug.to_s)
|
587
|
+
|
588
|
+
# query parameters
|
589
|
+
query_params = {}
|
590
|
+
|
591
|
+
# header parameters
|
592
|
+
header_params = {}
|
593
|
+
# HTTP header 'Accept' (if needed)
|
594
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
595
|
+
|
596
|
+
# form parameters
|
597
|
+
form_params = {}
|
598
|
+
|
599
|
+
# http body (model)
|
600
|
+
post_body = nil
|
601
|
+
auth_names = ['oauth']
|
602
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
603
|
+
:header_params => header_params,
|
604
|
+
:query_params => query_params,
|
605
|
+
:form_params => form_params,
|
606
|
+
:body => post_body,
|
607
|
+
:auth_names => auth_names,
|
608
|
+
:return_type => 'File')
|
609
|
+
if @api_client.config.debugging
|
610
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_id_files_slug\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
611
|
+
end
|
612
|
+
return data, status_code, headers
|
613
|
+
end
|
614
|
+
# Perform a fixity check on the resource
|
615
|
+
# Content <= 1GB is checked and results returned; content > 1GB is accepted and background job information is returned
|
616
|
+
# @param id
|
617
|
+
# @param [Hash] opts the optional parameters
|
618
|
+
# @return [nil]
|
619
|
+
def get_resources_id_fixity(id, opts = {})
|
620
|
+
get_resources_id_fixity_with_http_info(id, opts)
|
621
|
+
nil
|
622
|
+
end
|
623
|
+
|
624
|
+
# Perform a fixity check on the resource
|
625
|
+
# Content <= 1GB is checked and results returned; content > 1GB is accepted and background job information is returned
|
626
|
+
# @param id
|
627
|
+
# @param [Hash] opts the optional parameters
|
628
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
629
|
+
def get_resources_id_fixity_with_http_info(id, opts = {})
|
630
|
+
if @api_client.config.debugging
|
631
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_id_fixity ...'
|
632
|
+
end
|
633
|
+
# verify the required parameter 'id' is set
|
634
|
+
if @api_client.config.client_side_validation && id.nil?
|
635
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.get_resources_id_fixity"
|
636
|
+
end
|
637
|
+
# resource path
|
638
|
+
local_var_path = '/resources/{id}/fixity'.sub('{' + 'id' + '}', id.to_s)
|
639
|
+
|
640
|
+
# query parameters
|
641
|
+
query_params = {}
|
642
|
+
|
643
|
+
# header parameters
|
644
|
+
header_params = {}
|
645
|
+
# HTTP header 'Accept' (if needed)
|
646
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
647
|
+
|
648
|
+
# form parameters
|
649
|
+
form_params = {}
|
650
|
+
|
651
|
+
# http body (model)
|
652
|
+
post_body = nil
|
653
|
+
auth_names = ['oauth']
|
654
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
655
|
+
:header_params => header_params,
|
656
|
+
:query_params => query_params,
|
657
|
+
:form_params => form_params,
|
658
|
+
:body => post_body,
|
659
|
+
:auth_names => auth_names)
|
660
|
+
if @api_client.config.debugging
|
661
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_id_fixity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
662
|
+
end
|
663
|
+
return data, status_code, headers
|
664
|
+
end
|
665
|
+
# Get members of a Collection
|
666
|
+
# Members include all resources related to the collection by admin_policy_id, which includes itself.
|
667
|
+
# @param id
|
668
|
+
# @param [Hash] opts the optional parameters
|
669
|
+
# @option opts [Array<String>] :model Limit to selected model type(s)
|
670
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
671
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
672
|
+
# @option opts [Array<String>] :csv_fields CSV only: Include additional columns
|
673
|
+
# @option opts [Array<String>] :file_fields CSV only: Include file columns (row values: 'present', 'absent', or 'n/a')
|
674
|
+
# @option opts [BOOLEAN] :remove_empty_columns CSV only: Remove empty columns from CSV output table (default to false)
|
675
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
676
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
677
|
+
# @return [Array<DdrAPIResourceEntity>]
|
678
|
+
def get_resources_id_members(id, opts = {})
|
679
|
+
data, _status_code, _headers = get_resources_id_members_with_http_info(id, opts)
|
680
|
+
data
|
681
|
+
end
|
682
|
+
|
683
|
+
# Get members of a Collection
|
684
|
+
# Members include all resources related to the collection by admin_policy_id, which includes itself.
|
685
|
+
# @param id
|
686
|
+
# @param [Hash] opts the optional parameters
|
687
|
+
# @option opts [Array<String>] :model Limit to selected model type(s)
|
688
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
689
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
690
|
+
# @option opts [Array<String>] :csv_fields CSV only: Include additional columns
|
691
|
+
# @option opts [Array<String>] :file_fields CSV only: Include file columns (row values: 'present', 'absent', or 'n/a')
|
692
|
+
# @option opts [BOOLEAN] :remove_empty_columns CSV only: Remove empty columns from CSV output table
|
693
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
694
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
695
|
+
# @return [Array<(Array<DdrAPIResourceEntity>, Fixnum, Hash)>] Array<DdrAPIResourceEntity> data, response status code and response headers
|
696
|
+
def get_resources_id_members_with_http_info(id, opts = {})
|
697
|
+
if @api_client.config.debugging
|
698
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_id_members ...'
|
699
|
+
end
|
700
|
+
# verify the required parameter 'id' is set
|
701
|
+
if @api_client.config.client_side_validation && id.nil?
|
702
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.get_resources_id_members"
|
703
|
+
end
|
704
|
+
if @api_client.config.client_side_validation && opts[:'model'] && !opts[:'model'].all? { |item| ['Collection', 'Item', 'Component', 'Target', 'Attachment'].include?(item) }
|
705
|
+
fail ArgumentError, 'invalid value for "model", must include one of Collection, Item, Component, Target, Attachment'
|
706
|
+
end
|
707
|
+
if @api_client.config.client_side_validation && opts[:'fields'] && !opts[:'fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
708
|
+
fail ArgumentError, 'invalid value for "fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
709
|
+
end
|
710
|
+
if @api_client.config.client_side_validation && opts[:'exclude_fields'] && !opts[:'exclude_fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
711
|
+
fail ArgumentError, 'invalid value for "exclude_fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
712
|
+
end
|
713
|
+
if @api_client.config.client_side_validation && opts[:'csv_fields'] && !opts[:'csv_fields'].all? { |item| ['original_filename', 'sha1', 'collection_title', 'collection_id', 'parent_title', 'parent_id'].include?(item) }
|
714
|
+
fail ArgumentError, 'invalid value for "csv_fields", must include one of original_filename, sha1, collection_title, collection_id, parent_title, parent_id'
|
715
|
+
end
|
716
|
+
if @api_client.config.client_side_validation && opts[:'file_fields'] && !opts[:'file_fields'].all? { |item| ['caption', 'content', 'derived_image', 'extracted_text', 'fits_file', 'intermediate_file', 'multires_image', 'streamable_media', 'struct_metadata', 'thumbnail'].include?(item) }
|
717
|
+
fail ArgumentError, 'invalid value for "file_fields", must include one of caption, content, derived_image, extracted_text, fits_file, intermediate_file, multires_image, streamable_media, struct_metadata, thumbnail'
|
718
|
+
end
|
719
|
+
# resource path
|
720
|
+
local_var_path = '/resources/{id}/members'.sub('{' + 'id' + '}', id.to_s)
|
721
|
+
|
722
|
+
# query parameters
|
723
|
+
query_params = {}
|
724
|
+
query_params[:'model'] = @api_client.build_collection_param(opts[:'model'], :csv) if !opts[:'model'].nil?
|
725
|
+
query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
|
726
|
+
query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
|
727
|
+
query_params[:'csv_fields'] = @api_client.build_collection_param(opts[:'csv_fields'], :csv) if !opts[:'csv_fields'].nil?
|
728
|
+
query_params[:'file_fields'] = @api_client.build_collection_param(opts[:'file_fields'], :csv) if !opts[:'file_fields'].nil?
|
729
|
+
query_params[:'remove_empty_columns'] = opts[:'remove_empty_columns'] if !opts[:'remove_empty_columns'].nil?
|
730
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
731
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
732
|
+
|
733
|
+
# header parameters
|
734
|
+
header_params = {}
|
735
|
+
# HTTP header 'Accept' (if needed)
|
736
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv'])
|
737
|
+
|
738
|
+
# form parameters
|
739
|
+
form_params = {}
|
740
|
+
|
741
|
+
# http body (model)
|
742
|
+
post_body = nil
|
743
|
+
auth_names = ['oauth']
|
744
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
745
|
+
:header_params => header_params,
|
746
|
+
:query_params => query_params,
|
747
|
+
:form_params => form_params,
|
748
|
+
:body => post_body,
|
749
|
+
:auth_names => auth_names,
|
750
|
+
:return_type => 'Array<DdrAPIResourceEntity>')
|
751
|
+
if @api_client.config.debugging
|
752
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_id_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
753
|
+
end
|
754
|
+
return data, status_code, headers
|
755
|
+
end
|
756
|
+
# Retrieve metadata for the permanent ID assigned to the resource
|
757
|
+
# @param id
|
758
|
+
# @param [Hash] opts the optional parameters
|
759
|
+
# @return [nil]
|
760
|
+
def get_resources_id_permanent_id(id, opts = {})
|
761
|
+
get_resources_id_permanent_id_with_http_info(id, opts)
|
762
|
+
nil
|
763
|
+
end
|
764
|
+
|
765
|
+
# Retrieve metadata for the permanent ID assigned to the resource
|
766
|
+
# @param id
|
767
|
+
# @param [Hash] opts the optional parameters
|
768
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
769
|
+
def get_resources_id_permanent_id_with_http_info(id, opts = {})
|
770
|
+
if @api_client.config.debugging
|
771
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_id_permanent_id ...'
|
772
|
+
end
|
773
|
+
# verify the required parameter 'id' is set
|
774
|
+
if @api_client.config.client_side_validation && id.nil?
|
775
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.get_resources_id_permanent_id"
|
776
|
+
end
|
777
|
+
# resource path
|
778
|
+
local_var_path = '/resources/{id}/permanent_id'.sub('{' + 'id' + '}', id.to_s)
|
779
|
+
|
780
|
+
# query parameters
|
781
|
+
query_params = {}
|
782
|
+
|
783
|
+
# header parameters
|
784
|
+
header_params = {}
|
785
|
+
# HTTP header 'Accept' (if needed)
|
786
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
787
|
+
|
788
|
+
# form parameters
|
789
|
+
form_params = {}
|
790
|
+
|
791
|
+
# http body (model)
|
792
|
+
post_body = nil
|
793
|
+
auth_names = ['oauth']
|
794
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
795
|
+
:header_params => header_params,
|
796
|
+
:query_params => query_params,
|
797
|
+
:form_params => form_params,
|
798
|
+
:body => post_body,
|
799
|
+
:auth_names => auth_names)
|
800
|
+
if @api_client.config.debugging
|
801
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_id_permanent_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
802
|
+
end
|
803
|
+
return data, status_code, headers
|
804
|
+
end
|
805
|
+
# Return the effective permissions on the resource
|
806
|
+
# @param id
|
807
|
+
# @param [Hash] opts the optional parameters
|
808
|
+
# @return [nil]
|
809
|
+
def get_resources_id_permissions(id, opts = {})
|
810
|
+
get_resources_id_permissions_with_http_info(id, opts)
|
811
|
+
nil
|
812
|
+
end
|
813
|
+
|
814
|
+
# Return the effective permissions on the resource
|
815
|
+
# @param id
|
816
|
+
# @param [Hash] opts the optional parameters
|
817
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
818
|
+
def get_resources_id_permissions_with_http_info(id, opts = {})
|
819
|
+
if @api_client.config.debugging
|
820
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_id_permissions ...'
|
821
|
+
end
|
822
|
+
# verify the required parameter 'id' is set
|
823
|
+
if @api_client.config.client_side_validation && id.nil?
|
824
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.get_resources_id_permissions"
|
825
|
+
end
|
826
|
+
# resource path
|
827
|
+
local_var_path = '/resources/{id}/permissions'.sub('{' + 'id' + '}', id.to_s)
|
828
|
+
|
829
|
+
# query parameters
|
830
|
+
query_params = {}
|
831
|
+
|
832
|
+
# header parameters
|
833
|
+
header_params = {}
|
834
|
+
# HTTP header 'Accept' (if needed)
|
835
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
836
|
+
|
837
|
+
# form parameters
|
838
|
+
form_params = {}
|
839
|
+
|
840
|
+
# http body (model)
|
841
|
+
post_body = nil
|
842
|
+
auth_names = ['oauth']
|
843
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
844
|
+
:header_params => header_params,
|
845
|
+
:query_params => query_params,
|
846
|
+
:form_params => form_params,
|
847
|
+
:body => post_body,
|
848
|
+
:auth_names => auth_names)
|
849
|
+
if @api_client.config.debugging
|
850
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_id_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
851
|
+
end
|
852
|
+
return data, status_code, headers
|
853
|
+
end
|
854
|
+
# Get targets associated with the Collection
|
855
|
+
# @param id
|
856
|
+
# @param [Hash] opts the optional parameters
|
857
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
858
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
859
|
+
# @option opts [Array<String>] :csv_fields CSV only: Include additional columns
|
860
|
+
# @option opts [Array<String>] :file_fields CSV only: Include file columns (row values: 'present', 'absent', or 'n/a')
|
861
|
+
# @option opts [BOOLEAN] :remove_empty_columns CSV only: Remove empty columns from CSV output table (default to false)
|
862
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
863
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
864
|
+
# @return [Array<DdrAPIResourceEntity>]
|
865
|
+
def get_resources_id_targets(id, opts = {})
|
866
|
+
data, _status_code, _headers = get_resources_id_targets_with_http_info(id, opts)
|
867
|
+
data
|
868
|
+
end
|
869
|
+
|
870
|
+
# Get targets associated with the Collection
|
871
|
+
# @param id
|
872
|
+
# @param [Hash] opts the optional parameters
|
873
|
+
# @option opts [Array<String>] :fields Metadata fields to include (resource ID and model are always included)
|
874
|
+
# @option opts [Array<String>] :exclude_fields Metadata fields to exclude (cannot combine with \"fields\")
|
875
|
+
# @option opts [Array<String>] :csv_fields CSV only: Include additional columns
|
876
|
+
# @option opts [Array<String>] :file_fields CSV only: Include file columns (row values: 'present', 'absent', or 'n/a')
|
877
|
+
# @option opts [BOOLEAN] :remove_empty_columns CSV only: Remove empty columns from CSV output table
|
878
|
+
# @option opts [Object] :per_page JSON only: Number of records to return per page (default: 20)
|
879
|
+
# @option opts [Object] :page JSON only: Page number of results to return (default: 1)
|
880
|
+
# @return [Array<(Array<DdrAPIResourceEntity>, Fixnum, Hash)>] Array<DdrAPIResourceEntity> data, response status code and response headers
|
881
|
+
def get_resources_id_targets_with_http_info(id, opts = {})
|
882
|
+
if @api_client.config.debugging
|
883
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_id_targets ...'
|
884
|
+
end
|
885
|
+
# verify the required parameter 'id' is set
|
886
|
+
if @api_client.config.client_side_validation && id.nil?
|
887
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.get_resources_id_targets"
|
888
|
+
end
|
889
|
+
if @api_client.config.client_side_validation && opts[:'fields'] && !opts[:'fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
890
|
+
fail ArgumentError, 'invalid value for "fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
891
|
+
end
|
892
|
+
if @api_client.config.client_side_validation && opts[:'exclude_fields'] && !opts[:'exclude_fields'].all? { |item| ['abstract', 'accessRights', 'admin_set', 'aleph_id', 'alternative', 'aspace_id', 'available', 'biblical_book', 'category', 'chapter_and_verse', 'company', 'contentdm_id', 'contributor', 'creator', 'date', 'description', 'display_format', 'doi', 'ead_id', 'extent', 'fcrepo3_pid', 'format', 'hasPart', 'headline', 'identifier', 'ingested_by', 'ingestion_date', 'isFormatOf', 'isPartOf', 'issue_number', 'language', 'local_id', 'medium', 'nested_path', 'permanent_id', 'permanent_url', 'placement_company', 'product', 'provenance', 'publication', 'publisher', 'relation', 'research_help_contact', 'rights', 'rights_note', 'series', 'setting', 'spatial', 'sponsor', 'subject', 'title', 'tone', 'type', 'volume', 'workflow_state'].include?(item) }
|
893
|
+
fail ArgumentError, 'invalid value for "exclude_fields", must include one of abstract, accessRights, admin_set, aleph_id, alternative, aspace_id, available, biblical_book, category, chapter_and_verse, company, contentdm_id, contributor, creator, date, description, display_format, doi, ead_id, extent, fcrepo3_pid, format, hasPart, headline, identifier, ingested_by, ingestion_date, isFormatOf, isPartOf, issue_number, language, local_id, medium, nested_path, permanent_id, permanent_url, placement_company, product, provenance, publication, publisher, relation, research_help_contact, rights, rights_note, series, setting, spatial, sponsor, subject, title, tone, type, volume, workflow_state'
|
894
|
+
end
|
895
|
+
if @api_client.config.client_side_validation && opts[:'csv_fields'] && !opts[:'csv_fields'].all? { |item| ['original_filename', 'sha1', 'collection_title', 'collection_id', 'parent_title', 'parent_id'].include?(item) }
|
896
|
+
fail ArgumentError, 'invalid value for "csv_fields", must include one of original_filename, sha1, collection_title, collection_id, parent_title, parent_id'
|
897
|
+
end
|
898
|
+
if @api_client.config.client_side_validation && opts[:'file_fields'] && !opts[:'file_fields'].all? { |item| ['caption', 'content', 'derived_image', 'extracted_text', 'fits_file', 'intermediate_file', 'multires_image', 'streamable_media', 'struct_metadata', 'thumbnail'].include?(item) }
|
899
|
+
fail ArgumentError, 'invalid value for "file_fields", must include one of caption, content, derived_image, extracted_text, fits_file, intermediate_file, multires_image, streamable_media, struct_metadata, thumbnail'
|
900
|
+
end
|
901
|
+
# resource path
|
902
|
+
local_var_path = '/resources/{id}/targets'.sub('{' + 'id' + '}', id.to_s)
|
903
|
+
|
904
|
+
# query parameters
|
905
|
+
query_params = {}
|
906
|
+
query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil?
|
907
|
+
query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil?
|
908
|
+
query_params[:'csv_fields'] = @api_client.build_collection_param(opts[:'csv_fields'], :csv) if !opts[:'csv_fields'].nil?
|
909
|
+
query_params[:'file_fields'] = @api_client.build_collection_param(opts[:'file_fields'], :csv) if !opts[:'file_fields'].nil?
|
910
|
+
query_params[:'remove_empty_columns'] = opts[:'remove_empty_columns'] if !opts[:'remove_empty_columns'].nil?
|
911
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
912
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
913
|
+
|
914
|
+
# header parameters
|
915
|
+
header_params = {}
|
916
|
+
# HTTP header 'Accept' (if needed)
|
917
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv'])
|
918
|
+
|
919
|
+
# form parameters
|
920
|
+
form_params = {}
|
921
|
+
|
922
|
+
# http body (model)
|
923
|
+
post_body = nil
|
924
|
+
auth_names = ['oauth']
|
925
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
926
|
+
:header_params => header_params,
|
927
|
+
:query_params => query_params,
|
928
|
+
:form_params => form_params,
|
929
|
+
:body => post_body,
|
930
|
+
:auth_names => auth_names,
|
931
|
+
:return_type => 'Array<DdrAPIResourceEntity>')
|
932
|
+
if @api_client.config.debugging
|
933
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_id_targets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
934
|
+
end
|
935
|
+
return data, status_code, headers
|
936
|
+
end
|
937
|
+
# Get technical metadata for Component members of the Collection
|
938
|
+
# @param id
|
939
|
+
# @param [Hash] opts the optional parameters
|
940
|
+
# @return [Array<DdrAPITechnicalMetadataEntity>]
|
941
|
+
def get_resources_id_technical_metadata(id, opts = {})
|
942
|
+
data, _status_code, _headers = get_resources_id_technical_metadata_with_http_info(id, opts)
|
943
|
+
data
|
944
|
+
end
|
945
|
+
|
946
|
+
# Get technical metadata for Component members of the Collection
|
947
|
+
# @param id
|
948
|
+
# @param [Hash] opts the optional parameters
|
949
|
+
# @return [Array<(Array<DdrAPITechnicalMetadataEntity>, Fixnum, Hash)>] Array<DdrAPITechnicalMetadataEntity> data, response status code and response headers
|
950
|
+
def get_resources_id_technical_metadata_with_http_info(id, opts = {})
|
951
|
+
if @api_client.config.debugging
|
952
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.get_resources_id_technical_metadata ...'
|
953
|
+
end
|
954
|
+
# verify the required parameter 'id' is set
|
955
|
+
if @api_client.config.client_side_validation && id.nil?
|
956
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.get_resources_id_technical_metadata"
|
957
|
+
end
|
958
|
+
# resource path
|
959
|
+
local_var_path = '/resources/{id}/technical_metadata'.sub('{' + 'id' + '}', id.to_s)
|
960
|
+
|
961
|
+
# query parameters
|
962
|
+
query_params = {}
|
963
|
+
|
964
|
+
# header parameters
|
965
|
+
header_params = {}
|
966
|
+
# HTTP header 'Accept' (if needed)
|
967
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv'])
|
968
|
+
|
969
|
+
# form parameters
|
970
|
+
form_params = {}
|
971
|
+
|
972
|
+
# http body (model)
|
973
|
+
post_body = nil
|
974
|
+
auth_names = ['oauth']
|
975
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
976
|
+
:header_params => header_params,
|
977
|
+
:query_params => query_params,
|
978
|
+
:form_params => form_params,
|
979
|
+
:body => post_body,
|
980
|
+
:auth_names => auth_names,
|
981
|
+
:return_type => 'Array<DdrAPITechnicalMetadataEntity>')
|
982
|
+
if @api_client.config.debugging
|
983
|
+
@api_client.config.logger.debug "API called: ResourcesApi#get_resources_id_technical_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
984
|
+
end
|
985
|
+
return data, status_code, headers
|
986
|
+
end
|
987
|
+
# Update a resource
|
988
|
+
# @param id
|
989
|
+
# @param resources
|
990
|
+
# @param [Hash] opts the optional parameters
|
991
|
+
# @return [DdrAPIResourceEntity]
|
992
|
+
def patch_resources_id(id, resources, opts = {})
|
993
|
+
data, _status_code, _headers = patch_resources_id_with_http_info(id, resources, opts)
|
994
|
+
data
|
995
|
+
end
|
996
|
+
|
997
|
+
# Update a resource
|
998
|
+
# @param id
|
999
|
+
# @param resources
|
1000
|
+
# @param [Hash] opts the optional parameters
|
1001
|
+
# @return [Array<(DdrAPIResourceEntity, Fixnum, Hash)>] DdrAPIResourceEntity data, response status code and response headers
|
1002
|
+
def patch_resources_id_with_http_info(id, resources, opts = {})
|
1003
|
+
if @api_client.config.debugging
|
1004
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.patch_resources_id ...'
|
1005
|
+
end
|
1006
|
+
# verify the required parameter 'id' is set
|
1007
|
+
if @api_client.config.client_side_validation && id.nil?
|
1008
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling ResourcesApi.patch_resources_id"
|
1009
|
+
end
|
1010
|
+
# verify the required parameter 'resources' is set
|
1011
|
+
if @api_client.config.client_side_validation && resources.nil?
|
1012
|
+
fail ArgumentError, "Missing the required parameter 'resources' when calling ResourcesApi.patch_resources_id"
|
1013
|
+
end
|
1014
|
+
# resource path
|
1015
|
+
local_var_path = '/resources/{id}'.sub('{' + 'id' + '}', id.to_s)
|
1016
|
+
|
1017
|
+
# query parameters
|
1018
|
+
query_params = {}
|
1019
|
+
|
1020
|
+
# header parameters
|
1021
|
+
header_params = {}
|
1022
|
+
# HTTP header 'Accept' (if needed)
|
1023
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1024
|
+
# HTTP header 'Content-Type'
|
1025
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1026
|
+
|
1027
|
+
# form parameters
|
1028
|
+
form_params = {}
|
1029
|
+
|
1030
|
+
# http body (model)
|
1031
|
+
post_body = @api_client.object_to_http_body(resources)
|
1032
|
+
auth_names = ['oauth']
|
1033
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
|
1034
|
+
:header_params => header_params,
|
1035
|
+
:query_params => query_params,
|
1036
|
+
:form_params => form_params,
|
1037
|
+
:body => post_body,
|
1038
|
+
:auth_names => auth_names,
|
1039
|
+
:return_type => 'DdrAPIResourceEntity')
|
1040
|
+
if @api_client.config.debugging
|
1041
|
+
@api_client.config.logger.debug "API called: ResourcesApi#patch_resources_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1042
|
+
end
|
1043
|
+
return data, status_code, headers
|
1044
|
+
end
|
1045
|
+
# Create a resource
|
1046
|
+
# @param resources
|
1047
|
+
# @param [Hash] opts the optional parameters
|
1048
|
+
# @return [DdrAPIResourceEntity]
|
1049
|
+
def post_resources(resources, opts = {})
|
1050
|
+
data, _status_code, _headers = post_resources_with_http_info(resources, opts)
|
1051
|
+
data
|
1052
|
+
end
|
1053
|
+
|
1054
|
+
# Create a resource
|
1055
|
+
# @param resources
|
1056
|
+
# @param [Hash] opts the optional parameters
|
1057
|
+
# @return [Array<(DdrAPIResourceEntity, Fixnum, Hash)>] DdrAPIResourceEntity data, response status code and response headers
|
1058
|
+
def post_resources_with_http_info(resources, opts = {})
|
1059
|
+
if @api_client.config.debugging
|
1060
|
+
@api_client.config.logger.debug 'Calling API: ResourcesApi.post_resources ...'
|
1061
|
+
end
|
1062
|
+
# verify the required parameter 'resources' is set
|
1063
|
+
if @api_client.config.client_side_validation && resources.nil?
|
1064
|
+
fail ArgumentError, "Missing the required parameter 'resources' when calling ResourcesApi.post_resources"
|
1065
|
+
end
|
1066
|
+
# resource path
|
1067
|
+
local_var_path = '/resources'
|
1068
|
+
|
1069
|
+
# query parameters
|
1070
|
+
query_params = {}
|
1071
|
+
|
1072
|
+
# header parameters
|
1073
|
+
header_params = {}
|
1074
|
+
# HTTP header 'Accept' (if needed)
|
1075
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1076
|
+
# HTTP header 'Content-Type'
|
1077
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1078
|
+
|
1079
|
+
# form parameters
|
1080
|
+
form_params = {}
|
1081
|
+
|
1082
|
+
# http body (model)
|
1083
|
+
post_body = @api_client.object_to_http_body(resources)
|
1084
|
+
auth_names = ['oauth']
|
1085
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
1086
|
+
:header_params => header_params,
|
1087
|
+
:query_params => query_params,
|
1088
|
+
:form_params => form_params,
|
1089
|
+
:body => post_body,
|
1090
|
+
:auth_names => auth_names,
|
1091
|
+
:return_type => 'DdrAPIResourceEntity')
|
1092
|
+
if @api_client.config.debugging
|
1093
|
+
@api_client.config.logger.debug "API called: ResourcesApi#post_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1094
|
+
end
|
1095
|
+
return data, status_code, headers
|
1096
|
+
end
|
1097
|
+
end
|
1098
|
+
end
|