Class: Ovh::Api::Api::Services::Form
- Inherits:
-
Object
- Object
- Ovh::Api::Api::Services::Form
- Defined in:
- lib/ovh-api/api/services/form.rb
Instance Method Summary collapse
- #answer(form_name:, service_id:, services_form_form:) ⇒ Object
- #get(form_name:, service_id:) ⇒ Object
-
#initialize(connection) ⇒ Form
constructor
A new instance of Form.
- #list(service_id:) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Form
Returns a new instance of Form.
6 7 8 |
# File 'lib/ovh-api/api/services/form.rb', line 6 def initialize(connection) @connection = connection end |
Instance Method Details
#answer(form_name:, service_id:, services_form_form:) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ovh-api/api/services/form.rb', line 10 def answer(form_name:, service_id:, services_form_form:) raise ArgumentError, 'form_name is required' if form_name.nil? raise ArgumentError, 'service_id is required' if service_id.nil? raise ArgumentError, 'services_form_form is required' if services_form_form.nil? @connection.call( :POST, '/services/{serviceId}/form/{formName}/answer' .gsub('{formName}', ERB::Util.url_encode(form_name.to_s)) .gsub('{serviceId}', ERB::Util.url_encode(service_id.to_s)), type: nil, auth: [], body: services_form_form ) end |
#get(form_name:, service_id:) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ovh-api/api/services/form.rb', line 26 def get(form_name:, service_id:) raise ArgumentError, 'form_name is required' if form_name.nil? raise ArgumentError, 'service_id is required' if service_id.nil? @connection.call( :GET, '/services/{serviceId}/form/{formName}' .gsub('{formName}', ERB::Util.url_encode(form_name.to_s)) .gsub('{serviceId}', ERB::Util.url_encode(service_id.to_s)), type: nil, auth: [] ) end |
#list(service_id:) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/ovh-api/api/services/form.rb', line 40 def list(service_id:) raise ArgumentError, 'service_id is required' if service_id.nil? @connection.call( :GET, '/services/{serviceId}/form' .gsub('{serviceId}', ERB::Util.url_encode(service_id.to_s)), type: nil, auth: [] ) end |