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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +61 -0
- data/Rakefile +10 -0
- data/docs/Account.md +24 -0
- data/docs/AccountAliases.md +20 -0
- data/docs/AccountPaginatedResponse.md +22 -0
- data/docs/AccountsApi.md +595 -0
- data/docs/AddAccountAliasesRequest.md +18 -0
- data/docs/AssociatePricePlanRequest.md +24 -0
- data/docs/AssociatePricePlanResponse.md +22 -0
- data/docs/BaseSuccessResponse.md +18 -0
- data/docs/BundleStrategy.md +24 -0
- data/docs/BundleStrategyUsageMetersValue.md +18 -0
- data/docs/Computation.md +31 -0
- data/docs/CreateAccountRequest.md +22 -0
- data/docs/CreateCustomerRequest.md +26 -0
- data/docs/CreateCustomerResponse.md +26 -0
- data/docs/CreateEventSchemaRequest.md +24 -0
- data/docs/CreatePricePlanRequest.md +24 -0
- data/docs/CreateUsageMeterRequest.md +26 -0
- data/docs/Customer.md +30 -0
- data/docs/CustomerPaginatedResponse.md +22 -0
- data/docs/CustomersApi.md +363 -0
- data/docs/DimensionsSchema.md +18 -0
- data/docs/ErrorResponse.md +18 -0
- data/docs/Event.md +28 -0
- data/docs/EventAttribute.md +22 -0
- data/docs/EventAttributeSchema.md +20 -0
- data/docs/EventIngestionApi.md +146 -0
- data/docs/EventManagementApi.md +159 -0
- data/docs/EventPipelineInfo.md +26 -0
- data/docs/EventPipelineInfoAccount.md +20 -0
- data/docs/EventPipelineInfoCustomer.md +20 -0
- data/docs/EventPipelineInfoEventSchema.md +20 -0
- data/docs/EventPipelineInfoPricePlansInner.md +26 -0
- data/docs/EventPipelineInfoUsageMetersInner.md +24 -0
- data/docs/EventSchema.md +32 -0
- data/docs/EventSchemaListData.md +34 -0
- data/docs/EventSchemaListDataAllOf.md +18 -0
- data/docs/EventSchemaListPaginatedResponse.md +22 -0
- data/docs/EventSchemaVersionsResponse.md +18 -0
- data/docs/EventSchemasApi.md +581 -0
- data/docs/EventWithStatus.md +20 -0
- data/docs/EventWithStatusAndEventPipelineInfo.md +22 -0
- data/docs/EventWithStatusAndEventPipelineInfoAllOf.md +18 -0
- data/docs/GetEventResponse.md +18 -0
- data/docs/GetEventsResponse.md +20 -0
- data/docs/GetMetricsRequest.md +22 -0
- data/docs/GetMetricsResponse.md +18 -0
- data/docs/IngestBatchEventRequest.md +18 -0
- data/docs/IngestBatchEventResponse.md +18 -0
- data/docs/IngestError.md +20 -0
- data/docs/IngestEventRequest.md +18 -0
- data/docs/IngestEventResponse.md +18 -0
- data/docs/IngestionStatus.md +20 -0
- data/docs/MetricDataPoints.md +22 -0
- data/docs/MetricDataPointsGroupedBy.md +20 -0
- data/docs/MetricName.md +15 -0
- data/docs/MetricQuery.md +26 -0
- data/docs/MetricQueryFilterEntry.md +20 -0
- data/docs/MetricQueryResponse.md +22 -0
- data/docs/MetricsApi.md +79 -0
- data/docs/PaginationOptions.md +20 -0
- data/docs/PlanOverride.md +24 -0
- data/docs/PricePlan.md +26 -0
- data/docs/PricePlanListData.md +32 -0
- data/docs/PricePlanPaginatedResponse.md +22 -0
- data/docs/PricePlansApi.md +363 -0
- data/docs/PricingCycle.md +24 -0
- data/docs/PricingCycleStartOffset.md +20 -0
- data/docs/PricingSchedule.md +22 -0
- data/docs/RateCard.md +22 -0
- data/docs/RateCardBundle.md +22 -0
- data/docs/RateCardUsageValue.md +24 -0
- data/docs/RemoveAccountAliasesRequest.md +18 -0
- data/docs/SignupRequest.md +22 -0
- data/docs/SignupResponse.md +20 -0
- data/docs/StatusResponse.md +24 -0
- data/docs/StatusResponseHeaders.md +18 -0
- data/docs/UpdateAccountRequest.md +18 -0
- data/docs/UpdateCustomerRequest.md +22 -0
- data/docs/UpdateEventSchemaRequest.md +22 -0
- data/docs/UpdatePricePlanRequest.md +22 -0
- data/docs/UpdateUsageMeterRequest.md +24 -0
- data/docs/UsageMeter.md +34 -0
- data/docs/UsageMeterPaginatedResponse.md +22 -0
- data/docs/UsageMetersApi.md +521 -0
- data/docs/UsageStrategy.md +22 -0
- data/docs/UserDetails.md +26 -0
- data/git_push.sh +57 -0
- data/lib/togai_client/api/accounts_api.rb +679 -0
- data/lib/togai_client/api/customers_api.rb +365 -0
- data/lib/togai_client/api/event_ingestion_api.rb +158 -0
- data/lib/togai_client/api/event_management_api.rb +164 -0
- data/lib/togai_client/api/event_schemas_api.rb +579 -0
- data/lib/togai_client/api/metrics_api.rb +86 -0
- data/lib/togai_client/api/price_plans_api.rb +365 -0
- data/lib/togai_client/api/usage_meters_api.rb +572 -0
- data/lib/togai_client/api_client.rb +392 -0
- data/lib/togai_client/api_error.rb +57 -0
- data/lib/togai_client/configuration.rb +287 -0
- data/lib/togai_client/models/account.rb +373 -0
- data/lib/togai_client/models/account_aliases.rb +277 -0
- data/lib/togai_client/models/account_paginated_response.rb +239 -0
- data/lib/togai_client/models/add_account_aliases_request.rb +247 -0
- data/lib/togai_client/models/associate_price_plan_request.rb +274 -0
- data/lib/togai_client/models/associate_price_plan_response.rb +275 -0
- data/lib/togai_client/models/base_success_response.rb +224 -0
- data/lib/togai_client/models/bundle_strategy.rb +325 -0
- data/lib/togai_client/models/bundle_strategy_usage_meters_value.rb +224 -0
- data/lib/togai_client/models/computation.rb +294 -0
- data/lib/togai_client/models/create_account_request.rb +324 -0
- data/lib/togai_client/models/create_customer_request.rb +374 -0
- data/lib/togai_client/models/create_customer_response.rb +373 -0
- data/lib/togai_client/models/create_event_schema_request.rb +351 -0
- data/lib/togai_client/models/create_price_plan_request.rb +298 -0
- data/lib/togai_client/models/create_usage_meter_request.rb +368 -0
- data/lib/togai_client/models/customer.rb +442 -0
- data/lib/togai_client/models/customer_paginated_response.rb +239 -0
- data/lib/togai_client/models/dimensions_schema.rb +256 -0
- data/lib/togai_client/models/error_response.rb +244 -0
- data/lib/togai_client/models/event.rb +379 -0
- data/lib/togai_client/models/event_attribute.rb +304 -0
- data/lib/togai_client/models/event_attribute_schema.rb +281 -0
- data/lib/togai_client/models/event_pipeline_info.rb +260 -0
- data/lib/togai_client/models/event_pipeline_info_account.rb +238 -0
- data/lib/togai_client/models/event_pipeline_info_customer.rb +238 -0
- data/lib/togai_client/models/event_pipeline_info_event_schema.rb +238 -0
- data/lib/togai_client/models/event_pipeline_info_price_plans_inner.rb +283 -0
- data/lib/togai_client/models/event_pipeline_info_usage_meters_inner.rb +295 -0
- data/lib/togai_client/models/event_schema.rb +438 -0
- data/lib/togai_client/models/event_schema_list_data.rb +456 -0
- data/lib/togai_client/models/event_schema_list_data_all_of.rb +221 -0
- data/lib/togai_client/models/event_schema_list_paginated_response.rb +239 -0
- data/lib/togai_client/models/event_schema_versions_response.rb +227 -0
- data/lib/togai_client/models/event_with_status.rb +239 -0
- data/lib/togai_client/models/event_with_status_and_event_pipeline_info.rb +255 -0
- data/lib/togai_client/models/event_with_status_and_event_pipeline_info_all_of.rb +219 -0
- data/lib/togai_client/models/get_event_response.rb +222 -0
- data/lib/togai_client/models/get_events_response.rb +279 -0
- data/lib/togai_client/models/get_metrics_request.rb +265 -0
- data/lib/togai_client/models/get_metrics_response.rb +227 -0
- data/lib/togai_client/models/ingest_batch_event_request.rb +255 -0
- data/lib/togai_client/models/ingest_batch_event_response.rb +245 -0
- data/lib/togai_client/models/ingest_error.rb +229 -0
- data/lib/togai_client/models/ingest_event_request.rb +220 -0
- data/lib/togai_client/models/ingest_event_response.rb +244 -0
- data/lib/togai_client/models/ingestion_status.rb +284 -0
- data/lib/togai_client/models/metric_data_points.rb +289 -0
- data/lib/togai_client/models/metric_data_points_grouped_by.rb +238 -0
- data/lib/togai_client/models/metric_name.rb +38 -0
- data/lib/togai_client/models/metric_query.rb +331 -0
- data/lib/togai_client/models/metric_query_filter_entry.rb +241 -0
- data/lib/togai_client/models/metric_query_response.rb +255 -0
- data/lib/togai_client/models/pagination_options.rb +262 -0
- data/lib/togai_client/models/plan_override.rb +262 -0
- data/lib/togai_client/models/price_plan.rb +349 -0
- data/lib/togai_client/models/price_plan_list_data.rb +393 -0
- data/lib/togai_client/models/price_plan_paginated_response.rb +239 -0
- data/lib/togai_client/models/pricing_cycle.rb +313 -0
- data/lib/togai_client/models/pricing_cycle_start_offset.rb +241 -0
- data/lib/togai_client/models/pricing_schedule.rb +248 -0
- data/lib/togai_client/models/rate_card.rb +279 -0
- data/lib/togai_client/models/rate_card_bundle.rb +328 -0
- data/lib/togai_client/models/rate_card_usage_value.rb +343 -0
- data/lib/togai_client/models/remove_account_aliases_request.rb +247 -0
- data/lib/togai_client/models/signup_request.rb +293 -0
- data/lib/togai_client/models/signup_response.rb +260 -0
- data/lib/togai_client/models/status_response.rb +246 -0
- data/lib/togai_client/models/status_response_headers.rb +219 -0
- data/lib/togai_client/models/update_account_request.rb +245 -0
- data/lib/togai_client/models/update_customer_request.rb +304 -0
- data/lib/togai_client/models/update_event_schema_request.rb +306 -0
- data/lib/togai_client/models/update_price_plan_request.rb +254 -0
- data/lib/togai_client/models/update_usage_meter_request.rb +323 -0
- data/lib/togai_client/models/usage_meter.rb +440 -0
- data/lib/togai_client/models/usage_meter_paginated_response.rb +239 -0
- data/lib/togai_client/models/usage_strategy.rb +281 -0
- data/lib/togai_client/models/user_details.rb +380 -0
- data/lib/togai_client/version.rb +15 -0
- data/lib/togai_client.rb +125 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/spec_helper.rb +111 -0
- data/togai_client.gemspec +38 -0
- metadata +271 -0
@@ -0,0 +1,365 @@
|
|
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 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
|
+
# Create a customer and a default account corresponding to it
|
24
|
+
# @param create_customer_request [CreateCustomerRequest] Payload to create customer
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [CreateCustomerResponse]
|
27
|
+
def create_customer(create_customer_request, opts = {})
|
28
|
+
data, _status_code, _headers = create_customer_with_http_info(create_customer_request, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create a customer
|
33
|
+
# Create a customer and a default account corresponding to it
|
34
|
+
# @param create_customer_request [CreateCustomerRequest] Payload to create customer
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(CreateCustomerResponse, Integer, Hash)>] CreateCustomerResponse data, response status code and response headers
|
37
|
+
def create_customer_with_http_info(create_customer_request, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: CustomersApi.create_customer ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'create_customer_request' is set
|
42
|
+
if @api_client.config.client_side_validation && create_customer_request.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'create_customer_request' when calling CustomersApi.create_customer"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/customers'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
57
|
+
if !content_type.nil?
|
58
|
+
header_params['Content-Type'] = content_type
|
59
|
+
end
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = opts[:form_params] || {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_customer_request)
|
66
|
+
|
67
|
+
# return_type
|
68
|
+
return_type = opts[:debug_return_type] || 'CreateCustomerResponse'
|
69
|
+
|
70
|
+
# auth_names
|
71
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
72
|
+
|
73
|
+
new_options = opts.merge(
|
74
|
+
:operation => :"CustomersApi.create_customer",
|
75
|
+
:header_params => header_params,
|
76
|
+
:query_params => query_params,
|
77
|
+
:form_params => form_params,
|
78
|
+
:body => post_body,
|
79
|
+
:auth_names => auth_names,
|
80
|
+
:return_type => return_type
|
81
|
+
)
|
82
|
+
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug "API called: CustomersApi#create_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
|
90
|
+
# Delete a customer
|
91
|
+
# Delete a customer by id
|
92
|
+
# @param customer_id [String]
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [BaseSuccessResponse]
|
95
|
+
def delete_customer(customer_id, opts = {})
|
96
|
+
data, _status_code, _headers = delete_customer_with_http_info(customer_id, opts)
|
97
|
+
data
|
98
|
+
end
|
99
|
+
|
100
|
+
# Delete a customer
|
101
|
+
# Delete a customer by id
|
102
|
+
# @param customer_id [String]
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @return [Array<(BaseSuccessResponse, Integer, Hash)>] BaseSuccessResponse data, response status code and response headers
|
105
|
+
def delete_customer_with_http_info(customer_id, opts = {})
|
106
|
+
if @api_client.config.debugging
|
107
|
+
@api_client.config.logger.debug 'Calling API: CustomersApi.delete_customer ...'
|
108
|
+
end
|
109
|
+
# verify the required parameter 'customer_id' is set
|
110
|
+
if @api_client.config.client_side_validation && customer_id.nil?
|
111
|
+
fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.delete_customer"
|
112
|
+
end
|
113
|
+
if @api_client.config.client_side_validation && customer_id.to_s.length > 50
|
114
|
+
fail ArgumentError, 'invalid value for "customer_id" when calling CustomersApi.delete_customer, the character length must be smaller than or equal to 50.'
|
115
|
+
end
|
116
|
+
|
117
|
+
# resource path
|
118
|
+
local_var_path = '/customers/{customer_id}'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s))
|
119
|
+
|
120
|
+
# query parameters
|
121
|
+
query_params = opts[:query_params] || {}
|
122
|
+
|
123
|
+
# header parameters
|
124
|
+
header_params = opts[:header_params] || {}
|
125
|
+
# HTTP header 'Accept' (if needed)
|
126
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
127
|
+
|
128
|
+
# form parameters
|
129
|
+
form_params = opts[:form_params] || {}
|
130
|
+
|
131
|
+
# http body (model)
|
132
|
+
post_body = opts[:debug_body]
|
133
|
+
|
134
|
+
# return_type
|
135
|
+
return_type = opts[:debug_return_type] || 'BaseSuccessResponse'
|
136
|
+
|
137
|
+
# auth_names
|
138
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
139
|
+
|
140
|
+
new_options = opts.merge(
|
141
|
+
:operation => :"CustomersApi.delete_customer",
|
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(:DELETE, local_var_path, new_options)
|
151
|
+
if @api_client.config.debugging
|
152
|
+
@api_client.config.logger.debug "API called: CustomersApi#delete_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
153
|
+
end
|
154
|
+
return data, status_code, headers
|
155
|
+
end
|
156
|
+
|
157
|
+
# Get a customer
|
158
|
+
# Get a customer by id
|
159
|
+
# @param customer_id [String]
|
160
|
+
# @param [Hash] opts the optional parameters
|
161
|
+
# @return [Customer]
|
162
|
+
def get_customer(customer_id, opts = {})
|
163
|
+
data, _status_code, _headers = get_customer_with_http_info(customer_id, opts)
|
164
|
+
data
|
165
|
+
end
|
166
|
+
|
167
|
+
# Get a customer
|
168
|
+
# Get a customer by id
|
169
|
+
# @param customer_id [String]
|
170
|
+
# @param [Hash] opts the optional parameters
|
171
|
+
# @return [Array<(Customer, Integer, Hash)>] Customer data, response status code and response headers
|
172
|
+
def get_customer_with_http_info(customer_id, opts = {})
|
173
|
+
if @api_client.config.debugging
|
174
|
+
@api_client.config.logger.debug 'Calling API: CustomersApi.get_customer ...'
|
175
|
+
end
|
176
|
+
# verify the required parameter 'customer_id' is set
|
177
|
+
if @api_client.config.client_side_validation && customer_id.nil?
|
178
|
+
fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.get_customer"
|
179
|
+
end
|
180
|
+
if @api_client.config.client_side_validation && customer_id.to_s.length > 50
|
181
|
+
fail ArgumentError, 'invalid value for "customer_id" when calling CustomersApi.get_customer, the character length must be smaller than or equal to 50.'
|
182
|
+
end
|
183
|
+
|
184
|
+
# resource path
|
185
|
+
local_var_path = '/customers/{customer_id}'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.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] || 'Customer'
|
203
|
+
|
204
|
+
# auth_names
|
205
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
206
|
+
|
207
|
+
new_options = opts.merge(
|
208
|
+
:operation => :"CustomersApi.get_customer",
|
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(:GET, local_var_path, new_options)
|
218
|
+
if @api_client.config.debugging
|
219
|
+
@api_client.config.logger.debug "API called: CustomersApi#get_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
220
|
+
end
|
221
|
+
return data, status_code, headers
|
222
|
+
end
|
223
|
+
|
224
|
+
# List customers
|
225
|
+
# List customers with pagination and sort
|
226
|
+
# @param [Hash] opts the optional parameters
|
227
|
+
# @option opts [String] :next_token
|
228
|
+
# @option opts [String] :page_size
|
229
|
+
# @return [CustomerPaginatedResponse]
|
230
|
+
def get_customers(opts = {})
|
231
|
+
data, _status_code, _headers = get_customers_with_http_info(opts)
|
232
|
+
data
|
233
|
+
end
|
234
|
+
|
235
|
+
# List customers
|
236
|
+
# List customers with pagination and sort
|
237
|
+
# @param [Hash] opts the optional parameters
|
238
|
+
# @option opts [String] :next_token
|
239
|
+
# @option opts [String] :page_size
|
240
|
+
# @return [Array<(CustomerPaginatedResponse, Integer, Hash)>] CustomerPaginatedResponse data, response status code and response headers
|
241
|
+
def get_customers_with_http_info(opts = {})
|
242
|
+
if @api_client.config.debugging
|
243
|
+
@api_client.config.logger.debug 'Calling API: CustomersApi.get_customers ...'
|
244
|
+
end
|
245
|
+
# resource path
|
246
|
+
local_var_path = '/customers'
|
247
|
+
|
248
|
+
# query parameters
|
249
|
+
query_params = opts[:query_params] || {}
|
250
|
+
query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
|
251
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
252
|
+
|
253
|
+
# header parameters
|
254
|
+
header_params = opts[:header_params] || {}
|
255
|
+
# HTTP header 'Accept' (if needed)
|
256
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
257
|
+
|
258
|
+
# form parameters
|
259
|
+
form_params = opts[:form_params] || {}
|
260
|
+
|
261
|
+
# http body (model)
|
262
|
+
post_body = opts[:debug_body]
|
263
|
+
|
264
|
+
# return_type
|
265
|
+
return_type = opts[:debug_return_type] || 'CustomerPaginatedResponse'
|
266
|
+
|
267
|
+
# auth_names
|
268
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
269
|
+
|
270
|
+
new_options = opts.merge(
|
271
|
+
:operation => :"CustomersApi.get_customers",
|
272
|
+
:header_params => header_params,
|
273
|
+
:query_params => query_params,
|
274
|
+
:form_params => form_params,
|
275
|
+
:body => post_body,
|
276
|
+
:auth_names => auth_names,
|
277
|
+
:return_type => return_type
|
278
|
+
)
|
279
|
+
|
280
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
281
|
+
if @api_client.config.debugging
|
282
|
+
@api_client.config.logger.debug "API called: CustomersApi#get_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
283
|
+
end
|
284
|
+
return data, status_code, headers
|
285
|
+
end
|
286
|
+
|
287
|
+
# Update a customer
|
288
|
+
# Update a customer by id
|
289
|
+
# @param customer_id [String]
|
290
|
+
# @param update_customer_request [UpdateCustomerRequest] Payload to update customer
|
291
|
+
# @param [Hash] opts the optional parameters
|
292
|
+
# @return [Customer]
|
293
|
+
def update_customer(customer_id, update_customer_request, opts = {})
|
294
|
+
data, _status_code, _headers = update_customer_with_http_info(customer_id, update_customer_request, opts)
|
295
|
+
data
|
296
|
+
end
|
297
|
+
|
298
|
+
# Update a customer
|
299
|
+
# Update a customer by id
|
300
|
+
# @param customer_id [String]
|
301
|
+
# @param update_customer_request [UpdateCustomerRequest] Payload to update customer
|
302
|
+
# @param [Hash] opts the optional parameters
|
303
|
+
# @return [Array<(Customer, Integer, Hash)>] Customer data, response status code and response headers
|
304
|
+
def update_customer_with_http_info(customer_id, update_customer_request, opts = {})
|
305
|
+
if @api_client.config.debugging
|
306
|
+
@api_client.config.logger.debug 'Calling API: CustomersApi.update_customer ...'
|
307
|
+
end
|
308
|
+
# verify the required parameter 'customer_id' is set
|
309
|
+
if @api_client.config.client_side_validation && customer_id.nil?
|
310
|
+
fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomersApi.update_customer"
|
311
|
+
end
|
312
|
+
if @api_client.config.client_side_validation && customer_id.to_s.length > 50
|
313
|
+
fail ArgumentError, 'invalid value for "customer_id" when calling CustomersApi.update_customer, the character length must be smaller than or equal to 50.'
|
314
|
+
end
|
315
|
+
|
316
|
+
# verify the required parameter 'update_customer_request' is set
|
317
|
+
if @api_client.config.client_side_validation && update_customer_request.nil?
|
318
|
+
fail ArgumentError, "Missing the required parameter 'update_customer_request' when calling CustomersApi.update_customer"
|
319
|
+
end
|
320
|
+
# resource path
|
321
|
+
local_var_path = '/customers/{customer_id}'.sub('{' + 'customer_id' + '}', CGI.escape(customer_id.to_s))
|
322
|
+
|
323
|
+
# query parameters
|
324
|
+
query_params = opts[:query_params] || {}
|
325
|
+
|
326
|
+
# header parameters
|
327
|
+
header_params = opts[:header_params] || {}
|
328
|
+
# HTTP header 'Accept' (if needed)
|
329
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
330
|
+
# HTTP header 'Content-Type'
|
331
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
332
|
+
if !content_type.nil?
|
333
|
+
header_params['Content-Type'] = content_type
|
334
|
+
end
|
335
|
+
|
336
|
+
# form parameters
|
337
|
+
form_params = opts[:form_params] || {}
|
338
|
+
|
339
|
+
# http body (model)
|
340
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_customer_request)
|
341
|
+
|
342
|
+
# return_type
|
343
|
+
return_type = opts[:debug_return_type] || 'Customer'
|
344
|
+
|
345
|
+
# auth_names
|
346
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
347
|
+
|
348
|
+
new_options = opts.merge(
|
349
|
+
:operation => :"CustomersApi.update_customer",
|
350
|
+
:header_params => header_params,
|
351
|
+
:query_params => query_params,
|
352
|
+
:form_params => form_params,
|
353
|
+
:body => post_body,
|
354
|
+
:auth_names => auth_names,
|
355
|
+
:return_type => return_type
|
356
|
+
)
|
357
|
+
|
358
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
359
|
+
if @api_client.config.debugging
|
360
|
+
@api_client.config.logger.debug "API called: CustomersApi#update_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
361
|
+
end
|
362
|
+
return data, status_code, headers
|
363
|
+
end
|
364
|
+
end
|
365
|
+
end
|
@@ -0,0 +1,158 @@
|
|
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 EventIngestionApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Ingest events to Togai
|
23
|
+
# API to ingest your application event to Togai for billing and usage analytics. To know the limits on the ingestion api, check our docs - https://togai.com/docs/limits.
|
24
|
+
# @param ingest_event_request [IngestEventRequest] Request body to ingest events to Togai usage and billing management service.
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [nil]
|
27
|
+
def ingest(ingest_event_request, opts = {})
|
28
|
+
ingest_with_http_info(ingest_event_request, opts)
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
32
|
+
# Ingest events to Togai
|
33
|
+
# API to ingest your application event to Togai for billing and usage analytics. To know the limits on the ingestion api, check our docs - https://togai.com/docs/limits.
|
34
|
+
# @param ingest_event_request [IngestEventRequest] Request body to ingest events to Togai usage and billing management service.
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
37
|
+
def ingest_with_http_info(ingest_event_request, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: EventIngestionApi.ingest ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'ingest_event_request' is set
|
42
|
+
if @api_client.config.client_side_validation && ingest_event_request.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'ingest_event_request' when calling EventIngestionApi.ingest"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/ingest'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
57
|
+
if !content_type.nil?
|
58
|
+
header_params['Content-Type'] = content_type
|
59
|
+
end
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = opts[:form_params] || {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(ingest_event_request)
|
66
|
+
|
67
|
+
# return_type
|
68
|
+
return_type = opts[:debug_return_type]
|
69
|
+
|
70
|
+
# auth_names
|
71
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
72
|
+
|
73
|
+
new_options = opts.merge(
|
74
|
+
:operation => :"EventIngestionApi.ingest",
|
75
|
+
:header_params => header_params,
|
76
|
+
:query_params => query_params,
|
77
|
+
:form_params => form_params,
|
78
|
+
:body => post_body,
|
79
|
+
:auth_names => auth_names,
|
80
|
+
:return_type => return_type
|
81
|
+
)
|
82
|
+
|
83
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug "API called: EventIngestionApi#ingest\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
|
90
|
+
# Ingest events to Togai in batch
|
91
|
+
# API to ingest your application event in batch to Togai for billing and usage analytics. To know the limits on the ingestion api, check our docs - https://togai.com/docs/limits.
|
92
|
+
# @param ingest_batch_event_request [IngestBatchEventRequest] Request body to ingest events in batch to Togai usage and billing management service.
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @return [IngestBatchEventResponse]
|
95
|
+
def ingest_batch(ingest_batch_event_request, opts = {})
|
96
|
+
data, _status_code, _headers = ingest_batch_with_http_info(ingest_batch_event_request, opts)
|
97
|
+
data
|
98
|
+
end
|
99
|
+
|
100
|
+
# Ingest events to Togai in batch
|
101
|
+
# API to ingest your application event in batch to Togai for billing and usage analytics. To know the limits on the ingestion api, check our docs - https://togai.com/docs/limits.
|
102
|
+
# @param ingest_batch_event_request [IngestBatchEventRequest] Request body to ingest events in batch to Togai usage and billing management service.
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @return [Array<(IngestBatchEventResponse, Integer, Hash)>] IngestBatchEventResponse data, response status code and response headers
|
105
|
+
def ingest_batch_with_http_info(ingest_batch_event_request, opts = {})
|
106
|
+
if @api_client.config.debugging
|
107
|
+
@api_client.config.logger.debug 'Calling API: EventIngestionApi.ingest_batch ...'
|
108
|
+
end
|
109
|
+
# verify the required parameter 'ingest_batch_event_request' is set
|
110
|
+
if @api_client.config.client_side_validation && ingest_batch_event_request.nil?
|
111
|
+
fail ArgumentError, "Missing the required parameter 'ingest_batch_event_request' when calling EventIngestionApi.ingest_batch"
|
112
|
+
end
|
113
|
+
# resource path
|
114
|
+
local_var_path = '/ingestBatch'
|
115
|
+
|
116
|
+
# query parameters
|
117
|
+
query_params = opts[:query_params] || {}
|
118
|
+
|
119
|
+
# header parameters
|
120
|
+
header_params = opts[:header_params] || {}
|
121
|
+
# HTTP header 'Accept' (if needed)
|
122
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
123
|
+
# HTTP header 'Content-Type'
|
124
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
125
|
+
if !content_type.nil?
|
126
|
+
header_params['Content-Type'] = content_type
|
127
|
+
end
|
128
|
+
|
129
|
+
# form parameters
|
130
|
+
form_params = opts[:form_params] || {}
|
131
|
+
|
132
|
+
# http body (model)
|
133
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(ingest_batch_event_request)
|
134
|
+
|
135
|
+
# return_type
|
136
|
+
return_type = opts[:debug_return_type] || 'IngestBatchEventResponse'
|
137
|
+
|
138
|
+
# auth_names
|
139
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
140
|
+
|
141
|
+
new_options = opts.merge(
|
142
|
+
:operation => :"EventIngestionApi.ingest_batch",
|
143
|
+
:header_params => header_params,
|
144
|
+
:query_params => query_params,
|
145
|
+
:form_params => form_params,
|
146
|
+
:body => post_body,
|
147
|
+
:auth_names => auth_names,
|
148
|
+
:return_type => return_type
|
149
|
+
)
|
150
|
+
|
151
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
152
|
+
if @api_client.config.debugging
|
153
|
+
@api_client.config.logger.debug "API called: EventIngestionApi#ingest_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
154
|
+
end
|
155
|
+
return data, status_code, headers
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
@@ -0,0 +1,164 @@
|
|
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 EventManagementApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get usage events from Togai
|
23
|
+
# API to get usage events ingested to Togai.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [String] :next_token Pagination token used as a marker to get records from next page.
|
26
|
+
# @option opts [String] :status Filter option to filter the events by processed/unprocessed status.
|
27
|
+
# @option opts [String] :account_id Filter option to filter the events based on account id.
|
28
|
+
# @option opts [Integer] :page_size Maximum page size expected by client to return the record list. NOTE: Max page size cannot be more than 50. Also 50 is the default page size if no value is provided.
|
29
|
+
# @option opts [Integer] :start_time Start time filter in epoch milli seconds
|
30
|
+
# @option opts [Integer] :end_time End time filter in epoch milli seconds
|
31
|
+
# @return [GetEventsResponse]
|
32
|
+
def get_events(opts = {})
|
33
|
+
data, _status_code, _headers = get_events_with_http_info(opts)
|
34
|
+
data
|
35
|
+
end
|
36
|
+
|
37
|
+
# Get usage events from Togai
|
38
|
+
# API to get usage events ingested to Togai.
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @option opts [String] :next_token Pagination token used as a marker to get records from next page.
|
41
|
+
# @option opts [String] :status Filter option to filter the events by processed/unprocessed status.
|
42
|
+
# @option opts [String] :account_id Filter option to filter the events based on account id.
|
43
|
+
# @option opts [Integer] :page_size Maximum page size expected by client to return the record list. NOTE: Max page size cannot be more than 50. Also 50 is the default page size if no value is provided.
|
44
|
+
# @option opts [Integer] :start_time Start time filter in epoch milli seconds
|
45
|
+
# @option opts [Integer] :end_time End time filter in epoch milli seconds
|
46
|
+
# @return [Array<(GetEventsResponse, Integer, Hash)>] GetEventsResponse data, response status code and response headers
|
47
|
+
def get_events_with_http_info(opts = {})
|
48
|
+
if @api_client.config.debugging
|
49
|
+
@api_client.config.logger.debug 'Calling API: EventManagementApi.get_events ...'
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/events'
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
|
57
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
58
|
+
query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
|
59
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
60
|
+
query_params[:'start_time'] = opts[:'start_time'] if !opts[:'start_time'].nil?
|
61
|
+
query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
|
62
|
+
|
63
|
+
# header parameters
|
64
|
+
header_params = opts[:header_params] || {}
|
65
|
+
# HTTP header 'Accept' (if needed)
|
66
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
67
|
+
|
68
|
+
# form parameters
|
69
|
+
form_params = opts[:form_params] || {}
|
70
|
+
|
71
|
+
# http body (model)
|
72
|
+
post_body = opts[:debug_body]
|
73
|
+
|
74
|
+
# return_type
|
75
|
+
return_type = opts[:debug_return_type] || 'GetEventsResponse'
|
76
|
+
|
77
|
+
# auth_names
|
78
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
79
|
+
|
80
|
+
new_options = opts.merge(
|
81
|
+
:operation => :"EventManagementApi.get_events",
|
82
|
+
:header_params => header_params,
|
83
|
+
:query_params => query_params,
|
84
|
+
:form_params => form_params,
|
85
|
+
:body => post_body,
|
86
|
+
:auth_names => auth_names,
|
87
|
+
:return_type => return_type
|
88
|
+
)
|
89
|
+
|
90
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
91
|
+
if @api_client.config.debugging
|
92
|
+
@api_client.config.logger.debug "API called: EventManagementApi#get_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
93
|
+
end
|
94
|
+
return data, status_code, headers
|
95
|
+
end
|
96
|
+
|
97
|
+
# Get the usage event given event id.
|
98
|
+
# API to get the event given the event id.
|
99
|
+
# @param event_id [String]
|
100
|
+
# @param [Hash] opts the optional parameters
|
101
|
+
# @return [GetEventResponse]
|
102
|
+
def get_single_event(event_id, opts = {})
|
103
|
+
data, _status_code, _headers = get_single_event_with_http_info(event_id, opts)
|
104
|
+
data
|
105
|
+
end
|
106
|
+
|
107
|
+
# Get the usage event given event id.
|
108
|
+
# API to get the event given the event id.
|
109
|
+
# @param event_id [String]
|
110
|
+
# @param [Hash] opts the optional parameters
|
111
|
+
# @return [Array<(GetEventResponse, Integer, Hash)>] GetEventResponse data, response status code and response headers
|
112
|
+
def get_single_event_with_http_info(event_id, opts = {})
|
113
|
+
if @api_client.config.debugging
|
114
|
+
@api_client.config.logger.debug 'Calling API: EventManagementApi.get_single_event ...'
|
115
|
+
end
|
116
|
+
# verify the required parameter 'event_id' is set
|
117
|
+
if @api_client.config.client_side_validation && event_id.nil?
|
118
|
+
fail ArgumentError, "Missing the required parameter 'event_id' when calling EventManagementApi.get_single_event"
|
119
|
+
end
|
120
|
+
if @api_client.config.client_side_validation && event_id.to_s.length > 50
|
121
|
+
fail ArgumentError, 'invalid value for "event_id" when calling EventManagementApi.get_single_event, the character length must be smaller than or equal to 50.'
|
122
|
+
end
|
123
|
+
|
124
|
+
# resource path
|
125
|
+
local_var_path = '/events/{event_id}'.sub('{' + 'event_id' + '}', CGI.escape(event_id.to_s))
|
126
|
+
|
127
|
+
# query parameters
|
128
|
+
query_params = opts[:query_params] || {}
|
129
|
+
|
130
|
+
# header parameters
|
131
|
+
header_params = opts[:header_params] || {}
|
132
|
+
# HTTP header 'Accept' (if needed)
|
133
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
134
|
+
|
135
|
+
# form parameters
|
136
|
+
form_params = opts[:form_params] || {}
|
137
|
+
|
138
|
+
# http body (model)
|
139
|
+
post_body = opts[:debug_body]
|
140
|
+
|
141
|
+
# return_type
|
142
|
+
return_type = opts[:debug_return_type] || 'GetEventResponse'
|
143
|
+
|
144
|
+
# auth_names
|
145
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
146
|
+
|
147
|
+
new_options = opts.merge(
|
148
|
+
:operation => :"EventManagementApi.get_single_event",
|
149
|
+
:header_params => header_params,
|
150
|
+
:query_params => query_params,
|
151
|
+
:form_params => form_params,
|
152
|
+
:body => post_body,
|
153
|
+
:auth_names => auth_names,
|
154
|
+
:return_type => return_type
|
155
|
+
)
|
156
|
+
|
157
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
158
|
+
if @api_client.config.debugging
|
159
|
+
@api_client.config.logger.debug "API called: EventManagementApi#get_single_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
160
|
+
end
|
161
|
+
return data, status_code, headers
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|