ArxivRequestSpecification
public struct ArxivRequestSpecification : Codable
extension ArxivRequestSpecification: ArxivRequest
extension ArxivRequestSpecification: CustomStringConvertible
A full sppecification of an arXiv API request.
-
Returns a query used for the request or
nil
if the request consists ofidList
only.Declaration
Swift
public let query: ArxivQuery?
-
Returns an array od article ids. If the array is non-empty, qyery matching is limmited to specified articles.
Declaration
Swift
public private(set) var idList: [String] { get }
-
Returns zero-based index of the first article in the response. Set using
startIndex(_)
method. Default value is0
.The index can be used to implement paging. For example, if
itemsPerPage
is 20, the first page is withstartIndex == 0
, the second withstartIndex == 20
, the third withstartIndex == 60
etc.ArxivReponse
values can be used for getting various page indicies for given response.Declaration
Swift
public internal(set) var startIndex: Int { get }
-
Returns maximum number of articles to be returned from a single API call. Set using
itemsPerPage(_)
method. Default value is 50.Declaration
Swift
public internal(set) var itemsPerPage: Int { get }
-
Returns sorting criterion for returned articles. Set using
sorted(by:)
method. Default value is.lastUpdateDate
.Declaration
Swift
public internal(set) var sortingCriterion: SortingCriterion { get }
-
Returns sorting order for returned articles. Set using
sortingOrder(_)
method. Default value is.descending
.Declaration
Swift
public internal(set) var sortingOrder: SortingOrder { get }
-
Creates a request for retrieving the articles matching provided query and belonging to optionally provided ID list.
If a non-empty
idList
is provided, only the articles with specified IDs will be matched againt thequery
.To retrieve a specific version of an article, end the corresponding ID with
vN
suffix whereN
is the desired version number. If an identifier without the suffix is provided, the most recent version will be retrieved.ArxivEntry
type has properties for getting the version versioned IDs of the corresponing article.For detailed explanation of arXiv identifiers see arXiv help.
Declaration
Swift
public init(query: ArxivQuery, idList: [String] = [])
Parameters
query
A specification of search criteria for the request.
iDlist
Search scope for matching the query. Default value is empty list.
-
Creates a request for retrieving the articles specified by provided IDs.
To retrieve a specific version of an article, end the corresponding ID with
vN
suffix whereN
is the desired version number. If an identifier without the suffix is provided, the most recent version will be retrieved.ArxivEntry
type has properties for getting the version and versioned IDs of the corresponing article.For detailed explanation of arXiv identifiers see arXiv help.
Declaration
Swift
public init(idList: [String])
Parameters
idList
A list of arXiv article IDs.
-
Specifies sorting criteria for articles returned by API calls.
See moreDeclaration
Swift
public struct SortingCriterion : Codable, CustomStringConvertible
-
Specifies sorting order for articles returned by API calls.
See moreDeclaration
Swift
public struct SortingOrder : Codable, CustomStringConvertible
-
Returns
self
.Declaration
Swift
public var requestSpecification: ArxivRequestSpecification { get }
-
The arXiv API URL of the request.
Declaration
Swift
var url: URL { get }
-
Declaration
Swift
public var description: String { get }