Class: Spaceship::Portal::App
- Inherits:
-
Spaceship::PortalBase
- Object
- Base
- Spaceship::PortalBase
- Spaceship::Portal::App
- Defined in:
- spaceship/lib/spaceship/portal/app.rb
Overview
Represents an App ID from the Developer Portal
Instance Attribute Summary collapse
-
#app_groups_count ⇒ Fixnum
Number of associated app groups.
-
#app_id ⇒ String
The identifier of this app, provided by the Dev Portal.
-
#associated_cloud_containers ⇒ Array of Spaceship::Portal::CloudContainer
Associated cloud containers.
-
#associated_groups ⇒ Array of Spaceship::Portal::AppGroup
Associated groups.
-
#bundle_id ⇒ String
The bundle_id (app identifier) of your app.
-
#cloud_containers_count ⇒ Fixnum
Number of associated cloud containers.
-
#dev_push_enabled ⇒ Bool
Development Push Enabled?.
-
#enable_services ⇒ Array
List of enabled services.
-
#features ⇒ Hash
Feature details.
-
#identifiers_count ⇒ Fixnum
Number of associated identifiers.
-
#is_wildcard ⇒ Bool
Is this app a wildcard app (e.g. com.krausefx.*).
-
#name ⇒ String
The name you provided for this app.
-
#platform ⇒ String
The supported platform of this app.
-
#prefix ⇒ Object
Prefix provided by the Dev Portal.
-
#prod_push_enabled ⇒ Bool
Production Push Enabled?.
Attributes inherited from Base
Class Method Summary collapse
-
.all(mac: false) ⇒ Array
Returns all apps available for this account.
-
.create!(bundle_id: nil, name: nil, mac: false, enable_services: {}) ⇒ App
Creates a new App ID on the Apple Dev Portal.
-
.find(bundle_id, mac: false) ⇒ App
Find a specific App ID based on the bundle_id.
Instance Method Summary collapse
-
#associate_cloud_containers(containers) ⇒ App
Associate specific iCloud Containers with this app.
-
#associate_groups(groups) ⇒ App
Associate specific groups with this app.
-
#associate_merchants(merchants) ⇒ App
Associate specific merchants with this app.
-
#delete! ⇒ App
Delete this App ID.
-
#details ⇒ App
Fetch a specific App ID details based on the bundle_id.
-
#mac? ⇒ Bool
Is this a Mac app?.
-
#update_name!(name, mac: false) ⇒ App
Update name of this App ID.
-
#update_service(service) ⇒ App
Update a service for the app with given AppService object.
Methods inherited from Spaceship::PortalBase
Methods inherited from Base
attr_accessor, attr_mapping, attributes, #attributes, factory, #initialize, #inspect, mapping_module, method_missing, set_client, #setup, #to_s
Constructor Details
This class inherits a constructor from Spaceship::Base
Instance Attribute Details
#app_groups_count ⇒ Fixnum
Returns Number of associated app groups.
50 51 52 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 50 def app_groups_count @app_groups_count end |
#app_id ⇒ String
Returns The identifier of this app, provided by the Dev Portal.
12 13 14 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 12 def app_id @app_id end |
#associated_cloud_containers ⇒ Array of Spaceship::Portal::CloudContainer
Returns Associated cloud containers.
62 63 64 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 62 def associated_cloud_containers @associated_cloud_containers end |
#associated_groups ⇒ Array of Spaceship::Portal::AppGroup
Returns Associated groups.
59 60 61 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 59 def associated_groups @associated_groups end |
#bundle_id ⇒ String
Returns The bundle_id (app identifier) of your app.
32 33 34 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 32 def bundle_id @bundle_id end |
#cloud_containers_count ⇒ Fixnum
Returns Number of associated cloud containers.
53 54 55 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 53 def cloud_containers_count @cloud_containers_count end |
#dev_push_enabled ⇒ Bool
Returns Development Push Enabled?.
44 45 46 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 44 def dev_push_enabled @dev_push_enabled end |
#enable_services ⇒ Array
Returns List of enabled services.
41 42 43 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 41 def enable_services @enable_services end |
#features ⇒ Hash
Returns Feature details.
38 39 40 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 38 def features @features end |
#identifiers_count ⇒ Fixnum
Returns Number of associated identifiers.
56 57 58 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 56 def identifiers_count @identifiers_count end |
#is_wildcard ⇒ Bool
Returns Is this app a wildcard app (e.g. com.krausefx.*).
35 36 37 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 35 def is_wildcard @is_wildcard end |
#name ⇒ String
Returns The name you provided for this app.
17 18 19 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 17 def name @name end |
#platform ⇒ String
Returns the supported platform of this app.
22 23 24 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 22 def platform @platform end |
#prefix ⇒ Object
Prefix provided by the Dev Portal
27 28 29 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 27 def prefix @prefix end |
#prod_push_enabled ⇒ Bool
Returns Production Push Enabled?.
47 48 49 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 47 def prod_push_enabled @prod_push_enabled end |
Class Method Details
.all(mac: false) ⇒ Array
Returns all apps available for this account
84 85 86 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 84 def all(mac: false) client.apps(mac: mac).map { |app| self.new(app) } end |
.create!(bundle_id: nil, name: nil, mac: false, enable_services: {}) ⇒ App
Creates a new App ID on the Apple Dev Portal
if bundle_id ends with ‘*’ then it is a wildcard id otherwise, it is an explicit id
95 96 97 98 99 100 101 102 103 104 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 95 def create!(bundle_id: nil, name: nil, mac: false, enable_services: {}) if bundle_id.end_with?('*') type = :wildcard else type = :explicit end new_app = client.create_app!(type, name, bundle_id, mac: mac, enable_services: enable_services) self.new(new_app) end |
.find(bundle_id, mac: false) ⇒ App
Find a specific App ID based on the bundle_id
109 110 111 112 113 114 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 109 def find(bundle_id, mac: false) raise "`bundle_id` parameter must not be nil" if bundle_id.nil? all(mac: mac).find do |app| return app if app.bundle_id.casecmp(bundle_id) == 0 end end |
Instance Method Details
#associate_cloud_containers(containers) ⇒ App
Associate specific iCloud Containers with this app
165 166 167 168 169 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 165 def associate_cloud_containers(containers) raise "`associate_cloud_containers` not available for Mac apps" if mac? app = client.associate_cloud_containers_with_app(self, containers) self.class.factory(app) end |
#associate_groups(groups) ⇒ App
Associate specific groups with this app
157 158 159 160 161 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 157 def associate_groups(groups) raise "`associate_groups` not available for Mac apps" if mac? app = client.associate_groups_with_app(self, groups) self.class.factory(app) end |
#associate_merchants(merchants) ⇒ App
Associate specific merchants with this app
173 174 175 176 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 173 def associate_merchants(merchants) app = client.associate_merchants_with_app(self, merchants, mac?) self.class.factory(app) end |
#delete! ⇒ App
Delete this App ID. This action will most likely fail if the App ID is already in the store or there are active profiles
136 137 138 139 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 136 def delete! client.delete_app!(app_id, mac: mac?) self end |
#details ⇒ App
Fetch a specific App ID details based on the bundle_id
150 151 152 153 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 150 def details app = client.details_for_app(self) self.class.factory(app) end |
#mac? ⇒ Bool
Returns Is this a Mac app?.
187 188 189 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 187 def mac? platform == 'mac' end |
#update_name!(name, mac: false) ⇒ App
Update name of this App ID.
143 144 145 146 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 143 def update_name!(name, mac: false) app = client.update_app_name!(app_id, name, mac: mac) self.class.factory(app) end |
#update_service(service) ⇒ App
Update a service for the app with given AppService object
180 181 182 183 184 |
# File 'spaceship/lib/spaceship/portal/app.rb', line 180 def update_service(service) raise "`update_service` not implemented for Mac apps" if mac? app = client.update_service_for_app(self, service) self.class.factory(app) end |