Class: DeepL::Requests::StyleProfile::Update
- Defined in:
- lib/deepl/requests/style_profile/update.rb
Constant Summary
Constants inherited from Base
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
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(api, id, fields, options = {}) ⇒ Update
constructor
A new instance of Update.
- #request ⇒ Object
- #to_s ⇒ Object
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, = {}) super(api, ) @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 |