stackone_client 0.6.0 → 0.7.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/lib/stack_one/accounts.rb +279 -36
- data/lib/stack_one/ats.rb +4075 -580
- data/lib/stack_one/connect_sessions.rb +123 -22
- data/lib/stack_one/connectors.rb +111 -14
- data/lib/stack_one/crm.rb +563 -78
- data/lib/stack_one/hris.rb +3401 -458
- data/lib/stack_one/iam.rb +675 -56
- data/lib/stack_one/lms.rb +1533 -220
- data/lib/stack_one/marketing.rb +1503 -230
- data/lib/stack_one/models/operations/hris_update_employee_time_off_request_request.rb +33 -0
- data/lib/stack_one/models/operations/hris_update_employee_time_off_request_response.rb +36 -0
- data/lib/stack_one/models/operations/iam_delete_user_request.rb +27 -0
- data/lib/stack_one/models/operations/iam_delete_user_response.rb +36 -0
- data/lib/stack_one/models/operations/iam_update_user_request.rb +30 -0
- data/lib/stack_one/models/operations/iam_update_user_response.rb +36 -0
- data/lib/stack_one/models/operations/lms_list_users_queryparam_filter.rb +5 -2
- data/lib/stack_one/models/operations.rb +6 -0
- data/lib/stack_one/models/shared/atscreatejobrequestdto.rb +5 -2
- data/lib/stack_one/models/shared/atsupdatejobrequestdto.rb +5 -2
- data/lib/stack_one/models/shared/hriscreatetimeoffrequestdto.rb +2 -0
- data/lib/stack_one/models/shared/hriscreatetimeoffrequestdto_type.rb +2 -0
- data/lib/stack_one/models/shared/iamupdateuserrequestdto.rb +45 -0
- data/lib/stack_one/models/shared/iamupdateuserrequestdto_status.rb +27 -0
- data/lib/stack_one/models/shared/iamupdateuserrequestdto_value.rb +20 -0
- data/lib/stack_one/models/shared/job.rb +5 -2
- data/lib/stack_one/models/shared/rawresponse.rb +2 -2
- data/lib/stack_one/models/shared/timeoff.rb +2 -0
- data/lib/stack_one/models/shared/timeoff_type.rb +2 -0
- data/lib/stack_one/models/shared/updateuserapimodel.rb +45 -0
- data/lib/stack_one/models/shared/updateuserapimodel_status.rb +27 -0
- data/lib/stack_one/models/shared/updateuserapimodel_value.rb +20 -0
- data/lib/stack_one/models/shared.rb +6 -0
- data/lib/stack_one/proxy.rb +62 -11
- data/lib/stack_one/sdk_hooks/hooks.rb +101 -0
- data/lib/stack_one/sdk_hooks/types.rb +152 -0
- data/lib/stack_one/sdkconfiguration.rb +11 -4
- data/lib/stack_one/stackone.rb +22 -8
- data/lib/stack_one/utils/utils.rb +10 -0
- metadata +16 -2
@@ -7,6 +7,7 @@ require 'faraday'
|
|
7
7
|
require 'faraday/multipart'
|
8
8
|
require 'faraday/retry'
|
9
9
|
require 'sorbet-runtime'
|
10
|
+
require_relative 'sdk_hooks/hooks'
|
10
11
|
require_relative 'utils/retries'
|
11
12
|
|
12
13
|
module StackOne
|
@@ -21,8 +22,8 @@ module StackOne
|
|
21
22
|
end
|
22
23
|
|
23
24
|
|
24
|
-
sig { params(request: ::StackOne::Shared::ConnectSessionAuthenticate, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::StackoneAuthenticateConnectSessionResponse) }
|
25
|
-
def authenticate_connect_session(request, retries = nil)
|
25
|
+
sig { params(request: ::StackOne::Shared::ConnectSessionAuthenticate, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::StackoneAuthenticateConnectSessionResponse) }
|
26
|
+
def authenticate_connect_session(request, retries = nil, timeout_ms = nil)
|
26
27
|
# authenticate_connect_session - Authenticate Connect Session
|
27
28
|
url, params = @sdk_configuration.get_server_details
|
28
29
|
base_url = Utils.template_url(url, params)
|
@@ -31,6 +32,14 @@ module StackOne
|
|
31
32
|
req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
|
32
33
|
headers['content-type'] = req_content_type
|
33
34
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
35
|
+
|
36
|
+
if form
|
37
|
+
body = Utils.encode_form(form)
|
38
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
39
|
+
body = URI.encode_www_form(data)
|
40
|
+
else
|
41
|
+
body = data
|
42
|
+
end
|
34
43
|
headers['Accept'] = 'application/json'
|
35
44
|
headers['user-agent'] = @sdk_configuration.user_agent
|
36
45
|
retries ||= @sdk_configuration.retry_config
|
@@ -47,19 +56,61 @@ module StackOne
|
|
47
56
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
48
57
|
retry_options[:retry_statuses] = [429, 408]
|
49
58
|
|
59
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
60
|
+
|
61
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
62
|
+
timeout ||= @sdk_configuration.timeout
|
63
|
+
|
50
64
|
connection = @sdk_configuration.client.dup
|
51
65
|
connection.request :retry, retry_options
|
52
66
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
67
|
+
hook_ctx = SDKHooks::HookContext.new(
|
68
|
+
base_url: base_url,
|
69
|
+
oauth2_scopes: [],
|
70
|
+
operation_id: 'stackone_authenticate_connect_session',
|
71
|
+
security_source: @sdk_configuration.security_source
|
72
|
+
)
|
73
|
+
|
74
|
+
error = T.let(nil, T.nilable(StandardError))
|
75
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
76
|
+
|
77
|
+
begin
|
78
|
+
r = connection.post(url) do |req|
|
79
|
+
req.body = body
|
80
|
+
req.headers.merge!(headers)
|
81
|
+
req.options.timeout = timeout unless timeout.nil?
|
82
|
+
Utils.configure_request_security(req, security)
|
83
|
+
|
84
|
+
@sdk_configuration.hooks.before_request(
|
85
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
86
|
+
hook_ctx: hook_ctx
|
87
|
+
),
|
88
|
+
request: req
|
89
|
+
)
|
90
|
+
end
|
91
|
+
rescue StandardError => e
|
92
|
+
error = e
|
93
|
+
ensure
|
94
|
+
if r.nil? || Utils.error_status?(r.status)
|
95
|
+
r = @sdk_configuration.hooks.after_error(
|
96
|
+
error: error,
|
97
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
98
|
+
hook_ctx: hook_ctx
|
99
|
+
),
|
100
|
+
response: r
|
101
|
+
)
|
61
102
|
else
|
62
|
-
|
103
|
+
r = @sdk_configuration.hooks.after_success(
|
104
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
105
|
+
hook_ctx: hook_ctx
|
106
|
+
),
|
107
|
+
response: r
|
108
|
+
)
|
109
|
+
end
|
110
|
+
|
111
|
+
if r.nil?
|
112
|
+
raise error if !error.nil?
|
113
|
+
raise 'no response'
|
63
114
|
end
|
64
115
|
end
|
65
116
|
|
@@ -83,8 +134,8 @@ module StackOne
|
|
83
134
|
end
|
84
135
|
|
85
136
|
|
86
|
-
sig { params(request: ::StackOne::Shared::ConnectSessionCreate, retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::StackoneCreateConnectSessionResponse) }
|
87
|
-
def create_connect_session(request, retries = nil)
|
137
|
+
sig { params(request: ::StackOne::Shared::ConnectSessionCreate, retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::StackoneCreateConnectSessionResponse) }
|
138
|
+
def create_connect_session(request, retries = nil, timeout_ms = nil)
|
88
139
|
# create_connect_session - Create Connect Session
|
89
140
|
url, params = @sdk_configuration.get_server_details
|
90
141
|
base_url = Utils.template_url(url, params)
|
@@ -93,6 +144,14 @@ module StackOne
|
|
93
144
|
req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
|
94
145
|
headers['content-type'] = req_content_type
|
95
146
|
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
147
|
+
|
148
|
+
if form
|
149
|
+
body = Utils.encode_form(form)
|
150
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
151
|
+
body = URI.encode_www_form(data)
|
152
|
+
else
|
153
|
+
body = data
|
154
|
+
end
|
96
155
|
headers['Accept'] = 'application/json'
|
97
156
|
headers['user-agent'] = @sdk_configuration.user_agent
|
98
157
|
retries ||= @sdk_configuration.retry_config
|
@@ -109,19 +168,61 @@ module StackOne
|
|
109
168
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
110
169
|
retry_options[:retry_statuses] = [429, 408]
|
111
170
|
|
171
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
172
|
+
|
173
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
174
|
+
timeout ||= @sdk_configuration.timeout
|
175
|
+
|
112
176
|
connection = @sdk_configuration.client.dup
|
113
177
|
connection.request :retry, retry_options
|
114
178
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
179
|
+
hook_ctx = SDKHooks::HookContext.new(
|
180
|
+
base_url: base_url,
|
181
|
+
oauth2_scopes: [],
|
182
|
+
operation_id: 'stackone_create_connect_session',
|
183
|
+
security_source: @sdk_configuration.security_source
|
184
|
+
)
|
185
|
+
|
186
|
+
error = T.let(nil, T.nilable(StandardError))
|
187
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
188
|
+
|
189
|
+
begin
|
190
|
+
r = connection.post(url) do |req|
|
191
|
+
req.body = body
|
192
|
+
req.headers.merge!(headers)
|
193
|
+
req.options.timeout = timeout unless timeout.nil?
|
194
|
+
Utils.configure_request_security(req, security)
|
195
|
+
|
196
|
+
@sdk_configuration.hooks.before_request(
|
197
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
198
|
+
hook_ctx: hook_ctx
|
199
|
+
),
|
200
|
+
request: req
|
201
|
+
)
|
202
|
+
end
|
203
|
+
rescue StandardError => e
|
204
|
+
error = e
|
205
|
+
ensure
|
206
|
+
if r.nil? || Utils.error_status?(r.status)
|
207
|
+
r = @sdk_configuration.hooks.after_error(
|
208
|
+
error: error,
|
209
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
210
|
+
hook_ctx: hook_ctx
|
211
|
+
),
|
212
|
+
response: r
|
213
|
+
)
|
123
214
|
else
|
124
|
-
|
215
|
+
r = @sdk_configuration.hooks.after_success(
|
216
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
217
|
+
hook_ctx: hook_ctx
|
218
|
+
),
|
219
|
+
response: r
|
220
|
+
)
|
221
|
+
end
|
222
|
+
|
223
|
+
if r.nil?
|
224
|
+
raise error if !error.nil?
|
225
|
+
raise 'no response'
|
125
226
|
end
|
126
227
|
end
|
127
228
|
|
data/lib/stack_one/connectors.rb
CHANGED
@@ -7,6 +7,7 @@ require 'faraday'
|
|
7
7
|
require 'faraday/multipart'
|
8
8
|
require 'faraday/retry'
|
9
9
|
require 'sorbet-runtime'
|
10
|
+
require_relative 'sdk_hooks/hooks'
|
10
11
|
require_relative 'utils/retries'
|
11
12
|
|
12
13
|
module StackOne
|
@@ -21,8 +22,8 @@ module StackOne
|
|
21
22
|
end
|
22
23
|
|
23
24
|
|
24
|
-
sig { params(provider: ::String, include: T.nilable(::String), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::StackoneGetConnectorMetaResponse) }
|
25
|
-
def get_connector_meta(provider, include = nil, retries = nil)
|
25
|
+
sig { params(provider: ::String, include: T.nilable(::String), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::StackoneGetConnectorMetaResponse) }
|
26
|
+
def get_connector_meta(provider, include = nil, retries = nil, timeout_ms = nil)
|
26
27
|
# get_connector_meta - Get Connector Meta information for the given provider key
|
27
28
|
request = ::StackOne::Operations::StackoneGetConnectorMetaRequest.new(
|
28
29
|
|
@@ -55,14 +56,62 @@ module StackOne
|
|
55
56
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
56
57
|
retry_options[:retry_statuses] = [429, 408]
|
57
58
|
|
59
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
60
|
+
|
61
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
62
|
+
timeout ||= @sdk_configuration.timeout
|
63
|
+
|
58
64
|
connection = @sdk_configuration.client.dup
|
59
65
|
connection.request :retry, retry_options
|
60
66
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
67
|
+
hook_ctx = SDKHooks::HookContext.new(
|
68
|
+
base_url: base_url,
|
69
|
+
oauth2_scopes: [],
|
70
|
+
operation_id: 'stackone_get_connector_meta',
|
71
|
+
security_source: @sdk_configuration.security_source
|
72
|
+
)
|
73
|
+
|
74
|
+
error = T.let(nil, T.nilable(StandardError))
|
75
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
76
|
+
|
77
|
+
begin
|
78
|
+
r = connection.get(url) do |req|
|
79
|
+
req.headers.merge!(headers)
|
80
|
+
req.options.timeout = timeout unless timeout.nil?
|
81
|
+
req.params = query_params
|
82
|
+
Utils.configure_request_security(req, security)
|
83
|
+
|
84
|
+
@sdk_configuration.hooks.before_request(
|
85
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
86
|
+
hook_ctx: hook_ctx
|
87
|
+
),
|
88
|
+
request: req
|
89
|
+
)
|
90
|
+
end
|
91
|
+
rescue StandardError => e
|
92
|
+
error = e
|
93
|
+
ensure
|
94
|
+
if r.nil? || Utils.error_status?(r.status)
|
95
|
+
r = @sdk_configuration.hooks.after_error(
|
96
|
+
error: error,
|
97
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
98
|
+
hook_ctx: hook_ctx
|
99
|
+
),
|
100
|
+
response: r
|
101
|
+
)
|
102
|
+
else
|
103
|
+
r = @sdk_configuration.hooks.after_success(
|
104
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
105
|
+
hook_ctx: hook_ctx
|
106
|
+
),
|
107
|
+
response: r
|
108
|
+
)
|
109
|
+
end
|
110
|
+
|
111
|
+
if r.nil?
|
112
|
+
raise error if !error.nil?
|
113
|
+
raise 'no response'
|
114
|
+
end
|
66
115
|
end
|
67
116
|
|
68
117
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
@@ -85,8 +134,8 @@ module StackOne
|
|
85
134
|
end
|
86
135
|
|
87
136
|
|
88
|
-
sig { params(include: T.nilable(::String), retries: T.nilable(Utils::RetryConfig)).returns(::StackOne::Operations::StackoneListConnectorsMetaResponse) }
|
89
|
-
def list_connectors_meta(include = nil, retries = nil)
|
137
|
+
sig { params(include: T.nilable(::String), retries: T.nilable(Utils::RetryConfig), timeout_ms: T.nilable(Integer)).returns(::StackOne::Operations::StackoneListConnectorsMetaResponse) }
|
138
|
+
def list_connectors_meta(include = nil, retries = nil, timeout_ms = nil)
|
90
139
|
# list_connectors_meta - List Connectors Meta Information for all providers
|
91
140
|
request = ::StackOne::Operations::StackoneListConnectorsMetaRequest.new(
|
92
141
|
|
@@ -113,14 +162,62 @@ module StackOne
|
|
113
162
|
retry_options = retries.to_faraday_retry_options(initial_time: Time.now)
|
114
163
|
retry_options[:retry_statuses] = [429, 408]
|
115
164
|
|
165
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
166
|
+
|
167
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
168
|
+
timeout ||= @sdk_configuration.timeout
|
169
|
+
|
116
170
|
connection = @sdk_configuration.client.dup
|
117
171
|
connection.request :retry, retry_options
|
118
172
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
173
|
+
hook_ctx = SDKHooks::HookContext.new(
|
174
|
+
base_url: base_url,
|
175
|
+
oauth2_scopes: [],
|
176
|
+
operation_id: 'stackone_list_connectors_meta',
|
177
|
+
security_source: @sdk_configuration.security_source
|
178
|
+
)
|
179
|
+
|
180
|
+
error = T.let(nil, T.nilable(StandardError))
|
181
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
182
|
+
|
183
|
+
begin
|
184
|
+
r = connection.get(url) do |req|
|
185
|
+
req.headers.merge!(headers)
|
186
|
+
req.options.timeout = timeout unless timeout.nil?
|
187
|
+
req.params = query_params
|
188
|
+
Utils.configure_request_security(req, security)
|
189
|
+
|
190
|
+
@sdk_configuration.hooks.before_request(
|
191
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
192
|
+
hook_ctx: hook_ctx
|
193
|
+
),
|
194
|
+
request: req
|
195
|
+
)
|
196
|
+
end
|
197
|
+
rescue StandardError => e
|
198
|
+
error = e
|
199
|
+
ensure
|
200
|
+
if r.nil? || Utils.error_status?(r.status)
|
201
|
+
r = @sdk_configuration.hooks.after_error(
|
202
|
+
error: error,
|
203
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
204
|
+
hook_ctx: hook_ctx
|
205
|
+
),
|
206
|
+
response: r
|
207
|
+
)
|
208
|
+
else
|
209
|
+
r = @sdk_configuration.hooks.after_success(
|
210
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
211
|
+
hook_ctx: hook_ctx
|
212
|
+
),
|
213
|
+
response: r
|
214
|
+
)
|
215
|
+
end
|
216
|
+
|
217
|
+
if r.nil?
|
218
|
+
raise error if !error.nil?
|
219
|
+
raise 'no response'
|
220
|
+
end
|
124
221
|
end
|
125
222
|
|
126
223
|
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|