klaviyo_sdk 1.0.0.20220329
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/CHANGELOG.md +6 -0
- data/README.md +1121 -0
- data/klaviyo_sdk.gemspec +35 -0
- data/lib/klaviyo_sdk/api/campaigns_api.rb +717 -0
- data/lib/klaviyo_sdk/api/data_privacy_api.rb +86 -0
- data/lib/klaviyo_sdk/api/lists_segments_api.rb +1101 -0
- data/lib/klaviyo_sdk/api/metrics_api.rb +343 -0
- data/lib/klaviyo_sdk/api/profiles_api.rb +381 -0
- data/lib/klaviyo_sdk/api/templates_api.rb +555 -0
- data/lib/klaviyo_sdk/api/track_identify_api.rb +288 -0
- data/lib/klaviyo_sdk/api_client.rb +389 -0
- data/lib/klaviyo_sdk/api_error.rb +57 -0
- data/lib/klaviyo_sdk/configuration.rb +278 -0
- data/lib/klaviyo_sdk/models/campaign.rb +310 -0
- data/lib/klaviyo_sdk/models/check_membership_request.rb +244 -0
- data/lib/klaviyo_sdk/models/delete_email.rb +218 -0
- data/lib/klaviyo_sdk/models/delete_person.rb +218 -0
- data/lib/klaviyo_sdk/models/delete_phone.rb +219 -0
- data/lib/klaviyo_sdk/models/deprecated_get_list_response.rb +298 -0
- data/lib/klaviyo_sdk/models/deprecated_get_list_response_data.rb +263 -0
- data/lib/klaviyo_sdk/models/global_exclusion_response_data.rb +274 -0
- data/lib/klaviyo_sdk/models/identify_payload.rb +237 -0
- data/lib/klaviyo_sdk/models/identify_payload_properties.rb +327 -0
- data/lib/klaviyo_sdk/models/inline_object.rb +220 -0
- data/lib/klaviyo_sdk/models/inline_object3.rb +226 -0
- data/lib/klaviyo_sdk/models/inline_object4.rb +254 -0
- data/lib/klaviyo_sdk/models/inline_object5.rb +288 -0
- data/lib/klaviyo_sdk/models/metric.rb +265 -0
- data/lib/klaviyo_sdk/models/metric_export.rb +285 -0
- data/lib/klaviyo_sdk/models/metric_timeline.rb +271 -0
- data/lib/klaviyo_sdk/models/metric_timeline_data.rb +294 -0
- data/lib/klaviyo_sdk/models/person.rb +389 -0
- data/lib/klaviyo_sdk/models/person.rb.bak +389 -0
- data/lib/klaviyo_sdk/models/privacy_email.rb +218 -0
- data/lib/klaviyo_sdk/models/privacy_id.rb +218 -0
- data/lib/klaviyo_sdk/models/privacy_phone.rb +218 -0
- data/lib/klaviyo_sdk/models/rendered_template.rb +247 -0
- data/lib/klaviyo_sdk/models/template.rb +272 -0
- data/lib/klaviyo_sdk/models/track_payload.rb +261 -0
- data/lib/klaviyo_sdk/models/track_payload_customer_properties.rb +227 -0
- data/lib/klaviyo_sdk/models/track_payload_properties.rb +237 -0
- data/lib/klaviyo_sdk/version.rb +15 -0
- data/lib/klaviyo_sdk.rb +124 -0
- metadata +120 -0
@@ -0,0 +1,343 @@
|
|
1
|
+
=begin
|
2
|
+
#Klaviyo API
|
3
|
+
|
4
|
+
#Empowering creators to own their destiny
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2022.03.29
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Client
|
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 Metrics Info
|
23
|
+
# Returns a list of all the metrics in your account.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [Integer] :page For pagination, which page of results to return. Default = 0 (default to 0)
|
26
|
+
# @option opts [Integer] :count For pagination, the number of results to return. Default = 50 ; Max = 100 (default to 50)
|
27
|
+
# @return [Hash<String, Object>]
|
28
|
+
def get_metrics(opts = {})
|
29
|
+
data, _status_code, _headers = get_metrics_with_http_info(opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Get Metrics Info
|
34
|
+
# Returns a list of all the metrics in your account.
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @option opts [Integer] :page For pagination, which page of results to return. Default = 0
|
37
|
+
# @option opts [Integer] :count For pagination, the number of results to return. Default = 50 ; Max = 100
|
38
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
39
|
+
def get_metrics_with_http_info(opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.get_metrics ...'
|
42
|
+
end
|
43
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
|
44
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling MetricsApi.get_metrics, must be greater than or equal to 0.'
|
45
|
+
end
|
46
|
+
|
47
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 100
|
48
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling MetricsApi.get_metrics, must be smaller than or equal to 100.'
|
49
|
+
end
|
50
|
+
|
51
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
|
52
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling MetricsApi.get_metrics, must be greater than or equal to 1.'
|
53
|
+
end
|
54
|
+
|
55
|
+
# resource path
|
56
|
+
local_var_path = '/v1/metrics'
|
57
|
+
|
58
|
+
# query parameters
|
59
|
+
query_params = opts[:query_params] || {}
|
60
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
61
|
+
query_params[:'count'] = opts[:'count'] if !opts[:'count'].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[:body]
|
73
|
+
|
74
|
+
# return_type
|
75
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
76
|
+
|
77
|
+
# auth_names
|
78
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
79
|
+
|
80
|
+
new_options = opts.merge(
|
81
|
+
:operation => :"MetricsApi.get_metrics",
|
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: MetricsApi#get_metrics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
93
|
+
end
|
94
|
+
return data, status_code, headers
|
95
|
+
end
|
96
|
+
|
97
|
+
# Query Event Data
|
98
|
+
# Exports event data from Klaviyo, optionally filtering and segmenting on available event properties. Note that the only comparison operator currently supported is `=`. To ensure a correct response, enter parameters in the curl request as they are ordered below:
|
99
|
+
# @param metric_id [String]
|
100
|
+
# @param [Hash] opts the optional parameters
|
101
|
+
# @option opts [String] :start_date Beginning of timeframe to pull event data for. The default value is 1 month ago. Can also accept a 10-digit UNIX timestamp. When sending a `start_date`, you must also send an `end_date` Ex: `1610524800` OR `2021-01-13`
|
102
|
+
# @option opts [String] :end_date End of timeframe to pull event data for. The default is the current day, or 1 month from start_date, whichever is sooner. Can also accept a 10-digit UNIX timestamp. When sending an `end_date`, you must also send a `start_date`. Must be *at most* 31 days after `start_date` Ex: `1612080000` OR `2021-01-31`
|
103
|
+
# @option opts [String] :unit Granularity to bucket data points into - one of `day`, `week`, or `month`. Defaults to `day`. (default to 'day')
|
104
|
+
# @option opts [String] :measurement Type of metric to fetch - one of `unique`, `count`, `value`, or `sum`. Defaults to `count`. For `sum` a property name to operate on must be supplied as a JSON-encoded list like `[\"sum\",\"ItemCount\"]` (default to 'count')
|
105
|
+
# @option opts [String] :where Optional, JSON-encoded list. Conditions to use to filter the set of events. A max of 1 condition can be given. `where` and `by` parameters cannot be specified at the same time. ex: `[[\"$attributed_flow\",\"=\",\"FLOW_ID\"]]`
|
106
|
+
# @option opts [String] :by The name of a property to segment the event data on. `where` and `by` parameters cannot be specified at the same time. Cannot be used alongside `where` parameter.
|
107
|
+
# @option opts [Integer] :count Maximum number of segments to return. Default = 25, **MAX = 1000** (default to 25)
|
108
|
+
# @return [MetricExport]
|
109
|
+
def metric_export(metric_id, opts = {})
|
110
|
+
data, _status_code, _headers = metric_export_with_http_info(metric_id, opts)
|
111
|
+
data
|
112
|
+
end
|
113
|
+
|
114
|
+
# Query Event Data
|
115
|
+
# Exports event data from Klaviyo, optionally filtering and segmenting on available event properties. Note that the only comparison operator currently supported is `=`. To ensure a correct response, enter parameters in the curl request as they are ordered below:
|
116
|
+
# @param metric_id [String]
|
117
|
+
# @param [Hash] opts the optional parameters
|
118
|
+
# @option opts [String] :start_date Beginning of timeframe to pull event data for. The default value is 1 month ago. Can also accept a 10-digit UNIX timestamp. When sending a `start_date`, you must also send an `end_date` Ex: `1610524800` OR `2021-01-13`
|
119
|
+
# @option opts [String] :end_date End of timeframe to pull event data for. The default is the current day, or 1 month from start_date, whichever is sooner. Can also accept a 10-digit UNIX timestamp. When sending an `end_date`, you must also send a `start_date`. Must be *at most* 31 days after `start_date` Ex: `1612080000` OR `2021-01-31`
|
120
|
+
# @option opts [String] :unit Granularity to bucket data points into - one of `day`, `week`, or `month`. Defaults to `day`.
|
121
|
+
# @option opts [String] :measurement Type of metric to fetch - one of `unique`, `count`, `value`, or `sum`. Defaults to `count`. For `sum` a property name to operate on must be supplied as a JSON-encoded list like `[\"sum\",\"ItemCount\"]`
|
122
|
+
# @option opts [String] :where Optional, JSON-encoded list. Conditions to use to filter the set of events. A max of 1 condition can be given. `where` and `by` parameters cannot be specified at the same time. ex: `[[\"$attributed_flow\",\"=\",\"FLOW_ID\"]]`
|
123
|
+
# @option opts [String] :by The name of a property to segment the event data on. `where` and `by` parameters cannot be specified at the same time. Cannot be used alongside `where` parameter.
|
124
|
+
# @option opts [Integer] :count Maximum number of segments to return. Default = 25, **MAX = 1000**
|
125
|
+
# @return [Array<(MetricExport, Integer, Hash)>] MetricExport data, response status code and response headers
|
126
|
+
def metric_export_with_http_info(metric_id, opts = {})
|
127
|
+
if @api_client.config.debugging
|
128
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.metric_export ...'
|
129
|
+
end
|
130
|
+
# verify the required parameter 'metric_id' is set
|
131
|
+
if @api_client.config.client_side_validation && metric_id.nil?
|
132
|
+
fail ArgumentError, "Missing the required parameter 'metric_id' when calling MetricsApi.metric_export"
|
133
|
+
end
|
134
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 1000
|
135
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling MetricsApi.metric_export, must be smaller than or equal to 1000.'
|
136
|
+
end
|
137
|
+
|
138
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
|
139
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling MetricsApi.metric_export, must be greater than or equal to 1.'
|
140
|
+
end
|
141
|
+
|
142
|
+
# resource path
|
143
|
+
local_var_path = '/v1/metric/{metric_id}/export'.sub('{' + 'metric_id' + '}', CGI.escape(metric_id.to_s))
|
144
|
+
|
145
|
+
# query parameters
|
146
|
+
query_params = opts[:query_params] || {}
|
147
|
+
query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
|
148
|
+
query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
|
149
|
+
query_params[:'unit'] = opts[:'unit'] if !opts[:'unit'].nil?
|
150
|
+
query_params[:'measurement'] = opts[:'measurement'] if !opts[:'measurement'].nil?
|
151
|
+
query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
|
152
|
+
query_params[:'by'] = opts[:'by'] if !opts[:'by'].nil?
|
153
|
+
query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
|
154
|
+
|
155
|
+
# header parameters
|
156
|
+
header_params = opts[:header_params] || {}
|
157
|
+
# HTTP header 'Accept' (if needed)
|
158
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
159
|
+
|
160
|
+
# form parameters
|
161
|
+
form_params = opts[:form_params] || {}
|
162
|
+
|
163
|
+
# http body (model)
|
164
|
+
post_body = opts[:body]
|
165
|
+
|
166
|
+
# return_type
|
167
|
+
return_type = opts[:debug_return_type] || 'MetricExport'
|
168
|
+
|
169
|
+
# auth_names
|
170
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
171
|
+
|
172
|
+
new_options = opts.merge(
|
173
|
+
:operation => :"MetricsApi.metric_export",
|
174
|
+
:header_params => header_params,
|
175
|
+
:query_params => query_params,
|
176
|
+
:form_params => form_params,
|
177
|
+
:body => post_body,
|
178
|
+
:auth_names => auth_names,
|
179
|
+
:return_type => return_type
|
180
|
+
)
|
181
|
+
|
182
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
183
|
+
if @api_client.config.debugging
|
184
|
+
@api_client.config.logger.debug "API called: MetricsApi#metric_export\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
185
|
+
end
|
186
|
+
return data, status_code, headers
|
187
|
+
end
|
188
|
+
|
189
|
+
# Get Events for a Specific Metric
|
190
|
+
# Returns a batched timeline for one specific metric.
|
191
|
+
# @param metric_id [String]
|
192
|
+
# @param [Hash] opts the optional parameters
|
193
|
+
# @option opts [String] :since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the `next` attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
|
194
|
+
# @option opts [Integer] :count Number of events to return in a batch. Max = 100 (default to 50)
|
195
|
+
# @option opts [String] :sort Sort order to apply to timeline, either descending or ascending. Valid values are `desc` or `asc`. Defaults to `desc`. Always descending when `since` is not sent, as `since` defaults to current time. (default to 'desc')
|
196
|
+
# @return [MetricTimeline]
|
197
|
+
def metric_timeline(metric_id, opts = {})
|
198
|
+
data, _status_code, _headers = metric_timeline_with_http_info(metric_id, opts)
|
199
|
+
data
|
200
|
+
end
|
201
|
+
|
202
|
+
# Get Events for a Specific Metric
|
203
|
+
# Returns a batched timeline for one specific metric.
|
204
|
+
# @param metric_id [String]
|
205
|
+
# @param [Hash] opts the optional parameters
|
206
|
+
# @option opts [String] :since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the `next` attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
|
207
|
+
# @option opts [Integer] :count Number of events to return in a batch. Max = 100
|
208
|
+
# @option opts [String] :sort Sort order to apply to timeline, either descending or ascending. Valid values are `desc` or `asc`. Defaults to `desc`. Always descending when `since` is not sent, as `since` defaults to current time.
|
209
|
+
# @return [Array<(MetricTimeline, Integer, Hash)>] MetricTimeline data, response status code and response headers
|
210
|
+
def metric_timeline_with_http_info(metric_id, opts = {})
|
211
|
+
if @api_client.config.debugging
|
212
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.metric_timeline ...'
|
213
|
+
end
|
214
|
+
# verify the required parameter 'metric_id' is set
|
215
|
+
if @api_client.config.client_side_validation && metric_id.nil?
|
216
|
+
fail ArgumentError, "Missing the required parameter 'metric_id' when calling MetricsApi.metric_timeline"
|
217
|
+
end
|
218
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 100
|
219
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling MetricsApi.metric_timeline, must be smaller than or equal to 100.'
|
220
|
+
end
|
221
|
+
|
222
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
|
223
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling MetricsApi.metric_timeline, must be greater than or equal to 1.'
|
224
|
+
end
|
225
|
+
|
226
|
+
# resource path
|
227
|
+
local_var_path = '/v1/metric/{metric_id}/timeline'.sub('{' + 'metric_id' + '}', CGI.escape(metric_id.to_s))
|
228
|
+
|
229
|
+
# query parameters
|
230
|
+
query_params = opts[:query_params] || {}
|
231
|
+
query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
|
232
|
+
query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
|
233
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
234
|
+
|
235
|
+
# header parameters
|
236
|
+
header_params = opts[:header_params] || {}
|
237
|
+
# HTTP header 'Accept' (if needed)
|
238
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
239
|
+
|
240
|
+
# form parameters
|
241
|
+
form_params = opts[:form_params] || {}
|
242
|
+
|
243
|
+
# http body (model)
|
244
|
+
post_body = opts[:body]
|
245
|
+
|
246
|
+
# return_type
|
247
|
+
return_type = opts[:debug_return_type] || 'MetricTimeline'
|
248
|
+
|
249
|
+
# auth_names
|
250
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
251
|
+
|
252
|
+
new_options = opts.merge(
|
253
|
+
:operation => :"MetricsApi.metric_timeline",
|
254
|
+
:header_params => header_params,
|
255
|
+
:query_params => query_params,
|
256
|
+
:form_params => form_params,
|
257
|
+
:body => post_body,
|
258
|
+
:auth_names => auth_names,
|
259
|
+
:return_type => return_type
|
260
|
+
)
|
261
|
+
|
262
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
263
|
+
if @api_client.config.debugging
|
264
|
+
@api_client.config.logger.debug "API called: MetricsApi#metric_timeline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
265
|
+
end
|
266
|
+
return data, status_code, headers
|
267
|
+
end
|
268
|
+
|
269
|
+
# Get Events for All Metrics
|
270
|
+
# Returns a batched timeline of all events in your account.
|
271
|
+
# @param [Hash] opts the optional parameters
|
272
|
+
# @option opts [String] :since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the next attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
|
273
|
+
# @option opts [Integer] :count Number of events to return in a batch. Default = 50, Max = 100 (default to 50)
|
274
|
+
# @option opts [String] :sort Sort order to apply to timeline, either descending or ascending. Valid values are `desc` or `asc`. Defaults to `desc`. Always descending when `since` is not sent, as `since` defaults to current time. (default to 'desc')
|
275
|
+
# @return [MetricTimeline]
|
276
|
+
def metrics_timeline(opts = {})
|
277
|
+
data, _status_code, _headers = metrics_timeline_with_http_info(opts)
|
278
|
+
data
|
279
|
+
end
|
280
|
+
|
281
|
+
# Get Events for All Metrics
|
282
|
+
# Returns a batched timeline of all events in your account.
|
283
|
+
# @param [Hash] opts the optional parameters
|
284
|
+
# @option opts [String] :since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the next attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
|
285
|
+
# @option opts [Integer] :count Number of events to return in a batch. Default = 50, Max = 100
|
286
|
+
# @option opts [String] :sort Sort order to apply to timeline, either descending or ascending. Valid values are `desc` or `asc`. Defaults to `desc`. Always descending when `since` is not sent, as `since` defaults to current time.
|
287
|
+
# @return [Array<(MetricTimeline, Integer, Hash)>] MetricTimeline data, response status code and response headers
|
288
|
+
def metrics_timeline_with_http_info(opts = {})
|
289
|
+
if @api_client.config.debugging
|
290
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.metrics_timeline ...'
|
291
|
+
end
|
292
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] > 100
|
293
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling MetricsApi.metrics_timeline, must be smaller than or equal to 100.'
|
294
|
+
end
|
295
|
+
|
296
|
+
if @api_client.config.client_side_validation && !opts[:'count'].nil? && opts[:'count'] < 1
|
297
|
+
fail ArgumentError, 'invalid value for "opts[:"count"]" when calling MetricsApi.metrics_timeline, must be greater than or equal to 1.'
|
298
|
+
end
|
299
|
+
|
300
|
+
# resource path
|
301
|
+
local_var_path = '/v1/metrics/timeline'
|
302
|
+
|
303
|
+
# query parameters
|
304
|
+
query_params = opts[:query_params] || {}
|
305
|
+
query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
|
306
|
+
query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
|
307
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
308
|
+
|
309
|
+
# header parameters
|
310
|
+
header_params = opts[:header_params] || {}
|
311
|
+
# HTTP header 'Accept' (if needed)
|
312
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
313
|
+
|
314
|
+
# form parameters
|
315
|
+
form_params = opts[:form_params] || {}
|
316
|
+
|
317
|
+
# http body (model)
|
318
|
+
post_body = opts[:body]
|
319
|
+
|
320
|
+
# return_type
|
321
|
+
return_type = opts[:debug_return_type] || 'MetricTimeline'
|
322
|
+
|
323
|
+
# auth_names
|
324
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
325
|
+
|
326
|
+
new_options = opts.merge(
|
327
|
+
:operation => :"MetricsApi.metrics_timeline",
|
328
|
+
:header_params => header_params,
|
329
|
+
:query_params => query_params,
|
330
|
+
:form_params => form_params,
|
331
|
+
:body => post_body,
|
332
|
+
:auth_names => auth_names,
|
333
|
+
:return_type => return_type
|
334
|
+
)
|
335
|
+
|
336
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
337
|
+
if @api_client.config.debugging
|
338
|
+
@api_client.config.logger.debug "API called: MetricsApi#metrics_timeline\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
339
|
+
end
|
340
|
+
return data, status_code, headers
|
341
|
+
end
|
342
|
+
end
|
343
|
+
end
|