-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support unknown enum values in Swift (box/box-codegen#670) (#382)
- Loading branch information
1 parent
80257e0
commit 8fe7ff4
Showing
387 changed files
with
12,449 additions
and
1,161 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{ "engineHash": "ef00939", "specHash": "06fc5f7", "version": "0.6.0" } | ||
{ "engineHash": "77017fa", "specHash": "06fc5f7", "version": "0.6.0" } |
38 changes: 35 additions & 3 deletions
38
Sources/Managers/Ai/GetAiAgentDefaultConfigQueryParamsModeField.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 |
---|---|---|
@@ -1,8 +1,40 @@ | ||
import Foundation | ||
|
||
public enum GetAiAgentDefaultConfigQueryParamsModeField: String, CodableStringEnum { | ||
public enum GetAiAgentDefaultConfigQueryParamsModeField: CodableStringEnum { | ||
case ask | ||
case textGen = "text_gen" | ||
case textGen | ||
case extract | ||
case extractStructured = "extract_structured" | ||
case extractStructured | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "ask".lowercased(): | ||
self = .ask | ||
case "text_gen".lowercased(): | ||
self = .textGen | ||
case "extract".lowercased(): | ||
self = .extract | ||
case "extract_structured".lowercased(): | ||
self = .extractStructured | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .ask: | ||
return "ask" | ||
case .textGen: | ||
return "text_gen" | ||
case .extract: | ||
return "extract" | ||
case .extractStructured: | ||
return "extract_structured" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
22 changes: 21 additions & 1 deletion
22
Sources/Managers/Authorization/AuthorizeUserQueryParamsResponseTypeField.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 |
---|---|---|
@@ -1,5 +1,25 @@ | ||
import Foundation | ||
|
||
public enum AuthorizeUserQueryParamsResponseTypeField: String, CodableStringEnum { | ||
public enum AuthorizeUserQueryParamsResponseTypeField: CodableStringEnum { | ||
case code | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "code".lowercased(): | ||
self = .code | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .code: | ||
return "code" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
24 changes: 22 additions & 2 deletions
24
Sources/Managers/Classifications/AddClassificationRequestBodyFieldKeyField.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 |
---|---|---|
@@ -1,5 +1,25 @@ | ||
import Foundation | ||
|
||
public enum AddClassificationRequestBodyFieldKeyField: String, CodableStringEnum { | ||
case boxSecurityClassificationKey = "Box__Security__Classification__Key" | ||
public enum AddClassificationRequestBodyFieldKeyField: CodableStringEnum { | ||
case boxSecurityClassificationKey | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "Box__Security__Classification__Key".lowercased(): | ||
self = .boxSecurityClassificationKey | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .boxSecurityClassificationKey: | ||
return "Box__Security__Classification__Key" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
22 changes: 21 additions & 1 deletion
22
Sources/Managers/Classifications/AddClassificationRequestBodyOpField.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 |
---|---|---|
@@ -1,5 +1,25 @@ | ||
import Foundation | ||
|
||
public enum AddClassificationRequestBodyOpField: String, CodableStringEnum { | ||
public enum AddClassificationRequestBodyOpField: CodableStringEnum { | ||
case addEnumOption | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "addEnumOption".lowercased(): | ||
self = .addEnumOption | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .addEnumOption: | ||
return "addEnumOption" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
24 changes: 22 additions & 2 deletions
24
...es/Managers/Classifications/CreateClassificationTemplateRequestBodyDisplayNameField.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 |
---|---|---|
@@ -1,5 +1,25 @@ | ||
import Foundation | ||
|
||
public enum CreateClassificationTemplateRequestBodyDisplayNameField: String, CodableStringEnum { | ||
case classification = "Classification" | ||
public enum CreateClassificationTemplateRequestBodyDisplayNameField: CodableStringEnum { | ||
case classification | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "Classification".lowercased(): | ||
self = .classification | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .classification: | ||
return "Classification" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
24 changes: 22 additions & 2 deletions
24
...agers/Classifications/CreateClassificationTemplateRequestBodyFieldsDisplayNameField.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 |
---|---|---|
@@ -1,5 +1,25 @@ | ||
import Foundation | ||
|
||
public enum CreateClassificationTemplateRequestBodyFieldsDisplayNameField: String, CodableStringEnum { | ||
case classification = "Classification" | ||
public enum CreateClassificationTemplateRequestBodyFieldsDisplayNameField: CodableStringEnum { | ||
case classification | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "Classification".lowercased(): | ||
self = .classification | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .classification: | ||
return "Classification" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
24 changes: 22 additions & 2 deletions
24
Sources/Managers/Classifications/CreateClassificationTemplateRequestBodyFieldsKeyField.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 |
---|---|---|
@@ -1,5 +1,25 @@ | ||
import Foundation | ||
|
||
public enum CreateClassificationTemplateRequestBodyFieldsKeyField: String, CodableStringEnum { | ||
case boxSecurityClassificationKey = "Box__Security__Classification__Key" | ||
public enum CreateClassificationTemplateRequestBodyFieldsKeyField: CodableStringEnum { | ||
case boxSecurityClassificationKey | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "Box__Security__Classification__Key".lowercased(): | ||
self = .boxSecurityClassificationKey | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .boxSecurityClassificationKey: | ||
return "Box__Security__Classification__Key" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
24 changes: 22 additions & 2 deletions
24
...ces/Managers/Classifications/CreateClassificationTemplateRequestBodyFieldsTypeField.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 |
---|---|---|
@@ -1,5 +1,25 @@ | ||
import Foundation | ||
|
||
public enum CreateClassificationTemplateRequestBodyFieldsTypeField: String, CodableStringEnum { | ||
case enum_ = "enum" | ||
public enum CreateClassificationTemplateRequestBodyFieldsTypeField: CodableStringEnum { | ||
case enum_ | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "enum".lowercased(): | ||
self = .enum_ | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .enum_: | ||
return "enum" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
22 changes: 21 additions & 1 deletion
22
Sources/Managers/Classifications/CreateClassificationTemplateRequestBodyScopeField.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 |
---|---|---|
@@ -1,5 +1,25 @@ | ||
import Foundation | ||
|
||
public enum CreateClassificationTemplateRequestBodyScopeField: String, CodableStringEnum { | ||
public enum CreateClassificationTemplateRequestBodyScopeField: CodableStringEnum { | ||
case enterprise | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "enterprise".lowercased(): | ||
self = .enterprise | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .enterprise: | ||
return "enterprise" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
24 changes: 22 additions & 2 deletions
24
...es/Managers/Classifications/CreateClassificationTemplateRequestBodyTemplateKeyField.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 |
---|---|---|
@@ -1,5 +1,25 @@ | ||
import Foundation | ||
|
||
public enum CreateClassificationTemplateRequestBodyTemplateKeyField: String, CodableStringEnum { | ||
case securityClassification6VmVochwUWo = "securityClassification-6VMVochwUWo" | ||
public enum CreateClassificationTemplateRequestBodyTemplateKeyField: CodableStringEnum { | ||
case securityClassification6VmVochwUWo | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "securityClassification-6VMVochwUWo".lowercased(): | ||
self = .securityClassification6VmVochwUWo | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .securityClassification6VmVochwUWo: | ||
return "securityClassification-6VMVochwUWo" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
24 changes: 22 additions & 2 deletions
24
Sources/Managers/Classifications/UpdateClassificationRequestBodyFieldKeyField.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 |
---|---|---|
@@ -1,5 +1,25 @@ | ||
import Foundation | ||
|
||
public enum UpdateClassificationRequestBodyFieldKeyField: String, CodableStringEnum { | ||
case boxSecurityClassificationKey = "Box__Security__Classification__Key" | ||
public enum UpdateClassificationRequestBodyFieldKeyField: CodableStringEnum { | ||
case boxSecurityClassificationKey | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "Box__Security__Classification__Key".lowercased(): | ||
self = .boxSecurityClassificationKey | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .boxSecurityClassificationKey: | ||
return "Box__Security__Classification__Key" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
22 changes: 21 additions & 1 deletion
22
Sources/Managers/Classifications/UpdateClassificationRequestBodyOpField.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 |
---|---|---|
@@ -1,5 +1,25 @@ | ||
import Foundation | ||
|
||
public enum UpdateClassificationRequestBodyOpField: String, CodableStringEnum { | ||
public enum UpdateClassificationRequestBodyOpField: CodableStringEnum { | ||
case editEnumOption | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "editEnumOption".lowercased(): | ||
self = .editEnumOption | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .editEnumOption: | ||
return "editEnumOption" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
30 changes: 29 additions & 1 deletion
30
...borationAllowlistEntries/CreateCollaborationWhitelistEntryRequestBodyDirectionField.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 |
---|---|---|
@@ -1,7 +1,35 @@ | ||
import Foundation | ||
|
||
public enum CreateCollaborationWhitelistEntryRequestBodyDirectionField: String, CodableStringEnum { | ||
public enum CreateCollaborationWhitelistEntryRequestBodyDirectionField: CodableStringEnum { | ||
case inbound | ||
case outbound | ||
case both | ||
case customValue(String) | ||
|
||
public init(rawValue value: String) { | ||
switch value.lowercased() { | ||
case "inbound".lowercased(): | ||
self = .inbound | ||
case "outbound".lowercased(): | ||
self = .outbound | ||
case "both".lowercased(): | ||
self = .both | ||
default: | ||
self = .customValue(value) | ||
} | ||
} | ||
|
||
public var rawValue: String { | ||
switch self { | ||
case .inbound: | ||
return "inbound" | ||
case .outbound: | ||
return "outbound" | ||
case .both: | ||
return "both" | ||
case .customValue(let value): | ||
return value | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.