@@ -34,15 +34,14 @@ type Client interface {
34
34
35
35
DestroyDataForUserByID (ctx context.Context , userID string ) error
36
36
37
- GetCGMSummary (ctx context.Context , id string ) (* types.Summary [* types.CGMStats , types.CGMStats ], error )
38
- GetBGMSummary (ctx context.Context , id string ) (* types.Summary [* types.BGMStats , types.BGMStats ], error )
39
- GetContinuousSummary (ctx context.Context , id string ) (* types.Summary [* types.ContinuousStats , types.ContinuousStats ], error )
40
- UpdateCGMSummary (ctx context.Context , id string ) (* types.Summary [* types.CGMStats , types.CGMStats ], error )
41
- UpdateBGMSummary (ctx context.Context , id string ) (* types.Summary [* types.BGMStats , types.BGMStats ], error )
42
- UpdateContinuousSummary (ctx context.Context , id string ) (* types.Summary [* types.ContinuousStats , types.ContinuousStats ], error )
37
+ GetCGMSummary (ctx context.Context , id string ) (* types.Summary [* types.CGMStats , * types.GlucoseBucket , types. CGMStats , types. GlucoseBucket ], error )
38
+ GetBGMSummary (ctx context.Context , id string ) (* types.Summary [* types.BGMStats , * types.GlucoseBucket , types. BGMStats , types. GlucoseBucket ], error )
39
+ GetContinuousSummary (ctx context.Context , id string ) (* types.Summary [* types.ContinuousStats , * types.ContinuousBucket , types. ContinuousStats , types. ContinuousBucket ], error )
40
+ UpdateCGMSummary (ctx context.Context , id string ) (* types.Summary [* types.CGMStats , * types.GlucoseBucket , types. CGMStats , types. GlucoseBucket ], error )
41
+ UpdateBGMSummary (ctx context.Context , id string ) (* types.Summary [* types.BGMStats , * types.GlucoseBucket , types. BGMStats , types. GlucoseBucket ], error )
42
+ UpdateContinuousSummary (ctx context.Context , id string ) (* types.Summary [* types.ContinuousStats , * types.ContinuousBucket , types. ContinuousStats , types. ContinuousBucket ], error )
43
43
GetOutdatedUserIDs (ctx context.Context , t string , pagination * page.Pagination ) (* types.OutdatedSummariesResponse , error )
44
44
GetMigratableUserIDs (ctx context.Context , t string , pagination * page.Pagination ) ([]string , error )
45
- BackfillSummaries (ctx context.Context , t string ) (int , error )
46
45
}
47
46
48
47
type ClientImpl struct {
@@ -132,7 +131,7 @@ func (c *ClientImpl) GetDataSet(ctx context.Context, id string) (*data.DataSet,
132
131
return dataSet , nil
133
132
}
134
133
135
- func (c * ClientImpl ) GetCGMSummary (ctx context.Context , userId string ) (* types.Summary [* types.CGMStats , types.CGMStats ], error ) {
134
+ func (c * ClientImpl ) GetCGMSummary (ctx context.Context , userId string ) (* types.Summary [* types.CGMStats , * types.GlucoseBucket , types. CGMStats , types. GlucoseBucket ], error ) {
136
135
if ctx == nil {
137
136
return nil , errors .New ("context is missing" )
138
137
}
@@ -141,7 +140,7 @@ func (c *ClientImpl) GetCGMSummary(ctx context.Context, userId string) (*types.S
141
140
}
142
141
143
142
url := c .client .ConstructURL ("v1" , "summaries" , "cgm" , userId )
144
- summary := & types.Summary [* types.CGMStats , types.CGMStats ]{}
143
+ summary := & types.Summary [* types.CGMStats , * types.GlucoseBucket , types. CGMStats , types. GlucoseBucket ]{}
145
144
if err := c .client .RequestData (ctx , http .MethodGet , url , nil , nil , summary ); err != nil {
146
145
if request .IsErrorResourceNotFound (err ) {
147
146
return nil , nil
@@ -152,7 +151,7 @@ func (c *ClientImpl) GetCGMSummary(ctx context.Context, userId string) (*types.S
152
151
return summary , nil
153
152
}
154
153
155
- func (c * ClientImpl ) GetBGMSummary (ctx context.Context , userId string ) (* types.Summary [* types.BGMStats , types.BGMStats ], error ) {
154
+ func (c * ClientImpl ) GetBGMSummary (ctx context.Context , userId string ) (* types.Summary [* types.BGMStats , * types.GlucoseBucket , types. BGMStats , types. GlucoseBucket ], error ) {
156
155
if ctx == nil {
157
156
return nil , errors .New ("context is missing" )
158
157
}
@@ -161,7 +160,7 @@ func (c *ClientImpl) GetBGMSummary(ctx context.Context, userId string) (*types.S
161
160
}
162
161
163
162
url := c .client .ConstructURL ("v1" , "summaries" , "bgm" , userId )
164
- summary := & types.Summary [* types.BGMStats , types.BGMStats ]{}
163
+ summary := & types.Summary [* types.BGMStats , * types.GlucoseBucket , types. BGMStats , types. GlucoseBucket ]{}
165
164
if err := c .client .RequestData (ctx , http .MethodGet , url , nil , nil , summary ); err != nil {
166
165
if request .IsErrorResourceNotFound (err ) {
167
166
return nil , nil
@@ -172,7 +171,7 @@ func (c *ClientImpl) GetBGMSummary(ctx context.Context, userId string) (*types.S
172
171
return summary , nil
173
172
}
174
173
175
- func (c * ClientImpl ) GetContinuousSummary (ctx context.Context , userId string ) (* types.Summary [* types.ContinuousStats , types.ContinuousStats ], error ) {
174
+ func (c * ClientImpl ) GetContinuousSummary (ctx context.Context , userId string ) (* types.Summary [* types.ContinuousStats , * types.ContinuousBucket , types. ContinuousStats , types. ContinuousBucket ], error ) {
176
175
if ctx == nil {
177
176
return nil , errors .New ("context is missing" )
178
177
}
@@ -181,7 +180,7 @@ func (c *ClientImpl) GetContinuousSummary(ctx context.Context, userId string) (*
181
180
}
182
181
183
182
url := c .client .ConstructURL ("v1" , "summaries" , "continuous" , userId )
184
- summary := & types.Summary [* types.ContinuousStats , types.ContinuousStats ]{}
183
+ summary := & types.Summary [* types.ContinuousStats , * types.ContinuousBucket , types. ContinuousStats , types. ContinuousBucket ]{}
185
184
if err := c .client .RequestData (ctx , http .MethodGet , url , nil , nil , summary ); err != nil {
186
185
if request .IsErrorResourceNotFound (err ) {
187
186
return nil , nil
@@ -192,7 +191,7 @@ func (c *ClientImpl) GetContinuousSummary(ctx context.Context, userId string) (*
192
191
return summary , nil
193
192
}
194
193
195
- func (c * ClientImpl ) UpdateCGMSummary (ctx context.Context , userId string ) (* types.Summary [* types.CGMStats , types.CGMStats ], error ) {
194
+ func (c * ClientImpl ) UpdateCGMSummary (ctx context.Context , userId string ) (* types.Summary [* types.CGMStats , * types.GlucoseBucket , types. CGMStats , types. GlucoseBucket ], error ) {
196
195
if ctx == nil {
197
196
return nil , errors .New ("context is missing" )
198
197
}
@@ -201,7 +200,7 @@ func (c *ClientImpl) UpdateCGMSummary(ctx context.Context, userId string) (*type
201
200
}
202
201
203
202
url := c .client .ConstructURL ("v1" , "summaries" , "cgm" , userId )
204
- summary := & types.Summary [* types.CGMStats , types.CGMStats ]{}
203
+ summary := & types.Summary [* types.CGMStats , * types.GlucoseBucket , types. CGMStats , types. GlucoseBucket ]{}
205
204
if err := c .client .RequestData (ctx , http .MethodPost , url , nil , nil , summary ); err != nil {
206
205
if request .IsErrorResourceNotFound (err ) {
207
206
return nil , nil
@@ -212,7 +211,7 @@ func (c *ClientImpl) UpdateCGMSummary(ctx context.Context, userId string) (*type
212
211
return summary , nil
213
212
}
214
213
215
- func (c * ClientImpl ) UpdateBGMSummary (ctx context.Context , userId string ) (* types.Summary [* types.BGMStats , types.BGMStats ], error ) {
214
+ func (c * ClientImpl ) UpdateBGMSummary (ctx context.Context , userId string ) (* types.Summary [* types.BGMStats , * types.GlucoseBucket , types. BGMStats , types. GlucoseBucket ], error ) {
216
215
if ctx == nil {
217
216
return nil , errors .New ("context is missing" )
218
217
}
@@ -221,7 +220,7 @@ func (c *ClientImpl) UpdateBGMSummary(ctx context.Context, userId string) (*type
221
220
}
222
221
223
222
url := c .client .ConstructURL ("v1" , "summaries" , "bgm" , userId )
224
- summary := & types.Summary [* types.BGMStats , types.BGMStats ]{}
223
+ summary := & types.Summary [* types.BGMStats , * types.GlucoseBucket , types. BGMStats , types. GlucoseBucket ]{}
225
224
if err := c .client .RequestData (ctx , http .MethodPost , url , nil , nil , summary ); err != nil {
226
225
if request .IsErrorResourceNotFound (err ) {
227
226
return nil , nil
@@ -232,7 +231,7 @@ func (c *ClientImpl) UpdateBGMSummary(ctx context.Context, userId string) (*type
232
231
return summary , nil
233
232
}
234
233
235
- func (c * ClientImpl ) UpdateContinuousSummary (ctx context.Context , userId string ) (* types.Summary [* types.ContinuousStats , types.ContinuousStats ], error ) {
234
+ func (c * ClientImpl ) UpdateContinuousSummary (ctx context.Context , userId string ) (* types.Summary [* types.ContinuousStats , * types.ContinuousBucket , types. ContinuousStats , types. ContinuousBucket ], error ) {
236
235
if ctx == nil {
237
236
return nil , errors .New ("context is missing" )
238
237
}
@@ -241,7 +240,7 @@ func (c *ClientImpl) UpdateContinuousSummary(ctx context.Context, userId string)
241
240
}
242
241
243
242
url := c .client .ConstructURL ("v1" , "summaries" , "continuous" , userId )
244
- summary := & types.Summary [* types.ContinuousStats , types.ContinuousStats ]{}
243
+ summary := & types.Summary [* types.ContinuousStats , * types.ContinuousBucket , types. ContinuousStats , types. ContinuousBucket ]{}
245
244
if err := c .client .RequestData (ctx , http .MethodPost , url , nil , nil , summary ); err != nil {
246
245
if request .IsErrorResourceNotFound (err ) {
247
246
return nil , nil
@@ -252,19 +251,6 @@ func (c *ClientImpl) UpdateContinuousSummary(ctx context.Context, userId string)
252
251
return summary , nil
253
252
}
254
253
255
- func (c * ClientImpl ) BackfillSummaries (ctx context.Context , typ string ) (int , error ) {
256
- var count int
257
- url := c .client .ConstructURL ("v1" , "summaries" , "backfill" , typ )
258
-
259
- ctxWithTimeout , cancel := context .WithTimeout (ctx , ExtendedTimeout )
260
- defer cancel ()
261
- if err := c .client .RequestData (ctxWithTimeout , http .MethodPost , url , nil , nil , & count ); err != nil {
262
- return count , errors .Wrap (err , "backfill request returned an error" )
263
- }
264
-
265
- return count , nil
266
- }
267
-
268
254
func (c * ClientImpl ) GetOutdatedUserIDs (ctx context.Context , typ string , pagination * page.Pagination ) (* types.OutdatedSummariesResponse , error ) {
269
255
if ctx == nil {
270
256
return nil , errors .New ("context is missing" )
0 commit comments