Class: Quandoo::CustomersApi
- Inherits:
-
Object
- Object
- Quandoo::CustomersApi
- Defined in:
- lib/quandoo/api/customers_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_customer1(customer_id, opts = {}) ⇒ CustomerResponse
Get customer Data This endpoint allows an agent to get customer information by id.
-
#get_customer1_with_http_info(customer_id, opts = {}) ⇒ Array<(CustomerResponse, Fixnum, Hash)>
Get customer Data This endpoint allows an agent to get customer information by id.
-
#get_customers_of_merchant1(merchant_id, opts = {}) ⇒ CustomerDataList
Get a list of Customers of a merchant This endpoint allows a third party to get a list of customers of a merchant.
-
#get_customers_of_merchant1_with_http_info(merchant_id, opts = {}) ⇒ Array<(CustomerDataList, Fixnum, Hash)>
Get a list of Customers of a merchant This endpoint allows a third party to get a list of customers of a merchant.
-
#get_reservations1(customer_id, opts = {}) ⇒ ReservationDataList
Get customer reservations This endpoint allows an agent to get reservations of a customer.
-
#get_reservations1_with_http_info(customer_id, opts = {}) ⇒ Array<(ReservationDataList, Fixnum, Hash)>
Get customer reservations This endpoint allows an agent to get reservations of a customer.
-
#initialize(api_client = ApiClient.default) ⇒ CustomersApi
constructor
A new instance of CustomersApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ CustomersApi
Returns a new instance of CustomersApi.
19 20 21 |
# File 'lib/quandoo/api/customers_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/quandoo/api/customers_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_customer1(customer_id, opts = {}) ⇒ CustomerResponse
Get customer Data This endpoint allows an agent to get customer information by id. Customer id both in the request and response are agent-specific. The agent needs to be authenticated. The endpoint will return ‘HTTP 404 - Not Found` if the customer with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated or the agent doesn’t have permissions. ####Request: * customerId: Agent-specific ID of the customer ####Response: The response contains the following data of the customer as explained below: * id: The agent-dependent identifier of the customer * email: The given email of this customer. Optional * firstName: First name of the customer. Optional * lastName: Last name of the customer. Optional * gender: The given gender of the customer (one of MALE, FEMALE, OTHER or UNDEFINED). Optional * phoneNumber: The ID of the merchant at which this reservation was made * mobileNumber: The ID of the customer to which this reservation belongs * country: 2-letter ISO country code of the customer, e.g. DE * links: Related links that can be followed based on this response * subscriptions: The newsletter subscriptions, e.g. QUANDOO, MERCHANT Example curl: “‘ curl https://host/vX/customers/9ffb3466-3562-42cc-add1-92a46a2f0902 “` Example response: “` { "id": "9ffb3466-3562-42cc-add1-92a46a2f0902", "firstName": "Gaius", "lastName": "Octavius", "gender": "male", "email": "[email protected]", "phoneNumber": "+4917312345678", "country": "DE", "links": [ { "href": "localhost:39250/v1/customers/9ffb3466-3562-42cc-add1-92a46a2f0902/reservations", "method": "GET", "rel": "get-customer-reservations" } ], "subscriptions": [ { "id": "QUANDOO" } ] } “`
27 28 29 30 |
# File 'lib/quandoo/api/customers_api.rb', line 27 def get_customer1(customer_id, opts = {}) data, _status_code, _headers = get_customer1_with_http_info(customer_id, opts) data end |
#get_customer1_with_http_info(customer_id, opts = {}) ⇒ Array<(CustomerResponse, Fixnum, Hash)>
Get customer Data This endpoint allows an agent to get customer information by id. Customer id both in the request and response are agent-specific. The agent needs to be authenticated. The endpoint will return `HTTP 404 - Not Found` if the customer with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated or the agent doesn't have permissions. ####Request: * customerId: Agent-specific ID of the customer ####Response: The response contains the following data of the customer as explained below: * id: The agent-dependent identifier of the customer * email: The given email of this customer. Optional * firstName: First name of the customer. Optional * lastName: Last name of the customer. Optional * gender: The given gender of the customer (one of MALE, FEMALE, OTHER or UNDEFINED). Optional * phoneNumber: The ID of the merchant at which this reservation was made * mobileNumber: The ID of the customer to which this reservation belongs * country: 2-letter ISO country code of the customer, e.g. DE * links: Related links that can be followed based on this response * subscriptions: The newsletter subscriptions, e.g. QUANDOO, MERCHANT Example curl: ``` curl https://host/vX/customers/9ffb3466-3562-42cc-add1-92a46a2f0902 ``` Example response: ``` { "id": "9ffb3466-3562-42cc-add1-92a46a2f0902", "firstName": "Gaius", "lastName": "Octavius", "gender": "male", "email": "[email protected]", "phoneNumber": "+4917312345678", "country": "DE", "links": [ { "href": "localhost:39250/v1/customers/9ffb3466-3562-42cc-add1-92a46a2f0902/reservations", "method": "GET", "rel": "get-customer-reservations" } ], "subscriptions": [ { "id": "QUANDOO" } ] } ```
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/quandoo/api/customers_api.rb', line 37 def get_customer1_with_http_info(customer_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomersApi.get_customer1 ...' end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.get_customer1" end # resource path local_var_path = '/v1/customers/{customerId}'.sub('{' + 'customerId' + '}', customer_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['API_TOKEN'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CustomerResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomersApi#get_customer1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_customers_of_merchant1(merchant_id, opts = {}) ⇒ CustomerDataList
Get a list of Customers of a merchant This endpoint allows a third party to get a list of customers of a merchant. The list is filtered, showing only the customers that the third party system has access. Customer id is agent-specific if the customer was created by the agent. The agent needs to be authenticated. The endpoint will return ‘HTTP 404 - Not Found` if the merchant with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated or the agent doesn’t have permissions. ####Request: * merchantId: Identifier of the merchant * offset: sets the starting element to be returned. Defaults to 0 when unset or malformed. * limit: maximum number of results to be returned. Value must be between 1 and 100. Defaults to 100 when unset, malformed or outside bounds. * modifiedSince: earliest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss * modifiedUntil: latest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss ####Response: The response contains the following data of the customer as explained below: * id: The agent-dependent identifier of the customer * title: The title of the customer. Optional * firstName: First name of the customer. Optional * lastName: Last name of the customer. Optional * email: The given email of this customer. Optional * gender: The given gender of the customer (one of MALE, FEMALE, OTHER or UNDEFINED). Optional * phoneNumber: The phone number of the customer. Optional * mobileNumber: The mobile phone number of the customer. Optional * locale: The locale of the customer. * links: Related links that can be followed based on this response * subscriptions: The newsletter subscriptions, e.g. QUANDOO, MERCHANT * statistics: The customer statistics: number of successful, cancelled and no-show reservations * createdAt: The date the customer was created. Format: yyyy-MM-ddTHH:mm:ssZ * updatedAt: The date the customer was last updated. Format: yyyy-MM-ddTHH:mm:ssZ Example curl: “‘ curl https://host/vX/merchants/1234/customers “` Example response: “` { "result": [ { "id": "9ffb3466-3562-42cc-add1-92a46a2f0902", "customerRef": "9ffb3466-3562-42cc-add1-92a46a2f0902", "marketingFlags": [ { "marketingSettingType": "NEWSLETTERS", "marketingSettingStatus": "INACTIVE" }, { "marketingSettingType": "PROMO_CODES", "marketingSettingStatus": "ACTIVE" } ], "title": "Mr.", "firstName": "John", "lastName": "Doe", "email": "[email protected]", "phoneNumber": "+493012345678", "mobileNumber": "+17712345678", "locale": "de_DE", "links": [ { "href": "localhost:39250/v1/customers/9ffb3466-3562-42cc-add1-92a46a2f0902/reservations", "method": "GET", "rel": "get-customer-reservations" } ], "subscriptions": [ { "id": "QUANDOO" } ], "statistics": { "reservationSuccessfulCount": 8, "reservationCancelledCount": 5, "reservationNoShowCount": 2 }, "createdAt": "2018-11-22T18:42:16Z", "updatedAt": "2018-11-30T18:16:02Z" } ], "offset": 0, "limit": 100 } “`
81 82 83 84 |
# File 'lib/quandoo/api/customers_api.rb', line 81 def get_customers_of_merchant1(merchant_id, opts = {}) data, _status_code, _headers = get_customers_of_merchant1_with_http_info(merchant_id, opts) data end |
#get_customers_of_merchant1_with_http_info(merchant_id, opts = {}) ⇒ Array<(CustomerDataList, Fixnum, Hash)>
Get a list of Customers of a merchant This endpoint allows a third party to get a list of customers of a merchant. The list is filtered, showing only the customers that the third party system has access. Customer id is agent-specific if the customer was created by the agent. The agent needs to be authenticated. The endpoint will return `HTTP 404 - Not Found` if the merchant with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated or the agent doesn't have permissions. ####Request: * merchantId: Identifier of the merchant * offset: sets the starting element to be returned. Defaults to 0 when unset or malformed. * limit: maximum number of results to be returned. Value must be between 1 and 100. Defaults to 100 when unset, malformed or outside bounds. * modifiedSince: earliest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss * modifiedUntil: latest date time of time window in UTC. Format: yyyy-MM-dd HH:mm:ss ####Response: The response contains the following data of the customer as explained below: * id: The agent-dependent identifier of the customer * title: The title of the customer. Optional * firstName: First name of the customer. Optional * lastName: Last name of the customer. Optional * email: The given email of this customer. Optional * gender: The given gender of the customer (one of MALE, FEMALE, OTHER or UNDEFINED). Optional * phoneNumber: The phone number of the customer. Optional * mobileNumber: The mobile phone number of the customer. Optional * locale: The locale of the customer. * links: Related links that can be followed based on this response * subscriptions: The newsletter subscriptions, e.g. QUANDOO, MERCHANT * statistics: The customer statistics: number of successful, cancelled and no-show reservations * createdAt: The date the customer was created. Format: yyyy-MM-ddTHH:mm:ssZ * updatedAt: The date the customer was last updated. Format: yyyy-MM-ddTHH:mm:ssZ Example curl: ``` curl https://host/vX/merchants/1234/customers ``` Example response: ``` { "result": [ { "id": "9ffb3466-3562-42cc-add1-92a46a2f0902", "customerRef": "9ffb3466-3562-42cc-add1-92a46a2f0902", "marketingFlags": [ { "marketingSettingType": "NEWSLETTERS", "marketingSettingStatus": "INACTIVE" }, { "marketingSettingType": "PROMO_CODES", "marketingSettingStatus": "ACTIVE" } ], "title": "Mr.", "firstName": "John", "lastName": "Doe", "email": "[email protected]", "phoneNumber": "+493012345678", "mobileNumber": "+17712345678", "locale": "de_DE", "links": [ { "href": "localhost:39250/v1/customers/9ffb3466-3562-42cc-add1-92a46a2f0902/reservations", "method": "GET", "rel": "get-customer-reservations" } ], "subscriptions": [ { "id": "QUANDOO" } ], "statistics": { "reservationSuccessfulCount": 8, "reservationCancelledCount": 5, "reservationNoShowCount": 2 }, "createdAt": "2018-11-22T18:42:16Z", "updatedAt": "2018-11-30T18:16:02Z" } ], "offset": 0, "limit": 100 } ```
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/quandoo/api/customers_api.rb', line 95 def get_customers_of_merchant1_with_http_info(merchant_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomersApi.get_customers_of_merchant1 ...' end # verify the required parameter 'merchant_id' is set if @api_client.config.client_side_validation && merchant_id.nil? fail ArgumentError, "Missing the required parameter 'merchant_id' when calling CustomersApi.get_customers_of_merchant1" end # resource path local_var_path = '/v1/merchants/{merchantId}/customers'.sub('{' + 'merchantId' + '}', merchant_id.to_s) # query parameters query_params = {} query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'modifiedSince'] = opts[:'modified_since'] if !opts[:'modified_since'].nil? query_params[:'modifiedUntil'] = opts[:'modified_until'] if !opts[:'modified_until'].nil? # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['API_TOKEN'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CustomerDataList') if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomersApi#get_customers_of_merchant1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_reservations1(customer_id, opts = {}) ⇒ ReservationDataList
Get customer reservations This endpoint allows an agent to get reservations of a customer. The results will be filtered by agent id. Customer id in the request and reservation IDs in response are agent-specific. The agent needs to be authenticated. The endpoint will return ‘HTTP 404 - Not Found` if the customer with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated or the agent doesn’t have permissions. ####Request: * customerId: Agent-specific ID of the customer ####Response: The response will be a list of reservations. Each reservation has the fields explained below: * id: The agent-dependent unique id of the reservation * number: Quandoo internal identifier of the reservation. * quandooId: The public id of this reservation on quandoo system. * status: The status of the reservation eg. CREATED, CONFIRMED, CUSTOMER CANCELED etc. * startTime: The start time of the reservation. Format: ‘yyyy-MM-ddTHH:mm:ssZ` * endTime: The end time of the reservation. Format: `yyyy-MM-ddTHH:mm:ssZ` * capacity: The capacity (people count) of the reservation * merchantId: The ID of the merchant at which this reservation was made. * customerId: The public ID of the customer to which this reservation belongs * promoCode: The promotion code associated with this reservation. Optional. * extraInfo: extra information that the customer provided for the reservation. Optional. * links: Related links that can be followed based on this response. * createdAt: The date the reservation was created. Format: `yyyy-MM-ddTHH:mm:ssZ` * updatedAt: The date the reservation was last updated. Format: `yyyy-MM-ddTHH:mm:ssZ` Example curl: “` curl https://host/vX/customers/ce0706ff-a95d-4229-a220-d21dcd175342/reservations “` Example response: “` { "reservations": [ { "id": "07f53b36-3f48-11e5-a151-feff819cdc9f", "number": 8734957, "quandooId": "07f53b36-3f48-11e5-a151-feff819cdc9f", "status": "CREATED", "startTime": "2015-06-22T12:00:00+00:00", "endTime": "2015-06-22T13:00:00+00:00", "capacity": 4, "merchantId": 1384, "customerId": "ce0706ff-a95d-4229-a220-d21dcd175342", "promocode": "SOME_CAMPAIGN_CODE", "extraInfo": "request for baby chair", "links": [ { "href": "https://host/vX/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f", "method": "GET", "rel": "self" }, { "href": "https://host/vX/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f", "method": "PATCH", "rel": "update" } ], "createdAt": "2015-06-01T15:21:54Z", "updatedAt": "2015-06-01T18:45:30Z" }, { "id": "d8f53b36-3f48-11e5-a151-feff819cdc7a", "number": 8734958, "quandooId": "d8f53b36-3f48-11e5-a151-feff819cdc7a", "status": "CONFIRMED", "startTime": "2015-06-22T12:00:00+00:00", "endTime": "2015-06-22T13:00:00+00:00", "capacity": 3, "merchantId": 1384, "customerId": "ce0706ff-a95d-4229-a220-d21dcd175342", "promocode": "SOME_CAMPAIGN_CODE", "links": [ { "href": "https://host/vX/reservations/d8f53b36-3f48-11e5-a151-feff819cdc7a", "method": "GET", "rel": "self" }, { "href": "https://host/vX/reservations/d8f53b36-3f48-11e5-a151-feff819cdc7a", "method": "PATCH", "rel": "update" } ], "createdAt": "2015-06-01T15:21:54Z", "updatedAt": "2015-06-01T18:45:30Z" } ] } “`
139 140 141 142 |
# File 'lib/quandoo/api/customers_api.rb', line 139 def get_reservations1(customer_id, opts = {}) data, _status_code, _headers = get_reservations1_with_http_info(customer_id, opts) data end |
#get_reservations1_with_http_info(customer_id, opts = {}) ⇒ Array<(ReservationDataList, Fixnum, Hash)>
Get customer reservations This endpoint allows an agent to get reservations of a customer. The results will be filtered by agent id. Customer id in the request and reservation IDs in response are agent-specific. The agent needs to be authenticated. The endpoint will return `HTTP 404 - Not Found` if the customer with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated or the agent doesn't have permissions. ####Request: * customerId: Agent-specific ID of the customer ####Response: The response will be a list of reservations. Each reservation has the fields explained below: * id: The agent-dependent unique id of the reservation * number: Quandoo internal identifier of the reservation. * quandooId: The public id of this reservation on quandoo system. * status: The status of the reservation eg. CREATED, CONFIRMED, CUSTOMER CANCELED etc. * startTime: The start time of the reservation. Format: `yyyy-MM-ddTHH:mm:ssZ` * endTime: The end time of the reservation. Format: `yyyy-MM-ddTHH:mm:ssZ` * capacity: The capacity (people count) of the reservation * merchantId: The ID of the merchant at which this reservation was made. * customerId: The public ID of the customer to which this reservation belongs * promoCode: The promotion code associated with this reservation. Optional. * extraInfo: extra information that the customer provided for the reservation. Optional. * links: Related links that can be followed based on this response. * createdAt: The date the reservation was created. Format: `yyyy-MM-ddTHH:mm:ssZ` * updatedAt: The date the reservation was last updated. Format: `yyyy-MM-ddTHH:mm:ssZ` Example curl: ``` curl https://host/vX/customers/ce0706ff-a95d-4229-a220-d21dcd175342/reservations ``` Example response: ``` { "reservations": [ { "id": "07f53b36-3f48-11e5-a151-feff819cdc9f", "number": 8734957, "quandooId": "07f53b36-3f48-11e5-a151-feff819cdc9f", "status": "CREATED", "startTime": "2015-06-22T12:00:00+00:00", "endTime": "2015-06-22T13:00:00+00:00", "capacity": 4, "merchantId": 1384, "customerId": "ce0706ff-a95d-4229-a220-d21dcd175342", "promocode": "SOME_CAMPAIGN_CODE", "extraInfo": "request for baby chair", "links": [ { "href": "https://host/vX/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f", "method": "GET", "rel": "self" }, { "href": "https://host/vX/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f", "method": "PATCH", "rel": "update" } ], "createdAt": "2015-06-01T15:21:54Z", "updatedAt": "2015-06-01T18:45:30Z" }, { "id": "d8f53b36-3f48-11e5-a151-feff819cdc7a", "number": 8734958, "quandooId": "d8f53b36-3f48-11e5-a151-feff819cdc7a", "status": "CONFIRMED", "startTime": "2015-06-22T12:00:00+00:00", "endTime": "2015-06-22T13:00:00+00:00", "capacity": 3, "merchantId": 1384, "customerId": "ce0706ff-a95d-4229-a220-d21dcd175342", "promocode": "SOME_CAMPAIGN_CODE", "links": [ { "href": "https://host/vX/reservations/d8f53b36-3f48-11e5-a151-feff819cdc7a", "method": "GET", "rel": "self" }, { "href": "https://host/vX/reservations/d8f53b36-3f48-11e5-a151-feff819cdc7a", "method": "PATCH", "rel": "update" } ], "createdAt": "2015-06-01T15:21:54Z", "updatedAt": "2015-06-01T18:45:30Z" } ] } ```
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/quandoo/api/customers_api.rb', line 149 def get_reservations1_with_http_info(customer_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomersApi.get_reservations1 ...' end # verify the required parameter 'customer_id' is set if @api_client.config.client_side_validation && customer_id.nil? fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.get_reservations1" end # resource path local_var_path = '/v1/customers/{customerId}/reservations'.sub('{' + 'customerId' + '}', customer_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['API_TOKEN'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ReservationDataList') if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomersApi#get_reservations1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |