klaviyo_sdk 1.0.0.20220329 → 1.0.3.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile +10 -0
- data/README.md +99 -99
- data/Rakefile +10 -0
- data/docs/Campaign.md +38 -0
- data/docs/CampaignsApi.md +707 -0
- data/docs/CheckMembershipRequest.md +22 -0
- data/docs/DataPrivacyApi.md +81 -0
- data/docs/DeleteEmail.md +18 -0
- data/docs/DeletePerson.md +18 -0
- data/docs/DeletePhone.md +18 -0
- data/docs/DeprecatedGetListResponse.md +30 -0
- data/docs/DeprecatedGetListResponseData.md +28 -0
- data/docs/GlobalExclusionResponseData.md +30 -0
- data/docs/IdentifyPayload.md +20 -0
- data/docs/IdentifyPayloadProperties.md +42 -0
- data/docs/InlineObject.md +18 -0
- data/docs/InlineObject3.md +18 -0
- data/docs/InlineObject4.md +18 -0
- data/docs/InlineObject5.md +22 -0
- data/docs/ListsSegmentsApi.md +1198 -0
- data/docs/Metric.md +28 -0
- data/docs/MetricExport.md +32 -0
- data/docs/MetricTimeline.md +24 -0
- data/docs/MetricTimelineData.md +34 -0
- data/docs/MetricsApi.md +329 -0
- data/docs/Person.md +56 -0
- data/docs/PrivacyEmail.md +18 -0
- data/docs/PrivacyId.md +18 -0
- data/docs/PrivacyPhone.md +18 -0
- data/docs/ProfilesApi.md +391 -0
- data/docs/RenderedTemplate.md +24 -0
- data/docs/Template.md +30 -0
- data/docs/TemplatesApi.md +541 -0
- data/docs/TrackIdentifyApi.md +267 -0
- data/docs/TrackPayload.md +24 -0
- data/docs/TrackPayloadCustomerProperties.md +20 -0
- data/docs/TrackPayloadProperties.md +22 -0
- data/git_push.sh +57 -0
- data/klaviyo_sdk-1.0.3.2022.03.29.gem +0 -0
- data/klaviyo_sdk.gemspec +6 -1
- data/lib/klaviyo_sdk/api/campaigns_api.rb +1 -1
- data/lib/klaviyo_sdk/api/data_privacy_api.rb +1 -1
- data/lib/klaviyo_sdk/api/lists_segments_api.rb +1 -1
- data/lib/klaviyo_sdk/api/metrics_api.rb +1 -1
- data/lib/klaviyo_sdk/api/profiles_api.rb +1 -1
- data/lib/klaviyo_sdk/api/templates_api.rb +1 -1
- data/lib/klaviyo_sdk/api/track_identify_api.rb +1 -1
- data/lib/klaviyo_sdk/api_client.rb +2 -2
- data/lib/klaviyo_sdk/api_error.rb +1 -1
- data/lib/klaviyo_sdk/configuration.rb +1 -1
- data/lib/klaviyo_sdk/models/campaign.rb +4 -4
- data/lib/klaviyo_sdk/models/check_membership_request.rb +4 -4
- data/lib/klaviyo_sdk/models/delete_email.rb +4 -4
- data/lib/klaviyo_sdk/models/delete_person.rb +4 -4
- data/lib/klaviyo_sdk/models/delete_phone.rb +4 -4
- data/lib/klaviyo_sdk/models/deprecated_get_list_response.rb +4 -4
- data/lib/klaviyo_sdk/models/deprecated_get_list_response_data.rb +4 -4
- data/lib/klaviyo_sdk/models/global_exclusion_response_data.rb +4 -4
- data/lib/klaviyo_sdk/models/identify_payload.rb +4 -4
- data/lib/klaviyo_sdk/models/identify_payload_properties.rb +4 -4
- data/lib/klaviyo_sdk/models/inline_object.rb +9 -4
- data/lib/klaviyo_sdk/models/inline_object3.rb +4 -4
- data/lib/klaviyo_sdk/models/inline_object4.rb +4 -4
- data/lib/klaviyo_sdk/models/inline_object5.rb +4 -4
- data/lib/klaviyo_sdk/models/metric.rb +4 -4
- data/lib/klaviyo_sdk/models/metric_export.rb +4 -4
- data/lib/klaviyo_sdk/models/metric_timeline.rb +4 -4
- data/lib/klaviyo_sdk/models/metric_timeline_data.rb +4 -4
- data/lib/klaviyo_sdk/models/person.rb +4 -4
- data/lib/klaviyo_sdk/models/person.rb.bak +4 -4
- data/lib/klaviyo_sdk/models/privacy_email.rb +4 -4
- data/lib/klaviyo_sdk/models/privacy_id.rb +4 -4
- data/lib/klaviyo_sdk/models/privacy_phone.rb +4 -4
- data/lib/klaviyo_sdk/models/rendered_template.rb +4 -4
- data/lib/klaviyo_sdk/models/template.rb +4 -4
- data/lib/klaviyo_sdk/models/track_payload.rb +4 -4
- data/lib/klaviyo_sdk/models/track_payload_customer_properties.rb +4 -4
- data/lib/klaviyo_sdk/models/track_payload_properties.rb +4 -4
- data/lib/klaviyo_sdk/version.rb +1 -1
- data/lib/klaviyo_sdk.rb +7 -7
- data/spec/api/campaigns_api_spec.rb +165 -0
- data/spec/api/data_privacy_api_spec.rb +47 -0
- data/spec/api/lists_segments_api_spec.rb +239 -0
- data/spec/api/metrics_api_spec.rb +96 -0
- data/spec/api/profiles_api_spec.rb +103 -0
- data/spec/api/templates_api_spec.rb +130 -0
- data/spec/api/track_identify_api_spec.rb +83 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/campaign_spec.rb +94 -0
- data/spec/models/check_membership_request_spec.rb +46 -0
- data/spec/models/delete_email_spec.rb +34 -0
- data/spec/models/delete_person_spec.rb +34 -0
- data/spec/models/delete_phone_spec.rb +34 -0
- data/spec/models/deprecated_get_list_response_data_spec.rb +64 -0
- data/spec/models/deprecated_get_list_response_spec.rb +70 -0
- data/spec/models/global_exclusion_response_data_spec.rb +70 -0
- data/spec/models/identify_payload_properties_spec.rb +106 -0
- data/spec/models/identify_payload_spec.rb +40 -0
- data/spec/models/inline_object3_spec.rb +34 -0
- data/spec/models/inline_object4_spec.rb +34 -0
- data/spec/models/inline_object5_spec.rb +46 -0
- data/spec/models/inline_object_spec.rb +34 -0
- data/spec/models/metric_export_spec.rb +76 -0
- data/spec/models/metric_spec.rb +64 -0
- data/spec/models/metric_timeline_data_spec.rb +82 -0
- data/spec/models/metric_timeline_spec.rb +52 -0
- data/spec/models/person_spec.rb +148 -0
- data/spec/models/privacy_email_spec.rb +34 -0
- data/spec/models/privacy_id_spec.rb +34 -0
- data/spec/models/privacy_phone_spec.rb +34 -0
- data/spec/models/rendered_template_spec.rb +52 -0
- data/spec/models/template_spec.rb +70 -0
- data/spec/models/track_payload_customer_properties_spec.rb +40 -0
- data/spec/models/track_payload_properties_spec.rb +46 -0
- data/spec/models/track_payload_spec.rb +52 -0
- data/spec/spec_helper.rb +111 -0
- metadata +80 -3
@@ -0,0 +1,267 @@
|
|
1
|
+
# Klaviyo::TrackIdentifyApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://a.klaviyo.com/api*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**identify_get**](TrackIdentifyApi.md#identify_get) | **GET** /identify | Identify Profile (Legacy) |
|
8
|
+
| [**identify_post**](TrackIdentifyApi.md#identify_post) | **POST** /identify | Identify Profile |
|
9
|
+
| [**track_get**](TrackIdentifyApi.md#track_get) | **GET** /track | Track Profile Activity (Legacy) |
|
10
|
+
| [**track_post**](TrackIdentifyApi.md#track_post) | **POST** /track | Track Profile Activity |
|
11
|
+
|
12
|
+
|
13
|
+
## identify_get
|
14
|
+
|
15
|
+
> String identify_get(data)
|
16
|
+
|
17
|
+
Identify Profile (Legacy)
|
18
|
+
|
19
|
+
This endpoint is also used to identify a profile and update its properties without an associated event. It takes as input the same payload as the above POST request, but as a base64-encoded string passed as a query parameter. NOTE: This is offered for backwards compatibility; we recommend all new implementations use the POST approach above. **EXAMPLE:** ``` { \"token\": \"PUBLIC_KEY\", \"properties\": { \"$email\": \"abraham.lincoln@klaviyo.com\", \"$first_name\": \"Abraham\", \"$last_name\": \"Lincoln\", \"$city\": \"Springfield\", \"$region\": \"Illinois\" } } ``` Gets encoded into the following string, which is passed into the `data` parameter: `eyJ0b2tlbiI6ICJQVUJMSUNfS0VZIiwicHJvcGVydGllcyI6IHsiJGVtYWlsIjogImFicmFoYW0ubGluY29sbkBrbGF2aXlvLmNvbSIsIiRmaXJzdF9uYW1lIjogIkFicmFoYW0iLCIkbGFzdF9uYW1lIjogIkxpbmNvbG4iLCIkY2l0eSI6ICJTcHJpbmdmaWVsZCIsIiRyZWdpb24iOiAiSWxsaW5vaXMifX0K`
|
20
|
+
|
21
|
+
### Examples
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'time'
|
25
|
+
require 'klaviyo_sdk'
|
26
|
+
|
27
|
+
api_instance = Klaviyo::TrackIdentifyApi.new
|
28
|
+
data = 'BASE_64_STRING' # String | String representation of base64 encoded JSON object
|
29
|
+
|
30
|
+
begin
|
31
|
+
# Identify Profile (Legacy)
|
32
|
+
result = api_instance.identify_get(data)
|
33
|
+
p result
|
34
|
+
rescue Klaviyo::ApiError => e
|
35
|
+
puts "Error when calling TrackIdentifyApi->identify_get: #{e}"
|
36
|
+
end
|
37
|
+
```
|
38
|
+
|
39
|
+
#### Using the identify_get_with_http_info variant
|
40
|
+
|
41
|
+
This returns an Array which contains the response data, status code and headers.
|
42
|
+
|
43
|
+
> <Array(String, Integer, Hash)> identify_get_with_http_info(data)
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
begin
|
47
|
+
# Identify Profile (Legacy)
|
48
|
+
data, status_code, headers = api_instance.identify_get_with_http_info(data)
|
49
|
+
p status_code # => 2xx
|
50
|
+
p headers # => { ... }
|
51
|
+
p data # => String
|
52
|
+
rescue Klaviyo::ApiError => e
|
53
|
+
puts "Error when calling TrackIdentifyApi->identify_get_with_http_info: #{e}"
|
54
|
+
end
|
55
|
+
```
|
56
|
+
|
57
|
+
### Parameters
|
58
|
+
|
59
|
+
| Name | Type | Description | Notes |
|
60
|
+
| ---- | ---- | ----------- | ----- |
|
61
|
+
| **data** | **String** | String representation of base64 encoded JSON object | [default to 'BASE_64_STRING'] |
|
62
|
+
|
63
|
+
### Return type
|
64
|
+
|
65
|
+
**String**
|
66
|
+
|
67
|
+
### Authorization
|
68
|
+
|
69
|
+
No authorization required
|
70
|
+
|
71
|
+
### HTTP request headers
|
72
|
+
|
73
|
+
- **Content-Type**: Not defined
|
74
|
+
- **Accept**: text/html
|
75
|
+
|
76
|
+
|
77
|
+
## identify_post
|
78
|
+
|
79
|
+
> String identify_post(data)
|
80
|
+
|
81
|
+
Identify Profile
|
82
|
+
|
83
|
+
This endpoint is used to track and update properties about an individual without tracking an associated event. The following data is stored in a JSON object. **JSON OBJECT STRUCTURE:** __token: *string*__ This is your public API key. __properties: *JSON Object or null*__ Properties of the profile to track/update. You must identify the person by their email using a $email key (or by their phone number using a `$phone_number` key if you have SMS-only contacts). Other than that, you can include any data you want and it can then be used to create segments of people. For example, if you wanted to create a list of people on trial plans, include a person's plan type in this JSON object so you can use that information later. **SPECIAL FIELDS:** The Klaviyo CRM has the following special fields you can set for customer **properties** with the **Identify** endpoint, to unlock additional functionality: **$email:** _string_ **$first_name:** _string_ **$last_name:** _string_ **$phone_number:** _string; eg: \"+13239169023\"_ **$city:** _string_ **$region:** _string; state, or other region_ **$country:** _string_ **$zip:** _string_ **$image:** _string; url to a photo of a person_ **$consent:** _list of strings; eg: ['sms', 'email', 'web', 'directmail', 'mobile']_ **EXAMPLE:** ``` { \"token\": \"PUBLIC_KEY\", \"properties\": { \"$email\": \"abraham.lincoln@klaviyo.com\", \"$first_name\": \"Abraham\", \"$last_name\": \"Lincoln\", \"$city\": \"Springfield\", \"$region\": \"Illinois\" } }
|
84
|
+
|
85
|
+
### Examples
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
require 'time'
|
89
|
+
require 'klaviyo_sdk'
|
90
|
+
|
91
|
+
api_instance = Klaviyo::TrackIdentifyApi.new
|
92
|
+
data = 'data_example' # String |
|
93
|
+
|
94
|
+
begin
|
95
|
+
# Identify Profile
|
96
|
+
result = api_instance.identify_post(data)
|
97
|
+
p result
|
98
|
+
rescue Klaviyo::ApiError => e
|
99
|
+
puts "Error when calling TrackIdentifyApi->identify_post: #{e}"
|
100
|
+
end
|
101
|
+
```
|
102
|
+
|
103
|
+
#### Using the identify_post_with_http_info variant
|
104
|
+
|
105
|
+
This returns an Array which contains the response data, status code and headers.
|
106
|
+
|
107
|
+
> <Array(String, Integer, Hash)> identify_post_with_http_info(data)
|
108
|
+
|
109
|
+
```ruby
|
110
|
+
begin
|
111
|
+
# Identify Profile
|
112
|
+
data, status_code, headers = api_instance.identify_post_with_http_info(data)
|
113
|
+
p status_code # => 2xx
|
114
|
+
p headers # => { ... }
|
115
|
+
p data # => String
|
116
|
+
rescue Klaviyo::ApiError => e
|
117
|
+
puts "Error when calling TrackIdentifyApi->identify_post_with_http_info: #{e}"
|
118
|
+
end
|
119
|
+
```
|
120
|
+
|
121
|
+
### Parameters
|
122
|
+
|
123
|
+
| Name | Type | Description | Notes |
|
124
|
+
| ---- | ---- | ----------- | ----- |
|
125
|
+
| **data** | **String** | | [default to '{\"token\": \"PUBLIC_KEY\",\"properties\": {\"$email\":\"ben.franklin@klaviyo.com\"}}'] |
|
126
|
+
|
127
|
+
### Return type
|
128
|
+
|
129
|
+
**String**
|
130
|
+
|
131
|
+
### Authorization
|
132
|
+
|
133
|
+
No authorization required
|
134
|
+
|
135
|
+
### HTTP request headers
|
136
|
+
|
137
|
+
- **Content-Type**: application/x-www-form-urlencoded
|
138
|
+
- **Accept**: text/html
|
139
|
+
|
140
|
+
|
141
|
+
## track_get
|
142
|
+
|
143
|
+
> String track_get(data)
|
144
|
+
|
145
|
+
Track Profile Activity (Legacy)
|
146
|
+
|
147
|
+
This endpoint is also used to track a profile's activity. It takes as input the same payload as the above POST request, but as a base64-encoded string passed as a query parameter. NOTE: This is offered for backwards compatibility; we recommend all new implementations use the POST approach above. **EXAMPLE:** ``` { \"token\": \"PUBLIC_KEY\", \"event\": \"Ordered Product\", \"customer_properties\": { \"$email\": \"abraham.lincoln@klaviyo.com\" }, \"properties\": { \"item_name\": \"Boots\", \"$value\": 100 } } ``` Gets encoded into the following string, which is passed into the `data` parameter: `eyJ0b2tlbiI6ICJQVUJMSUNfS0VZIiwiZXZlbnQiOiAiT3JkZXJlZEl0ZW0iLCJjdXN0b21lcl9wcm9wZXJ0aWVzIjogeyIkZW1haWwiOiAiYWJyYWhhbS5saW5jb2xuQGtsYXZpeW8uY29tIn0sInByb3BlcnRpZXMiOiB7Iml0ZW1fbmFtZSI6ICJCb290cyIsIiR2YWx1ZSI6IDEwMH19`
|
148
|
+
|
149
|
+
### Examples
|
150
|
+
|
151
|
+
```ruby
|
152
|
+
require 'time'
|
153
|
+
require 'klaviyo_sdk'
|
154
|
+
|
155
|
+
api_instance = Klaviyo::TrackIdentifyApi.new
|
156
|
+
data = 'BASE_64_STRING' # String | String representation of base64 encoded JSON object
|
157
|
+
|
158
|
+
begin
|
159
|
+
# Track Profile Activity (Legacy)
|
160
|
+
result = api_instance.track_get(data)
|
161
|
+
p result
|
162
|
+
rescue Klaviyo::ApiError => e
|
163
|
+
puts "Error when calling TrackIdentifyApi->track_get: #{e}"
|
164
|
+
end
|
165
|
+
```
|
166
|
+
|
167
|
+
#### Using the track_get_with_http_info variant
|
168
|
+
|
169
|
+
This returns an Array which contains the response data, status code and headers.
|
170
|
+
|
171
|
+
> <Array(String, Integer, Hash)> track_get_with_http_info(data)
|
172
|
+
|
173
|
+
```ruby
|
174
|
+
begin
|
175
|
+
# Track Profile Activity (Legacy)
|
176
|
+
data, status_code, headers = api_instance.track_get_with_http_info(data)
|
177
|
+
p status_code # => 2xx
|
178
|
+
p headers # => { ... }
|
179
|
+
p data # => String
|
180
|
+
rescue Klaviyo::ApiError => e
|
181
|
+
puts "Error when calling TrackIdentifyApi->track_get_with_http_info: #{e}"
|
182
|
+
end
|
183
|
+
```
|
184
|
+
|
185
|
+
### Parameters
|
186
|
+
|
187
|
+
| Name | Type | Description | Notes |
|
188
|
+
| ---- | ---- | ----------- | ----- |
|
189
|
+
| **data** | **String** | String representation of base64 encoded JSON object | [default to 'BASE_64_STRING'] |
|
190
|
+
|
191
|
+
### Return type
|
192
|
+
|
193
|
+
**String**
|
194
|
+
|
195
|
+
### Authorization
|
196
|
+
|
197
|
+
No authorization required
|
198
|
+
|
199
|
+
### HTTP request headers
|
200
|
+
|
201
|
+
- **Content-Type**: Not defined
|
202
|
+
- **Accept**: text/html
|
203
|
+
|
204
|
+
|
205
|
+
## track_post
|
206
|
+
|
207
|
+
> String track_post(data)
|
208
|
+
|
209
|
+
Track Profile Activity
|
210
|
+
|
211
|
+
This endpoint is used to track a profile's activity. The following data is encoded in a JSON object. NOTE: an account can have up to 200 unique metrics (event types). This endpoint can accept payloads up to approximately 1MB. **JSON OBJECT STRUCTURE:** __token: *string*__ This is your public API key. __event: *string*__ Name of the event you want to track. __customer_properties: *JSON Object or null*__ Properties of the profile that triggered this event. You must identify the person by their email using a $email key (or by their phone number using a `$phone_number` key if you have SMS-only contacts). Other than that, you can include any data you want and it can then be used to create segments of people. For example, if you wanted to create a list of people on trial plans, include a person's plan type in this JSON object so you can use that information later. __properties: *optional; JSON Object or null*__ Properties of this event. Any properties included here can be used for creating segments later For example, if you track an event called \"Ordered Product\" you could include a property for item type (e.g. image, article, etc.), size, etc. __time: *optional; 10-digit UNIX timestamp or null*__ When this event occurred. By default, Klaviyo assumes events happen when a request is made. If you'd like to track an event that happened in past, use this property. **SPECIAL FIELDS:** The Klaviyo CRM has the following special fields you can set for **customer_properties** with the **Track** endpoint, to unlock additional functionality: **$email:** _string_ **$first_name:** _string_ **$last_name:** _string_ **$phone_number:** _string; eg: \"+13239169023\"_ **$city:** _string_ **$region:** _string; state, or other region_ **$country:** _string_ **$zip:** _string_ **$image:** _string; url to a photo of a person_ **$consent:** _list of strings; eg: ['sms', 'email', 'web', 'directmail', 'mobile']_ You can also set the following special fields in event **properties** with the **Track** endpoint: **$event_id:** _a unique identifier for an event_ **$value:** _a numeric value to associate with this event (e.g. the dollar value of a purchase)_ **EXAMPLE:** ``` { \"token\": \"PUBLIC_KEY\", \"event\": \"Ordered Product\", \"customer_properties\": { \"$email\": \"abraham.lincoln@klaviyo.com\" }, \"properties\": { \"item_name\": \"Boots\", \"$value\": 100 } }
|
212
|
+
|
213
|
+
### Examples
|
214
|
+
|
215
|
+
```ruby
|
216
|
+
require 'time'
|
217
|
+
require 'klaviyo_sdk'
|
218
|
+
|
219
|
+
api_instance = Klaviyo::TrackIdentifyApi.new
|
220
|
+
data = 'data_example' # String |
|
221
|
+
|
222
|
+
begin
|
223
|
+
# Track Profile Activity
|
224
|
+
result = api_instance.track_post(data)
|
225
|
+
p result
|
226
|
+
rescue Klaviyo::ApiError => e
|
227
|
+
puts "Error when calling TrackIdentifyApi->track_post: #{e}"
|
228
|
+
end
|
229
|
+
```
|
230
|
+
|
231
|
+
#### Using the track_post_with_http_info variant
|
232
|
+
|
233
|
+
This returns an Array which contains the response data, status code and headers.
|
234
|
+
|
235
|
+
> <Array(String, Integer, Hash)> track_post_with_http_info(data)
|
236
|
+
|
237
|
+
```ruby
|
238
|
+
begin
|
239
|
+
# Track Profile Activity
|
240
|
+
data, status_code, headers = api_instance.track_post_with_http_info(data)
|
241
|
+
p status_code # => 2xx
|
242
|
+
p headers # => { ... }
|
243
|
+
p data # => String
|
244
|
+
rescue Klaviyo::ApiError => e
|
245
|
+
puts "Error when calling TrackIdentifyApi->track_post_with_http_info: #{e}"
|
246
|
+
end
|
247
|
+
```
|
248
|
+
|
249
|
+
### Parameters
|
250
|
+
|
251
|
+
| Name | Type | Description | Notes |
|
252
|
+
| ---- | ---- | ----------- | ----- |
|
253
|
+
| **data** | **String** | | [default to '{\"token\": \"PUBLIC_KEY\", \"event\": \"Ordered Product\", \"customer_properties\": {\"$email\": \"abraham.lincoln@klaviyo.com\"}, \"properties\": {\"item_name\": \"Boots\",\"$value\": 100}}'] |
|
254
|
+
|
255
|
+
### Return type
|
256
|
+
|
257
|
+
**String**
|
258
|
+
|
259
|
+
### Authorization
|
260
|
+
|
261
|
+
No authorization required
|
262
|
+
|
263
|
+
### HTTP request headers
|
264
|
+
|
265
|
+
- **Content-Type**: application/x-www-form-urlencoded
|
266
|
+
- **Accept**: text/html
|
267
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Klaviyo::TrackPayload
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **token** | **String** | | |
|
8
|
+
| **customer_properties** | [**TrackPayloadCustomerProperties**](TrackPayloadCustomerProperties.md) | | |
|
9
|
+
| **properties** | [**TrackPayloadProperties**](TrackPayloadProperties.md) | | |
|
10
|
+
| **time** | [**OneOfstringinteger**](OneOfstringinteger.md) | | [optional] |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'klaviyo_sdk'
|
16
|
+
|
17
|
+
instance = Klaviyo::TrackPayload.new(
|
18
|
+
token: null,
|
19
|
+
customer_properties: null,
|
20
|
+
properties: null,
|
21
|
+
time: null
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Klaviyo::TrackPayloadCustomerProperties
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **_email** | **String** | | [optional] |
|
8
|
+
| **_phone_number** | **String** | | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'klaviyo_sdk'
|
14
|
+
|
15
|
+
instance = Klaviyo::TrackPayloadCustomerProperties.new(
|
16
|
+
_email: null,
|
17
|
+
_phone_number: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Klaviyo::TrackPayloadProperties
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **event_id** | **String** | | [optional] |
|
8
|
+
| **value** | **String** | | [optional] |
|
9
|
+
| **your_custom_field** | [**OneOfstringintegernumberbooleanarray**](OneOfstringintegernumberbooleanarray.md) | | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'klaviyo_sdk'
|
15
|
+
|
16
|
+
instance = Klaviyo::TrackPayloadProperties.new(
|
17
|
+
event_id: null,
|
18
|
+
value: null,
|
19
|
+
your_custom_field: null
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="GIT_USER_ID"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=$(git remote)
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
Binary file
|
data/klaviyo_sdk.gemspec
CHANGED
@@ -17,7 +17,7 @@ require "klaviyo_sdk/version"
|
|
17
17
|
|
18
18
|
Gem::Specification.new do |s|
|
19
19
|
s.name = "klaviyo_sdk"
|
20
|
-
s.version = "1.0.
|
20
|
+
s.version = "1.0.3.20220329"
|
21
21
|
s.authors = ['Klaviyo Team']
|
22
22
|
s.email = ['libraries@klaviyo.com']
|
23
23
|
s.summary = 'You heard us, a Ruby wrapper for the Klaviyo API'
|
@@ -32,4 +32,9 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
33
33
|
s.executables = []
|
34
34
|
s.require_paths = ["lib"]
|
35
|
+
|
36
|
+
s.metadata = {
|
37
|
+
"changelog_uri" => "https://github.com/klaviyo/klaviyo-ruby-sdk/blob/main/CHANGELOG.md",
|
38
|
+
"documentation_uri" => "https://github.com/klaviyo/klaviyo-ruby-sdk/blob/main/README.md",
|
39
|
+
}
|
35
40
|
end
|
@@ -17,7 +17,7 @@ require 'tempfile'
|
|
17
17
|
require 'time'
|
18
18
|
require 'typhoeus'
|
19
19
|
|
20
|
-
module
|
20
|
+
module Klaviyo
|
21
21
|
class ApiClient
|
22
22
|
# The Configuration object holding settings to be used in the API client.
|
23
23
|
attr_accessor :config
|
@@ -31,7 +31,7 @@ module Client
|
|
31
31
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
32
32
|
def initialize(config = Configuration.default)
|
33
33
|
@config = config
|
34
|
-
@user_agent = "klaviyo-ruby/1.0.
|
34
|
+
@user_agent = "klaviyo-ruby/1.0.3.20220329"
|
35
35
|
@default_headers = {
|
36
36
|
'Content-Type' => 'application/json',
|
37
37
|
'User-Agent' => @user_agent
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module Klaviyo
|
17
17
|
class Campaign
|
18
18
|
attr_accessor :object
|
19
19
|
|
@@ -86,13 +86,13 @@ module Client
|
|
86
86
|
# @param [Hash] attributes Model attributes in the form of hash
|
87
87
|
def initialize(attributes = {})
|
88
88
|
if (!attributes.is_a?(Hash))
|
89
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
89
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::Campaign` initialize method"
|
90
90
|
end
|
91
91
|
|
92
92
|
# check to see if the attribute exists and convert string to symbol for hash key
|
93
93
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
94
94
|
if (!self.class.attribute_map.key?(k.to_sym))
|
95
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
95
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::Campaign`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
96
96
|
end
|
97
97
|
h[k.to_sym] = v
|
98
98
|
}
|
@@ -254,7 +254,7 @@ module Client
|
|
254
254
|
end
|
255
255
|
else # model
|
256
256
|
# models (e.g. Pet) or oneOf
|
257
|
-
klass =
|
257
|
+
klass = Klaviyo.const_get(type)
|
258
258
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
259
259
|
end
|
260
260
|
end
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module Klaviyo
|
17
17
|
class CheckMembershipRequest
|
18
18
|
# List of email addresses
|
19
19
|
attr_accessor :emails
|
@@ -56,13 +56,13 @@ module Client
|
|
56
56
|
# @param [Hash] attributes Model attributes in the form of hash
|
57
57
|
def initialize(attributes = {})
|
58
58
|
if (!attributes.is_a?(Hash))
|
59
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::CheckMembershipRequest` initialize method"
|
60
60
|
end
|
61
61
|
|
62
62
|
# check to see if the attribute exists and convert string to symbol for hash key
|
63
63
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
64
64
|
if (!self.class.attribute_map.key?(k.to_sym))
|
65
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::CheckMembershipRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
66
66
|
end
|
67
67
|
h[k.to_sym] = v
|
68
68
|
}
|
@@ -188,7 +188,7 @@ module Client
|
|
188
188
|
end
|
189
189
|
else # model
|
190
190
|
# models (e.g. Pet) or oneOf
|
191
|
-
klass =
|
191
|
+
klass = Klaviyo.const_get(type)
|
192
192
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
193
193
|
end
|
194
194
|
end
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module Klaviyo
|
17
17
|
class DeleteEmail
|
18
18
|
attr_accessor :email
|
19
19
|
|
@@ -46,13 +46,13 @@ module Client
|
|
46
46
|
# @param [Hash] attributes Model attributes in the form of hash
|
47
47
|
def initialize(attributes = {})
|
48
48
|
if (!attributes.is_a?(Hash))
|
49
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::DeleteEmail` initialize method"
|
50
50
|
end
|
51
51
|
|
52
52
|
# check to see if the attribute exists and convert string to symbol for hash key
|
53
53
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
54
|
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::DeleteEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
56
|
end
|
57
57
|
h[k.to_sym] = v
|
58
58
|
}
|
@@ -162,7 +162,7 @@ module Client
|
|
162
162
|
end
|
163
163
|
else # model
|
164
164
|
# models (e.g. Pet) or oneOf
|
165
|
-
klass =
|
165
|
+
klass = Klaviyo.const_get(type)
|
166
166
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
167
167
|
end
|
168
168
|
end
|
@@ -13,7 +13,7 @@ OpenAPI Generator version: 5.4.0
|
|
13
13
|
require 'date'
|
14
14
|
require 'time'
|
15
15
|
|
16
|
-
module
|
16
|
+
module Klaviyo
|
17
17
|
class DeletePerson
|
18
18
|
attr_accessor :person_id
|
19
19
|
|
@@ -46,13 +46,13 @@ module Client
|
|
46
46
|
# @param [Hash] attributes Model attributes in the form of hash
|
47
47
|
def initialize(attributes = {})
|
48
48
|
if (!attributes.is_a?(Hash))
|
49
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Klaviyo::DeletePerson` initialize method"
|
50
50
|
end
|
51
51
|
|
52
52
|
# check to see if the attribute exists and convert string to symbol for hash key
|
53
53
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
54
|
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Klaviyo::DeletePerson`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
56
|
end
|
57
57
|
h[k.to_sym] = v
|
58
58
|
}
|
@@ -162,7 +162,7 @@ module Client
|
|
162
162
|
end
|
163
163
|
else # model
|
164
164
|
# models (e.g. Pet) or oneOf
|
165
|
-
klass =
|
165
|
+
klass = Klaviyo.const_get(type)
|
166
166
|
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
167
167
|
end
|
168
168
|
end
|