togai_client 1.0.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 (187) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +61 -0
  4. data/Rakefile +10 -0
  5. data/docs/Account.md +24 -0
  6. data/docs/AccountAliases.md +20 -0
  7. data/docs/AccountPaginatedResponse.md +22 -0
  8. data/docs/AccountsApi.md +595 -0
  9. data/docs/AddAccountAliasesRequest.md +18 -0
  10. data/docs/AssociatePricePlanRequest.md +24 -0
  11. data/docs/AssociatePricePlanResponse.md +22 -0
  12. data/docs/BaseSuccessResponse.md +18 -0
  13. data/docs/BundleStrategy.md +24 -0
  14. data/docs/BundleStrategyUsageMetersValue.md +18 -0
  15. data/docs/Computation.md +31 -0
  16. data/docs/CreateAccountRequest.md +22 -0
  17. data/docs/CreateCustomerRequest.md +26 -0
  18. data/docs/CreateCustomerResponse.md +26 -0
  19. data/docs/CreateEventSchemaRequest.md +24 -0
  20. data/docs/CreatePricePlanRequest.md +24 -0
  21. data/docs/CreateUsageMeterRequest.md +26 -0
  22. data/docs/Customer.md +30 -0
  23. data/docs/CustomerPaginatedResponse.md +22 -0
  24. data/docs/CustomersApi.md +363 -0
  25. data/docs/DimensionsSchema.md +18 -0
  26. data/docs/ErrorResponse.md +18 -0
  27. data/docs/Event.md +28 -0
  28. data/docs/EventAttribute.md +22 -0
  29. data/docs/EventAttributeSchema.md +20 -0
  30. data/docs/EventIngestionApi.md +146 -0
  31. data/docs/EventManagementApi.md +159 -0
  32. data/docs/EventPipelineInfo.md +26 -0
  33. data/docs/EventPipelineInfoAccount.md +20 -0
  34. data/docs/EventPipelineInfoCustomer.md +20 -0
  35. data/docs/EventPipelineInfoEventSchema.md +20 -0
  36. data/docs/EventPipelineInfoPricePlansInner.md +26 -0
  37. data/docs/EventPipelineInfoUsageMetersInner.md +24 -0
  38. data/docs/EventSchema.md +32 -0
  39. data/docs/EventSchemaListData.md +34 -0
  40. data/docs/EventSchemaListDataAllOf.md +18 -0
  41. data/docs/EventSchemaListPaginatedResponse.md +22 -0
  42. data/docs/EventSchemaVersionsResponse.md +18 -0
  43. data/docs/EventSchemasApi.md +581 -0
  44. data/docs/EventWithStatus.md +20 -0
  45. data/docs/EventWithStatusAndEventPipelineInfo.md +22 -0
  46. data/docs/EventWithStatusAndEventPipelineInfoAllOf.md +18 -0
  47. data/docs/GetEventResponse.md +18 -0
  48. data/docs/GetEventsResponse.md +20 -0
  49. data/docs/GetMetricsRequest.md +22 -0
  50. data/docs/GetMetricsResponse.md +18 -0
  51. data/docs/IngestBatchEventRequest.md +18 -0
  52. data/docs/IngestBatchEventResponse.md +18 -0
  53. data/docs/IngestError.md +20 -0
  54. data/docs/IngestEventRequest.md +18 -0
  55. data/docs/IngestEventResponse.md +18 -0
  56. data/docs/IngestionStatus.md +20 -0
  57. data/docs/MetricDataPoints.md +22 -0
  58. data/docs/MetricDataPointsGroupedBy.md +20 -0
  59. data/docs/MetricName.md +15 -0
  60. data/docs/MetricQuery.md +26 -0
  61. data/docs/MetricQueryFilterEntry.md +20 -0
  62. data/docs/MetricQueryResponse.md +22 -0
  63. data/docs/MetricsApi.md +79 -0
  64. data/docs/PaginationOptions.md +20 -0
  65. data/docs/PlanOverride.md +24 -0
  66. data/docs/PricePlan.md +26 -0
  67. data/docs/PricePlanListData.md +32 -0
  68. data/docs/PricePlanPaginatedResponse.md +22 -0
  69. data/docs/PricePlansApi.md +363 -0
  70. data/docs/PricingCycle.md +24 -0
  71. data/docs/PricingCycleStartOffset.md +20 -0
  72. data/docs/PricingSchedule.md +22 -0
  73. data/docs/RateCard.md +22 -0
  74. data/docs/RateCardBundle.md +22 -0
  75. data/docs/RateCardUsageValue.md +24 -0
  76. data/docs/RemoveAccountAliasesRequest.md +18 -0
  77. data/docs/SignupRequest.md +22 -0
  78. data/docs/SignupResponse.md +20 -0
  79. data/docs/StatusResponse.md +24 -0
  80. data/docs/StatusResponseHeaders.md +18 -0
  81. data/docs/UpdateAccountRequest.md +18 -0
  82. data/docs/UpdateCustomerRequest.md +22 -0
  83. data/docs/UpdateEventSchemaRequest.md +22 -0
  84. data/docs/UpdatePricePlanRequest.md +22 -0
  85. data/docs/UpdateUsageMeterRequest.md +24 -0
  86. data/docs/UsageMeter.md +34 -0
  87. data/docs/UsageMeterPaginatedResponse.md +22 -0
  88. data/docs/UsageMetersApi.md +521 -0
  89. data/docs/UsageStrategy.md +22 -0
  90. data/docs/UserDetails.md +26 -0
  91. data/git_push.sh +57 -0
  92. data/lib/togai_client/api/accounts_api.rb +679 -0
  93. data/lib/togai_client/api/customers_api.rb +365 -0
  94. data/lib/togai_client/api/event_ingestion_api.rb +158 -0
  95. data/lib/togai_client/api/event_management_api.rb +164 -0
  96. data/lib/togai_client/api/event_schemas_api.rb +579 -0
  97. data/lib/togai_client/api/metrics_api.rb +86 -0
  98. data/lib/togai_client/api/price_plans_api.rb +365 -0
  99. data/lib/togai_client/api/usage_meters_api.rb +572 -0
  100. data/lib/togai_client/api_client.rb +392 -0
  101. data/lib/togai_client/api_error.rb +57 -0
  102. data/lib/togai_client/configuration.rb +287 -0
  103. data/lib/togai_client/models/account.rb +373 -0
  104. data/lib/togai_client/models/account_aliases.rb +277 -0
  105. data/lib/togai_client/models/account_paginated_response.rb +239 -0
  106. data/lib/togai_client/models/add_account_aliases_request.rb +247 -0
  107. data/lib/togai_client/models/associate_price_plan_request.rb +274 -0
  108. data/lib/togai_client/models/associate_price_plan_response.rb +275 -0
  109. data/lib/togai_client/models/base_success_response.rb +224 -0
  110. data/lib/togai_client/models/bundle_strategy.rb +325 -0
  111. data/lib/togai_client/models/bundle_strategy_usage_meters_value.rb +224 -0
  112. data/lib/togai_client/models/computation.rb +294 -0
  113. data/lib/togai_client/models/create_account_request.rb +324 -0
  114. data/lib/togai_client/models/create_customer_request.rb +374 -0
  115. data/lib/togai_client/models/create_customer_response.rb +373 -0
  116. data/lib/togai_client/models/create_event_schema_request.rb +351 -0
  117. data/lib/togai_client/models/create_price_plan_request.rb +298 -0
  118. data/lib/togai_client/models/create_usage_meter_request.rb +368 -0
  119. data/lib/togai_client/models/customer.rb +442 -0
  120. data/lib/togai_client/models/customer_paginated_response.rb +239 -0
  121. data/lib/togai_client/models/dimensions_schema.rb +256 -0
  122. data/lib/togai_client/models/error_response.rb +244 -0
  123. data/lib/togai_client/models/event.rb +379 -0
  124. data/lib/togai_client/models/event_attribute.rb +304 -0
  125. data/lib/togai_client/models/event_attribute_schema.rb +281 -0
  126. data/lib/togai_client/models/event_pipeline_info.rb +260 -0
  127. data/lib/togai_client/models/event_pipeline_info_account.rb +238 -0
  128. data/lib/togai_client/models/event_pipeline_info_customer.rb +238 -0
  129. data/lib/togai_client/models/event_pipeline_info_event_schema.rb +238 -0
  130. data/lib/togai_client/models/event_pipeline_info_price_plans_inner.rb +283 -0
  131. data/lib/togai_client/models/event_pipeline_info_usage_meters_inner.rb +295 -0
  132. data/lib/togai_client/models/event_schema.rb +438 -0
  133. data/lib/togai_client/models/event_schema_list_data.rb +456 -0
  134. data/lib/togai_client/models/event_schema_list_data_all_of.rb +221 -0
  135. data/lib/togai_client/models/event_schema_list_paginated_response.rb +239 -0
  136. data/lib/togai_client/models/event_schema_versions_response.rb +227 -0
  137. data/lib/togai_client/models/event_with_status.rb +239 -0
  138. data/lib/togai_client/models/event_with_status_and_event_pipeline_info.rb +255 -0
  139. data/lib/togai_client/models/event_with_status_and_event_pipeline_info_all_of.rb +219 -0
  140. data/lib/togai_client/models/get_event_response.rb +222 -0
  141. data/lib/togai_client/models/get_events_response.rb +279 -0
  142. data/lib/togai_client/models/get_metrics_request.rb +265 -0
  143. data/lib/togai_client/models/get_metrics_response.rb +227 -0
  144. data/lib/togai_client/models/ingest_batch_event_request.rb +255 -0
  145. data/lib/togai_client/models/ingest_batch_event_response.rb +245 -0
  146. data/lib/togai_client/models/ingest_error.rb +229 -0
  147. data/lib/togai_client/models/ingest_event_request.rb +220 -0
  148. data/lib/togai_client/models/ingest_event_response.rb +244 -0
  149. data/lib/togai_client/models/ingestion_status.rb +284 -0
  150. data/lib/togai_client/models/metric_data_points.rb +289 -0
  151. data/lib/togai_client/models/metric_data_points_grouped_by.rb +238 -0
  152. data/lib/togai_client/models/metric_name.rb +38 -0
  153. data/lib/togai_client/models/metric_query.rb +331 -0
  154. data/lib/togai_client/models/metric_query_filter_entry.rb +241 -0
  155. data/lib/togai_client/models/metric_query_response.rb +255 -0
  156. data/lib/togai_client/models/pagination_options.rb +262 -0
  157. data/lib/togai_client/models/plan_override.rb +262 -0
  158. data/lib/togai_client/models/price_plan.rb +349 -0
  159. data/lib/togai_client/models/price_plan_list_data.rb +393 -0
  160. data/lib/togai_client/models/price_plan_paginated_response.rb +239 -0
  161. data/lib/togai_client/models/pricing_cycle.rb +313 -0
  162. data/lib/togai_client/models/pricing_cycle_start_offset.rb +241 -0
  163. data/lib/togai_client/models/pricing_schedule.rb +248 -0
  164. data/lib/togai_client/models/rate_card.rb +279 -0
  165. data/lib/togai_client/models/rate_card_bundle.rb +328 -0
  166. data/lib/togai_client/models/rate_card_usage_value.rb +343 -0
  167. data/lib/togai_client/models/remove_account_aliases_request.rb +247 -0
  168. data/lib/togai_client/models/signup_request.rb +293 -0
  169. data/lib/togai_client/models/signup_response.rb +260 -0
  170. data/lib/togai_client/models/status_response.rb +246 -0
  171. data/lib/togai_client/models/status_response_headers.rb +219 -0
  172. data/lib/togai_client/models/update_account_request.rb +245 -0
  173. data/lib/togai_client/models/update_customer_request.rb +304 -0
  174. data/lib/togai_client/models/update_event_schema_request.rb +306 -0
  175. data/lib/togai_client/models/update_price_plan_request.rb +254 -0
  176. data/lib/togai_client/models/update_usage_meter_request.rb +323 -0
  177. data/lib/togai_client/models/usage_meter.rb +440 -0
  178. data/lib/togai_client/models/usage_meter_paginated_response.rb +239 -0
  179. data/lib/togai_client/models/usage_strategy.rb +281 -0
  180. data/lib/togai_client/models/user_details.rb +380 -0
  181. data/lib/togai_client/version.rb +15 -0
  182. data/lib/togai_client.rb +125 -0
  183. data/spec/api_client_spec.rb +226 -0
  184. data/spec/configuration_spec.rb +42 -0
  185. data/spec/spec_helper.rb +111 -0
  186. data/togai_client.gemspec +38 -0
  187. metadata +271 -0
@@ -0,0 +1,579 @@
1
+ =begin
2
+ #Togai Apis
3
+
4
+ #APIs for Togai App
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: engg@togai.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.1.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module TogaiClient
16
+ class EventSchemasApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Activate an event schema
23
+ # Activate an event schema
24
+ # @param event_schema_name [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [EventSchema]
27
+ def activate_event_schema(event_schema_name, opts = {})
28
+ data, _status_code, _headers = activate_event_schema_with_http_info(event_schema_name, opts)
29
+ data
30
+ end
31
+
32
+ # Activate an event schema
33
+ # Activate an event schema
34
+ # @param event_schema_name [String]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(EventSchema, Integer, Hash)>] EventSchema data, response status code and response headers
37
+ def activate_event_schema_with_http_info(event_schema_name, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: EventSchemasApi.activate_event_schema ...'
40
+ end
41
+ # verify the required parameter 'event_schema_name' is set
42
+ if @api_client.config.client_side_validation && event_schema_name.nil?
43
+ fail ArgumentError, "Missing the required parameter 'event_schema_name' when calling EventSchemasApi.activate_event_schema"
44
+ end
45
+ if @api_client.config.client_side_validation && event_schema_name.to_s.length > 50
46
+ fail ArgumentError, 'invalid value for "event_schema_name" when calling EventSchemasApi.activate_event_schema, the character length must be smaller than or equal to 50.'
47
+ end
48
+
49
+ # resource path
50
+ local_var_path = '/event_schema/{event_schema_name}/activate'.sub('{' + 'event_schema_name' + '}', CGI.escape(event_schema_name.to_s))
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+
55
+ # header parameters
56
+ header_params = opts[:header_params] || {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
+
60
+ # form parameters
61
+ form_params = opts[:form_params] || {}
62
+
63
+ # http body (model)
64
+ post_body = opts[:debug_body]
65
+
66
+ # return_type
67
+ return_type = opts[:debug_return_type] || 'EventSchema'
68
+
69
+ # auth_names
70
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
71
+
72
+ new_options = opts.merge(
73
+ :operation => :"EventSchemasApi.activate_event_schema",
74
+ :header_params => header_params,
75
+ :query_params => query_params,
76
+ :form_params => form_params,
77
+ :body => post_body,
78
+ :auth_names => auth_names,
79
+ :return_type => return_type
80
+ )
81
+
82
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "API called: EventSchemasApi#activate_event_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ end
86
+ return data, status_code, headers
87
+ end
88
+
89
+ # Create an event schema
90
+ # Create an event schema
91
+ # @param create_event_schema_request [CreateEventSchemaRequest] Payload to create event schema
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [EventSchema]
94
+ def create_event_schema(create_event_schema_request, opts = {})
95
+ data, _status_code, _headers = create_event_schema_with_http_info(create_event_schema_request, opts)
96
+ data
97
+ end
98
+
99
+ # Create an event schema
100
+ # Create an event schema
101
+ # @param create_event_schema_request [CreateEventSchemaRequest] Payload to create event schema
102
+ # @param [Hash] opts the optional parameters
103
+ # @return [Array<(EventSchema, Integer, Hash)>] EventSchema data, response status code and response headers
104
+ def create_event_schema_with_http_info(create_event_schema_request, opts = {})
105
+ if @api_client.config.debugging
106
+ @api_client.config.logger.debug 'Calling API: EventSchemasApi.create_event_schema ...'
107
+ end
108
+ # verify the required parameter 'create_event_schema_request' is set
109
+ if @api_client.config.client_side_validation && create_event_schema_request.nil?
110
+ fail ArgumentError, "Missing the required parameter 'create_event_schema_request' when calling EventSchemasApi.create_event_schema"
111
+ end
112
+ # resource path
113
+ local_var_path = '/event_schema'
114
+
115
+ # query parameters
116
+ query_params = opts[:query_params] || {}
117
+
118
+ # header parameters
119
+ header_params = opts[:header_params] || {}
120
+ # HTTP header 'Accept' (if needed)
121
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
122
+ # HTTP header 'Content-Type'
123
+ content_type = @api_client.select_header_content_type(['application/json'])
124
+ if !content_type.nil?
125
+ header_params['Content-Type'] = content_type
126
+ end
127
+
128
+ # form parameters
129
+ form_params = opts[:form_params] || {}
130
+
131
+ # http body (model)
132
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_event_schema_request)
133
+
134
+ # return_type
135
+ return_type = opts[:debug_return_type] || 'EventSchema'
136
+
137
+ # auth_names
138
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
139
+
140
+ new_options = opts.merge(
141
+ :operation => :"EventSchemasApi.create_event_schema",
142
+ :header_params => header_params,
143
+ :query_params => query_params,
144
+ :form_params => form_params,
145
+ :body => post_body,
146
+ :auth_names => auth_names,
147
+ :return_type => return_type
148
+ )
149
+
150
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
151
+ if @api_client.config.debugging
152
+ @api_client.config.logger.debug "API called: EventSchemasApi#create_event_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
153
+ end
154
+ return data, status_code, headers
155
+ end
156
+
157
+ # Deactivate an event schema
158
+ # Deactivate an event schema
159
+ # @param event_schema_name [String]
160
+ # @param [Hash] opts the optional parameters
161
+ # @return [EventSchema]
162
+ def deactivate_event_schema(event_schema_name, opts = {})
163
+ data, _status_code, _headers = deactivate_event_schema_with_http_info(event_schema_name, opts)
164
+ data
165
+ end
166
+
167
+ # Deactivate an event schema
168
+ # Deactivate an event schema
169
+ # @param event_schema_name [String]
170
+ # @param [Hash] opts the optional parameters
171
+ # @return [Array<(EventSchema, Integer, Hash)>] EventSchema data, response status code and response headers
172
+ def deactivate_event_schema_with_http_info(event_schema_name, opts = {})
173
+ if @api_client.config.debugging
174
+ @api_client.config.logger.debug 'Calling API: EventSchemasApi.deactivate_event_schema ...'
175
+ end
176
+ # verify the required parameter 'event_schema_name' is set
177
+ if @api_client.config.client_side_validation && event_schema_name.nil?
178
+ fail ArgumentError, "Missing the required parameter 'event_schema_name' when calling EventSchemasApi.deactivate_event_schema"
179
+ end
180
+ if @api_client.config.client_side_validation && event_schema_name.to_s.length > 50
181
+ fail ArgumentError, 'invalid value for "event_schema_name" when calling EventSchemasApi.deactivate_event_schema, the character length must be smaller than or equal to 50.'
182
+ end
183
+
184
+ # resource path
185
+ local_var_path = '/event_schema/{event_schema_name}/deactivate'.sub('{' + 'event_schema_name' + '}', CGI.escape(event_schema_name.to_s))
186
+
187
+ # query parameters
188
+ query_params = opts[:query_params] || {}
189
+
190
+ # header parameters
191
+ header_params = opts[:header_params] || {}
192
+ # HTTP header 'Accept' (if needed)
193
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
194
+
195
+ # form parameters
196
+ form_params = opts[:form_params] || {}
197
+
198
+ # http body (model)
199
+ post_body = opts[:debug_body]
200
+
201
+ # return_type
202
+ return_type = opts[:debug_return_type] || 'EventSchema'
203
+
204
+ # auth_names
205
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
206
+
207
+ new_options = opts.merge(
208
+ :operation => :"EventSchemasApi.deactivate_event_schema",
209
+ :header_params => header_params,
210
+ :query_params => query_params,
211
+ :form_params => form_params,
212
+ :body => post_body,
213
+ :auth_names => auth_names,
214
+ :return_type => return_type
215
+ )
216
+
217
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
218
+ if @api_client.config.debugging
219
+ @api_client.config.logger.debug "API called: EventSchemasApi#deactivate_event_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
220
+ end
221
+ return data, status_code, headers
222
+ end
223
+
224
+ # Delete an event schema
225
+ # Delete an event schema
226
+ # @param event_schema_name [String]
227
+ # @param [Hash] opts the optional parameters
228
+ # @return [BaseSuccessResponse]
229
+ def delete_event_schema(event_schema_name, opts = {})
230
+ data, _status_code, _headers = delete_event_schema_with_http_info(event_schema_name, opts)
231
+ data
232
+ end
233
+
234
+ # Delete an event schema
235
+ # Delete an event schema
236
+ # @param event_schema_name [String]
237
+ # @param [Hash] opts the optional parameters
238
+ # @return [Array<(BaseSuccessResponse, Integer, Hash)>] BaseSuccessResponse data, response status code and response headers
239
+ def delete_event_schema_with_http_info(event_schema_name, opts = {})
240
+ if @api_client.config.debugging
241
+ @api_client.config.logger.debug 'Calling API: EventSchemasApi.delete_event_schema ...'
242
+ end
243
+ # verify the required parameter 'event_schema_name' is set
244
+ if @api_client.config.client_side_validation && event_schema_name.nil?
245
+ fail ArgumentError, "Missing the required parameter 'event_schema_name' when calling EventSchemasApi.delete_event_schema"
246
+ end
247
+ if @api_client.config.client_side_validation && event_schema_name.to_s.length > 50
248
+ fail ArgumentError, 'invalid value for "event_schema_name" when calling EventSchemasApi.delete_event_schema, the character length must be smaller than or equal to 50.'
249
+ end
250
+
251
+ # resource path
252
+ local_var_path = '/event_schema/{event_schema_name}'.sub('{' + 'event_schema_name' + '}', CGI.escape(event_schema_name.to_s))
253
+
254
+ # query parameters
255
+ query_params = opts[:query_params] || {}
256
+
257
+ # header parameters
258
+ header_params = opts[:header_params] || {}
259
+ # HTTP header 'Accept' (if needed)
260
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
261
+
262
+ # form parameters
263
+ form_params = opts[:form_params] || {}
264
+
265
+ # http body (model)
266
+ post_body = opts[:debug_body]
267
+
268
+ # return_type
269
+ return_type = opts[:debug_return_type] || 'BaseSuccessResponse'
270
+
271
+ # auth_names
272
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
273
+
274
+ new_options = opts.merge(
275
+ :operation => :"EventSchemasApi.delete_event_schema",
276
+ :header_params => header_params,
277
+ :query_params => query_params,
278
+ :form_params => form_params,
279
+ :body => post_body,
280
+ :auth_names => auth_names,
281
+ :return_type => return_type
282
+ )
283
+
284
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
285
+ if @api_client.config.debugging
286
+ @api_client.config.logger.debug "API called: EventSchemasApi#delete_event_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
287
+ end
288
+ return data, status_code, headers
289
+ end
290
+
291
+ # Get an event schema
292
+ # Get an event schema
293
+ # @param event_schema_name [String]
294
+ # @param [Hash] opts the optional parameters
295
+ # @option opts [Integer] :version Optional version to get a specific version. Gets latest version if it is not provided.
296
+ # @return [EventSchema]
297
+ def get_event_schema(event_schema_name, opts = {})
298
+ data, _status_code, _headers = get_event_schema_with_http_info(event_schema_name, opts)
299
+ data
300
+ end
301
+
302
+ # Get an event schema
303
+ # Get an event schema
304
+ # @param event_schema_name [String]
305
+ # @param [Hash] opts the optional parameters
306
+ # @option opts [Integer] :version Optional version to get a specific version. Gets latest version if it is not provided.
307
+ # @return [Array<(EventSchema, Integer, Hash)>] EventSchema data, response status code and response headers
308
+ def get_event_schema_with_http_info(event_schema_name, opts = {})
309
+ if @api_client.config.debugging
310
+ @api_client.config.logger.debug 'Calling API: EventSchemasApi.get_event_schema ...'
311
+ end
312
+ # verify the required parameter 'event_schema_name' is set
313
+ if @api_client.config.client_side_validation && event_schema_name.nil?
314
+ fail ArgumentError, "Missing the required parameter 'event_schema_name' when calling EventSchemasApi.get_event_schema"
315
+ end
316
+ if @api_client.config.client_side_validation && event_schema_name.to_s.length > 50
317
+ fail ArgumentError, 'invalid value for "event_schema_name" when calling EventSchemasApi.get_event_schema, the character length must be smaller than or equal to 50.'
318
+ end
319
+
320
+ # resource path
321
+ local_var_path = '/event_schema/{event_schema_name}'.sub('{' + 'event_schema_name' + '}', CGI.escape(event_schema_name.to_s))
322
+
323
+ # query parameters
324
+ query_params = opts[:query_params] || {}
325
+ query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil?
326
+
327
+ # header parameters
328
+ header_params = opts[:header_params] || {}
329
+ # HTTP header 'Accept' (if needed)
330
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
331
+
332
+ # form parameters
333
+ form_params = opts[:form_params] || {}
334
+
335
+ # http body (model)
336
+ post_body = opts[:debug_body]
337
+
338
+ # return_type
339
+ return_type = opts[:debug_return_type] || 'EventSchema'
340
+
341
+ # auth_names
342
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
343
+
344
+ new_options = opts.merge(
345
+ :operation => :"EventSchemasApi.get_event_schema",
346
+ :header_params => header_params,
347
+ :query_params => query_params,
348
+ :form_params => form_params,
349
+ :body => post_body,
350
+ :auth_names => auth_names,
351
+ :return_type => return_type
352
+ )
353
+
354
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
355
+ if @api_client.config.debugging
356
+ @api_client.config.logger.debug "API called: EventSchemasApi#get_event_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
357
+ end
358
+ return data, status_code, headers
359
+ end
360
+
361
+ # List all event schema versions
362
+ # List all event schema versions
363
+ # @param event_schema_name [String]
364
+ # @param [Hash] opts the optional parameters
365
+ # @return [EventSchemaVersionsResponse]
366
+ def list_event_schema_versions(event_schema_name, opts = {})
367
+ data, _status_code, _headers = list_event_schema_versions_with_http_info(event_schema_name, opts)
368
+ data
369
+ end
370
+
371
+ # List all event schema versions
372
+ # List all event schema versions
373
+ # @param event_schema_name [String]
374
+ # @param [Hash] opts the optional parameters
375
+ # @return [Array<(EventSchemaVersionsResponse, Integer, Hash)>] EventSchemaVersionsResponse data, response status code and response headers
376
+ def list_event_schema_versions_with_http_info(event_schema_name, opts = {})
377
+ if @api_client.config.debugging
378
+ @api_client.config.logger.debug 'Calling API: EventSchemasApi.list_event_schema_versions ...'
379
+ end
380
+ # verify the required parameter 'event_schema_name' is set
381
+ if @api_client.config.client_side_validation && event_schema_name.nil?
382
+ fail ArgumentError, "Missing the required parameter 'event_schema_name' when calling EventSchemasApi.list_event_schema_versions"
383
+ end
384
+ if @api_client.config.client_side_validation && event_schema_name.to_s.length > 50
385
+ fail ArgumentError, 'invalid value for "event_schema_name" when calling EventSchemasApi.list_event_schema_versions, the character length must be smaller than or equal to 50.'
386
+ end
387
+
388
+ # resource path
389
+ local_var_path = '/event_schema/{event_schema_name}/versions'.sub('{' + 'event_schema_name' + '}', CGI.escape(event_schema_name.to_s))
390
+
391
+ # query parameters
392
+ query_params = opts[:query_params] || {}
393
+
394
+ # header parameters
395
+ header_params = opts[:header_params] || {}
396
+ # HTTP header 'Accept' (if needed)
397
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
398
+
399
+ # form parameters
400
+ form_params = opts[:form_params] || {}
401
+
402
+ # http body (model)
403
+ post_body = opts[:debug_body]
404
+
405
+ # return_type
406
+ return_type = opts[:debug_return_type] || 'EventSchemaVersionsResponse'
407
+
408
+ # auth_names
409
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
410
+
411
+ new_options = opts.merge(
412
+ :operation => :"EventSchemasApi.list_event_schema_versions",
413
+ :header_params => header_params,
414
+ :query_params => query_params,
415
+ :form_params => form_params,
416
+ :body => post_body,
417
+ :auth_names => auth_names,
418
+ :return_type => return_type
419
+ )
420
+
421
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
422
+ if @api_client.config.debugging
423
+ @api_client.config.logger.debug "API called: EventSchemasApi#list_event_schema_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
424
+ end
425
+ return data, status_code, headers
426
+ end
427
+
428
+ # List event schemas
429
+ # List event schemas with pagination and sort
430
+ # @param [Hash] opts the optional parameters
431
+ # @option opts [String] :statuses Filter by provided statuses
432
+ # @option opts [String] :next_token
433
+ # @option opts [String] :page_size
434
+ # @option opts [String] :sort_order
435
+ # @return [EventSchemaListPaginatedResponse]
436
+ def list_event_schemas(opts = {})
437
+ data, _status_code, _headers = list_event_schemas_with_http_info(opts)
438
+ data
439
+ end
440
+
441
+ # List event schemas
442
+ # List event schemas with pagination and sort
443
+ # @param [Hash] opts the optional parameters
444
+ # @option opts [String] :statuses Filter by provided statuses
445
+ # @option opts [String] :next_token
446
+ # @option opts [String] :page_size
447
+ # @option opts [String] :sort_order
448
+ # @return [Array<(EventSchemaListPaginatedResponse, Integer, Hash)>] EventSchemaListPaginatedResponse data, response status code and response headers
449
+ def list_event_schemas_with_http_info(opts = {})
450
+ if @api_client.config.debugging
451
+ @api_client.config.logger.debug 'Calling API: EventSchemasApi.list_event_schemas ...'
452
+ end
453
+ allowable_values = ["ASC", "DESC"]
454
+ if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order'])
455
+ fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}"
456
+ end
457
+ # resource path
458
+ local_var_path = '/event_schema'
459
+
460
+ # query parameters
461
+ query_params = opts[:query_params] || {}
462
+ query_params[:'statuses'] = opts[:'statuses'] if !opts[:'statuses'].nil?
463
+ query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
464
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
465
+ query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
466
+
467
+ # header parameters
468
+ header_params = opts[:header_params] || {}
469
+ # HTTP header 'Accept' (if needed)
470
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
471
+
472
+ # form parameters
473
+ form_params = opts[:form_params] || {}
474
+
475
+ # http body (model)
476
+ post_body = opts[:debug_body]
477
+
478
+ # return_type
479
+ return_type = opts[:debug_return_type] || 'EventSchemaListPaginatedResponse'
480
+
481
+ # auth_names
482
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
483
+
484
+ new_options = opts.merge(
485
+ :operation => :"EventSchemasApi.list_event_schemas",
486
+ :header_params => header_params,
487
+ :query_params => query_params,
488
+ :form_params => form_params,
489
+ :body => post_body,
490
+ :auth_names => auth_names,
491
+ :return_type => return_type
492
+ )
493
+
494
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
495
+ if @api_client.config.debugging
496
+ @api_client.config.logger.debug "API called: EventSchemasApi#list_event_schemas\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
497
+ end
498
+ return data, status_code, headers
499
+ end
500
+
501
+ # Update an event schema
502
+ # Update an event schema
503
+ # @param event_schema_name [String]
504
+ # @param update_event_schema_request [UpdateEventSchemaRequest] Payload to update event schema
505
+ # @param [Hash] opts the optional parameters
506
+ # @return [EventSchema]
507
+ def update_event_schema(event_schema_name, update_event_schema_request, opts = {})
508
+ data, _status_code, _headers = update_event_schema_with_http_info(event_schema_name, update_event_schema_request, opts)
509
+ data
510
+ end
511
+
512
+ # Update an event schema
513
+ # Update an event schema
514
+ # @param event_schema_name [String]
515
+ # @param update_event_schema_request [UpdateEventSchemaRequest] Payload to update event schema
516
+ # @param [Hash] opts the optional parameters
517
+ # @return [Array<(EventSchema, Integer, Hash)>] EventSchema data, response status code and response headers
518
+ def update_event_schema_with_http_info(event_schema_name, update_event_schema_request, opts = {})
519
+ if @api_client.config.debugging
520
+ @api_client.config.logger.debug 'Calling API: EventSchemasApi.update_event_schema ...'
521
+ end
522
+ # verify the required parameter 'event_schema_name' is set
523
+ if @api_client.config.client_side_validation && event_schema_name.nil?
524
+ fail ArgumentError, "Missing the required parameter 'event_schema_name' when calling EventSchemasApi.update_event_schema"
525
+ end
526
+ if @api_client.config.client_side_validation && event_schema_name.to_s.length > 50
527
+ fail ArgumentError, 'invalid value for "event_schema_name" when calling EventSchemasApi.update_event_schema, the character length must be smaller than or equal to 50.'
528
+ end
529
+
530
+ # verify the required parameter 'update_event_schema_request' is set
531
+ if @api_client.config.client_side_validation && update_event_schema_request.nil?
532
+ fail ArgumentError, "Missing the required parameter 'update_event_schema_request' when calling EventSchemasApi.update_event_schema"
533
+ end
534
+ # resource path
535
+ local_var_path = '/event_schema/{event_schema_name}'.sub('{' + 'event_schema_name' + '}', CGI.escape(event_schema_name.to_s))
536
+
537
+ # query parameters
538
+ query_params = opts[:query_params] || {}
539
+
540
+ # header parameters
541
+ header_params = opts[:header_params] || {}
542
+ # HTTP header 'Accept' (if needed)
543
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
544
+ # HTTP header 'Content-Type'
545
+ content_type = @api_client.select_header_content_type(['application/json'])
546
+ if !content_type.nil?
547
+ header_params['Content-Type'] = content_type
548
+ end
549
+
550
+ # form parameters
551
+ form_params = opts[:form_params] || {}
552
+
553
+ # http body (model)
554
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_event_schema_request)
555
+
556
+ # return_type
557
+ return_type = opts[:debug_return_type] || 'EventSchema'
558
+
559
+ # auth_names
560
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
561
+
562
+ new_options = opts.merge(
563
+ :operation => :"EventSchemasApi.update_event_schema",
564
+ :header_params => header_params,
565
+ :query_params => query_params,
566
+ :form_params => form_params,
567
+ :body => post_body,
568
+ :auth_names => auth_names,
569
+ :return_type => return_type
570
+ )
571
+
572
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
573
+ if @api_client.config.debugging
574
+ @api_client.config.logger.debug "API called: EventSchemasApi#update_event_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
575
+ end
576
+ return data, status_code, headers
577
+ end
578
+ end
579
+ end
@@ -0,0 +1,86 @@
1
+ =begin
2
+ #Togai Apis
3
+
4
+ #APIs for Togai App
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: engg@togai.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.1.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module TogaiClient
16
+ class MetricsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get togai metrics.
23
+ # To get the metrics, you make a POST request to the /metrics resource. You can query up to five metrics in a single request. Single response dataset can contain a maximum of 100 data points.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [GetMetricsRequest] :get_metrics_request
26
+ # @return [GetMetricsResponse]
27
+ def get_metrics(opts = {})
28
+ data, _status_code, _headers = get_metrics_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # Get togai metrics.
33
+ # To get the metrics, you make a POST request to the /metrics resource. You can query up to five metrics in a single request. Single response dataset can contain a maximum of 100 data points.
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [GetMetricsRequest] :get_metrics_request
36
+ # @return [Array<(GetMetricsResponse, Integer, Hash)>] GetMetricsResponse data, response status code and response headers
37
+ def get_metrics_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: MetricsApi.get_metrics ...'
40
+ end
41
+ # resource path
42
+ local_var_path = '/metrics'
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+
47
+ # header parameters
48
+ header_params = opts[:header_params] || {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
51
+ # HTTP header 'Content-Type'
52
+ content_type = @api_client.select_header_content_type(['application/json'])
53
+ if !content_type.nil?
54
+ header_params['Content-Type'] = content_type
55
+ end
56
+
57
+ # form parameters
58
+ form_params = opts[:form_params] || {}
59
+
60
+ # http body (model)
61
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'get_metrics_request'])
62
+
63
+ # return_type
64
+ return_type = opts[:debug_return_type] || 'GetMetricsResponse'
65
+
66
+ # auth_names
67
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
68
+
69
+ new_options = opts.merge(
70
+ :operation => :"MetricsApi.get_metrics",
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: MetricsApi#get_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+ end
86
+ end