From 80703f204c630a816a7cd6bf41b27387c10ccfe2 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 21:18:14 +0000 Subject: [PATCH] SDK regeneration --- lib/requests.rb | 52 ++++---- lib/ssoready.rb | 16 +-- .../management/organizations/client.rb | 94 +++++++++++--- .../management/saml_connections/client.rb | 94 +++++++++++--- .../management/scim_directories/client.rb | 122 +++++++++++++++--- lib/ssoready/management/setup_urls/client.rb | 22 +++- lib/ssoready/saml/client.rb | 44 +++++-- lib/ssoready/scim/client.rb | 100 +++++++++++--- .../types/create_setup_url_response.rb | 3 +- .../types/get_saml_redirect_url_response.rb | 3 +- lib/ssoready/types/google_protobuf_any.rb | 3 +- .../types/list_organizations_response.rb | 8 +- .../types/list_saml_connections_response.rb | 8 +- .../types/list_scim_directories_response.rb | 8 +- .../types/list_scim_groups_response.rb | 8 +- .../types/list_scim_users_response.rb | 8 +- lib/ssoready/types/organization.rb | 11 +- .../types/redeem_saml_access_code_response.rb | 13 +- ...te_scim_directory_bearer_token_response.rb | 3 +- lib/ssoready/types/saml_connection.rb | 17 +-- lib/ssoready/types/scim_directory.rb | 11 +- lib/ssoready/types/scim_group.rb | 11 +- lib/ssoready/types/scim_user.rb | 11 +- lib/ssoready/types/status.rb | 10 +- ssoready.gemspec | 2 +- 25 files changed, 506 insertions(+), 176 deletions(-) diff --git a/lib/requests.rb b/lib/requests.rb index eaf56b1..cc4bb59 100644 --- a/lib/requests.rb +++ b/lib/requests.rb @@ -7,32 +7,27 @@ module SSOReady class RequestClient - # @return [Hash{String => String}] - attr_reader :headers # @return [Faraday] attr_reader :conn # @return [String] attr_reader :base_url # @return [String] + attr_reader :api_key + # @return [String] attr_reader :default_environment - # @param environment [SSOReady::Environment] # @param base_url [String] + # @param environment [SSOReady::Environment] # @param max_retries [Long] The number of times to retry a failed request, defaults to 2. # @param timeout_in_seconds [Long] # @param api_key [String] # @return [SSOReady::RequestClient] - def initialize(environment: SSOReady::Environment::DEFAULT, base_url: nil, max_retries: nil, - timeout_in_seconds: nil, api_key: nil) + def initialize(base_url: nil, environment: SSOReady::Environment::DEFAULT, max_retries: nil, + timeout_in_seconds: nil, api_key: ENV["SSOREADY_API_KEY"]) @default_environment = environment @base_url = environment || base_url - @headers = { - "X-Fern-Language": "Ruby", - "X-Fern-SDK-Name": "ssoready", - "X-Fern-SDK-Version": "0.1.0", - "Authorization": %(Bearer #{api_key || ENV["SSOREADY_API_KEY"]}) - } - @conn = Faraday.new(headers: @headers) do |faraday| + @api_key = "Bearer #{api_key}" + @conn = Faraday.new do |faraday| faraday.request :json faraday.response :raise_error, include_request: true faraday.request :retry, { max: max_retries } unless max_retries.nil? @@ -45,35 +40,37 @@ def initialize(environment: SSOReady::Environment::DEFAULT, base_url: nil, max_r def get_url(request_options: nil) request_options&.base_url || @default_environment || @base_url end + + # @return [Hash{String => String}] + def get_headers + headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "ssoready", "X-Fern-SDK-Version": "1.0.0" } + headers["Authorization"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil? + headers + end end class AsyncRequestClient - # @return [Hash{String => String}] - attr_reader :headers # @return [Faraday] attr_reader :conn # @return [String] attr_reader :base_url # @return [String] + attr_reader :api_key + # @return [String] attr_reader :default_environment - # @param environment [SSOReady::Environment] # @param base_url [String] + # @param environment [SSOReady::Environment] # @param max_retries [Long] The number of times to retry a failed request, defaults to 2. # @param timeout_in_seconds [Long] # @param api_key [String] # @return [SSOReady::AsyncRequestClient] - def initialize(environment: SSOReady::Environment::DEFAULT, base_url: nil, max_retries: nil, - timeout_in_seconds: nil, api_key: nil) + def initialize(base_url: nil, environment: SSOReady::Environment::DEFAULT, max_retries: nil, + timeout_in_seconds: nil, api_key: ENV["SSOREADY_API_KEY"]) @default_environment = environment @base_url = environment || base_url - @headers = { - "X-Fern-Language": "Ruby", - "X-Fern-SDK-Name": "ssoready", - "X-Fern-SDK-Version": "0.1.0", - "Authorization": %(Bearer #{api_key || ENV["SSOREADY_API_KEY"]}) - } - @conn = Faraday.new(headers: @headers) do |faraday| + @api_key = "Bearer #{api_key}" + @conn = Faraday.new do |faraday| faraday.request :json faraday.response :raise_error, include_request: true faraday.adapter :async_http @@ -87,6 +84,13 @@ def initialize(environment: SSOReady::Environment::DEFAULT, base_url: nil, max_r def get_url(request_options: nil) request_options&.base_url || @default_environment || @base_url end + + # @return [Hash{String => String}] + def get_headers + headers = { "X-Fern-Language": "Ruby", "X-Fern-SDK-Name": "ssoready", "X-Fern-SDK-Version": "1.0.0" } + headers["Authorization"] = ((@api_key.is_a? Method) ? @api_key.call : @api_key) unless @api_key.nil? + headers + end end # Additional options for request-specific configuration when calling APIs via the diff --git a/lib/ssoready.rb b/lib/ssoready.rb index af12932..58bfa61 100644 --- a/lib/ssoready.rb +++ b/lib/ssoready.rb @@ -16,17 +16,17 @@ class Client # @return [SSOReady::Management::Client] attr_reader :management - # @param environment [SSOReady::Environment] # @param base_url [String] + # @param environment [SSOReady::Environment] # @param max_retries [Long] The number of times to retry a failed request, defaults to 2. # @param timeout_in_seconds [Long] # @param api_key [String] # @return [SSOReady::Client] - def initialize(environment: SSOReady::Environment::DEFAULT, base_url: nil, max_retries: nil, - timeout_in_seconds: nil, api_key: nil) + def initialize(base_url: nil, environment: SSOReady::Environment::DEFAULT, max_retries: nil, + timeout_in_seconds: nil, api_key: ENV["SSOREADY_API_KEY"]) @request_client = SSOReady::RequestClient.new( - environment: environment, base_url: base_url, + environment: environment, max_retries: max_retries, timeout_in_seconds: timeout_in_seconds, api_key: api_key @@ -45,17 +45,17 @@ class AsyncClient # @return [SSOReady::Management::AsyncClient] attr_reader :management - # @param environment [SSOReady::Environment] # @param base_url [String] + # @param environment [SSOReady::Environment] # @param max_retries [Long] The number of times to retry a failed request, defaults to 2. # @param timeout_in_seconds [Long] # @param api_key [String] # @return [SSOReady::AsyncClient] - def initialize(environment: SSOReady::Environment::DEFAULT, base_url: nil, max_retries: nil, - timeout_in_seconds: nil, api_key: nil) + def initialize(base_url: nil, environment: SSOReady::Environment::DEFAULT, max_retries: nil, + timeout_in_seconds: nil, api_key: ENV["SSOREADY_API_KEY"]) @async_request_client = SSOReady::AsyncRequestClient.new( - environment: environment, base_url: base_url, + environment: environment, max_retries: max_retries, timeout_in_seconds: timeout_in_seconds, api_key: api_key diff --git a/lib/ssoready/management/organizations/client.rb b/lib/ssoready/management/organizations/client.rb index 28f6e2e..f994b33 100644 --- a/lib/ssoready/management/organizations/client.rb +++ b/lib/ssoready/management/organizations/client.rb @@ -27,8 +27,8 @@ def initialize(request_client:) # @return [SSOReady::ListOrganizationsResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.organizations.list_organizations @@ -36,8 +36,15 @@ def list_organizations(page_token: nil, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact req.params = { **(request_options&.additional_query_parameters || {}), "pageToken": page_token }.compact + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations" end SSOReady::ListOrganizationsResponse.from_json(json_object: response.body) @@ -55,8 +62,8 @@ def list_organizations(page_token: nil, request_options: nil) # @return [SSOReady::CreateOrganizationResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.organizations.create_organization(request: { }) @@ -64,7 +71,14 @@ def create_organization(request:, request_options: nil) response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations" end @@ -78,8 +92,8 @@ def create_organization(request:, request_options: nil) # @return [SSOReady::GetOrganizationResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.organizations.get_organization(id: "id") @@ -87,7 +101,17 @@ def get_organization(id:, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations/#{id}" end SSOReady::GetOrganizationResponse.from_json(json_object: response.body) @@ -106,8 +130,8 @@ def get_organization(id:, request_options: nil) # @return [SSOReady::UpdateOrganizationResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.organizations.update_organization(id: "id", request: { }) @@ -115,7 +139,14 @@ def update_organization(id:, request:, request_options: nil) response = @request_client.conn.patch do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations/#{id}" end @@ -140,8 +171,8 @@ def initialize(request_client:) # @return [SSOReady::ListOrganizationsResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.organizations.list_organizations @@ -150,8 +181,15 @@ def list_organizations(page_token: nil, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact req.params = { **(request_options&.additional_query_parameters || {}), "pageToken": page_token }.compact + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations" end SSOReady::ListOrganizationsResponse.from_json(json_object: response.body) @@ -170,8 +208,8 @@ def list_organizations(page_token: nil, request_options: nil) # @return [SSOReady::CreateOrganizationResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.organizations.create_organization(request: { }) @@ -180,7 +218,14 @@ def create_organization(request:, request_options: nil) response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations" end @@ -195,8 +240,8 @@ def create_organization(request:, request_options: nil) # @return [SSOReady::GetOrganizationResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.organizations.get_organization(id: "id") @@ -205,7 +250,17 @@ def get_organization(id:, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations/#{id}" end SSOReady::GetOrganizationResponse.from_json(json_object: response.body) @@ -225,8 +280,8 @@ def get_organization(id:, request_options: nil) # @return [SSOReady::UpdateOrganizationResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.organizations.update_organization(id: "id", request: { }) @@ -235,7 +290,14 @@ def update_organization(id:, request:, request_options: nil) response = @request_client.conn.patch do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/organizations/#{id}" end diff --git a/lib/ssoready/management/saml_connections/client.rb b/lib/ssoready/management/saml_connections/client.rb index 514c7e0..9b2a4aa 100644 --- a/lib/ssoready/management/saml_connections/client.rb +++ b/lib/ssoready/management/saml_connections/client.rb @@ -28,8 +28,8 @@ def initialize(request_client:) # @return [SSOReady::ListSAMLConnectionsResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.saml_connections.list_saml_connections @@ -37,12 +37,19 @@ def list_saml_connections(organization_id: nil, page_token: nil, request_options response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact req.params = { **(request_options&.additional_query_parameters || {}), "organizationId": organization_id, "pageToken": page_token }.compact + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections" end SSOReady::ListSAMLConnectionsResponse.from_json(json_object: response.body) @@ -63,8 +70,8 @@ def list_saml_connections(organization_id: nil, page_token: nil, request_options # @return [SSOReady::CreateSAMLConnectionResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.saml_connections.create_saml_connection(request: { }) @@ -72,7 +79,14 @@ def create_saml_connection(request:, request_options: nil) response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections" end @@ -86,8 +100,8 @@ def create_saml_connection(request:, request_options: nil) # @return [SSOReady::GetSAMLConnectionResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.saml_connections.get_saml_connection(id: "id") @@ -95,7 +109,17 @@ def get_saml_connection(id:, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections/#{id}" end SSOReady::GetSAMLConnectionResponse.from_json(json_object: response.body) @@ -117,8 +141,8 @@ def get_saml_connection(id:, request_options: nil) # @return [SSOReady::UpdateSAMLConnectionResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.saml_connections.update_saml_connection(id: "id", request: { }) @@ -126,7 +150,14 @@ def update_saml_connection(id:, request:, request_options: nil) response = @request_client.conn.patch do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections/#{id}" end @@ -152,8 +183,8 @@ def initialize(request_client:) # @return [SSOReady::ListSAMLConnectionsResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.saml_connections.list_saml_connections @@ -162,12 +193,19 @@ def list_saml_connections(organization_id: nil, page_token: nil, request_options response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact req.params = { **(request_options&.additional_query_parameters || {}), "organizationId": organization_id, "pageToken": page_token }.compact + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections" end SSOReady::ListSAMLConnectionsResponse.from_json(json_object: response.body) @@ -189,8 +227,8 @@ def list_saml_connections(organization_id: nil, page_token: nil, request_options # @return [SSOReady::CreateSAMLConnectionResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.saml_connections.create_saml_connection(request: { }) @@ -199,7 +237,14 @@ def create_saml_connection(request:, request_options: nil) response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections" end @@ -214,8 +259,8 @@ def create_saml_connection(request:, request_options: nil) # @return [SSOReady::GetSAMLConnectionResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.saml_connections.get_saml_connection(id: "id") @@ -224,7 +269,17 @@ def get_saml_connection(id:, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections/#{id}" end SSOReady::GetSAMLConnectionResponse.from_json(json_object: response.body) @@ -247,8 +302,8 @@ def get_saml_connection(id:, request_options: nil) # @return [SSOReady::UpdateSAMLConnectionResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.saml_connections.update_saml_connection(id: "id", request: { }) @@ -257,7 +312,14 @@ def update_saml_connection(id:, request:, request_options: nil) response = @request_client.conn.patch do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml-connections/#{id}" end diff --git a/lib/ssoready/management/scim_directories/client.rb b/lib/ssoready/management/scim_directories/client.rb index 69b95c9..03345a6 100644 --- a/lib/ssoready/management/scim_directories/client.rb +++ b/lib/ssoready/management/scim_directories/client.rb @@ -29,8 +29,8 @@ def initialize(request_client:) # @return [SSOReady::ListSCIMDirectoriesResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.scim_directories.list_scim_directories @@ -38,12 +38,19 @@ def list_scim_directories(organization_id: nil, page_token: nil, request_options response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact req.params = { **(request_options&.additional_query_parameters || {}), "organizationId": organization_id, "pageToken": page_token }.compact + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim-directories" end SSOReady::ListSCIMDirectoriesResponse.from_json(json_object: response.body) @@ -61,8 +68,8 @@ def list_scim_directories(organization_id: nil, page_token: nil, request_options # @return [SSOReady::CreateSCIMDirectoryResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.scim_directories.create_scim_directory(request: { }) @@ -70,7 +77,14 @@ def create_scim_directory(request:, request_options: nil) response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim-directories" end @@ -84,8 +98,8 @@ def create_scim_directory(request:, request_options: nil) # @return [SSOReady::GetSCIMDirectoryResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.scim_directories.get_scim_directory(id: "id") @@ -93,7 +107,17 @@ def get_scim_directory(id:, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim-directories/#{id}" end SSOReady::GetSCIMDirectoryResponse.from_json(json_object: response.body) @@ -112,8 +136,8 @@ def get_scim_directory(id:, request_options: nil) # @return [SSOReady::UpdateSCIMDirectoryResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.scim_directories.update_scim_directory(id: "id", request: { }) @@ -121,7 +145,14 @@ def update_scim_directory(id:, request:, request_options: nil) response = @request_client.conn.patch do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim-directories/#{id}" end @@ -148,8 +179,8 @@ def update_scim_directory(id:, request:, request_options: nil) # @return [SSOReady::RotateSCIMDirectoryBearerTokenResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.scim_directories.rotate_scim_directory_bearer_token(id: "id") @@ -157,7 +188,17 @@ def rotate_scim_directory_bearer_token(id:, request_options: nil) response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim-directories/#{id}/rotate-bearer-token" end SSOReady::RotateSCIMDirectoryBearerTokenResponse.from_json(json_object: response.body) @@ -182,8 +223,8 @@ def initialize(request_client:) # @return [SSOReady::ListSCIMDirectoriesResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.scim_directories.list_scim_directories @@ -192,12 +233,19 @@ def list_scim_directories(organization_id: nil, page_token: nil, request_options response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact req.params = { **(request_options&.additional_query_parameters || {}), "organizationId": organization_id, "pageToken": page_token }.compact + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim-directories" end SSOReady::ListSCIMDirectoriesResponse.from_json(json_object: response.body) @@ -216,8 +264,8 @@ def list_scim_directories(organization_id: nil, page_token: nil, request_options # @return [SSOReady::CreateSCIMDirectoryResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.scim_directories.create_scim_directory(request: { }) @@ -226,7 +274,14 @@ def create_scim_directory(request:, request_options: nil) response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim-directories" end @@ -241,8 +296,8 @@ def create_scim_directory(request:, request_options: nil) # @return [SSOReady::GetSCIMDirectoryResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.scim_directories.get_scim_directory(id: "id") @@ -251,7 +306,17 @@ def get_scim_directory(id:, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim-directories/#{id}" end SSOReady::GetSCIMDirectoryResponse.from_json(json_object: response.body) @@ -271,8 +336,8 @@ def get_scim_directory(id:, request_options: nil) # @return [SSOReady::UpdateSCIMDirectoryResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.scim_directories.update_scim_directory(id: "id", request: { }) @@ -281,7 +346,14 @@ def update_scim_directory(id:, request:, request_options: nil) response = @request_client.conn.patch do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim-directories/#{id}" end @@ -309,8 +381,8 @@ def update_scim_directory(id:, request:, request_options: nil) # @return [SSOReady::RotateSCIMDirectoryBearerTokenResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.scim_directories.rotate_scim_directory_bearer_token(id: "id") @@ -319,7 +391,17 @@ def rotate_scim_directory_bearer_token(id:, request_options: nil) response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim-directories/#{id}/rotate-bearer-token" end SSOReady::RotateSCIMDirectoryBearerTokenResponse.from_json(json_object: response.body) diff --git a/lib/ssoready/management/setup_urls/client.rb b/lib/ssoready/management/setup_urls/client.rb index 10120b2..d5364fe 100644 --- a/lib/ssoready/management/setup_urls/client.rb +++ b/lib/ssoready/management/setup_urls/client.rb @@ -27,8 +27,8 @@ def initialize(request_client:) # @return [SSOReady::CreateSetupURLResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.setup_urls.create_setup_url @@ -36,7 +36,14 @@ def create_setup_url(organization_id: nil, can_manage_saml: nil, can_manage_scim response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request_options&.additional_body_parameters || {}), organizationId: organization_id, @@ -70,8 +77,8 @@ def initialize(request_client:) # @return [SSOReady::CreateSetupURLResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.management.setup_urls.create_setup_url @@ -80,7 +87,14 @@ def create_setup_url(organization_id: nil, can_manage_saml: nil, can_manage_scim response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request_options&.additional_body_parameters || {}), organizationId: organization_id, diff --git a/lib/ssoready/saml/client.rb b/lib/ssoready/saml/client.rb index 0c2fa0b..cae14be 100644 --- a/lib/ssoready/saml/client.rb +++ b/lib/ssoready/saml/client.rb @@ -23,8 +23,8 @@ def initialize(request_client:) # @return [SSOReady::RedeemSAMLAccessCodeResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.saml.redeem_saml_access_code(saml_access_code: "saml_access_code_...") @@ -32,7 +32,14 @@ def redeem_saml_access_code(saml_access_code: nil, request_options: nil) response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request_options&.additional_body_parameters || {}), samlAccessCode: saml_access_code }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml/redeem" end @@ -61,8 +68,8 @@ def redeem_saml_access_code(saml_access_code: nil, request_options: nil) # @return [SSOReady::GetSAMLRedirectURLResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.saml.get_saml_redirect_url(organization_external_id: "my_custom_external_id") @@ -71,7 +78,14 @@ def get_saml_redirect_url(saml_connection_id: nil, organization_id: nil, organiz response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request_options&.additional_body_parameters || {}), samlConnectionId: saml_connection_id, @@ -102,8 +116,8 @@ def initialize(request_client:) # @return [SSOReady::RedeemSAMLAccessCodeResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.saml.redeem_saml_access_code(saml_access_code: "saml_access_code_...") @@ -112,7 +126,14 @@ def redeem_saml_access_code(saml_access_code: nil, request_options: nil) response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request_options&.additional_body_parameters || {}), samlAccessCode: saml_access_code }.compact req.url "#{@request_client.get_url(request_options: request_options)}/v1/saml/redeem" end @@ -142,8 +163,8 @@ def redeem_saml_access_code(saml_access_code: nil, request_options: nil) # @return [SSOReady::GetSAMLRedirectURLResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.saml.get_saml_redirect_url(organization_external_id: "my_custom_external_id") @@ -153,7 +174,14 @@ def get_saml_redirect_url(saml_connection_id: nil, organization_id: nil, organiz response = @request_client.conn.post do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end req.body = { **(request_options&.additional_body_parameters || {}), samlConnectionId: saml_connection_id, diff --git a/lib/ssoready/scim/client.rb b/lib/ssoready/scim/client.rb index 9dc36a1..1437480 100644 --- a/lib/ssoready/scim/client.rb +++ b/lib/ssoready/scim/client.rb @@ -36,8 +36,8 @@ def initialize(request_client:) # @return [SSOReady::ListSCIMGroupsResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.scim.list_scim_groups(organization_external_id: "my_custom_external_id") @@ -46,7 +46,11 @@ def list_scim_groups(scim_directory_id: nil, organization_id: nil, organization_ response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact req.params = { **(request_options&.additional_query_parameters || {}), "scimDirectoryId": scim_directory_id, @@ -54,6 +58,9 @@ def list_scim_groups(scim_directory_id: nil, organization_id: nil, organization_ "organizationExternalId": organization_external_id, "pageToken": page_token }.compact + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim/groups" end SSOReady::ListSCIMGroupsResponse.from_json(json_object: response.body) @@ -66,8 +73,8 @@ def list_scim_groups(scim_directory_id: nil, organization_id: nil, organization_ # @return [SSOReady::GetSCIMGroupResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.scim.get_scim_group(id: "scim_group_...") @@ -75,7 +82,17 @@ def get_scim_group(id:, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim/groups/#{id}" end SSOReady::GetSCIMGroupResponse.from_json(json_object: response.body) @@ -100,8 +117,8 @@ def get_scim_group(id:, request_options: nil) # @return [SSOReady::ListSCIMUsersResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.scim.list_scim_users(organization_external_id: "my_custom_external_id") @@ -110,7 +127,11 @@ def list_scim_users(scim_directory_id: nil, organization_id: nil, organization_e response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact req.params = { **(request_options&.additional_query_parameters || {}), "scimDirectoryId": scim_directory_id, @@ -119,6 +140,9 @@ def list_scim_users(scim_directory_id: nil, organization_id: nil, organization_e "scimGroupId": scim_group_id, "pageToken": page_token }.compact + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim/users" end SSOReady::ListSCIMUsersResponse.from_json(json_object: response.body) @@ -131,8 +155,8 @@ def list_scim_users(scim_directory_id: nil, organization_id: nil, organization_e # @return [SSOReady::GetSCIMUserResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.scim.get_scim_user(id: "scim_user_...") @@ -140,7 +164,17 @@ def get_scim_user(id:, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim/users/#{id}" end SSOReady::GetSCIMUserResponse.from_json(json_object: response.body) @@ -175,8 +209,8 @@ def initialize(request_client:) # @return [SSOReady::ListSCIMGroupsResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.scim.list_scim_groups(organization_external_id: "my_custom_external_id") @@ -186,7 +220,11 @@ def list_scim_groups(scim_directory_id: nil, organization_id: nil, organization_ response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact req.params = { **(request_options&.additional_query_parameters || {}), "scimDirectoryId": scim_directory_id, @@ -194,6 +232,9 @@ def list_scim_groups(scim_directory_id: nil, organization_id: nil, organization_ "organizationExternalId": organization_external_id, "pageToken": page_token }.compact + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim/groups" end SSOReady::ListSCIMGroupsResponse.from_json(json_object: response.body) @@ -207,8 +248,8 @@ def list_scim_groups(scim_directory_id: nil, organization_id: nil, organization_ # @return [SSOReady::GetSCIMGroupResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.scim.get_scim_group(id: "scim_group_...") @@ -217,7 +258,17 @@ def get_scim_group(id:, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim/groups/#{id}" end SSOReady::GetSCIMGroupResponse.from_json(json_object: response.body) @@ -243,8 +294,8 @@ def get_scim_group(id:, request_options: nil) # @return [SSOReady::ListSCIMUsersResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.scim.list_scim_users(organization_external_id: "my_custom_external_id") @@ -254,7 +305,11 @@ def list_scim_users(scim_directory_id: nil, organization_id: nil, organization_e response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact req.params = { **(request_options&.additional_query_parameters || {}), "scimDirectoryId": scim_directory_id, @@ -263,6 +318,9 @@ def list_scim_users(scim_directory_id: nil, organization_id: nil, organization_e "scimGroupId": scim_group_id, "pageToken": page_token }.compact + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim/users" end SSOReady::ListSCIMUsersResponse.from_json(json_object: response.body) @@ -276,8 +334,8 @@ def list_scim_users(scim_directory_id: nil, organization_id: nil, organization_e # @return [SSOReady::GetSCIMUserResponse] # @example # api = SSOReady::Client.new( - # environment: SSOReady::Environment::DEFAULT, # base_url: "https://api.example.com", + # environment: SSOReady::Environment::DEFAULT, # api_key: "YOUR_AUTH_TOKEN" # ) # api.scim.get_scim_user(id: "scim_user_...") @@ -286,7 +344,17 @@ def get_scim_user(id:, request_options: nil) response = @request_client.conn.get do |req| req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil? req.headers["Authorization"] = request_options.api_key unless request_options&.api_key.nil? - req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact + req.headers = { + **(req.headers || {}), + **@request_client.get_headers, + **(request_options&.additional_headers || {}) + }.compact + unless request_options.nil? || request_options&.additional_query_parameters.nil? + req.params = { **(request_options&.additional_query_parameters || {}) }.compact + end + unless request_options.nil? || request_options&.additional_body_parameters.nil? + req.body = { **(request_options&.additional_body_parameters || {}) }.compact + end req.url "#{@request_client.get_url(request_options: request_options)}/v1/scim/users/#{id}" end SSOReady::GetSCIMUserResponse.from_json(json_object: response.body) diff --git a/lib/ssoready/types/create_setup_url_response.rb b/lib/ssoready/types/create_setup_url_response.rb index 26f925f..86432b9 100644 --- a/lib/ssoready/types/create_setup_url_response.rb +++ b/lib/ssoready/types/create_setup_url_response.rb @@ -38,7 +38,8 @@ def initialize(url: OMIT, additional_properties: nil) # @return [SSOReady::CreateSetupURLResponse] def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) - url = struct["url"] + parsed_json = JSON.parse(json_object) + url = parsed_json["url"] new(url: url, additional_properties: struct) end diff --git a/lib/ssoready/types/get_saml_redirect_url_response.rb b/lib/ssoready/types/get_saml_redirect_url_response.rb index 3a57874..15c29b6 100644 --- a/lib/ssoready/types/get_saml_redirect_url_response.rb +++ b/lib/ssoready/types/get_saml_redirect_url_response.rb @@ -32,7 +32,8 @@ def initialize(redirect_url: OMIT, additional_properties: nil) # @return [SSOReady::GetSAMLRedirectURLResponse] def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) - redirect_url = struct["redirectUrl"] + parsed_json = JSON.parse(json_object) + redirect_url = parsed_json["redirectUrl"] new(redirect_url: redirect_url, additional_properties: struct) end diff --git a/lib/ssoready/types/google_protobuf_any.rb b/lib/ssoready/types/google_protobuf_any.rb index fba0c5a..907cb7c 100644 --- a/lib/ssoready/types/google_protobuf_any.rb +++ b/lib/ssoready/types/google_protobuf_any.rb @@ -34,7 +34,8 @@ def initialize(type: OMIT, additional_properties: nil) # @return [SSOReady::GoogleProtobufAny] def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) - type = struct["@type"] + parsed_json = JSON.parse(json_object) + type = parsed_json["@type"] new(type: type, additional_properties: struct) end diff --git a/lib/ssoready/types/list_organizations_response.rb b/lib/ssoready/types/list_organizations_response.rb index 9c3192e..85ea5a4 100644 --- a/lib/ssoready/types/list_organizations_response.rb +++ b/lib/ssoready/types/list_organizations_response.rb @@ -40,11 +40,11 @@ def initialize(organizations: OMIT, next_page_token: OMIT, additional_properties def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) - organizations = parsed_json["organizations"]&.map do |v| - v = v.to_json - SSOReady::Organization.from_json(json_object: v) + organizations = parsed_json["organizations"]&.map do |item| + item = item.to_json + SSOReady::Organization.from_json(json_object: item) end - next_page_token = struct["nextPageToken"] + next_page_token = parsed_json["nextPageToken"] new( organizations: organizations, next_page_token: next_page_token, diff --git a/lib/ssoready/types/list_saml_connections_response.rb b/lib/ssoready/types/list_saml_connections_response.rb index 9d0fcbb..44b46a5 100644 --- a/lib/ssoready/types/list_saml_connections_response.rb +++ b/lib/ssoready/types/list_saml_connections_response.rb @@ -40,11 +40,11 @@ def initialize(saml_connections: OMIT, next_page_token: OMIT, additional_propert def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) - saml_connections = parsed_json["samlConnections"]&.map do |v| - v = v.to_json - SSOReady::SAMLConnection.from_json(json_object: v) + saml_connections = parsed_json["samlConnections"]&.map do |item| + item = item.to_json + SSOReady::SAMLConnection.from_json(json_object: item) end - next_page_token = struct["nextPageToken"] + next_page_token = parsed_json["nextPageToken"] new( saml_connections: saml_connections, next_page_token: next_page_token, diff --git a/lib/ssoready/types/list_scim_directories_response.rb b/lib/ssoready/types/list_scim_directories_response.rb index a50929a..a908a2b 100644 --- a/lib/ssoready/types/list_scim_directories_response.rb +++ b/lib/ssoready/types/list_scim_directories_response.rb @@ -40,11 +40,11 @@ def initialize(scim_directories: OMIT, next_page_token: OMIT, additional_propert def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) - scim_directories = parsed_json["scimDirectories"]&.map do |v| - v = v.to_json - SSOReady::SCIMDirectory.from_json(json_object: v) + scim_directories = parsed_json["scimDirectories"]&.map do |item| + item = item.to_json + SSOReady::SCIMDirectory.from_json(json_object: item) end - next_page_token = struct["nextPageToken"] + next_page_token = parsed_json["nextPageToken"] new( scim_directories: scim_directories, next_page_token: next_page_token, diff --git a/lib/ssoready/types/list_scim_groups_response.rb b/lib/ssoready/types/list_scim_groups_response.rb index 57ba46b..5d48b99 100644 --- a/lib/ssoready/types/list_scim_groups_response.rb +++ b/lib/ssoready/types/list_scim_groups_response.rb @@ -40,11 +40,11 @@ def initialize(scim_groups: OMIT, next_page_token: OMIT, additional_properties: def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) - scim_groups = parsed_json["scimGroups"]&.map do |v| - v = v.to_json - SSOReady::SCIMGroup.from_json(json_object: v) + scim_groups = parsed_json["scimGroups"]&.map do |item| + item = item.to_json + SSOReady::SCIMGroup.from_json(json_object: item) end - next_page_token = struct["nextPageToken"] + next_page_token = parsed_json["nextPageToken"] new( scim_groups: scim_groups, next_page_token: next_page_token, diff --git a/lib/ssoready/types/list_scim_users_response.rb b/lib/ssoready/types/list_scim_users_response.rb index 90a0d9b..2fc17ba 100644 --- a/lib/ssoready/types/list_scim_users_response.rb +++ b/lib/ssoready/types/list_scim_users_response.rb @@ -40,11 +40,11 @@ def initialize(scim_users: OMIT, next_page_token: OMIT, additional_properties: n def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) - scim_users = parsed_json["scimUsers"]&.map do |v| - v = v.to_json - SSOReady::SCIMUser.from_json(json_object: v) + scim_users = parsed_json["scimUsers"]&.map do |item| + item = item.to_json + SSOReady::SCIMUser.from_json(json_object: item) end - next_page_token = struct["nextPageToken"] + next_page_token = parsed_json["nextPageToken"] new( scim_users: scim_users, next_page_token: next_page_token, diff --git a/lib/ssoready/types/organization.rb b/lib/ssoready/types/organization.rb index 1ddbb76..17914c7 100644 --- a/lib/ssoready/types/organization.rb +++ b/lib/ssoready/types/organization.rb @@ -73,11 +73,12 @@ def initialize(id: OMIT, environment_id: OMIT, display_name: OMIT, external_id: # @return [SSOReady::Organization] def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) - id = struct["id"] - environment_id = struct["environmentId"] - display_name = struct["displayName"] - external_id = struct["externalId"] - domains = struct["domains"] + parsed_json = JSON.parse(json_object) + id = parsed_json["id"] + environment_id = parsed_json["environmentId"] + display_name = parsed_json["displayName"] + external_id = parsed_json["externalId"] + domains = parsed_json["domains"] new( id: id, environment_id: environment_id, diff --git a/lib/ssoready/types/redeem_saml_access_code_response.rb b/lib/ssoready/types/redeem_saml_access_code_response.rb index dd98ebd..b8bcc71 100644 --- a/lib/ssoready/types/redeem_saml_access_code_response.rb +++ b/lib/ssoready/types/redeem_saml_access_code_response.rb @@ -84,12 +84,13 @@ def initialize(email: OMIT, state: OMIT, attributes: OMIT, organization_id: OMIT # @return [SSOReady::RedeemSAMLAccessCodeResponse] def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) - email = struct["email"] - state = struct["state"] - attributes = struct["attributes"] - organization_id = struct["organizationId"] - organization_external_id = struct["organizationExternalId"] - saml_flow_id = struct["samlFlowId"] + parsed_json = JSON.parse(json_object) + email = parsed_json["email"] + state = parsed_json["state"] + attributes = parsed_json["attributes"] + organization_id = parsed_json["organizationId"] + organization_external_id = parsed_json["organizationExternalId"] + saml_flow_id = parsed_json["samlFlowId"] new( email: email, state: state, diff --git a/lib/ssoready/types/rotate_scim_directory_bearer_token_response.rb b/lib/ssoready/types/rotate_scim_directory_bearer_token_response.rb index eb22656..7a730ee 100644 --- a/lib/ssoready/types/rotate_scim_directory_bearer_token_response.rb +++ b/lib/ssoready/types/rotate_scim_directory_bearer_token_response.rb @@ -39,7 +39,8 @@ def initialize(bearer_token: OMIT, additional_properties: nil) # @return [SSOReady::RotateSCIMDirectoryBearerTokenResponse] def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) - bearer_token = struct["bearerToken"] + parsed_json = JSON.parse(json_object) + bearer_token = parsed_json["bearerToken"] new(bearer_token: bearer_token, additional_properties: struct) end diff --git a/lib/ssoready/types/saml_connection.rb b/lib/ssoready/types/saml_connection.rb index 3b36d05..976b076 100644 --- a/lib/ssoready/types/saml_connection.rb +++ b/lib/ssoready/types/saml_connection.rb @@ -96,14 +96,15 @@ def initialize(id: OMIT, organization_id: OMIT, primary: OMIT, idp_redirect_url: # @return [SSOReady::SAMLConnection] def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) - id = struct["id"] - organization_id = struct["organizationId"] - primary = struct["primary"] - idp_redirect_url = struct["idpRedirectUrl"] - idp_certificate = struct["idpCertificate"] - idp_entity_id = struct["idpEntityId"] - sp_entity_id = struct["spEntityId"] - sp_acs_url = struct["spAcsUrl"] + parsed_json = JSON.parse(json_object) + id = parsed_json["id"] + organization_id = parsed_json["organizationId"] + primary = parsed_json["primary"] + idp_redirect_url = parsed_json["idpRedirectUrl"] + idp_certificate = parsed_json["idpCertificate"] + idp_entity_id = parsed_json["idpEntityId"] + sp_entity_id = parsed_json["spEntityId"] + sp_acs_url = parsed_json["spAcsUrl"] new( id: id, organization_id: organization_id, diff --git a/lib/ssoready/types/scim_directory.rb b/lib/ssoready/types/scim_directory.rb index 22cf0a3..b76f1db 100644 --- a/lib/ssoready/types/scim_directory.rb +++ b/lib/ssoready/types/scim_directory.rb @@ -65,11 +65,12 @@ def initialize(id: OMIT, organization_id: OMIT, primary: OMIT, scim_base_url: OM # @return [SSOReady::SCIMDirectory] def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) - id = struct["id"] - organization_id = struct["organizationId"] - primary = struct["primary"] - scim_base_url = struct["scimBaseUrl"] - has_client_bearer_token = struct["hasClientBearerToken"] + parsed_json = JSON.parse(json_object) + id = parsed_json["id"] + organization_id = parsed_json["organizationId"] + primary = parsed_json["primary"] + scim_base_url = parsed_json["scimBaseUrl"] + has_client_bearer_token = parsed_json["hasClientBearerToken"] new( id: id, organization_id: organization_id, diff --git a/lib/ssoready/types/scim_group.rb b/lib/ssoready/types/scim_group.rb index 07d6361..f734b4b 100644 --- a/lib/ssoready/types/scim_group.rb +++ b/lib/ssoready/types/scim_group.rb @@ -75,11 +75,12 @@ def initialize(id: OMIT, scim_directory_id: OMIT, display_name: OMIT, deleted: O # @return [SSOReady::SCIMGroup] def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) - id = struct["id"] - scim_directory_id = struct["scimDirectoryId"] - display_name = struct["displayName"] - deleted = struct["deleted"] - attributes = struct["attributes"] + parsed_json = JSON.parse(json_object) + id = parsed_json["id"] + scim_directory_id = parsed_json["scimDirectoryId"] + display_name = parsed_json["displayName"] + deleted = parsed_json["deleted"] + attributes = parsed_json["attributes"] new( id: id, scim_directory_id: scim_directory_id, diff --git a/lib/ssoready/types/scim_user.rb b/lib/ssoready/types/scim_user.rb index 89d9d27..9dcfcb8 100644 --- a/lib/ssoready/types/scim_user.rb +++ b/lib/ssoready/types/scim_user.rb @@ -63,11 +63,12 @@ def initialize(id: OMIT, scim_directory_id: OMIT, email: OMIT, deleted: OMIT, at # @return [SSOReady::SCIMUser] def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) - id = struct["id"] - scim_directory_id = struct["scimDirectoryId"] - email = struct["email"] - deleted = struct["deleted"] - attributes = struct["attributes"] + parsed_json = JSON.parse(json_object) + id = parsed_json["id"] + scim_directory_id = parsed_json["scimDirectoryId"] + email = parsed_json["email"] + deleted = parsed_json["deleted"] + attributes = parsed_json["attributes"] new( id: id, scim_directory_id: scim_directory_id, diff --git a/lib/ssoready/types/status.rb b/lib/ssoready/types/status.rb index dd3fc3a..f3e6c94 100644 --- a/lib/ssoready/types/status.rb +++ b/lib/ssoready/types/status.rb @@ -58,11 +58,11 @@ def initialize(code: OMIT, message: OMIT, details: OMIT, additional_properties: def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) - code = struct["code"] - message = struct["message"] - details = parsed_json["details"]&.map do |v| - v = v.to_json - SSOReady::GoogleProtobufAny.from_json(json_object: v) + code = parsed_json["code"] + message = parsed_json["message"] + details = parsed_json["details"]&.map do |item| + item = item.to_json + SSOReady::GoogleProtobufAny.from_json(json_object: item) end new( code: code, diff --git a/ssoready.gemspec b/ssoready.gemspec index d4f0313..5469d32 100644 --- a/ssoready.gemspec +++ b/ssoready.gemspec @@ -4,7 +4,7 @@ require_relative "lib/gemconfig" Gem::Specification.new do |spec| spec.name = "ssoready" - spec.version = "0.1.0" + spec.version = "1.0.0" spec.authors = SSOReady::Gemconfig::AUTHORS spec.email = SSOReady::Gemconfig::EMAIL spec.summary = SSOReady::Gemconfig::SUMMARY