lib/gooddata/models/domain.rb
def clients(id = :all)
      clients_uri = "/gdc/domains/#{name}/clients"
      res = client.get(clients_uri)
      res_clients = (res['clients'] && res['clients']['items']) || []
      if id == :all
        res_clients.map { |res_client| client.create(GoodData::Client, res_client) }
      else
        find_result = res_clients.find { |c| c['client']['id'] == id }
        fail "Client with id #{id} was not found" unless find_result
        client.create(GoodData::Client, find_result)
      end
    end
# Returns all the clients defined in all segments defined in domain. Alternatively
# id of a client can be provided in which case it returns just that client
# if it exists.
#
# @param id [String] Id of client that you are looking for
# @return [Object] Raw response
#
Returns all the clients defined in all segments defined in domain. Alternatively
id of a client can be provided in which case it returns just that client
if it exists.
Returns all the clients defined in all segments defined in domain . Alternatively id of a client can be provided in which case it returns just that client if it exists .
def clients(id = :all)
      clients_uri = "/gdc/domains/#{name}/clients"
      res = client.get(clients_uri)
      res_clients = (res['clients'] && res['clients']['items']) || []
      if id == :all
        res_clients.map { |res_client| client.create(GoodData::Client, res_client) }
      else
        find_result = res_clients.find { |c| c['client']['id'] == id }
        fail "Client with id #{id} was not found" unless find_result
        client.create(GoodData::Client, find_result)
      end
    end
def clients ( id = :all ) clients_uri = "/gdc/domains/#{name}/clients" res = client . get ( clients_uri ) res_clients = ( res [ 'clients' ] && res [ 'clients' ] [ 'items' ] ) || [ ] if id == :all res_clients . map { | res_client | client . create ( GoodData :: Client , res_client ) } else find_result = res_clients . find { | c | c [ 'client' ] [ 'id' ] == id } fail "Client with id #{id} was not found" unless find_result client . create ( GoodData :: Client , find_result ) end end
Returns all the clients defined in all segments defined in domain.
Returns all the clients defined in all segments defined in domain .
None
Object
id
Id of client that you are looking for
Id of client that you are looking for