@@ -44,6 +44,10 @@ public struct CustomReport: Codable, Hashable, Sendable, CodingKeysContaining, I
44
44
public let startTime : Date ?
45
45
/// The end time of the report. The format is YYYY-MM-DD, such as 2024-06-30.
46
46
public let endTime : Date ?
47
+ /// The date range of the report.
48
+ ///
49
+ /// A date range is required only when using `WEEKLY` granularity in Impression Share Report.
50
+ public let dateRange : CustomReportDateRange ?
47
51
/// The timestamp for the creation of the report.
48
52
public let creationTime : Date ?
49
53
/// The most recent timestamp of report modifications
@@ -75,6 +79,7 @@ public struct CustomReport: Codable, Hashable, Sendable, CodingKeysContaining, I
75
79
state: State ? = nil ,
76
80
startTime: Date ? = nil ,
77
81
endTime: Date ? = nil ,
82
+ dateRange: CustomReportDateRange ? = nil ,
78
83
creationTime: Date ? = nil ,
79
84
modificationTime: Date ? = nil ,
80
85
granularity: CustomReportGranularity ? = nil ,
@@ -88,6 +93,7 @@ public struct CustomReport: Codable, Hashable, Sendable, CodingKeysContaining, I
88
93
self . state = state
89
94
self . startTime = startTime
90
95
self . endTime = endTime
96
+ self . dateRange = dateRange
91
97
self . creationTime = creationTime
92
98
self . modificationTime = modificationTime
93
99
self . granularity = granularity
@@ -103,6 +109,7 @@ public struct CustomReport: Codable, Hashable, Sendable, CodingKeysContaining, I
103
109
case state
104
110
case startTime
105
111
case endTime
112
+ case dateRange
106
113
case creationTime
107
114
case modificationTime
108
115
case granularity
@@ -122,6 +129,7 @@ public struct CustomReport: Codable, Hashable, Sendable, CodingKeysContaining, I
122
129
state = try container. decodeIfPresent ( CustomReport . State. self, forKey: . state)
123
130
startTime = try container. decodeIfPresent ( String . self, forKey: . startTime) . flatMap ( formatter. date ( from: ) )
124
131
endTime = try container. decodeIfPresent ( String . self, forKey: . endTime) . flatMap ( formatter. date ( from: ) )
132
+ dateRange = try container. decodeIfPresent ( CustomReportDateRange . self, forKey: . dateRange)
125
133
creationTime = try container. decodeIfPresent ( Date . self, forKey: . creationTime)
126
134
modificationTime = try container. decodeIfPresent ( Date . self, forKey: . modificationTime)
127
135
granularity = try container. decodeIfPresent ( CustomReportGranularity . self, forKey: . granularity)
@@ -137,6 +145,7 @@ public struct CustomReport: Codable, Hashable, Sendable, CodingKeysContaining, I
137
145
try container. encodeIfPresent ( id, forKey: . id)
138
146
try container. encodeIfPresent ( name, forKey: . name)
139
147
try container. encodeIfPresent ( state, forKey: . state)
148
+ try container. encodeIfPresent ( dateRange, forKey: . dateRange)
140
149
try container. encodeIfPresent ( creationTime, forKey: . creationTime)
141
150
try container. encodeIfPresent ( modificationTime, forKey: . modificationTime)
142
151
try container. encodeIfPresent ( granularity, forKey: . granularity)
0 commit comments