Skip to content

Commit 4d46369

Browse files
committed
Add structure for oauth-token-response
Also added conversion documentation.
1 parent c98d783 commit 4d46369

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Conversion for `oauth-types/src/oauth-token-response.ts`
2+
3+
## `export const oauthTokenResponseSchema`
4+
5+
This has been converted.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//
2+
// OAuthTokenResponse.swift
3+
// ATOAuthKit
4+
//
5+
// Created by Christopher Jr Riley on 2025-08-04.
6+
//
7+
8+
import Foundation
9+
10+
/// A structure representing a token response.
11+
public struct TokenResponse: Codable {
12+
13+
/// The access token of the response.
14+
public let accessToken: String
15+
16+
/// The response's token type.
17+
public let tokenType: OAuthTokenType
18+
19+
/// The scope of the token response. Optional.
20+
public let scope: String?
21+
22+
/// The refresh token of the response. Optional.
23+
public let refreshToken: String?
24+
25+
/// The date and time the response expires. Optional.
26+
public let expiresIn: Date?
27+
28+
/// The signed JSON Web Token (JWT). Optional.
29+
public let idToken: SignedJWT?
30+
31+
/// Additional authorization details associated with the token response. Optional.
32+
public let authorizationDetails: AuthorizationDetail?
33+
34+
enum CodingKeys: String, CodingKey {
35+
case accessToken = "access_token"
36+
case tokenType = "token_type"
37+
case scope
38+
case refreshToken = "refresh_token"
39+
case expiresIn = "expires_in"
40+
case idToken = "id_token"
41+
case authorizationDetails = "authorization_details"
42+
}
43+
}

0 commit comments

Comments
 (0)