module Support
  module Services
    class OwsVideo
      include HTTParty

      base_uri DOMAINS[:ows_video]

      class << self
        def reject_product(product_id)
          path = "/product/#{product_id}/approval"
          options = {
            body: { "approval_type" => "rejection", "value" => "saaaaad" }.to_json,
            headers: { "Content-Type" => "application/json", "Orchard-User-Id" => "oa:1241" }
          }
          response = post(path, options)

          JSON.parse(response.body)
        end

        def video_job_status(job_id)
          path = "/jobs?job_id=#{job_id}"
          response = get(path)

          JSON.parse(response.body)["items"].first["status"]
        end
      end
    end
  end
end
