class KeycloakAdmin::ClientClient

Public Class Methods

new(configuration, realm_client) click to toggle source
Calls superclass method KeycloakAdmin::Client::new
# File lib/keycloak-admin/client/client_client.rb, line 3
def initialize(configuration, realm_client)
  super(configuration)
  raise ArgumentError.new("realm must be defined") unless realm_client.name_defined?
  @realm_client = realm_client
end

Public Instance Methods

clients_url(id=nil) click to toggle source
# File lib/keycloak-admin/client/client_client.rb, line 16
def clients_url(id=nil)
  if id
    "#{@realm_client.realm_admin_url}/clients/#{id}"
  else
    "#{@realm_client.realm_admin_url}/clients"
  end
end
list() click to toggle source
# File lib/keycloak-admin/client/client_client.rb, line 9
def list
  response = execute_http do
    RestClient::Resource.new(clients_url, @configuration.rest_client_options).get(headers)
  end
  JSON.parse(response).map { |client_as_hash| ClientRepresentation.from_hash(client_as_hash) }
end