Sha256: 0d4f09b477701f75724ce185ecb9134ac6efc670b67a247edd7e236af7b13aaa

Contents?: true

Size: 1.02 KB

Versions: 6

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

require 'client/conversion/base_conversion_client'
require 'param/conversion/document/processing_job_url_builder'

module Uploadcare
  module Client
    module Conversion
      # This is client for document conversion
      #
      # @see https://uploadcare.com/api-refs/rest-api/v0.6.0/#operation/documentConvert
      class DocumentConversionClient < BaseConversionClient
        def convert_many(
          arr,
          options = {},
          url_builder_class = Param::Conversion::Document::ProcessingJobUrlBuilder
        )
          send_convert_request(arr, options, url_builder_class)
        end

        def get_conversion_status(token)
          get(uri: "/convert/document/status/#{token}/")
        end

        private

        def convert_uri
          '/convert/document/'
        end

        def build_paths_body(params)
          {
            uuid: params[:uuid],
            format: params[:format],
            page: params[:page]
          }.compact
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
uploadcare-ruby-3.3.2 lib/uploadcare/client/conversion/document_conversion_client.rb
uploadcare-ruby-3.3.1 lib/uploadcare/client/conversion/document_conversion_client.rb
uploadcare-ruby-3.3.0 lib/uploadcare/client/conversion/document_conversion_client.rb
uploadcare-ruby-3.2.0 lib/uploadcare/client/conversion/document_conversion_client.rb
uploadcare-ruby-3.1.1 lib/uploadcare/client/conversion/document_conversion_client.rb
uploadcare-ruby-3.1.0 lib/uploadcare/client/conversion/document_conversion_client.rb