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,22 @@
|
|
1
|
+
# Client::CheckMembershipRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **emails** | **Array<String>** | List of email addresses | [optional] |
|
8
|
+
| **phone_numbers** | **Array<String>** | List of phone numbers | [optional] |
|
9
|
+
| **push_tokens** | **Array<String>** | | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'klaviyo_sdk'
|
15
|
+
|
16
|
+
instance = Client::CheckMembershipRequest.new(
|
17
|
+
emails: ["george.washington@klaviyo.com","abraham.lincoln@klaviyo.com"],
|
18
|
+
phone_numbers: ["+13239169023","+12028837032"],
|
19
|
+
push_tokens: ["PUSH_TOKEN_1","PUSH_TOKEN_2"]
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# Client::DataPrivacyApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://a.klaviyo.com/api*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**request_deletion**](DataPrivacyApi.md#request_deletion) | **POST** /v2/data-privacy/deletion-request | Request a Deletion |
|
8
|
+
|
9
|
+
|
10
|
+
## request_deletion
|
11
|
+
|
12
|
+
> String request_deletion(opts)
|
13
|
+
|
14
|
+
Request a Deletion
|
15
|
+
|
16
|
+
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\"}`
|
17
|
+
|
18
|
+
### Examples
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
require 'time'
|
22
|
+
require 'klaviyo_sdk'
|
23
|
+
# setup authorization
|
24
|
+
Client.configure do |config|
|
25
|
+
# Configure API key authorization: ApiKeyAuth
|
26
|
+
config.api_key['ApiKeyAuth'] = 'YOUR API KEY'
|
27
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
28
|
+
# config.api_key_prefix['ApiKeyAuth'] = 'Bearer'
|
29
|
+
end
|
30
|
+
|
31
|
+
api_instance = Client::DataPrivacyApi.new
|
32
|
+
opts = {
|
33
|
+
body: '{"email":"abraham.lincoln@klaviyo.com"}' # String |
|
34
|
+
}
|
35
|
+
|
36
|
+
begin
|
37
|
+
# Request a Deletion
|
38
|
+
result = api_instance.request_deletion(opts)
|
39
|
+
p result
|
40
|
+
rescue Client::ApiError => e
|
41
|
+
puts "Error when calling DataPrivacyApi->request_deletion: #{e}"
|
42
|
+
end
|
43
|
+
```
|
44
|
+
|
45
|
+
#### Using the request_deletion_with_http_info variant
|
46
|
+
|
47
|
+
This returns an Array which contains the response data, status code and headers.
|
48
|
+
|
49
|
+
> <Array(String, Integer, Hash)> request_deletion_with_http_info(opts)
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
begin
|
53
|
+
# Request a Deletion
|
54
|
+
data, status_code, headers = api_instance.request_deletion_with_http_info(opts)
|
55
|
+
p status_code # => 2xx
|
56
|
+
p headers # => { ... }
|
57
|
+
p data # => String
|
58
|
+
rescue Client::ApiError => e
|
59
|
+
puts "Error when calling DataPrivacyApi->request_deletion_with_http_info: #{e}"
|
60
|
+
end
|
61
|
+
```
|
62
|
+
|
63
|
+
### Parameters
|
64
|
+
|
65
|
+
| Name | Type | Description | Notes |
|
66
|
+
| ---- | ---- | ----------- | ----- |
|
67
|
+
| **body** | **String** | | [optional] |
|
68
|
+
|
69
|
+
### Return type
|
70
|
+
|
71
|
+
**String**
|
72
|
+
|
73
|
+
### Authorization
|
74
|
+
|
75
|
+
[ApiKeyAuth](../README.md#ApiKeyAuth)
|
76
|
+
|
77
|
+
### HTTP request headers
|
78
|
+
|
79
|
+
- **Content-Type**: application/json
|
80
|
+
- **Accept**: application/json
|
81
|
+
|
data/docs/DeleteEmail.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Client::DeleteEmail
|
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 = Client::DeleteEmail.new(
|
15
|
+
email: example@klaviyo.com
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Client::DeletePerson
|
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 = Client::DeletePerson.new(
|
15
|
+
person_id: PERSON_ID
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
data/docs/DeletePhone.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Client::DeletePhone
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **phone_number** | **String** | Phone Number | [optional] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'klaviyo_sdk'
|
13
|
+
|
14
|
+
instance = Client::DeletePhone.new(
|
15
|
+
phone_number: +13239169023
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Client::DeprecatedGetListResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **object** | **String** | | [optional] |
|
8
|
+
| **start** | **Integer** | | [optional] |
|
9
|
+
| **_end** | **Integer** | | [optional] |
|
10
|
+
| **page** | **Integer** | | [optional] |
|
11
|
+
| **size** | **Integer** | | [optional] |
|
12
|
+
| **total** | **Integer** | | [optional] |
|
13
|
+
| **data** | [**Array<DeprecatedGetListResponseData>**](DeprecatedGetListResponseData.md) | | [optional] |
|
14
|
+
|
15
|
+
## Example
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require 'klaviyo_sdk'
|
19
|
+
|
20
|
+
instance = Client::DeprecatedGetListResponse.new(
|
21
|
+
object: null,
|
22
|
+
start: null,
|
23
|
+
_end: null,
|
24
|
+
page: null,
|
25
|
+
size: null,
|
26
|
+
total: null,
|
27
|
+
data: null
|
28
|
+
)
|
29
|
+
```
|
30
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Client::DeprecatedGetListResponseData
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **object** | **String** | | [optional] |
|
8
|
+
| **id** | **String** | | [optional] |
|
9
|
+
| **type** | **String** | | [optional] |
|
10
|
+
| **created** | **String** | | [optional] |
|
11
|
+
| **updated** | **String** | | [optional] |
|
12
|
+
| **person_count** | **Integer** | | [optional] |
|
13
|
+
|
14
|
+
## Example
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'klaviyo_sdk'
|
18
|
+
|
19
|
+
instance = Client::DeprecatedGetListResponseData.new(
|
20
|
+
object: null,
|
21
|
+
id: null,
|
22
|
+
type: null,
|
23
|
+
created: null,
|
24
|
+
updated: null,
|
25
|
+
person_count: null
|
26
|
+
)
|
27
|
+
```
|
28
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Client::GlobalExclusionResponseData
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **object** | **String** | | [optional] |
|
8
|
+
| **data** | **Array<Hash<String, Object>>** | | [optional] |
|
9
|
+
| **page** | **Integer** | | [optional] |
|
10
|
+
| **start** | **Integer** | | [optional] |
|
11
|
+
| **_end** | **Integer** | | [optional] |
|
12
|
+
| **total** | **Integer** | | [optional] |
|
13
|
+
| **page_size** | **Integer** | | [optional] |
|
14
|
+
|
15
|
+
## Example
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require 'klaviyo_sdk'
|
19
|
+
|
20
|
+
instance = Client::GlobalExclusionResponseData.new(
|
21
|
+
object: $list,
|
22
|
+
data: null,
|
23
|
+
page: 0,
|
24
|
+
start: 0,
|
25
|
+
_end: 1,
|
26
|
+
total: 1,
|
27
|
+
page_size: 1
|
28
|
+
)
|
29
|
+
```
|
30
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Client::IdentifyPayload
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **token** | **String** | | |
|
8
|
+
| **properties** | [**IdentifyPayloadProperties**](IdentifyPayloadProperties.md) | | |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'klaviyo_sdk'
|
14
|
+
|
15
|
+
instance = Client::IdentifyPayload.new(
|
16
|
+
token: null,
|
17
|
+
properties: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# Client::IdentifyPayloadProperties
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **_email** | **String** | | [optional] |
|
8
|
+
| **_first_name** | **String** | | [optional] |
|
9
|
+
| **_last_name** | **String** | | [optional] |
|
10
|
+
| **_phone_number** | **String** | | [optional] |
|
11
|
+
| **_title** | **String** | | [optional] |
|
12
|
+
| **_organization** | **String** | | [optional] |
|
13
|
+
| **_city** | **String** | | [optional] |
|
14
|
+
| **_region** | **String** | | [optional] |
|
15
|
+
| **_country** | **String** | | [optional] |
|
16
|
+
| **_zip** | **String** | | [optional] |
|
17
|
+
| **image** | **String** | | [optional] |
|
18
|
+
| **consent** | **String** | | [optional] |
|
19
|
+
| **your_custom_field** | [**OneOfstringintegernumberbooleanarray**](OneOfstringintegernumberbooleanarray.md) | | [optional] |
|
20
|
+
|
21
|
+
## Example
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'klaviyo_sdk'
|
25
|
+
|
26
|
+
instance = Client::IdentifyPayloadProperties.new(
|
27
|
+
_email: null,
|
28
|
+
_first_name: null,
|
29
|
+
_last_name: null,
|
30
|
+
_phone_number: null,
|
31
|
+
_title: null,
|
32
|
+
_organization: null,
|
33
|
+
_city: null,
|
34
|
+
_region: null,
|
35
|
+
_country: null,
|
36
|
+
_zip: null,
|
37
|
+
image: null,
|
38
|
+
consent: null,
|
39
|
+
your_custom_field: null
|
40
|
+
)
|
41
|
+
```
|
42
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Client::InlineObject
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **exchange_id** | **String** | | [optional][default to 'EXCHANGE_ID'] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'klaviyo_sdk'
|
13
|
+
|
14
|
+
instance = Client::InlineObject.new(
|
15
|
+
exchange_id: EXCHANGE_ID
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Client::InlineObject3
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **profiles** | **Array<Hash<String, Object>>** | | |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'klaviyo_sdk'
|
13
|
+
|
14
|
+
instance = Client::InlineObject3.new(
|
15
|
+
profiles: [{"email":"george.washington@klaviyo.com"},{"phone_number":"+13239169023","sms_consent":true}]
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Client::InlineObject4
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **profiles** | **Array<Hash<String, Object>>** | | |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'klaviyo_sdk'
|
13
|
+
|
14
|
+
instance = Client::InlineObject4.new(
|
15
|
+
profiles: [{"email":"george.washington@klaviyo.com"},{"phone_number":"+13239169023"}]
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Client::InlineObject5
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **emails** | **Array<String>** | | [optional] |
|
8
|
+
| **phone_numbers** | **Array<String>** | | [optional] |
|
9
|
+
| **push_tokens** | **Array<String>** | | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'klaviyo_sdk'
|
15
|
+
|
16
|
+
instance = Client::InlineObject5.new(
|
17
|
+
emails: ["george.washington@klaviyo.com","abraham.lincoln@klaviyo.com"],
|
18
|
+
phone_numbers: ["+13239169023"],
|
19
|
+
push_tokens: ["PUSH_TOKEN"]
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|