Class: DeepL::Requests::StyleProfile::Update

Inherits:
Base
  • Object
show all
Defined in:
lib/deepl/requests/style_profile/update.rb

Constant Summary

Constants inherited from Base

Base::COMPONENT_ID_FIELDS

Constants inherited from Base

Base::MAX_GLOSSARY_IDS, Base::NETWORK_ERRORS, Base::RESPONSE_FORMAT_ERRORS, Base::RETRYABLE_NETWORK_ERRORS, Base::TECHNICAL_HEADERS

Instance Attribute Summary collapse

Attributes inherited from Base

#api, #options, #response

Instance Method Summary collapse

Methods inherited from Base

accepted_options, accepts_options, #details, inherited, validate_options!

Constructor Details

#initialize(api, id, fields, options = {}) ⇒ Update

Returns a new instance of Update.



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

def initialize(api, id, fields, options = {})
  super(api, options)
  @id = style_profile_id(id)
  @fields = fields
end

Instance Attribute Details

#fields ⇒ Object (readonly)

Returns the value of attribute fields.



10
11
12
# File 'lib/deepl/requests/style_profile/update.rb', line 10

def fields
  @fields
end

#id ⇒ Object (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/deepl/requests/style_profile/update.rb', line 10

def id
  @id
end

Instance Method Details

#request ⇒ Object



18
19
20
21
# File 'lib/deepl/requests/style_profile/update.rb', line 18

def request
  payload = optional_fields_payload(fields)
  build_style_profile(*execute_request_with_retries(patch_request(payload)))
end

#to_s ⇒ Object



23
24
25
# File 'lib/deepl/requests/style_profile/update.rb', line 23

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