lib/spaceship/tunes/build.rb in spaceship-0.23.0 vs lib/spaceship/tunes/build.rb in spaceship-0.24.0

- old
+ new

@@ -4,10 +4,15 @@ class Build < TunesBase ##################################################### # @!group General metadata ##################################################### + # @return (String) The App identifier of this app, provided by iTunes Connect + # @example + # "1013943394" + attr_accessor :apple_id + # @return (Spaceship::Tunes::BuildTrain) 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 @@ -110,16 +115,29 @@ self.external_expiry_date ||= 0 self.internal_expiry_date ||= 0 end + def details + response = client.build_details(app_id: self.apple_id, + train: self.train_version, + build_number: self.build_version) + response['apple_id'] = self.apple_id + BuildDetails.factory(response) + end + + def apple_id + return @apple_id if @apple_id + return self.build_train.application.apple_id + end + def update_build_information!(whats_new: nil, description: nil, feedback_email: nil) parameters = { - app_id: self.build_train.application.apple_id, - train: self.build_train.version_string, + app_id: self.apple_id, + train: self.train_version, build_number: self.build_version, platform: self.platform }.merge({ whats_new: whats_new, description: description, @@ -148,12 +166,12 @@ # review_password: nil, # encryption: false # } def submit_for_beta_review!(metadata) parameters = { - app_id: self.build_train.application.apple_id, - train: self.build_train.version_string, + app_id: self.apple_id, + train: self.train_version, build_number: self.build_version, platform: self.platform, # Required Metadata: changelog: "No changelog provided", @@ -197,11 +215,11 @@ return testing end # This will cancel the review process for this TestFlight build def cancel_beta_review! - client.remove_testflight_build_from_review!(app_id: self.build_train.application.apple_id, - train: self.build_train.version_string, + client.remove_testflight_build_from_review!(app_id: self.apple_id, + train: self.train_version, build_number: self.build_version, platform: self.platform) end end end