@@ -9,13 +9,13 @@ import Foundation
99import AsyncHTTPClient
1010
1111/// Loads credentials from `~/.config/gcloud/application_default_credentials.json`
12- struct GoogleApplicationDefaultCredentials : Codable {
13- let clientId : String
14- let clientSecret : String
15- let refreshToken : String
16- let type : String
12+ public struct GoogleApplicationDefaultCredentials : Codable {
13+ public let clientId : String
14+ public let clientSecret : String
15+ public let refreshToken : String
16+ public let type : String
1717
18- init ( fromFilePath path: String ) throws {
18+ public init ( fromFilePath path: String ) throws {
1919 let decoder = JSONDecoder ( )
2020 decoder. keyDecodingStrategy = . convertFromSnakeCase
2121 if let contents = try String ( contentsOfFile: path) . data ( using: . utf8) {
@@ -25,7 +25,7 @@ struct GoogleApplicationDefaultCredentials: Codable {
2525 }
2626 }
2727
28- init ( fromJsonString json: String ) throws {
28+ public init ( fromJsonString json: String ) throws {
2929 let decoder = JSONDecoder ( )
3030 decoder. keyDecodingStrategy = . convertFromSnakeCase
3131 if let data = json. data ( using: . utf8) {
@@ -37,19 +37,19 @@ struct GoogleApplicationDefaultCredentials: Codable {
3737}
3838
3939/// Loads credentials from a file specified in the `GOOGLE_APPLICATION_CREDENTIALS` environment variable
40- struct GoogleServiceAccountCredentials : Codable {
41- let type : String
42- let projectId : String
43- let privateKeyId : String
44- let privateKey : String
45- let clientEmail : String
46- let clientId : String
47- let authUri : URL
48- let tokenUri : URL
49- let authProviderX509CertUrl : URL
50- let clientX509CertUrl : URL
40+ public struct GoogleServiceAccountCredentials : Codable {
41+ public let type : String
42+ public let projectId : String
43+ public let privateKeyId : String
44+ public let privateKey : String
45+ public let clientEmail : String
46+ public let clientId : String
47+ public let authUri : URL
48+ public let tokenUri : URL
49+ public let authProviderX509CertUrl : URL
50+ public let clientX509CertUrl : URL
5151
52- init ( fromFilePath path: String ) throws {
52+ public init ( fromFilePath path: String ) throws {
5353 let decoder = JSONDecoder ( )
5454 decoder. keyDecodingStrategy = . convertFromSnakeCase
5555 if let contents = try String ( contentsOfFile: path) . data ( using: . utf8) {
@@ -59,7 +59,7 @@ struct GoogleServiceAccountCredentials: Codable {
5959 }
6060 }
6161
62- init ( fromJsonString json: String ) throws {
62+ public init ( fromJsonString json: String ) throws {
6363 let decoder = JSONDecoder ( )
6464 decoder. keyDecodingStrategy = . convertFromSnakeCase
6565 if let data = json. data ( using: . utf8) {
0 commit comments