-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathPrivacyGuardInitConfig.swift
More file actions
112 lines (100 loc) · 3.78 KB
/
PrivacyGuardInitConfig.swift
File metadata and controls
112 lines (100 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//
import ObjCModule
public final class PrivacyGuardInitConfig {
let odwPrivacyGuardInitConfig: ODWPrivacyGuardInitConfig
private var commonDataContext: CommonDataContext
private var privacyConcernMetadataProvider: PrivacyConcernMetadataProvider
/// Data Context to use with the Privacy Guard.
public var dataContext: CommonDataContext {
get {
commonDataContext
}
set {
commonDataContext = newValue
odwPrivacyGuardInitConfig.dataContext = commonDataContext.odwCommonDataContext
}
}
/// Metadata provider to use with Privacy Guard.
public var metadataProvider: PrivacyConcernMetadataProvider {
get {
return metadataProvider
}
set {
metadataProvider = newValue
odwPrivacyGuardInitConfig.metadataProvider = privacyConcernMetadataProvider.odwPrivacyConcernMetadataProvider
}
}
/// (OPTIONAL) Custom event name to use when logging privacy concerns. Default value is `PrivacyConcern`.
public var notificationEventName: String {
get {
odwPrivacyGuardInitConfig.notificationEventName
}
set {
odwPrivacyGuardInitConfig.notificationEventName = newValue
}
}
/// (OPTIONAL) Custom event name to use when logging concerns identified in the Semantic Context. Default value is `SemanticContext`.
public var semanticContextNotificationEventName: String {
get {
odwPrivacyGuardInitConfig.semanticContextNotificationEventName
}
set {
odwPrivacyGuardInitConfig.semanticContextNotificationEventName = newValue
}
}
/// (OPTIONAL) Custom event name to use when logging summary events. Default value is `PrivacyGuardSummary`.
public var summaryEventName: String {
get {
odwPrivacyGuardInitConfig.summaryEventName
}
set {
odwPrivacyGuardInitConfig.summaryEventName = newValue
}
}
/// (OPTIONAL) Add `PG_` prefix to Notification and Summary event field names. Default value is `false`.
public var useEventFieldPrefix: Bool {
get {
odwPrivacyGuardInitConfig.useEventFieldPrefix
}
set {
odwPrivacyGuardInitConfig.useEventFieldPrefix = newValue
}
}
/// (OPTIONAL) Should scan for URLs? Default value is `true`.
public var scanForUrls: Bool {
get {
odwPrivacyGuardInitConfig.scanForUrls
}
set {
odwPrivacyGuardInitConfig.scanForUrls = newValue
}
}
/// (OPTIONAL) Should disable advanced scans such as location, URLs, Out-of-scope identifiers, etc.
public var disableAdvancedScans: Bool {
get {
odwPrivacyGuardInitConfig.disableAdvancedScans
}
set {
odwPrivacyGuardInitConfig.disableAdvancedScans = newValue
}
}
/// Default constructor.
public init() {
odwPrivacyGuardInitConfig = ODWPrivacyGuardInitConfig()
odwPrivacyGuardInitConfig.dataContext = ODWCommonDataContext()
odwPrivacyGuardInitConfig.metadataProvider = ODWPrivacyConcernMetadataProvider()
metadataProvider = PrivacyConcernMetadataProvider(odwPrivacyConcernMetadataProvider: odwPrivacyGuardInitConfig.metadataProvider)
commonDataContext = CommonDataContext(odwCommonDataContext: odwPrivacyGuardInitConfig.dataContext)
}
/**
Returns the Obj-C object of the wrapper.
- Return:
`ODWPrivacyGuardInitConfig` object which class is wrapped around.
*/
func getODWPrivacyGuardInitConfig() -> ODWPrivacyGuardInitConfig {
return odwPrivacyGuardInitConfig
}
}