Skip to content

Commit

Permalink
fix: Fix access control errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sqeezelemon committed Sep 29, 2022
1 parent 9d32dbd commit fa884f1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Sources/SwiftyLiveApi/ATC/LAAtcFrequency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public struct LAAtcFrequency: Decodable {
@LADate
public var startTime: Date

enum CodingKeys: String, CodingKey {
private enum CodingKeys: String, CodingKey {
case frequencyId, airportName, type, latitude, longitude
case userId, username, virtualOrganization, startTime
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftyLiveApi/Aircraft/LALivery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public struct LALivery: Decodable {
/// Name of the livery. Can differ between aircraft.
public var name: String

internal enum CodingKeys: CodingKey {
private enum CodingKeys: CodingKey {
case id
case aircraftID
case aircraftName
Expand Down
8 changes: 4 additions & 4 deletions Sources/SwiftyLiveApi/LAClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ public final class LAClient {
//MARK: Properties

/// Reusable URL components
var urlComponents = URLComponents()
private var urlComponents = URLComponents()
/// URLSession to be used by the client.
let urlSession = URLSession(configuration: .ephemeral)
private let urlSession = URLSession(configuration: .ephemeral)
/// JSON decoder to be used by the client
let decoder = JSONDecoder()
private let decoder = JSONDecoder()
/// The API key used by the client.
var apiKey: String? {
public var apiKey: String? {
set {
urlComponents.queryItems = [
URLQueryItem(name: "apikey", value: newValue)
Expand Down
6 changes: 3 additions & 3 deletions Sources/SwiftyLiveApi/Utils/LAResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import Foundation
/// Wrapper for all API responses.
internal struct LAResponse<T: Decodable>: Decodable {
/// API error code.
var errorCode: LAError
public var errorCode: LAError
/// Response data.
var result: T
public var result: T

private enum CodingKeys: CodingKey {
case errorCode, result
}

init(from decoder: Decoder) throws {
public init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: CodingKeys.self)
errorCode = try values.decode(LAError.self, forKey: .errorCode)
guard errorCode == .ok else { throw errorCode }
Expand Down

0 comments on commit fa884f1

Please sign in to comment.