spaceship/lib/spaceship/portal/app.rb in fastlane-2.102.0 vs spaceship/lib/spaceship/portal/app.rb in fastlane-2.103.0
- old
+ new
@@ -1,7 +1,8 @@
require_relative 'portal_base'
require_relative 'app_group'
+require_relative 'cloud_container'
module Spaceship
module Portal
# Represents an App ID from the Developer Portal
class App < PortalBase
@@ -55,10 +56,13 @@
attr_accessor :identifiers_count
# @return (Array of Spaceship::Portal::AppGroup) Associated groups
attr_accessor :associated_groups
+ # @return (Array of Spaceship::Portal::CloudContainer) Associated cloud containers
+ attr_accessor :associated_cloud_containers
+
attr_mapping(
'appIdId' => :app_id,
'name' => :name,
'appIdPlatform' => :platform,
'prefix' => :prefix,
@@ -68,11 +72,12 @@
'enabledFeatures' => :enable_services,
'isDevPushEnabled' => :dev_push_enabled,
'isProdPushEnabled' => :prod_push_enabled,
'associatedApplicationGroupsCount' => :app_groups_count,
'associatedCloudContainersCount' => :cloud_containers_count,
- 'associatedIdentifiersCount' => :identifiers_count
+ 'associatedIdentifiersCount' => :identifiers_count,
+ 'associatedCloudContainers' => :associated_cloud_containers
)
class << self
# @param mac [Bool] Fetches Mac apps if true
# @return (Array) Returns all apps available for this account
@@ -115,10 +120,18 @@
@associated_groups ||= raw_data['associatedApplicationGroups'].map do |info|
Spaceship::Portal::AppGroup.new(info)
end
end
+ def associated_cloud_containers
+ return unless raw_data['associatedCloudContainers']
+
+ @associated_cloud_containers ||= raw_data['associatedCloudContainers'].map do |info|
+ Spaceship::Portal::CloudContainer.new(info)
+ end
+ end
+
# Delete this App ID. This action will most likely fail if the App ID is already in the store
# or there are active profiles
# @return (App) The app you just deletd
def delete!
client.delete_app!(app_id, mac: mac?)
@@ -142,9 +155,17 @@
# Associate specific groups with this app
# @return (App) The updated detailed app. This is nil if the app couldn't be found
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 specific iCloud Containers with this app
+ # @return (App) The updated detailed app. This is nil if the app couldn't be found.
+ 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 specific merchants with this app
# @return (App) The updated detailed app. This is nil if the app couldn't be found