@@ -95,12 +95,6 @@ class ProfilesList(BaseModel):
9595 data : Union [list [Profile ], Any ] = Field (default = None )
9696 links : Union [ProfilesListLinks | None , Any ] = Field (default = None )
9797
98- class ListLinks (BaseModel ):
99- """Related links"""
100- model_config = ConfigDict (extra = "allow" , populate_by_name = True )
101-
102- self : Union [str | None , Any ] = Field (default = None )
103-
10498class ListAttributes (BaseModel ):
10599 """List attributes"""
106100 model_config = ConfigDict (extra = "allow" , populate_by_name = True )
@@ -114,6 +108,12 @@ class ListAttributes(BaseModel):
114108 opt_in_process : Union [str | None , Any ] = Field (default = None , description = "Opt-in process type" )
115109 """Opt-in process type"""
116110
111+ class ListLinks (BaseModel ):
112+ """Related links"""
113+ model_config = ConfigDict (extra = "allow" , populate_by_name = True )
114+
115+ self : Union [str | None , Any ] = Field (default = None )
116+
117117class List (BaseModel ):
118118 """A Klaviyo list for organizing profiles"""
119119 model_config = ConfigDict (extra = "allow" , populate_by_name = True )
@@ -138,6 +138,12 @@ class ListsList(BaseModel):
138138 data : Union [list [List ], Any ] = Field (default = None )
139139 links : Union [ListsListLinks | None , Any ] = Field (default = None )
140140
141+ class CampaignLinks (BaseModel ):
142+ """Related links"""
143+ model_config = ConfigDict (extra = "allow" , populate_by_name = True )
144+
145+ self : Union [str | None , Any ] = Field (default = None )
146+
141147class CampaignAttributes (BaseModel ):
142148 """Campaign attributes"""
143149 model_config = ConfigDict (extra = "allow" , populate_by_name = True )
@@ -165,12 +171,6 @@ class CampaignAttributes(BaseModel):
165171 send_time : Union [str | None , Any ] = Field (default = None , description = "Actual send time" )
166172 """Actual send time"""
167173
168- class CampaignLinks (BaseModel ):
169- """Related links"""
170- model_config = ConfigDict (extra = "allow" , populate_by_name = True )
171-
172- self : Union [str | None , Any ] = Field (default = None )
173-
174174class Campaign (BaseModel ):
175175 """A Klaviyo campaign"""
176176 model_config = ConfigDict (extra = "allow" , populate_by_name = True )
@@ -195,18 +195,11 @@ class CampaignsList(BaseModel):
195195 data : Union [list [Campaign ], Any ] = Field (default = None )
196196 links : Union [CampaignsListLinks | None , Any ] = Field (default = None )
197197
198- class EventRelationshipsProfileData (BaseModel ):
199- """Nested schema for EventRelationshipsProfile.data"""
200- model_config = ConfigDict (extra = "allow" , populate_by_name = True )
201-
202- type : Union [str | None , Any ] = Field (default = None )
203- id : Union [str | None , Any ] = Field (default = None )
204-
205- class EventRelationshipsProfile (BaseModel ):
206- """Nested schema for EventRelationships.profile"""
198+ class EventLinks (BaseModel ):
199+ """Related links"""
207200 model_config = ConfigDict (extra = "allow" , populate_by_name = True )
208201
209- data : Union [EventRelationshipsProfileData | None , Any ] = Field (default = None )
202+ self : Union [str | None , Any ] = Field (default = None )
210203
211204class EventRelationshipsMetricData (BaseModel ):
212205 """Nested schema for EventRelationshipsMetric.data"""
@@ -221,6 +214,19 @@ class EventRelationshipsMetric(BaseModel):
221214
222215 data : Union [EventRelationshipsMetricData | None , Any ] = Field (default = None )
223216
217+ class EventRelationshipsProfileData (BaseModel ):
218+ """Nested schema for EventRelationshipsProfile.data"""
219+ model_config = ConfigDict (extra = "allow" , populate_by_name = True )
220+
221+ type : Union [str | None , Any ] = Field (default = None )
222+ id : Union [str | None , Any ] = Field (default = None )
223+
224+ class EventRelationshipsProfile (BaseModel ):
225+ """Nested schema for EventRelationships.profile"""
226+ model_config = ConfigDict (extra = "allow" , populate_by_name = True )
227+
228+ data : Union [EventRelationshipsProfileData | None , Any ] = Field (default = None )
229+
224230class EventRelationships (BaseModel ):
225231 """Related resources"""
226232 model_config = ConfigDict (extra = "allow" , populate_by_name = True )
@@ -241,12 +247,6 @@ class EventAttributes(BaseModel):
241247 event_properties : Union [dict [str , Any ] | None , Any ] = Field (default = None , description = "Custom event properties" )
242248 """Custom event properties"""
243249
244- class EventLinks (BaseModel ):
245- """Related links"""
246- model_config = ConfigDict (extra = "allow" , populate_by_name = True )
247-
248- self : Union [str | None , Any ] = Field (default = None )
249-
250250class Event (BaseModel ):
251251 """A Klaviyo event representing an action taken by a profile"""
252252 model_config = ConfigDict (extra = "allow" , populate_by_name = True )
@@ -370,6 +370,12 @@ class FlowsList(BaseModel):
370370 data : Union [list [Flow ], Any ] = Field (default = None )
371371 links : Union [FlowsListLinks | None , Any ] = Field (default = None )
372372
373+ class TemplateLinks (BaseModel ):
374+ """Related links"""
375+ model_config = ConfigDict (extra = "allow" , populate_by_name = True )
376+
377+ self : Union [str | None , Any ] = Field (default = None )
378+
373379class TemplateAttributes (BaseModel ):
374380 """Template attributes"""
375381 model_config = ConfigDict (extra = "allow" , populate_by_name = True )
@@ -387,12 +393,6 @@ class TemplateAttributes(BaseModel):
387393 updated : Union [str | None , Any ] = Field (default = None , description = "Last update timestamp" )
388394 """Last update timestamp"""
389395
390- class TemplateLinks (BaseModel ):
391- """Related links"""
392- model_config = ConfigDict (extra = "allow" , populate_by_name = True )
393-
394- self : Union [str | None , Any ] = Field (default = None )
395-
396396class Template (BaseModel ):
397397 """A Klaviyo email template"""
398398 model_config = ConfigDict (extra = "allow" , populate_by_name = True )
0 commit comments