Class: Repull::GuestsApi
- Inherits:
-
Object
- Object
- Repull::GuestsApi
- Defined in:
- lib/repull/api/guests_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_guest(id, opts = {}) ⇒ GuestProfile
Get guest profile Returns the full guest profile — base list-row fields plus contacts, flags, notes, risk metadata, and reservation aggregates.
-
#get_guest_with_http_info(id, opts = {}) ⇒ Array<(GuestProfile, Integer, Hash)>
Get guest profile Returns the full guest profile — base list-row fields plus contacts, flags, notes, risk metadata, and reservation aggregates.
-
#initialize(api_client = ApiClient.default) ⇒ GuestsApi
constructor
A new instance of GuestsApi.
-
#list_guests(opts = {}) ⇒ GuestListResponse
List guests Cursor-paginated list of guests in the workspace.
-
#list_guests_with_http_info(opts = {}) ⇒ Array<(GuestListResponse, Integer, Hash)>
List guests Cursor-paginated list of guests in the workspace.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/repull/api/guests_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get_guest(id, opts = {}) ⇒ GuestProfile
Get guest profile Returns the full guest profile — base list-row fields plus contacts, flags, notes, risk metadata, and reservation aggregates. Aggregates main vanio’s ‘GuestService.getGuestProfile()` into the public Repull shape so SDK consumers don’t have to learn the internal schema.
28 29 30 31 |
# File 'lib/repull/api/guests_api.rb', line 28 def get_guest(id, opts = {}) data, _status_code, _headers = get_guest_with_http_info(id, opts) data end |
#get_guest_with_http_info(id, opts = {}) ⇒ Array<(GuestProfile, Integer, Hash)>
Get guest profile Returns the full guest profile — base list-row fields plus contacts, flags, notes, risk metadata, and reservation aggregates. Aggregates main vanio's `GuestService.getGuestProfile()` into the public Repull shape so SDK consumers don't have to learn the internal schema.
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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/repull/api/guests_api.rb', line 39 def get_guest_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GuestsApi.get_guest ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling GuestsApi.get_guest" end # resource path local_var_path = '/v1/guests/{id}'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GuestProfile' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"GuestsApi.get_guest", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GuestsApi#get_guest\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_guests(opts = {}) ⇒ GuestListResponse
List guests Cursor-paginated list of guests in the workspace. Walks ‘guests.id ASC` keyset for constant per-page cost regardless of how many guests the customer has. Use `pagination.nextCursor` from one response as the `cursor` query param of the next request. Filters: `q` (substring on name/email/phone), `has_reservation` (`true`|`false`), `listing_id` (restrict to guests with at least one reservation on that listing).
98 99 100 101 |
# File 'lib/repull/api/guests_api.rb', line 98 def list_guests(opts = {}) data, _status_code, _headers = list_guests_with_http_info(opts) data end |
#list_guests_with_http_info(opts = {}) ⇒ Array<(GuestListResponse, Integer, Hash)>
List guests Cursor-paginated list of guests in the workspace. Walks `guests.id ASC` keyset for constant per-page cost regardless of how many guests the customer has. Use `pagination.nextCursor` from one response as the `cursor` query param of the next request. Filters: `q` (substring on name/email/phone), `has_reservation` (`true`|`false`), `listing_id` (restrict to guests with at least one reservation on that listing).
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/repull/api/guests_api.rb', line 113 def list_guests_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GuestsApi.list_guests ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GuestsApi.list_guests, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling GuestsApi.list_guests, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/guests' # query parameters query_params = opts[:query_params] || {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil? query_params[:'has_reservation'] = opts[:'has_reservation'] if !opts[:'has_reservation'].nil? query_params[:'listingId'] = opts[:'listing_id'] if !opts[:'listing_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] header_params[:'X-Schema'] = opts[:'x_schema'] if !opts[:'x_schema'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GuestListResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"GuestsApi.list_guests", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: GuestsApi#list_guests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |