SAPcpmsUsagePolicy
public struct SAPcpmsUsagePolicy
extension SAPcpmsUsagePolicy: CustomStringConvertible, CustomDebugStringConvertible
Describes the SAPcpms Usage policy structure
Note: Crash upload is currently not supported on visionOS
-
Parameter from the server’s Usage policy
Declaration
Swift
public let uploadDataAfterDays: Int
-
Undocumented
Declaration
Swift
public let crashLogUploadEnabled: Bool
-
Undocumented
Declaration
Swift
public let dataCollectionEnabled: Bool
-
Initialize the structure
Declaration
Swift
public init(dataCollectionEnabled: Bool = false, uploadDataAfterDays: Int = 0, crashLogUploadEnabled: Bool = false)
Parameters
uploadDataAfterDays
parameter from the server’s Usage policy
-
Initialize the structure
-
Initialize the structure from [String: Any] dictionary. For example when the policy received from mobile services and should parse the json. Example structure, which is part of the Settings structure downloaded from mobile services: { “mobileservices”: { “settingsExchange”: { … “usagePolicy”: { “dataCollectionEnabled”: “true”, “uploadDataAfterDays”: “1”, “crashLogUploadEnabled”: “true” } … } } } If the enabled property is false, the init returns nil.
Throws
ConfigurationError if the received config is invalid.Declaration
Swift
public init?(sapcpmsSettings: Any) throws
Parameters
sapcpmsSettings
‘Any’ type object which can be converted to [String: Any]
-
Initialize the structure from [String: String] dictionary. For example when the policy received from mobile services and should parse the json. Example structure, which is part of the Settings structure downloaded from mobile services: … “usagePolicy”: { “dataCollectionEnabled”: “true”, “uploadDataAfterDays”: “1” “crashLogUploadEnabled”: “true” } … If the dataCollectionEnabled and crashLogUploadEnabled property is false or sapcpmsUsagePolicy is an empty dictionary, the init returns nil.
Throws
ConfigurationError if the received config is invalidDeclaration
Swift
public init?(sapcpmsUsagePolicy: Any) throws
Parameters
sapcpmsUsagePolicy
Any
type object which can be converted to [String: Any] -
Declaration
Swift
public var description: String { get }
-
Declaration
Swift
public var debugDescription: String { get }