get_around_owner 1.0.1 → 1.0.3

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.
Files changed (237) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -0
  3. data/Owner API v1.json +2938 -0
  4. data/README.md +338 -181
  5. data/Rakefile +8 -0
  6. data/docs/Car.md +12 -0
  7. data/docs/CarId.md +6 -0
  8. data/docs/CarIdUnavailabilitiesJsonBody.md +9 -0
  9. data/docs/CarsApi.md +110 -0
  10. data/docs/CarsIndex.md +6 -0
  11. data/docs/Checkin.md +10 -0
  12. data/docs/CheckinsApi.md +114 -0
  13. data/docs/CheckinsIndex.md +6 -0
  14. data/docs/Checkout.md +11 -0
  15. data/docs/CheckoutsApi.md +114 -0
  16. data/docs/CheckoutsIndex.md +6 -0
  17. data/docs/EndsAt.md +6 -0
  18. data/docs/GetaroundCar.md +28 -0
  19. data/docs/GetaroundCarsIndexInner.md +18 -0
  20. data/docs/GetaroundCheckin.md +24 -0
  21. data/docs/GetaroundCheckinsIndexInner.md +18 -0
  22. data/docs/GetaroundCheckout.md +26 -0
  23. data/docs/GetaroundCreateMessagesRequest.md +18 -0
  24. data/docs/GetaroundCreateUnavailabilitiesRequest.md +22 -0
  25. data/docs/GetaroundDestroyUnavailabilityRequest.md +20 -0
  26. data/docs/GetaroundInvoice.md +34 -0
  27. data/docs/GetaroundInvoiceChargesInner.md +20 -0
  28. data/docs/GetaroundInvoicesIndexInner.md +18 -0
  29. data/docs/GetaroundMessage.md +26 -0
  30. data/docs/GetaroundMessagesSent.md +22 -0
  31. data/docs/GetaroundMessagesSentAllOfData.md +20 -0
  32. data/docs/GetaroundPayout.md +28 -0
  33. data/docs/GetaroundPayoutInvoicesInner.md +18 -0
  34. data/docs/GetaroundPayoutsIndexInner.md +18 -0
  35. data/docs/GetaroundReason.md +15 -0
  36. data/docs/GetaroundRental.md +32 -0
  37. data/docs/GetaroundRentalInvoicesIndexInner.md +18 -0
  38. data/docs/GetaroundRentalMessagesIndexInner.md +18 -0
  39. data/docs/GetaroundRentalsBooked.md +22 -0
  40. data/docs/GetaroundRentalsBookedAllOfData.md +18 -0
  41. data/docs/GetaroundRentalsCanceled.md +22 -0
  42. data/docs/GetaroundRentalsCarCheckedIn.md +22 -0
  43. data/docs/GetaroundRentalsCarCheckedOut.md +22 -0
  44. data/docs/GetaroundRentalsCarSwitched.md +22 -0
  45. data/docs/GetaroundRentalsIndexInner.md +18 -0
  46. data/docs/GetaroundRentalsTimesChanged.md +22 -0
  47. data/docs/GetaroundUnavailabilitiesCreated.md +22 -0
  48. data/docs/GetaroundUnavailabilitiesCreatedAllOfData.md +24 -0
  49. data/docs/GetaroundUnavailabilitiesDeleted.md +22 -0
  50. data/docs/GetaroundUnavailabilitiesDeletedAllOfData.md +22 -0
  51. data/docs/GetaroundUnavailability.md +24 -0
  52. data/docs/GetaroundUser.md +42 -0
  53. data/docs/GetaroundUsersUpdated.md +22 -0
  54. data/docs/GetaroundUsersUpdatedAllOfData.md +18 -0
  55. data/docs/GetaroundWebhook.md +22 -0
  56. data/docs/Invoice.md +15 -0
  57. data/docs/InvoicesApi.md +169 -0
  58. data/docs/InvoicesIndex.md +6 -0
  59. data/docs/Message.md +11 -0
  60. data/docs/MessagesApi.md +162 -0
  61. data/docs/MessagesSent.md +6 -0
  62. data/docs/Payout.md +12 -0
  63. data/docs/PayoutsApi.md +114 -0
  64. data/docs/PayoutsIndex.md +6 -0
  65. data/docs/Rental.md +14 -0
  66. data/docs/RentalIdMessagesJsonBody.md +7 -0
  67. data/docs/RentalInvoicesIndex.md +6 -0
  68. data/docs/RentalMessagesIndex.md +6 -0
  69. data/docs/RentalsApi.md +114 -0
  70. data/docs/RentalsBooked.md +6 -0
  71. data/docs/RentalsCanceled.md +6 -0
  72. data/docs/RentalsCarCheckedIn.md +6 -0
  73. data/docs/RentalsCarCheckedOut.md +6 -0
  74. data/docs/RentalsCarSwitched.md +6 -0
  75. data/docs/RentalsIndex.md +6 -0
  76. data/docs/RentalsTimesChanged.md +6 -0
  77. data/docs/StartsAt.md +6 -0
  78. data/docs/UnavailabilitiesApi.md +167 -0
  79. data/docs/UnavailabilitiesCreated.md +6 -0
  80. data/docs/UnavailabilitiesDeleted.md +6 -0
  81. data/docs/UnavailabilitiesIndex.md +6 -0
  82. data/docs/Unavailability.md +10 -0
  83. data/docs/User.md +19 -0
  84. data/docs/UsersApi.md +57 -0
  85. data/docs/UsersUpdated.md +6 -0
  86. data/docs/Webhook.md +9 -0
  87. data/get_around_owner-1.0.0.gem +0 -0
  88. data/get_around_owner-1.0.1.gem +0 -0
  89. data/get_around_owner.gemspec +39 -0
  90. data/getaround-api.gemspec +38 -0
  91. data/git_push.sh +55 -0
  92. data/lib/{get_around_owner → getaround-api}/api/cars_api.rb +25 -41
  93. data/lib/getaround-api/api/checkins_api.rb +146 -0
  94. data/lib/getaround-api/api/checkouts_api.rb +146 -0
  95. data/lib/{get_around_owner → getaround-api}/api/invoices_api.rb +43 -66
  96. data/lib/getaround-api/api/messages_api.rb +198 -0
  97. data/lib/{get_around_owner → getaround-api}/api/payouts_api.rb +29 -45
  98. data/lib/getaround-api/api/rentals_api.rb +146 -0
  99. data/lib/getaround-api/api/unavailabilities_api.rb +208 -0
  100. data/lib/{get_around_owner/api/messages_api.rb → getaround-api/api/users_api.rb} +31 -37
  101. data/lib/{get_around_owner → getaround-api}/api_client.rb +71 -77
  102. data/lib/{get_around_owner → getaround-api}/api_error.rb +5 -6
  103. data/lib/{get_around_owner → getaround-api}/configuration.rb +13 -106
  104. data/lib/{get_around_owner/models/getaround_car.rb → getaround-api/models/car.rb} +36 -56
  105. data/lib/{get_around_owner/models/getaround_users_updated_all_of_data.rb → getaround-api/models/car_id.rb} +33 -50
  106. data/lib/{get_around_owner/models/getaround_destroy_unavailability_request.rb → getaround-api/models/car_id_unavailabilities_json_body.rb} +45 -47
  107. data/lib/{get_around_owner/models/getaround_rentals_booked_all_of_data.rb → getaround-api/models/cars_index.rb} +33 -50
  108. data/lib/{get_around_owner/models/getaround_checkin.rb → getaround-api/models/checkin.rb} +34 -65
  109. data/lib/{get_around_owner/models/getaround_rentals_index_inner.rb → getaround-api/models/checkins_index.rb} +32 -58
  110. data/lib/{get_around_owner/models/getaround_checkout.rb → getaround-api/models/checkout.rb} +35 -70
  111. data/lib/getaround-api/models/checkouts_index.rb +197 -0
  112. data/lib/getaround-api/models/ends_at.rb +198 -0
  113. data/lib/{get_around_owner/models/getaround_invoice.rb → getaround-api/models/invoice.rb} +45 -113
  114. data/lib/getaround-api/models/invoices_index.rb +198 -0
  115. data/lib/{get_around_owner/models/getaround_message.rb → getaround-api/models/message.rb} +35 -53
  116. data/lib/getaround-api/models/messages_sent.rb +197 -0
  117. data/lib/{get_around_owner/models/getaround_payout.rb → getaround-api/models/payout.rb} +37 -101
  118. data/lib/getaround-api/models/payouts_index.rb +198 -0
  119. data/lib/{get_around_owner/models/getaround_rental.rb → getaround-api/models/rental.rb} +38 -100
  120. data/lib/{get_around_owner/models/getaround_create_messages_request.rb → getaround-api/models/rental_id_messages_json_body.rb} +31 -41
  121. data/lib/getaround-api/models/rental_invoices_index.rb +198 -0
  122. data/lib/getaround-api/models/rental_messages_index.rb +198 -0
  123. data/lib/getaround-api/models/rentals_booked.rb +197 -0
  124. data/lib/getaround-api/models/rentals_canceled.rb +197 -0
  125. data/lib/getaround-api/models/rentals_car_checked_in.rb +197 -0
  126. data/lib/getaround-api/models/rentals_car_checked_out.rb +197 -0
  127. data/lib/getaround-api/models/rentals_car_switched.rb +197 -0
  128. data/lib/getaround-api/models/rentals_index.rb +198 -0
  129. data/lib/getaround-api/models/rentals_times_changed.rb +197 -0
  130. data/lib/getaround-api/models/starts_at.rb +198 -0
  131. data/lib/{get_around_owner/models/getaround_cars_index_inner.rb → getaround-api/models/unavailabilities_created.rb} +32 -58
  132. data/lib/getaround-api/models/unavailabilities_deleted.rb +197 -0
  133. data/lib/getaround-api/models/unavailabilities_index.rb +198 -0
  134. data/lib/{get_around_owner/models/getaround_unavailabilities_created_all_of_data.rb → getaround-api/models/unavailability.rb} +51 -65
  135. data/lib/{get_around_owner/models/getaround_user.rb → getaround-api/models/user.rb} +43 -75
  136. data/lib/getaround-api/models/users_updated.rb +197 -0
  137. data/lib/{get_around_owner/models/getaround_webhook.rb → getaround-api/models/webhook.rb} +38 -47
  138. data/lib/{get_around_owner → getaround-api}/version.rb +5 -6
  139. data/lib/getaround-api.rb +81 -0
  140. data/openapi.yml +2298 -0
  141. data/spec/api/cars_api_spec.rb +13 -14
  142. data/spec/api/checkins_api_spec.rb +13 -14
  143. data/spec/api/checkouts_api_spec.rb +13 -14
  144. data/spec/api/invoices_api_spec.rb +19 -20
  145. data/spec/api/messages_api_spec.rb +14 -15
  146. data/spec/api/payouts_api_spec.rb +13 -14
  147. data/spec/api/rentals_api_spec.rb +13 -14
  148. data/spec/api/unavailabilities_api_spec.rb +14 -16
  149. data/spec/api/users_api_spec.rb +9 -10
  150. data/spec/api_client_spec.rb +225 -0
  151. data/spec/base_object_spec.rb +109 -0
  152. data/spec/{models/getaround_checkins_index_inner_spec.rb → configuration_spec.rb} +26 -21
  153. data/spec/models/{getaround_reason_spec.rb → car_id_spec.rb} +18 -14
  154. data/spec/models/{getaround_unavailabilities_deleted_all_of_data_spec.rb → car_id_unavailabilities_json_body_spec.rb} +24 -20
  155. data/spec/models/{getaround_car_spec.rb → car_spec.rb} +24 -20
  156. data/spec/models/cars_index_spec.rb +34 -0
  157. data/spec/models/{getaround_checkin_spec.rb → checkin_spec.rb} +22 -18
  158. data/spec/models/checkins_index_spec.rb +34 -0
  159. data/spec/models/{getaround_checkout_spec.rb → checkout_spec.rb} +23 -19
  160. data/spec/models/checkouts_index_spec.rb +34 -0
  161. data/spec/models/ends_at_spec.rb +34 -0
  162. data/spec/models/{getaround_invoice_spec.rb → invoice_spec.rb} +27 -31
  163. data/spec/models/invoices_index_spec.rb +34 -0
  164. data/spec/models/{getaround_message_spec.rb → message_spec.rb} +23 -19
  165. data/spec/models/messages_sent_spec.rb +34 -0
  166. data/spec/models/{getaround_payout_spec.rb → payout_spec.rb} +24 -24
  167. data/spec/models/payouts_index_spec.rb +34 -0
  168. data/spec/models/{getaround_create_messages_request_spec.rb → rental_id_messages_json_body_spec.rb} +19 -15
  169. data/spec/models/{getaround_rentals_index_inner_spec.rb → rental_invoices_index_spec.rb} +16 -18
  170. data/spec/models/rental_messages_index_spec.rb +34 -0
  171. data/spec/models/{getaround_rental_spec.rb → rental_spec.rb} +26 -22
  172. data/spec/models/rentals_booked_spec.rb +34 -0
  173. data/spec/models/rentals_canceled_spec.rb +34 -0
  174. data/spec/models/rentals_car_checked_in_spec.rb +34 -0
  175. data/spec/models/rentals_car_checked_out_spec.rb +34 -0
  176. data/spec/models/rentals_car_switched_spec.rb +34 -0
  177. data/spec/models/rentals_index_spec.rb +34 -0
  178. data/spec/models/rentals_times_changed_spec.rb +34 -0
  179. data/spec/models/starts_at_spec.rb +34 -0
  180. data/spec/models/{getaround_cars_index_inner_spec.rb → unavailabilities_created_spec.rb} +16 -18
  181. data/spec/models/{getaround_payouts_index_inner_spec.rb → unavailabilities_deleted_spec.rb} +16 -18
  182. data/spec/models/unavailabilities_index_spec.rb +34 -0
  183. data/spec/models/{getaround_unavailabilities_created_all_of_data_spec.rb → unavailability_spec.rb} +22 -18
  184. data/spec/models/{getaround_user_spec.rb → user_spec.rb} +31 -27
  185. data/spec/models/users_updated_spec.rb +34 -0
  186. data/spec/models/{getaround_webhook_spec.rb → webhook_spec.rb} +21 -17
  187. data/spec/spec_helper.rb +5 -6
  188. metadata +289 -133
  189. data/lib/get_around_owner/api/checkins_api.rb +0 -82
  190. data/lib/get_around_owner/api/checkouts_api.rb +0 -82
  191. data/lib/get_around_owner/api/rentals_api.rb +0 -262
  192. data/lib/get_around_owner/api/unavailabilities_api.rb +0 -142
  193. data/lib/get_around_owner/api/users_api.rb +0 -82
  194. data/lib/get_around_owner/models/getaround_checkins_index_inner.rb +0 -222
  195. data/lib/get_around_owner/models/getaround_create_unavailabilities_request.rb +0 -283
  196. data/lib/get_around_owner/models/getaround_invoice_charges_inner.rb +0 -225
  197. data/lib/get_around_owner/models/getaround_invoices_index_inner.rb +0 -223
  198. data/lib/get_around_owner/models/getaround_messages_sent.rb +0 -257
  199. data/lib/get_around_owner/models/getaround_messages_sent_all_of_data.rb +0 -225
  200. data/lib/get_around_owner/models/getaround_payout_invoices_inner.rb +0 -223
  201. data/lib/get_around_owner/models/getaround_payouts_index_inner.rb +0 -223
  202. data/lib/get_around_owner/models/getaround_reason.rb +0 -45
  203. data/lib/get_around_owner/models/getaround_rental_invoices_index_inner.rb +0 -223
  204. data/lib/get_around_owner/models/getaround_rental_messages_index_inner.rb +0 -223
  205. data/lib/get_around_owner/models/getaround_rentals_booked.rb +0 -257
  206. data/lib/get_around_owner/models/getaround_rentals_canceled.rb +0 -257
  207. data/lib/get_around_owner/models/getaround_rentals_car_checked_in.rb +0 -257
  208. data/lib/get_around_owner/models/getaround_rentals_car_checked_out.rb +0 -257
  209. data/lib/get_around_owner/models/getaround_rentals_car_switched.rb +0 -257
  210. data/lib/get_around_owner/models/getaround_rentals_times_changed.rb +0 -257
  211. data/lib/get_around_owner/models/getaround_unavailabilities_created.rb +0 -257
  212. data/lib/get_around_owner/models/getaround_unavailabilities_deleted.rb +0 -257
  213. data/lib/get_around_owner/models/getaround_unavailabilities_deleted_all_of_data.rb +0 -235
  214. data/lib/get_around_owner/models/getaround_unavailability.rb +0 -302
  215. data/lib/get_around_owner/models/getaround_users_updated.rb +0 -257
  216. data/lib/get_around_owner.rb +0 -86
  217. data/spec/models/getaround_create_unavailabilities_request_spec.rb +0 -52
  218. data/spec/models/getaround_destroy_unavailability_request_spec.rb +0 -42
  219. data/spec/models/getaround_invoice_charges_inner_spec.rb +0 -42
  220. data/spec/models/getaround_invoices_index_inner_spec.rb +0 -36
  221. data/spec/models/getaround_messages_sent_all_of_data_spec.rb +0 -42
  222. data/spec/models/getaround_messages_sent_spec.rb +0 -48
  223. data/spec/models/getaround_payout_invoices_inner_spec.rb +0 -36
  224. data/spec/models/getaround_rental_invoices_index_inner_spec.rb +0 -36
  225. data/spec/models/getaround_rental_messages_index_inner_spec.rb +0 -36
  226. data/spec/models/getaround_rentals_booked_all_of_data_spec.rb +0 -36
  227. data/spec/models/getaround_rentals_booked_spec.rb +0 -48
  228. data/spec/models/getaround_rentals_canceled_spec.rb +0 -48
  229. data/spec/models/getaround_rentals_car_checked_in_spec.rb +0 -48
  230. data/spec/models/getaround_rentals_car_checked_out_spec.rb +0 -48
  231. data/spec/models/getaround_rentals_car_switched_spec.rb +0 -48
  232. data/spec/models/getaround_rentals_times_changed_spec.rb +0 -48
  233. data/spec/models/getaround_unavailabilities_created_spec.rb +0 -48
  234. data/spec/models/getaround_unavailabilities_deleted_spec.rb +0 -48
  235. data/spec/models/getaround_unavailability_spec.rb +0 -58
  236. data/spec/models/getaround_users_updated_all_of_data_spec.rb +0 -36
  237. data/spec/models/getaround_users_updated_spec.rb +0 -48
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: get_around_owner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAPI-Generator
8
- - yann120
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-06-28 00:00:00.000000000 Z
11
+ date: 2024-12-30 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: typhoeus
@@ -51,65 +50,224 @@ dependencies:
51
50
  - - ">="
52
51
  - !ruby/object:Gem::Version
53
52
  version: 3.6.0
54
- description: Getaround Owner API Wrapper
53
+ description: '# Quick Start The Owner API uses the JSON format, and must be accessed
54
+ over a [secure connection](https://en.wikipedia.org/wiki/HTTPS). Let’s assume that
55
+ the access token provided by your account manager is “TOKEN”. Here’s how to get
56
+ the list of ids of all your invoices from the first week of August with a shell
57
+ script: ```bash query="end_date=2018-08-08T00%3A00%3A00%2B00%3A00&start_date=2018-08-01T00%3A00%3A00%2B00%3A00" curl
58
+ -i "https://api-eu.getaround.com/owner/v1/invoices?${query}" \ -H "Authorization:
59
+ Bearer TOKEN" \ -H "Accept:application/json" \ -H "Content-Type:application/json"
60
+ ``` And here’s how to get the invoice with the id 12345: ```bash curl -i "https://api-eu.getaround.com/owner/v1/invoices/12345"
61
+ \ -H "Authorization: Bearer TOKEN" \ -H "Accept: application/json" \ -H "Content-Type:
62
+ application/json"" ``` See the [endpoints section](#tag/Invoices) of this guide
63
+ for details about the response format. Dates in request params should follow the
64
+ ISO 8601 standard. # Authentication All requests must be authenticated with a
65
+ [bearer token header](https://tools.ietf.org/html/rfc6750#section-2.1). You token
66
+ will be sent to you by your account manager. Unauthenticated requests will return
67
+ a 401 status. # Pagination The page number and the number of items per page can
68
+ be set with the “page” and “per_page” params. For example, this request will return
69
+ the second page of invoices, and 50 invoices per page: `https://api-eu.getaround.com/owner/v1/invoices?page=2&per_page=50` Both
70
+ of these params are optional. The default page size is 30 items. The Getaround
71
+ Owner API follows the [RFC 8288 convention](https://datatracker.ietf.org/doc/html/rfc8288)
72
+ of using the `Link` header to provide the `next` page URL. Please don''t build the
73
+ pagination URLs yourself. The `next` page will be missing when you are requesting
74
+ the last available page. Here''s an example response header from requesting the
75
+ second page of invoices `https://api-eu.getaround.com/owner/v1/invoices?page=2&per_page=50`
76
+ ``` Link: <https://api-eu.getaround.com/owner/v1/invoices?page=3&per_page=50>; rel="next"
77
+ ``` # Throttling policy and Date range limitation We have throttling policy that
78
+ prevents you to perform more than 100 requests per min from the same IP. Also,
79
+ there is a limitation on the size of the range of dates given in params in some
80
+ requests. All requests that need start_date and end_date, do not accept a range
81
+ bigger than 30 days. # Webhooks Getaround can send webhook events that notify
82
+ your application when certain events happen on your account. This is especially
83
+ useful to follow the lifecycle of rentals, tracking for example bookings or cancellations. ###
84
+ Setup To set up an endpoint, you need to define a route on your server for receiving
85
+ events, and then <a href="mailto:owner-api@getaround.com">ask Getaround</a> to add
86
+ this URL to your account. To acknowledge receipt of a event, your endpoint must: -
87
+ Return a `2xx` HTTP status code. - Be a secure `https` endpoint with a valid SSL
88
+ certificate. ### Testing Once Getaround has set up the endpoint, and it is properly
89
+ configured as described above, a test `ping` event can be sent by clicking the button
90
+ below: <form action="/docs/api/owner/fire_ping_webhook" method="post"><input type="submit"
91
+ value="Send Ping Event"></form> You should receive the following JSON payload: ```json
92
+ { "data": { "ping": "pong" }, "type": "ping", "occurred_at": "2019-04-18T08:30:05Z"
93
+ } ``` ### Retries Webhook deliveries will be attempted for up to three days with
94
+ an exponential back off. After that point the delivery will be abandoned. ### Verifying
95
+ Signatures Getaround will also provide you with a secret token, which is used to
96
+ create a hash signature with each payload. This hash signature is passed along
97
+ with each request in the headers as `X-Drivy-Signature`. Suppose you have a basic
98
+ server listening to webhooks that looks like this: ```ruby require ''sinatra''
99
+ require ''json'' post ''/payload'' do push = JSON.parse(params[:payload]) "I
100
+ got some JSON: #{push.inspect}" end ``` The goal is to compute a hash using your
101
+ secret token, and ensure that the hash from Getaround matches. Getaround uses an
102
+ HMAC hexdigest to compute the hash, so you could change your server to look a little
103
+ like this: ```ruby post ''/payload'' do request.body.rewind payload_body =
104
+ request.body.read verify_signature(payload_body) push = JSON.parse(params[:payload]) "I
105
+ got some JSON: #{push.inspect}" end def verify_signature(payload_body) signature
106
+ = ''sha1='' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new(''sha1''), ENV[''SECRET_TOKEN''],
107
+ payload_body) return halt 500, "Signatures didn''t match!" unless Rack::Utils.secure_compare(signature,
108
+ request.env[''HTTP_X_DRIVY_SIGNATURE'']) end ``` Obviously, your language and server
109
+ implementations may differ from this code. There are a couple of important things
110
+ to point out, however: No matter which implementation you use, the hash signature
111
+ starts with `sha1=`, using the key of your secret token and your payload body. Using
112
+ a plain `==` operator is not advised. A method like secure_compare performs a "constant
113
+ time" string comparison, which renders it safe from certain timing attacks against
114
+ regular equality operators. ### Best Practices - **Acknowledge events immediately**.
115
+ If your webhook script performs complex logic, or makes network calls, it’s possible
116
+ that the script would time out before Getaround sees its complete execution. Ideally,
117
+ your webhook handler code (acknowledging receipt of an event by returning a `2xx`
118
+ status code) is separate of any other logic you do for that event. - **Handle duplicate
119
+ events**. Webhook endpoints might occasionally receive the same event more than
120
+ once. We advise you to guard against duplicated event receipts by making your event
121
+ processing idempotent. One way of doing this is logging the events you’ve processed,
122
+ and then not processing already-logged events. - **Do not expect events in order**.
123
+ Getaround does not guarantee delivery of events in the order in which they are generated.
124
+ Your endpoint should therefore handle this accordingly. We do provide an `occurred_at`
125
+ timestamp for each event, though, to help reconcile ordering. '
55
126
  email:
127
+ - owner-api@getaround.com
56
128
  executables: []
57
129
  extensions: []
58
130
  extra_rdoc_files: []
59
131
  files:
132
+ - Gemfile
133
+ - Owner API v1.json
60
134
  - README.md
61
- - lib/get_around_owner.rb
62
- - lib/get_around_owner/api/cars_api.rb
63
- - lib/get_around_owner/api/checkins_api.rb
64
- - lib/get_around_owner/api/checkouts_api.rb
65
- - lib/get_around_owner/api/invoices_api.rb
66
- - lib/get_around_owner/api/messages_api.rb
67
- - lib/get_around_owner/api/payouts_api.rb
68
- - lib/get_around_owner/api/rentals_api.rb
69
- - lib/get_around_owner/api/unavailabilities_api.rb
70
- - lib/get_around_owner/api/users_api.rb
71
- - lib/get_around_owner/api_client.rb
72
- - lib/get_around_owner/api_error.rb
73
- - lib/get_around_owner/configuration.rb
74
- - lib/get_around_owner/models/getaround_car.rb
75
- - lib/get_around_owner/models/getaround_cars_index_inner.rb
76
- - lib/get_around_owner/models/getaround_checkin.rb
77
- - lib/get_around_owner/models/getaround_checkins_index_inner.rb
78
- - lib/get_around_owner/models/getaround_checkout.rb
79
- - lib/get_around_owner/models/getaround_create_messages_request.rb
80
- - lib/get_around_owner/models/getaround_create_unavailabilities_request.rb
81
- - lib/get_around_owner/models/getaround_destroy_unavailability_request.rb
82
- - lib/get_around_owner/models/getaround_invoice.rb
83
- - lib/get_around_owner/models/getaround_invoice_charges_inner.rb
84
- - lib/get_around_owner/models/getaround_invoices_index_inner.rb
85
- - lib/get_around_owner/models/getaround_message.rb
86
- - lib/get_around_owner/models/getaround_messages_sent.rb
87
- - lib/get_around_owner/models/getaround_messages_sent_all_of_data.rb
88
- - lib/get_around_owner/models/getaround_payout.rb
89
- - lib/get_around_owner/models/getaround_payout_invoices_inner.rb
90
- - lib/get_around_owner/models/getaround_payouts_index_inner.rb
91
- - lib/get_around_owner/models/getaround_reason.rb
92
- - lib/get_around_owner/models/getaround_rental.rb
93
- - lib/get_around_owner/models/getaround_rental_invoices_index_inner.rb
94
- - lib/get_around_owner/models/getaround_rental_messages_index_inner.rb
95
- - lib/get_around_owner/models/getaround_rentals_booked.rb
96
- - lib/get_around_owner/models/getaround_rentals_booked_all_of_data.rb
97
- - lib/get_around_owner/models/getaround_rentals_canceled.rb
98
- - lib/get_around_owner/models/getaround_rentals_car_checked_in.rb
99
- - lib/get_around_owner/models/getaround_rentals_car_checked_out.rb
100
- - lib/get_around_owner/models/getaround_rentals_car_switched.rb
101
- - lib/get_around_owner/models/getaround_rentals_index_inner.rb
102
- - lib/get_around_owner/models/getaround_rentals_times_changed.rb
103
- - lib/get_around_owner/models/getaround_unavailabilities_created.rb
104
- - lib/get_around_owner/models/getaround_unavailabilities_created_all_of_data.rb
105
- - lib/get_around_owner/models/getaround_unavailabilities_deleted.rb
106
- - lib/get_around_owner/models/getaround_unavailabilities_deleted_all_of_data.rb
107
- - lib/get_around_owner/models/getaround_unavailability.rb
108
- - lib/get_around_owner/models/getaround_user.rb
109
- - lib/get_around_owner/models/getaround_users_updated.rb
110
- - lib/get_around_owner/models/getaround_users_updated_all_of_data.rb
111
- - lib/get_around_owner/models/getaround_webhook.rb
112
- - lib/get_around_owner/version.rb
135
+ - Rakefile
136
+ - docs/Car.md
137
+ - docs/CarId.md
138
+ - docs/CarIdUnavailabilitiesJsonBody.md
139
+ - docs/CarsApi.md
140
+ - docs/CarsIndex.md
141
+ - docs/Checkin.md
142
+ - docs/CheckinsApi.md
143
+ - docs/CheckinsIndex.md
144
+ - docs/Checkout.md
145
+ - docs/CheckoutsApi.md
146
+ - docs/CheckoutsIndex.md
147
+ - docs/EndsAt.md
148
+ - docs/GetaroundCar.md
149
+ - docs/GetaroundCarsIndexInner.md
150
+ - docs/GetaroundCheckin.md
151
+ - docs/GetaroundCheckinsIndexInner.md
152
+ - docs/GetaroundCheckout.md
153
+ - docs/GetaroundCreateMessagesRequest.md
154
+ - docs/GetaroundCreateUnavailabilitiesRequest.md
155
+ - docs/GetaroundDestroyUnavailabilityRequest.md
156
+ - docs/GetaroundInvoice.md
157
+ - docs/GetaroundInvoiceChargesInner.md
158
+ - docs/GetaroundInvoicesIndexInner.md
159
+ - docs/GetaroundMessage.md
160
+ - docs/GetaroundMessagesSent.md
161
+ - docs/GetaroundMessagesSentAllOfData.md
162
+ - docs/GetaroundPayout.md
163
+ - docs/GetaroundPayoutInvoicesInner.md
164
+ - docs/GetaroundPayoutsIndexInner.md
165
+ - docs/GetaroundReason.md
166
+ - docs/GetaroundRental.md
167
+ - docs/GetaroundRentalInvoicesIndexInner.md
168
+ - docs/GetaroundRentalMessagesIndexInner.md
169
+ - docs/GetaroundRentalsBooked.md
170
+ - docs/GetaroundRentalsBookedAllOfData.md
171
+ - docs/GetaroundRentalsCanceled.md
172
+ - docs/GetaroundRentalsCarCheckedIn.md
173
+ - docs/GetaroundRentalsCarCheckedOut.md
174
+ - docs/GetaroundRentalsCarSwitched.md
175
+ - docs/GetaroundRentalsIndexInner.md
176
+ - docs/GetaroundRentalsTimesChanged.md
177
+ - docs/GetaroundUnavailabilitiesCreated.md
178
+ - docs/GetaroundUnavailabilitiesCreatedAllOfData.md
179
+ - docs/GetaroundUnavailabilitiesDeleted.md
180
+ - docs/GetaroundUnavailabilitiesDeletedAllOfData.md
181
+ - docs/GetaroundUnavailability.md
182
+ - docs/GetaroundUser.md
183
+ - docs/GetaroundUsersUpdated.md
184
+ - docs/GetaroundUsersUpdatedAllOfData.md
185
+ - docs/GetaroundWebhook.md
186
+ - docs/Invoice.md
187
+ - docs/InvoicesApi.md
188
+ - docs/InvoicesIndex.md
189
+ - docs/Message.md
190
+ - docs/MessagesApi.md
191
+ - docs/MessagesSent.md
192
+ - docs/Payout.md
193
+ - docs/PayoutsApi.md
194
+ - docs/PayoutsIndex.md
195
+ - docs/Rental.md
196
+ - docs/RentalIdMessagesJsonBody.md
197
+ - docs/RentalInvoicesIndex.md
198
+ - docs/RentalMessagesIndex.md
199
+ - docs/RentalsApi.md
200
+ - docs/RentalsBooked.md
201
+ - docs/RentalsCanceled.md
202
+ - docs/RentalsCarCheckedIn.md
203
+ - docs/RentalsCarCheckedOut.md
204
+ - docs/RentalsCarSwitched.md
205
+ - docs/RentalsIndex.md
206
+ - docs/RentalsTimesChanged.md
207
+ - docs/StartsAt.md
208
+ - docs/UnavailabilitiesApi.md
209
+ - docs/UnavailabilitiesCreated.md
210
+ - docs/UnavailabilitiesDeleted.md
211
+ - docs/UnavailabilitiesIndex.md
212
+ - docs/Unavailability.md
213
+ - docs/User.md
214
+ - docs/UsersApi.md
215
+ - docs/UsersUpdated.md
216
+ - docs/Webhook.md
217
+ - get_around_owner-1.0.0.gem
218
+ - get_around_owner-1.0.1.gem
219
+ - get_around_owner.gemspec
220
+ - getaround-api.gemspec
221
+ - git_push.sh
222
+ - lib/getaround-api.rb
223
+ - lib/getaround-api/api/cars_api.rb
224
+ - lib/getaround-api/api/checkins_api.rb
225
+ - lib/getaround-api/api/checkouts_api.rb
226
+ - lib/getaround-api/api/invoices_api.rb
227
+ - lib/getaround-api/api/messages_api.rb
228
+ - lib/getaround-api/api/payouts_api.rb
229
+ - lib/getaround-api/api/rentals_api.rb
230
+ - lib/getaround-api/api/unavailabilities_api.rb
231
+ - lib/getaround-api/api/users_api.rb
232
+ - lib/getaround-api/api_client.rb
233
+ - lib/getaround-api/api_error.rb
234
+ - lib/getaround-api/configuration.rb
235
+ - lib/getaround-api/models/car.rb
236
+ - lib/getaround-api/models/car_id.rb
237
+ - lib/getaround-api/models/car_id_unavailabilities_json_body.rb
238
+ - lib/getaround-api/models/cars_index.rb
239
+ - lib/getaround-api/models/checkin.rb
240
+ - lib/getaround-api/models/checkins_index.rb
241
+ - lib/getaround-api/models/checkout.rb
242
+ - lib/getaround-api/models/checkouts_index.rb
243
+ - lib/getaround-api/models/ends_at.rb
244
+ - lib/getaround-api/models/invoice.rb
245
+ - lib/getaround-api/models/invoices_index.rb
246
+ - lib/getaround-api/models/message.rb
247
+ - lib/getaround-api/models/messages_sent.rb
248
+ - lib/getaround-api/models/payout.rb
249
+ - lib/getaround-api/models/payouts_index.rb
250
+ - lib/getaround-api/models/rental.rb
251
+ - lib/getaround-api/models/rental_id_messages_json_body.rb
252
+ - lib/getaround-api/models/rental_invoices_index.rb
253
+ - lib/getaround-api/models/rental_messages_index.rb
254
+ - lib/getaround-api/models/rentals_booked.rb
255
+ - lib/getaround-api/models/rentals_canceled.rb
256
+ - lib/getaround-api/models/rentals_car_checked_in.rb
257
+ - lib/getaround-api/models/rentals_car_checked_out.rb
258
+ - lib/getaround-api/models/rentals_car_switched.rb
259
+ - lib/getaround-api/models/rentals_index.rb
260
+ - lib/getaround-api/models/rentals_times_changed.rb
261
+ - lib/getaround-api/models/starts_at.rb
262
+ - lib/getaround-api/models/unavailabilities_created.rb
263
+ - lib/getaround-api/models/unavailabilities_deleted.rb
264
+ - lib/getaround-api/models/unavailabilities_index.rb
265
+ - lib/getaround-api/models/unavailability.rb
266
+ - lib/getaround-api/models/user.rb
267
+ - lib/getaround-api/models/users_updated.rb
268
+ - lib/getaround-api/models/webhook.rb
269
+ - lib/getaround-api/version.rb
270
+ - openapi.yml
113
271
  - spec/api/cars_api_spec.rb
114
272
  - spec/api/checkins_api_spec.rb
115
273
  - spec/api/checkouts_api_spec.rb
@@ -119,46 +277,45 @@ files:
119
277
  - spec/api/rentals_api_spec.rb
120
278
  - spec/api/unavailabilities_api_spec.rb
121
279
  - spec/api/users_api_spec.rb
122
- - spec/models/getaround_car_spec.rb
123
- - spec/models/getaround_cars_index_inner_spec.rb
124
- - spec/models/getaround_checkin_spec.rb
125
- - spec/models/getaround_checkins_index_inner_spec.rb
126
- - spec/models/getaround_checkout_spec.rb
127
- - spec/models/getaround_create_messages_request_spec.rb
128
- - spec/models/getaround_create_unavailabilities_request_spec.rb
129
- - spec/models/getaround_destroy_unavailability_request_spec.rb
130
- - spec/models/getaround_invoice_charges_inner_spec.rb
131
- - spec/models/getaround_invoice_spec.rb
132
- - spec/models/getaround_invoices_index_inner_spec.rb
133
- - spec/models/getaround_message_spec.rb
134
- - spec/models/getaround_messages_sent_all_of_data_spec.rb
135
- - spec/models/getaround_messages_sent_spec.rb
136
- - spec/models/getaround_payout_invoices_inner_spec.rb
137
- - spec/models/getaround_payout_spec.rb
138
- - spec/models/getaround_payouts_index_inner_spec.rb
139
- - spec/models/getaround_reason_spec.rb
140
- - spec/models/getaround_rental_invoices_index_inner_spec.rb
141
- - spec/models/getaround_rental_messages_index_inner_spec.rb
142
- - spec/models/getaround_rental_spec.rb
143
- - spec/models/getaround_rentals_booked_all_of_data_spec.rb
144
- - spec/models/getaround_rentals_booked_spec.rb
145
- - spec/models/getaround_rentals_canceled_spec.rb
146
- - spec/models/getaround_rentals_car_checked_in_spec.rb
147
- - spec/models/getaround_rentals_car_checked_out_spec.rb
148
- - spec/models/getaround_rentals_car_switched_spec.rb
149
- - spec/models/getaround_rentals_index_inner_spec.rb
150
- - spec/models/getaround_rentals_times_changed_spec.rb
151
- - spec/models/getaround_unavailabilities_created_all_of_data_spec.rb
152
- - spec/models/getaround_unavailabilities_created_spec.rb
153
- - spec/models/getaround_unavailabilities_deleted_all_of_data_spec.rb
154
- - spec/models/getaround_unavailabilities_deleted_spec.rb
155
- - spec/models/getaround_unavailability_spec.rb
156
- - spec/models/getaround_user_spec.rb
157
- - spec/models/getaround_users_updated_all_of_data_spec.rb
158
- - spec/models/getaround_users_updated_spec.rb
159
- - spec/models/getaround_webhook_spec.rb
280
+ - spec/api_client_spec.rb
281
+ - spec/base_object_spec.rb
282
+ - spec/configuration_spec.rb
283
+ - spec/models/car_id_spec.rb
284
+ - spec/models/car_id_unavailabilities_json_body_spec.rb
285
+ - spec/models/car_spec.rb
286
+ - spec/models/cars_index_spec.rb
287
+ - spec/models/checkin_spec.rb
288
+ - spec/models/checkins_index_spec.rb
289
+ - spec/models/checkout_spec.rb
290
+ - spec/models/checkouts_index_spec.rb
291
+ - spec/models/ends_at_spec.rb
292
+ - spec/models/invoice_spec.rb
293
+ - spec/models/invoices_index_spec.rb
294
+ - spec/models/message_spec.rb
295
+ - spec/models/messages_sent_spec.rb
296
+ - spec/models/payout_spec.rb
297
+ - spec/models/payouts_index_spec.rb
298
+ - spec/models/rental_id_messages_json_body_spec.rb
299
+ - spec/models/rental_invoices_index_spec.rb
300
+ - spec/models/rental_messages_index_spec.rb
301
+ - spec/models/rental_spec.rb
302
+ - spec/models/rentals_booked_spec.rb
303
+ - spec/models/rentals_canceled_spec.rb
304
+ - spec/models/rentals_car_checked_in_spec.rb
305
+ - spec/models/rentals_car_checked_out_spec.rb
306
+ - spec/models/rentals_car_switched_spec.rb
307
+ - spec/models/rentals_index_spec.rb
308
+ - spec/models/rentals_times_changed_spec.rb
309
+ - spec/models/starts_at_spec.rb
310
+ - spec/models/unavailabilities_created_spec.rb
311
+ - spec/models/unavailabilities_deleted_spec.rb
312
+ - spec/models/unavailabilities_index_spec.rb
313
+ - spec/models/unavailability_spec.rb
314
+ - spec/models/user_spec.rb
315
+ - spec/models/users_updated_spec.rb
316
+ - spec/models/webhook_spec.rb
160
317
  - spec/spec_helper.rb
161
- homepage: https://rubygems.org/gems/get_around_owner
318
+ homepage: https://openapi-generator.tech
162
319
  licenses:
163
320
  - Unlicense
164
321
  metadata: {}
@@ -191,42 +348,41 @@ test_files:
191
348
  - spec/api/unavailabilities_api_spec.rb
192
349
  - spec/api/checkouts_api_spec.rb
193
350
  - spec/api/users_api_spec.rb
194
- - spec/models/getaround_rentals_canceled_spec.rb
195
- - spec/models/getaround_invoice_charges_inner_spec.rb
196
- - spec/models/getaround_rentals_car_checked_out_spec.rb
197
- - spec/models/getaround_rental_messages_index_inner_spec.rb
198
- - spec/models/getaround_users_updated_spec.rb
199
- - spec/models/getaround_messages_sent_spec.rb
200
- - spec/models/getaround_unavailabilities_deleted_all_of_data_spec.rb
201
- - spec/models/getaround_payout_spec.rb
202
- - spec/models/getaround_checkins_index_inner_spec.rb
203
- - spec/models/getaround_unavailability_spec.rb
204
- - spec/models/getaround_invoice_spec.rb
205
- - spec/models/getaround_message_spec.rb
206
- - spec/models/getaround_create_messages_request_spec.rb
207
- - spec/models/getaround_checkout_spec.rb
208
- - spec/models/getaround_checkin_spec.rb
209
- - spec/models/getaround_users_updated_all_of_data_spec.rb
210
- - spec/models/getaround_reason_spec.rb
211
- - spec/models/getaround_unavailabilities_created_all_of_data_spec.rb
212
- - spec/models/getaround_invoices_index_inner_spec.rb
213
- - spec/models/getaround_cars_index_inner_spec.rb
214
- - spec/models/getaround_rental_invoices_index_inner_spec.rb
215
- - spec/models/getaround_car_spec.rb
216
- - spec/models/getaround_rentals_booked_all_of_data_spec.rb
217
- - spec/models/getaround_payout_invoices_inner_spec.rb
218
- - spec/models/getaround_create_unavailabilities_request_spec.rb
219
- - spec/models/getaround_payouts_index_inner_spec.rb
220
- - spec/models/getaround_destroy_unavailability_request_spec.rb
221
- - spec/models/getaround_rentals_car_checked_in_spec.rb
222
- - spec/models/getaround_rentals_times_changed_spec.rb
223
- - spec/models/getaround_user_spec.rb
224
- - spec/models/getaround_unavailabilities_deleted_spec.rb
225
- - spec/models/getaround_rental_spec.rb
226
- - spec/models/getaround_webhook_spec.rb
227
- - spec/models/getaround_rentals_booked_spec.rb
228
- - spec/models/getaround_messages_sent_all_of_data_spec.rb
229
- - spec/models/getaround_rentals_index_inner_spec.rb
230
- - spec/models/getaround_rentals_car_switched_spec.rb
231
- - spec/models/getaround_unavailabilities_created_spec.rb
351
+ - spec/api_client_spec.rb
352
+ - spec/base_object_spec.rb
353
+ - spec/configuration_spec.rb
354
+ - spec/models/webhook_spec.rb
355
+ - spec/models/rentals_canceled_spec.rb
356
+ - spec/models/checkins_index_spec.rb
357
+ - spec/models/unavailabilities_index_spec.rb
358
+ - spec/models/unavailability_spec.rb
359
+ - spec/models/rental_spec.rb
360
+ - spec/models/cars_index_spec.rb
361
+ - spec/models/car_id_spec.rb
362
+ - spec/models/invoices_index_spec.rb
363
+ - spec/models/rental_id_messages_json_body_spec.rb
364
+ - spec/models/rentals_index_spec.rb
365
+ - spec/models/checkout_spec.rb
366
+ - spec/models/rentals_car_checked_out_spec.rb
367
+ - spec/models/checkin_spec.rb
368
+ - spec/models/unavailabilities_deleted_spec.rb
369
+ - spec/models/rental_invoices_index_spec.rb
370
+ - spec/models/message_spec.rb
371
+ - spec/models/car_id_unavailabilities_json_body_spec.rb
372
+ - spec/models/unavailabilities_created_spec.rb
373
+ - spec/models/payout_spec.rb
374
+ - spec/models/starts_at_spec.rb
375
+ - spec/models/invoice_spec.rb
376
+ - spec/models/ends_at_spec.rb
377
+ - spec/models/car_spec.rb
378
+ - spec/models/rental_messages_index_spec.rb
379
+ - spec/models/payouts_index_spec.rb
380
+ - spec/models/rentals_car_switched_spec.rb
381
+ - spec/models/user_spec.rb
382
+ - spec/models/rentals_car_checked_in_spec.rb
383
+ - spec/models/messages_sent_spec.rb
384
+ - spec/models/users_updated_spec.rb
385
+ - spec/models/rentals_times_changed_spec.rb
386
+ - spec/models/checkouts_index_spec.rb
387
+ - spec/models/rentals_booked_spec.rb
232
388
  - spec/spec_helper.rb
@@ -1,82 +0,0 @@
1
- =begin
2
- #Getaround Owner API
3
-
4
- ## Quick Start The Owner API uses the JSON format, and must be accessed over a [secure connection](https://en.wikipedia.org/wiki/HTTPS). Let’s assume that the access token provided by your account manager is “TOKEN”. Here’s how to get the list of ids of all your invoices from the first week of August with a shell script: ```bash query=\"end_date=2018-08-08T00%3A00%3A00%2B00%3A00&start_date=2018-08-01T00%3A00%3A00%2B00%3A00\" curl -i \"https://api-eu.getaround.com/owner/v1/invoices?${query}\" \\ -H \"Authorization: Bearer TOKEN\" \\ -H \"Accept:application/json\" \\ -H \"Content-Type:application/json\" ``` And here’s how to get the invoice with the id 12345: ```bash curl -i \"https://api-eu.getaround.com/owner/v1/invoices/12345\" \\ -H \"Authorization: Bearer TOKEN\" \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\"\" ``` See the [endpoints section](#tag/Invoices) of this guide for details about the response format. Dates in request params should follow the ISO 8601 standard. # Authentication All requests must be authenticated with a [bearer token header](https://tools.ietf.org/html/rfc6750#section-2.1). You token will be sent to you by your account manager. Unauthenticated requests will return a 401 status. # Pagination The page number and the number of items per page can be set with the “page” and “per_page” params. For example, this request will return the second page of invoices, and 50 invoices per page: `https://api-eu.getaround.com/owner/v1/invoices?page=2&per_page=50` Both of these params are optional. The default page size is 30 items. The Getaround Owner API follows the [RFC 8288 convention](https://datatracker.ietf.org/doc/html/rfc8288) of using the `Link` header to provide the `next` page URL. Please don't build the pagination URLs yourself. The `next` page will be missing when you are requesting the last available page. Here's an example response header from requesting the second page of invoices `https://api-eu.getaround.com/owner/v1/invoices?page=2&per_page=50` ``` Link: <https://api-eu.getaround.com/owner/v1/invoices?page=3&per_page=50>; rel=\"next\" ``` # Throttling policy and Date range limitation We have throttling policy that prevents you to perform more than 100 requests per min from the same IP. Also, there is a limitation on the size of the range of dates given in params in some requests. All requests that need start_date and end_date, do not accept a range bigger than 30 days. # Webhooks Getaround can send webhook events that notify your application when certain events happen on your account. This is especially useful to follow the lifecycle of rentals, tracking for example bookings or cancellations. ### Setup To set up an endpoint, you need to define a route on your server for receiving events, and then <a href=\"mailto:owner-api@getaround.com\">ask Getaround</a> to add this URL to your account. To acknowledge receipt of a event, your endpoint must: - Return a `2xx` HTTP status code. - Be a secure `https` endpoint with a valid SSL certificate. ### Testing Once Getaround has set up the endpoint, and it is properly configured as described above, a test `ping` event can be sent by clicking the button below: <form action=\"/docs/api/owner/fire_ping_webhook\" method=\"post\"><input type=\"submit\" value=\"Send Ping Event\"></form> You should receive the following JSON payload: ```json { \"data\": { \"ping\": \"pong\" }, \"type\": \"ping\", \"occurred_at\": \"2019-04-18T08:30:05Z\" } ``` ### Retries Webhook deliveries will be attempted for up to three days with an exponential back off. After that point the delivery will be abandoned. ### Verifying Signatures Getaround will also provide you with a secret token, which is used to create a hash signature with each payload. This hash signature is passed along with each request in the headers as `X-Drivy-Signature`. Suppose you have a basic server listening to webhooks that looks like this: ```ruby require 'sinatra' require 'json' post '/payload' do push = JSON.parse(params[:payload]) \"I got some JSON: \#{push.inspect}\" end ``` The goal is to compute a hash using your secret token, and ensure that the hash from Getaround matches. Getaround uses an HMAC hexdigest to compute the hash, so you could change your server to look a little like this: ```ruby post '/payload' do request.body.rewind payload_body = request.body.read verify_signature(payload_body) push = JSON.parse(params[:payload]) \"I got some JSON: \#{push.inspect}\" end def verify_signature(payload_body) signature = 'sha1=' + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), ENV['SECRET_TOKEN'], payload_body) return halt 500, \"Signatures didn't match!\" unless Rack::Utils.secure_compare(signature, request.env['HTTP_X_DRIVY_SIGNATURE']) end ``` Obviously, your language and server implementations may differ from this code. There are a couple of important things to point out, however: No matter which implementation you use, the hash signature starts with `sha1=`, using the key of your secret token and your payload body. Using a plain `==` operator is not advised. A method like secure_compare performs a \"constant time\" string comparison, which renders it safe from certain timing attacks against regular equality operators. ### Best Practices - **Acknowledge events immediately**. If your webhook script performs complex logic, or makes network calls, it’s possible that the script would time out before Getaround sees its complete execution. Ideally, your webhook handler code (acknowledging receipt of an event by returning a `2xx` status code) is separate of any other logic you do for that event. - **Handle duplicate events**. Webhook endpoints might occasionally receive the same event more than once. We advise you to guard against duplicated event receipts by making your event processing idempotent. One way of doing this is logging the events you’ve processed, and then not processing already-logged events. - **Do not expect events in order**. Getaround does not guarantee delivery of events in the order in which they are generated. Your endpoint should therefore handle this accordingly. We do provide an `occurred_at` timestamp for each event, though, to help reconcile ordering.
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: owner-api@getaround.com
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
10
-
11
- =end
12
-
13
- require 'cgi'
14
-
15
- module GetAroundOwner
16
- class CheckinsApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Rental started for one of your cars
23
- # @param [Hash] opts the optional parameters
24
- # @option opts [GetaroundRentalsCarCheckedIn] :getaround_rentals_car_checked_in This event is triggered when a rental starts and the car has been unlocked
25
- # @return [nil]
26
- def car_checked_in_rental_post(opts = {})
27
- car_checked_in_rental_post_with_http_info(opts)
28
- nil
29
- end
30
-
31
- # Rental started for one of your cars
32
- # @param [Hash] opts the optional parameters
33
- # @option opts [GetaroundRentalsCarCheckedIn] :getaround_rentals_car_checked_in This event is triggered when a rental starts and the car has been unlocked
34
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
35
- def car_checked_in_rental_post_with_http_info(opts = {})
36
- if @api_client.config.debugging
37
- @api_client.config.logger.debug 'Calling API: CheckinsApi.car_checked_in_rental_post ...'
38
- end
39
- # resource path
40
- local_var_path = '/carCheckedInRental'
41
-
42
- # query parameters
43
- query_params = opts[:query_params] || {}
44
-
45
- # header parameters
46
- header_params = opts[:header_params] || {}
47
- # HTTP header 'Content-Type'
48
- content_type = @api_client.select_header_content_type(['application/json'])
49
- if !content_type.nil?
50
- header_params['Content-Type'] = content_type
51
- end
52
-
53
- # form parameters
54
- form_params = opts[:form_params] || {}
55
-
56
- # http body (model)
57
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'getaround_rentals_car_checked_in'])
58
-
59
- # return_type
60
- return_type = opts[:debug_return_type]
61
-
62
- # auth_names
63
- auth_names = opts[:debug_auth_names] || []
64
-
65
- new_options = opts.merge(
66
- :operation => :"CheckinsApi.car_checked_in_rental_post",
67
- :header_params => header_params,
68
- :query_params => query_params,
69
- :form_params => form_params,
70
- :body => post_body,
71
- :auth_names => auth_names,
72
- :return_type => return_type
73
- )
74
-
75
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
76
- if @api_client.config.debugging
77
- @api_client.config.logger.debug "API called: CheckinsApi#car_checked_in_rental_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
- end
79
- return data, status_code, headers
80
- end
81
- end
82
- end