TermsOfServicesModule
public class TermsOfServicesModule
Provides TermsOfService management.
-
Initializer
Declaration
Swift
public init(boxClient: BoxClient)Parameters
boxClientRequired for communicating with Box APIs.
-
Creates a Terms of Service for an enterprise.
Declaration
Swift
public func create( status: TermsOfServiceStatus, tosType: TermsOfServiceType, text: String, fields: [String]? = nil, completion: @escaping Callback<TermsOfService> )Parameters
statusThe flag for whether a Terms of Service is active or inactive.
tosTypeThe scope of the terms of service whether or not it is internal or external to an enterprise.
textThe text of the Terms of Service to be displayed to the user.
fieldsComma-separated list of fields to include in the response.
completionReturns a full Terms of Service object or an error.
-
Updates a specified Terms of Service.
Declaration
Swift
public func update( tosId: String, text: String, status: TermsOfServiceStatus, fields: [String]? = nil, completion: @escaping Callback<TermsOfService> )Parameters
tosIdThe id of the Terms of Service to update.
textThe text of the Terms of Service to be updated.
statusThe flag for whether a Terms of Service is active or inactive to be updated.
fieldsComma-separated list of fields to include in the response.
completionReturns a full Terms of Service object or an error.
-
Retrieves a specified Terms of Service.
Declaration
Swift
public func get( tosId: String, fields: [String]? = nil, completion: @escaping Callback<TermsOfService> )Parameters
tosIdThe id of the Terms of Service to retrieve information for.
fieldsComma-separated list of fields to include in the response.
completionReturns a full Terms of Service object or an error.
-
Retrieves both external and managed Terms of Services if no Terms of Service type is specified.
Declaration
Swift
public func listForEnterprise( tosType: TermsOfServiceType? = nil, fields: [String]? = nil, completion: @escaping Callback<[TermsOfService]> )Parameters
tosTypeOptional field indicating whether to retrieve managed, external, or both types of Terms of Service. If left
nil, both types will be returned.fieldsComma-separated list of fields to include in the response.
completionReturns a collection of Terms of Service object or an error.
-
Creates an association between a terms of service and a specified user. If no user is specified, defaults to current user.
Declaration
Swift
public func createUserStatus( tosId: String, isAccepted: Bool, userId: String? = nil, fields: [String]? = nil, completion: @escaping Callback<TermsOfServiceUserStatus> )Parameters
tosIdThe id of the terms of service to associate with a user.
isAcceptedIndicator whether or not the Terms of Service has been accepted by the user.
userIdThe user to create association with terms of service on. If no user id is specified, defaults to current user.
fieldsComma-separated list of fields to include in the response.
completionReturns a Terms of Service User Status object or an error.
-
Update the user status on the Terms of Service. Choose to either accept or deny.
Declaration
Swift
public func updateUserStatus( userStatusId: String, isAccepted: Bool, fields: [String]? = nil, completion: @escaping Callback<TermsOfServiceUserStatus> )Parameters
userStatusIdThe id of the user status to act on.
isAcceptedIndicates whether or not the Terms of Service is accepted or denied by the user.
fieldsComma-separated list of fields to include in the response.
completionReturns a Terms of Service User Status object or an error.
-
Retrieves the user status for the specified Terms of Service and the specified user.
Declaration
Swift
public func getUserStatus( tosId: String, userId: String? = nil, fields: [String]? = nil, completion: @escaping Callback<TermsOfServiceUserStatus> )Parameters
tosIdThe id of the Terms of Service to retrieve the user status for.
userIdThe optional id of the user to retrieve the user status for.
fieldsComma-separated list of fields to include in the response.
completionReturns a collection of Terms of Service User Status object or an error.
TermsOfServicesModule Class Reference