license_manager 0.1.0

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 (323) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +9 -0
  4. data/LICENSE +201 -0
  5. data/README.md +96 -0
  6. data/Rakefile +10 -0
  7. data/docs/ConnectStripe.md +18 -0
  8. data/docs/CreateCustomer.md +20 -0
  9. data/docs/CreateIntegrationMapping.md +20 -0
  10. data/docs/CreateLicense.md +36 -0
  11. data/docs/CreatePolicy.md +30 -0
  12. data/docs/CreatePortalLink.md +18 -0
  13. data/docs/CreateProduct.md +20 -0
  14. data/docs/CreateProductWithPolicy.md +24 -0
  15. data/docs/CreateRelease.md +20 -0
  16. data/docs/CreateToken.md +20 -0
  17. data/docs/Customer.md +30 -0
  18. data/docs/CustomerList.md +20 -0
  19. data/docs/CustomersApi.md +385 -0
  20. data/docs/Error.md +18 -0
  21. data/docs/ErrorError.md +22 -0
  22. data/docs/ErrorErrorIssuesInner.md +20 -0
  23. data/docs/ErrorErrorIssuesInnerPathInner.md +15 -0
  24. data/docs/Event.md +34 -0
  25. data/docs/EventActor.md +55 -0
  26. data/docs/EventActorOneOf.md +26 -0
  27. data/docs/EventActorOneOf1.md +24 -0
  28. data/docs/EventActorOneOf2.md +22 -0
  29. data/docs/EventActorOneOf3.md +18 -0
  30. data/docs/EventActorOneOf4.md +22 -0
  31. data/docs/EventList.md +20 -0
  32. data/docs/EventMachine.md +22 -0
  33. data/docs/EventType.md +15 -0
  34. data/docs/EventsApi.md +173 -0
  35. data/docs/FixedMaxVersion.md +20 -0
  36. data/docs/Integration.md +38 -0
  37. data/docs/IntegrationMapping.md +38 -0
  38. data/docs/IntegrationStatus.md +15 -0
  39. data/docs/IntegrationsApi.md +587 -0
  40. data/docs/License.md +50 -0
  41. data/docs/LicenseList.md +20 -0
  42. data/docs/LicenseMaxVersion.md +22 -0
  43. data/docs/LicenseMaxVersionInput.md +22 -0
  44. data/docs/LicenseStats.md +26 -0
  45. data/docs/LicenseStatsActivationsByMachineInner.md +24 -0
  46. data/docs/LicenseStatsActivationsByVersionInner.md +20 -0
  47. data/docs/LicenseStatus.md +15 -0
  48. data/docs/LicenseToken.md +18 -0
  49. data/docs/LicensesApi.md +817 -0
  50. data/docs/ListPolicyEventsTypeParameter.md +15 -0
  51. data/docs/ListStripePrices200Response.md +18 -0
  52. data/docs/LockMaxVersion.md +22 -0
  53. data/docs/LockMaxVersionMajorAfter.md +49 -0
  54. data/docs/LockMaxVersionMajorAfterOneOf.md +20 -0
  55. data/docs/LockMaxVersionMajorAfterOneOf1.md +20 -0
  56. data/docs/LockMaxVersionMinorAfter.md +20 -0
  57. data/docs/Machine.md +36 -0
  58. data/docs/MachineList.md +20 -0
  59. data/docs/MachinesApi.md +246 -0
  60. data/docs/Pagination.md +24 -0
  61. data/docs/PoliciesApi.md +388 -0
  62. data/docs/Policy.md +40 -0
  63. data/docs/PolicyDuration.md +20 -0
  64. data/docs/PolicyList.md +20 -0
  65. data/docs/PolicyMaxVersion.md +24 -0
  66. data/docs/PolicySettings.md +24 -0
  67. data/docs/PolicySettingsDuration.md +20 -0
  68. data/docs/PolicySettingsDurationAnyOf.md +20 -0
  69. data/docs/PolicySettingsDurationAnyOf1.md +20 -0
  70. data/docs/PolicySettingsMaxVersion.md +24 -0
  71. data/docs/Portal.md +30 -0
  72. data/docs/PortalApi.md +289 -0
  73. data/docs/PortalLink.md +22 -0
  74. data/docs/PortalNotFound.md +22 -0
  75. data/docs/PortalSettings.md +26 -0
  76. data/docs/Price.md +20 -0
  77. data/docs/PriceInput.md +20 -0
  78. data/docs/Product.md +32 -0
  79. data/docs/ProductList.md +20 -0
  80. data/docs/ProductStats.md +54 -0
  81. data/docs/ProductStatsActivationsByVersionInner.md +20 -0
  82. data/docs/ProductStatsActiveMachinesByPlatformInner.md +20 -0
  83. data/docs/ProductStatsActiveMachinesByVersionInner.md +20 -0
  84. data/docs/ProductStatsNewLicensesByPolicyInner.md +22 -0
  85. data/docs/ProductsApi.md +666 -0
  86. data/docs/Release.md +28 -0
  87. data/docs/ReleaseList.md +20 -0
  88. data/docs/ReleasesApi.md +388 -0
  89. data/docs/RequestPortalLink.md +20 -0
  90. data/docs/Revenue.md +34 -0
  91. data/docs/SendLicenseKeys.md +18 -0
  92. data/docs/SendPortalLink.md +18 -0
  93. data/docs/SigningKey.md +27 -0
  94. data/docs/StripeIntegration.md +26 -0
  95. data/docs/StripePermission.md +22 -0
  96. data/docs/StripePrice.md +28 -0
  97. data/docs/Token.md +24 -0
  98. data/docs/TokensApi.md +235 -0
  99. data/docs/UpdateCustomer.md +20 -0
  100. data/docs/UpdateIntegrationMapping.md +18 -0
  101. data/docs/UpdateLicense.md +28 -0
  102. data/docs/UpdatePolicy.md +30 -0
  103. data/docs/UpdateProduct.md +22 -0
  104. data/docs/UpdateProductPortal.md +26 -0
  105. data/docs/UpdateRelease.md +20 -0
  106. data/docs/ValidateKey.md +26 -0
  107. data/docs/ValidateKeyError.md +18 -0
  108. data/docs/ValidateKeyErrorError.md +24 -0
  109. data/git_push.sh +54 -0
  110. data/lib/license_manager/api/customers_api.rb +398 -0
  111. data/lib/license_manager/api/events_api.rb +207 -0
  112. data/lib/license_manager/api/integrations_api.rb +559 -0
  113. data/lib/license_manager/api/licenses_api.rb +885 -0
  114. data/lib/license_manager/api/machines_api.rb +257 -0
  115. data/lib/license_manager/api/policies_api.rb +412 -0
  116. data/lib/license_manager/api/portal_api.rb +310 -0
  117. data/lib/license_manager/api/products_api.rb +653 -0
  118. data/lib/license_manager/api/releases_api.rb +408 -0
  119. data/lib/license_manager/api/tokens_api.rb +244 -0
  120. data/lib/license_manager/api_client.rb +441 -0
  121. data/lib/license_manager/api_error.rb +58 -0
  122. data/lib/license_manager/api_model_base.rb +88 -0
  123. data/lib/license_manager/configuration.rb +400 -0
  124. data/lib/license_manager/models/connect_stripe.rb +187 -0
  125. data/lib/license_manager/models/create_customer.rb +222 -0
  126. data/lib/license_manager/models/create_integration_mapping.rb +222 -0
  127. data/lib/license_manager/models/create_license.rb +361 -0
  128. data/lib/license_manager/models/create_policy.rb +347 -0
  129. data/lib/license_manager/models/create_portal_link.rb +196 -0
  130. data/lib/license_manager/models/create_product.rb +244 -0
  131. data/lib/license_manager/models/create_product_with_policy.rb +270 -0
  132. data/lib/license_manager/models/create_release.rb +208 -0
  133. data/lib/license_manager/models/create_token.rb +237 -0
  134. data/lib/license_manager/models/customer.rb +308 -0
  135. data/lib/license_manager/models/customer_list.rb +206 -0
  136. data/lib/license_manager/models/error.rb +177 -0
  137. data/lib/license_manager/models/error_error.rb +215 -0
  138. data/lib/license_manager/models/error_error_issues_inner.rb +205 -0
  139. data/lib/license_manager/models/error_error_issues_inner_path_inner.rb +103 -0
  140. data/lib/license_manager/models/event.rb +340 -0
  141. data/lib/license_manager/models/event_actor.rb +108 -0
  142. data/lib/license_manager/models/event_actor_one_of.rb +251 -0
  143. data/lib/license_manager/models/event_actor_one_of1.rb +239 -0
  144. data/lib/license_manager/models/event_actor_one_of2.rb +257 -0
  145. data/lib/license_manager/models/event_actor_one_of3.rb +201 -0
  146. data/lib/license_manager/models/event_actor_one_of4.rb +243 -0
  147. data/lib/license_manager/models/event_list.rb +206 -0
  148. data/lib/license_manager/models/event_machine.rb +216 -0
  149. data/lib/license_manager/models/event_type.rb +46 -0
  150. data/lib/license_manager/models/fixed_max_version.rb +240 -0
  151. data/lib/license_manager/models/integration.rb +412 -0
  152. data/lib/license_manager/models/integration_mapping.rb +435 -0
  153. data/lib/license_manager/models/integration_status.rb +42 -0
  154. data/lib/license_manager/models/license.rb +542 -0
  155. data/lib/license_manager/models/license_list.rb +206 -0
  156. data/lib/license_manager/models/license_max_version.rb +208 -0
  157. data/lib/license_manager/models/license_max_version_input.rb +202 -0
  158. data/lib/license_manager/models/license_stats.rb +292 -0
  159. data/lib/license_manager/models/license_stats_activations_by_machine_inner.rb +244 -0
  160. data/lib/license_manager/models/license_stats_activations_by_version_inner.rb +206 -0
  161. data/lib/license_manager/models/license_status.rb +42 -0
  162. data/lib/license_manager/models/license_token.rb +178 -0
  163. data/lib/license_manager/models/list_policy_events_type_parameter.rb +104 -0
  164. data/lib/license_manager/models/list_stripe_prices200_response.rb +179 -0
  165. data/lib/license_manager/models/lock_max_version.rb +240 -0
  166. data/lib/license_manager/models/lock_max_version_major_after.rb +105 -0
  167. data/lib/license_manager/models/lock_max_version_major_after_one_of.rb +245 -0
  168. data/lib/license_manager/models/lock_max_version_major_after_one_of1.rb +246 -0
  169. data/lib/license_manager/models/lock_max_version_minor_after.rb +104 -0
  170. data/lib/license_manager/models/machine.rb +383 -0
  171. data/lib/license_manager/models/machine_list.rb +206 -0
  172. data/lib/license_manager/models/pagination.rb +260 -0
  173. data/lib/license_manager/models/policy.rb +425 -0
  174. data/lib/license_manager/models/policy_duration.rb +104 -0
  175. data/lib/license_manager/models/policy_list.rb +206 -0
  176. data/lib/license_manager/models/policy_max_version.rb +104 -0
  177. data/lib/license_manager/models/policy_settings.rb +244 -0
  178. data/lib/license_manager/models/policy_settings_duration.rb +104 -0
  179. data/lib/license_manager/models/policy_settings_duration_any_of.rb +245 -0
  180. data/lib/license_manager/models/policy_settings_duration_any_of1.rb +246 -0
  181. data/lib/license_manager/models/policy_settings_max_version.rb +104 -0
  182. data/lib/license_manager/models/portal.rb +281 -0
  183. data/lib/license_manager/models/portal_link.rb +232 -0
  184. data/lib/license_manager/models/portal_not_found.rb +204 -0
  185. data/lib/license_manager/models/portal_settings.rb +304 -0
  186. data/lib/license_manager/models/price.rb +206 -0
  187. data/lib/license_manager/models/price_input.rb +224 -0
  188. data/lib/license_manager/models/product.rb +333 -0
  189. data/lib/license_manager/models/product_list.rb +206 -0
  190. data/lib/license_manager/models/product_stats.rb +682 -0
  191. data/lib/license_manager/models/product_stats_activations_by_version_inner.rb +193 -0
  192. data/lib/license_manager/models/product_stats_active_machines_by_platform_inner.rb +190 -0
  193. data/lib/license_manager/models/product_stats_active_machines_by_version_inner.rb +190 -0
  194. data/lib/license_manager/models/product_stats_new_licenses_by_policy_inner.rb +235 -0
  195. data/lib/license_manager/models/release.rb +308 -0
  196. data/lib/license_manager/models/release_list.rb +206 -0
  197. data/lib/license_manager/models/request_portal_link.rb +216 -0
  198. data/lib/license_manager/models/revenue.rb +401 -0
  199. data/lib/license_manager/models/send_license_keys.rb +198 -0
  200. data/lib/license_manager/models/send_portal_link.rb +187 -0
  201. data/lib/license_manager/models/signing_key.rb +282 -0
  202. data/lib/license_manager/models/stripe_integration.rb +276 -0
  203. data/lib/license_manager/models/stripe_permission.rb +253 -0
  204. data/lib/license_manager/models/stripe_price.rb +280 -0
  205. data/lib/license_manager/models/token.rb +274 -0
  206. data/lib/license_manager/models/update_customer.rb +215 -0
  207. data/lib/license_manager/models/update_integration_mapping.rb +186 -0
  208. data/lib/license_manager/models/update_license.rb +268 -0
  209. data/lib/license_manager/models/update_policy.rb +340 -0
  210. data/lib/license_manager/models/update_product.rb +246 -0
  211. data/lib/license_manager/models/update_product_portal.rb +274 -0
  212. data/lib/license_manager/models/update_release.rb +201 -0
  213. data/lib/license_manager/models/validate_key.rb +362 -0
  214. data/lib/license_manager/models/validate_key_error.rb +177 -0
  215. data/lib/license_manager/models/validate_key_error_error.rb +226 -0
  216. data/lib/license_manager/version.rb +15 -0
  217. data/lib/license_manager.rb +142 -0
  218. data/license_manager.gemspec +41 -0
  219. data/openapi.json +9825 -0
  220. data/spec/api/customers_api_spec.rb +102 -0
  221. data/spec/api/events_api_spec.rb +68 -0
  222. data/spec/api/integrations_api_spec.rb +134 -0
  223. data/spec/api/licenses_api_spec.rb +200 -0
  224. data/spec/api/machines_api_spec.rb +77 -0
  225. data/spec/api/policies_api_spec.rb +105 -0
  226. data/spec/api/portal_api_spec.rb +87 -0
  227. data/spec/api/products_api_spec.rb +148 -0
  228. data/spec/api/releases_api_spec.rb +105 -0
  229. data/spec/api/tokens_api_spec.rb +74 -0
  230. data/spec/models/connect_stripe_spec.rb +36 -0
  231. data/spec/models/create_customer_spec.rb +42 -0
  232. data/spec/models/create_integration_mapping_spec.rb +42 -0
  233. data/spec/models/create_license_spec.rb +90 -0
  234. data/spec/models/create_policy_spec.rb +72 -0
  235. data/spec/models/create_portal_link_spec.rb +36 -0
  236. data/spec/models/create_product_spec.rb +42 -0
  237. data/spec/models/create_product_with_policy_spec.rb +54 -0
  238. data/spec/models/create_release_spec.rb +42 -0
  239. data/spec/models/create_token_spec.rb +46 -0
  240. data/spec/models/customer_list_spec.rb +42 -0
  241. data/spec/models/customer_spec.rb +72 -0
  242. data/spec/models/error_error_issues_inner_path_inner_spec.rb +21 -0
  243. data/spec/models/error_error_issues_inner_spec.rb +42 -0
  244. data/spec/models/error_error_spec.rb +48 -0
  245. data/spec/models/error_spec.rb +36 -0
  246. data/spec/models/event_actor_one_of1_spec.rb +58 -0
  247. data/spec/models/event_actor_one_of2_spec.rb +56 -0
  248. data/spec/models/event_actor_one_of3_spec.rb +40 -0
  249. data/spec/models/event_actor_one_of4_spec.rb +56 -0
  250. data/spec/models/event_actor_one_of_spec.rb +64 -0
  251. data/spec/models/event_actor_spec.rb +32 -0
  252. data/spec/models/event_list_spec.rb +42 -0
  253. data/spec/models/event_machine_spec.rb +48 -0
  254. data/spec/models/event_spec.rb +84 -0
  255. data/spec/models/event_type_spec.rb +30 -0
  256. data/spec/models/fixed_max_version_spec.rb +46 -0
  257. data/spec/models/integration_mapping_spec.rb +100 -0
  258. data/spec/models/integration_spec.rb +100 -0
  259. data/spec/models/integration_status_spec.rb +30 -0
  260. data/spec/models/license_list_spec.rb +42 -0
  261. data/spec/models/license_max_version_input_spec.rb +48 -0
  262. data/spec/models/license_max_version_spec.rb +48 -0
  263. data/spec/models/license_spec.rb +132 -0
  264. data/spec/models/license_stats_activations_by_machine_inner_spec.rb +54 -0
  265. data/spec/models/license_stats_activations_by_version_inner_spec.rb +42 -0
  266. data/spec/models/license_stats_spec.rb +60 -0
  267. data/spec/models/license_status_spec.rb +30 -0
  268. data/spec/models/license_token_spec.rb +36 -0
  269. data/spec/models/list_policy_events_type_parameter_spec.rb +21 -0
  270. data/spec/models/list_stripe_prices200_response_spec.rb +36 -0
  271. data/spec/models/lock_max_version_major_after_one_of1_spec.rb +46 -0
  272. data/spec/models/lock_max_version_major_after_one_of_spec.rb +46 -0
  273. data/spec/models/lock_max_version_major_after_spec.rb +32 -0
  274. data/spec/models/lock_max_version_minor_after_spec.rb +21 -0
  275. data/spec/models/lock_max_version_spec.rb +52 -0
  276. data/spec/models/machine_list_spec.rb +42 -0
  277. data/spec/models/machine_spec.rb +94 -0
  278. data/spec/models/pagination_spec.rb +54 -0
  279. data/spec/models/policy_duration_spec.rb +21 -0
  280. data/spec/models/policy_list_spec.rb +42 -0
  281. data/spec/models/policy_max_version_spec.rb +21 -0
  282. data/spec/models/policy_settings_duration_any_of1_spec.rb +46 -0
  283. data/spec/models/policy_settings_duration_any_of_spec.rb +46 -0
  284. data/spec/models/policy_settings_duration_spec.rb +21 -0
  285. data/spec/models/policy_settings_max_version_spec.rb +21 -0
  286. data/spec/models/policy_settings_spec.rb +54 -0
  287. data/spec/models/policy_spec.rb +102 -0
  288. data/spec/models/portal_link_spec.rb +48 -0
  289. data/spec/models/portal_not_found_spec.rb +48 -0
  290. data/spec/models/portal_settings_spec.rb +60 -0
  291. data/spec/models/portal_spec.rb +72 -0
  292. data/spec/models/price_input_spec.rb +42 -0
  293. data/spec/models/price_spec.rb +42 -0
  294. data/spec/models/product_list_spec.rb +42 -0
  295. data/spec/models/product_spec.rb +78 -0
  296. data/spec/models/product_stats_activations_by_version_inner_spec.rb +42 -0
  297. data/spec/models/product_stats_active_machines_by_platform_inner_spec.rb +42 -0
  298. data/spec/models/product_stats_active_machines_by_version_inner_spec.rb +42 -0
  299. data/spec/models/product_stats_new_licenses_by_policy_inner_spec.rb +48 -0
  300. data/spec/models/product_stats_spec.rb +144 -0
  301. data/spec/models/release_list_spec.rb +42 -0
  302. data/spec/models/release_spec.rb +66 -0
  303. data/spec/models/request_portal_link_spec.rb +42 -0
  304. data/spec/models/revenue_spec.rb +84 -0
  305. data/spec/models/send_license_keys_spec.rb +36 -0
  306. data/spec/models/send_portal_link_spec.rb +36 -0
  307. data/spec/models/signing_key_spec.rb +58 -0
  308. data/spec/models/stripe_integration_spec.rb +60 -0
  309. data/spec/models/stripe_permission_spec.rb +52 -0
  310. data/spec/models/stripe_price_spec.rb +66 -0
  311. data/spec/models/token_spec.rb +62 -0
  312. data/spec/models/update_customer_spec.rb +42 -0
  313. data/spec/models/update_integration_mapping_spec.rb +36 -0
  314. data/spec/models/update_license_spec.rb +66 -0
  315. data/spec/models/update_policy_spec.rb +72 -0
  316. data/spec/models/update_product_portal_spec.rb +60 -0
  317. data/spec/models/update_product_spec.rb +48 -0
  318. data/spec/models/update_release_spec.rb +42 -0
  319. data/spec/models/validate_key_error_error_spec.rb +54 -0
  320. data/spec/models/validate_key_error_spec.rb +36 -0
  321. data/spec/models/validate_key_spec.rb +60 -0
  322. data/spec/spec_helper.rb +111 -0
  323. metadata +532 -0
@@ -0,0 +1,398 @@
1
+ =begin
2
+ #LicenseManager API
3
+
4
+ #Public API. Authenticate with an organization API key, or with a token scoped to a customer, license or machine on the endpoints that accept one. ## Conventions - **Errors** answer `{ \"error\": { \"code\", \"message\" } }`. Branch on `code`, which is stable, not on `message`. Each response lists the codes it can return, except `404`, which answers `not_found` unless it says otherwise. Unexpected errors answer `500` with `internal_error`. - **Validation** errors answer `422`, not `400`, with the `validation_error` code and an `issues` array giving the `path` and `message` of each invalid value. - **Unknown body fields are ignored**, not rejected: sending a field an endpoint doesn't accept, like `policyId` to `updateLicense`, changes nothing and doesn't fail. - **Strings** are trimmed before they're validated and stored. Emails are stored lower cased. - **Updates** only change the fields that are sent. A field sent as `null` is cleared, when it can be. - **Dates** can be sent with any offset, and are always returned in UTC, like `2026-01-15T09:30:00.000Z`. Calendar months and days are counted in UTC. - **Ids** are 8 letters and digits, after `test_` for test products and their resources. - **Lists** are paginated with `page` and `pageSize`. Items with the same value for the `sort` field are ordered by id, so pages are stable, but items created or deleted between two requests shift the pages. Items without a value for the `sort` field come last in ascending order, and first in descending order, unless the endpoint says otherwise. - **Test products** are sandboxes of a live product. Test API keys only reach test products, live API keys only live ones: the others answer `404`, as if they didn't exist. Sessions and tokens reach both.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module LicenseManager
16
+ class CustomersApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a customer
23
+ # **Required role permission**: `customer:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
24
+ # @param product_id [String]
25
+ # @param create_customer [CreateCustomer]
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [Customer]
28
+ def create_customer(product_id, create_customer, opts = {})
29
+ data, _status_code, _headers = create_customer_with_http_info(product_id, create_customer, opts)
30
+ data
31
+ end
32
+
33
+ # Create a customer
34
+ # **Required role permission**: `customer:create` when called with a session, granted by the member's role. API keys aren't limited by roles.
35
+ # @param product_id [String]
36
+ # @param create_customer [CreateCustomer]
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(Customer, Integer, Hash)>] Customer data, response status code and response headers
39
+ def create_customer_with_http_info(product_id, create_customer, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: CustomersApi.create_customer ...'
42
+ end
43
+ # verify the required parameter 'product_id' is set
44
+ if @api_client.config.client_side_validation && product_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'product_id' when calling CustomersApi.create_customer"
46
+ end
47
+ # verify the required parameter 'create_customer' is set
48
+ if @api_client.config.client_side_validation && create_customer.nil?
49
+ fail ArgumentError, "Missing the required parameter 'create_customer' when calling CustomersApi.create_customer"
50
+ end
51
+ # resource path
52
+ local_var_path = '/v1/products/{productId}/customers'.sub('{productId}', CGI.escape(product_id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
+ # HTTP header 'Content-Type'
62
+ content_type = @api_client.select_header_content_type(['application/json'])
63
+ if !content_type.nil?
64
+ header_params['Content-Type'] = content_type
65
+ end
66
+
67
+ # form parameters
68
+ form_params = opts[:form_params] || {}
69
+
70
+ # http body (model)
71
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_customer)
72
+
73
+ # return_type
74
+ return_type = opts[:debug_return_type] || 'Customer'
75
+
76
+ # auth_names
77
+ auth_names = opts[:debug_auth_names] || ['apiKey']
78
+
79
+ new_options = opts.merge(
80
+ :operation => :"CustomersApi.create_customer",
81
+ :header_params => header_params,
82
+ :query_params => query_params,
83
+ :form_params => form_params,
84
+ :body => post_body,
85
+ :auth_names => auth_names,
86
+ :return_type => return_type
87
+ )
88
+
89
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: CustomersApi#create_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+
96
+ # Delete a customer
97
+ # A customer that licenses belong to can't be deleted: delete them first. The customer tokens of the customer, like the ones of its portal links, stop working. **Required role permission**: `customer:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.
98
+ # @param id [String]
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [nil]
101
+ def delete_customer(id, opts = {})
102
+ delete_customer_with_http_info(id, opts)
103
+ nil
104
+ end
105
+
106
+ # Delete a customer
107
+ # A customer that licenses belong to can&#39;t be deleted: delete them first. The customer tokens of the customer, like the ones of its portal links, stop working. **Required role permission**: &#x60;customer:delete&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
108
+ # @param id [String]
109
+ # @param [Hash] opts the optional parameters
110
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
111
+ def delete_customer_with_http_info(id, opts = {})
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug 'Calling API: CustomersApi.delete_customer ...'
114
+ end
115
+ # verify the required parameter 'id' is set
116
+ if @api_client.config.client_side_validation && id.nil?
117
+ fail ArgumentError, "Missing the required parameter 'id' when calling CustomersApi.delete_customer"
118
+ end
119
+ # resource path
120
+ local_var_path = '/v1/customers/{id}'.sub('{id}', CGI.escape(id.to_s))
121
+
122
+ # query parameters
123
+ query_params = opts[:query_params] || {}
124
+
125
+ # header parameters
126
+ header_params = opts[:header_params] || {}
127
+ # HTTP header 'Accept' (if needed)
128
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
129
+
130
+ # form parameters
131
+ form_params = opts[:form_params] || {}
132
+
133
+ # http body (model)
134
+ post_body = opts[:debug_body]
135
+
136
+ # return_type
137
+ return_type = opts[:debug_return_type]
138
+
139
+ # auth_names
140
+ auth_names = opts[:debug_auth_names] || ['apiKey']
141
+
142
+ new_options = opts.merge(
143
+ :operation => :"CustomersApi.delete_customer",
144
+ :header_params => header_params,
145
+ :query_params => query_params,
146
+ :form_params => form_params,
147
+ :body => post_body,
148
+ :auth_names => auth_names,
149
+ :return_type => return_type
150
+ )
151
+
152
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
153
+ if @api_client.config.debugging
154
+ @api_client.config.logger.debug "API called: CustomersApi#delete_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
155
+ end
156
+ return data, status_code, headers
157
+ end
158
+
159
+ # Get a customer
160
+ # **Token access**: customer, license, machine tokens with the `customer:read` permission (or the matching write one). A token reaches the customer it's scoped to, or the customer of its license or machine.
161
+ # @param id [String]
162
+ # @param [Hash] opts the optional parameters
163
+ # @return [Customer]
164
+ def get_customer(id, opts = {})
165
+ data, _status_code, _headers = get_customer_with_http_info(id, opts)
166
+ data
167
+ end
168
+
169
+ # Get a customer
170
+ # **Token access**: customer, license, machine tokens with the &#x60;customer:read&#x60; permission (or the matching write one). A token reaches the customer it&#39;s scoped to, or the customer of its license or machine.
171
+ # @param id [String]
172
+ # @param [Hash] opts the optional parameters
173
+ # @return [Array<(Customer, Integer, Hash)>] Customer data, response status code and response headers
174
+ def get_customer_with_http_info(id, opts = {})
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug 'Calling API: CustomersApi.get_customer ...'
177
+ end
178
+ # verify the required parameter 'id' is set
179
+ if @api_client.config.client_side_validation && id.nil?
180
+ fail ArgumentError, "Missing the required parameter 'id' when calling CustomersApi.get_customer"
181
+ end
182
+ # resource path
183
+ local_var_path = '/v1/customers/{id}'.sub('{id}', CGI.escape(id.to_s))
184
+
185
+ # query parameters
186
+ query_params = opts[:query_params] || {}
187
+
188
+ # header parameters
189
+ header_params = opts[:header_params] || {}
190
+ # HTTP header 'Accept' (if needed)
191
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
192
+
193
+ # form parameters
194
+ form_params = opts[:form_params] || {}
195
+
196
+ # http body (model)
197
+ post_body = opts[:debug_body]
198
+
199
+ # return_type
200
+ return_type = opts[:debug_return_type] || 'Customer'
201
+
202
+ # auth_names
203
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'token']
204
+
205
+ new_options = opts.merge(
206
+ :operation => :"CustomersApi.get_customer",
207
+ :header_params => header_params,
208
+ :query_params => query_params,
209
+ :form_params => form_params,
210
+ :body => post_body,
211
+ :auth_names => auth_names,
212
+ :return_type => return_type
213
+ )
214
+
215
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
216
+ if @api_client.config.debugging
217
+ @api_client.config.logger.debug "API called: CustomersApi#get_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
218
+ end
219
+ return data, status_code, headers
220
+ end
221
+
222
+ # List the customers of a product
223
+ # Sorting by `name` puts the customers without a name last in both orders.
224
+ # @param product_id [String]
225
+ # @param [Hash] opts the optional parameters
226
+ # @option opts [Integer] :page Page to return. Pages are numbered from 1: &#x60;1&#x60; is the first page. A page past the last one returns an empty &#x60;data&#x60;, not an error. Defaults to &#x60;1&#x60;. (default to 1)
227
+ # @option opts [Integer] :page_size Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to &#x60;20&#x60;. (default to 20)
228
+ # @option opts [String] :sort Field to sort by, prefixed with &#x60;-&#x60; for descending order. Defaults to &#x60;-createdAt&#x60;. (default to '-createdAt')
229
+ # @option opts [String] :search Case-insensitive text the name or email contains.
230
+ # @option opts [String] :email Only returns the customer with this email, compared regardless of case.
231
+ # @return [CustomerList]
232
+ def list_customers(product_id, opts = {})
233
+ data, _status_code, _headers = list_customers_with_http_info(product_id, opts)
234
+ data
235
+ end
236
+
237
+ # List the customers of a product
238
+ # Sorting by &#x60;name&#x60; puts the customers without a name last in both orders.
239
+ # @param product_id [String]
240
+ # @param [Hash] opts the optional parameters
241
+ # @option opts [Integer] :page Page to return. Pages are numbered from 1: &#x60;1&#x60; is the first page. A page past the last one returns an empty &#x60;data&#x60;, not an error. Defaults to &#x60;1&#x60;. (default to 1)
242
+ # @option opts [Integer] :page_size Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to &#x60;20&#x60;. (default to 20)
243
+ # @option opts [String] :sort Field to sort by, prefixed with &#x60;-&#x60; for descending order. Defaults to &#x60;-createdAt&#x60;. (default to '-createdAt')
244
+ # @option opts [String] :search Case-insensitive text the name or email contains.
245
+ # @option opts [String] :email Only returns the customer with this email, compared regardless of case.
246
+ # @return [Array<(CustomerList, Integer, Hash)>] CustomerList data, response status code and response headers
247
+ def list_customers_with_http_info(product_id, opts = {})
248
+ if @api_client.config.debugging
249
+ @api_client.config.logger.debug 'Calling API: CustomersApi.list_customers ...'
250
+ end
251
+ # verify the required parameter 'product_id' is set
252
+ if @api_client.config.client_side_validation && product_id.nil?
253
+ fail ArgumentError, "Missing the required parameter 'product_id' when calling CustomersApi.list_customers"
254
+ end
255
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
256
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling CustomersApi.list_customers, must be greater than or equal to 1.'
257
+ end
258
+
259
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
260
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CustomersApi.list_customers, must be smaller than or equal to 100.'
261
+ end
262
+
263
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
264
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CustomersApi.list_customers, must be greater than or equal to 1.'
265
+ end
266
+
267
+ allowable_values = ["name", "-name", "email", "-email", "licenseCount", "-licenseCount", "createdAt", "-createdAt", "unknown_default_open_api"]
268
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
269
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
270
+ end
271
+ if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length > 200
272
+ fail ArgumentError, 'invalid value for "opts[:"search"]" when calling CustomersApi.list_customers, the character length must be smaller than or equal to 200.'
273
+ end
274
+
275
+ if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length < 1
276
+ fail ArgumentError, 'invalid value for "opts[:"search"]" when calling CustomersApi.list_customers, the character length must be greater than or equal to 1.'
277
+ end
278
+
279
+ # resource path
280
+ local_var_path = '/v1/products/{productId}/customers'.sub('{productId}', CGI.escape(product_id.to_s))
281
+
282
+ # query parameters
283
+ query_params = opts[:query_params] || {}
284
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
285
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
286
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
287
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
288
+ query_params[:'email'] = opts[:'email'] if !opts[:'email'].nil?
289
+
290
+ # header parameters
291
+ header_params = opts[:header_params] || {}
292
+ # HTTP header 'Accept' (if needed)
293
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
294
+
295
+ # form parameters
296
+ form_params = opts[:form_params] || {}
297
+
298
+ # http body (model)
299
+ post_body = opts[:debug_body]
300
+
301
+ # return_type
302
+ return_type = opts[:debug_return_type] || 'CustomerList'
303
+
304
+ # auth_names
305
+ auth_names = opts[:debug_auth_names] || ['apiKey']
306
+
307
+ new_options = opts.merge(
308
+ :operation => :"CustomersApi.list_customers",
309
+ :header_params => header_params,
310
+ :query_params => query_params,
311
+ :form_params => form_params,
312
+ :body => post_body,
313
+ :auth_names => auth_names,
314
+ :return_type => return_type
315
+ )
316
+
317
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
318
+ if @api_client.config.debugging
319
+ @api_client.config.logger.debug "API called: CustomersApi#list_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
320
+ end
321
+ return data, status_code, headers
322
+ end
323
+
324
+ # Update a customer
325
+ # **Required role permission**: `customer:update` when called with a session, granted by the member's role. API keys aren't limited by roles.
326
+ # @param id [String]
327
+ # @param update_customer [UpdateCustomer]
328
+ # @param [Hash] opts the optional parameters
329
+ # @return [Customer]
330
+ def update_customer(id, update_customer, opts = {})
331
+ data, _status_code, _headers = update_customer_with_http_info(id, update_customer, opts)
332
+ data
333
+ end
334
+
335
+ # Update a customer
336
+ # **Required role permission**: &#x60;customer:update&#x60; when called with a session, granted by the member&#39;s role. API keys aren&#39;t limited by roles.
337
+ # @param id [String]
338
+ # @param update_customer [UpdateCustomer]
339
+ # @param [Hash] opts the optional parameters
340
+ # @return [Array<(Customer, Integer, Hash)>] Customer data, response status code and response headers
341
+ def update_customer_with_http_info(id, update_customer, opts = {})
342
+ if @api_client.config.debugging
343
+ @api_client.config.logger.debug 'Calling API: CustomersApi.update_customer ...'
344
+ end
345
+ # verify the required parameter 'id' is set
346
+ if @api_client.config.client_side_validation && id.nil?
347
+ fail ArgumentError, "Missing the required parameter 'id' when calling CustomersApi.update_customer"
348
+ end
349
+ # verify the required parameter 'update_customer' is set
350
+ if @api_client.config.client_side_validation && update_customer.nil?
351
+ fail ArgumentError, "Missing the required parameter 'update_customer' when calling CustomersApi.update_customer"
352
+ end
353
+ # resource path
354
+ local_var_path = '/v1/customers/{id}'.sub('{id}', CGI.escape(id.to_s))
355
+
356
+ # query parameters
357
+ query_params = opts[:query_params] || {}
358
+
359
+ # header parameters
360
+ header_params = opts[:header_params] || {}
361
+ # HTTP header 'Accept' (if needed)
362
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
363
+ # HTTP header 'Content-Type'
364
+ content_type = @api_client.select_header_content_type(['application/json'])
365
+ if !content_type.nil?
366
+ header_params['Content-Type'] = content_type
367
+ end
368
+
369
+ # form parameters
370
+ form_params = opts[:form_params] || {}
371
+
372
+ # http body (model)
373
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_customer)
374
+
375
+ # return_type
376
+ return_type = opts[:debug_return_type] || 'Customer'
377
+
378
+ # auth_names
379
+ auth_names = opts[:debug_auth_names] || ['apiKey']
380
+
381
+ new_options = opts.merge(
382
+ :operation => :"CustomersApi.update_customer",
383
+ :header_params => header_params,
384
+ :query_params => query_params,
385
+ :form_params => form_params,
386
+ :body => post_body,
387
+ :auth_names => auth_names,
388
+ :return_type => return_type
389
+ )
390
+
391
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
392
+ if @api_client.config.debugging
393
+ @api_client.config.logger.debug "API called: CustomersApi#update_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
394
+ end
395
+ return data, status_code, headers
396
+ end
397
+ end
398
+ end
@@ -0,0 +1,207 @@
1
+ =begin
2
+ #LicenseManager API
3
+
4
+ #Public API. Authenticate with an organization API key, or with a token scoped to a customer, license or machine on the endpoints that accept one. ## Conventions - **Errors** answer `{ \"error\": { \"code\", \"message\" } }`. Branch on `code`, which is stable, not on `message`. Each response lists the codes it can return, except `404`, which answers `not_found` unless it says otherwise. Unexpected errors answer `500` with `internal_error`. - **Validation** errors answer `422`, not `400`, with the `validation_error` code and an `issues` array giving the `path` and `message` of each invalid value. - **Unknown body fields are ignored**, not rejected: sending a field an endpoint doesn't accept, like `policyId` to `updateLicense`, changes nothing and doesn't fail. - **Strings** are trimmed before they're validated and stored. Emails are stored lower cased. - **Updates** only change the fields that are sent. A field sent as `null` is cleared, when it can be. - **Dates** can be sent with any offset, and are always returned in UTC, like `2026-01-15T09:30:00.000Z`. Calendar months and days are counted in UTC. - **Ids** are 8 letters and digits, after `test_` for test products and their resources. - **Lists** are paginated with `page` and `pageSize`. Items with the same value for the `sort` field are ordered by id, so pages are stable, but items created or deleted between two requests shift the pages. Items without a value for the `sort` field come last in ascending order, and first in descending order, unless the endpoint says otherwise. - **Test products** are sandboxes of a live product. Test API keys only reach test products, live API keys only live ones: the others answer `404`, as if they didn't exist. Sessions and tokens reach both.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module LicenseManager
16
+ class EventsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List the events of a license
23
+ # Includes the validations of the license on each of its machines. Doesn't accept tokens: only API keys and sessions.
24
+ # @param id [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Integer] :page Page to return. Pages are numbered from 1: &#x60;1&#x60; is the first page. A page past the last one returns an empty &#x60;data&#x60;, not an error. Defaults to &#x60;1&#x60;. (default to 1)
27
+ # @option opts [Integer] :page_size Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to &#x60;20&#x60;. (default to 20)
28
+ # @option opts [String] :sort Field to sort by, prefixed with &#x60;-&#x60; for descending order. Defaults to &#x60;-createdAt&#x60;. (default to '-createdAt')
29
+ # @option opts [ListPolicyEventsTypeParameter] :type Only returns the events of this type. Repeat it to return the events of any of these types.
30
+ # @option opts [String] :machine_id Only returns the events of this machine of the license.
31
+ # @return [EventList]
32
+ def list_license_events(id, opts = {})
33
+ data, _status_code, _headers = list_license_events_with_http_info(id, opts)
34
+ data
35
+ end
36
+
37
+ # List the events of a license
38
+ # Includes the validations of the license on each of its machines. Doesn&#39;t accept tokens: only API keys and sessions.
39
+ # @param id [String]
40
+ # @param [Hash] opts the optional parameters
41
+ # @option opts [Integer] :page Page to return. Pages are numbered from 1: &#x60;1&#x60; is the first page. A page past the last one returns an empty &#x60;data&#x60;, not an error. Defaults to &#x60;1&#x60;. (default to 1)
42
+ # @option opts [Integer] :page_size Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to &#x60;20&#x60;. (default to 20)
43
+ # @option opts [String] :sort Field to sort by, prefixed with &#x60;-&#x60; for descending order. Defaults to &#x60;-createdAt&#x60;. (default to '-createdAt')
44
+ # @option opts [ListPolicyEventsTypeParameter] :type Only returns the events of this type. Repeat it to return the events of any of these types.
45
+ # @option opts [String] :machine_id Only returns the events of this machine of the license.
46
+ # @return [Array<(EventList, Integer, Hash)>] EventList data, response status code and response headers
47
+ def list_license_events_with_http_info(id, opts = {})
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: EventsApi.list_license_events ...'
50
+ end
51
+ # verify the required parameter 'id' is set
52
+ if @api_client.config.client_side_validation && id.nil?
53
+ fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.list_license_events"
54
+ end
55
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
56
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling EventsApi.list_license_events, must be greater than or equal to 1.'
57
+ end
58
+
59
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
60
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling EventsApi.list_license_events, must be smaller than or equal to 100.'
61
+ end
62
+
63
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
64
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling EventsApi.list_license_events, must be greater than or equal to 1.'
65
+ end
66
+
67
+ allowable_values = ["createdAt", "-createdAt", "unknown_default_open_api"]
68
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
69
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
70
+ end
71
+ # resource path
72
+ local_var_path = '/v1/licenses/{id}/events'.sub('{id}', CGI.escape(id.to_s))
73
+
74
+ # query parameters
75
+ query_params = opts[:query_params] || {}
76
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
77
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
78
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
79
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
80
+ query_params[:'machineId'] = opts[:'machine_id'] if !opts[:'machine_id'].nil?
81
+
82
+ # header parameters
83
+ header_params = opts[:header_params] || {}
84
+ # HTTP header 'Accept' (if needed)
85
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
86
+
87
+ # form parameters
88
+ form_params = opts[:form_params] || {}
89
+
90
+ # http body (model)
91
+ post_body = opts[:debug_body]
92
+
93
+ # return_type
94
+ return_type = opts[:debug_return_type] || 'EventList'
95
+
96
+ # auth_names
97
+ auth_names = opts[:debug_auth_names] || ['apiKey']
98
+
99
+ new_options = opts.merge(
100
+ :operation => :"EventsApi.list_license_events",
101
+ :header_params => header_params,
102
+ :query_params => query_params,
103
+ :form_params => form_params,
104
+ :body => post_body,
105
+ :auth_names => auth_names,
106
+ :return_type => return_type
107
+ )
108
+
109
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug "API called: EventsApi#list_license_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
112
+ end
113
+ return data, status_code, headers
114
+ end
115
+
116
+ # List the events of a policy
117
+ # Doesn't accept tokens: only API keys and sessions.
118
+ # @param id [String]
119
+ # @param [Hash] opts the optional parameters
120
+ # @option opts [Integer] :page Page to return. Pages are numbered from 1: &#x60;1&#x60; is the first page. A page past the last one returns an empty &#x60;data&#x60;, not an error. Defaults to &#x60;1&#x60;. (default to 1)
121
+ # @option opts [Integer] :page_size Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to &#x60;20&#x60;. (default to 20)
122
+ # @option opts [String] :sort Field to sort by, prefixed with &#x60;-&#x60; for descending order. Defaults to &#x60;-createdAt&#x60;. (default to '-createdAt')
123
+ # @option opts [ListPolicyEventsTypeParameter] :type Only returns the events of this type. Repeat it to return the events of any of these types.
124
+ # @return [EventList]
125
+ def list_policy_events(id, opts = {})
126
+ data, _status_code, _headers = list_policy_events_with_http_info(id, opts)
127
+ data
128
+ end
129
+
130
+ # List the events of a policy
131
+ # Doesn&#39;t accept tokens: only API keys and sessions.
132
+ # @param id [String]
133
+ # @param [Hash] opts the optional parameters
134
+ # @option opts [Integer] :page Page to return. Pages are numbered from 1: &#x60;1&#x60; is the first page. A page past the last one returns an empty &#x60;data&#x60;, not an error. Defaults to &#x60;1&#x60;. (default to 1)
135
+ # @option opts [Integer] :page_size Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to &#x60;20&#x60;. (default to 20)
136
+ # @option opts [String] :sort Field to sort by, prefixed with &#x60;-&#x60; for descending order. Defaults to &#x60;-createdAt&#x60;. (default to '-createdAt')
137
+ # @option opts [ListPolicyEventsTypeParameter] :type Only returns the events of this type. Repeat it to return the events of any of these types.
138
+ # @return [Array<(EventList, Integer, Hash)>] EventList data, response status code and response headers
139
+ def list_policy_events_with_http_info(id, opts = {})
140
+ if @api_client.config.debugging
141
+ @api_client.config.logger.debug 'Calling API: EventsApi.list_policy_events ...'
142
+ end
143
+ # verify the required parameter 'id' is set
144
+ if @api_client.config.client_side_validation && id.nil?
145
+ fail ArgumentError, "Missing the required parameter 'id' when calling EventsApi.list_policy_events"
146
+ end
147
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
148
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling EventsApi.list_policy_events, must be greater than or equal to 1.'
149
+ end
150
+
151
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
152
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling EventsApi.list_policy_events, must be smaller than or equal to 100.'
153
+ end
154
+
155
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
156
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling EventsApi.list_policy_events, must be greater than or equal to 1.'
157
+ end
158
+
159
+ allowable_values = ["createdAt", "-createdAt", "unknown_default_open_api"]
160
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
161
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
162
+ end
163
+ # resource path
164
+ local_var_path = '/v1/policies/{id}/events'.sub('{id}', CGI.escape(id.to_s))
165
+
166
+ # query parameters
167
+ query_params = opts[:query_params] || {}
168
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
169
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
170
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
171
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
172
+
173
+ # header parameters
174
+ header_params = opts[:header_params] || {}
175
+ # HTTP header 'Accept' (if needed)
176
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
177
+
178
+ # form parameters
179
+ form_params = opts[:form_params] || {}
180
+
181
+ # http body (model)
182
+ post_body = opts[:debug_body]
183
+
184
+ # return_type
185
+ return_type = opts[:debug_return_type] || 'EventList'
186
+
187
+ # auth_names
188
+ auth_names = opts[:debug_auth_names] || ['apiKey']
189
+
190
+ new_options = opts.merge(
191
+ :operation => :"EventsApi.list_policy_events",
192
+ :header_params => header_params,
193
+ :query_params => query_params,
194
+ :form_params => form_params,
195
+ :body => post_body,
196
+ :auth_names => auth_names,
197
+ :return_type => return_type
198
+ )
199
+
200
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
201
+ if @api_client.config.debugging
202
+ @api_client.config.logger.debug "API called: EventsApi#list_policy_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
203
+ end
204
+ return data, status_code, headers
205
+ end
206
+ end
207
+ end