Class: DeepL::Requests::Document::GetStatus

Inherits:
Base
  • Object
show all
Defined in:
lib/deepl/requests/document/get_status.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#api, #options, #response

Instance Method Summary collapse

Constructor Details

#initialize(api, document_id, document_key, options = {}, additional_headers = {}) ⇒ GetStatus

Returns a new instance of GetStatus.



12
13
14
15
16
# File 'lib/deepl/requests/document/get_status.rb', line 12

def initialize(api, document_id, document_key, options = {}, additional_headers = {})
  super(api, options, additional_headers)
  @document_id = document_id
  @document_key = document_key
end

Instance Attribute Details

#document_idObject (readonly)

Returns the value of attribute document_id.



10
11
12
# File 'lib/deepl/requests/document/get_status.rb', line 10

def document_id
  @document_id
end

#document_keyObject (readonly)

Returns the value of attribute document_key.



10
11
12
# File 'lib/deepl/requests/document/get_status.rb', line 10

def document_key
  @document_key
end

Instance Method Details

#detailsObject



23
24
25
# File 'lib/deepl/requests/document/get_status.rb', line 23

def details
  "HTTP Headers: #{headers}\nPayload #{{ document_key: document_key }}"
end

#requestObject



18
19
20
21
# File 'lib/deepl/requests/document/get_status.rb', line 18

def request
  payload = { document_key: document_key }
  build_doc_translation_status(*execute_request_with_retries(post_request(payload)))
end

#to_sObject



27
28
29
# File 'lib/deepl/requests/document/get_status.rb', line 27

def to_s
  "POST #{uri.request_uri}"
end