Sha256: 0c54f327f56451585fb9ff37d7162269cfacc0383b85b88e772f047968ef430b

Contents?: true

Size: 1.47 KB

Versions: 3

Compression:

Stored size: 1.47 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

3 entries across 3 versions & 1 rubygems

Version Path
fastlane_hotfix-2.165.1 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane_hotfix-2.165.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb
fastlane_hotfix-2.187.0 spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb