Skip to content

Commit f978ff7

Browse files
committed
Add missing fields to reporting models
1 parent ddebcaf commit f978ff7

File tree

5 files changed

+155
-5
lines changed

5 files changed

+155
-5
lines changed

Sources/Core/Models/Codable/ReportingAd.swift

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ public struct ReportingAd: Codable, Hashable, Sendable, CodingKeysContaining, Id
4949
///
5050
/// You can use this field with the `orderBy` selector.
5151
public let modificationTime: Date?
52+
/// Reporting device class.
53+
public let deviceClass: DeviceClass?
54+
/// Reporting gender.
55+
public let gender: Gender?
56+
/// Reporting age range.
57+
public let ageRange: AgeRange?
58+
/// Reporting country code.
59+
public let countryCode: String?
60+
/// Reporting administrative area.
61+
public let adminArea: String?
62+
/// Reporting locality.
63+
public let locality: String?
5264

5365
public var id: Int? { adId }
5466

@@ -67,7 +79,13 @@ public struct ReportingAd: Codable, Hashable, Sendable, CodingKeysContaining, Id
6779
language: String? = nil,
6880
deleted: Bool? = nil,
6981
creationTime: Date? = nil,
70-
modificationTime: Date? = nil
82+
modificationTime: Date? = nil,
83+
deviceClass: DeviceClass? = nil,
84+
gender: Gender? = nil,
85+
ageRange: AgeRange? = nil,
86+
countryCode: String? = nil,
87+
adminArea: String? = nil,
88+
locality: String? = nil
7189
) {
7290
self.adId = adId
7391
self.adGroupId = adGroupId
@@ -84,6 +102,12 @@ public struct ReportingAd: Codable, Hashable, Sendable, CodingKeysContaining, Id
84102
self.deleted = deleted
85103
self.creationTime = creationTime
86104
self.modificationTime = modificationTime
105+
self.deviceClass = deviceClass
106+
self.gender = gender
107+
self.ageRange = ageRange
108+
self.countryCode = countryCode
109+
self.adminArea = adminArea
110+
self.locality = locality
87111
}
88112

89113
public enum CodingKeys: String, CodingKey {
@@ -102,5 +126,11 @@ public struct ReportingAd: Codable, Hashable, Sendable, CodingKeysContaining, Id
102126
case deleted
103127
case creationTime
104128
case modificationTime
129+
case deviceClass
130+
case gender
131+
case ageRange
132+
case countryCode
133+
case adminArea
134+
case locality
105135
}
106136
}

Sources/Core/Models/Codable/ReportingAdGroup.swift

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ public struct ReportingAdGroup: Codable, Hashable, Sendable, CodingKeysContainin
3636
///
3737
/// Your `orgId` is the same as your account in the Apple Search Ads UI.
3838
public let orgId: Int?
39+
/// Reporting device class.
40+
public let deviceClass: DeviceClass?
41+
/// Reporting gender.
42+
public let gender: Gender?
43+
/// Reporting age range.
44+
public let ageRange: AgeRange?
45+
/// Reporting country code.
46+
public let countryCode: String?
47+
/// Reporting administrative area.
48+
public let adminArea: String?
49+
/// Reporting locality.
50+
public let locality: String?
3951

4052
public var id: Int? { adGroupId }
4153

@@ -54,7 +66,13 @@ public struct ReportingAdGroup: Codable, Hashable, Sendable, CodingKeysContainin
5466
startTime: Date? = nil,
5567
endTime: Date? = nil,
5668
modificationTime: Date? = nil,
57-
orgId: Int? = nil
69+
orgId: Int? = nil,
70+
deviceClass: DeviceClass? = nil,
71+
gender: Gender? = nil,
72+
ageRange: AgeRange? = nil,
73+
countryCode: String? = nil,
74+
adminArea: String? = nil,
75+
locality: String? = nil
5876
) {
5977
self.adGroupDisplayStatus = adGroupDisplayStatus
6078
self.adGroupId = adGroupId
@@ -71,6 +89,12 @@ public struct ReportingAdGroup: Codable, Hashable, Sendable, CodingKeysContainin
7189
self.endTime = endTime
7290
self.modificationTime = modificationTime
7391
self.orgId = orgId
92+
self.deviceClass = deviceClass
93+
self.gender = gender
94+
self.ageRange = ageRange
95+
self.countryCode = countryCode
96+
self.adminArea = adminArea
97+
self.locality = locality
7498
}
7599

76100
public enum CodingKeys: String, CodingKey {
@@ -89,5 +113,11 @@ public struct ReportingAdGroup: Codable, Hashable, Sendable, CodingKeysContainin
89113
case endTime
90114
case modificationTime
91115
case orgId
116+
case deviceClass
117+
case gender
118+
case ageRange
119+
case countryCode
120+
case adminArea
121+
case locality
92122
}
93123
}

Sources/Core/Models/Codable/ReportingCampaign.swift

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ public struct ReportingCampaign: Codable, Hashable, Sendable, CodingKeysContaini
4343
///
4444
/// This is the equivalent of `budgetAmount` in your `Campaign`.
4545
public let totalBudget: Money?
46+
/// Reporting device class.
47+
public let deviceClass: DeviceClass?
48+
/// Reporting gender.
49+
public let gender: Gender?
50+
/// Reporting age range.
51+
public let ageRange: AgeRange?
52+
/// Reporting country code.
53+
public let countryCode: String?
54+
/// Reporting administrative area.
55+
public let adminArea: String?
56+
/// Reporting locality.
57+
public let locality: String?
4658

4759
public var id: Int? { campaignId }
4860

@@ -62,7 +74,13 @@ public struct ReportingCampaign: Codable, Hashable, Sendable, CodingKeysContaini
6274
servingStateReasons: [Campaign.ServingStateReason]? = nil,
6375
servingStatus: Campaign.ServingStatus? = nil,
6476
supplySources: [SupplySource]? = nil,
65-
totalBudget: Money? = nil
77+
totalBudget: Money? = nil,
78+
deviceClass: DeviceClass? = nil,
79+
gender: Gender? = nil,
80+
ageRange: AgeRange? = nil,
81+
countryCode: String? = nil,
82+
adminArea: String? = nil,
83+
locality: String? = nil
6684
) {
6785
self.adChannelType = adChannelType
6886
self.app = app
@@ -80,6 +98,12 @@ public struct ReportingCampaign: Codable, Hashable, Sendable, CodingKeysContaini
8098
self.servingStatus = servingStatus
8199
self.supplySources = supplySources
82100
self.totalBudget = totalBudget
101+
self.deviceClass = deviceClass
102+
self.gender = gender
103+
self.ageRange = ageRange
104+
self.countryCode = countryCode
105+
self.adminArea = adminArea
106+
self.locality = locality
83107
}
84108

85109
public enum CodingKeys: String, CodingKey {
@@ -99,5 +123,11 @@ public struct ReportingCampaign: Codable, Hashable, Sendable, CodingKeysContaini
99123
case servingStatus
100124
case supplySources
101125
case totalBudget
126+
case deviceClass
127+
case gender
128+
case ageRange
129+
case countryCode
130+
case adminArea
131+
case locality
102132
}
103133
}

Sources/Core/Models/Codable/ReportingKeyword.swift

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ public struct ReportingKeyword: Codable, Hashable, Sendable, CodingKeysContainin
3232
public let orgId: Int?
3333
/// The date and time of the most recent modification of the object.
3434
public let modificationTime: Date?
35+
/// Reporting device class.
36+
public let deviceClass: DeviceClass?
37+
/// Reporting gender.
38+
public let gender: Gender?
39+
/// Reporting age range.
40+
public let ageRange: AgeRange?
41+
/// Reporting country code.
42+
public let countryCode: String?
43+
/// Reporting administrative area.
44+
public let adminArea: String?
45+
/// Reporting locality.
46+
public let locality: String?
3547

3648
public var id: Int? { keywordId }
3749

@@ -48,7 +60,13 @@ public struct ReportingKeyword: Codable, Hashable, Sendable, CodingKeysContainin
4860
keywordDisplayStatus: KeywordDisplayStatus? = nil,
4961
matchType: KeywordMatchType? = nil,
5062
orgId: Int? = nil,
51-
modificationTime: Date? = nil
63+
modificationTime: Date? = nil,
64+
deviceClass: DeviceClass? = nil,
65+
gender: Gender? = nil,
66+
ageRange: AgeRange? = nil,
67+
countryCode: String? = nil,
68+
adminArea: String? = nil,
69+
locality: String? = nil
5270
) {
5371
self.adGroupDeleted = adGroupDeleted
5472
self.adGroupId = adGroupId
@@ -63,6 +81,12 @@ public struct ReportingKeyword: Codable, Hashable, Sendable, CodingKeysContainin
6381
self.matchType = matchType
6482
self.orgId = orgId
6583
self.modificationTime = modificationTime
84+
self.deviceClass = deviceClass
85+
self.gender = gender
86+
self.ageRange = ageRange
87+
self.countryCode = countryCode
88+
self.adminArea = adminArea
89+
self.locality = locality
6690
}
6791

6892
public enum CodingKeys: String, CodingKey {
@@ -79,5 +103,11 @@ public struct ReportingKeyword: Codable, Hashable, Sendable, CodingKeysContainin
79103
case matchType
80104
case orgId
81105
case modificationTime
106+
case deviceClass
107+
case gender
108+
case ageRange
109+
case countryCode
110+
case adminArea
111+
case locality
82112
}
83113
}

Sources/Core/Models/Codable/ReportingSearchTerm.swift

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ public struct ReportingSearchTerm: Codable, Hashable, Sendable, CodingKeysContai
4444
public let searchTermSource: Source?
4545
/// The search terms to use for app searches.
4646
public let searchTermText: String?
47+
/// Reporting device class.
48+
public let deviceClass: DeviceClass?
49+
/// Reporting gender.
50+
public let gender: Gender?
51+
/// Reporting age range.
52+
public let ageRange: AgeRange?
53+
/// Reporting country code.
54+
public let countryCode: String?
55+
/// Reporting administrative area.
56+
public let adminArea: String?
57+
/// Reporting locality.
58+
public let locality: String?
4759

4860
public var id: Int? { keywordId }
4961

@@ -62,7 +74,13 @@ public struct ReportingSearchTerm: Codable, Hashable, Sendable, CodingKeysContai
6274
orgId: Int? = nil,
6375
modificationTime: Date? = nil,
6476
searchTermSource: Source? = nil,
65-
searchTermText: String? = nil
77+
searchTermText: String? = nil,
78+
deviceClass: DeviceClass? = nil,
79+
gender: Gender? = nil,
80+
ageRange: AgeRange? = nil,
81+
countryCode: String? = nil,
82+
adminArea: String? = nil,
83+
locality: String? = nil
6684
) {
6785
self.adGroupDeleted = adGroupDeleted
6886
self.adGroupId = adGroupId
@@ -79,6 +97,12 @@ public struct ReportingSearchTerm: Codable, Hashable, Sendable, CodingKeysContai
7997
self.modificationTime = modificationTime
8098
self.searchTermSource = searchTermSource
8199
self.searchTermText = searchTermText
100+
self.deviceClass = deviceClass
101+
self.gender = gender
102+
self.ageRange = ageRange
103+
self.countryCode = countryCode
104+
self.adminArea = adminArea
105+
self.locality = locality
82106
}
83107

84108
public enum CodingKeys: String, CodingKey {
@@ -97,5 +121,11 @@ public struct ReportingSearchTerm: Codable, Hashable, Sendable, CodingKeysContai
97121
case modificationTime
98122
case searchTermSource
99123
case searchTermText
124+
case deviceClass
125+
case gender
126+
case ageRange
127+
case countryCode
128+
case adminArea
129+
case locality
100130
}
101131
}

0 commit comments

Comments
 (0)