Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7243289

Browse files
committedMar 6, 2025·
remove unused fields from other structs
1 parent ff5b5c0 commit 7243289

File tree

4 files changed

+4
-57
lines changed

4 files changed

+4
-57
lines changed
 

‎Coder Desktop/Coder DesktopTests/LoginFormTests.swift

+1-12
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,7 @@ struct LoginTests {
9393

9494
let user = User(
9595
id: UUID(),
96-
username: "admin",
97-
avatar_url: "",
98-
name: "admin",
99-
email: "admin@coder.com",
100-
created_at: Date.now,
101-
updated_at: Date.now,
102-
last_seen_at: Date.now,
103-
status: "active",
104-
login_type: "none",
105-
theme_preference: "dark",
106-
organization_ids: [],
107-
roles: []
96+
username: "admin"
10897
)
10998

11099
try Mock(

‎Coder Desktop/CoderSDK/Deployment.swift

+1-9
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,8 @@ public extension Client {
1010
}
1111
}
1212

13-
public struct BuildInfoResponse: Encodable, Decodable, Equatable, Sendable {
14-
public let external_url: String
13+
public struct BuildInfoResponse: Codable, Equatable, Sendable {
1514
public let version: String
16-
public let dashboard_url: String
17-
public let telemetry: Bool
18-
public let workspace_proxy: Bool
19-
public let agent_api_version: String
20-
public let provisioner_api_version: String
21-
public let upgrade_message: String
22-
public let deployment_id: String
2315

2416
// `version` in the form `[0-9]+.[0-9]+.[0-9]+`
2517
public var semver: String? {

‎Coder Desktop/CoderSDK/User.swift

-12
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,3 @@ public struct User: Encodable, Decodable, Equatable, Sendable {
2222
self.username = username
2323
}
2424
}
25-
26-
public struct Role: Encodable, Decodable, Equatable, Sendable {
27-
public let name: String
28-
public let display_name: String
29-
public let organization_id: UUID?
30-
31-
public init(name: String, display_name: String, organization_id: UUID?) {
32-
self.name = name
33-
self.display_name = display_name
34-
self.organization_id = organization_id
35-
}
36-
}

‎Coder Desktop/CoderSDKTests/CoderSDKTests.swift

+2-24
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,9 @@ import Testing
77
struct CoderSDKTests {
88
@Test
99
func user() async throws {
10-
let now = Date.now
1110
let user = User(
1211
id: UUID(),
13-
username: "johndoe",
14-
avatar_url: "https://example.com/img.png",
15-
name: "John Doe",
16-
email: "john.doe@example.com",
17-
created_at: now,
18-
updated_at: now,
19-
last_seen_at: now,
20-
status: "active",
21-
login_type: "email",
22-
theme_preference: "dark",
23-
organization_ids: [UUID()],
24-
roles: [
25-
Role(name: "user", display_name: "User", organization_id: UUID()),
26-
]
12+
username: "johndoe"
2713
)
2814

2915
let url = URL(string: "https://example.com")!
@@ -50,15 +36,7 @@ struct CoderSDKTests {
5036
@Test
5137
func buildInfo() async throws {
5238
let buildInfo = BuildInfoResponse(
53-
external_url: "https://example.com",
54-
version: "v2.18.2-devel+630fd7c0a",
55-
dashboard_url: "https://example.com/dashboard",
56-
telemetry: true,
57-
workspace_proxy: false,
58-
agent_api_version: "1.0",
59-
provisioner_api_version: "1.2",
60-
upgrade_message: "foo",
61-
deployment_id: UUID().uuidString
39+
version: "v2.18.2-devel+630fd7c0a"
6240
)
6341

6442
let url = URL(string: "https://example.com")!

0 commit comments

Comments
 (0)
Please sign in to comment.