klaviyo_sdk 1.0.0.20220329 → 1.0.1.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/Gemfile +10 -0
- data/README.md +3 -3
- 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.0.20220329.gem +0 -0
- data/klaviyo_sdk.gemspec +6 -1
- data/lib/klaviyo_sdk/api_client.rb +1 -1
- 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 +79 -2
@@ -0,0 +1,267 @@
|
|
1
|
+
# Client::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 = Client::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 Client::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 Client::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 = Client::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 Client::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 Client::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 = Client::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 Client::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 Client::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 = Client::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 Client::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 Client::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
|
+
# Client::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 = Client::TrackPayload.new(
|
18
|
+
token: null,
|
19
|
+
customer_properties: null,
|
20
|
+
properties: null,
|
21
|
+
time: null
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Client::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 = Client::TrackPayloadCustomerProperties.new(
|
16
|
+
_email: null,
|
17
|
+
_phone_number: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Client::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 = Client::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.1.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
|
@@ -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.1.20220329"
|
35
35
|
@default_headers = {
|
36
36
|
'Content-Type' => 'application/json',
|
37
37
|
'User-Agent' => @user_agent
|
@@ -0,0 +1,165 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Client::CampaignsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'CampaignsApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Client::CampaignsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of CampaignsApi' do
|
30
|
+
it 'should create an instance of CampaignsApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Client::CampaignsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for cancel_campaign
|
36
|
+
# Cancel a Campaign
|
37
|
+
# Cancels a campaign send. Marks a campaign as cancelled regardless of it's current status.
|
38
|
+
# @param campaign_id
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [Campaign]
|
41
|
+
describe 'cancel_campaign test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# unit tests for clone_campaign
|
48
|
+
# Clone a Campaign
|
49
|
+
# Creates a copy of a campaign. The new campaign starts as a draft.
|
50
|
+
# @param campaign_id
|
51
|
+
# @param name The name for the new campaign. All other properties of the campaign will remain the same. Note, the template for the new campaign will be cloned from the existing template so changes to the existing campaign's content will not alter the content of the new campaign.
|
52
|
+
# @param list_id The list you will send the campaign to.
|
53
|
+
# @param [Hash] opts the optional parameters
|
54
|
+
# @return [Campaign]
|
55
|
+
describe 'clone_campaign test' do
|
56
|
+
it 'should work' do
|
57
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# unit tests for create_campaign
|
62
|
+
# Create New Campaign
|
63
|
+
# Creates a new campaign. The created campaign is a draft and is not automatically sent.
|
64
|
+
# @param list_id The list you will send the campaign to.
|
65
|
+
# @param template_id The template that will define the content of the page. Note: the Email Template is copied when creating this campaign, so future changes to that Email Template will not alter the content of this campaign.
|
66
|
+
# @param from_email The email address your email will be sent from and will be used in the `reply-to` header.
|
67
|
+
# @param from_name The name or label associated with the email address you're sending from.
|
68
|
+
# @param subject The email subject of the campaign
|
69
|
+
# @param [Hash] opts the optional parameters
|
70
|
+
# @option opts [String] :name If not specified, this will default to the subject of the campaign.
|
71
|
+
# @option opts [Boolean] :use_smart_sending If set, limits the number of emails sent to an individual within a short period. Valid values are `true` and `false`. If not specified, defaults to `true`.
|
72
|
+
# @option opts [Boolean] :add_google_analytics If specified, adds Google Analytics tracking tags to links. Valid values are `true` and `false`. If not specified, defaults to `false`.
|
73
|
+
# @return [Campaign]
|
74
|
+
describe 'create_campaign test' do
|
75
|
+
it 'should work' do
|
76
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# unit tests for get_campaign_info
|
81
|
+
# Get Campaign Info
|
82
|
+
# Returns summary information for the campaign specified.
|
83
|
+
# @param campaign_id
|
84
|
+
# @param [Hash] opts the optional parameters
|
85
|
+
# @return [Campaign]
|
86
|
+
describe 'get_campaign_info test' do
|
87
|
+
it 'should work' do
|
88
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# unit tests for get_campaign_recipients
|
93
|
+
# Get Campaign Recipients
|
94
|
+
# Returns summary information about email recipients for the campaign specified that includes each recipients email, customer ID, and status.
|
95
|
+
# @param campaign_id
|
96
|
+
# @param [Hash] opts the optional parameters
|
97
|
+
# @option opts [Integer] :count For pagination, the number of results to return. Max = 25,000
|
98
|
+
# @option opts [String] :sort Sort order to apply to results, either ascending or descending. Valid values are `asc` or `desc`. Defaults to `asc`.
|
99
|
+
# @option opts [String] :offset For pagination, if a response to this endpoint includes a `next_offset`, use that value to get the next page of recipients.
|
100
|
+
# @return [Hash<String, Object>]
|
101
|
+
describe 'get_campaign_recipients test' do
|
102
|
+
it 'should work' do
|
103
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
# unit tests for get_campaigns
|
108
|
+
# Get Campaigns
|
109
|
+
# Returns a list of all the campaigns you've created. The campaigns are returned in reverse sorted order by the time they were created.
|
110
|
+
# @param [Hash] opts the optional parameters
|
111
|
+
# @option opts [Integer] :page For pagination, which page of results to return. Default = 0
|
112
|
+
# @option opts [Integer] :count For pagination, the number of results to return. Max = 100
|
113
|
+
# @return [Hash<String, Object>]
|
114
|
+
describe 'get_campaigns test' do
|
115
|
+
it 'should work' do
|
116
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
# unit tests for schedule_campaign
|
121
|
+
# Schedule a Campaign
|
122
|
+
# Schedules a campaign for a time in the future
|
123
|
+
# @param campaign_id
|
124
|
+
# @param send_time A timestamp of the format `%Y-%m-%d %H:%M:%S` in the UTC timezone. Ex: `2022-01-13 00:00:00`
|
125
|
+
# @param [Hash] opts the optional parameters
|
126
|
+
# @return [Hash<String, Object>]
|
127
|
+
describe 'schedule_campaign test' do
|
128
|
+
it 'should work' do
|
129
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
# unit tests for send_campaign
|
134
|
+
# Send a Campaign Immediately
|
135
|
+
# Queues a campaign for immediate delivery
|
136
|
+
# @param campaign_id
|
137
|
+
# @param [Hash] opts the optional parameters
|
138
|
+
# @return [Hash<String, Object>]
|
139
|
+
describe 'send_campaign test' do
|
140
|
+
it 'should work' do
|
141
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# unit tests for update_campaign
|
146
|
+
# Update Campaign
|
147
|
+
# Updates details of a campaign. You can update a campaign's name, subject, from email address, from name, template or list.
|
148
|
+
# @param campaign_id
|
149
|
+
# @param [Hash] opts the optional parameters
|
150
|
+
# @option opts [String] :list_id The list you will send the campaign to.
|
151
|
+
# @option opts [String] :template_id The ID of the Email Template object that will be the content of this campaign. Note the Email Template is copied when creating this campaign, so future changes to that Email Template will not alter the content of this campaign.
|
152
|
+
# @option opts [String] :from_email The email address your email will be sent from and will be used in the reply-to header.
|
153
|
+
# @option opts [String] :from_name The name or label associated with the email address you're sending from.
|
154
|
+
# @option opts [String] :subject The email subject of the campaign
|
155
|
+
# @option opts [String] :name A name for this campaign. If not specified, this will default to the subject of the campaign.
|
156
|
+
# @option opts [Boolean] :use_smart_sending If set, limits the number of emails sent to an individual within a short period. Campaigns initially default to `true`.
|
157
|
+
# @option opts [Boolean] :add_google_analytics If specified, adds Google Analytics tracking tags to links. Campaigns initially default to `false`.
|
158
|
+
# @return [Campaign]
|
159
|
+
describe 'update_campaign test' do
|
160
|
+
it 'should work' do
|
161
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
end
|
@@ -0,0 +1,47 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Client::DataPrivacyApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'DataPrivacyApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Client::DataPrivacyApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of DataPrivacyApi' do
|
30
|
+
it 'should create an instance of DataPrivacyApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Client::DataPrivacyApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for request_deletion
|
36
|
+
# Request a Deletion
|
37
|
+
# Request a data privacy-compliant deletion for the person record corresponding to an email address, phone number, or person identifier. **If multiple person records exist for the provided identifier, only one of them will be deleted.** The arguments should be sent as content type application/json. Note that only **one** identifier (email, phone_number, or person_id) can be specified. In addition to your API key, you need to set exactly one of the following parameters: `email`, `phone_number`, `or person_id`, along with the associated `string` value. Examples: Email: `{\"email\":\"abraham.lincoln@klaviyo.com\"}` Phone Number: `{\"phone_number\":\"+13239169023\"}` Person ID: `{\"person_id\":\"PERSON_ID\"}`
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [String] :body
|
40
|
+
# @return [String]
|
41
|
+
describe 'request_deletion test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|