Class: Spaceship::ConnectAPI::User

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
spaceship/lib/spaceship/connect_api/models/user.rb

Instance Attribute Summary collapse

Attributes included from Model

#id, #reverse_attr_map

Class Method Summary collapse

Methods included from Model

#attr_mapping, included, #initialize, #reverse_attr_mapping, #to_json, #update_attributes

Instance Attribute Details

#agreed_to_termsObject

Returns the value of attribute agreed_to_terms.



12
13
14
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 12

def agreed_to_terms
  @agreed_to_terms
end

#all_apps_visibleObject

Returns the value of attribute all_apps_visible.



14
15
16
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 14

def all_apps_visible
  @all_apps_visible
end

#emailObject

Returns the value of attribute email.



10
11
12
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 10

def email
  @email
end

#email_vetting_requiredObject

Returns the value of attribute email_vetting_required.



16
17
18
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 16

def email_vetting_required
  @email_vetting_required
end

#first_nameObject

Returns the value of attribute first_name.



8
9
10
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 8

def first_name
  @first_name
end

#last_nameObject

Returns the value of attribute last_name.



9
10
11
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 9

def last_name
  @last_name
end

#notificationsObject

Returns the value of attribute notifications.



17
18
19
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 17

def notifications
  @notifications
end

#preferred_currency_territoryObject

Returns the value of attribute preferred_currency_territory.



11
12
13
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 11

def preferred_currency_territory
  @preferred_currency_territory
end

#provisioning_allowedObject

Returns the value of attribute provisioning_allowed.



15
16
17
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 15

def provisioning_allowed
  @provisioning_allowed
end

#rolesObject

Returns the value of attribute roles.



13
14
15
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 13

def roles
  @roles
end

#usernameObject

Returns the value of attribute username.



7
8
9
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 7

def username
  @username
end

Class Method Details

.all(client: nil, filter: {}, includes: nil, limit: nil, sort: nil) ⇒ Object

API



41
42
43
44
45
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 41

def self.all(client: nil, filter: {}, includes: nil, limit: nil, sort: nil)
  client ||= Spaceship::ConnectAPI
  resps = client.get_users(filter: filter, includes: includes).all_pages
  return resps.flat_map(&:to_models)
end

.find(client: nil, email: nil, includes: nil) ⇒ Object



47
48
49
50
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 47

def self.find(client: nil, email: nil, includes: nil)
  client ||= Spaceship::ConnectAPI
  return all(client: client, filter: { email: email }, includes: includes)
end

.typeObject



33
34
35
# File 'spaceship/lib/spaceship/connect_api/models/user.rb', line 33

def self.type
  return "users"
end