get_around_owner 1.0.0 → 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 (198) hide show
  1. checksums.yaml +4 -4
  2. data/Owner API v1.json +2938 -0
  3. data/README.md +338 -181
  4. data/Rakefile +0 -2
  5. data/docs/Car.md +12 -0
  6. data/docs/CarId.md +6 -0
  7. data/docs/CarIdUnavailabilitiesJsonBody.md +9 -0
  8. data/docs/CarsApi.md +38 -79
  9. data/docs/CarsIndex.md +6 -0
  10. data/docs/Checkin.md +10 -0
  11. data/docs/CheckinsApi.md +76 -33
  12. data/docs/CheckinsIndex.md +6 -0
  13. data/docs/Checkout.md +11 -0
  14. data/docs/CheckoutsApi.md +76 -33
  15. data/docs/CheckoutsIndex.md +6 -0
  16. data/docs/EndsAt.md +6 -0
  17. data/docs/Invoice.md +15 -0
  18. data/docs/InvoicesApi.md +62 -124
  19. data/docs/InvoicesIndex.md +6 -0
  20. data/docs/Message.md +11 -0
  21. data/docs/MessagesApi.md +122 -31
  22. data/docs/MessagesSent.md +6 -0
  23. data/docs/Payout.md +12 -0
  24. data/docs/PayoutsApi.md +42 -83
  25. data/docs/PayoutsIndex.md +6 -0
  26. data/docs/Rental.md +14 -0
  27. data/docs/RentalIdMessagesJsonBody.md +7 -0
  28. data/docs/RentalInvoicesIndex.md +6 -0
  29. data/docs/RentalMessagesIndex.md +6 -0
  30. data/docs/RentalsApi.md +54 -203
  31. data/docs/RentalsBooked.md +6 -0
  32. data/docs/RentalsCanceled.md +6 -0
  33. data/docs/RentalsCarCheckedIn.md +6 -0
  34. data/docs/RentalsCarCheckedOut.md +6 -0
  35. data/docs/RentalsCarSwitched.md +6 -0
  36. data/docs/RentalsIndex.md +6 -0
  37. data/docs/RentalsTimesChanged.md +6 -0
  38. data/docs/StartsAt.md +6 -0
  39. data/docs/UnavailabilitiesApi.md +100 -68
  40. data/docs/UnavailabilitiesCreated.md +6 -0
  41. data/docs/UnavailabilitiesDeleted.md +6 -0
  42. data/docs/UnavailabilitiesIndex.md +6 -0
  43. data/docs/Unavailability.md +10 -0
  44. data/docs/User.md +19 -0
  45. data/docs/UsersApi.md +27 -41
  46. data/docs/UsersUpdated.md +6 -0
  47. data/docs/Webhook.md +9 -0
  48. data/get_around_owner-1.0.0.gem +0 -0
  49. data/get_around_owner-1.0.1.gem +0 -0
  50. data/get_around_owner.gemspec +16 -3
  51. data/getaround-api.gemspec +38 -0
  52. data/git_push.sh +9 -11
  53. data/lib/{get_around_owner → getaround-api}/api/cars_api.rb +25 -41
  54. data/lib/getaround-api/api/checkins_api.rb +146 -0
  55. data/lib/getaround-api/api/checkouts_api.rb +146 -0
  56. data/lib/{get_around_owner → getaround-api}/api/invoices_api.rb +43 -66
  57. data/lib/getaround-api/api/messages_api.rb +198 -0
  58. data/lib/{get_around_owner → getaround-api}/api/payouts_api.rb +29 -45
  59. data/lib/getaround-api/api/rentals_api.rb +146 -0
  60. data/lib/getaround-api/api/unavailabilities_api.rb +208 -0
  61. data/lib/{get_around_owner/api/messages_api.rb → getaround-api/api/users_api.rb} +31 -37
  62. data/lib/{get_around_owner → getaround-api}/api_client.rb +71 -77
  63. data/lib/{get_around_owner → getaround-api}/api_error.rb +5 -6
  64. data/lib/{get_around_owner → getaround-api}/configuration.rb +13 -106
  65. data/lib/{get_around_owner/models/getaround_car.rb → getaround-api/models/car.rb} +36 -56
  66. data/lib/{get_around_owner/models/getaround_users_updated_all_of_data.rb → getaround-api/models/car_id.rb} +33 -50
  67. data/lib/{get_around_owner/models/getaround_destroy_unavailability_request.rb → getaround-api/models/car_id_unavailabilities_json_body.rb} +45 -47
  68. data/lib/{get_around_owner/models/getaround_rentals_booked_all_of_data.rb → getaround-api/models/cars_index.rb} +33 -50
  69. data/lib/{get_around_owner/models/getaround_checkin.rb → getaround-api/models/checkin.rb} +34 -65
  70. data/lib/{get_around_owner/models/getaround_rentals_index_inner.rb → getaround-api/models/checkins_index.rb} +32 -58
  71. data/lib/{get_around_owner/models/getaround_checkout.rb → getaround-api/models/checkout.rb} +35 -70
  72. data/lib/getaround-api/models/checkouts_index.rb +197 -0
  73. data/lib/getaround-api/models/ends_at.rb +198 -0
  74. data/lib/{get_around_owner/models/getaround_invoice.rb → getaround-api/models/invoice.rb} +45 -113
  75. data/lib/getaround-api/models/invoices_index.rb +198 -0
  76. data/lib/{get_around_owner/models/getaround_message.rb → getaround-api/models/message.rb} +35 -53
  77. data/lib/getaround-api/models/messages_sent.rb +197 -0
  78. data/lib/{get_around_owner/models/getaround_payout.rb → getaround-api/models/payout.rb} +37 -101
  79. data/lib/getaround-api/models/payouts_index.rb +198 -0
  80. data/lib/{get_around_owner/models/getaround_rental.rb → getaround-api/models/rental.rb} +38 -100
  81. data/lib/{get_around_owner/models/getaround_create_messages_request.rb → getaround-api/models/rental_id_messages_json_body.rb} +31 -41
  82. data/lib/getaround-api/models/rental_invoices_index.rb +198 -0
  83. data/lib/getaround-api/models/rental_messages_index.rb +198 -0
  84. data/lib/getaround-api/models/rentals_booked.rb +197 -0
  85. data/lib/getaround-api/models/rentals_canceled.rb +197 -0
  86. data/lib/getaround-api/models/rentals_car_checked_in.rb +197 -0
  87. data/lib/getaround-api/models/rentals_car_checked_out.rb +197 -0
  88. data/lib/getaround-api/models/rentals_car_switched.rb +197 -0
  89. data/lib/getaround-api/models/rentals_index.rb +198 -0
  90. data/lib/getaround-api/models/rentals_times_changed.rb +197 -0
  91. data/lib/getaround-api/models/starts_at.rb +198 -0
  92. data/lib/{get_around_owner/models/getaround_cars_index_inner.rb → getaround-api/models/unavailabilities_created.rb} +32 -58
  93. data/lib/getaround-api/models/unavailabilities_deleted.rb +197 -0
  94. data/lib/getaround-api/models/unavailabilities_index.rb +198 -0
  95. data/lib/{get_around_owner/models/getaround_unavailabilities_created_all_of_data.rb → getaround-api/models/unavailability.rb} +51 -65
  96. data/lib/{get_around_owner/models/getaround_user.rb → getaround-api/models/user.rb} +43 -75
  97. data/lib/getaround-api/models/users_updated.rb +197 -0
  98. data/lib/{get_around_owner/models/getaround_webhook.rb → getaround-api/models/webhook.rb} +38 -47
  99. data/lib/{get_around_owner → getaround-api}/version.rb +5 -6
  100. data/lib/getaround-api.rb +81 -0
  101. data/openapi.yml +2298 -0
  102. data/spec/api/cars_api_spec.rb +13 -14
  103. data/spec/api/checkins_api_spec.rb +13 -14
  104. data/spec/api/checkouts_api_spec.rb +13 -14
  105. data/spec/api/invoices_api_spec.rb +19 -20
  106. data/spec/api/messages_api_spec.rb +14 -15
  107. data/spec/api/payouts_api_spec.rb +13 -14
  108. data/spec/api/rentals_api_spec.rb +13 -14
  109. data/spec/api/unavailabilities_api_spec.rb +14 -16
  110. data/spec/api/users_api_spec.rb +9 -10
  111. data/spec/api_client_spec.rb +225 -0
  112. data/spec/base_object_spec.rb +109 -0
  113. data/spec/{models/getaround_checkins_index_inner_spec.rb → configuration_spec.rb} +26 -21
  114. data/spec/models/{getaround_reason_spec.rb → car_id_spec.rb} +18 -14
  115. data/spec/models/{getaround_unavailabilities_deleted_all_of_data_spec.rb → car_id_unavailabilities_json_body_spec.rb} +24 -20
  116. data/spec/models/{getaround_car_spec.rb → car_spec.rb} +24 -20
  117. data/spec/models/cars_index_spec.rb +34 -0
  118. data/spec/models/{getaround_checkin_spec.rb → checkin_spec.rb} +22 -18
  119. data/spec/models/checkins_index_spec.rb +34 -0
  120. data/spec/models/{getaround_checkout_spec.rb → checkout_spec.rb} +23 -19
  121. data/spec/models/checkouts_index_spec.rb +34 -0
  122. data/spec/models/ends_at_spec.rb +34 -0
  123. data/spec/models/{getaround_invoice_spec.rb → invoice_spec.rb} +27 -31
  124. data/spec/models/invoices_index_spec.rb +34 -0
  125. data/spec/models/{getaround_message_spec.rb → message_spec.rb} +23 -19
  126. data/spec/models/messages_sent_spec.rb +34 -0
  127. data/spec/models/{getaround_payout_spec.rb → payout_spec.rb} +24 -24
  128. data/spec/models/payouts_index_spec.rb +34 -0
  129. data/spec/models/{getaround_create_messages_request_spec.rb → rental_id_messages_json_body_spec.rb} +19 -15
  130. data/spec/models/{getaround_rentals_index_inner_spec.rb → rental_invoices_index_spec.rb} +16 -18
  131. data/spec/models/rental_messages_index_spec.rb +34 -0
  132. data/spec/models/{getaround_rental_spec.rb → rental_spec.rb} +26 -22
  133. data/spec/models/rentals_booked_spec.rb +34 -0
  134. data/spec/models/rentals_canceled_spec.rb +34 -0
  135. data/spec/models/rentals_car_checked_in_spec.rb +34 -0
  136. data/spec/models/rentals_car_checked_out_spec.rb +34 -0
  137. data/spec/models/rentals_car_switched_spec.rb +34 -0
  138. data/spec/models/rentals_index_spec.rb +34 -0
  139. data/spec/models/rentals_times_changed_spec.rb +34 -0
  140. data/spec/models/starts_at_spec.rb +34 -0
  141. data/spec/models/{getaround_cars_index_inner_spec.rb → unavailabilities_created_spec.rb} +16 -18
  142. data/spec/models/{getaround_payouts_index_inner_spec.rb → unavailabilities_deleted_spec.rb} +16 -18
  143. data/spec/models/unavailabilities_index_spec.rb +34 -0
  144. data/spec/models/{getaround_unavailabilities_created_all_of_data_spec.rb → unavailability_spec.rb} +22 -18
  145. data/spec/models/{getaround_user_spec.rb → user_spec.rb} +31 -27
  146. data/spec/models/users_updated_spec.rb +34 -0
  147. data/spec/models/{getaround_webhook_spec.rb → webhook_spec.rb} +21 -17
  148. data/spec/spec_helper.rb +5 -6
  149. metadata +237 -132
  150. data/lib/get_around_owner/api/checkins_api.rb +0 -82
  151. data/lib/get_around_owner/api/checkouts_api.rb +0 -82
  152. data/lib/get_around_owner/api/rentals_api.rb +0 -262
  153. data/lib/get_around_owner/api/unavailabilities_api.rb +0 -142
  154. data/lib/get_around_owner/api/users_api.rb +0 -82
  155. data/lib/get_around_owner/models/getaround_checkins_index_inner.rb +0 -222
  156. data/lib/get_around_owner/models/getaround_create_unavailabilities_request.rb +0 -283
  157. data/lib/get_around_owner/models/getaround_invoice_charges_inner.rb +0 -225
  158. data/lib/get_around_owner/models/getaround_invoices_index_inner.rb +0 -223
  159. data/lib/get_around_owner/models/getaround_messages_sent.rb +0 -257
  160. data/lib/get_around_owner/models/getaround_messages_sent_all_of_data.rb +0 -225
  161. data/lib/get_around_owner/models/getaround_payout_invoices_inner.rb +0 -223
  162. data/lib/get_around_owner/models/getaround_payouts_index_inner.rb +0 -223
  163. data/lib/get_around_owner/models/getaround_reason.rb +0 -45
  164. data/lib/get_around_owner/models/getaround_rental_invoices_index_inner.rb +0 -223
  165. data/lib/get_around_owner/models/getaround_rental_messages_index_inner.rb +0 -223
  166. data/lib/get_around_owner/models/getaround_rentals_booked.rb +0 -257
  167. data/lib/get_around_owner/models/getaround_rentals_canceled.rb +0 -257
  168. data/lib/get_around_owner/models/getaround_rentals_car_checked_in.rb +0 -257
  169. data/lib/get_around_owner/models/getaround_rentals_car_checked_out.rb +0 -257
  170. data/lib/get_around_owner/models/getaround_rentals_car_switched.rb +0 -257
  171. data/lib/get_around_owner/models/getaround_rentals_times_changed.rb +0 -257
  172. data/lib/get_around_owner/models/getaround_unavailabilities_created.rb +0 -257
  173. data/lib/get_around_owner/models/getaround_unavailabilities_deleted.rb +0 -257
  174. data/lib/get_around_owner/models/getaround_unavailabilities_deleted_all_of_data.rb +0 -235
  175. data/lib/get_around_owner/models/getaround_unavailability.rb +0 -302
  176. data/lib/get_around_owner/models/getaround_users_updated.rb +0 -257
  177. data/lib/get_around_owner.rb +0 -86
  178. data/spec/models/getaround_create_unavailabilities_request_spec.rb +0 -52
  179. data/spec/models/getaround_destroy_unavailability_request_spec.rb +0 -42
  180. data/spec/models/getaround_invoice_charges_inner_spec.rb +0 -42
  181. data/spec/models/getaround_invoices_index_inner_spec.rb +0 -36
  182. data/spec/models/getaround_messages_sent_all_of_data_spec.rb +0 -42
  183. data/spec/models/getaround_messages_sent_spec.rb +0 -48
  184. data/spec/models/getaround_payout_invoices_inner_spec.rb +0 -36
  185. data/spec/models/getaround_rental_invoices_index_inner_spec.rb +0 -36
  186. data/spec/models/getaround_rental_messages_index_inner_spec.rb +0 -36
  187. data/spec/models/getaround_rentals_booked_all_of_data_spec.rb +0 -36
  188. data/spec/models/getaround_rentals_booked_spec.rb +0 -48
  189. data/spec/models/getaround_rentals_canceled_spec.rb +0 -48
  190. data/spec/models/getaround_rentals_car_checked_in_spec.rb +0 -48
  191. data/spec/models/getaround_rentals_car_checked_out_spec.rb +0 -48
  192. data/spec/models/getaround_rentals_car_switched_spec.rb +0 -48
  193. data/spec/models/getaround_rentals_times_changed_spec.rb +0 -48
  194. data/spec/models/getaround_unavailabilities_created_spec.rb +0 -48
  195. data/spec/models/getaround_unavailabilities_deleted_spec.rb +0 -48
  196. data/spec/models/getaround_unavailability_spec.rb +0 -58
  197. data/spec/models/getaround_users_updated_all_of_data_spec.rb +0 -36
  198. data/spec/models/getaround_users_updated_spec.rb +0 -48
@@ -2,60 +2,95 @@
2
2
 
3
3
  All URIs are relative to *https://api-eu.getaround.com/owner/v1*
4
4
 
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**created_unavailability_post**](UnavailabilitiesApi.md#created_unavailability_post) | **POST** /createdUnavailability | Unavailability created on one of your cars |
8
- | [**deleted_unavailability_post**](UnavailabilitiesApi.md#deleted_unavailability_post) | **POST** /deletedUnavailability | Unavailabilities deleted on one of your cars |
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**create_unavailabilities**](UnavailabilitiesApi.md#create_unavailabilities) | **POST** /cars/{car_id}/unavailabilities.json | Create Unavailability related to a car between dates
8
+ [**destroy_unavailability**](UnavailabilitiesApi.md#destroy_unavailability) | **DELETE** /cars/{car_id}/unavailabilities.json | Destroy Unavailability related to a car between dates
9
+ [**get_unavailabilities_for_car**](UnavailabilitiesApi.md#get_unavailabilities_for_car) | **GET** /cars/{car_id}/unavailabilities.json | Find Unavailabilities related to a car between dates
9
10
 
11
+ # **create_unavailabilities**
12
+ > create_unavailabilities(car_id, opts)
10
13
 
11
- ## created_unavailability_post
14
+ Create Unavailability related to a car between dates
12
15
 
13
- > created_unavailability_post(opts)
14
-
15
- Unavailability created on one of your cars
16
-
17
- ### Examples
16
+ Set a car as unavailable between 2 dates
18
17
 
18
+ ### Example
19
19
  ```ruby
20
- require 'time'
21
- require 'get_around_owner'
20
+ # load the gem
21
+ require 'getaround-api'
22
+ # setup authorization
23
+ GetAroundOwner.configure do |config|
24
+ end
22
25
 
23
26
  api_instance = GetAroundOwner::UnavailabilitiesApi.new
24
- opts = {
25
- getaround_unavailabilities_created: # GetaroundUnavailabilitiesCreated | This event is triggered whenever an unavailability is created (through the API or directly in the app/website). It shows the unavailability that has just been created, with the same timestamps as those entered by the user. It does not show the changes of other potential overlapping unavailabilities. For example: if an unavailability was already set between June 10 and June 20, and if the user creates a new one between June 18 and June 22, this webhook will only send information about the newly created June 18 - June 22 unavailability. It will not show that, under the hood, the unavailability from June 10 to June 20 has be deleted, and that a new unavailability from June 10 to June 22 has been created.
27
+ car_id = GetAroundOwner::null.new # | ID of car
28
+ opts = {
29
+ body: GetAroundOwner::CarIdUnavailabilitiesJsonBody.new # CarIdUnavailabilitiesJsonBody | Unavailability to create
26
30
  }
27
31
 
28
32
  begin
29
- # Unavailability created on one of your cars
30
- api_instance.created_unavailability_post(opts)
33
+ #Create Unavailability related to a car between dates
34
+ api_instance.create_unavailabilities(car_id, opts)
31
35
  rescue GetAroundOwner::ApiError => e
32
- puts "Error when calling UnavailabilitiesApi->created_unavailability_post: #{e}"
36
+ puts "Exception when calling UnavailabilitiesApi->create_unavailabilities: #{e}"
33
37
  end
34
38
  ```
35
39
 
36
- #### Using the created_unavailability_post_with_http_info variant
40
+ ### Parameters
41
+
42
+ Name | Type | Description | Notes
43
+ ------------- | ------------- | ------------- | -------------
44
+ **car_id** | [****](.md)| ID of car |
45
+ **body** | [**CarIdUnavailabilitiesJsonBody**](CarIdUnavailabilitiesJsonBody.md)| Unavailability to create | [optional]
46
+
47
+ ### Return type
48
+
49
+ nil (empty response body)
50
+
51
+ ### Authorization
52
+
53
+ [bearerAuth](../README.md#bearerAuth)
54
+
55
+ ### HTTP request headers
56
+
57
+ - **Content-Type**: application/json
58
+ - **Accept**: Not defined
59
+
60
+
61
+
62
+ # **destroy_unavailability**
63
+ > destroy_unavailability(car_id)
37
64
 
38
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
65
+ Destroy Unavailability related to a car between dates
39
66
 
40
- > <Array(nil, Integer, Hash)> created_unavailability_post_with_http_info(opts)
67
+ Set a car as available between 2 dates
41
68
 
69
+ ### Example
42
70
  ```ruby
71
+ # load the gem
72
+ require 'getaround-api'
73
+ # setup authorization
74
+ GetAroundOwner.configure do |config|
75
+ end
76
+
77
+ api_instance = GetAroundOwner::UnavailabilitiesApi.new
78
+ car_id = GetAroundOwner::null.new # | ID of car
79
+
80
+
43
81
  begin
44
- # Unavailability created on one of your cars
45
- data, status_code, headers = api_instance.created_unavailability_post_with_http_info(opts)
46
- p status_code # => 2xx
47
- p headers # => { ... }
48
- p data # => nil
82
+ #Destroy Unavailability related to a car between dates
83
+ api_instance.destroy_unavailability(car_id)
49
84
  rescue GetAroundOwner::ApiError => e
50
- puts "Error when calling UnavailabilitiesApi->created_unavailability_post_with_http_info: #{e}"
85
+ puts "Exception when calling UnavailabilitiesApi->destroy_unavailability: #{e}"
51
86
  end
52
87
  ```
53
88
 
54
89
  ### Parameters
55
90
 
56
- | Name | Type | Description | Notes |
57
- | ---- | ---- | ----------- | ----- |
58
- | **getaround_unavailabilities_created** | [**GetaroundUnavailabilitiesCreated**](GetaroundUnavailabilitiesCreated.md) | This event is triggered whenever an unavailability is created (through the API or directly in the app/website). It shows the unavailability that has just been created, with the same timestamps as those entered by the user. It does not show the changes of other potential overlapping unavailabilities. For example: if an unavailability was already set between June 10 and June 20, and if the user creates a new one between June 18 and June 22, this webhook will only send information about the newly created June 18 - June 22 unavailability. It will not show that, under the hood, the unavailability from June 10 to June 20 has be deleted, and that a new unavailability from June 10 to June 22 has been created. | [optional] |
91
+ Name | Type | Description | Notes
92
+ ------------- | ------------- | ------------- | -------------
93
+ **car_id** | [****](.md)| ID of car |
59
94
 
60
95
  ### Return type
61
96
 
@@ -63,73 +98,70 @@ nil (empty response body)
63
98
 
64
99
  ### Authorization
65
100
 
66
- No authorization required
101
+ [bearerAuth](../README.md#bearerAuth)
67
102
 
68
103
  ### HTTP request headers
69
104
 
70
- - **Content-Type**: application/json
71
- - **Accept**: Not defined
105
+ - **Content-Type**: Not defined
106
+ - **Accept**: Not defined
72
107
 
73
108
 
74
- ## deleted_unavailability_post
75
109
 
76
- > deleted_unavailability_post(opts)
110
+ # **get_unavailabilities_for_car**
111
+ > UnavailabilitiesIndex get_unavailabilities_for_car(start_date, end_date, car_id, opts)
77
112
 
78
- Unavailabilities deleted on one of your cars
113
+ Find Unavailabilities related to a car between dates
79
114
 
80
- ### Examples
115
+ Find between 2 dates when you’ve set a car as unavailable
81
116
 
117
+ ### Example
82
118
  ```ruby
83
- require 'time'
84
- require 'get_around_owner'
119
+ # load the gem
120
+ require 'getaround-api'
121
+ # setup authorization
122
+ GetAroundOwner.configure do |config|
123
+ end
85
124
 
86
125
  api_instance = GetAroundOwner::UnavailabilitiesApi.new
87
- opts = {
88
- getaround_unavailabilities_deleted: # GetaroundUnavailabilitiesDeleted | This event is triggered whenever an unavailability is deleted (through the API or directly in the app/website). It shows the unavailability that has just been deleted, with the same timestamps as those entered by the user. It does not show the changes of other potential overlapping unavailabilities. For example: if an unavailability was already set between June 10 and June 20, and if the user deletes an unavailability between June 18 and June 22 (to set their car as available between this dates), this webhook will only send information about the newly deleted June 18 - June 22 unavailability. It will not show that, under the hood, the unavailability from June 10 to June 20 has be deleted, and that a new unavailability from June 10 to June 18 has been created.
126
+ start_date = GetAroundOwner::null.new # | Start date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)
127
+ end_date = GetAroundOwner::null.new # | End date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html)
128
+ car_id = GetAroundOwner::null.new # | ID of the car
129
+ opts = {
130
+ page: GetAroundOwner::null.new, # | Page number
131
+ per_page: GetAroundOwner::null.new # | Page size
89
132
  }
90
133
 
91
134
  begin
92
- # Unavailabilities deleted on one of your cars
93
- api_instance.deleted_unavailability_post(opts)
94
- rescue GetAroundOwner::ApiError => e
95
- puts "Error when calling UnavailabilitiesApi->deleted_unavailability_post: #{e}"
96
- end
97
- ```
98
-
99
- #### Using the deleted_unavailability_post_with_http_info variant
100
-
101
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
102
-
103
- > <Array(nil, Integer, Hash)> deleted_unavailability_post_with_http_info(opts)
104
-
105
- ```ruby
106
- begin
107
- # Unavailabilities deleted on one of your cars
108
- data, status_code, headers = api_instance.deleted_unavailability_post_with_http_info(opts)
109
- p status_code # => 2xx
110
- p headers # => { ... }
111
- p data # => nil
135
+ #Find Unavailabilities related to a car between dates
136
+ result = api_instance.get_unavailabilities_for_car(start_date, end_date, car_id, opts)
137
+ p result
112
138
  rescue GetAroundOwner::ApiError => e
113
- puts "Error when calling UnavailabilitiesApi->deleted_unavailability_post_with_http_info: #{e}"
139
+ puts "Exception when calling UnavailabilitiesApi->get_unavailabilities_for_car: #{e}"
114
140
  end
115
141
  ```
116
142
 
117
143
  ### Parameters
118
144
 
119
- | Name | Type | Description | Notes |
120
- | ---- | ---- | ----------- | ----- |
121
- | **getaround_unavailabilities_deleted** | [**GetaroundUnavailabilitiesDeleted**](GetaroundUnavailabilitiesDeleted.md) | This event is triggered whenever an unavailability is deleted (through the API or directly in the app/website). It shows the unavailability that has just been deleted, with the same timestamps as those entered by the user. It does not show the changes of other potential overlapping unavailabilities. For example: if an unavailability was already set between June 10 and June 20, and if the user deletes an unavailability between June 18 and June 22 (to set their car as available between this dates), this webhook will only send information about the newly deleted June 18 - June 22 unavailability. It will not show that, under the hood, the unavailability from June 10 to June 20 has be deleted, and that a new unavailability from June 10 to June 18 has been created. | [optional] |
145
+ Name | Type | Description | Notes
146
+ ------------- | ------------- | ------------- | -------------
147
+ **start_date** | [****](.md)| Start date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html) |
148
+ **end_date** | [****](.md)| End date and time in [ISO8601 format](https://www.iso.org/iso-8601-date-and-time-format.html) |
149
+ **car_id** | [****](.md)| ID of the car |
150
+ **page** | [****](.md)| Page number | [optional]
151
+ **per_page** | [****](.md)| Page size | [optional] [default to 30]
122
152
 
123
153
  ### Return type
124
154
 
125
- nil (empty response body)
155
+ [**UnavailabilitiesIndex**](UnavailabilitiesIndex.md)
126
156
 
127
157
  ### Authorization
128
158
 
129
- No authorization required
159
+ [bearerAuth](../README.md#bearerAuth)
130
160
 
131
161
  ### HTTP request headers
132
162
 
133
- - **Content-Type**: application/json
134
- - **Accept**: Not defined
163
+ - **Content-Type**: Not defined
164
+ - **Accept**: application/json
165
+
166
+
135
167
 
@@ -0,0 +1,6 @@
1
+ # GetAroundOwner::UnavailabilitiesCreated
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
@@ -0,0 +1,6 @@
1
+ # GetAroundOwner::UnavailabilitiesDeleted
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
@@ -0,0 +1,6 @@
1
+ # GetAroundOwner::UnavailabilitiesIndex
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
@@ -0,0 +1,10 @@
1
+ # GetAroundOwner::Unavailability
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **car_id** | [****](.md) | ID of the related car |
7
+ **starts_at** | [****](.md) | The ISO8601 formatted beginning of the unavailability&#x27;s period |
8
+ **ends_at** | [****](.md) | The ISO8601 formatted ending of the unavailability&#x27;s period |
9
+ **reason** | [****](.md) | The reason of the unavailability of the car. | [optional]
10
+
data/docs/User.md ADDED
@@ -0,0 +1,19 @@
1
+ # GetAroundOwner::User
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **id** | [****](.md) | The user ID |
7
+ **first_name** | [****](.md) | First name(s) |
8
+ **last_name** | [****](.md) | Last name(s) |
9
+ **phone_number** | [****](.md) | The phone number in international format |
10
+ **address_line1** | [****](.md) | Residential address of the user |
11
+ **address_line2** | [****](.md) | Additional address details | [optional]
12
+ **postal_code** | [****](.md) | The postal code |
13
+ **city** | [****](.md) | The city |
14
+ **country** | [****](.md) | Address&#x27;s country format ISO_3166-1_alpha-2 (ex: FR, ES, ...) |
15
+ **birth_date** | [****](.md) | The birth date |
16
+ **license_country** | [****](.md) | Driving licence country of issue format ISO_3166-1_alpha-2 (ex: FR, ES, ...) |
17
+ **license_first_issue_date** | [****](.md) | Driving licence first issue date |
18
+ **license_number** | [****](.md) | The license number |
19
+
data/docs/UsersApi.md CHANGED
@@ -2,70 +2,56 @@
2
2
 
3
3
  All URIs are relative to *https://api-eu.getaround.com/owner/v1*
4
4
 
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**updated_user_post**](UsersApi.md#updated_user_post) | **POST** /updatedUser | User updated his profile information |
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**get_user_by_id**](UsersApi.md#get_user_by_id) | **GET** /users/{id}.json | Find a user by ID (Users are customers who rent one of your cars)
8
8
 
9
+ # **get_user_by_id**
10
+ > User get_user_by_id(id)
9
11
 
10
- ## updated_user_post
12
+ Find a user by ID (Users are customers who rent one of your cars)
11
13
 
12
- > updated_user_post(opts)
13
-
14
- User updated his profile information
15
-
16
- ### Examples
14
+ Find a user by ID (Users are customers who rent one of your cars)
17
15
 
16
+ ### Example
18
17
  ```ruby
19
- require 'time'
20
- require 'get_around_owner'
21
-
22
- api_instance = GetAroundOwner::UsersApi.new
23
- opts = {
24
- getaround_users_updated: # GetaroundUsersUpdated | This event is triggered when a user updates his profile information (You will only receive this event on users with a booked rental or a started rental).
25
- }
26
-
27
- begin
28
- # User updated his profile information
29
- api_instance.updated_user_post(opts)
30
- rescue GetAroundOwner::ApiError => e
31
- puts "Error when calling UsersApi->updated_user_post: #{e}"
18
+ # load the gem
19
+ require 'getaround-api'
20
+ # setup authorization
21
+ GetAroundOwner.configure do |config|
32
22
  end
33
- ```
34
-
35
- #### Using the updated_user_post_with_http_info variant
36
23
 
37
- This returns an Array which contains the response data (`nil` in this case), status code and headers.
24
+ api_instance = GetAroundOwner::UsersApi.new
25
+ id = GetAroundOwner::null.new # | ID of user to return
38
26
 
39
- > <Array(nil, Integer, Hash)> updated_user_post_with_http_info(opts)
40
27
 
41
- ```ruby
42
28
  begin
43
- # User updated his profile information
44
- data, status_code, headers = api_instance.updated_user_post_with_http_info(opts)
45
- p status_code # => 2xx
46
- p headers # => { ... }
47
- p data # => nil
29
+ #Find a user by ID (Users are customers who rent one of your cars)
30
+ result = api_instance.get_user_by_id(id)
31
+ p result
48
32
  rescue GetAroundOwner::ApiError => e
49
- puts "Error when calling UsersApi->updated_user_post_with_http_info: #{e}"
33
+ puts "Exception when calling UsersApi->get_user_by_id: #{e}"
50
34
  end
51
35
  ```
52
36
 
53
37
  ### Parameters
54
38
 
55
- | Name | Type | Description | Notes |
56
- | ---- | ---- | ----------- | ----- |
57
- | **getaround_users_updated** | [**GetaroundUsersUpdated**](GetaroundUsersUpdated.md) | This event is triggered when a user updates his profile information (You will only receive this event on users with a booked rental or a started rental). | [optional] |
39
+ Name | Type | Description | Notes
40
+ ------------- | ------------- | ------------- | -------------
41
+ **id** | [****](.md)| ID of user to return |
58
42
 
59
43
  ### Return type
60
44
 
61
- nil (empty response body)
45
+ [**User**](User.md)
62
46
 
63
47
  ### Authorization
64
48
 
65
- No authorization required
49
+ [bearerAuth](../README.md#bearerAuth)
66
50
 
67
51
  ### HTTP request headers
68
52
 
69
- - **Content-Type**: application/json
70
- - **Accept**: Not defined
53
+ - **Content-Type**: Not defined
54
+ - **Accept**: application/json
55
+
56
+
71
57
 
@@ -0,0 +1,6 @@
1
+ # GetAroundOwner::UsersUpdated
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
data/docs/Webhook.md ADDED
@@ -0,0 +1,9 @@
1
+ # GetAroundOwner::Webhook
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **type** | [****](.md) | The webhook event type |
7
+ **data** | [****](.md) | The webhook event data |
8
+ **occurred_at** | [****](.md) | The webhook event occurred at timestamp |
9
+
Binary file
Binary file
@@ -1,16 +1,29 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
+ =begin
4
+ #Getaround Owner API
5
+
6
+ ## 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.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: owner-api@getaround.com
10
+ Generated by: https://openapi-generator.tech
11
+ Generator version: 7.10.0
12
+
13
+ =end
14
+
3
15
  $:.push File.expand_path("../lib", __FILE__)
4
- require "get_around_owner/version"
16
+ require "getaround-api/version"
5
17
 
6
18
  Gem::Specification.new do |s|
7
19
  s.name = "get_around_owner"
8
20
  s.version = GetAroundOwner::VERSION
9
21
  s.platform = Gem::Platform::RUBY
10
- s.authors = ["OpenAPI-Generator", "yann120"]
22
+ s.authors = ["OpenAPI-Generator"]
23
+ s.email = ["owner-api@getaround.com"]
11
24
  s.homepage = "https://openapi-generator.tech"
12
25
  s.summary = "Getaround Owner API Ruby Gem"
13
- s.description = "Getaround Owner API Wrapper"
26
+ s.description = "# 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. "
14
27
  s.license = "Unlicense"
15
28
  s.required_ruby_version = ">= 2.7"
16
29
  s.metadata = {}
@@ -0,0 +1,38 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ =begin
4
+ #Getaround Owner API
5
+
6
+ ## 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.
7
+
8
+ OpenAPI spec version: 1.0.0
9
+ Contact: owner-api@getaround.com
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+ Swagger Codegen version: 3.0.66
12
+ =end
13
+
14
+ $:.push File.expand_path("../lib", __FILE__)
15
+ require "getaround-api/version"
16
+
17
+ Gem::Specification.new do |s|
18
+ s.name = "getaround-api"
19
+ s.version = GetAroundOwner::VERSION
20
+ s.platform = Gem::Platform::RUBY
21
+ s.authors = ["YannPETITJEAN"]
22
+ s.email = ["owner-api@getaround.com"]
23
+ s.homepage = "https://github.com/swagger-api/swagger-codegen"
24
+ s.summary = "Getaround Owner API Ruby Gem"
25
+ s.description = "# 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. "
26
+ s.license = "Unlicense"
27
+ s.required_ruby_version = ">= 1.9"
28
+
29
+ s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
30
+ s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
31
+
32
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
33
+
34
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
35
+ s.test_files = `find spec/*`.split("\n")
36
+ s.executables = []
37
+ s.require_paths = ["lib"]
38
+ end
data/git_push.sh CHANGED
@@ -1,17 +1,14 @@
1
1
  #!/bin/sh
2
+ #
3
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
4
+ #
2
5
  # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
3
6
  #
4
- # Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
7
+ # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
5
8
 
6
9
  git_user_id=$1
7
10
  git_repo_id=$2
8
11
  release_note=$3
9
- git_host=$4
10
-
11
- if [ "$git_host" = "" ]; then
12
- git_host="github.com"
13
- echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14
- fi
15
12
 
16
13
  if [ "$git_user_id" = "" ]; then
17
14
  git_user_id="GIT_USER_ID"
@@ -38,14 +35,14 @@ git add .
38
35
  git commit -m "$release_note"
39
36
 
40
37
  # Sets the new remote
41
- git_remote=$(git remote)
38
+ git_remote=`git remote`
42
39
  if [ "$git_remote" = "" ]; then # git remote not defined
43
40
 
44
41
  if [ "$GIT_TOKEN" = "" ]; then
45
42
  echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
46
- git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
43
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
47
44
  else
48
- git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
45
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
49
46
  fi
50
47
 
51
48
  fi
@@ -53,5 +50,6 @@ fi
53
50
  git pull origin master
54
51
 
55
52
  # Pushes (Forces) the changes in the local repository up to the remote repository
56
- echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
53
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
57
54
  git push origin master 2>&1 | grep -v 'To https'
55
+