diff --git a/lib/beyond_api/services/shop/feature.rb b/lib/beyond_api/services/shop/feature.rb new file mode 100644 index 0000000..ba74be8 --- /dev/null +++ b/lib/beyond_api/services/shop/feature.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module BeyondApi + module Shop + # @example How to instantiate a client + # @client = BeyondApi::Shop::Feature.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Feature < BaseService + # List all features that are assigned to a specific shop identified by the current hostname. + # + # @see https://developer.epages.com/beyond-docs/#list_feature_assignments + # + # @return [Hash] + # + # @example + # @client.all + def all + get('shop/features') + end + + # Retrieve the details of a specific feature assignment of a merchant’s shop identified by the current hostname. + # + # @see https://developer.epages.com/beyond-docs/#show_feature_assignment_details + # + # @param feature_name [String] The feature name + # + # @return [Hash] + # + # @example + # @client.find('product-management.max-products') + def find(feature_name) + get("shop/features/#{feature_name}") + end + end + end +end diff --git a/lib/beyond_api/services/shop/language.rb b/lib/beyond_api/services/shop/language.rb new file mode 100644 index 0000000..dcb2f4c --- /dev/null +++ b/lib/beyond_api/services/shop/language.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module BeyondApi + module Shop + # @example How to instantiate a client + # @client = BeyondApi::Shop::Language.new(api_url: 'https://example.com/api', access_token: 'your_token') + class Language < BaseService + # Create a language for a specified shop. + # + # @see https://developer.epages.com/beyond-docs/#create_language + # + # @param locale [String] the locale + # + # @return [Hash] + # + # @example + # @client.create('de-DE') + def create(locale) + post('shop/languages', locale:) + end + + # Retrieve detailed information about a single language of the shop. The language is specified by its id. + # + # @see https://developer.epages.com/beyond-docs/#show_language_details + # + # @param id [String] The language UUID + # + # @return [Hash] + # + # @example + # @client.find('750958a7-7924-4028-8f44-260f8fb11cbb') + def find(id) + get("shop/languages/#{id}") + end + + # Retrieve the currently active languages of a specified shop in a paged way. + # + # @see https://developer.epages.com/beyond-docs/#list_languages + # + # @option params [Boolean] :paginated + # @option params [Integer] :size the page size + # @option params [Integer] :page the page number + # + # @return [Hash] + # + # @example + # @client.all(size: 100, page: 0) + def all(params = {}) + fetch_all_pages('shop/languages', params) + end + + # Retrieve all languages that can be created for a shop. Languages that are not on the list are not supported. + # + # @see https://developer.epages.com/beyond-docs/#list_supported_languages + # + # @return [Hash] + # + # @example + # @client.supported_languages + def supported_languages + get('shop/languages/supported') + end + + # Delete a language from a specified shop. + # + # @see https://developer.epages.com/beyond-docs/#delete_language + # + # @param id [String] the language UUID + # + # @return [Hash] an empty hash + # + # @example + # @client.delete('750958a7-7924-4028-8f44-260f8fb11cbb') + def delete(id) + super("shop/languages/#{id}") + end + end + end +end diff --git a/spec/beyond_api/services/shop/feature_spec.rb b/spec/beyond_api/services/shop/feature_spec.rb new file mode 100644 index 0000000..e712ee3 --- /dev/null +++ b/spec/beyond_api/services/shop/feature_spec.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Shop::Feature, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all shop features' do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :features)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + describe '.find' do + it 'returns a shop feature' do + response = client.find('product-management.max-products') + expect(response[:name]).to eq('product-management.max-products') + end + end +end diff --git a/spec/beyond_api/services/shop/language_spec.rb b/spec/beyond_api/services/shop/language_spec.rb new file mode 100644 index 0000000..6400a9e --- /dev/null +++ b/spec/beyond_api/services/shop/language_spec.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +RSpec.describe BeyondApi::Shop::Language, vcr: true do + let(:client) { described_class.new(api_url: ENV.fetch('API_URL', nil), access_token: beyond_access_token) } + + describe '.all' do + it 'returns all shop languages' do + response = client.all + + expect(response).not_to be nil + expect(response.dig(:embedded, :languages)).to be_kind_of(Array) + expect(response[:page]).to be_kind_of(Hash) + end + end + + context 'with language' do + before(:each) do + @response = client.create('it-IT') + end + + describe '.create' do + it 'creates a new shop language' do + expect(@response).not_to be nil + expect(@response[:locale]).to eq('it-IT') + end + end + + describe '.find' do + it 'returns a shop language' do + response = client.find(@response[:id]) + expect(response[:locale]).to eq('it-IT') + end + end + + describe '.delete' do + it 'deletes a shop language' do + response = client.delete(@response[:id]) + expect(response).to eq({}) + end + end + end +end diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Feature/_all/returns_all_shop_features.yml b/spec/vcr_cassettes/BeyondApi_Shop_Feature/_all/returns_all_shop_features.yml new file mode 100644 index 0000000..d1293fb --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Feature/_all/returns_all_shop_features.yml @@ -0,0 +1,139 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:35:49 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.116' + X-B3-Traceid: + - fa44cdc1b1ed04f1eb6fd71f2aa6daa9 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727966149, + "jti" : "/vD005oJgNnKqkX0vCFmyX7uN4E=" + } + recorded_at: Thu, 03 Oct 2024 14:35:49 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/features + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:35:49 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.006' + X-B3-Traceid: + - d057c4f7c94b8329953d59ab4233af6c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "features" : [ ] + }, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/features?page=0&size=20" + }, + "owner" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop" + } + }, + "page" : { + "size" : 20, + "totalElements" : 0, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Thu, 03 Oct 2024 14:35:49 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Feature/_find/returns_a_shop_feature.yml b/spec/vcr_cassettes/BeyondApi_Shop_Feature/_find/returns_a_shop_feature.yml new file mode 100644 index 0000000..eadaf84 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Feature/_find/returns_a_shop_feature.yml @@ -0,0 +1,141 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:35:49 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.114' + X-B3-Traceid: + - 9b9fd559577b4859295938bb62a99dfd + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727966149, + "jti" : "15+/3WWjnbld4XnafwjV6RHfvsU=" + } + recorded_at: Thu, 03 Oct 2024 14:35:49 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/features/product-management.max-products + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:35:49 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Content-Disposition: + - inline;filename=f.txt + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.011' + X-B3-Traceid: + - 31afcc7e8cd621053bcf55cd7e24db70 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "name" : "product-management.max-products", + "type" : "COUNTER", + "details" : { + "maxValue" : 100, + "currentValue" : 0 + }, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/features/product-management.max-products" + }, + "owner" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop" + }, + "feature-definition" : { + "href" : "https://api-shop.beyondshop.cloud/api/feature-definitions/product-management.max-products" + } + } + } + recorded_at: Thu, 03 Oct 2024 14:35:49 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Language/_all/returns_all_shop_languages.yml b/spec/vcr_cassettes/BeyondApi_Shop_Language/_all/returns_all_shop_languages.yml new file mode 100644 index 0000000..4de5307 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Language/_all/returns_all_shop_languages.yml @@ -0,0 +1,158 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 09:42:19 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.091' + X-B3-Traceid: + - 3c831c0f06f35a83daaadc6bf1d2572e + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727948539, + "jti" : "i9X4RgJLGRZpgy21AGIV7W4NzrM=" + } + recorded_at: Thu, 03 Oct 2024 09:42:19 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/languages + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 09:42:19 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.008' + X-B3-Traceid: + - a3c1855601b9a8f87e8164e97f8fb1c8 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_embedded" : { + "languages" : [ { + "_id" : "dd170cd2-8b2d-4a8e-bfdb-16023eeca398", + "locale" : "it-IT", + "deletableAt" : "2024-10-02T09:54:49.099Z", + "creatableAt" : null, + "deleted" : false, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages/dd170cd2-8b2d-4a8e-bfdb-16023eeca398" + } + } + }, { + "_id" : "413732f8-44f7-4f4a-9981-20614262c0f1", + "locale" : "nb-NO", + "deletableAt" : "2024-10-02T09:54:49.107Z", + "creatableAt" : null, + "deleted" : false, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages/413732f8-44f7-4f4a-9981-20614262c0f1" + } + } + } ] + }, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages?page=0&size=20&sort=createdAt,asc" + } + }, + "page" : { + "size" : 20, + "totalElements" : 2, + "totalPages" : 1, + "number" : 0 + } + } + recorded_at: Thu, 03 Oct 2024 09:42:19 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_create/creates_a_new_shop_language.yml b/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_create/creates_a_new_shop_language.yml new file mode 100644 index 0000000..fd07237 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_create/creates_a_new_shop_language.yml @@ -0,0 +1,132 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:10:06 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.125' + X-B3-Traceid: + - ae7e7a9a7cd4926bbb51af05eedad4ae + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727964606, + "jti" : "VZdbLKLZ3DKJywgUWMdaG1szCPU=" + } + recorded_at: Thu, 03 Oct 2024 14:10:06 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/languages + body: + encoding: UTF-8 + string: '{"locale":"it-IT"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:10:06 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.008' + X-B3-Traceid: + - 951c00505367046cb463def0cacfd2f0 + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "c56b1f74-5bca-4943-98e9-c4646b5e1db8", + "locale" : "it-IT", + "deletableAt" : "2024-10-02T09:54:53.177Z", + "creatableAt" : null, + "deleted" : false, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages/c56b1f74-5bca-4943-98e9-c4646b5e1db8" + } + } + } + recorded_at: Thu, 03 Oct 2024 14:10:06 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_delete/deletes_a_shop_language.yml b/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_delete/deletes_a_shop_language.yml new file mode 100644 index 0000000..f20c811 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_delete/deletes_a_shop_language.yml @@ -0,0 +1,186 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:24:09 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.103' + X-B3-Traceid: + - 9c5853c17768bd61ea33f1bf3e8d768c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727965449, + "jti" : "lzxLLtsyXFMbTxn86B/78ZMg7lo=" + } + recorded_at: Thu, 03 Oct 2024 14:24:09 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/languages + body: + encoding: UTF-8 + string: '{"locale":"it-IT"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:24:09 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.008' + X-B3-Traceid: + - d0674316fc606ae32d06a1ad84248efa + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "c56b1f74-5bca-4943-98e9-c4646b5e1db8", + "locale" : "it-IT", + "deletableAt" : "2024-10-02T09:54:53.177Z", + "creatableAt" : null, + "deleted" : false, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages/c56b1f74-5bca-4943-98e9-c4646b5e1db8" + } + } + } + recorded_at: Thu, 03 Oct 2024 14:24:09 GMT +- request: + method: delete + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/languages/c56b1f74-5bca-4943-98e9-c4646b5e1db8 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:24:10 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.008' + X-B3-Traceid: + - d0674316fc606ae32d06a1ad84248efa + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: '' + recorded_at: Thu, 03 Oct 2024 14:24:10 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_find/returns_a_shop_language.yml b/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_find/returns_a_shop_language.yml new file mode 100644 index 0000000..73d5ca8 --- /dev/null +++ b/spec/vcr_cassettes/BeyondApi_Shop_Language/with_language/_find/returns_a_shop_language.yml @@ -0,0 +1,198 @@ +--- +http_interactions: +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/oauth/token?grant_type=client_credentials + body: + encoding: UTF-8 + string: "{}" + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Basic + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:24:09 GMT + Content-Type: + - application/json;charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Cache-Control: + - no-store + Pragma: + - no-cache + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Strict-Transport-Security: + - max-age=31536000 ; includeSubDomains + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.103' + X-B3-Traceid: + - 9c5853c17768bd61ea33f1bf3e8d768c + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "access_token" : "", + "token_type" : "bearer", + "expires_in" : 3599, + "scope" : "orde:r prat:dcur pypr:cur prod:urdc lcnt:u pymt:ur loca:urcd sctg:m shat:cdru rfpr:ur prad:rcd shpz:dcur shad:u ordr:cur shop:u shim:cd cust:urcd clpr:cr legl:ur prda:ru rtpr:rc oset:ur shpr:rcu cset:ru ordp:r catg:cdur nltg:m", + "tenantId" : 8542, + "iat" : 1727965449, + "jti" : "lzxLLtsyXFMbTxn86B/78ZMg7lo=" + } + recorded_at: Thu, 03 Oct 2024 14:24:09 GMT +- request: + method: post + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/languages + body: + encoding: UTF-8 + string: '{"locale":"it-IT"}' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:24:09 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.008' + X-B3-Traceid: + - d0674316fc606ae32d06a1ad84248efa + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "c56b1f74-5bca-4943-98e9-c4646b5e1db8", + "locale" : "it-IT", + "deletableAt" : "2024-10-02T09:54:53.177Z", + "creatableAt" : null, + "deleted" : false, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages/c56b1f74-5bca-4943-98e9-c4646b5e1db8" + } + } + } + recorded_at: Thu, 03 Oct 2024 14:24:09 GMT +- request: + method: get + uri: https://team42-beyond-api.beyondshop.cloud/api/shop/languages/c56b1f74-5bca-4943-98e9-c4646b5e1db8 + body: + encoding: US-ASCII + string: '' + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - Faraday v2.10.1 + Authorization: + - Bearer + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + response: + status: + code: 200 + message: OK + headers: + Date: + - Thu, 03 Oct 2024 14:24:10 GMT + Content-Type: + - application/json + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Content-Type-Options: + - nosniff + X-Xss-Protection: + - 1; mode=block + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + X-Frame-Options: + - DENY + Server: + - epages-beyond + X-Request-Time: + - '0.008' + X-B3-Traceid: + - d0674316fc606ae32d06a1ad84248efa + X-Hello-Human: + - Come work with us! https://developer.epages.com/devjobs/ + body: + encoding: UTF-8 + string: |- + { + "_id" : "c56b1f74-5bca-4943-98e9-c4646b5e1db8", + "locale" : "it-IT", + "deletableAt" : "2024-10-02T09:54:53.177Z", + "creatableAt" : null, + "deleted" : false, + "_links" : { + "self" : { + "href" : "https://api-shop.beyondshop.cloud/api/shop/languages/c56b1f74-5bca-4943-98e9-c4646b5e1db8" + } + } + } + recorded_at: Thu, 03 Oct 2024 14:24:10 GMT +recorded_with: VCR 6.2.0