Module: BeyondApi::ShopLegals
- Included in:
- Shop
- Defined in:
- lib/beyond_api/resources/shops/legals.rb
Instance Method Summary collapse
-
#legal_content(legal_content_type) ⇒ OpenStruct
A
GET
request is used to retrieve a specific part of the legal content information. -
#legal_contents(params = {}) ⇒ OpenStruct
A
GET
request is used to retrieve the legal content of a shop. -
#legal_details ⇒ OpenStruct
A
GET
request is used to retrieve the details of the legal resource. -
#update_legal_content(body) ⇒ OpenStruct
A
PUT
request is used to update the content of a specific part of the legal content information. -
#update_legal_details(body) ⇒ OpenStruct
A
PATCH
request is used to update a legal resource partially with json content type.
Instance Method Details
#legal_content(legal_content_type) ⇒ OpenStruct
A GET
request is used to retrieve a specific part of the legal content information.
$ curl 'https://api-shop.beyondshop.cloud/api/legal-content/right-of-withdrawal' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
21 22 23 24 25 26 |
# File 'lib/beyond_api/resources/shops/legals.rb', line 21 def legal_content(legal_content_type) response, status = BeyondApi::Request.get(@session, "/legal-content/#{legal_content_type}") handle_response(response, status) end |
#legal_contents(params = {}) ⇒ OpenStruct
A GET
request is used to retrieve the legal content of a shop.
$ curl 'https://api-shop.beyondshop.cloud/api/legal-content' -i -X GET \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
43 44 45 46 47 48 49 |
# File 'lib/beyond_api/resources/shops/legals.rb', line 43 def legal_contents(params = {}) response, status = BeyondApi::Request.get(@session, "/legal-content", params) handle_response(response, status) end |
#legal_details ⇒ OpenStruct
A GET
request is used to retrieve the details of the legal resource.
$ curl 'https://api-shop.beyondshop.cloud/api/shop/legal' -i -X GET \
-H 'Authorization: Bearer <Access token>'
64 65 66 67 68 69 |
# File 'lib/beyond_api/resources/shops/legals.rb', line 64 def legal_details response, status = BeyondApi::Request.get(@session, "/shop/legal") handle_response(response, status) end |
#update_legal_content(body) ⇒ OpenStruct
A PUT
request is used to update the content of a specific part of the legal content information. Changes on the properties type and mandatory will be ignored.
$ curl 'https://api-shop.beyondshop.cloud/api/legal-content/legal-notice' -i -X PUT \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access token>' \
-d '{
"content" : "new legal content"
}'
91 92 93 94 95 96 97 |
# File 'lib/beyond_api/resources/shops/legals.rb', line 91 def update_legal_content(body) response, status = BeyondApi::Request.put(@session, "/legal-content/legal-notice", body) handle_response(response, status) end |
#update_legal_details(body) ⇒ OpenStruct
A PATCH
request is used to update a legal resource partially with json content type.
$ curl 'https://api-shop.beyondshop.cloud/api/shop/legal' -i -X PATCH \
-H 'Content-Type: application/json' \
-H 'Accept: application/hal+json' \
-H 'Authorization: Bearer <Access token>' \
-d '{
"vatId" : "GB 111111111"
}'
123 124 125 126 127 128 129 |
# File 'lib/beyond_api/resources/shops/legals.rb', line 123 def update_legal_details(body) response, status = BeyondApi::Request.patch(@session, "/shop/legal", body) handle_response(response, status) end |