Sources/OphanThrift/url.swift (24 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
/// Represents a url either of a page served or a referrer
public final class Url {
/// The full raw URL as provided to ophan, potentially including
/// query string and fragment identifier
/// Be careful about using the value of this field: almost certainly
/// you want to use the combination of domain and path instead, which are cleared of
/// non-significant variation.
public var raw: String
/// the host of this url with no parsing or normalisation performed.
/// Be careful about using the value of this field: almost certainly
/// you want to use the combination of domain and path instead, which are cleared of
/// non-significant variation.
public var host: String
/// The path served on the given host, without query strings or fragment identifiers.
/// For guardian urls, processing is performed on the path -
/// especially for the native mobile apps - to try to make the url
/// match up with those on www.theguardian.com
/// Path will always start with a /.
public var path: String
/// Indicates sites that we really care about, factoring out the variation
/// on domain that they sometimes contain.
/// Note that were this url represents a page on a site that we don't consider significant,
/// this value will be unpopulated. You should probably use domain to aggregate in that case.
public var site: SignificantSite?
/// the domain of this url.
/// This is the host stripped down to one level below the top level domain.
/// e.g.
/// www.theguardian.com => theguardian.com
/// news.google.co.uk => google.co.uk
/// membership.theguardian.com => theguardian.com
public var domain: String
/// Indicates whether this url was synthesised in some way by ophan
public var synthesised: Bool?
public init(raw: String, host: String, domain: String, path: String) {
self.raw = raw
self.host = host
self.domain = domain
self.path = path
}
public init(raw: String, host: String, domain: String, path: String, site: SignificantSite?, synthesised: Bool?) {
self.raw = raw
self.host = host
self.domain = domain
self.path = path
self.site = site
self.synthesised = synthesised
}
}