-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,017 changed files
with
184,714 additions
and
110,635 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
This file was deleted.
Oops, something went wrong.
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
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
50 changes: 50 additions & 0 deletions
50
AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Models/Features.swift
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,50 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import Foundation | ||
import AWSCLIUtils | ||
|
||
struct FeaturesReader: Decodable { | ||
private let requestFilePath: String | ||
private let mappingFilePath: String | ||
|
||
public init( | ||
requestFilePath: String = "../build-request.json", | ||
mappingFilePath: String = "../feature-service-id.json" | ||
) { | ||
self.requestFilePath = requestFilePath | ||
self.mappingFilePath = mappingFilePath | ||
} | ||
|
||
public func getFeaturesFromFile() throws -> Features { | ||
let fileContents = try FileManager.default.loadContents(atPath: requestFilePath) | ||
return try JSONDecoder().decode(Features.self, from: fileContents) | ||
} | ||
|
||
public func getFeaturesIDToServiceNameDictFromFile() throws -> [String: String] { | ||
let fileContents = try FileManager.default.loadContents(atPath: mappingFilePath) | ||
return try JSONDecoder().decode([String: String].self, from: fileContents) | ||
} | ||
} | ||
|
||
struct Features: Decodable { | ||
let features: [Feature] | ||
} | ||
|
||
struct Feature: Decodable { | ||
let releaseNotes: String? | ||
let featureMetadata: FeatureMetadata | ||
|
||
struct FeatureMetadata: Decodable { | ||
let trebuchet: Trebuchet | ||
|
||
struct Trebuchet: Decodable { | ||
let featureId: String | ||
let featureType: String | ||
} | ||
} | ||
} |
Oops, something went wrong.