repull 0.2.8 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/repull/api/airbnb_api.rb +1443 -182
- data/lib/repull/api/availability_api.rb +24 -92
- data/lib/repull/api/billing_api.rb +186 -15
- data/lib/repull/api/booking_com_api.rb +532 -41
- data/lib/repull/api/listings_api.rb +74 -0
- data/lib/repull/api/plumguide_api.rb +245 -0
- data/lib/repull/api/reservations_api.rb +0 -197
- data/lib/repull/api/sandbox_api.rb +136 -0
- data/lib/repull/api/vrbo_api.rb +0 -126
- data/lib/repull/models/acknowledge_booking_reservations_request.rb +176 -0
- data/lib/repull/models/{create_studio_project201_response_data.rb → airbnb_alteration.rb} +44 -52
- data/lib/repull/models/airbnb_amenity.rb +171 -0
- data/lib/repull/models/{get_studio_deployment200_response.rb → airbnb_availability_write_request.rb} +52 -10
- data/lib/repull/models/airbnb_calendar_operation.rb +250 -0
- data/lib/repull/models/airbnb_listing_action_request.rb +198 -0
- data/lib/repull/models/{update_availability_request.rb → airbnb_pricing_write_request.rb} +100 -11
- data/lib/repull/models/booking_availability_update.rb +276 -0
- data/lib/repull/models/booking_availability_update_request.rb +230 -0
- data/lib/repull/models/{generate_studio_completion_request_project_id.rb → booking_availability_update_request_property_id.rb} +2 -2
- data/lib/repull/models/booking_availability_update_request_updates_inner.rb +104 -0
- data/lib/repull/models/booking_pricing_rate_update.rb +1 -0
- data/lib/repull/models/booking_pricing_rate_update_restrictions.rb +65 -6
- data/lib/repull/models/booking_setup_request.rb +220 -0
- data/lib/repull/models/create_airbnb_alteration_request.rb +195 -0
- data/lib/repull/models/{create_studio_deployment201_response_data.rb → create_airbnb_offer_request.rb} +42 -30
- data/lib/repull/models/{create_studio_project_request.rb → create_booking_webhook_request.rb} +36 -47
- data/lib/repull/models/{generate_studio_completion200_response.rb → delete_airbnb_listing_photo200_response.rb} +10 -10
- data/lib/repull/models/{delete_studio_project200_response.rb → get_airbnb_alteration200_response.rb} +50 -7
- data/lib/repull/models/{delete_studio_project_file200_response.rb → get_airbnb_listing_quality200_response.rb} +37 -7
- data/lib/repull/models/{create_studio_project_generation201_response.rb → get_airbnb_listing_settings200_response.rb} +37 -7
- data/lib/repull/models/{delete_studio_deployment200_response.rb → get_airbnb_thread200_response.rb} +50 -7
- data/lib/repull/models/{list_studio_deployments200_response.rb → get_usage_logs200_response.rb} +17 -8
- data/lib/repull/models/get_usage_logs200_response_data_inner.rb +264 -0
- data/lib/repull/models/{create_studio_deployment201_response.rb → get_usage_logs200_response_pagination.rb} +29 -10
- data/lib/repull/models/get_usage_summary200_response.rb +232 -0
- data/lib/repull/models/get_usage_summary200_response_breakdown_inner.rb +183 -0
- data/lib/repull/models/{delete_studio_deployment200_response_data.rb → get_usage_summary200_response_limits.rb} +18 -16
- data/lib/repull/models/{delete_studio_project200_response_data.rb → get_usage_summary200_response_remaining.rb} +18 -16
- data/lib/repull/models/{create_studio_project_generation201_response_data.rb → get_usage_summary200_response_status_distribution.rb} +31 -22
- data/lib/repull/models/{upsert_studio_project_file_request.rb → get_usage_summary200_response_timeline_inner.rb} +28 -28
- data/lib/repull/models/{create_studio_project_generation_request.rb → get_usage_summary200_response_totals.rb} +28 -28
- data/lib/repull/models/{create_studio_project201_response.rb → get_usage_summary200_response_used.rb} +19 -10
- data/lib/repull/models/get_usage_tier200_response.rb +183 -0
- data/lib/repull/models/{list_studio_projects200_response.rb → get_usage_tier200_response_limits.rb} +31 -12
- data/lib/repull/models/{update_reservation_request.rb → get_usage_tier200_response_remaining.rb} +25 -31
- data/lib/repull/models/{get_studio_project200_response.rb → get_usage_tier200_response_used.rb} +28 -10
- data/lib/repull/models/list_airbnb_alterations200_response.rb +192 -0
- data/lib/repull/models/list_airbnb_listing_amenities200_response.rb +190 -0
- data/lib/repull/models/{create_studio_deployment_request.rb → list_airbnb_listing_amenities200_response_data.rb} +23 -28
- data/lib/repull/models/{list_studio_project_files200_response.rb → list_airbnb_transactions200_response.rb} +50 -7
- data/lib/repull/models/listing_content_update_request.rb +243 -0
- data/lib/repull/models/{upsert_studio_project_file200_response.rb → listing_content_update_request_address.rb} +53 -10
- data/lib/repull/models/listing_content_update_request_amenities.rb +105 -0
- data/lib/repull/models/listing_content_update_request_amenities_one_of_inner.rb +196 -0
- data/lib/repull/models/listing_content_update_request_occupancy.rb +179 -0
- data/lib/repull/{api/ai_api.rb → models/listing_content_update_request_photos_inner.rb} +77 -59
- data/lib/repull/models/{generate_studio_completion200_response_data.rb → listing_content_update_request_photos_inner_one_of.rb} +81 -66
- data/lib/repull/models/listing_content_update_request_policies.rb +253 -0
- data/lib/repull/models/{create_ai_operation200_response.rb → listing_content_update_response.rb} +32 -16
- data/lib/repull/models/map_airbnb_listing_request.rb +215 -0
- data/lib/repull/models/{create_reservation_request.rb → map_airbnb_listing_response.rb} +137 -116
- data/lib/repull/models/property.rb +42 -69
- data/lib/repull/models/property_availability.rb +222 -0
- data/lib/repull/models/property_availability_day.rb +247 -0
- data/lib/repull/models/reservation.rb +28 -1
- data/lib/repull/models/sandbox_fixture_ref.rb +193 -0
- data/lib/repull/models/{delete_studio_project_file200_response_data.rb → sandbox_reset_result.rb} +72 -11
- data/lib/repull/models/sandbox_reset_result_deleted.rb +216 -0
- data/lib/repull/models/sandbox_seed_result.rb +278 -0
- data/lib/repull/models/{update_studio_project_request.rb → update_airbnb_message_request.rb} +43 -24
- data/lib/repull/models/update_booking_charges_request.rb +194 -0
- data/lib/repull/version.rb +1 -1
- data/lib/repull.rb +59 -34
- data/openapi/v1.json +3956 -2522
- metadata +61 -36
- data/lib/repull/api/studio_api.rb +0 -1094
- data/lib/repull/models/generate_studio_completion_request.rb +0 -305
- data/lib/repull/models/upsert_studio_project_file200_response_data.rb +0 -147
|
@@ -19,26 +19,26 @@ module Repull
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
|
-
# Get availability
|
|
23
|
-
#
|
|
24
|
-
# @param property_id [Integer]
|
|
25
|
-
# @param
|
|
26
|
-
# @param
|
|
22
|
+
# Get property availability
|
|
23
|
+
# Channel-agnostic day-by-day availability calendar for a property over a date window. Returns a thin per-date shape — `{ date, available, price, minNights }` — projected from the connected channel calendar (currently Airbnb). The `from` and `to` query params are **required** (ISO `YYYY-MM-DD`, inclusive) — omitting or malforming either returns 422. The window is capped at 366 days; longer ranges are truncated to the first 366 days. Every date in the window is present in `days`: dates with no explicit calendar row fall back to `available: true` at the property's default nightly price. A property with no channel calendar still returns a real 200 (a fully-default calendar), never a 404 — 404 means the property id does not exist or belongs to a different workspace. This endpoint is read-only. Availability **writes** stay per-channel: `PUT /v1/channels/airbnb/listings/{id}/availability` (Airbnb) or `PUT /v1/channels/booking/availability` (Booking.com).
|
|
24
|
+
# @param property_id [Integer] Repull property id (equal to `listings.id`; the same integer used as `propertyId` on availability and `listingId` on reservations).
|
|
25
|
+
# @param from [Date] Start of the window (inclusive), ISO `YYYY-MM-DD`. Required — missing/malformed returns 422. `startDate` is accepted as an alias.
|
|
26
|
+
# @param to [Date] End of the window (inclusive), ISO `YYYY-MM-DD`. Required — missing/malformed returns 422. `endDate` is accepted as an alias.
|
|
27
27
|
# @param [Hash] opts the optional parameters
|
|
28
|
-
# @return [
|
|
29
|
-
def get_availability(property_id,
|
|
30
|
-
data, _status_code, _headers = get_availability_with_http_info(property_id,
|
|
28
|
+
# @return [PropertyAvailability]
|
|
29
|
+
def get_availability(property_id, from, to, opts = {})
|
|
30
|
+
data, _status_code, _headers = get_availability_with_http_info(property_id, from, to, opts)
|
|
31
31
|
data
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
# Get availability
|
|
35
|
-
#
|
|
36
|
-
# @param property_id [Integer]
|
|
37
|
-
# @param
|
|
38
|
-
# @param
|
|
34
|
+
# Get property availability
|
|
35
|
+
# Channel-agnostic day-by-day availability calendar for a property over a date window. Returns a thin per-date shape — `{ date, available, price, minNights }` — projected from the connected channel calendar (currently Airbnb). The `from` and `to` query params are **required** (ISO `YYYY-MM-DD`, inclusive) — omitting or malforming either returns 422. The window is capped at 366 days; longer ranges are truncated to the first 366 days. Every date in the window is present in `days`: dates with no explicit calendar row fall back to `available: true` at the property's default nightly price. A property with no channel calendar still returns a real 200 (a fully-default calendar), never a 404 — 404 means the property id does not exist or belongs to a different workspace. This endpoint is read-only. Availability **writes** stay per-channel: `PUT /v1/channels/airbnb/listings/{id}/availability` (Airbnb) or `PUT /v1/channels/booking/availability` (Booking.com).
|
|
36
|
+
# @param property_id [Integer] Repull property id (equal to `listings.id`; the same integer used as `propertyId` on availability and `listingId` on reservations).
|
|
37
|
+
# @param from [Date] Start of the window (inclusive), ISO `YYYY-MM-DD`. Required — missing/malformed returns 422. `startDate` is accepted as an alias.
|
|
38
|
+
# @param to [Date] End of the window (inclusive), ISO `YYYY-MM-DD`. Required — missing/malformed returns 422. `endDate` is accepted as an alias.
|
|
39
39
|
# @param [Hash] opts the optional parameters
|
|
40
|
-
# @return [Array<(
|
|
41
|
-
def get_availability_with_http_info(property_id,
|
|
40
|
+
# @return [Array<(PropertyAvailability, Integer, Hash)>] PropertyAvailability data, response status code and response headers
|
|
41
|
+
def get_availability_with_http_info(property_id, from, to, opts = {})
|
|
42
42
|
if @api_client.config.debugging
|
|
43
43
|
@api_client.config.logger.debug 'Calling API: AvailabilityApi.get_availability ...'
|
|
44
44
|
end
|
|
@@ -46,21 +46,21 @@ module Repull
|
|
|
46
46
|
if @api_client.config.client_side_validation && property_id.nil?
|
|
47
47
|
fail ArgumentError, "Missing the required parameter 'property_id' when calling AvailabilityApi.get_availability"
|
|
48
48
|
end
|
|
49
|
-
# verify the required parameter '
|
|
50
|
-
if @api_client.config.client_side_validation &&
|
|
51
|
-
fail ArgumentError, "Missing the required parameter '
|
|
49
|
+
# verify the required parameter 'from' is set
|
|
50
|
+
if @api_client.config.client_side_validation && from.nil?
|
|
51
|
+
fail ArgumentError, "Missing the required parameter 'from' when calling AvailabilityApi.get_availability"
|
|
52
52
|
end
|
|
53
|
-
# verify the required parameter '
|
|
54
|
-
if @api_client.config.client_side_validation &&
|
|
55
|
-
fail ArgumentError, "Missing the required parameter '
|
|
53
|
+
# verify the required parameter 'to' is set
|
|
54
|
+
if @api_client.config.client_side_validation && to.nil?
|
|
55
|
+
fail ArgumentError, "Missing the required parameter 'to' when calling AvailabilityApi.get_availability"
|
|
56
56
|
end
|
|
57
57
|
# resource path
|
|
58
58
|
local_var_path = '/v1/availability/{propertyId}'.sub('{propertyId}', CGI.escape(property_id.to_s))
|
|
59
59
|
|
|
60
60
|
# query parameters
|
|
61
61
|
query_params = opts[:query_params] || {}
|
|
62
|
-
query_params[:'
|
|
63
|
-
query_params[:'
|
|
62
|
+
query_params[:'from'] = from
|
|
63
|
+
query_params[:'to'] = to
|
|
64
64
|
|
|
65
65
|
# header parameters
|
|
66
66
|
header_params = opts[:header_params] || {}
|
|
@@ -74,7 +74,7 @@ module Repull
|
|
|
74
74
|
post_body = opts[:debug_body]
|
|
75
75
|
|
|
76
76
|
# return_type
|
|
77
|
-
return_type = opts[:debug_return_type] || '
|
|
77
|
+
return_type = opts[:debug_return_type] || 'PropertyAvailability'
|
|
78
78
|
|
|
79
79
|
# auth_names
|
|
80
80
|
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
@@ -95,73 +95,5 @@ module Repull
|
|
|
95
95
|
end
|
|
96
96
|
return data, status_code, headers
|
|
97
97
|
end
|
|
98
|
-
|
|
99
|
-
# Update availability
|
|
100
|
-
# Update pricing, availability, and minimum stay for specific dates.
|
|
101
|
-
# @param property_id [Integer]
|
|
102
|
-
# @param [Hash] opts the optional parameters
|
|
103
|
-
# @option opts [UpdateAvailabilityRequest] :update_availability_request
|
|
104
|
-
# @return [nil]
|
|
105
|
-
def update_availability(property_id, opts = {})
|
|
106
|
-
update_availability_with_http_info(property_id, opts)
|
|
107
|
-
nil
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
# Update availability
|
|
111
|
-
# Update pricing, availability, and minimum stay for specific dates.
|
|
112
|
-
# @param property_id [Integer]
|
|
113
|
-
# @param [Hash] opts the optional parameters
|
|
114
|
-
# @option opts [UpdateAvailabilityRequest] :update_availability_request
|
|
115
|
-
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
116
|
-
def update_availability_with_http_info(property_id, opts = {})
|
|
117
|
-
if @api_client.config.debugging
|
|
118
|
-
@api_client.config.logger.debug 'Calling API: AvailabilityApi.update_availability ...'
|
|
119
|
-
end
|
|
120
|
-
# verify the required parameter 'property_id' is set
|
|
121
|
-
if @api_client.config.client_side_validation && property_id.nil?
|
|
122
|
-
fail ArgumentError, "Missing the required parameter 'property_id' when calling AvailabilityApi.update_availability"
|
|
123
|
-
end
|
|
124
|
-
# resource path
|
|
125
|
-
local_var_path = '/v1/availability/{propertyId}'.sub('{propertyId}', CGI.escape(property_id.to_s))
|
|
126
|
-
|
|
127
|
-
# query parameters
|
|
128
|
-
query_params = opts[:query_params] || {}
|
|
129
|
-
|
|
130
|
-
# header parameters
|
|
131
|
-
header_params = opts[:header_params] || {}
|
|
132
|
-
# HTTP header 'Content-Type'
|
|
133
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
134
|
-
if !content_type.nil?
|
|
135
|
-
header_params['Content-Type'] = content_type
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
# form parameters
|
|
139
|
-
form_params = opts[:form_params] || {}
|
|
140
|
-
|
|
141
|
-
# http body (model)
|
|
142
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_availability_request'])
|
|
143
|
-
|
|
144
|
-
# return_type
|
|
145
|
-
return_type = opts[:debug_return_type]
|
|
146
|
-
|
|
147
|
-
# auth_names
|
|
148
|
-
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
149
|
-
|
|
150
|
-
new_options = opts.merge(
|
|
151
|
-
:operation => :"AvailabilityApi.update_availability",
|
|
152
|
-
:header_params => header_params,
|
|
153
|
-
:query_params => query_params,
|
|
154
|
-
:form_params => form_params,
|
|
155
|
-
:body => post_body,
|
|
156
|
-
:auth_names => auth_names,
|
|
157
|
-
:return_type => return_type
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
161
|
-
if @api_client.config.debugging
|
|
162
|
-
@api_client.config.logger.debug "API called: AvailabilityApi#update_availability\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
163
|
-
end
|
|
164
|
-
return data, status_code, headers
|
|
165
|
-
end
|
|
166
98
|
end
|
|
167
99
|
end
|
|
@@ -81,31 +81,81 @@ module Repull
|
|
|
81
81
|
return data, status_code, headers
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
-
#
|
|
85
|
-
#
|
|
84
|
+
# List API request logs
|
|
85
|
+
# Cursor-paginated raw API request log for the authenticated workspace, newest first. Filter by time `range`, `operation` id(s), status class, or free-text `q`. Walk pages with `cursor` from `pagination.next_cursor` until `pagination.has_more` is `false`; `offset` is accepted as a shallow alias (deep walks must use `cursor`).
|
|
86
86
|
# @param [Hash] opts the optional parameters
|
|
87
|
-
# @
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
# @option opts [String] :range Time window ending now. (default to '24h')
|
|
88
|
+
# @option opts [String] :operation Comma-separated `operation_id` filter.
|
|
89
|
+
# @option opts [String] :status Status-class filter.
|
|
90
|
+
# @option opts [String] :q Free-text match on path / operation / request id.
|
|
91
|
+
# @option opts [Integer] :limit Page size (max 200). (default to 50)
|
|
92
|
+
# @option opts [String] :cursor Opaque cursor from the previous response's `pagination.next_cursor`.
|
|
93
|
+
# @option opts [Integer] :offset First-class alias for cursor-based pagination. Mutually exclusive with `cursor` — passing both returns 422. Accepts integers in `[0, 10000]`; deeper walks must use `cursor` (constant per-page cost). The response always includes `pagination.next_cursor` so consumers can switch from offset → cursor mid-walk for deep pagination without re-keying. (default to 0)
|
|
94
|
+
# @option opts [Boolean] :include_total When `true` (default), the response's `pagination.total` carries the count of rows matching the current filter, across all pages. Pass `false` to skip the count for very large workspaces where the per-page COUNT(*) cost matters. (default to true)
|
|
95
|
+
# @return [GetUsageLogs200Response]
|
|
96
|
+
def get_usage_logs(opts = {})
|
|
97
|
+
data, _status_code, _headers = get_usage_logs_with_http_info(opts)
|
|
98
|
+
data
|
|
91
99
|
end
|
|
92
100
|
|
|
93
|
-
#
|
|
94
|
-
#
|
|
101
|
+
# List API request logs
|
|
102
|
+
# Cursor-paginated raw API request log for the authenticated workspace, newest first. Filter by time `range`, `operation` id(s), status class, or free-text `q`. Walk pages with `cursor` from `pagination.next_cursor` until `pagination.has_more` is `false`; `offset` is accepted as a shallow alias (deep walks must use `cursor`).
|
|
95
103
|
# @param [Hash] opts the optional parameters
|
|
96
|
-
# @
|
|
97
|
-
|
|
104
|
+
# @option opts [String] :range Time window ending now. (default to '24h')
|
|
105
|
+
# @option opts [String] :operation Comma-separated `operation_id` filter.
|
|
106
|
+
# @option opts [String] :status Status-class filter.
|
|
107
|
+
# @option opts [String] :q Free-text match on path / operation / request id.
|
|
108
|
+
# @option opts [Integer] :limit Page size (max 200). (default to 50)
|
|
109
|
+
# @option opts [String] :cursor Opaque cursor from the previous response's `pagination.next_cursor`.
|
|
110
|
+
# @option opts [Integer] :offset First-class alias for cursor-based pagination. Mutually exclusive with `cursor` — passing both returns 422. Accepts integers in `[0, 10000]`; deeper walks must use `cursor` (constant per-page cost). The response always includes `pagination.next_cursor` so consumers can switch from offset → cursor mid-walk for deep pagination without re-keying. (default to 0)
|
|
111
|
+
# @option opts [Boolean] :include_total When `true` (default), the response's `pagination.total` carries the count of rows matching the current filter, across all pages. Pass `false` to skip the count for very large workspaces where the per-page COUNT(*) cost matters. (default to true)
|
|
112
|
+
# @return [Array<(GetUsageLogs200Response, Integer, Hash)>] GetUsageLogs200Response data, response status code and response headers
|
|
113
|
+
def get_usage_logs_with_http_info(opts = {})
|
|
98
114
|
if @api_client.config.debugging
|
|
99
|
-
@api_client.config.logger.debug 'Calling API: BillingApi.
|
|
115
|
+
@api_client.config.logger.debug 'Calling API: BillingApi.get_usage_logs ...'
|
|
116
|
+
end
|
|
117
|
+
allowable_values = ["1h", "24h", "7d", "30d"]
|
|
118
|
+
if @api_client.config.client_side_validation && opts[:'range'] && !allowable_values.include?(opts[:'range'])
|
|
119
|
+
fail ArgumentError, "invalid value for \"range\", must be one of #{allowable_values}"
|
|
120
|
+
end
|
|
121
|
+
allowable_values = ["2xx", "3xx", "4xx", "5xx"]
|
|
122
|
+
if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
|
|
123
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
|
|
124
|
+
end
|
|
125
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
|
|
126
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BillingApi.get_usage_logs, must be smaller than or equal to 200.'
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
130
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling BillingApi.get_usage_logs, must be greater than or equal to 1.'
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] > 10000
|
|
134
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling BillingApi.get_usage_logs, must be smaller than or equal to 10000.'
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
138
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling BillingApi.get_usage_logs, must be greater than or equal to 0.'
|
|
100
139
|
end
|
|
140
|
+
|
|
101
141
|
# resource path
|
|
102
|
-
local_var_path = '/v1/
|
|
142
|
+
local_var_path = '/v1/usage/logs'
|
|
103
143
|
|
|
104
144
|
# query parameters
|
|
105
145
|
query_params = opts[:query_params] || {}
|
|
146
|
+
query_params[:'range'] = opts[:'range'] if !opts[:'range'].nil?
|
|
147
|
+
query_params[:'operation'] = opts[:'operation'] if !opts[:'operation'].nil?
|
|
148
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
149
|
+
query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?
|
|
150
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
151
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
152
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
153
|
+
query_params[:'include_total'] = opts[:'include_total'] if !opts[:'include_total'].nil?
|
|
106
154
|
|
|
107
155
|
# header parameters
|
|
108
156
|
header_params = opts[:header_params] || {}
|
|
157
|
+
# HTTP header 'Accept' (if needed)
|
|
158
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
109
159
|
|
|
110
160
|
# form parameters
|
|
111
161
|
form_params = opts[:form_params] || {}
|
|
@@ -114,13 +164,134 @@ module Repull
|
|
|
114
164
|
post_body = opts[:debug_body]
|
|
115
165
|
|
|
116
166
|
# return_type
|
|
117
|
-
return_type = opts[:debug_return_type]
|
|
167
|
+
return_type = opts[:debug_return_type] || 'GetUsageLogs200Response'
|
|
168
|
+
|
|
169
|
+
# auth_names
|
|
170
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
171
|
+
|
|
172
|
+
new_options = opts.merge(
|
|
173
|
+
:operation => :"BillingApi.get_usage_logs",
|
|
174
|
+
:header_params => header_params,
|
|
175
|
+
:query_params => query_params,
|
|
176
|
+
:form_params => form_params,
|
|
177
|
+
:body => post_body,
|
|
178
|
+
:auth_names => auth_names,
|
|
179
|
+
:return_type => return_type
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
183
|
+
if @api_client.config.debugging
|
|
184
|
+
@api_client.config.logger.debug "API called: BillingApi#get_usage_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
185
|
+
end
|
|
186
|
+
return data, status_code, headers
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Get usage summary
|
|
190
|
+
# Aggregated usage over the requested `range` — tier + plan limits, quota used/remaining, next reset, a per-operation breakdown (request/error counts, error rate, avg latency), a daily timeline, status-class distribution, and range totals.
|
|
191
|
+
# @param [Hash] opts the optional parameters
|
|
192
|
+
# @option opts [String] :range Aggregation window ending now. (default to '30d')
|
|
193
|
+
# @return [GetUsageSummary200Response]
|
|
194
|
+
def get_usage_summary(opts = {})
|
|
195
|
+
data, _status_code, _headers = get_usage_summary_with_http_info(opts)
|
|
196
|
+
data
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Get usage summary
|
|
200
|
+
# Aggregated usage over the requested `range` — tier + plan limits, quota used/remaining, next reset, a per-operation breakdown (request/error counts, error rate, avg latency), a daily timeline, status-class distribution, and range totals.
|
|
201
|
+
# @param [Hash] opts the optional parameters
|
|
202
|
+
# @option opts [String] :range Aggregation window ending now. (default to '30d')
|
|
203
|
+
# @return [Array<(GetUsageSummary200Response, Integer, Hash)>] GetUsageSummary200Response data, response status code and response headers
|
|
204
|
+
def get_usage_summary_with_http_info(opts = {})
|
|
205
|
+
if @api_client.config.debugging
|
|
206
|
+
@api_client.config.logger.debug 'Calling API: BillingApi.get_usage_summary ...'
|
|
207
|
+
end
|
|
208
|
+
allowable_values = ["7d", "30d", "90d"]
|
|
209
|
+
if @api_client.config.client_side_validation && opts[:'range'] && !allowable_values.include?(opts[:'range'])
|
|
210
|
+
fail ArgumentError, "invalid value for \"range\", must be one of #{allowable_values}"
|
|
211
|
+
end
|
|
212
|
+
# resource path
|
|
213
|
+
local_var_path = '/v1/usage/summary'
|
|
214
|
+
|
|
215
|
+
# query parameters
|
|
216
|
+
query_params = opts[:query_params] || {}
|
|
217
|
+
query_params[:'range'] = opts[:'range'] if !opts[:'range'].nil?
|
|
218
|
+
|
|
219
|
+
# header parameters
|
|
220
|
+
header_params = opts[:header_params] || {}
|
|
221
|
+
# HTTP header 'Accept' (if needed)
|
|
222
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
223
|
+
|
|
224
|
+
# form parameters
|
|
225
|
+
form_params = opts[:form_params] || {}
|
|
226
|
+
|
|
227
|
+
# http body (model)
|
|
228
|
+
post_body = opts[:debug_body]
|
|
229
|
+
|
|
230
|
+
# return_type
|
|
231
|
+
return_type = opts[:debug_return_type] || 'GetUsageSummary200Response'
|
|
232
|
+
|
|
233
|
+
# auth_names
|
|
234
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
235
|
+
|
|
236
|
+
new_options = opts.merge(
|
|
237
|
+
:operation => :"BillingApi.get_usage_summary",
|
|
238
|
+
:header_params => header_params,
|
|
239
|
+
:query_params => query_params,
|
|
240
|
+
:form_params => form_params,
|
|
241
|
+
:body => post_body,
|
|
242
|
+
:auth_names => auth_names,
|
|
243
|
+
:return_type => return_type
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
247
|
+
if @api_client.config.debugging
|
|
248
|
+
@api_client.config.logger.debug "API called: BillingApi#get_usage_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
249
|
+
end
|
|
250
|
+
return data, status_code, headers
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# Get tier and quota
|
|
254
|
+
# Lightweight current-tier snapshot for status badges and quota meters — plan limits (monthly requests, daily AI requests, dynamic-pricing listings), the amount used, the amount remaining, and the next reset. `null` limits mean unlimited on that dimension.
|
|
255
|
+
# @param [Hash] opts the optional parameters
|
|
256
|
+
# @return [GetUsageTier200Response]
|
|
257
|
+
def get_usage_tier(opts = {})
|
|
258
|
+
data, _status_code, _headers = get_usage_tier_with_http_info(opts)
|
|
259
|
+
data
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Get tier and quota
|
|
263
|
+
# Lightweight current-tier snapshot for status badges and quota meters — plan limits (monthly requests, daily AI requests, dynamic-pricing listings), the amount used, the amount remaining, and the next reset. `null` limits mean unlimited on that dimension.
|
|
264
|
+
# @param [Hash] opts the optional parameters
|
|
265
|
+
# @return [Array<(GetUsageTier200Response, Integer, Hash)>] GetUsageTier200Response data, response status code and response headers
|
|
266
|
+
def get_usage_tier_with_http_info(opts = {})
|
|
267
|
+
if @api_client.config.debugging
|
|
268
|
+
@api_client.config.logger.debug 'Calling API: BillingApi.get_usage_tier ...'
|
|
269
|
+
end
|
|
270
|
+
# resource path
|
|
271
|
+
local_var_path = '/v1/usage/tier'
|
|
272
|
+
|
|
273
|
+
# query parameters
|
|
274
|
+
query_params = opts[:query_params] || {}
|
|
275
|
+
|
|
276
|
+
# header parameters
|
|
277
|
+
header_params = opts[:header_params] || {}
|
|
278
|
+
# HTTP header 'Accept' (if needed)
|
|
279
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
280
|
+
|
|
281
|
+
# form parameters
|
|
282
|
+
form_params = opts[:form_params] || {}
|
|
283
|
+
|
|
284
|
+
# http body (model)
|
|
285
|
+
post_body = opts[:debug_body]
|
|
286
|
+
|
|
287
|
+
# return_type
|
|
288
|
+
return_type = opts[:debug_return_type] || 'GetUsageTier200Response'
|
|
118
289
|
|
|
119
290
|
# auth_names
|
|
120
291
|
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
121
292
|
|
|
122
293
|
new_options = opts.merge(
|
|
123
|
-
:operation => :"BillingApi.
|
|
294
|
+
:operation => :"BillingApi.get_usage_tier",
|
|
124
295
|
:header_params => header_params,
|
|
125
296
|
:query_params => query_params,
|
|
126
297
|
:form_params => form_params,
|
|
@@ -131,7 +302,7 @@ module Repull
|
|
|
131
302
|
|
|
132
303
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
133
304
|
if @api_client.config.debugging
|
|
134
|
-
@api_client.config.logger.debug "API called: BillingApi#
|
|
305
|
+
@api_client.config.logger.debug "API called: BillingApi#get_usage_tier\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
135
306
|
end
|
|
136
307
|
return data, status_code, headers
|
|
137
308
|
end
|