strawberry_api 0.4.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/doc/HTTParty/Response.html +1 -1
- data/doc/StrawberryAPI.html +4 -4
- data/doc/StrawberryAPI/AccessRight.html +1 -1
- data/doc/StrawberryAPI/ApiKey.html +1 -1
- data/doc/StrawberryAPI/ArchiveStrategy.html +1 -1
- data/doc/StrawberryAPI/ArchiveStrategyState.html +1 -1
- data/doc/StrawberryAPI/Asset.html +2 -2
- data/doc/StrawberryAPI/AssetCopyToStrategy.html +1 -1
- data/doc/StrawberryAPI/AssetFeedback.html +1 -1
- data/doc/StrawberryAPI/Client.html +9 -9
- data/doc/StrawberryAPI/Client/ApiKeys.html +5 -5
- data/doc/StrawberryAPI/Client/ArchiveStrategies.html +1 -1
- data/doc/StrawberryAPI/Client/AssetCopyToStrategies.html +5 -5
- data/doc/StrawberryAPI/Client/AssetFeedbacks.html +1 -1
- data/doc/StrawberryAPI/Client/Assets.html +6 -6
- data/doc/StrawberryAPI/Client/Collections.html +1 -1
- data/doc/StrawberryAPI/Client/CopyToFeedbacks.html +1 -1
- data/doc/StrawberryAPI/Client/CustomMetadata.html +1 -1
- data/doc/StrawberryAPI/Client/CustomMetadataFields.html +1 -1
- data/doc/StrawberryAPI/Client/CustomMetadataOptions.html +1 -1
- data/doc/StrawberryAPI/Client/CustomMetadataSets.html +1 -1
- data/doc/StrawberryAPI/Client/Edits.html +1 -1
- data/doc/StrawberryAPI/Client/Features.html +1 -1
- data/doc/StrawberryAPI/Client/Libraries.html +294 -2
- data/doc/StrawberryAPI/Client/Markers.html +1 -1
- data/doc/StrawberryAPI/Client/ProjectCopyToStrategies.html +5 -5
- data/doc/StrawberryAPI/Client/ProjectFeedbacks.html +1 -1
- data/doc/StrawberryAPI/Client/Projects.html +410 -152
- data/doc/StrawberryAPI/Client/Roles.html +1 -1
- data/doc/StrawberryAPI/Client/Schedules.html +1 -1
- data/doc/StrawberryAPI/Client/Searches.html +1 -1
- data/doc/StrawberryAPI/Client/Sessions.html +1 -1
- data/doc/StrawberryAPI/Client/Settings.html +1 -1
- data/doc/StrawberryAPI/Client/StatusFlags.html +1 -1
- data/doc/StrawberryAPI/Client/Teams.html +5 -5
- data/doc/StrawberryAPI/Client/Templates.html +1 -1
- data/doc/StrawberryAPI/Client/Users.html +5 -5
- data/doc/StrawberryAPI/Collection.html +1 -1
- data/doc/StrawberryAPI/Configuration.html +1 -1
- data/doc/StrawberryAPI/CopyToFeedback.html +1 -1
- data/doc/StrawberryAPI/CustomMetadataField.html +1 -1
- data/doc/StrawberryAPI/CustomMetadataOption.html +1 -1
- data/doc/StrawberryAPI/CustomMetadataSet.html +1 -1
- data/doc/StrawberryAPI/CustomMetadatum.html +1 -1
- data/doc/StrawberryAPI/Edit.html +1 -1
- data/doc/StrawberryAPI/Feature.html +1 -1
- data/doc/StrawberryAPI/Feedback.html +1 -1
- data/doc/StrawberryAPI/HttpClient.html +1 -1
- data/doc/StrawberryAPI/Library.html +1 -1
- data/doc/StrawberryAPI/Marker.html +1 -1
- data/doc/StrawberryAPI/Metadatum.html +567 -0
- data/doc/StrawberryAPI/Project.html +1 -1
- data/doc/StrawberryAPI/ProjectCopyToStrategy.html +1 -1
- data/doc/StrawberryAPI/ProjectFeedback.html +1 -1
- data/doc/StrawberryAPI/Proxy.html +1 -1
- data/doc/StrawberryAPI/Role.html +1 -1
- data/doc/StrawberryAPI/Schedule.html +1 -1
- data/doc/StrawberryAPI/Session.html +1 -1
- data/doc/StrawberryAPI/Setting.html +1 -1
- data/doc/StrawberryAPI/StatusFlag.html +1 -1
- data/doc/StrawberryAPI/Strategy.html +1 -1
- data/doc/StrawberryAPI/Team.html +1 -1
- data/doc/StrawberryAPI/Template.html +1 -1
- data/doc/StrawberryAPI/User.html +1 -1
- data/doc/_index.html +8 -1
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +541 -461
- data/doc/top-level-namespace.html +1 -1
- data/lib/strawberry_api/asset.rb +1 -1
- data/lib/strawberry_api/client.rb +1 -0
- data/lib/strawberry_api/client/api_keys.rb +1 -1
- data/lib/strawberry_api/client/asset_copy_to_strategies.rb +1 -1
- data/lib/strawberry_api/client/assets.rb +2 -2
- data/lib/strawberry_api/client/libraries.rb +34 -0
- data/lib/strawberry_api/client/project_copy_to_strategies.rb +1 -1
- data/lib/strawberry_api/client/projects.rb +32 -3
- data/lib/strawberry_api/client/teams.rb +1 -1
- data/lib/strawberry_api/client/users.rb +1 -1
- data/lib/strawberry_api/metadatum.rb +18 -0
- data/lib/strawberry_api/version.rb +1 -1
- data/samples/test.rb +2 -1
- metadata +4 -2
@@ -100,7 +100,7 @@
|
|
100
100
|
</div>
|
101
101
|
|
102
102
|
<div id="footer">
|
103
|
-
Generated on
|
103
|
+
Generated on Mon Oct 22 13:11:46 2018 by
|
104
104
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
105
105
|
0.9.16 (ruby-2.5.0).
|
106
106
|
</div>
|
data/lib/strawberry_api/asset.rb
CHANGED
@@ -3,6 +3,7 @@ require 'strawberry_api/api_key'
|
|
3
3
|
require 'strawberry_api/asset'
|
4
4
|
require 'strawberry_api/client'
|
5
5
|
require 'strawberry_api/collection'
|
6
|
+
require 'strawberry_api/metadatum'
|
6
7
|
require 'strawberry_api/custom_metadatum'
|
7
8
|
require 'strawberry_api/custom_metadata/custom_metadata_field'
|
8
9
|
require 'strawberry_api/custom_metadata/custom_metadata_option'
|
@@ -61,7 +61,7 @@ module StrawberryAPI
|
|
61
61
|
#
|
62
62
|
# @return [Boolean] Success
|
63
63
|
#
|
64
|
-
def
|
64
|
+
def delete_assets(project_id:, asset_ids:)
|
65
65
|
delete("/assets/destroy", body: {data: {project_id => {asset_ids: asset_ids}}}).success?
|
66
66
|
end
|
67
67
|
|
@@ -83,7 +83,7 @@ module StrawberryAPI
|
|
83
83
|
# @return [Boolean] Success
|
84
84
|
#
|
85
85
|
def update_asset_custom_metadata(id:, custom_metadata:)
|
86
|
-
filthy_hash = StrawberryAPI::
|
86
|
+
filthy_hash = StrawberryAPI::CustomMetadatum.filthify(custom_metadata: custom_metadata)
|
87
87
|
put("/assets/#{id}/update_metadata", query: filthy_hash).success?
|
88
88
|
end
|
89
89
|
|
@@ -25,6 +25,40 @@ module StrawberryAPI
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
# Creates a library
|
29
|
+
#
|
30
|
+
# @param [Integer] project_id Id of the project where to ingest media
|
31
|
+
# @param [String] ingest_storage Name of the storage to ingest into
|
32
|
+
# @param [<type>] ingest_path Watchfoler path
|
33
|
+
# @param [<type>] external false Whether to keep in place ingest media
|
34
|
+
# @param [<type>] options {mxf_handling: false} Hash of options
|
35
|
+
#
|
36
|
+
# @return [StrawberryAPI::Library] The created library
|
37
|
+
#
|
38
|
+
def create_library(project_id:, ingest_storage: 'media_1', ingest_path:, external: false, options: {mxf_handling: false})
|
39
|
+
update_project(id: project_id, options: {is_library_project: true, encoding_priority: 'high'})
|
40
|
+
|
41
|
+
body = {
|
42
|
+
project_id: project_id,
|
43
|
+
ingest_storage: ingest_storage,
|
44
|
+
ingest_path: ingest_path,
|
45
|
+
external: external,
|
46
|
+
options: options
|
47
|
+
}.to_json
|
48
|
+
|
49
|
+
data = post("/library_ingests", body: body).parse['libraryingest']
|
50
|
+
data.nil? ? nil : Library.new(data)
|
51
|
+
end
|
52
|
+
|
53
|
+
# Deletes a library
|
54
|
+
#
|
55
|
+
# @param [Integer] id Id of the library to delete
|
56
|
+
#
|
57
|
+
# @return [Boolean] Success
|
58
|
+
#
|
59
|
+
def delete_library(id:)
|
60
|
+
delete("/library_ingests/#{id}").success?
|
61
|
+
end
|
28
62
|
end
|
29
63
|
end
|
30
64
|
end
|
@@ -77,23 +77,40 @@ module StrawberryAPI
|
|
77
77
|
#
|
78
78
|
# @return [StrawberryAPI::Project] The created project
|
79
79
|
#
|
80
|
-
def create_project(name:, templatename:)
|
80
|
+
def create_project(name:, templatename:, custom_metadata: nil)
|
81
|
+
custom_metadata = custom_metadata.each_with_object(Array.new) do |field, memo|
|
82
|
+
memo.push({custom_metadata_field: field[0], value: field[1]})
|
83
|
+
end
|
84
|
+
|
81
85
|
body = {
|
82
86
|
name: name,
|
83
|
-
templatename: templatename
|
87
|
+
templatename: templatename,
|
88
|
+
custom_metadata: custom_metadata
|
84
89
|
}.to_json
|
85
90
|
|
86
91
|
data = post("/projects", body: body).parse['project']
|
87
92
|
data.nil? ? nil : Project.new(data)
|
88
93
|
end
|
89
94
|
|
95
|
+
# Updates a project
|
96
|
+
#
|
97
|
+
# @param [Interger] id Id of the project to update
|
98
|
+
# @param [Hash] options Hash of options
|
99
|
+
#
|
100
|
+
# @return [StrawberryAPI::Project] The updated project
|
101
|
+
#
|
102
|
+
def update_project(id:, options: {})
|
103
|
+
data = put("/projects/#{id}", body: options.to_json).parse['project']
|
104
|
+
data.nil? ? nil : Project.new(data)
|
105
|
+
end
|
106
|
+
|
90
107
|
# Deletes a project
|
91
108
|
#
|
92
109
|
# @param [Integer] id Id of the project to delete
|
93
110
|
#
|
94
111
|
# @return [Boolean] Success
|
95
112
|
#
|
96
|
-
def
|
113
|
+
def delete_project(id:)
|
97
114
|
delete("/projects/#{id}").success?
|
98
115
|
end
|
99
116
|
|
@@ -309,6 +326,18 @@ module StrawberryAPI
|
|
309
326
|
end
|
310
327
|
end
|
311
328
|
|
329
|
+
# Updates an project custom metadata
|
330
|
+
#
|
331
|
+
# @param [Integer] id Id of the project which to update custom metadata
|
332
|
+
# @param [Hash] custom_metadata Custom metadata to update the project with
|
333
|
+
#
|
334
|
+
# @return [Boolean] Success
|
335
|
+
#
|
336
|
+
def update_project_custom_metadata(id:, custom_metadata: nil)
|
337
|
+
filthy_hash = StrawberryAPI::CustomMetadatum.filthify(custom_metadata: custom_metadata)
|
338
|
+
put("/projects/#{id}/update_metadata", query: filthy_hash).success?
|
339
|
+
end
|
340
|
+
|
312
341
|
# Fetches a project assets
|
313
342
|
#
|
314
343
|
# @param [Integer] id Id of the project to retrieve which to retrieve assets from
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module StrawberryAPI
|
2
|
+
|
3
|
+
class Metadatum
|
4
|
+
|
5
|
+
attr_accessor :id
|
6
|
+
attr_accessor :asset_id
|
7
|
+
attr_accessor :source
|
8
|
+
attr_accessor :property
|
9
|
+
attr_accessor :value
|
10
|
+
|
11
|
+
def initialize(params = {})
|
12
|
+
params.each do |k, v|
|
13
|
+
instance_variable_set("@#{k}", v) unless v.nil?
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
data/samples/test.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strawberry_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Lebrun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- doc/StrawberryAPI/HttpClient.html
|
119
119
|
- doc/StrawberryAPI/Library.html
|
120
120
|
- doc/StrawberryAPI/Marker.html
|
121
|
+
- doc/StrawberryAPI/Metadatum.html
|
121
122
|
- doc/StrawberryAPI/Project.html
|
122
123
|
- doc/StrawberryAPI/ProjectCopyToStrategy.html
|
123
124
|
- doc/StrawberryAPI/ProjectFeedback.html
|
@@ -192,6 +193,7 @@ files:
|
|
192
193
|
- lib/strawberry_api/http_client.rb
|
193
194
|
- lib/strawberry_api/library.rb
|
194
195
|
- lib/strawberry_api/marker.rb
|
196
|
+
- lib/strawberry_api/metadatum.rb
|
195
197
|
- lib/strawberry_api/project.rb
|
196
198
|
- lib/strawberry_api/proxy.rb
|
197
199
|
- lib/strawberry_api/role.rb
|