Class: SSOReady::Management::AsyncSetupURLsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/ssoready/management/setup_urls/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_client:) ⇒ SSOReady::Management::AsyncSetupURLsClient

Parameters:



65
66
67
# File 'lib/ssoready/management/setup_urls/client.rb', line 65

def initialize(request_client:)
  @request_client = request_client
end

Instance Attribute Details

#request_clientSSOReady::AsyncRequestClient (readonly)



61
62
63
# File 'lib/ssoready/management/setup_urls/client.rb', line 61

def request_client
  @request_client
end

Instance Method Details

#create_setup_url(organization_id: nil, can_manage_saml: nil, can_manage_scim: nil, request_options: nil) ⇒ SSOReady::CreateSetupURLResponse

Creates a short-lived self-serve setup URL that you can send to your customer.

Setup URLs let your customer configure their SAML settings, SCIM settings, or
both.

Examples:

api = SSOReady::Client.new(
  base_url: "https://api.example.com",
  environment: SSOReady::Environment::DEFAULT,
  api_key: "YOUR_AUTH_TOKEN"
)
api.management.setup_urls.create_setup_url

Parameters:

  • organization_id (String) (defaults to: nil)

    The organization that the setup URL is for.

  • can_manage_saml (Boolean) (defaults to: nil)

    Whether the setup URL lets the user manage SAML connections.

  • can_manage_scim (Boolean) (defaults to: nil)

    Whether the setup URL lets the user manage SCIM directories.

  • request_options (SSOReady::RequestOptions) (defaults to: nil)

Returns:



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/ssoready/management/setup_urls/client.rb', line 85

def create_setup_url(organization_id: nil, can_manage_saml: nil, can_manage_scim: nil, request_options: nil)
  Async do
    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_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,
        canManageSaml: can_manage_saml,
        canManageScim: can_manage_scim
      }.compact
      req.url "#{@request_client.get_url(request_options: request_options)}/v1/setup-urls"
    end
    SSOReady::CreateSetupURLResponse.from_json(json_object: response.body)
  end
end