cirro-ruby-client 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +18 -13
- data/cirro-ruby-client.gemspec +0 -1
- data/lib/cirro_io/client.rb +2 -0
- data/lib/cirro_io/client/gig.rb +27 -10
- data/lib/cirro_io/client/gig_result.rb +8 -0
- data/lib/cirro_io/client/gig_time_activity.rb +7 -0
- data/lib/cirro_io/client/version.rb +1 -1
- metadata +4 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4345f8d02b4f3afcc21cd23b3b0c2edcfadeeeeb887dd0e7c7f501b5bb2ced40
|
4
|
+
data.tar.gz: 00ee7217ad02c180d22cae50b5c23a915a8998c47efacf68e99c7da630e4d255
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec030038393796f3dcac6ccc457453100584e8fc2aeb4d2f9016a2b3d2cd004078e6155062bd940584909659f1e026cd325b0c2702dd7936afe80d03f7b7580e
|
7
|
+
data.tar.gz: '0853aff5207749a568f87fce5bf43d87ab47d883513c1c389f15d10398f71ce7d8f5ca4fced3e7f49aec4b042b74a34ccd2573a73d3c9fd2234c4de11fec3e0c'
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,17 +1,28 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/inderps/json_api_client
|
3
|
+
revision: 675e1c8b1bf9978ca4722c2aa19314fb0aa5860b
|
4
|
+
specs:
|
5
|
+
json_api_client (1.17.1)
|
6
|
+
activemodel (>= 3.2.0)
|
7
|
+
activesupport (>= 3.2.0)
|
8
|
+
addressable (~> 2.2)
|
9
|
+
faraday (>= 0.15.2, < 1.2.0)
|
10
|
+
faraday_middleware (>= 0.9.0, < 1.2.0)
|
11
|
+
rack (>= 0.2)
|
12
|
+
|
1
13
|
PATH
|
2
14
|
remote: .
|
3
15
|
specs:
|
4
16
|
cirro-ruby-client (1.1.0)
|
5
17
|
faraday_middleware
|
6
|
-
json_api_client
|
7
18
|
jwt
|
8
19
|
|
9
20
|
GEM
|
10
21
|
remote: https://rubygems.org/
|
11
22
|
specs:
|
12
|
-
activemodel (6.0.3.
|
13
|
-
activesupport (= 6.0.3.
|
14
|
-
activesupport (6.0.3.
|
23
|
+
activemodel (6.0.3.4)
|
24
|
+
activesupport (= 6.0.3.4)
|
25
|
+
activesupport (6.0.3.4)
|
15
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
27
|
i18n (>= 0.7, < 2)
|
17
28
|
minitest (~> 5.1)
|
@@ -33,13 +44,6 @@ GEM
|
|
33
44
|
hashdiff (1.0.1)
|
34
45
|
i18n (1.8.5)
|
35
46
|
concurrent-ruby (~> 1.0)
|
36
|
-
json_api_client (1.17.1)
|
37
|
-
activemodel (>= 3.2.0)
|
38
|
-
activesupport (>= 3.2.0)
|
39
|
-
addressable (~> 2.2)
|
40
|
-
faraday (>= 0.15.2, < 1.2.0)
|
41
|
-
faraday_middleware (>= 0.9.0, < 1.2.0)
|
42
|
-
rack (>= 0.2)
|
43
47
|
jwt (2.2.2)
|
44
48
|
method_source (1.0.0)
|
45
49
|
minitest (5.14.2)
|
@@ -84,14 +88,14 @@ GEM
|
|
84
88
|
rubocop (~> 0.87)
|
85
89
|
ruby-progressbar (1.10.1)
|
86
90
|
thread_safe (0.3.6)
|
87
|
-
tzinfo (1.2.
|
91
|
+
tzinfo (1.2.8)
|
88
92
|
thread_safe (~> 0.1)
|
89
93
|
unicode-display_width (1.7.0)
|
90
94
|
webmock (3.9.1)
|
91
95
|
addressable (>= 2.3.6)
|
92
96
|
crack (>= 0.3.2)
|
93
97
|
hashdiff (>= 0.4.0, < 2.0.0)
|
94
|
-
zeitwerk (2.4.
|
98
|
+
zeitwerk (2.4.2)
|
95
99
|
|
96
100
|
PLATFORMS
|
97
101
|
ruby
|
@@ -99,6 +103,7 @@ PLATFORMS
|
|
99
103
|
DEPENDENCIES
|
100
104
|
cirro-ruby-client!
|
101
105
|
faker
|
106
|
+
json_api_client!
|
102
107
|
pry
|
103
108
|
rake (~> 12.0)
|
104
109
|
rspec (~> 3.0)
|
data/cirro-ruby-client.gemspec
CHANGED
data/lib/cirro_io/client.rb
CHANGED
@@ -9,6 +9,8 @@ require 'cirro_io/client/app_user'
|
|
9
9
|
require 'cirro_io/client/app_worker'
|
10
10
|
require 'cirro_io/client/worker_invitation_filter'
|
11
11
|
require 'cirro_io/client/gig_task'
|
12
|
+
require 'cirro_io/client/gig_result'
|
13
|
+
require 'cirro_io/client/gig_time_activity'
|
12
14
|
require 'cirro_io/client/gig'
|
13
15
|
|
14
16
|
module CirroIO
|
data/lib/cirro_io/client/gig.rb
CHANGED
@@ -3,26 +3,43 @@ module CirroIO
|
|
3
3
|
class Gig < Base
|
4
4
|
has_one :worker_invitation_filter
|
5
5
|
has_many :gig_tasks
|
6
|
+
has_many :gig_results
|
7
|
+
has_many :gig_time_activities
|
6
8
|
|
7
9
|
# rubocop:disable Metrics/AbcSize
|
8
|
-
def bulk_create_with(
|
9
|
-
payload = { data: { attributes: attributes } }
|
10
|
+
def bulk_create_with(worker_invitation_filter, gig_tasks)
|
11
|
+
payload = { data: { attributes: attributes, relationships: {} } }
|
12
|
+
payload[:data][:relationships][:gig_tasks] = gig_tasks.map(&:attributes)
|
13
|
+
payload[:data][:relationships][:worker_invitation_filter] = worker_invitation_filter.attributes
|
10
14
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
+
response = self.class.custom_post('bulk/gigs', format_to_dashed_keys(payload))
|
16
|
+
|
17
|
+
self.class.parser.parse(self.class, response).first
|
18
|
+
end
|
15
19
|
|
16
|
-
|
17
|
-
|
18
|
-
|
20
|
+
def bulk_archive_with(gig_results, gig_time_activities)
|
21
|
+
payload = { data: { relationships: {} } }
|
22
|
+
payload[:data][:relationships][:gig_results] = gig_results.map do |result|
|
23
|
+
result.attributes.merge({ relationships: {
|
24
|
+
'app-worker': { data: result.app_worker.attributes },
|
25
|
+
'gig-task': { data: result.gig_task.attributes },
|
26
|
+
} })
|
27
|
+
end
|
28
|
+
payload[:data][:relationships][:gig_time_activities] = gig_time_activities.map do |activity|
|
29
|
+
activity.attributes.merge({ relationships: { 'app-worker': { data: activity.app_worker.attributes } } })
|
19
30
|
end
|
20
31
|
|
21
|
-
response = self.class.custom_post(
|
32
|
+
response = self.class.custom_post("bulk/gigs/#{id}/archive", format_to_dashed_keys(payload))
|
22
33
|
|
23
34
|
self.class.parser.parse(self.class, response).first
|
24
35
|
end
|
25
36
|
# rubocop:enable Metrics/AbcSize
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def format_to_dashed_keys(params)
|
41
|
+
params.deep_transform_keys { |key| key.to_s.gsub('_', '-') }
|
42
|
+
end
|
26
43
|
end
|
27
44
|
end
|
28
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cirro-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cirro Dev Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: json_api_client
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: faraday_middleware
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +67,9 @@ files:
|
|
81
67
|
- lib/cirro_io/client/configuration.rb
|
82
68
|
- lib/cirro_io/client/gig.rb
|
83
69
|
- lib/cirro_io/client/gig_invitation.rb
|
70
|
+
- lib/cirro_io/client/gig_result.rb
|
84
71
|
- lib/cirro_io/client/gig_task.rb
|
72
|
+
- lib/cirro_io/client/gig_time_activity.rb
|
85
73
|
- lib/cirro_io/client/jwt_authentication.rb
|
86
74
|
- lib/cirro_io/client/response_debugging_middleware.rb
|
87
75
|
- lib/cirro_io/client/version.rb
|