ssoready 0.1.0 → 1.0.0

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: eae7d3a91ffaa2a24a93694e881ad865dd00f9cb4567f657d37335975029ab0a
4
- data.tar.gz: 405f5ab9bb277715d81ab9810491133c1cdebada999d72b44a4c3e8b4caf2c8c
3
+ metadata.gz: 34313ad0f73b2be9675770afe8a5f14545f5f9f0b81dee7d613ffcbd2da29615
4
+ data.tar.gz: 27ced1e68eddd8c89b3c21d905d42ffb55e0aa7803e0b6aa159eec1f806dea8f
5
5
  SHA512:
6
- metadata.gz: f5ab8e8cade77237383875ecc23607ed64e7998cbcfd38f5b92ef7919ac3a0efabd63fea14661f8df3a37a852baf6e705df1455da6067518aa566f6ac5f15da2
7
- data.tar.gz: 8edde9a2038c2af2f12cdbd63e75bb47098c5bd99c7ad9cfbeb45d1dba24b345e15593357abfd464e7e0b90c11f3b4dbf2f2dd87b40ac5990a924968ba12f7a4
6
+ metadata.gz: 81cc165b8ec8de00e0c20cb209214d7aaa8f9d0382cd80b23af4f48b162e8eb6697aed5225e1d9c0eadfa49e3189baea21eb6ddd4c4a25a9d9babf47d9d2a965
7
+ data.tar.gz: 5c6ee054e4bd168d3a5d270763d3b9af1e5d19abecab0694dd27deaaaf34c2e286856759c1bd84f2069e2ebcd4b14907481cbabaae997da6c3efed2d5e2ab755
data/lib/requests.rb CHANGED
@@ -7,32 +7,27 @@ require "async/http/faraday"
7
7
 
8
8
  module SSOReady
9
9
  class RequestClient
10
- # @return [Hash{String => String}]
11
- attr_reader :headers
12
10
  # @return [Faraday]
13
11
  attr_reader :conn
14
12
  # @return [String]
15
13
  attr_reader :base_url
16
14
  # @return [String]
15
+ attr_reader :api_key
16
+ # @return [String]
17
17
  attr_reader :default_environment
18
18
 
19
- # @param environment [SSOReady::Environment]
20
19
  # @param base_url [String]
20
+ # @param environment [SSOReady::Environment]
21
21
  # @param max_retries [Long] The number of times to retry a failed request, defaults to 2.
22
22
  # @param timeout_in_seconds [Long]
23
23
  # @param api_key [String]
24
24
  # @return [SSOReady::RequestClient]
25
- def initialize(environment: SSOReady::Environment::DEFAULT, base_url: nil, max_retries: nil,
26
- timeout_in_seconds: nil, api_key: nil)
25
+ def initialize(base_url: nil, environment: SSOReady::Environment::DEFAULT, max_retries: nil,
26
+ timeout_in_seconds: nil, api_key: ENV["SSOREADY_API_KEY"])
27
27
  @default_environment = environment
28
28
  @base_url = environment || base_url
29
- @headers = {
30
- "X-Fern-Language": "Ruby",
31
- "X-Fern-SDK-Name": "ssoready",
32
- "X-Fern-SDK-Version": "0.1.0",
33
- "Authorization": %(Bearer #{api_key || ENV["SSOREADY_API_KEY"]})
34
- }
35
- @conn = Faraday.new(headers: @headers) do |faraday|
29
+ @api_key = "Bearer #{api_key}"
30
+ @conn = Faraday.new do |faraday|
36
31
  faraday.request :json
37
32
  faraday.response :raise_error, include_request: true
38
33
  faraday.request :retry, { max: max_retries } unless max_retries.nil?
@@ -45,35 +40,37 @@ module SSOReady
45
40
  def get_url(request_options: nil)
46
41
  request_options&.base_url || @default_environment || @base_url
47
42
  end
43
+
44
+ # @return [Hash{String => String}]
45
+ def get_headers
46
+ headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "ssoready", "X-Fern-SDK-Version": "1.0.0" }
47
+ headers["Authorization"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
48
+ headers
49
+ end
48
50
  end
49
51
 
50
52
  class AsyncRequestClient
51
- # @return [Hash{String => String}]
52
- attr_reader :headers
53
53
  # @return [Faraday]
54
54
  attr_reader :conn
55
55
  # @return [String]
56
56
  attr_reader :base_url
57
57
  # @return [String]
58
+ attr_reader :api_key
59
+ # @return [String]
58
60
  attr_reader :default_environment
59
61
 
60
- # @param environment [SSOReady::Environment]
61
62
  # @param base_url [String]
63
+ # @param environment [SSOReady::Environment]
62
64
  # @param max_retries [Long] The number of times to retry a failed request, defaults to 2.
63
65
  # @param timeout_in_seconds [Long]
64
66
  # @param api_key [String]
65
67
  # @return [SSOReady::AsyncRequestClient]
66
- def initialize(environment: SSOReady::Environment::DEFAULT, base_url: nil, max_retries: nil,
67
- timeout_in_seconds: nil, api_key: nil)
68
+ def initialize(base_url: nil, environment: SSOReady::Environment::DEFAULT, max_retries: nil,
69
+ timeout_in_seconds: nil, api_key: ENV["SSOREADY_API_KEY"])
68
70
  @default_environment = environment
69
71
  @base_url = environment || base_url
70
- @headers = {
71
- "X-Fern-Language": "Ruby",
72
- "X-Fern-SDK-Name": "ssoready",
73
- "X-Fern-SDK-Version": "0.1.0",
74
- "Authorization": %(Bearer #{api_key || ENV["SSOREADY_API_KEY"]})
75
- }
76
- @conn = Faraday.new(headers: @headers) do |faraday|
72
+ @api_key = "Bearer #{api_key}"
73
+ @conn = Faraday.new do |faraday|
77
74
  faraday.request :json
78
75
  faraday.response :raise_error, include_request: true
79
76
  faraday.adapter :async_http
@@ -87,6 +84,13 @@ module SSOReady
87
84
  def get_url(request_options: nil)
88
85
  request_options&.base_url || @default_environment || @base_url
89
86
  end
87
+
88
+ # @return [Hash{String => String}]
89
+ def get_headers
90
+ headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "ssoready", "X-Fern-SDK-Version": "1.0.0" }
91
+ headers["Authorization"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil?
92
+ headers
93
+ end
90
94
  end
91
95
 
92
96
  # Additional options for request-specific configuration when calling APIs via the
@@ -27,8 +27,8 @@ module SSOReady
27
27
  # @return [SSOReady::ListOrganizationsResponse]
28
28
  # @example
29
29
  # api = SSOReady::Client.new(
30
- # environment: SSOReady::Environment::DEFAULT,
31
30
  # base_url: "https://api.example.com",
31
+ # environment: SSOReady::Environment::DEFAULT,
32
32
  # api_key: "YOUR_AUTH_TOKEN"
33
33
  # )
34
34
  # api.management.organizations.list_organizations
@@ -36,8 +36,15 @@ module SSOReady
36
36
  response = @request_client.conn.get do |req|
37
37
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
38
38
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
39
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
39
+ req.headers = {
40
+ **(req.headers || {}),
41
+ **@request_client.get_headers,
42
+ **(request_options&.additional_headers || {})
43
+ }.compact
40
44
  req.params = { **(request_options&.additional_query_parameters || {}), "pageToken": page_token }.compact
45
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
46
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
47
+ end
41
48
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations"
42
49
  end
43
50
  SSOReady::ListOrganizationsResponse.from_json(json_object: response.body)
@@ -55,8 +62,8 @@ module SSOReady
55
62
  # @return [SSOReady::CreateOrganizationResponse]
56
63
  # @example
57
64
  # api = SSOReady::Client.new(
58
- # environment: SSOReady::Environment::DEFAULT,
59
65
  # base_url: "https://api.example.com",
66
+ # environment: SSOReady::Environment::DEFAULT,
60
67
  # api_key: "YOUR_AUTH_TOKEN"
61
68
  # )
62
69
  # api.management.organizations.create_organization(request: { })
@@ -64,7 +71,14 @@ module SSOReady
64
71
  response = @request_client.conn.post do |req|
65
72
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
66
73
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
67
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
74
+ req.headers = {
75
+ **(req.headers || {}),
76
+ **@request_client.get_headers,
77
+ **(request_options&.additional_headers || {})
78
+ }.compact
79
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
80
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
81
+ end
68
82
  req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
69
83
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations"
70
84
  end
@@ -78,8 +92,8 @@ module SSOReady
78
92
  # @return [SSOReady::GetOrganizationResponse]
79
93
  # @example
80
94
  # api = SSOReady::Client.new(
81
- # environment: SSOReady::Environment::DEFAULT,
82
95
  # base_url: "https://api.example.com",
96
+ # environment: SSOReady::Environment::DEFAULT,
83
97
  # api_key: "YOUR_AUTH_TOKEN"
84
98
  # )
85
99
  # api.management.organizations.get_organization(id: "id")
@@ -87,7 +101,17 @@ module SSOReady
87
101
  response = @request_client.conn.get do |req|
88
102
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
89
103
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
90
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
104
+ req.headers = {
105
+ **(req.headers || {}),
106
+ **@request_client.get_headers,
107
+ **(request_options&.additional_headers || {})
108
+ }.compact
109
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
110
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
111
+ end
112
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
113
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
114
+ end
91
115
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations/#{id}"
92
116
  end
93
117
  SSOReady::GetOrganizationResponse.from_json(json_object: response.body)
@@ -106,8 +130,8 @@ module SSOReady
106
130
  # @return [SSOReady::UpdateOrganizationResponse]
107
131
  # @example
108
132
  # api = SSOReady::Client.new(
109
- # environment: SSOReady::Environment::DEFAULT,
110
133
  # base_url: "https://api.example.com",
134
+ # environment: SSOReady::Environment::DEFAULT,
111
135
  # api_key: "YOUR_AUTH_TOKEN"
112
136
  # )
113
137
  # api.management.organizations.update_organization(id: "id", request: { })
@@ -115,7 +139,14 @@ module SSOReady
115
139
  response = @request_client.conn.patch do |req|
116
140
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
117
141
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
118
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
142
+ req.headers = {
143
+ **(req.headers || {}),
144
+ **@request_client.get_headers,
145
+ **(request_options&.additional_headers || {})
146
+ }.compact
147
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
148
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
149
+ end
119
150
  req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
120
151
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations/#{id}"
121
152
  end
@@ -140,8 +171,8 @@ module SSOReady
140
171
  # @return [SSOReady::ListOrganizationsResponse]
141
172
  # @example
142
173
  # api = SSOReady::Client.new(
143
- # environment: SSOReady::Environment::DEFAULT,
144
174
  # base_url: "https://api.example.com",
175
+ # environment: SSOReady::Environment::DEFAULT,
145
176
  # api_key: "YOUR_AUTH_TOKEN"
146
177
  # )
147
178
  # api.management.organizations.list_organizations
@@ -150,8 +181,15 @@ module SSOReady
150
181
  response = @request_client.conn.get do |req|
151
182
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
152
183
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
153
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
184
+ req.headers = {
185
+ **(req.headers || {}),
186
+ **@request_client.get_headers,
187
+ **(request_options&.additional_headers || {})
188
+ }.compact
154
189
  req.params = { **(request_options&.additional_query_parameters || {}), "pageToken": page_token }.compact
190
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
191
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
192
+ end
155
193
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations"
156
194
  end
157
195
  SSOReady::ListOrganizationsResponse.from_json(json_object: response.body)
@@ -170,8 +208,8 @@ module SSOReady
170
208
  # @return [SSOReady::CreateOrganizationResponse]
171
209
  # @example
172
210
  # api = SSOReady::Client.new(
173
- # environment: SSOReady::Environment::DEFAULT,
174
211
  # base_url: "https://api.example.com",
212
+ # environment: SSOReady::Environment::DEFAULT,
175
213
  # api_key: "YOUR_AUTH_TOKEN"
176
214
  # )
177
215
  # api.management.organizations.create_organization(request: { })
@@ -180,7 +218,14 @@ module SSOReady
180
218
  response = @request_client.conn.post do |req|
181
219
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
182
220
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
183
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
221
+ req.headers = {
222
+ **(req.headers || {}),
223
+ **@request_client.get_headers,
224
+ **(request_options&.additional_headers || {})
225
+ }.compact
226
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
227
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
228
+ end
184
229
  req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
185
230
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations"
186
231
  end
@@ -195,8 +240,8 @@ module SSOReady
195
240
  # @return [SSOReady::GetOrganizationResponse]
196
241
  # @example
197
242
  # api = SSOReady::Client.new(
198
- # environment: SSOReady::Environment::DEFAULT,
199
243
  # base_url: "https://api.example.com",
244
+ # environment: SSOReady::Environment::DEFAULT,
200
245
  # api_key: "YOUR_AUTH_TOKEN"
201
246
  # )
202
247
  # api.management.organizations.get_organization(id: "id")
@@ -205,7 +250,17 @@ module SSOReady
205
250
  response = @request_client.conn.get do |req|
206
251
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
207
252
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
208
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
253
+ req.headers = {
254
+ **(req.headers || {}),
255
+ **@request_client.get_headers,
256
+ **(request_options&.additional_headers || {})
257
+ }.compact
258
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
259
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
260
+ end
261
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
262
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
263
+ end
209
264
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations/#{id}"
210
265
  end
211
266
  SSOReady::GetOrganizationResponse.from_json(json_object: response.body)
@@ -225,8 +280,8 @@ module SSOReady
225
280
  # @return [SSOReady::UpdateOrganizationResponse]
226
281
  # @example
227
282
  # api = SSOReady::Client.new(
228
- # environment: SSOReady::Environment::DEFAULT,
229
283
  # base_url: "https://api.example.com",
284
+ # environment: SSOReady::Environment::DEFAULT,
230
285
  # api_key: "YOUR_AUTH_TOKEN"
231
286
  # )
232
287
  # api.management.organizations.update_organization(id: "id", request: { })
@@ -235,7 +290,14 @@ module SSOReady
235
290
  response = @request_client.conn.patch do |req|
236
291
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
237
292
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
238
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
293
+ req.headers = {
294
+ **(req.headers || {}),
295
+ **@request_client.get_headers,
296
+ **(request_options&.additional_headers || {})
297
+ }.compact
298
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
299
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
300
+ end
239
301
  req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
240
302
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations/#{id}"
241
303
  end
@@ -28,8 +28,8 @@ module SSOReady
28
28
  # @return [SSOReady::ListSAMLConnectionsResponse]
29
29
  # @example
30
30
  # api = SSOReady::Client.new(
31
- # environment: SSOReady::Environment::DEFAULT,
32
31
  # base_url: "https://api.example.com",
32
+ # environment: SSOReady::Environment::DEFAULT,
33
33
  # api_key: "YOUR_AUTH_TOKEN"
34
34
  # )
35
35
  # api.management.saml_connections.list_saml_connections
@@ -37,12 +37,19 @@ module SSOReady
37
37
  response = @request_client.conn.get do |req|
38
38
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
39
39
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
40
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
40
+ req.headers = {
41
+ **(req.headers || {}),
42
+ **@request_client.get_headers,
43
+ **(request_options&.additional_headers || {})
44
+ }.compact
41
45
  req.params = {
42
46
  **(request_options&.additional_query_parameters || {}),
43
47
  "organizationId": organization_id,
44
48
  "pageToken": page_token
45
49
  }.compact
50
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
51
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
52
+ end
46
53
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections"
47
54
  end
48
55
  SSOReady::ListSAMLConnectionsResponse.from_json(json_object: response.body)
@@ -63,8 +70,8 @@ module SSOReady
63
70
  # @return [SSOReady::CreateSAMLConnectionResponse]
64
71
  # @example
65
72
  # api = SSOReady::Client.new(
66
- # environment: SSOReady::Environment::DEFAULT,
67
73
  # base_url: "https://api.example.com",
74
+ # environment: SSOReady::Environment::DEFAULT,
68
75
  # api_key: "YOUR_AUTH_TOKEN"
69
76
  # )
70
77
  # api.management.saml_connections.create_saml_connection(request: { })
@@ -72,7 +79,14 @@ module SSOReady
72
79
  response = @request_client.conn.post do |req|
73
80
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
74
81
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
75
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
82
+ req.headers = {
83
+ **(req.headers || {}),
84
+ **@request_client.get_headers,
85
+ **(request_options&.additional_headers || {})
86
+ }.compact
87
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
88
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
89
+ end
76
90
  req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
77
91
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections"
78
92
  end
@@ -86,8 +100,8 @@ module SSOReady
86
100
  # @return [SSOReady::GetSAMLConnectionResponse]
87
101
  # @example
88
102
  # api = SSOReady::Client.new(
89
- # environment: SSOReady::Environment::DEFAULT,
90
103
  # base_url: "https://api.example.com",
104
+ # environment: SSOReady::Environment::DEFAULT,
91
105
  # api_key: "YOUR_AUTH_TOKEN"
92
106
  # )
93
107
  # api.management.saml_connections.get_saml_connection(id: "id")
@@ -95,7 +109,17 @@ module SSOReady
95
109
  response = @request_client.conn.get do |req|
96
110
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
97
111
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
98
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
112
+ req.headers = {
113
+ **(req.headers || {}),
114
+ **@request_client.get_headers,
115
+ **(request_options&.additional_headers || {})
116
+ }.compact
117
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
118
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
119
+ end
120
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
121
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
122
+ end
99
123
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections/#{id}"
100
124
  end
101
125
  SSOReady::GetSAMLConnectionResponse.from_json(json_object: response.body)
@@ -117,8 +141,8 @@ module SSOReady
117
141
  # @return [SSOReady::UpdateSAMLConnectionResponse]
118
142
  # @example
119
143
  # api = SSOReady::Client.new(
120
- # environment: SSOReady::Environment::DEFAULT,
121
144
  # base_url: "https://api.example.com",
145
+ # environment: SSOReady::Environment::DEFAULT,
122
146
  # api_key: "YOUR_AUTH_TOKEN"
123
147
  # )
124
148
  # api.management.saml_connections.update_saml_connection(id: "id", request: { })
@@ -126,7 +150,14 @@ module SSOReady
126
150
  response = @request_client.conn.patch do |req|
127
151
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
128
152
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
129
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
153
+ req.headers = {
154
+ **(req.headers || {}),
155
+ **@request_client.get_headers,
156
+ **(request_options&.additional_headers || {})
157
+ }.compact
158
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
159
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
160
+ end
130
161
  req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
131
162
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections/#{id}"
132
163
  end
@@ -152,8 +183,8 @@ module SSOReady
152
183
  # @return [SSOReady::ListSAMLConnectionsResponse]
153
184
  # @example
154
185
  # api = SSOReady::Client.new(
155
- # environment: SSOReady::Environment::DEFAULT,
156
186
  # base_url: "https://api.example.com",
187
+ # environment: SSOReady::Environment::DEFAULT,
157
188
  # api_key: "YOUR_AUTH_TOKEN"
158
189
  # )
159
190
  # api.management.saml_connections.list_saml_connections
@@ -162,12 +193,19 @@ module SSOReady
162
193
  response = @request_client.conn.get do |req|
163
194
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
164
195
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
165
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
196
+ req.headers = {
197
+ **(req.headers || {}),
198
+ **@request_client.get_headers,
199
+ **(request_options&.additional_headers || {})
200
+ }.compact
166
201
  req.params = {
167
202
  **(request_options&.additional_query_parameters || {}),
168
203
  "organizationId": organization_id,
169
204
  "pageToken": page_token
170
205
  }.compact
206
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
207
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
208
+ end
171
209
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections"
172
210
  end
173
211
  SSOReady::ListSAMLConnectionsResponse.from_json(json_object: response.body)
@@ -189,8 +227,8 @@ module SSOReady
189
227
  # @return [SSOReady::CreateSAMLConnectionResponse]
190
228
  # @example
191
229
  # api = SSOReady::Client.new(
192
- # environment: SSOReady::Environment::DEFAULT,
193
230
  # base_url: "https://api.example.com",
231
+ # environment: SSOReady::Environment::DEFAULT,
194
232
  # api_key: "YOUR_AUTH_TOKEN"
195
233
  # )
196
234
  # api.management.saml_connections.create_saml_connection(request: { })
@@ -199,7 +237,14 @@ module SSOReady
199
237
  response = @request_client.conn.post do |req|
200
238
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
201
239
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
202
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
240
+ req.headers = {
241
+ **(req.headers || {}),
242
+ **@request_client.get_headers,
243
+ **(request_options&.additional_headers || {})
244
+ }.compact
245
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
246
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
247
+ end
203
248
  req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
204
249
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections"
205
250
  end
@@ -214,8 +259,8 @@ module SSOReady
214
259
  # @return [SSOReady::GetSAMLConnectionResponse]
215
260
  # @example
216
261
  # api = SSOReady::Client.new(
217
- # environment: SSOReady::Environment::DEFAULT,
218
262
  # base_url: "https://api.example.com",
263
+ # environment: SSOReady::Environment::DEFAULT,
219
264
  # api_key: "YOUR_AUTH_TOKEN"
220
265
  # )
221
266
  # api.management.saml_connections.get_saml_connection(id: "id")
@@ -224,7 +269,17 @@ module SSOReady
224
269
  response = @request_client.conn.get do |req|
225
270
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
226
271
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
227
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
272
+ req.headers = {
273
+ **(req.headers || {}),
274
+ **@request_client.get_headers,
275
+ **(request_options&.additional_headers || {})
276
+ }.compact
277
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
278
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
279
+ end
280
+ unless request_options.nil? || request_options&.additional_body_parameters.nil?
281
+ req.body = { **(request_options&.additional_body_parameters || {}) }.compact
282
+ end
228
283
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections/#{id}"
229
284
  end
230
285
  SSOReady::GetSAMLConnectionResponse.from_json(json_object: response.body)
@@ -247,8 +302,8 @@ module SSOReady
247
302
  # @return [SSOReady::UpdateSAMLConnectionResponse]
248
303
  # @example
249
304
  # api = SSOReady::Client.new(
250
- # environment: SSOReady::Environment::DEFAULT,
251
305
  # base_url: "https://api.example.com",
306
+ # environment: SSOReady::Environment::DEFAULT,
252
307
  # api_key: "YOUR_AUTH_TOKEN"
253
308
  # )
254
309
  # api.management.saml_connections.update_saml_connection(id: "id", request: { })
@@ -257,7 +312,14 @@ module SSOReady
257
312
  response = @request_client.conn.patch do |req|
258
313
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
259
314
  req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil?
260
- req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
315
+ req.headers = {
316
+ **(req.headers || {}),
317
+ **@request_client.get_headers,
318
+ **(request_options&.additional_headers || {})
319
+ }.compact
320
+ unless request_options.nil? || request_options&.additional_query_parameters.nil?
321
+ req.params = { **(request_options&.additional_query_parameters || {}) }.compact
322
+ end
261
323
  req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
262
324
  req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections/#{id}"
263
325
  end