Module: Spaceship::ConnectAPI::Users

Included in:
Spaceship::ConnectAPI
Defined in:
spaceship/lib/spaceship/connect_api/users/users.rb,
spaceship/lib/spaceship/connect_api/users/client.rb

Defined Under Namespace

Classes: Client

Instance Method Summary collapse

Instance Method Details

#add_user_visible_apps(user_id: nil, app_ids: nil) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'spaceship/lib/spaceship/connect_api/users/users.rb', line 15

def add_user_visible_apps(user_id: nil, app_ids: nil)
  body = {
    data: app_ids.map do |app_id|
      {
        type: "apps",
        id: app_id
      }
    end
  }

  Client.instance.post("users/#{user_id}/relationships/visibleApps", body)
end

#get_users(filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

users



10
11
12
13
# File 'spaceship/lib/spaceship/connect_api/users/users.rb', line 10

def get_users(filter: {}, includes: nil, limit: nil, sort: nil)
  params = Client.instance.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
  Client.instance.get("users", params)
end