module Spaceship module Tunes # Represents a build which is inside the build train class Build < TunesBase ##################################################### # @!group General metadata ##################################################### # @return (Spaceship::Tunes::Application) A reference to the build train this build is contained in attr_accessor :build_train # @return (Integer) The ID generated by iTunes Connect attr_accessor :id # @return (Boolean) attr_accessor :valid # @return (String) The build version (not the version number) attr_accessor :build_version # @return (String) The version number (e.g. 1.3) attr_accessor :train_version # @return (Integer) The number of ticks since 1970 (e.g. 1413966436000) attr_accessor :upload_date # @return (String) URL to the app icon of this build (150x150px) attr_accessor :icon_url # @return (String) attr_accessor :app_name # @return (String) The platform of this build (e.g. 'ios') attr_accessor :platform # @return (Integer) When is this build going to be invalid attr_accessor :internal_expiry_date # @return (Bool) Does this build support WatchKit? attr_accessor :watch_kit_enabled # @return (Bool): attr_accessor :ready_to_install ##################################################### # @!group Analytics ##################################################### # @return (Integer) Number of installs of this build attr_accessor :install_count # @return (Integer) Number of installs for this build that come from internal users attr_accessor :internal_install_count # @return (Integer) Number of installs for this build that come from external users attr_accessor :external_install_count # @return (Integer) Might be nil. The number of sessions for this build attr_accessor :session_count # @return (Integer) Might be nil. The number of crashes of this build attr_accessor :crash_count attr_mapping( 'uploadDate' => :upload_date, 'iconUrl' => :icon_url, 'buildVersion' => :build_version, 'trainVersion' => :train_version, 'appName' => :app_name, 'platform' => :platform, 'id' => :id, 'valid' => :valid, 'installCount' => :install_count, 'internalInstallCount' => :internal_install_count, 'externalInstallCount' => :external_install_count, 'sessionCount' => :session_count, 'crashCount' => :crash_count, 'internalExpiry' => :internal_expiry_date, 'watchKitEnabled' => :watch_kit_enabled, 'readyToInstall' => :ready_to_install, ) class << self # Create a new object based on a hash. # This is used to create a new object based on the server response. def factory(attrs) self.new(attrs) end end end end end # Example response # "buildVersion": "0.9.10", # "trainVersion": "0.9.10", # "uploadDate": 1413966436000, # "iconUrl": "https://is5-ssl.mzstatic.com/image/thumb/Newsstand5/v4/e8/ab/f8/e8abf8ca-6c22-a519-aa1b-c73901c4917e/Icon-60@2x.png.png/150x150bb-80.png", # "appName": "Yeahaa", # "platform": "ios", # "betaEntitled": false, # "id": 523299, # "valid": true, # "missingExportCompliance": false, # "waitingForExportComplianceApproval": false, # "addedInternalUsersCount": 0, # "addedExternalUsersCount": 0, # "invitedExternalUsersCount": 0, # "invitedInternalUsersCount": 0, # "acceptedInternalUsersCount": 0, # "acceptedExternalUsersCount": 0, # "installCount": 0, # "internalInstallCount": 0, # "externalInstallCount": 0, # "sessionCount": null, # "crashCount": null, # "promotedVersion": null, # "internalState": "noBetaEntitlement", # "betaState": "noBetaEntitlement", # "internalExpiry": 1416562036000, # "externalExpiry": 0, # "watchKitEnabled": false, # "readyToInstall": false, # "sdkBuildWhitelisted": true, # "internalTesting": null, # "externalTesting": null