Module: UriService::Client::Requests::CustomFields
- Included in:
- Connection
- Defined in:
- lib/uri_service/client/requests/custom_fields.rb
Instance Method Summary collapse
- #create_custom_field(vocabulary, custom_field = {}) ⇒ Object
- #delete_custom_field(vocabulary, field_key) ⇒ Object
- #update_custom_field(vocabulary, custom_field = {}) ⇒ Object
Instance Method Details
#create_custom_field(vocabulary, custom_field = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/uri_service/client/requests/custom_fields.rb', line 5 def create_custom_field(vocabulary, custom_field = {}) request(:post, "/vocabularies/#{vocabulary}/custom_fields", body: custom_field) end |
#delete_custom_field(vocabulary, field_key) ⇒ Object
19 20 21 22 |
# File 'lib/uri_service/client/requests/custom_fields.rb', line 19 def delete_custom_field(vocabulary, field_key) request(:delete, "/vocabularies/#{vocabulary}/custom_fields/#{field_key}") end |
#update_custom_field(vocabulary, custom_field = {}) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/uri_service/client/requests/custom_fields.rb', line 11 def update_custom_field(vocabulary, custom_field = {}) field_key = custom_field.delete('field_key') || custom_field.delete(:field_key) request(:patch, "/vocabularies/#{vocabulary}/custom_fields/#{field_key}", body: custom_field) end |