Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "192deac", "specHash": "fa34496", "version": "10.0.1" }
{ "engineHash": "192deac", "specHash": "cf21406", "version": "10.0.1" }
692 changes: 692 additions & 0 deletions BoxSdkGen/BoxSdkGen.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions BoxSdkGen/Sources/Client/BoxClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ public class BoxClient {

public let docgen: DocgenManager

public let enterpriseConfigurations: EnterpriseConfigurationsManager

public let hubs: HubsManager

public let hubCollaborations: HubCollaborationsManager
Expand Down Expand Up @@ -242,6 +244,7 @@ public class BoxClient {
self.aiStudio = AiStudioManager(auth: self.auth, networkSession: self.networkSession)
self.docgenTemplate = DocgenTemplateManager(auth: self.auth, networkSession: self.networkSession)
self.docgen = DocgenManager(auth: self.auth, networkSession: self.networkSession)
self.enterpriseConfigurations = EnterpriseConfigurationsManager(auth: self.auth, networkSession: self.networkSession)
self.hubs = HubsManager(auth: self.auth, networkSession: self.networkSession)
self.hubCollaborations = HubCollaborationsManager(auth: self.auth, networkSession: self.networkSession)
self.hubItems = HubItemsManager(auth: self.auth, networkSession: self.networkSession)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Foundation

public class EnterpriseConfigurationsManager {
public let auth: Authentication?

public let networkSession: NetworkSession

public init(auth: Authentication? = nil, networkSession: NetworkSession = NetworkSession()) {
self.auth = auth
self.networkSession = networkSession
}

/// Retrieves the configuration for an enterprise.
///
/// - Parameters:
/// - enterpriseId: The ID of the enterprise.
/// Example: "3442311"
/// - queryParams: Query parameters of getEnterpriseConfigurationByIdV2025R0 method
/// - headers: Headers of getEnterpriseConfigurationByIdV2025R0 method
/// - Returns: The `EnterpriseConfigurationV2025R0`.
/// - Throws: The `GeneralError`.
public func getEnterpriseConfigurationByIdV2025R0(enterpriseId: String, queryParams: GetEnterpriseConfigurationByIdV2025R0QueryParams, headers: GetEnterpriseConfigurationByIdV2025R0Headers = GetEnterpriseConfigurationByIdV2025R0Headers()) async throws -> EnterpriseConfigurationV2025R0 {
let queryParamsMap: [String: String] = Utils.Dictionary.prepareParams(map: ["categories": Utils.Strings.toString(value: queryParams.categories)])
let headersMap: [String: String] = Utils.Dictionary.prepareParams(map: Utils.Dictionary.merge(["box-version": Utils.Strings.toString(value: headers.boxVersion)], headers.extraHeaders))
let response: FetchResponse = try await self.networkSession.networkClient.fetch(options: FetchOptions(url: "\(self.networkSession.baseUrls.baseUrl)\("/2.0/enterprise_configurations/")\(enterpriseId)", method: "GET", params: queryParamsMap, headers: headersMap, responseFormat: ResponseFormat.json, auth: self.auth, networkSession: self.networkSession))
return try EnterpriseConfigurationV2025R0.deserialize(from: response.data!)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Foundation

public class GetEnterpriseConfigurationByIdV2025R0Headers {
/// Version header.
public let boxVersion: BoxVersionHeaderV2025R0

/// Extra headers that will be included in the HTTP request.
public let extraHeaders: [String: String?]?

/// Initializer for a GetEnterpriseConfigurationByIdV2025R0Headers.
///
/// - Parameters:
/// - boxVersion: Version header.
/// - extraHeaders: Extra headers that will be included in the HTTP request.
public init(boxVersion: BoxVersionHeaderV2025R0 = BoxVersionHeaderV2025R0._20250, extraHeaders: [String: String?]? = [:]) {
self.boxVersion = boxVersion
self.extraHeaders = extraHeaders
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Foundation

public class GetEnterpriseConfigurationByIdV2025R0QueryParams {
/// The comma-delimited list of the enterprise configuration categories.
/// Allowed values: `security`, `content_and_sharing`, `user_settings`, `shield`.
public let categories: String

/// Initializer for a GetEnterpriseConfigurationByIdV2025R0QueryParams.
///
/// - Parameters:
/// - categories: The comma-delimited list of the enterprise configuration categories.
/// Allowed values: `security`, `content_and_sharing`, `user_settings`, `shield`.
public init(categories: String) {
self.categories = categories
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

/// A mini representation of a enterprise, used when
/// A representation of a enterprise, used when
/// nested within another resource.
public class EnterpriseBase: Codable, RawJSONReadable {
private enum CodingKeys: String, CodingKey {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import Foundation

/// The collaboration permissions.
public class CollaborationPermissionsV2025R0: Codable, RawJSONReadable {
private enum CodingKeys: String, CodingKey {
case isCoOwnerRoleEnabled = "is_co_owner_role_enabled"
case isEditorRoleEnabled = "is_editor_role_enabled"
case isPreviewerRoleEnabled = "is_previewer_role_enabled"
case isPreviewerUploaderRoleEnabled = "is_previewer_uploader_role_enabled"
case isUploaderRoleEnabled = "is_uploader_role_enabled"
case isViewerRoleEnabled = "is_viewer_role_enabled"
case isViewerUploaderRoleEnabled = "is_viewer_uploader_role_enabled"
}

/// Internal backing store for rawData. Used to store raw dictionary data associated with the instance.
private var _rawData: [String: Any]?

/// Returns the raw dictionary data associated with the instance. This is a read-only property.
public var rawData: [String: Any]? {
return _rawData
}


/// The co-owner role is enabled for collaboration.
public let isCoOwnerRoleEnabled: Bool?

/// The editor role is enabled for collaboration.
public let isEditorRoleEnabled: Bool?

/// The previewer role is enabled for collaboration.
public let isPreviewerRoleEnabled: Bool?

/// The previewer uploader role is enabled for collaboration.
public let isPreviewerUploaderRoleEnabled: Bool?

/// The uploader role is enabled for collaboration.
public let isUploaderRoleEnabled: Bool?

/// The viewer role is enabled for collaboration.
public let isViewerRoleEnabled: Bool?

/// The viewer uploader role is enabled for collaboration.
public let isViewerUploaderRoleEnabled: Bool?

/// Initializer for a CollaborationPermissionsV2025R0.
///
/// - Parameters:
/// - isCoOwnerRoleEnabled: The co-owner role is enabled for collaboration.
/// - isEditorRoleEnabled: The editor role is enabled for collaboration.
/// - isPreviewerRoleEnabled: The previewer role is enabled for collaboration.
/// - isPreviewerUploaderRoleEnabled: The previewer uploader role is enabled for collaboration.
/// - isUploaderRoleEnabled: The uploader role is enabled for collaboration.
/// - isViewerRoleEnabled: The viewer role is enabled for collaboration.
/// - isViewerUploaderRoleEnabled: The viewer uploader role is enabled for collaboration.
public init(isCoOwnerRoleEnabled: Bool? = nil, isEditorRoleEnabled: Bool? = nil, isPreviewerRoleEnabled: Bool? = nil, isPreviewerUploaderRoleEnabled: Bool? = nil, isUploaderRoleEnabled: Bool? = nil, isViewerRoleEnabled: Bool? = nil, isViewerUploaderRoleEnabled: Bool? = nil) {
self.isCoOwnerRoleEnabled = isCoOwnerRoleEnabled
self.isEditorRoleEnabled = isEditorRoleEnabled
self.isPreviewerRoleEnabled = isPreviewerRoleEnabled
self.isPreviewerUploaderRoleEnabled = isPreviewerUploaderRoleEnabled
self.isUploaderRoleEnabled = isUploaderRoleEnabled
self.isViewerRoleEnabled = isViewerRoleEnabled
self.isViewerUploaderRoleEnabled = isViewerUploaderRoleEnabled
}

required public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
isCoOwnerRoleEnabled = try container.decodeIfPresent(Bool.self, forKey: .isCoOwnerRoleEnabled)
isEditorRoleEnabled = try container.decodeIfPresent(Bool.self, forKey: .isEditorRoleEnabled)
isPreviewerRoleEnabled = try container.decodeIfPresent(Bool.self, forKey: .isPreviewerRoleEnabled)
isPreviewerUploaderRoleEnabled = try container.decodeIfPresent(Bool.self, forKey: .isPreviewerUploaderRoleEnabled)
isUploaderRoleEnabled = try container.decodeIfPresent(Bool.self, forKey: .isUploaderRoleEnabled)
isViewerRoleEnabled = try container.decodeIfPresent(Bool.self, forKey: .isViewerRoleEnabled)
isViewerUploaderRoleEnabled = try container.decodeIfPresent(Bool.self, forKey: .isViewerUploaderRoleEnabled)
}

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(isCoOwnerRoleEnabled, forKey: .isCoOwnerRoleEnabled)
try container.encodeIfPresent(isEditorRoleEnabled, forKey: .isEditorRoleEnabled)
try container.encodeIfPresent(isPreviewerRoleEnabled, forKey: .isPreviewerRoleEnabled)
try container.encodeIfPresent(isPreviewerUploaderRoleEnabled, forKey: .isPreviewerUploaderRoleEnabled)
try container.encodeIfPresent(isUploaderRoleEnabled, forKey: .isUploaderRoleEnabled)
try container.encodeIfPresent(isViewerRoleEnabled, forKey: .isViewerRoleEnabled)
try container.encodeIfPresent(isViewerUploaderRoleEnabled, forKey: .isViewerUploaderRoleEnabled)
}

/// Sets the raw JSON data.
///
/// - Parameters:
/// - rawData: A dictionary containing the raw JSON data
func setRawData(rawData: [String: Any]?) {
self._rawData = rawData
}

/// Gets the raw JSON data
/// - Returns: The `[String: Any]?`.
func getRawData() -> [String: Any]? {
return self._rawData
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Foundation

/// The collaboration restriction.
public enum CollaborationRestrictionV2025R0: CodableStringEnum {
case internal_
case external
case customValue(String)

public init(rawValue value: String) {
switch value.lowercased() {
case "internal".lowercased():
self = .internal_
case "external".lowercased():
self = .external
default:
self = .customValue(value)
}
}

public var rawValue: String {
switch self {
case .internal_:
return "internal"
case .external:
return "external"
case .customValue(let value):
return value
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import Foundation

/// A custom session duration group item.
public class CustomSessionDurationGroupItemV2025R0: Codable, RawJSONReadable {
private enum CodingKeys: String, CodingKey {
case id
case name
}

/// Internal backing store for rawData. Used to store raw dictionary data associated with the instance.
private var _rawData: [String: Any]?

/// Returns the raw dictionary data associated with the instance. This is a read-only property.
public var rawData: [String: Any]? {
return _rawData
}


/// Group ID (numerical).
public let id: String?

/// Group Name.
public let name: String?

/// Initializer for a CustomSessionDurationGroupItemV2025R0.
///
/// - Parameters:
/// - id: Group ID (numerical).
/// - name: Group Name.
public init(id: String? = nil, name: String? = nil) {
self.id = id
self.name = name
}

required public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id)
name = try container.decodeIfPresent(String.self, forKey: .name)
}

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(id, forKey: .id)
try container.encodeIfPresent(name, forKey: .name)
}

/// Sets the raw JSON data.
///
/// - Parameters:
/// - rawData: A dictionary containing the raw JSON data
func setRawData(rawData: [String: Any]?) {
self._rawData = rawData
}

/// Gets the raw JSON data
/// - Returns: The `[String: Any]?`.
func getRawData() -> [String: Any]? {
return self._rawData
}

}
Loading