Class: NewStoreApi::ProfilesController
- Inherits:
-
BaseController
- Object
- BaseController
- NewStoreApi::ProfilesController
- Defined in:
- lib/new_store_api/controllers/profiles_controller.rb
Overview
ProfilesController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#list_profiles(next_page_token: nil, page_size: 100) ⇒ Profiles
List all clienteling profiles.
-
#show_profile(customer_id) ⇒ Profile
Get a single clienteling profile.
Methods inherited from BaseController
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent
Constructor Details
This class inherits a constructor from NewStoreApi::BaseController
Instance Method Details
#list_profiles(next_page_token: nil, page_size: 100) ⇒ Profiles
List all clienteling profiles. encodes the information required to retrieve the next page of profiles. returned in a page.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/new_store_api/controllers/profiles_controller.rb', line 15 def list_profiles(next_page_token: nil, page_size: 100) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/clienteling/profiles', Server::API) .query_param(new_parameter(next_page_token, key: 'next_page_token')) .query_param(new_parameter(page_size, key: 'page_size')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(Profiles.method(:from_hash))) .execute end |
#show_profile(customer_id) ⇒ Profile
Get a single clienteling profile. customer.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/new_store_api/controllers/profiles_controller.rb', line 35 def show_profile(customer_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/clienteling/profiles/{customer_id}', Server::API) .template_param(new_parameter(customer_id, key: 'customer_id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('oauth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(Profile.method(:from_hash))) .execute end |