Class: SSOReady::Management::AsyncOrganizationsClient
- Inherits:
-
Object
- Object
- SSOReady::Management::AsyncOrganizationsClient
- Defined in:
- lib/ssoready/management/organizations/client.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create_organization(request:, request_options: nil) ⇒ SSOReady::CreateOrganizationResponse
Creates an organization.
-
#get_organization(id:, request_options: nil) ⇒ SSOReady::GetOrganizationResponse
Gets an organization.
- #initialize(request_client:) ⇒ SSOReady::Management::AsyncOrganizationsClient constructor
-
#list_organizations(page_token: nil, request_options: nil) ⇒ SSOReady::ListOrganizationsResponse
Gets a list of organizations.
-
#update_organization(id:, request:, request_options: nil) ⇒ SSOReady::UpdateOrganizationResponse
Updates an organization.
Constructor Details
#initialize(request_client:) ⇒ SSOReady::Management::AsyncOrganizationsClient
163 164 165 |
# File 'lib/ssoready/management/organizations/client.rb', line 163 def initialize(request_client:) @request_client = request_client end |
Instance Attribute Details
#request_client ⇒ SSOReady::AsyncRequestClient (readonly)
159 160 161 |
# File 'lib/ssoready/management/organizations/client.rb', line 159 def request_client @request_client end |
Instance Method Details
#create_organization(request:, request_options: nil) ⇒ SSOReady::CreateOrganizationResponse
Creates an organization.
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/ssoready/management/organizations/client.rb', line 216 def create_organization(request:, request_options: nil) Async do response = @request_client.conn.post do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(request || {}), **(&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: )}/v1/organizations" end SSOReady::CreateOrganizationResponse.from_json(json_object: response.body) end end |
#get_organization(id:, request_options: nil) ⇒ SSOReady::GetOrganizationResponse
Gets an organization.
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/ssoready/management/organizations/client.rb', line 248 def get_organization(id:, request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/v1/organizations/#{id}" end SSOReady::GetOrganizationResponse.from_json(json_object: response.body) end end |
#list_organizations(page_token: nil, request_options: nil) ⇒ SSOReady::ListOrganizationsResponse
Gets a list of organizations.
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/ssoready/management/organizations/client.rb', line 179 def list_organizations(page_token: nil, request_options: nil) Async do response = @request_client.conn.get do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact req.params = { **(&.additional_query_parameters || {}), "pageToken": page_token }.compact unless .nil? || &.additional_body_parameters.nil? req.body = { **(&.additional_body_parameters || {}) }.compact end req.url "#{@request_client.get_url(request_options: )}/v1/organizations" end SSOReady::ListOrganizationsResponse.from_json(json_object: response.body) end end |
#update_organization(id:, request:, request_options: nil) ⇒ SSOReady::UpdateOrganizationResponse
Updates an organization.
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/ssoready/management/organizations/client.rb', line 288 def update_organization(id:, request:, request_options: nil) Async do response = @request_client.conn.patch do |req| req..timeout = .timeout_in_seconds unless &.timeout_in_seconds.nil? req.headers["Authorization"] = .api_key unless &.api_key.nil? req.headers = { **(req.headers || {}), **@request_client.get_headers, **(&.additional_headers || {}) }.compact unless .nil? || &.additional_query_parameters.nil? req.params = { **(&.additional_query_parameters || {}) }.compact end req.body = { **(request || {}), **(&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: )}/v1/organizations/#{id}" end SSOReady::UpdateOrganizationResponse.from_json(json_object: response.body) end end |