cirro-ruby-client 1.0.1 → 1.1.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/Gemfile.lock +2 -1
- data/cirro-ruby-client.gemspec +1 -0
- data/lib/cirro_io/client.rb +3 -0
- data/lib/cirro_io/client/app_user.rb +0 -3
- data/lib/cirro_io/client/app_worker.rb +0 -4
- data/lib/cirro_io/client/base.rb +13 -0
- data/lib/cirro_io/client/gig.rb +28 -0
- data/lib/cirro_io/client/gig_invitation.rb +0 -3
- data/lib/cirro_io/client/gig_task.rb +6 -0
- data/lib/cirro_io/client/response_debugging_middleware.rb +1 -1
- data/lib/cirro_io/client/version.rb +1 -1
- data/lib/cirro_io/client/worker_invitation_filter.rb +6 -0
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6a519fabbdd1bfa16f4f088ec3d7dc648c6aceb74931e420ed1488619735cac
|
4
|
+
data.tar.gz: c08439cdaddb6444a2aba457dc93d68a997647a1472c6b39493461eddceb0402
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e82c0ff26229b5178e05e471a2fb746ac1de0cf5e531b1dcb0e77dfed39ba5b9205f1bdeaa91d221fe64617c578f473745896ee005f062ff7b947e83352b27af
|
7
|
+
data.tar.gz: 131bf1dc4a613de2c26ffaf3328ca1631e4a5b9f672274975ef69e1c767a035a9e33130cb2ccd834de4154c68762c25d3c763d53a655e6a866f6c395b33e8628
|
data/Gemfile.lock
CHANGED
data/cirro-ruby-client.gemspec
CHANGED
data/lib/cirro_io/client.rb
CHANGED
@@ -7,6 +7,9 @@ require 'cirro_io/client/base'
|
|
7
7
|
require 'cirro_io/client/gig_invitation'
|
8
8
|
require 'cirro_io/client/app_user'
|
9
9
|
require 'cirro_io/client/app_worker'
|
10
|
+
require 'cirro_io/client/worker_invitation_filter'
|
11
|
+
require 'cirro_io/client/gig_task'
|
12
|
+
require 'cirro_io/client/gig'
|
10
13
|
|
11
14
|
module CirroIO
|
12
15
|
module Client
|
data/lib/cirro_io/client/base.rb
CHANGED
@@ -9,6 +9,19 @@ module CirroIO
|
|
9
9
|
super(url)
|
10
10
|
connection.faraday.url_prefix = url
|
11
11
|
end
|
12
|
+
|
13
|
+
def self.custom_post(endpoint, payload)
|
14
|
+
custom_connection.post(endpoint, payload.to_json)
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.custom_connection
|
18
|
+
Faraday.new(url: "#{CirroIO::Client.configuration.site}/#{CirroIO::Client.configuration.api_version}") do |conn|
|
19
|
+
conn.request :json
|
20
|
+
conn.response :json
|
21
|
+
conn.use CirroIO::Client::JwtAuthentication
|
22
|
+
conn.use JsonApiClient::Middleware::Status, {}
|
23
|
+
end
|
24
|
+
end
|
12
25
|
end
|
13
26
|
end
|
14
27
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module CirroIO
|
2
|
+
module Client
|
3
|
+
class Gig < Base
|
4
|
+
has_one :worker_invitation_filter
|
5
|
+
has_many :gig_tasks
|
6
|
+
|
7
|
+
# rubocop:disable Metrics/AbcSize
|
8
|
+
def bulk_create_with(attrs)
|
9
|
+
payload = { data: { attributes: attributes } }
|
10
|
+
|
11
|
+
if attrs[:gig_tasks]
|
12
|
+
payload[:data][:relationships] ||= {}
|
13
|
+
payload[:data][:relationships][:gig_tasks] = attrs[:gig_tasks].map(&:attributes)
|
14
|
+
end
|
15
|
+
|
16
|
+
if attrs[:worker_invitation_filter]
|
17
|
+
payload[:data][:relationships] ||= {}
|
18
|
+
payload[:data][:relationships][:worker_invitation_filter] = attrs[:worker_invitation_filter].attributes
|
19
|
+
end
|
20
|
+
|
21
|
+
response = self.class.custom_post('bulk/gigs', payload)
|
22
|
+
|
23
|
+
self.class.parser.parse(self.class, response).first
|
24
|
+
end
|
25
|
+
# rubocop:enable Metrics/AbcSize
|
26
|
+
end
|
27
|
+
end
|
28
|
+
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.0
|
4
|
+
version: 1.1.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-
|
11
|
+
date: 2020-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: faraday_middleware
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: Simple wrapper for Cirro API
|
42
56
|
email:
|
43
57
|
- OrgtestIODevelopers@epam.com
|
@@ -65,10 +79,13 @@ files:
|
|
65
79
|
- lib/cirro_io/client/app_worker.rb
|
66
80
|
- lib/cirro_io/client/base.rb
|
67
81
|
- lib/cirro_io/client/configuration.rb
|
82
|
+
- lib/cirro_io/client/gig.rb
|
68
83
|
- lib/cirro_io/client/gig_invitation.rb
|
84
|
+
- lib/cirro_io/client/gig_task.rb
|
69
85
|
- lib/cirro_io/client/jwt_authentication.rb
|
70
86
|
- lib/cirro_io/client/response_debugging_middleware.rb
|
71
87
|
- lib/cirro_io/client/version.rb
|
88
|
+
- lib/cirro_io/client/worker_invitation_filter.rb
|
72
89
|
homepage: https://cirro.io/api-docs/v1#cirro-api-documentation
|
73
90
|
licenses:
|
74
91
|
- MIT
|