Sources/OphanThrift/referrer.swift (40 lines of code) (raw):
/**
* Autogenerated by Thrift Compiler (0.21.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
import Foundation
import Thrift
public final class AppReferral {
/// Eg 'android-app://{package_id}[/{scheme}[/{host}[/{path}]]][#Intent;{...}]' on Android (the full raw Intent provided to the app)
public var raw: String
/// Eg 'com.google.android.gm' for the Android GMail app
public var appId: String?
public init(raw: String) {
self.raw = raw
}
public init(raw: String, appId: String?) {
self.raw = raw
self.appId = appId
}
}
/// Information about the referrer - previous page - that the reader navigated to
/// this one from.
public final class Referrer {
/// Web: The "raw" value in here is the value of
/// document.referrer as reported by the browser
/// Native app: If this is populated, we will use it.
/// If it is not populated, it will be synthesised using
/// the nativeAppSource field.
public var url: Url?
/// the component that was clicked on for this referral,
/// if the previous page was served by the guardian
public var component: String?
/// the platform of the referrer,
/// if the previous page was served by the guardian
public var platform: Platform?
/// the viewId of the referrer,
/// if the previous page was served by the guardian
public var viewId: String?
/// if this was from a guardian email, what email it was
public var email: String?
/// If this referral was from a native app, the source of the referral
public var nativeAppSource: Source?
/// If this referral was from google, and we have additional data on the query string,
/// the values we got.
public var google: GoogleReferral?
/// The link name associated with the element clicked.
public var linkName: LinkName?
public var tagIdFollowed: String?
public var appReferral: AppReferral?
/// The Guardian Content API (CAPI) Id of the referring content. Uniquely identifies Content, even if its URL is
/// updated. Changing a content's url is generally avoided, but may be done for SEO reasons (eg Coronavirus explainer).
/// See also 'Evolving URLs': https://docs.google.com/document/d/1s6xsGHcQOgdPBTbGYwqTXuCz90e3lHKOnkBFW6yCvqY/edit#
public var capiId: String?
public init() { }
public init(url: Url?, component: String?, linkName: LinkName?, platform: Platform?, viewId: String?, email: String?, nativeAppSource: Source?, google: GoogleReferral?, tagIdFollowed: String?, appReferral: AppReferral?, capiId: String?) {
self.url = url
self.component = component
self.linkName = linkName
self.platform = platform
self.viewId = viewId
self.email = email
self.nativeAppSource = nativeAppSource
self.google = google
self.tagIdFollowed = tagIdFollowed
self.appReferral = appReferral
self.capiId = capiId
}
}