TermsOfServicesModule

public class TermsOfServicesModule

Provides TermsOfService management.

  • 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

    status

    The flag for whether a Terms of Service is active or inactive.

    tosType

    The scope of the terms of service whether or not it is internal or external to an enterprise.

    text

    The text of the Terms of Service to be displayed to the user.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    tosId

    The id of the Terms of Service to update.

    text

    The text of the Terms of Service to be updated.

    status

    The flag for whether a Terms of Service is active or inactive to be updated.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    tosId

    The id of the Terms of Service to retrieve information for.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    tosType

    Optional field indicating whether to retrieve managed, external, or both types of Terms of Service. If left nil, both types will be returned.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    tosId

    The id of the terms of service to associate with a user.

    isAccepted

    Indicator whether or not the Terms of Service has been accepted by the user.

    userId

    The user to create association with terms of service on. If no user id is specified, defaults to current user.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    userStatusId

    The id of the user status to act on.

    isAccepted

    Indicates whether or not the Terms of Service is accepted or denied by the user.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns 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

    tosId

    The id of the Terms of Service to retrieve the user status for.

    userId

    The optional id of the user to retrieve the user status for.

    fields

    Comma-separated list of fields to include in the response.

    completion

    Returns a collection of Terms of Service User Status object or an error.