require_relative 'base' require 'json' class Page < Base def create_page(data) base_url = petra_object.base_url required_parameters = ["name","amount","description"] check_passed_parameters(required_parameters, data) response = post_request("#{base_url}/page", data) return response end def get_pages(page =1 , per_page =50) base_url = petra_object.base_url response = get_request("#{base_url}/page?perPage=#{per_page}&page=#{page}") return response end def get_page(id) base_url = petra_object.base_url response = get_request("#{base_url}/page/#{id}") return response end def update_page(id, payload) base_url = petra_object.base_url required_parameters = ["name"] check_passed_parameters(required_parameters, payload) response = put_request("#{base_url}/page/#{id}", payload) end def check_slug_availability(slug) base_url = petra_object.base_url response = get_request("#{base_url}/page/check_slug_availability/#{slug}") return response end end