klaviyo_sdk 1.0.1.20220329 → 1.0.4.20220329

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +121 -99
  4. data/klaviyo_sdk.gemspec +1 -1
  5. data/lib/klaviyo_sdk/api/campaigns_api.rb +1 -1
  6. data/lib/klaviyo_sdk/api/data_privacy_api.rb +3 -3
  7. data/lib/klaviyo_sdk/api/lists_segments_api.rb +1 -1
  8. data/lib/klaviyo_sdk/api/metrics_api.rb +1 -1
  9. data/lib/klaviyo_sdk/api/profiles_api.rb +67 -1
  10. data/lib/klaviyo_sdk/api/templates_api.rb +1 -1
  11. data/lib/klaviyo_sdk/api/track_identify_api.rb +1 -1
  12. data/lib/klaviyo_sdk/api_client.rb +2 -2
  13. data/lib/klaviyo_sdk/api_error.rb +1 -1
  14. data/lib/klaviyo_sdk/configuration.rb +1 -1
  15. data/lib/klaviyo_sdk/models/campaign.rb +202 -22
  16. data/lib/klaviyo_sdk/models/campaign_lists.rb +318 -0
  17. data/lib/klaviyo_sdk/models/campaigns.rb +487 -0
  18. data/lib/klaviyo_sdk/models/check_membership_request.rb +4 -4
  19. data/lib/klaviyo_sdk/models/delete_email.rb +4 -4
  20. data/lib/klaviyo_sdk/models/delete_person.rb +4 -4
  21. data/lib/klaviyo_sdk/models/delete_phone.rb +4 -4
  22. data/lib/klaviyo_sdk/models/deprecated_get_list_response.rb +4 -4
  23. data/lib/klaviyo_sdk/models/deprecated_get_list_response_data.rb +4 -4
  24. data/lib/klaviyo_sdk/models/global_exclusion_response_data.rb +4 -4
  25. data/lib/klaviyo_sdk/models/identify_payload.rb +4 -4
  26. data/lib/klaviyo_sdk/models/identify_payload_properties.rb +4 -4
  27. data/lib/klaviyo_sdk/models/inline_object.rb +9 -4
  28. data/lib/klaviyo_sdk/models/inline_object3.rb +4 -4
  29. data/lib/klaviyo_sdk/models/inline_object4.rb +4 -4
  30. data/lib/klaviyo_sdk/models/inline_object5.rb +4 -5
  31. data/lib/klaviyo_sdk/models/inline_response200.rb +218 -0
  32. data/lib/klaviyo_sdk/models/metric.rb +4 -4
  33. data/lib/klaviyo_sdk/models/metric_export.rb +4 -4
  34. data/lib/klaviyo_sdk/models/metric_timeline.rb +4 -4
  35. data/lib/klaviyo_sdk/models/metric_timeline_data.rb +4 -4
  36. data/lib/klaviyo_sdk/models/person.rb +4 -4
  37. data/lib/klaviyo_sdk/models/person.rb.bak +4 -4
  38. data/lib/klaviyo_sdk/models/privacy_email.rb +4 -4
  39. data/lib/klaviyo_sdk/models/privacy_id.rb +4 -4
  40. data/lib/klaviyo_sdk/models/privacy_phone.rb +4 -4
  41. data/lib/klaviyo_sdk/models/rendered_template.rb +4 -4
  42. data/lib/klaviyo_sdk/models/template.rb +4 -4
  43. data/lib/klaviyo_sdk/models/track_payload.rb +4 -4
  44. data/lib/klaviyo_sdk/models/track_payload_customer_properties.rb +4 -4
  45. data/lib/klaviyo_sdk/models/track_payload_properties.rb +4 -4
  46. data/lib/klaviyo_sdk/version.rb +1 -1
  47. data/lib/klaviyo_sdk.rb +10 -7
  48. metadata +6 -76
  49. data/docs/Campaign.md +0 -38
  50. data/docs/CampaignsApi.md +0 -707
  51. data/docs/CheckMembershipRequest.md +0 -22
  52. data/docs/DataPrivacyApi.md +0 -81
  53. data/docs/DeleteEmail.md +0 -18
  54. data/docs/DeletePerson.md +0 -18
  55. data/docs/DeletePhone.md +0 -18
  56. data/docs/DeprecatedGetListResponse.md +0 -30
  57. data/docs/DeprecatedGetListResponseData.md +0 -28
  58. data/docs/GlobalExclusionResponseData.md +0 -30
  59. data/docs/IdentifyPayload.md +0 -20
  60. data/docs/IdentifyPayloadProperties.md +0 -42
  61. data/docs/InlineObject.md +0 -18
  62. data/docs/InlineObject3.md +0 -18
  63. data/docs/InlineObject4.md +0 -18
  64. data/docs/InlineObject5.md +0 -22
  65. data/docs/ListsSegmentsApi.md +0 -1198
  66. data/docs/Metric.md +0 -28
  67. data/docs/MetricExport.md +0 -32
  68. data/docs/MetricTimeline.md +0 -24
  69. data/docs/MetricTimelineData.md +0 -34
  70. data/docs/MetricsApi.md +0 -329
  71. data/docs/Person.md +0 -56
  72. data/docs/PrivacyEmail.md +0 -18
  73. data/docs/PrivacyId.md +0 -18
  74. data/docs/PrivacyPhone.md +0 -18
  75. data/docs/ProfilesApi.md +0 -391
  76. data/docs/RenderedTemplate.md +0 -24
  77. data/docs/Template.md +0 -30
  78. data/docs/TemplatesApi.md +0 -541
  79. data/docs/TrackIdentifyApi.md +0 -267
  80. data/docs/TrackPayload.md +0 -24
  81. data/docs/TrackPayloadCustomerProperties.md +0 -20
  82. data/docs/TrackPayloadProperties.md +0 -22
  83. data/git_push.sh +0 -57
  84. data/klaviyo_sdk-1.0.0.20220329.gem +0 -0
  85. data/spec/api/campaigns_api_spec.rb +0 -165
  86. data/spec/api/data_privacy_api_spec.rb +0 -47
  87. data/spec/api/lists_segments_api_spec.rb +0 -239
  88. data/spec/api/metrics_api_spec.rb +0 -96
  89. data/spec/api/profiles_api_spec.rb +0 -103
  90. data/spec/api/templates_api_spec.rb +0 -130
  91. data/spec/api/track_identify_api_spec.rb +0 -83
  92. data/spec/api_client_spec.rb +0 -226
  93. data/spec/configuration_spec.rb +0 -42
  94. data/spec/models/campaign_spec.rb +0 -94
  95. data/spec/models/check_membership_request_spec.rb +0 -46
  96. data/spec/models/delete_email_spec.rb +0 -34
  97. data/spec/models/delete_person_spec.rb +0 -34
  98. data/spec/models/delete_phone_spec.rb +0 -34
  99. data/spec/models/deprecated_get_list_response_data_spec.rb +0 -64
  100. data/spec/models/deprecated_get_list_response_spec.rb +0 -70
  101. data/spec/models/global_exclusion_response_data_spec.rb +0 -70
  102. data/spec/models/identify_payload_properties_spec.rb +0 -106
  103. data/spec/models/identify_payload_spec.rb +0 -40
  104. data/spec/models/inline_object3_spec.rb +0 -34
  105. data/spec/models/inline_object4_spec.rb +0 -34
  106. data/spec/models/inline_object5_spec.rb +0 -46
  107. data/spec/models/inline_object_spec.rb +0 -34
  108. data/spec/models/metric_export_spec.rb +0 -76
  109. data/spec/models/metric_spec.rb +0 -64
  110. data/spec/models/metric_timeline_data_spec.rb +0 -82
  111. data/spec/models/metric_timeline_spec.rb +0 -52
  112. data/spec/models/person_spec.rb +0 -148
  113. data/spec/models/privacy_email_spec.rb +0 -34
  114. data/spec/models/privacy_id_spec.rb +0 -34
  115. data/spec/models/privacy_phone_spec.rb +0 -34
  116. data/spec/models/rendered_template_spec.rb +0 -52
  117. data/spec/models/template_spec.rb +0 -70
  118. data/spec/models/track_payload_customer_properties_spec.rb +0 -40
  119. data/spec/models/track_payload_properties_spec.rb +0 -46
  120. data/spec/models/track_payload_spec.rb +0 -52
  121. data/spec/spec_helper.rb +0 -111
@@ -1,239 +0,0 @@
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::ListsSegmentsApi
17
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
- # Please update as you see appropriate
19
- describe 'ListsSegmentsApi' do
20
- before do
21
- # run before each test
22
- @api_instance = Client::ListsSegmentsApi.new
23
- end
24
-
25
- after do
26
- # run after each test
27
- end
28
-
29
- describe 'test an instance of ListsSegmentsApi' do
30
- it 'should create an instance of ListsSegmentsApi' do
31
- expect(@api_instance).to be_instance_of(Client::ListsSegmentsApi)
32
- end
33
- end
34
-
35
- # unit tests for add_members
36
- # Add Members to a List
37
- # Adds profiles to a list. This endpoint is functionally equivalent to adding profiles to a list via a CSV upload and will immediately add profiles to the list. If you would like to subscribe profiles to a list and use the double opt-in settings for the list, please use the subscribe endpoint.
38
- # @param list_id
39
- # @param [Hash] opts the optional parameters
40
- # @option opts [InlineObject4] :inline_object4
41
- # @return [Array<Hash<String, Object>>]
42
- describe 'add_members test' do
43
- it 'should work' do
44
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
45
- end
46
- end
47
-
48
- # unit tests for create_list
49
- # Create List
50
- # Creates a new list.
51
- # @param list_name
52
- # @param [Hash] opts the optional parameters
53
- # @return [Hash<String, Object>]
54
- describe 'create_list test' do
55
- it 'should work' do
56
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
57
- end
58
- end
59
-
60
- # unit tests for delete_list
61
- # Delete List
62
- # Deletes a list from an account. This is a destructive operation and cannot be undone. It will also remove flow triggers associated with the list.
63
- # @param list_id
64
- # @param [Hash] opts the optional parameters
65
- # @return [nil]
66
- describe 'delete_list test' do
67
- it 'should work' do
68
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
69
- end
70
- end
71
-
72
- # unit tests for exclude_globally
73
- # Exclude Profile From All Email
74
- # Marks a person as excluded from all email. This works the same way as manually excluding someone via the excluded people page. Someone who is excluded will no longer receive any campaigns or flow emails.
75
- # @param email
76
- # @param [Hash] opts the optional parameters
77
- # @return [Hash<String, Object>]
78
- describe 'exclude_globally test' do
79
- it 'should work' do
80
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
81
- end
82
- end
83
-
84
- # unit tests for get_global_exclusions
85
- # Get Global Exclusions &amp; Unsubscribes
86
- # Returns global exclusions/unsubscribes. Global exclusions are distinct from list exclusions in that these email addresses will not receive any emails from any list. Typically, when someone unsubscribes from a campaign, they are only unsubscribed from that list and are not globally unsubscribed.
87
- # @param [Hash] opts the optional parameters
88
- # @option opts [String] :reason Filter results based on the reason for someone being excluded. The possible values are &#x60;unsubscribed&#x60;, &#x60;bounced&#x60;, &#x60;invalid_email&#x60;, &#x60;reported_spam&#x60; and &#x60;manually_excluded&#x60;. Only a single value may be specified at a time. Defaults to return all profiles regardless of reason.
89
- # @option opts [String] :sort Sort order to apply to results, either ascending or descending. Valid values are &#x60;asc&#x60; or &#x60;desc&#x60;. Defaults to &#x60;asc&#x60;.
90
- # @option opts [Integer] :count For pagination, the number of results to return. Default &#x3D; 500
91
- # @option opts [Integer] :page For pagination, which page of results to return. Default &#x3D; 0
92
- # @return [GlobalExclusionResponseData]
93
- describe 'get_global_exclusions test' do
94
- it 'should work' do
95
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
96
- end
97
- end
98
-
99
- # unit tests for get_list_exclusions
100
- # Get All Exclusions for a List
101
- # Gets all of the emails and phone numbers that have been excluded from a list along with the exclusion reasons and exclusion time. This endpoint uses batching to return the records, so for a large list multiple calls will need to be made to get all of the records.
102
- # @param list_id
103
- # @param [Hash] opts the optional parameters
104
- # @option opts [Integer] :marker A marker value returned by a previous GET call. Use this to grab the next batch of records.
105
- # @return [Hash<String, Object>]
106
- describe 'get_list_exclusions test' do
107
- it 'should work' do
108
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
109
- end
110
- end
111
-
112
- # unit tests for get_list_info
113
- # Get List Info
114
- # Returns information about a list.
115
- # @param list_id
116
- # @param [Hash] opts the optional parameters
117
- # @return [Hash<String, Object>]
118
- describe 'get_list_info test' do
119
- it 'should work' do
120
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
121
- end
122
- end
123
-
124
- # unit tests for get_list_members
125
- # Check if Profiles Are in a List
126
- # Checks if one or more emails, phone numbers, or push tokens are in a given list. No distinction is made between a person not being in a given list, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
127
- # @param list_id
128
- # @param [Hash] opts the optional parameters
129
- # @option opts [CheckMembershipRequest] :check_membership_request
130
- # @return [Array<Hash<String, Object>>]
131
- describe 'get_list_members test' do
132
- it 'should work' do
133
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
134
- end
135
- end
136
-
137
- # unit tests for get_list_subscriptions
138
- # Check if Profiles Are in a List and not Suppressed
139
- # Checks if one or more emails are in a given list and not suppressed. No distinction is made between a person not being in a given list, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
140
- # @param list_id
141
- # @param [Hash] opts the optional parameters
142
- # @option opts [CheckMembershipRequest] :check_membership_request
143
- # @return [Array<Hash<String, Object>>]
144
- describe 'get_list_subscriptions test' do
145
- it 'should work' do
146
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
147
- end
148
- end
149
-
150
- # unit tests for get_lists
151
- # Get Lists
152
- # Returns a listing of all of the lists in an account.
153
- # @param [Hash] opts the optional parameters
154
- # @return [Array<Hash<String, Object>>]
155
- describe 'get_lists test' do
156
- it 'should work' do
157
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
158
- end
159
- end
160
-
161
- # unit tests for get_members
162
- # Get List and Segment Members
163
- # Gets all of the emails, phone numbers, and push tokens for profiles in a given list or segment
164
- # @param list_or_segment_id
165
- # @param [Hash] opts the optional parameters
166
- # @option opts [Integer] :marker A marker value returned by a previous GET call. Use this to grab the next batch of records.
167
- # @return [Hash<String, Object>]
168
- describe 'get_members test' do
169
- it 'should work' do
170
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
171
- end
172
- end
173
-
174
- # unit tests for get_segment_members
175
- # Check if Profiles Are in a Segment
176
- # Checks if one or more emails, phone numbers, or push tokens are in a given segment. No distinction is made between a person not being in a given segment, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
177
- # @param segment_id
178
- # @param [Hash] opts the optional parameters
179
- # @option opts [CheckMembershipRequest] :check_membership_request
180
- # @return [Array<Hash<String, Object>>]
181
- describe 'get_segment_members test' do
182
- it 'should work' do
183
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
184
- end
185
- end
186
-
187
- # unit tests for remove_members
188
- # Remove Profiles From List
189
- # Removes profiles from a list.
190
- # @param list_id
191
- # @param [Hash] opts the optional parameters
192
- # @option opts [InlineObject5] :inline_object5
193
- # @return [nil]
194
- describe 'remove_members test' do
195
- it 'should work' do
196
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
197
- end
198
- end
199
-
200
- # unit tests for subscribe
201
- # Subscribe Profiles to List
202
- # Subscribes profiles to a list. Profiles will be single or double opted into the specified list in accordance with that list’s settings. **Note:** If you have double opt-in enabled (default behavior), users will not be added to list until they opt-in, and so API will respond with an empty list: &#x60;[]&#x60;
203
- # @param list_id
204
- # @param [Hash] opts the optional parameters
205
- # @option opts [InlineObject3] :inline_object3
206
- # @return [Array<Object>]
207
- describe 'subscribe test' do
208
- it 'should work' do
209
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
210
- end
211
- end
212
-
213
- # unit tests for unsubscribe
214
- # Unsubscribe Profiles From List
215
- # Unsubscribes and removes profiles from a list.
216
- # @param list_id
217
- # @param [Hash] opts the optional parameters
218
- # @option opts [Hash<String, Object>] :request_body Unsubscribe and remove profiles from a list.
219
- # @return [nil]
220
- describe 'unsubscribe test' do
221
- it 'should work' do
222
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
223
- end
224
- end
225
-
226
- # unit tests for update_list_name
227
- # Update List Name
228
- # Updates a list&#39;s name.
229
- # @param list_id
230
- # @param list_name
231
- # @param [Hash] opts the optional parameters
232
- # @return [nil]
233
- describe 'update_list_name test' do
234
- it 'should work' do
235
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
236
- end
237
- end
238
-
239
- end
@@ -1,96 +0,0 @@
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::MetricsApi
17
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
- # Please update as you see appropriate
19
- describe 'MetricsApi' do
20
- before do
21
- # run before each test
22
- @api_instance = Client::MetricsApi.new
23
- end
24
-
25
- after do
26
- # run after each test
27
- end
28
-
29
- describe 'test an instance of MetricsApi' do
30
- it 'should create an instance of MetricsApi' do
31
- expect(@api_instance).to be_instance_of(Client::MetricsApi)
32
- end
33
- end
34
-
35
- # unit tests for get_metrics
36
- # Get Metrics Info
37
- # Returns a list of all the metrics in your account.
38
- # @param [Hash] opts the optional parameters
39
- # @option opts [Integer] :page For pagination, which page of results to return. Default &#x3D; 0
40
- # @option opts [Integer] :count For pagination, the number of results to return. Default &#x3D; 50 ; Max &#x3D; 100
41
- # @return [Hash<String, Object>]
42
- describe 'get_metrics test' do
43
- it 'should work' do
44
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
45
- end
46
- end
47
-
48
- # unit tests for metric_export
49
- # Query Event Data
50
- # Exports event data from Klaviyo, optionally filtering and segmenting on available event properties. Note that the only comparison operator currently supported is &#x60;&#x3D;&#x60;. To ensure a correct response, enter parameters in the curl request as they are ordered below:
51
- # @param metric_id
52
- # @param [Hash] opts the optional parameters
53
- # @option opts [String] :start_date Beginning of timeframe to pull event data for. The default value is 1 month ago. Can also accept a 10-digit UNIX timestamp. When sending a &#x60;start_date&#x60;, you must also send an &#x60;end_date&#x60; Ex: &#x60;1610524800&#x60; OR &#x60;2021-01-13&#x60;
54
- # @option opts [String] :end_date End of timeframe to pull event data for. The default is the current day, or 1 month from start_date, whichever is sooner. Can also accept a 10-digit UNIX timestamp. When sending an &#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;
55
- # @option opts [String] :unit Granularity to bucket data points into - one of &#x60;day&#x60;, &#x60;week&#x60;, or &#x60;month&#x60;. Defaults to &#x60;day&#x60;.
56
- # @option opts [String] :measurement 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;
57
- # @option opts [String] :where Optional, JSON-encoded list. Conditions to use to filter the set of events. A max of 1 condition can be given. &#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;
58
- # @option opts [String] :by 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.
59
- # @option opts [Integer] :count Maximum number of segments to return. Default &#x3D; 25, **MAX &#x3D; 1000**
60
- # @return [MetricExport]
61
- describe 'metric_export test' do
62
- it 'should work' do
63
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
64
- end
65
- end
66
-
67
- # unit tests for metric_timeline
68
- # Get Events for a Specific Metric
69
- # Returns a batched timeline for one specific metric.
70
- # @param metric_id
71
- # @param [Hash] opts the optional parameters
72
- # @option opts [String] :since 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.
73
- # @option opts [Integer] :count Number of events to return in a batch. Max &#x3D; 100
74
- # @option opts [String] :sort 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.
75
- # @return [MetricTimeline]
76
- describe 'metric_timeline test' do
77
- it 'should work' do
78
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
79
- end
80
- end
81
-
82
- # unit tests for metrics_timeline
83
- # Get Events for All Metrics
84
- # Returns a batched timeline of all events in your account.
85
- # @param [Hash] opts the optional parameters
86
- # @option opts [String] :since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the next attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
87
- # @option opts [Integer] :count Number of events to return in a batch. Default &#x3D; 50, Max &#x3D; 100
88
- # @option opts [String] :sort 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.
89
- # @return [MetricTimeline]
90
- describe 'metrics_timeline test' do
91
- it 'should work' do
92
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
93
- end
94
- end
95
-
96
- end
@@ -1,103 +0,0 @@
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::ProfilesApi
17
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
- # Please update as you see appropriate
19
- describe 'ProfilesApi' do
20
- before do
21
- # run before each test
22
- @api_instance = Client::ProfilesApi.new
23
- end
24
-
25
- after do
26
- # run after each test
27
- end
28
-
29
- describe 'test an instance of ProfilesApi' do
30
- it 'should create an instance of ProfilesApi' do
31
- expect(@api_instance).to be_instance_of(Client::ProfilesApi)
32
- end
33
- end
34
-
35
- # unit tests for exchange
36
- # Exchange ID for Profile ID
37
- # Klaviyo&#39;s web tracking uses an encrypted identifier. However, there are many use cases that require developers to have access to a given profile&#39;s email or phone number. In such cases, developers can use this operation to exchange an encrypted identifier for a profile ID, which they can then use to retrieve the full profile data (by making a subsequent request to the &#x60;get-profiles&#x60; operation). The &#x60;exchange_id&#x60; takes the following form: &#x60;&lt;IDENTIFIER&gt;.&lt;COMPANY_ID&gt;&#x60; The &#x60;exchange_id&#x60; appears in the url as follows: &#x60;?_kx&#x3D;&lt;IDENTIFIER&gt;.&lt;COMPANY_ID&gt;&#x60;
38
- # @param [Hash] opts the optional parameters
39
- # @option opts [InlineObject] :inline_object
40
- # @return [Hash<String, Object>]
41
- describe 'exchange 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 get_profile
48
- # Get Profile
49
- # Retrieves all the data attributes for a person, based on the Klaviyo Person ID.
50
- # @param person_id
51
- # @param [Hash] opts the optional parameters
52
- # @return [Person]
53
- describe 'get_profile test' do
54
- it 'should work' do
55
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
- end
57
- end
58
-
59
- # unit tests for profile_metric_timeline
60
- # Get Profile&#39;s Events for a Specific Metric
61
- # Returns a person&#39;s batched timeline for one specific event type.
62
- # @param person_id
63
- # @param metric_id
64
- # @param [Hash] opts the optional parameters
65
- # @option opts [String] :since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the next attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
66
- # @option opts [Integer] :count Number of events to return in a batch.
67
- # @option opts [String] :sort 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;.
68
- # @return [MetricTimeline]
69
- describe 'profile_metric_timeline test' do
70
- it 'should work' do
71
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
72
- end
73
- end
74
-
75
- # unit tests for profile_metrics_timeline
76
- # Get Profile&#39;s Events for all Metrics
77
- # Returns a batched timeline of all events for a person.
78
- # @param person_id
79
- # @param [Hash] opts the optional parameters
80
- # @option opts [String] :since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the next attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
81
- # @option opts [Integer] :count Number of events to return in a batch. Default &#x3D; 50, Max &#x3D; 100
82
- # @option opts [String] :sort 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.
83
- # @return [MetricTimeline]
84
- describe 'profile_metrics_timeline test' do
85
- it 'should work' do
86
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
87
- end
88
- end
89
-
90
- # unit tests for update_profile
91
- # Update Profile
92
- # NOTE: If you are interested in creating or updating profiles in Klaviyo, you should be using the Identify API instead. The best use-case for this route is changing a profiles&#39;s email address or other primary identifier after a profile already exists in Klaviyo. Add or update one more more attributes for a Person, based on the Klaviyo Person ID. If a property already exists, it will be updated. If a property is not set for that record, it will be created. You can update any attribute, by sending one or more attributes along their new values, as query parameters. Recommended attributes for this endpoint: &#x60;$email&#x60;, &#x60;$phone_number&#x60;, &#x60;$id&#x60;
93
- # @param person_id
94
- # @param [Hash] opts the optional parameters
95
- # @option opts [Hash<String, Object>] :params
96
- # @return [Person]
97
- describe 'update_profile test' do
98
- it 'should work' do
99
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
100
- end
101
- end
102
-
103
- end
@@ -1,130 +0,0 @@
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::TemplatesApi
17
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
- # Please update as you see appropriate
19
- describe 'TemplatesApi' do
20
- before do
21
- # run before each test
22
- @api_instance = Client::TemplatesApi.new
23
- end
24
-
25
- after do
26
- # run after each test
27
- end
28
-
29
- describe 'test an instance of TemplatesApi' do
30
- it 'should create an instance of TemplatesApi' do
31
- expect(@api_instance).to be_instance_of(Client::TemplatesApi)
32
- end
33
- end
34
-
35
- # unit tests for clone_template
36
- # Clone Template
37
- # Creates a copy of a given template with a new name.
38
- # @param template_id
39
- # @param name The new name of the email template.
40
- # @param [Hash] opts the optional parameters
41
- # @return [Template]
42
- describe 'clone_template test' do
43
- it 'should work' do
44
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
45
- end
46
- end
47
-
48
- # unit tests for create_template
49
- # Create New Template
50
- # Creates a new email template.
51
- # @param name The name of the email template.
52
- # @param html
53
- # @param [Hash] opts the optional parameters
54
- # @return [Template]
55
- describe 'create_template 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 delete_template
62
- # Delete Template
63
- # Deletes a given template.
64
- # @param template_id
65
- # @param [Hash] opts the optional parameters
66
- # @return [Hash<String, Object>]
67
- describe 'delete_template test' do
68
- it 'should work' do
69
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
70
- end
71
- end
72
-
73
- # unit tests for get_templates
74
- # Get All Templates
75
- # Returns a list of all the email templates you&#39;ve created. The templates are returned in sorted order by &#x60;name&#x60;.
76
- # @param [Hash] opts the optional parameters
77
- # @option opts [Integer] :page For pagination, which page of results to return. Default &#x3D; 0
78
- # @option opts [Integer] :count For pagination, the number of results to return. Max &#x3D; 100
79
- # @return [Hash<String, Object>]
80
- describe 'get_templates test' do
81
- it 'should work' do
82
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
83
- end
84
- end
85
-
86
- # unit tests for render_template
87
- # Render Template
88
- # Renders the specified template with the provided data and return HTML and text versions of the email.
89
- # @param template_id
90
- # @param [Hash] opts the optional parameters
91
- # @option opts [String] :context This is the context your email template will be rendered with. Email templates are rendered with contexts in a similar manner to how Django templates are rendered. This means that nested template variables can be referenced via dot notation and template variables without corresponding context values are treated as falsy and output nothing.
92
- # @return [RenderedTemplate]
93
- describe 'render_template test' do
94
- it 'should work' do
95
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
96
- end
97
- end
98
-
99
- # unit tests for send_template
100
- # Render and Send Template
101
- # Renders the specified template with the provided data and send the contents in an email via the service specified. This API is intended to test templates only, and is rate limited to the following thresholds: 100/hour, 1,000/day.
102
- # @param template_id
103
- # @param from_email
104
- # @param from_name
105
- # @param subject
106
- # @param to **Mixed**. string, or JSON encoded array of objects with \\\&quot;email\\\&quot; and \\\&quot;name\\\&quot; keys. &#x60;abraham.lincoln@klaviyo.com&#x60; OR &#x60;[{\\\&quot;name\\\&quot;:\\\&quot;Abraham Lincoln\\\&quot;,\\\&quot;email\\\&quot;:\\\&quot;abraham.lincoln@klaviyo.com\\\&quot;}]&#x60;
107
- # @param [Hash] opts the optional parameters
108
- # @option opts [String] :context Optional, JSON object. This is the context your email template will be rendered with. Email templates are rendered with contexts in a similar manner to how Django templates are rendered. This means that nested template variables can be referenced via dot notation and template variables without corresponding context values are treated as falsy and output nothing. ex: &#x60;{ \\\&quot;name\\\&quot; : \\\&quot;George Washington\\\&quot;, \\\&quot;state\\\&quot; : \\\&quot;VA\\\&quot; }&#x60;
109
- # @return [RenderedTemplate]
110
- describe 'send_template test' do
111
- it 'should work' do
112
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
113
- end
114
- end
115
-
116
- # unit tests for update_template
117
- # Update Template
118
- # Updates the name and/or HTML content of a template. Only updates imported HTML templates; does not currently update drag &amp; drop templates.
119
- # @param template_id
120
- # @param [Hash] opts the optional parameters
121
- # @option opts [String] :name The new name of the email template.
122
- # @option opts [String] :html The new HTML content for this template.
123
- # @return [Template]
124
- describe 'update_template test' do
125
- it 'should work' do
126
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
127
- end
128
- end
129
-
130
- end
@@ -1,83 +0,0 @@
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::TrackIdentifyApi
17
- # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
- # Please update as you see appropriate
19
- describe 'TrackIdentifyApi' do
20
- before do
21
- # run before each test
22
- @api_instance = Client::TrackIdentifyApi.new
23
- end
24
-
25
- after do
26
- # run after each test
27
- end
28
-
29
- describe 'test an instance of TrackIdentifyApi' do
30
- it 'should create an instance of TrackIdentifyApi' do
31
- expect(@api_instance).to be_instance_of(Client::TrackIdentifyApi)
32
- end
33
- end
34
-
35
- # unit tests for identify_get
36
- # Identify Profile (Legacy)
37
- # 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:** &#x60;&#x60;&#x60; { \&quot;token\&quot;: \&quot;PUBLIC_KEY\&quot;, \&quot;properties\&quot;: { \&quot;$email\&quot;: \&quot;abraham.lincoln@klaviyo.com\&quot;, \&quot;$first_name\&quot;: \&quot;Abraham\&quot;, \&quot;$last_name\&quot;: \&quot;Lincoln\&quot;, \&quot;$city\&quot;: \&quot;Springfield\&quot;, \&quot;$region\&quot;: \&quot;Illinois\&quot; } } &#x60;&#x60;&#x60; Gets encoded into the following string, which is passed into the &#x60;data&#x60; parameter: &#x60;eyJ0b2tlbiI6ICJQVUJMSUNfS0VZIiwicHJvcGVydGllcyI6IHsiJGVtYWlsIjogImFicmFoYW0ubGluY29sbkBrbGF2aXlvLmNvbSIsIiRmaXJzdF9uYW1lIjogIkFicmFoYW0iLCIkbGFzdF9uYW1lIjogIkxpbmNvbG4iLCIkY2l0eSI6ICJTcHJpbmdmaWVsZCIsIiRyZWdpb24iOiAiSWxsaW5vaXMifX0K&#x60;
38
- # @param data String representation of base64 encoded JSON object
39
- # @param [Hash] opts the optional parameters
40
- # @return [String]
41
- describe 'identify_get 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 identify_post
48
- # Identify Profile
49
- # 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 &#x60;$phone_number&#x60; 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&#39;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: \&quot;+13239169023\&quot;_ **$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: [&#39;sms&#39;, &#39;email&#39;, &#39;web&#39;, &#39;directmail&#39;, &#39;mobile&#39;]_ **EXAMPLE:** &#x60;&#x60;&#x60; { \&quot;token\&quot;: \&quot;PUBLIC_KEY\&quot;, \&quot;properties\&quot;: { \&quot;$email\&quot;: \&quot;abraham.lincoln@klaviyo.com\&quot;, \&quot;$first_name\&quot;: \&quot;Abraham\&quot;, \&quot;$last_name\&quot;: \&quot;Lincoln\&quot;, \&quot;$city\&quot;: \&quot;Springfield\&quot;, \&quot;$region\&quot;: \&quot;Illinois\&quot; } }
50
- # @param data
51
- # @param [Hash] opts the optional parameters
52
- # @return [String]
53
- describe 'identify_post test' do
54
- it 'should work' do
55
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
- end
57
- end
58
-
59
- # unit tests for track_get
60
- # Track Profile Activity (Legacy)
61
- # This endpoint is also used to track a profile&#39;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:** &#x60;&#x60;&#x60; { \&quot;token\&quot;: \&quot;PUBLIC_KEY\&quot;, \&quot;event\&quot;: \&quot;Ordered Product\&quot;, \&quot;customer_properties\&quot;: { \&quot;$email\&quot;: \&quot;abraham.lincoln@klaviyo.com\&quot; }, \&quot;properties\&quot;: { \&quot;item_name\&quot;: \&quot;Boots\&quot;, \&quot;$value\&quot;: 100 } } &#x60;&#x60;&#x60; Gets encoded into the following string, which is passed into the &#x60;data&#x60; parameter: &#x60;eyJ0b2tlbiI6ICJQVUJMSUNfS0VZIiwiZXZlbnQiOiAiT3JkZXJlZEl0ZW0iLCJjdXN0b21lcl9wcm9wZXJ0aWVzIjogeyIkZW1haWwiOiAiYWJyYWhhbS5saW5jb2xuQGtsYXZpeW8uY29tIn0sInByb3BlcnRpZXMiOiB7Iml0ZW1fbmFtZSI6ICJCb290cyIsIiR2YWx1ZSI6IDEwMH19&#x60;
62
- # @param data String representation of base64 encoded JSON object
63
- # @param [Hash] opts the optional parameters
64
- # @return [String]
65
- describe 'track_get test' do
66
- it 'should work' do
67
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
- end
69
- end
70
-
71
- # unit tests for track_post
72
- # Track Profile Activity
73
- # This endpoint is used to track a profile&#39;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 &#x60;$phone_number&#x60; 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&#39;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 \&quot;Ordered Product\&quot; 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&#39;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: \&quot;+13239169023\&quot;_ **$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: [&#39;sms&#39;, &#39;email&#39;, &#39;web&#39;, &#39;directmail&#39;, &#39;mobile&#39;]_ 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:** &#x60;&#x60;&#x60; { \&quot;token\&quot;: \&quot;PUBLIC_KEY\&quot;, \&quot;event\&quot;: \&quot;Ordered Product\&quot;, \&quot;customer_properties\&quot;: { \&quot;$email\&quot;: \&quot;abraham.lincoln@klaviyo.com\&quot; }, \&quot;properties\&quot;: { \&quot;item_name\&quot;: \&quot;Boots\&quot;, \&quot;$value\&quot;: 100 } }
74
- # @param data
75
- # @param [Hash] opts the optional parameters
76
- # @return [String]
77
- describe 'track_post test' do
78
- it 'should work' do
79
- # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
80
- end
81
- end
82
-
83
- end