Skip to content

Commit 1c29a5f

Browse files
feat!: Change names of unions (box/box-codegen#789) (#967)
1 parent 77c0db8 commit 1c29a5f

File tree

65 files changed

+843
-790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+843
-790
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "1c54d3c", "specHash": "24fbeb9", "version": "0.1.0" }
1+
{ "engineHash": "ef443c1", "specHash": "99e14a6", "version": "0.1.0" }

BoxSdkGen.xcodeproj/project.pbxproj

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

Sources/Managers/Ai/AiManager.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ public class AiManager {
4545
/// - Parameters:
4646
/// - queryParams: Query parameters of getAiAgentDefaultConfig method
4747
/// - headers: Headers of getAiAgentDefaultConfig method
48-
/// - Returns: The `AiAgentAskOrAiAgentExtractOrAiAgentExtractStructuredOrAiAgentTextGen`.
48+
/// - Returns: The `AiAgent`.
4949
/// - Throws: The `GeneralError`.
50-
public func getAiAgentDefaultConfig(queryParams: GetAiAgentDefaultConfigQueryParams, headers: GetAiAgentDefaultConfigHeaders = GetAiAgentDefaultConfigHeaders()) async throws -> AiAgentAskOrAiAgentExtractOrAiAgentExtractStructuredOrAiAgentTextGen {
50+
public func getAiAgentDefaultConfig(queryParams: GetAiAgentDefaultConfigQueryParams, headers: GetAiAgentDefaultConfigHeaders = GetAiAgentDefaultConfigHeaders()) async throws -> AiAgent {
5151
let queryParamsMap: [String: String] = Utils.Dictionary.prepareParams(map: ["mode": Utils.Strings.toString(value: queryParams.mode), "language": Utils.Strings.toString(value: queryParams.language), "model": Utils.Strings.toString(value: queryParams.model)])
5252
let headersMap: [String: String] = Utils.Dictionary.prepareParams(map: Utils.Dictionary.merge([:], headers.extraHeaders))
5353
let response: FetchResponse = try await self.networkSession.networkClient.fetch(options: FetchOptions(url: "\(self.networkSession.baseUrls.baseUrl)\("/2.0/ai_agent_default")", method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: ResponseFormat.json, auth: self.auth, networkSession: self.networkSession))
54-
return try AiAgentAskOrAiAgentExtractOrAiAgentExtractStructuredOrAiAgentTextGen.deserialize(from: response.data!)
54+
return try AiAgent.deserialize(from: response.data!)
5555
}
5656

5757
/// Sends an AI request to supported Large Language Models (LLMs) and extracts metadata in form of key-value pairs.

Sources/Managers/FileVersions/FileVersionsManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public class FileVersionsManager {
116116
///
117117
/// This creates a new copy of the old version and puts it at the
118118
/// top of the versions history. The file will have the exact same contents
119-
/// as the older version, with the the same hash digest, `etag`, and
119+
/// as the older version, with the same hash digest, `etag`, and
120120
/// name as the original.
121121
///
122122
/// Other properties such as comments do not get updated to their

Sources/Managers/Files/FilesManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class FilesManager {
5959
/// Deletes a file, either permanently or by moving it to
6060
/// the trash.
6161
///
62-
/// The the enterprise settings determine whether the item will
62+
/// The enterprise settings determine whether the item will
6363
/// be permanently deleted from Box or moved to the trash.
6464
///
6565
/// - Parameters:

Sources/Managers/Search/SearchForContentQueryParams.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class SearchForContentQueryParams {
6161
/// Date ranges are defined as comma separated RFC3339
6262
/// timestamps.
6363
///
64-
/// If the the start date is omitted (`,2014-05-17T13:35:01-07:00`)
64+
/// If the start date is omitted (`,2014-05-17T13:35:01-07:00`)
6565
/// anything created before the end date will be returned.
6666
///
6767
/// If the end date is omitted (`2014-05-15T13:35:01-07:00,`) the
@@ -171,7 +171,7 @@ public class SearchForContentQueryParams {
171171
public let trashContent: SearchForContentQueryParamsTrashContentField?
172172

173173
/// Limits the search results to any items for which the metadata matches the provided filter.
174-
/// This parameter is a list that specifies exactly **one** metadata template used to filter the search results.
174+
/// This parameter is a list that specifies exactly **one** metadata template used to filter the search results.
175175
/// The parameter is required unless the `query` parameter is provided.
176176
public let mdfilters: [MetadataFilter]?
177177

@@ -246,7 +246,7 @@ public class SearchForContentQueryParams {
246246
///
247247
/// Date ranges are defined as comma separated RFC3339 timestamps.
248248
///
249-
/// If the the start date is omitted (`2014-05-17T13:35:01-07:00`),
249+
/// If the start date is omitted (`2014-05-17T13:35:01-07:00`),
250250
/// anything deleted before the end date will be returned.
251251
///
252252
/// If the end date is omitted (`2014-05-15T13:35:01-07:00`),
@@ -317,7 +317,7 @@ public class SearchForContentQueryParams {
317317
/// Date ranges are defined as comma separated RFC3339
318318
/// timestamps.
319319
///
320-
/// If the the start date is omitted (`,2014-05-17T13:35:01-07:00`)
320+
/// If the start date is omitted (`,2014-05-17T13:35:01-07:00`)
321321
/// anything created before the end date will be returned.
322322
///
323323
/// If the end date is omitted (`2014-05-15T13:35:01-07:00,`) the
@@ -409,7 +409,7 @@ public class SearchForContentQueryParams {
409409
/// the trash
410410
/// * `all_items` - Searches for both trashed and non-trashed items.
411411
/// - mdfilters: Limits the search results to any items for which the metadata matches the provided filter.
412-
/// This parameter is a list that specifies exactly **one** metadata template used to filter the search results.
412+
/// This parameter is a list that specifies exactly **one** metadata template used to filter the search results.
413413
/// The parameter is required unless the `query` parameter is provided.
414414
/// - sort: Defines the order in which search results are returned. This API
415415
/// defaults to returning items by relevance unless this parameter is
@@ -468,7 +468,7 @@ public class SearchForContentQueryParams {
468468
///
469469
/// Date ranges are defined as comma separated RFC3339 timestamps.
470470
///
471-
/// If the the start date is omitted (`2014-05-17T13:35:01-07:00`),
471+
/// If the start date is omitted (`2014-05-17T13:35:01-07:00`),
472472
/// anything deleted before the end date will be returned.
473473
///
474474
/// If the end date is omitted (`2014-05-15T13:35:01-07:00`),

Sources/Managers/Search/SearchManager.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ public class SearchManager {
3434
/// - Parameters:
3535
/// - queryParams: Query parameters of searchForContent method
3636
/// - headers: Headers of searchForContent method
37-
/// - Returns: The `SearchResultsOrSearchResultsWithSharedLinks`.
37+
/// - Returns: The `SearchResultsResponse`.
3838
/// - Throws: The `GeneralError`.
39-
public func searchForContent(queryParams: SearchForContentQueryParams = SearchForContentQueryParams(), headers: SearchForContentHeaders = SearchForContentHeaders()) async throws -> SearchResultsOrSearchResultsWithSharedLinks {
39+
public func searchForContent(queryParams: SearchForContentQueryParams = SearchForContentQueryParams(), headers: SearchForContentHeaders = SearchForContentHeaders()) async throws -> SearchResultsResponse {
4040
let queryParamsMap: [String: String] = Utils.Dictionary.prepareParams(map: ["query": Utils.Strings.toString(value: queryParams.query), "scope": Utils.Strings.toString(value: queryParams.scope), "file_extensions": Utils.Strings.toString(value: queryParams.fileExtensions), "created_at_range": Utils.Strings.toString(value: queryParams.createdAtRange), "updated_at_range": Utils.Strings.toString(value: queryParams.updatedAtRange), "size_range": Utils.Strings.toString(value: queryParams.sizeRange), "owner_user_ids": Utils.Strings.toString(value: queryParams.ownerUserIds), "recent_updater_user_ids": Utils.Strings.toString(value: queryParams.recentUpdaterUserIds), "ancestor_folder_ids": Utils.Strings.toString(value: queryParams.ancestorFolderIds), "content_types": Utils.Strings.toString(value: queryParams.contentTypes), "type": Utils.Strings.toString(value: queryParams.type), "trash_content": Utils.Strings.toString(value: queryParams.trashContent), "mdfilters": Utils.Strings.toString(value: queryParams.mdfilters), "sort": Utils.Strings.toString(value: queryParams.sort), "direction": Utils.Strings.toString(value: queryParams.direction), "limit": Utils.Strings.toString(value: queryParams.limit), "include_recent_shared_links": Utils.Strings.toString(value: queryParams.includeRecentSharedLinks), "fields": Utils.Strings.toString(value: queryParams.fields), "offset": Utils.Strings.toString(value: queryParams.offset), "deleted_user_ids": Utils.Strings.toString(value: queryParams.deletedUserIds), "deleted_at_range": Utils.Strings.toString(value: queryParams.deletedAtRange)])
4141
let headersMap: [String: String] = Utils.Dictionary.prepareParams(map: Utils.Dictionary.merge([:], headers.extraHeaders))
4242
let response: FetchResponse = try await self.networkSession.networkClient.fetch(options: FetchOptions(url: "\(self.networkSession.baseUrls.baseUrl)\("/2.0/search")", method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: ResponseFormat.json, auth: self.auth, networkSession: self.networkSession))
43-
return try SearchResultsOrSearchResultsWithSharedLinks.deserialize(from: response.data!)
43+
return try SearchResultsResponse.deserialize(from: response.data!)
4444
}
4545

4646
}

Sources/Managers/Skills/CreateBoxSkillCardsOnFileRequestBody.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ public class CreateBoxSkillCardsOnFileRequestBody: Codable, RawJSONReadable {
1515

1616

1717
/// A list of Box Skill cards to apply to this file.
18-
public let cards: [KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard]
18+
public let cards: [SkillCard]
1919

2020
/// Initializer for a CreateBoxSkillCardsOnFileRequestBody.
2121
///
2222
/// - Parameters:
2323
/// - cards: A list of Box Skill cards to apply to this file.
24-
public init(cards: [KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard]) {
24+
public init(cards: [SkillCard]) {
2525
self.cards = cards
2626
}
2727

2828
required public init(from decoder: Decoder) throws {
2929
let container = try decoder.container(keyedBy: CodingKeys.self)
30-
cards = try container.decode([KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard].self, forKey: .cards)
30+
cards = try container.decode([SkillCard].self, forKey: .cards)
3131
}
3232

3333
public func encode(to encoder: Encoder) throws {

Sources/Managers/Skills/UpdateAllSkillCardsOnFileRequestBodyMetadataField.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ public class UpdateAllSkillCardsOnFileRequestBodyMetadataField: Codable, RawJSON
1515

1616

1717
/// A list of Box Skill cards to apply to this file.
18-
public let cards: [KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard]?
18+
public let cards: [SkillCard]?
1919

2020
/// Initializer for a UpdateAllSkillCardsOnFileRequestBodyMetadataField.
2121
///
2222
/// - Parameters:
2323
/// - cards: A list of Box Skill cards to apply to this file.
24-
public init(cards: [KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard]? = nil) {
24+
public init(cards: [SkillCard]? = nil) {
2525
self.cards = cards
2626
}
2727

2828
required public init(from decoder: Decoder) throws {
2929
let container = try decoder.container(keyedBy: CodingKeys.self)
30-
cards = try container.decodeIfPresent([KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard].self, forKey: .cards)
30+
cards = try container.decodeIfPresent([SkillCard].self, forKey: .cards)
3131
}
3232

3333
public func encode(to encoder: Encoder) throws {

Sources/Managers/Skills/UpdateBoxSkillCardsOnFileRequestBody.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class UpdateBoxSkillCardsOnFileRequestBody: Codable, RawJSONReadable {
2424
/// zero-indexed position of the card in the list of cards.
2525
public let path: String?
2626

27-
public let value: KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard?
27+
public let value: SkillCard?
2828

2929
/// Initializer for a UpdateBoxSkillCardsOnFileRequestBody.
3030
///
@@ -34,7 +34,7 @@ public class UpdateBoxSkillCardsOnFileRequestBody: Codable, RawJSONReadable {
3434
/// this will be in the format `/cards/{index}` where `index` is the
3535
/// zero-indexed position of the card in the list of cards.
3636
/// - value:
37-
public init(op: UpdateBoxSkillCardsOnFileRequestBodyOpField? = nil, path: String? = nil, value: KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard? = nil) {
37+
public init(op: UpdateBoxSkillCardsOnFileRequestBodyOpField? = nil, path: String? = nil, value: SkillCard? = nil) {
3838
self.op = op
3939
self.path = path
4040
self.value = value
@@ -44,7 +44,7 @@ public class UpdateBoxSkillCardsOnFileRequestBody: Codable, RawJSONReadable {
4444
let container = try decoder.container(keyedBy: CodingKeys.self)
4545
op = try container.decodeIfPresent(UpdateBoxSkillCardsOnFileRequestBodyOpField.self, forKey: .op)
4646
path = try container.decodeIfPresent(String.self, forKey: .path)
47-
value = try container.decodeIfPresent(KeywordSkillCardOrStatusSkillCardOrTimelineSkillCardOrTranscriptSkillCard.self, forKey: .value)
47+
value = try container.decodeIfPresent(SkillCard.self, forKey: .value)
4848
}
4949

5050
public func encode(to encoder: Encoder) throws {

0 commit comments

Comments
 (0)