Skip to content

Commit 805c937

Browse files
fix(boxsdkgen): remove enum types from GET enterprise configurations endpoint (box/box-openapi#560) (#1206)
* chore: Update `.codegen.json` with commit hash of `codegen` and `openapi` spec [skip ci] * feat: use generated `RetryStrategy` for retrying requests (box/box-codegen#872) * fix: remove enum types from GET enterprise configurations endpoint (box/box-openapi#560)
1 parent c91bb4f commit 805c937

File tree

8 files changed

+12
-105
lines changed

8 files changed

+12
-105
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "b98d1dc", "specHash": "cf21406", "version": "6.0.0" }
1+
{ "engineHash": "4421f42", "specHash": "1715587", "version": "6.0.0" }

BoxSdkGen/BoxSdkGen.xcodeproj/project.pbxproj

Lines changed: 0 additions & 32 deletions
Large diffs are not rendered by default.

BoxSdkGen/Sources/Managers/EnterpriseConfigurations/GetEnterpriseConfigurationByIdV2025R0QueryParams.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import Foundation
22

33
public class GetEnterpriseConfigurationByIdV2025R0QueryParams {
4-
/// The comma-delimited list of the enterprise configuration categories.
4+
/// A comma-separated list of the enterprise configuration categories.
55
/// Allowed values: `security`, `content_and_sharing`, `user_settings`, `shield`.
6-
public let categories: String
6+
public let categories: [String]
77

88
/// Initializer for a GetEnterpriseConfigurationByIdV2025R0QueryParams.
99
///
1010
/// - Parameters:
11-
/// - categories: The comma-delimited list of the enterprise configuration categories.
11+
/// - categories: A comma-separated list of the enterprise configuration categories.
1212
/// Allowed values: `security`, `content_and_sharing`, `user_settings`, `shield`.
13-
public init(categories: String) {
13+
public init(categories: [String]) {
1414
self.categories = categories
1515
}
1616

BoxSdkGen/Sources/Networking/Retries/BoxRetryStrategy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class BoxRetryStrategy: RetryStrategy {
2222
}
2323

2424
let isSuccessful: Bool = fetchResponse.status >= 200 && fetchResponse.status < 400
25-
let retryAfterHeader: String? = fetchResponse.headers["Retry-After"]
25+
let retryAfterHeader: String? = fetchResponse.headers.keys.contains("Retry-After") ? fetchResponse.headers["Retry-After"] : nil
2626
let isAcceptedWithRetryAfter: Bool = fetchResponse.status == 202 && retryAfterHeader != nil
2727
if attemptNumber >= self.maxAttempts {
2828
return false

BoxSdkGen/Sources/Schemas/V2025R0/CollaborationRestrictionV2025R0/CollaborationRestrictionV2025R0.swift

Lines changed: 0 additions & 31 deletions
This file was deleted.

BoxSdkGen/Sources/Schemas/V2025R0/EnterpriseConfigurationContentAndSharingV2025R0/EnterpriseConfigurationContentAndSharingV2025R0CollaborationRestrictionsField.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ public class EnterpriseConfigurationContentAndSharingV2025R0CollaborationRestric
1414
}
1515

1616

17-
public let value: [CollaborationRestrictionV2025R0]?
17+
public let value: [String]?
1818

1919
/// Initializer for a EnterpriseConfigurationContentAndSharingV2025R0CollaborationRestrictionsField.
2020
///
2121
/// - Parameters:
2222
/// - isUsed: Indicates whether a configuration is used for a given enterprise.
2323
/// - value:
24-
public init(isUsed: Bool? = nil, value: [CollaborationRestrictionV2025R0]? = nil) {
24+
public init(isUsed: Bool? = nil, value: [String]? = nil) {
2525
self.value = value
2626

2727
super.init(isUsed: isUsed)
2828
}
2929

3030
required public init(from decoder: Decoder) throws {
3131
let container = try decoder.container(keyedBy: CodingKeys.self)
32-
value = try container.decodeIfPresent([CollaborationRestrictionV2025R0].self, forKey: .value)
32+
value = try container.decodeIfPresent([String].self, forKey: .value)
3333

3434
try super.init(from: decoder)
3535
}

BoxSdkGen/Sources/Schemas/V2025R0/EnterpriseConfigurationContentAndSharingV2025R0/EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusField.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ public class EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaboratio
1515

1616

1717
/// The external collaboration status.
18-
@CodableTriState public private(set) var value: EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField?
18+
@CodableTriState public private(set) var value: String?
1919

2020
/// Initializer for a EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusField.
2121
///
2222
/// - Parameters:
2323
/// - isUsed: Indicates whether a configuration is used for a given enterprise.
2424
/// - value: The external collaboration status.
25-
public init(isUsed: Bool? = nil, value: TriStateField<EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField> = nil) {
25+
public init(isUsed: Bool? = nil, value: TriStateField<String> = nil) {
2626
self._value = CodableTriState(state: value)
2727

2828
super.init(isUsed: isUsed)
2929
}
3030

3131
required public init(from decoder: Decoder) throws {
3232
let container = try decoder.container(keyedBy: CodingKeys.self)
33-
value = try container.decodeIfPresent(EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField.self, forKey: .value)
33+
value = try container.decodeIfPresent(String.self, forKey: .value)
3434

3535
try super.init(from: decoder)
3636
}

BoxSdkGen/Sources/Schemas/V2025R0/EnterpriseConfigurationContentAndSharingV2025R0/EnterpriseConfigurationContentAndSharingV2025R0ExternalCollaborationStatusFieldValueField.swift

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)