klaviyo_sdk 1.0.0.20220329 → 1.0.3.20220329

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/Gemfile +10 -0
  4. data/README.md +99 -99
  5. data/Rakefile +10 -0
  6. data/docs/Campaign.md +38 -0
  7. data/docs/CampaignsApi.md +707 -0
  8. data/docs/CheckMembershipRequest.md +22 -0
  9. data/docs/DataPrivacyApi.md +81 -0
  10. data/docs/DeleteEmail.md +18 -0
  11. data/docs/DeletePerson.md +18 -0
  12. data/docs/DeletePhone.md +18 -0
  13. data/docs/DeprecatedGetListResponse.md +30 -0
  14. data/docs/DeprecatedGetListResponseData.md +28 -0
  15. data/docs/GlobalExclusionResponseData.md +30 -0
  16. data/docs/IdentifyPayload.md +20 -0
  17. data/docs/IdentifyPayloadProperties.md +42 -0
  18. data/docs/InlineObject.md +18 -0
  19. data/docs/InlineObject3.md +18 -0
  20. data/docs/InlineObject4.md +18 -0
  21. data/docs/InlineObject5.md +22 -0
  22. data/docs/ListsSegmentsApi.md +1198 -0
  23. data/docs/Metric.md +28 -0
  24. data/docs/MetricExport.md +32 -0
  25. data/docs/MetricTimeline.md +24 -0
  26. data/docs/MetricTimelineData.md +34 -0
  27. data/docs/MetricsApi.md +329 -0
  28. data/docs/Person.md +56 -0
  29. data/docs/PrivacyEmail.md +18 -0
  30. data/docs/PrivacyId.md +18 -0
  31. data/docs/PrivacyPhone.md +18 -0
  32. data/docs/ProfilesApi.md +391 -0
  33. data/docs/RenderedTemplate.md +24 -0
  34. data/docs/Template.md +30 -0
  35. data/docs/TemplatesApi.md +541 -0
  36. data/docs/TrackIdentifyApi.md +267 -0
  37. data/docs/TrackPayload.md +24 -0
  38. data/docs/TrackPayloadCustomerProperties.md +20 -0
  39. data/docs/TrackPayloadProperties.md +22 -0
  40. data/git_push.sh +57 -0
  41. data/klaviyo_sdk-1.0.3.2022.03.29.gem +0 -0
  42. data/klaviyo_sdk.gemspec +6 -1
  43. data/lib/klaviyo_sdk/api/campaigns_api.rb +1 -1
  44. data/lib/klaviyo_sdk/api/data_privacy_api.rb +1 -1
  45. data/lib/klaviyo_sdk/api/lists_segments_api.rb +1 -1
  46. data/lib/klaviyo_sdk/api/metrics_api.rb +1 -1
  47. data/lib/klaviyo_sdk/api/profiles_api.rb +1 -1
  48. data/lib/klaviyo_sdk/api/templates_api.rb +1 -1
  49. data/lib/klaviyo_sdk/api/track_identify_api.rb +1 -1
  50. data/lib/klaviyo_sdk/api_client.rb +2 -2
  51. data/lib/klaviyo_sdk/api_error.rb +1 -1
  52. data/lib/klaviyo_sdk/configuration.rb +1 -1
  53. data/lib/klaviyo_sdk/models/campaign.rb +4 -4
  54. data/lib/klaviyo_sdk/models/check_membership_request.rb +4 -4
  55. data/lib/klaviyo_sdk/models/delete_email.rb +4 -4
  56. data/lib/klaviyo_sdk/models/delete_person.rb +4 -4
  57. data/lib/klaviyo_sdk/models/delete_phone.rb +4 -4
  58. data/lib/klaviyo_sdk/models/deprecated_get_list_response.rb +4 -4
  59. data/lib/klaviyo_sdk/models/deprecated_get_list_response_data.rb +4 -4
  60. data/lib/klaviyo_sdk/models/global_exclusion_response_data.rb +4 -4
  61. data/lib/klaviyo_sdk/models/identify_payload.rb +4 -4
  62. data/lib/klaviyo_sdk/models/identify_payload_properties.rb +4 -4
  63. data/lib/klaviyo_sdk/models/inline_object.rb +9 -4
  64. data/lib/klaviyo_sdk/models/inline_object3.rb +4 -4
  65. data/lib/klaviyo_sdk/models/inline_object4.rb +4 -4
  66. data/lib/klaviyo_sdk/models/inline_object5.rb +4 -4
  67. data/lib/klaviyo_sdk/models/metric.rb +4 -4
  68. data/lib/klaviyo_sdk/models/metric_export.rb +4 -4
  69. data/lib/klaviyo_sdk/models/metric_timeline.rb +4 -4
  70. data/lib/klaviyo_sdk/models/metric_timeline_data.rb +4 -4
  71. data/lib/klaviyo_sdk/models/person.rb +4 -4
  72. data/lib/klaviyo_sdk/models/person.rb.bak +4 -4
  73. data/lib/klaviyo_sdk/models/privacy_email.rb +4 -4
  74. data/lib/klaviyo_sdk/models/privacy_id.rb +4 -4
  75. data/lib/klaviyo_sdk/models/privacy_phone.rb +4 -4
  76. data/lib/klaviyo_sdk/models/rendered_template.rb +4 -4
  77. data/lib/klaviyo_sdk/models/template.rb +4 -4
  78. data/lib/klaviyo_sdk/models/track_payload.rb +4 -4
  79. data/lib/klaviyo_sdk/models/track_payload_customer_properties.rb +4 -4
  80. data/lib/klaviyo_sdk/models/track_payload_properties.rb +4 -4
  81. data/lib/klaviyo_sdk/version.rb +1 -1
  82. data/lib/klaviyo_sdk.rb +7 -7
  83. data/spec/api/campaigns_api_spec.rb +165 -0
  84. data/spec/api/data_privacy_api_spec.rb +47 -0
  85. data/spec/api/lists_segments_api_spec.rb +239 -0
  86. data/spec/api/metrics_api_spec.rb +96 -0
  87. data/spec/api/profiles_api_spec.rb +103 -0
  88. data/spec/api/templates_api_spec.rb +130 -0
  89. data/spec/api/track_identify_api_spec.rb +83 -0
  90. data/spec/api_client_spec.rb +226 -0
  91. data/spec/configuration_spec.rb +42 -0
  92. data/spec/models/campaign_spec.rb +94 -0
  93. data/spec/models/check_membership_request_spec.rb +46 -0
  94. data/spec/models/delete_email_spec.rb +34 -0
  95. data/spec/models/delete_person_spec.rb +34 -0
  96. data/spec/models/delete_phone_spec.rb +34 -0
  97. data/spec/models/deprecated_get_list_response_data_spec.rb +64 -0
  98. data/spec/models/deprecated_get_list_response_spec.rb +70 -0
  99. data/spec/models/global_exclusion_response_data_spec.rb +70 -0
  100. data/spec/models/identify_payload_properties_spec.rb +106 -0
  101. data/spec/models/identify_payload_spec.rb +40 -0
  102. data/spec/models/inline_object3_spec.rb +34 -0
  103. data/spec/models/inline_object4_spec.rb +34 -0
  104. data/spec/models/inline_object5_spec.rb +46 -0
  105. data/spec/models/inline_object_spec.rb +34 -0
  106. data/spec/models/metric_export_spec.rb +76 -0
  107. data/spec/models/metric_spec.rb +64 -0
  108. data/spec/models/metric_timeline_data_spec.rb +82 -0
  109. data/spec/models/metric_timeline_spec.rb +52 -0
  110. data/spec/models/person_spec.rb +148 -0
  111. data/spec/models/privacy_email_spec.rb +34 -0
  112. data/spec/models/privacy_id_spec.rb +34 -0
  113. data/spec/models/privacy_phone_spec.rb +34 -0
  114. data/spec/models/rendered_template_spec.rb +52 -0
  115. data/spec/models/template_spec.rb +70 -0
  116. data/spec/models/track_payload_customer_properties_spec.rb +40 -0
  117. data/spec/models/track_payload_properties_spec.rb +46 -0
  118. data/spec/models/track_payload_spec.rb +52 -0
  119. data/spec/spec_helper.rb +111 -0
  120. metadata +80 -3
data/docs/Metric.md ADDED
@@ -0,0 +1,28 @@
1
+ # Klaviyo::Metric
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **object** | **String** | | [optional] |
8
+ | **id** | **String** | | [optional] |
9
+ | **name** | **String** | | [optional] |
10
+ | **integration** | **Hash<String, Object>** | | [optional] |
11
+ | **created** | **String** | | [optional] |
12
+ | **updated** | **String** | | [optional] |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'klaviyo_sdk'
18
+
19
+ instance = Klaviyo::Metric.new(
20
+ object: null,
21
+ id: null,
22
+ name: null,
23
+ integration: null,
24
+ created: null,
25
+ updated: null
26
+ )
27
+ ```
28
+
@@ -0,0 +1,32 @@
1
+ # Klaviyo::MetricExport
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **metric** | **Hash<String, Object>** | | [optional] |
8
+ | **start_date** | **String** | | [optional] |
9
+ | **end_date** | **String** | | [optional] |
10
+ | **unit** | **String** | | [optional] |
11
+ | **measurement** | **String** | | [optional] |
12
+ | **by** | **String** | | [optional] |
13
+ | **where** | **String** | | [optional] |
14
+ | **results** | **Array<Hash<String, Object>>** | | [optional] |
15
+
16
+ ## Example
17
+
18
+ ```ruby
19
+ require 'klaviyo_sdk'
20
+
21
+ instance = Klaviyo::MetricExport.new(
22
+ metric: null,
23
+ start_date: null,
24
+ end_date: null,
25
+ unit: null,
26
+ measurement: null,
27
+ by: null,
28
+ where: null,
29
+ results: null
30
+ )
31
+ ```
32
+
@@ -0,0 +1,24 @@
1
+ # Klaviyo::MetricTimeline
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **object** | **String** | | [optional] |
8
+ | **count** | **Integer** | | [optional] |
9
+ | **data** | [**Array<MetricTimelineData>**](MetricTimelineData.md) | | [optional] |
10
+ | **_next** | **String** | | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'klaviyo_sdk'
16
+
17
+ instance = Klaviyo::MetricTimeline.new(
18
+ object: null,
19
+ count: null,
20
+ data: null,
21
+ _next: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,34 @@
1
+ # Klaviyo::MetricTimelineData
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **object** | **String** | | [optional] |
8
+ | **id** | **String** | | [optional] |
9
+ | **statistic_id** | **String** | | [optional] |
10
+ | **timestamp** | **Integer** | | [optional] |
11
+ | **event_name** | **String** | | [optional] |
12
+ | **event_properties** | **Hash<String, Object>** | | [optional] |
13
+ | **datetime** | **String** | | [optional] |
14
+ | **uuid** | **String** | | [optional] |
15
+ | **person** | **Hash<String, Object>** | | [optional] |
16
+
17
+ ## Example
18
+
19
+ ```ruby
20
+ require 'klaviyo_sdk'
21
+
22
+ instance = Klaviyo::MetricTimelineData.new(
23
+ object: null,
24
+ id: null,
25
+ statistic_id: null,
26
+ timestamp: null,
27
+ event_name: null,
28
+ event_properties: null,
29
+ datetime: null,
30
+ uuid: null,
31
+ person: null
32
+ )
33
+ ```
34
+
@@ -0,0 +1,329 @@
1
+ # Klaviyo::MetricsApi
2
+
3
+ All URIs are relative to *https://a.klaviyo.com/api*
4
+
5
+ | Method | HTTP request | Description |
6
+ | ------ | ------------ | ----------- |
7
+ | [**get_metrics**](MetricsApi.md#get_metrics) | **GET** /v1/metrics | Get Metrics Info |
8
+ | [**metric_export**](MetricsApi.md#metric_export) | **GET** /v1/metric/{metric_id}/export | Query Event Data |
9
+ | [**metric_timeline**](MetricsApi.md#metric_timeline) | **GET** /v1/metric/{metric_id}/timeline | Get Events for a Specific Metric |
10
+ | [**metrics_timeline**](MetricsApi.md#metrics_timeline) | **GET** /v1/metrics/timeline | Get Events for All Metrics |
11
+
12
+
13
+ ## get_metrics
14
+
15
+ > Hash<String, Object> get_metrics(opts)
16
+
17
+ Get Metrics Info
18
+
19
+ Returns a list of all the metrics in your account.
20
+
21
+ ### Examples
22
+
23
+ ```ruby
24
+ require 'time'
25
+ require 'klaviyo_sdk'
26
+ # setup authorization
27
+ Klaviyo.configure do |config|
28
+ # Configure API key authorization: ApiKeyAuth
29
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
30
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
31
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
32
+ end
33
+
34
+ api_instance = Klaviyo::MetricsApi.new
35
+ opts = {
36
+ page: 0, # Integer | For pagination, which page of results to return. Default = 0
37
+ count: 50 # Integer | For pagination, the number of results to return. Default = 50 ; Max = 100
38
+ }
39
+
40
+ begin
41
+ # Get Metrics Info
42
+ result = api_instance.get_metrics(opts)
43
+ p result
44
+ rescue Klaviyo::ApiError => e
45
+ puts "Error when calling MetricsApi->get_metrics: #{e}"
46
+ end
47
+ ```
48
+
49
+ #### Using the get_metrics_with_http_info variant
50
+
51
+ This returns an Array which contains the response data, status code and headers.
52
+
53
+ > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> get_metrics_with_http_info(opts)
54
+
55
+ ```ruby
56
+ begin
57
+ # Get Metrics Info
58
+ data, status_code, headers = api_instance.get_metrics_with_http_info(opts)
59
+ p status_code # => 2xx
60
+ p headers # => { ... }
61
+ p data # => Hash&lt;String, Object&gt;
62
+ rescue Klaviyo::ApiError => e
63
+ puts "Error when calling MetricsApi->get_metrics_with_http_info: #{e}"
64
+ end
65
+ ```
66
+
67
+ ### Parameters
68
+
69
+ | Name | Type | Description | Notes |
70
+ | ---- | ---- | ----------- | ----- |
71
+ | **page** | **Integer** | For pagination, which page of results to return. Default &#x3D; 0 | [optional][default to 0] |
72
+ | **count** | **Integer** | For pagination, the number of results to return. Default &#x3D; 50 ; Max &#x3D; 100 | [optional][default to 50] |
73
+
74
+ ### Return type
75
+
76
+ **Hash&lt;String, Object&gt;**
77
+
78
+ ### Authorization
79
+
80
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
81
+
82
+ ### HTTP request headers
83
+
84
+ - **Content-Type**: Not defined
85
+ - **Accept**: application/json
86
+
87
+
88
+ ## metric_export
89
+
90
+ > <MetricExport> metric_export(metric_id, opts)
91
+
92
+ Query Event Data
93
+
94
+ 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:
95
+
96
+ ### Examples
97
+
98
+ ```ruby
99
+ require 'time'
100
+ require 'klaviyo_sdk'
101
+ # setup authorization
102
+ Klaviyo.configure do |config|
103
+ # Configure API key authorization: ApiKeyAuth
104
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
105
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
106
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
107
+ end
108
+
109
+ api_instance = Klaviyo::MetricsApi.new
110
+ metric_id = 'METRIC_ID' # String |
111
+ opts = {
112
+ start_date: 'start_date_example', # String | 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`
113
+ end_date: 'end_date_example', # String | 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`
114
+ unit: 'day', # String | Granularity to bucket data points into - one of `day`, `week`, or `month`. Defaults to `day`.
115
+ measurement: 'count', # String | 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\"]`
116
+ where: '[["$attributed_flow","=","FLOW_ID"]]', # String | 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\"]]`
117
+ by: '$attributed_flow', # String | 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.
118
+ count: 25 # Integer | Maximum number of segments to return. Default = 25, **MAX = 1000**
119
+ }
120
+
121
+ begin
122
+ # Query Event Data
123
+ result = api_instance.metric_export(metric_id, opts)
124
+ p result
125
+ rescue Klaviyo::ApiError => e
126
+ puts "Error when calling MetricsApi->metric_export: #{e}"
127
+ end
128
+ ```
129
+
130
+ #### Using the metric_export_with_http_info variant
131
+
132
+ This returns an Array which contains the response data, status code and headers.
133
+
134
+ > <Array(<MetricExport>, Integer, Hash)> metric_export_with_http_info(metric_id, opts)
135
+
136
+ ```ruby
137
+ begin
138
+ # Query Event Data
139
+ data, status_code, headers = api_instance.metric_export_with_http_info(metric_id, opts)
140
+ p status_code # => 2xx
141
+ p headers # => { ... }
142
+ p data # => <MetricExport>
143
+ rescue Klaviyo::ApiError => e
144
+ puts "Error when calling MetricsApi->metric_export_with_http_info: #{e}"
145
+ end
146
+ ```
147
+
148
+ ### Parameters
149
+
150
+ | Name | Type | Description | Notes |
151
+ | ---- | ---- | ----------- | ----- |
152
+ | **metric_id** | **String** | | [default to &#39;METRIC_ID&#39;] |
153
+ | **start_date** | **String** | 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 &#x60;start_date&#x60;, you must also send an &#x60;end_date&#x60; Ex: &#x60;1610524800&#x60; OR &#x60;2021-01-13&#x60; | [optional] |
154
+ | **end_date** | **String** | 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 &#x60;end_date&#x60;, you must also send a &#x60;start_date&#x60;. Must be *at most* 31 days after &#x60;start_date&#x60; Ex: &#x60;1612080000&#x60; OR &#x60;2021-01-31&#x60; | [optional] |
155
+ | **unit** | **String** | Granularity to bucket data points into - one of &#x60;day&#x60;, &#x60;week&#x60;, or &#x60;month&#x60;. Defaults to &#x60;day&#x60;. | [optional][default to &#39;day&#39;] |
156
+ | **measurement** | **String** | Type of metric to fetch - one of &#x60;unique&#x60;, &#x60;count&#x60;, &#x60;value&#x60;, or &#x60;sum&#x60;. Defaults to &#x60;count&#x60;. For &#x60;sum&#x60; a property name to operate on must be supplied as a JSON-encoded list like &#x60;[\&quot;sum\&quot;,\&quot;ItemCount\&quot;]&#x60; | [optional][default to &#39;count&#39;] |
157
+ | **where** | **String** | Optional, JSON-encoded list. Conditions to use to filter the set of events. A max of 1 condition can be given. &#x60;where&#x60; and &#x60;by&#x60; parameters cannot be specified at the same time. ex: &#x60;[[\&quot;$attributed_flow\&quot;,\&quot;&#x3D;\&quot;,\&quot;FLOW_ID\&quot;]]&#x60; | [optional] |
158
+ | **by** | **String** | The name of a property to segment the event data on. &#x60;where&#x60; and &#x60;by&#x60; parameters cannot be specified at the same time. Cannot be used alongside &#x60;where&#x60; parameter. | [optional] |
159
+ | **count** | **Integer** | Maximum number of segments to return. Default &#x3D; 25, **MAX &#x3D; 1000** | [optional][default to 25] |
160
+
161
+ ### Return type
162
+
163
+ [**MetricExport**](MetricExport.md)
164
+
165
+ ### Authorization
166
+
167
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
168
+
169
+ ### HTTP request headers
170
+
171
+ - **Content-Type**: Not defined
172
+ - **Accept**: application/json
173
+
174
+
175
+ ## metric_timeline
176
+
177
+ > <MetricTimeline> metric_timeline(metric_id, opts)
178
+
179
+ Get Events for a Specific Metric
180
+
181
+ Returns a batched timeline for one specific metric.
182
+
183
+ ### Examples
184
+
185
+ ```ruby
186
+ require 'time'
187
+ require 'klaviyo_sdk'
188
+ # setup authorization
189
+ Klaviyo.configure do |config|
190
+ # Configure API key authorization: ApiKeyAuth
191
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
192
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
193
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
194
+ end
195
+
196
+ api_instance = Klaviyo::MetricsApi.new
197
+ metric_id = 'METRIC_ID' # String |
198
+ opts = {
199
+ since: 'since_example', # String | 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.
200
+ count: 100, # Integer | Number of events to return in a batch. Max = 100
201
+ sort: 'desc' # String | 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.
202
+ }
203
+
204
+ begin
205
+ # Get Events for a Specific Metric
206
+ result = api_instance.metric_timeline(metric_id, opts)
207
+ p result
208
+ rescue Klaviyo::ApiError => e
209
+ puts "Error when calling MetricsApi->metric_timeline: #{e}"
210
+ end
211
+ ```
212
+
213
+ #### Using the metric_timeline_with_http_info variant
214
+
215
+ This returns an Array which contains the response data, status code and headers.
216
+
217
+ > <Array(<MetricTimeline>, Integer, Hash)> metric_timeline_with_http_info(metric_id, opts)
218
+
219
+ ```ruby
220
+ begin
221
+ # Get Events for a Specific Metric
222
+ data, status_code, headers = api_instance.metric_timeline_with_http_info(metric_id, opts)
223
+ p status_code # => 2xx
224
+ p headers # => { ... }
225
+ p data # => <MetricTimeline>
226
+ rescue Klaviyo::ApiError => e
227
+ puts "Error when calling MetricsApi->metric_timeline_with_http_info: #{e}"
228
+ end
229
+ ```
230
+
231
+ ### Parameters
232
+
233
+ | Name | Type | Description | Notes |
234
+ | ---- | ---- | ----------- | ----- |
235
+ | **metric_id** | **String** | | [default to &#39;METRIC_ID&#39;] |
236
+ | **since** | **String** | Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the &#x60;next&#x60; attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time. | [optional] |
237
+ | **count** | **Integer** | Number of events to return in a batch. Max &#x3D; 100 | [optional][default to 50] |
238
+ | **sort** | **String** | Sort order to apply to timeline, either descending or ascending. Valid values are &#x60;desc&#x60; or &#x60;asc&#x60;. Defaults to &#x60;desc&#x60;. Always descending when &#x60;since&#x60; is not sent, as &#x60;since&#x60; defaults to current time. | [optional][default to &#39;desc&#39;] |
239
+
240
+ ### Return type
241
+
242
+ [**MetricTimeline**](MetricTimeline.md)
243
+
244
+ ### Authorization
245
+
246
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
247
+
248
+ ### HTTP request headers
249
+
250
+ - **Content-Type**: Not defined
251
+ - **Accept**: application/json
252
+
253
+
254
+ ## metrics_timeline
255
+
256
+ > <MetricTimeline> metrics_timeline(opts)
257
+
258
+ Get Events for All Metrics
259
+
260
+ Returns a batched timeline of all events in your account.
261
+
262
+ ### Examples
263
+
264
+ ```ruby
265
+ require 'time'
266
+ require 'klaviyo_sdk'
267
+ # setup authorization
268
+ Klaviyo.configure do |config|
269
+ # Configure API key authorization: ApiKeyAuth
270
+ config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
271
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
272
+ # config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
273
+ end
274
+
275
+ api_instance = Klaviyo::MetricsApi.new
276
+ opts = {
277
+ since: 'since_example', # String | 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.
278
+ count: 50, # Integer | Number of events to return in a batch. Default = 50, Max = 100
279
+ sort: 'desc' # String | 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.
280
+ }
281
+
282
+ begin
283
+ # Get Events for All Metrics
284
+ result = api_instance.metrics_timeline(opts)
285
+ p result
286
+ rescue Klaviyo::ApiError => e
287
+ puts "Error when calling MetricsApi->metrics_timeline: #{e}"
288
+ end
289
+ ```
290
+
291
+ #### Using the metrics_timeline_with_http_info variant
292
+
293
+ This returns an Array which contains the response data, status code and headers.
294
+
295
+ > <Array(<MetricTimeline>, Integer, Hash)> metrics_timeline_with_http_info(opts)
296
+
297
+ ```ruby
298
+ begin
299
+ # Get Events for All Metrics
300
+ data, status_code, headers = api_instance.metrics_timeline_with_http_info(opts)
301
+ p status_code # => 2xx
302
+ p headers # => { ... }
303
+ p data # => <MetricTimeline>
304
+ rescue Klaviyo::ApiError => e
305
+ puts "Error when calling MetricsApi->metrics_timeline_with_http_info: #{e}"
306
+ end
307
+ ```
308
+
309
+ ### Parameters
310
+
311
+ | Name | Type | Description | Notes |
312
+ | ---- | ---- | ----------- | ----- |
313
+ | **since** | **String** | 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. | [optional] |
314
+ | **count** | **Integer** | Number of events to return in a batch. Default &#x3D; 50, Max &#x3D; 100 | [optional][default to 50] |
315
+ | **sort** | **String** | Sort order to apply to timeline, either descending or ascending. Valid values are &#x60;desc&#x60; or &#x60;asc&#x60;. Defaults to &#x60;desc&#x60;. Always descending when &#x60;since&#x60; is not sent, as &#x60;since&#x60; defaults to current time. | [optional][default to &#39;desc&#39;] |
316
+
317
+ ### Return type
318
+
319
+ [**MetricTimeline**](MetricTimeline.md)
320
+
321
+ ### Authorization
322
+
323
+ [ApiKeyAuth](../README.md#ApiKeyAuth)
324
+
325
+ ### HTTP request headers
326
+
327
+ - **Content-Type**: Not defined
328
+ - **Accept**: application/json
329
+
data/docs/Person.md ADDED
@@ -0,0 +1,56 @@
1
+ # Klaviyo::Person
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **object** | **String** | | [optional] |
8
+ | **id** | **String** | | [optional] |
9
+ | **_address1** | **String** | | [optional] |
10
+ | **_address2** | **String** | | [optional] |
11
+ | **_city** | **String** | | [optional] |
12
+ | **_country** | **String** | | [optional] |
13
+ | **_latitude** | **String** | | [optional] |
14
+ | **_longitude** | **String** | | [optional] |
15
+ | **_region** | **String** | | [optional] |
16
+ | **_zip** | **String** | | [optional] |
17
+ | **_email** | **String** | | [optional] |
18
+ | **_title** | **String** | | [optional] |
19
+ | **_phone_number** | **String** | | [optional] |
20
+ | **_organization** | **String** | | [optional] |
21
+ | **_first_name** | **String** | | [optional] |
22
+ | **_last_name** | **String** | | [optional] |
23
+ | **_timezone** | **String** | | [optional] |
24
+ | **_id** | **String** | | [optional] |
25
+ | **created** | **String** | | [optional] |
26
+ | **updated** | **String** | | [optional] |
27
+
28
+ ## Example
29
+
30
+ ```ruby
31
+ require 'klaviyo_sdk'
32
+
33
+ instance = Klaviyo::Person.new(
34
+ object: person,
35
+ id: PERSON_ID,
36
+ _address1: ,
37
+ _address2: ,
38
+ _city: Mount Vernon,
39
+ _country: United States,
40
+ _latitude: ,
41
+ _longitude: ,
42
+ _region: Virginia,
43
+ _zip: 22121,
44
+ _email: george.washington@klaviyo.com,
45
+ _title: President,
46
+ _phone_number: +13239169023,
47
+ _organization: U.S. Government,
48
+ _first_name: George,
49
+ _last_name: Washington,
50
+ _timezone: US/Eastern,
51
+ _id: CUSTOM_ID,
52
+ created: 2021-11-04 09:06:13,
53
+ updated: 2021-11-23 11:21:03
54
+ )
55
+ ```
56
+
@@ -0,0 +1,18 @@
1
+ # Klaviyo::PrivacyEmail
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **email** | **String** | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'klaviyo_sdk'
13
+
14
+ instance = Klaviyo::PrivacyEmail.new(
15
+ email: abraham.lincoln@klaviyo.com
16
+ )
17
+ ```
18
+
data/docs/PrivacyId.md ADDED
@@ -0,0 +1,18 @@
1
+ # Klaviyo::PrivacyId
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **person_id** | **String** | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'klaviyo_sdk'
13
+
14
+ instance = Klaviyo::PrivacyId.new(
15
+ person_id: PERSON_ID
16
+ )
17
+ ```
18
+
@@ -0,0 +1,18 @@
1
+ # Klaviyo::PrivacyPhone
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **phone_number** | **String** | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'klaviyo_sdk'
13
+
14
+ instance = Klaviyo::PrivacyPhone.new(
15
+ phone_number: +13239169023
16
+ )
17
+ ```
18
+