spaceship/lib/spaceship/tunes/app_version.rb in fastlane-2.38.0.beta.20170612010035 vs spaceship/lib/spaceship/tunes/app_version.rb in fastlane-2.38.0

- old
+ new

@@ -171,10 +171,32 @@ attr_reader :screenshots # @return (Hash) Represents the trailers of this app version (read-only) attr_reader :trailers + # @return (Hash) Represents the phased_release hash (read-only) + # For now, please use the `toggle_phased_release` method and call `.save!` + # as the API will probably change in the future + attr_reader :phased_release + + # Currently phased_release doesn't seem to have all the features enabled + # + # => {"state"=>{"value"=>"NOT_STARTED", "isEditable"=>true, "isRequired"=>false, "errorKeys"=>nil}, + # "startDate"=>nil, + # "lastPaused"=>nil, + # "pausedDuration"=>nil, + # "totalPauseDays"=>30, + # "currentDayNumber"=>nil, + # "dayPercentageMap"=>{"1"=>1, "2"=>2, "3"=>5, "4"=>10, "5"=>20, "6"=>50, "7"=>100}, + # "isEnabled"=>true} + # + def toggle_phased_release(enabled: false) + state = (enabled ? "INACTIVE" : "NOT_STARTED") + + self.phased_release["state"]["value"] = state + end + attr_mapping({ 'appType' => :app_type, 'platform' => :platform, 'canBetaTest' => :can_beta_test, 'canPrepareForUpload' => :can_prepare_for_upload, @@ -189,9 +211,10 @@ 'status' => :raw_status, 'preReleaseBuild.buildVersion' => :build_version, 'supportsAppleWatch' => :supports_apple_watch, 'versionId' => :version_id, 'version.value' => :version, + 'phasedRelease' => :phased_release, # GeoJson # 'transitAppFile.value' => :transit_app_file # Trade Representative Contact Information