Sha256: 2cfb2236a6915576f1ccb187eef98ff9f9f7a34a9c20c40a20a59fd98819077b

Contents?: true

Size: 1.42 KB

Versions: 98

Compression:

Stored size: 1.42 KB

Contents

require_relative '../model'
module Spaceship
  class ConnectAPI
    class AppStoreVersionPhasedRelease
      include Spaceship::ConnectAPI::Model

      attr_accessor :phased_release_state
      attr_accessor :start_date
      attr_accessor :total_pause_duration
      attr_accessor :current_day_number

      module PhasedReleaseState
        INACTIVE = "INACTIVE"
        ACTIVE = "ACTIVE"
        PAUSED = "PAUSED"
        COMPLETE = "COMPLETE"
      end

      attr_mapping({
        "phasedReleaseState" => "phased_release_state",
        "startDate" => "start_date",
        "totalPauseDuration" => "total_pause_duration",
        "currentDayNumber" => "current_day_number"
      })

      def self.type
        return "appStoreVersionPhasedReleases"
      end

      #
      # API
      #

      def pause
        update(PhasedReleaseState::PAUSED)
      end

      def resume
        update(PhasedReleaseState::ACTIVE)
      end

      def complete
        update(PhasedReleaseState::COMPLETE)
      end

      def delete!(filter: {}, includes: nil, limit: nil, sort: nil)
        Spaceship::ConnectAPI.delete_app_store_version_phased_release(app_store_version_phased_release_id: id)
      end

      private def update(state)
        Spaceship::ConnectAPI.patch_app_store_version_phased_release(app_store_version_phased_release_id: id, attributes: {
          phasedReleaseState: state
        }).to_models.first
      end
    end
  end
end

Version data entries

98 entries across 98 versions & 4 rubygems

Version Path
fastlane-2.226.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.225.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.224.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.223.1 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.223.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.222.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.221.1 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.221.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.220.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.219.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.218.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-security-patched-2.216.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.217.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.216.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.215.1 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.215.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-mercafacil-2.214.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.214.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.213.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane-2.212.2 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb