peoplegroup-connectors 0.1.77 → 0.1.81
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59bf4a7262edf9f57f6cb78d1af2c51f26878aa2b03c5024e0675f34f7325b2d
|
4
|
+
data.tar.gz: 4ca9690f2e103c0435cdcb2ad92ff782a2c777ffcf82aab0737f0fa0e0e8272b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ac63c2ce2f22471a1ba87af06621243a0ef62ac0922ff4af153a31fa04e6bf7c6dc414c1b59a245e6120e273694f43c755e596a9930c7d51dbb9a1f8f930421
|
7
|
+
data.tar.gz: fb23d5463e6bb43775698dce503de8ccd55a2d6c30dcfdeb7e3916d5dff57e62a785c8294eafd03e633693f94bbd1df1891fcfa4c03da6aaa61bdc857d8d2f8e
|
data/data/email_mapper.yml
CHANGED
@@ -1,4 +1,10 @@
|
|
1
1
|
- slack_email: cristiano
|
2
2
|
bamboo_email: ccasella
|
3
3
|
- slack_email: kencjohnston
|
4
|
-
bamboo_email: kjohnston
|
4
|
+
bamboo_email: kjohnston
|
5
|
+
- slack_email: jmeshell
|
6
|
+
bamboo_email: jporter
|
7
|
+
- slack_email: mjacob
|
8
|
+
bamboo_email: mgomez
|
9
|
+
- slack_email: nprecilla
|
10
|
+
bamboo_email: ngarcia
|
@@ -84,7 +84,7 @@ module PeopleGroup
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def update_variable(project, key, value, **opts)
|
87
|
-
retry_on_error { @client.update_variable(project, key, value, opts) }
|
87
|
+
retry_on_error { @client.update_variable(project, key, value, **opts) }
|
88
88
|
end
|
89
89
|
|
90
90
|
def find_or_create_epic(group_id, title, options = {})
|
@@ -0,0 +1,102 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'savon'
|
4
|
+
|
5
|
+
module PeopleGroup
|
6
|
+
module Connectors
|
7
|
+
class Workday
|
8
|
+
attr_accessor :client, :subdomain, :tenant
|
9
|
+
|
10
|
+
API_VERSION = 'v37.0'
|
11
|
+
MAX_RESULTS_PER_PAGE = 999
|
12
|
+
|
13
|
+
EmployeeNotFoundError = Class.new(StandardError)
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
@subdomain = ENV['WORKDAY_SUBDOMAIN']
|
17
|
+
@tenant = ENV['WORKDAY_TENANT']
|
18
|
+
isu_username = ENV['WORKDAY_ISU_USERNAME']
|
19
|
+
isu_password = ENV['WORKDAY_ISU_PASSWORD']
|
20
|
+
soap_debug_logs_enabled = ENV['WORKDAY_SOAP_DEBUG_LOGS'].present?
|
21
|
+
|
22
|
+
@client = Savon.client(
|
23
|
+
wsdl: "https://#{@subdomain}.workday.com/ccx/service/#{@tenant}/Human_Resources/#{API_VERSION}?wsdl",
|
24
|
+
log: soap_debug_logs_enabled,
|
25
|
+
wsse_auth: ["#{isu_username}@#{@tenant}", isu_password],
|
26
|
+
pretty_print_xml: true,
|
27
|
+
convert_request_keys_to: :camelcase,
|
28
|
+
env_namespace: :env,
|
29
|
+
namespace_identifier: nil,
|
30
|
+
namespaces: {
|
31
|
+
'xmlns' => nil,
|
32
|
+
'xmlns:env' => 'http://schemas.xmlsoap.org/soap/envelope/',
|
33
|
+
'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
|
34
|
+
'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'
|
35
|
+
}
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
def workers
|
40
|
+
retry_on_error do
|
41
|
+
@workers ||= auto_paginated_call(:get_workers, { message_tag: 'wd:Get_Workers_Request', attributes: attributes })
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def retry_on_error(&block)
|
48
|
+
Utils.retry_on_error(errors: [Net::ReadTimeout], delay: 3, &block)
|
49
|
+
end
|
50
|
+
|
51
|
+
def auto_paginated_call(operation_name, locals = {}, &block)
|
52
|
+
data = nil
|
53
|
+
page = 1
|
54
|
+
|
55
|
+
loop do
|
56
|
+
message = locals[:message] || {}
|
57
|
+
message_with_pagination_parameters = { **message, **pagination_parameters(page) }
|
58
|
+
response = @client.call(operation_name, { **locals, message: message_with_pagination_parameters }, &block)
|
59
|
+
|
60
|
+
# The response hash contains only one key named after the operation performed
|
61
|
+
# eg. get_workers_response
|
62
|
+
_operation_response_name, operation_result = response.to_hash.first
|
63
|
+
|
64
|
+
page = operation_result.dig(:response_results, :page).to_i
|
65
|
+
total_pages = operation_result.dig(:response_results, :total_pages).to_i
|
66
|
+
|
67
|
+
# The operation data hash contains only one key named after the Workday object(s) retrieved
|
68
|
+
# eg. worker
|
69
|
+
_object_label, partial_data = operation_result[:response_data].first
|
70
|
+
|
71
|
+
if page == 1
|
72
|
+
data = partial_data
|
73
|
+
else
|
74
|
+
data.concat(partial_data)
|
75
|
+
end
|
76
|
+
|
77
|
+
break if page == total_pages
|
78
|
+
|
79
|
+
page += 1
|
80
|
+
end
|
81
|
+
|
82
|
+
data
|
83
|
+
end
|
84
|
+
|
85
|
+
def pagination_parameters(page = 1, results_per_page = MAX_RESULTS_PER_PAGE)
|
86
|
+
{
|
87
|
+
'wd:Response_Filter' => {
|
88
|
+
'wd:Page' => page,
|
89
|
+
'wd:Count' => results_per_page
|
90
|
+
}
|
91
|
+
}
|
92
|
+
end
|
93
|
+
|
94
|
+
def attributes
|
95
|
+
{
|
96
|
+
'xmlns:wd' => 'urn:com.workday/bsvc',
|
97
|
+
'wd:version' => API_VERSION
|
98
|
+
}
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peoplegroup-connectors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.81
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lien van den steen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '2.5'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: savon
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.12.1
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.12.1
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rspec
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -182,6 +196,7 @@ files:
|
|
182
196
|
- lib/peoplegroup/connectors/pto_roots.rb
|
183
197
|
- lib/peoplegroup/connectors/slack.rb
|
184
198
|
- lib/peoplegroup/connectors/version.rb
|
199
|
+
- lib/peoplegroup/connectors/workday.rb
|
185
200
|
- lib/peoplegroup/utils.rb
|
186
201
|
homepage: https://gitlab.com/gitlab-com/people-group/peopleops-eng/connectors-gem
|
187
202
|
licenses:
|
@@ -190,7 +205,7 @@ metadata:
|
|
190
205
|
homepage_uri: https://gitlab.com/gitlab-com/people-group/peopleops-eng/connectors-gem
|
191
206
|
source_code_uri: https://gitlab.com/gitlab-com/people-group/peopleops-eng/connectors-gem
|
192
207
|
changelog_uri: https://gitlab.com/gitlab-com/people-group/peopleops-eng/connectors-gem
|
193
|
-
post_install_message:
|
208
|
+
post_install_message:
|
194
209
|
rdoc_options: []
|
195
210
|
require_paths:
|
196
211
|
- lib
|
@@ -205,8 +220,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
220
|
- !ruby/object:Gem::Version
|
206
221
|
version: '0'
|
207
222
|
requirements: []
|
208
|
-
rubygems_version: 3.
|
209
|
-
signing_key:
|
223
|
+
rubygems_version: 3.2.3
|
224
|
+
signing_key:
|
210
225
|
specification_version: 4
|
211
226
|
summary: Library for our shared connectors.
|
212
227
|
test_files: []
|