Module: Crowdin::ApiResources::Fields
- Defined in:
- lib/crowdin-api/api_resources/fields.rb
Instance Method Summary collapse
- #add_field(body = {}) ⇒ Object
- #delete_field(field_id) ⇒ Object
- #edit_field(field_id, body = []) ⇒ Object
- #get_field(field_id) ⇒ Object
- #list_fields(query = {}) ⇒ Object
Instance Method Details
#add_field(body = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/crowdin-api/api_resources/fields.rb', line 24 def add_field(body = {}) enterprise_mode? || raise_only_for_enterprise_mode_error request = Web::Request.new( connection, :post, "#{config.target_api_url}/fields", { params: body } ) Web::SendRequest.new(request).perform end |
#delete_field(field_id) ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/crowdin-api/api_resources/fields.rb', line 38 def delete_field(field_id) enterprise_mode? || raise_only_for_enterprise_mode_error request = Web::Request.new( connection, :delete, "#{config.target_api_url}/fields/#{field_id}" ) Web::SendRequest.new(request).perform end |
#edit_field(field_id, body = []) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/crowdin-api/api_resources/fields.rb', line 65 def edit_field(field_id, body = []) enterprise_mode? || raise_only_for_enterprise_mode_error request = Web::Request.new( connection, :patch, "#{config.target_api_url}/fields/#{field_id}", { params: body } ) Web::SendRequest.new(request).perform end |
#get_field(field_id) ⇒ Object
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/crowdin-api/api_resources/fields.rb', line 51 def get_field(field_id) enterprise_mode? || raise_only_for_enterprise_mode_error request = Web::Request.new( connection, :get, "#{config.target_api_url}/fields/#{field_id}" ) Web::SendRequest.new(request).perform end |
#list_fields(query = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/crowdin-api/api_resources/fields.rb', line 10 def list_fields(query = {}) enterprise_mode? || raise_only_for_enterprise_mode_error request = Web::Request.new( connection, :get, "#{config.target_api_url}/fields", { params: query } ) Web::SendRequest.new(request).perform end |