Class: DeepL::Requests::TranslationMemory::CreateImport

Inherits:
Base
  • Object
show all
Defined in:
lib/deepl/requests/translation_memory/create_import.rb

Constant Summary

Constants inherited from Base

Base::MAX_GLOSSARY_IDS

Instance Attribute Summary collapse

Attributes inherited from Base

#api, #options, #response

Instance Method Summary collapse

Constructor Details

#initialize(api, file_name, content_length, options = {}, additional_headers = {}) ⇒ CreateImport

Returns a new instance of CreateImport.



12
13
14
15
16
17
18
# File 'lib/deepl/requests/translation_memory/create_import.rb', line 12

def initialize(api, file_name, content_length, options = {}, additional_headers = {})
  super(api, options, additional_headers)
  @file_name = file_name
  @content_length = content_length
  @content_type = delete_option(:content_type)
  @display_name = delete_option(:display_name)
end

Instance Attribute Details

#content_lengthObject (readonly)

Returns the value of attribute content_length.



10
11
12
# File 'lib/deepl/requests/translation_memory/create_import.rb', line 10

def content_length
  @content_length
end

#file_nameObject (readonly)

Returns the value of attribute file_name.



10
11
12
# File 'lib/deepl/requests/translation_memory/create_import.rb', line 10

def file_name
  @file_name
end

Instance Method Details

#detailsObject



24
25
26
# File 'lib/deepl/requests/translation_memory/create_import.rb', line 24

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

#requestObject



20
21
22
# File 'lib/deepl/requests/translation_memory/create_import.rb', line 20

def request
  build_translation_memory_import(*execute_request_with_retries(post_request(payload)))
end

#to_sObject



28
29
30
# File 'lib/deepl/requests/translation_memory/create_import.rb', line 28

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