Sha256: c90f2876dfba10bdb29547f8aabf735d57e2ca732e3b4941ee0383a3b5d4a1e5

Contents?: true

Size: 1.25 KB

Versions: 7

Compression:

Stored size: 1.25 KB

Contents

module Ecoportal
  module API
    class V2
      class S3
        class Files
          class PollStatus < Common::Content::DoubleModel
            class FileContainer < Common::Content::DoubleModel
              passkey :id
              passthrough :file_container_id # same as :id :)
              passthrough :name, :label
              passthrough :file_size, :content_type
              passthrough :tags
              passboolean :archived
              passthrough :active_person, :user_name
              passdate :created_at, :updated_at, :file_update_at
            end

            # PollStatus
            passthrough :status
            embeds_one :file, klass: FileContainer

            def container_id
              return unless success?

              file&.id
            end

            def complete?
              success? || failed?
            end

            def timeout?
              statut == 'timeout'
            end

            def pending?
              status == "pending"
            end

            def success?
              status == "success"
            end

            def failed?
              status == "failed"
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ecoportal-api-v2-2.0.6 lib/ecoportal/api/v2/s3/files/poll_status.rb
ecoportal-api-v2-2.0.5 lib/ecoportal/api/v2/s3/files/poll_status.rb
ecoportal-api-v2-2.0.4 lib/ecoportal/api/v2/s3/files/poll_status.rb
ecoportal-api-v2-2.0.3 lib/ecoportal/api/v2/s3/files/poll_status.rb
ecoportal-api-v2-2.0.2 lib/ecoportal/api/v2/s3/files/poll_status.rb
ecoportal-api-v2-2.0.1 lib/ecoportal/api/v2/s3/files/poll_status.rb
ecoportal-api-v2-2.0.0 lib/ecoportal/api/v2/s3/files/poll_status.rb