-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3852cf1
commit feee1ce
Showing
15 changed files
with
345 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
BluxClient/Classes/request/events/AddInstantImpression.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import Foundation | ||
|
||
public class AddInstantImpressionEvent: EventRequest { | ||
private static let DEFAULT_EVENT_TYPE = "instant_impression" | ||
|
||
init(builder: Builder) throws { | ||
super.init() | ||
try self.events.append( | ||
Event(eventType: builder.eventType) | ||
.setItemId(builder.itemId) | ||
.setPage(builder.page) | ||
.setSection(builder.section) | ||
.setPosition(builder.position) | ||
.setRecommendationId(builder.recommendationId ?? "") | ||
.setCustomEventProperties(builder.customEventProperties ?? [:]) | ||
) | ||
} | ||
|
||
public class Builder { | ||
fileprivate let eventType: String = DEFAULT_EVENT_TYPE | ||
fileprivate let itemId: String | ||
fileprivate let page: String | ||
fileprivate let section: String | ||
fileprivate let position: Double | ||
|
||
fileprivate var recommendationId: String? = nil | ||
fileprivate var customEventProperties: [String: String]? = nil | ||
|
||
public init(itemId: String, page: String, section: String, position: Double) { | ||
self.itemId = itemId | ||
self.page = page | ||
self.section = section | ||
self.position = position | ||
} | ||
|
||
public func recommendationId(_ recommendationId: String) -> Builder { | ||
self.recommendationId = recommendationId | ||
return self | ||
} | ||
|
||
public func customEventProperties(_ customEventProperties: [String: String]) -> Builder { | ||
self.customEventProperties = customEventProperties | ||
return self | ||
} | ||
|
||
public func build() throws -> AddInstantImpressionEvent { | ||
return try AddInstantImpressionEvent(builder: self) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Foundation | ||
|
||
public class AddPageVisitEvent: EventRequest { | ||
private static let DEFAULT_EVENT_TYPE: String = "page_visit" | ||
|
||
init(builder: Builder) throws { | ||
super.init() | ||
self.events.append( | ||
Event(eventType: builder.eventType) | ||
.setCustomEventProperties(builder.customEventProperties) | ||
) | ||
} | ||
|
||
public class Builder { | ||
fileprivate let eventType: String = DEFAULT_EVENT_TYPE | ||
|
||
fileprivate var customEventProperties: [String: String]? = nil | ||
|
||
public init() {} | ||
|
||
public func customEventProperties(_ customEventProperties: [String: String]) -> Builder { | ||
self.customEventProperties = customEventProperties | ||
return self | ||
} | ||
|
||
public func build() throws -> AddPageVisitEvent { | ||
return try AddPageVisitEvent(builder: self) | ||
} | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
BluxClient/Classes/request/events/AddPersistentImpression.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import Foundation | ||
|
||
public class AddPersistentImpressionEvent: EventRequest { | ||
private static let DEFAULT_EVENT_TYPE = "persistent_impression" | ||
|
||
init(builder: Builder) throws { | ||
super.init() | ||
try self.events.append( | ||
Event(eventType: builder.eventType) | ||
.setItemId(builder.itemId) | ||
.setPage(builder.page) | ||
.setSection(builder.section) | ||
.setPosition(builder.position) | ||
.setRecommendationId(builder.recommendationId ?? "") | ||
.setCustomEventProperties(builder.customEventProperties ?? [:]) | ||
) | ||
} | ||
|
||
public class Builder { | ||
fileprivate let eventType: String = DEFAULT_EVENT_TYPE | ||
fileprivate let itemId: String | ||
fileprivate let page: String | ||
fileprivate let section: String | ||
fileprivate let position: Double | ||
|
||
fileprivate var recommendationId: String? = nil | ||
fileprivate var customEventProperties: [String: String]? = nil | ||
|
||
public init(itemId: String, page: String, section: String, position: Double) { | ||
self.itemId = itemId | ||
self.page = page | ||
self.section = section | ||
self.position = position | ||
} | ||
|
||
public func recommendationId(_ recommendationId: String) -> Builder { | ||
self.recommendationId = recommendationId | ||
return self | ||
} | ||
|
||
public func customEventProperties(_ customEventProperties: [String: String]) -> Builder { | ||
self.customEventProperties = customEventProperties | ||
return self | ||
} | ||
|
||
public func build() throws -> AddPersistentImpressionEvent { | ||
return try AddPersistentImpressionEvent(builder: self) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.