Class: Spaceship::ConnectAPI::BetaTester

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

Instance Attribute Summary collapse

Attributes included from Model

#id, #reverse_attr_map

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Model

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

Instance Attribute Details

#appsObject

Returns the value of attribute apps.



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

def apps
  @apps
end

#beta_groupsObject

Returns the value of attribute beta_groups.



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

def beta_groups
  @beta_groups
end

#beta_tester_metricsObject

Returns the value of attribute beta_tester_metrics.



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

def beta_tester_metrics
  @beta_tester_metrics
end

#buildsObject

Returns the value of attribute builds.



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

def builds
  @builds
end

#emailObject

Returns the value of attribute email.



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

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name.



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

def first_name
  @first_name
end

#invitationObject

Returns the value of attribute invitation.



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

def invitation
  @invitation
end

#invite_typeObject

Returns the value of attribute invite_type.



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

def invite_type
  @invite_type
end

#last_nameObject

Returns the value of attribute last_name.



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

def last_name
  @last_name
end

Class Method Details

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

API



39
40
41
42
43
# File 'spaceship/lib/spaceship/connect_api/models/beta_tester.rb', line 39

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

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



45
46
47
48
# File 'spaceship/lib/spaceship/connect_api/models/beta_tester.rb', line 45

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

.typeObject



31
32
33
# File 'spaceship/lib/spaceship/connect_api/models/beta_tester.rb', line 31

def self.type
  return "betaTesters"
end

Instance Method Details

#delete_from_apps(client: nil, apps: nil) ⇒ Object



50
51
52
53
54
# File 'spaceship/lib/spaceship/connect_api/models/beta_tester.rb', line 50

def delete_from_apps(client: nil, apps: nil)
  client ||= Spaceship::ConnectAPI
  app_ids = apps.map(&:id)
  return client.delete_beta_tester_from_apps(beta_tester_id: id, app_ids: app_ids)
end

#delete_from_beta_groups(client: nil, beta_groups: nil) ⇒ Object



56
57
58
59
60
# File 'spaceship/lib/spaceship/connect_api/models/beta_tester.rb', line 56

def delete_from_beta_groups(client: nil, beta_groups: nil)
  client ||= Spaceship::ConnectAPI
  beta_group_ids = beta_groups.map(&:id)
  return client.delete_beta_tester_from_beta_groups(beta_tester_id: id, beta_group_ids: beta_group_ids)
end