-
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.
Query different languages and release tracks
- Loading branch information
1 parent
79e27cb
commit 1484bed
Showing
3 changed files
with
138 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// | ||
// Language.swift | ||
// BbcNews | ||
// | ||
// Created by Bilaal Rashid on 04/06/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
/// A language supported by the API. | ||
public enum Language: Codable, Equatable, Hashable { | ||
/// The Arabic language. | ||
case arabic | ||
|
||
/// The Cymru language. | ||
case cymru | ||
|
||
/// The English language. | ||
case english | ||
|
||
/// The Hindi language. | ||
case hindi | ||
|
||
/// The Mundo language. | ||
case mundo | ||
|
||
/// The Russian language. | ||
case russian | ||
|
||
/// The value of the `clientName` URL parameter to use when calling the API for this language. | ||
var clientName: String { | ||
switch self { | ||
case .arabic: | ||
return "Arabic" | ||
case .cymru: | ||
return "Cymru" | ||
case .english: | ||
return "Chrysalis" | ||
case .hindi: | ||
return "Hindi" | ||
case .mundo: | ||
return "Mundo" | ||
case .russian: | ||
return "Russian" | ||
} | ||
} | ||
|
||
/// The value of the `service` URL parameter to use when calling the API for this language. | ||
var service: String { | ||
switch self { | ||
case .arabic: | ||
return "arabic" | ||
case .cymru: | ||
return "cymrufyw" | ||
case .english: | ||
return "news" | ||
case .hindi: | ||
return "hindi" | ||
case .mundo: | ||
return "mundo" | ||
case .russian: | ||
return "russian" | ||
} | ||
} | ||
} |
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,17 @@ | ||
// | ||
// ReleaseTrack.swift | ||
// BbcNews | ||
// | ||
// Created by Bilaal Rashid on 04/06/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
/// A release track for the API. | ||
public enum ReleaseTrack: String, Codable, Equatable, Hashable { | ||
/// The `public-alpha` release track. | ||
case publicAlpha = "public-alpha" | ||
|
||
/// The `team` release track. | ||
case team = "team" | ||
} |