-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
fcmdata-gen.go
745 lines (693 loc) · 32.9 KB
/
fcmdata-gen.go
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
// Copyright 2024 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package fcmdata provides access to the Firebase Cloud Messaging Data API.
//
// For product documentation, see: https://firebase.google.com/docs/cloud-messaging
//
// # Library status
//
// These client libraries are officially supported by Google. However, this
// library is considered complete and is in maintenance mode. This means
// that we will address critical bugs and security issues but will not add
// any new features.
//
// When possible, we recommend using our newer
// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
// that are still actively being worked and iterated on.
//
// # Creating a client
//
// Usage example:
//
// import "google.golang.org/api/fcmdata/v1beta1"
// ...
// ctx := context.Background()
// fcmdataService, err := fcmdata.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for
// authentication. For information on how to create and obtain Application
// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// # Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API
// keys), use [google.golang.org/api/option.WithAPIKey]:
//
// fcmdataService, err := fcmdata.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
// flow, use [google.golang.org/api/option.WithTokenSource]:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// fcmdataService, err := fcmdata.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See [google.golang.org/api/option.ClientOption] for details on options.
package fcmdata // import "google.golang.org/api/fcmdata/v1beta1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
internal "google.golang.org/api/internal"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
var _ = internal.Version
const apiId = "fcmdata:v1beta1"
const apiName = "fcmdata"
const apiVersion = "v1beta1"
const basePath = "https://fcmdata.googleapis.com/"
const basePathTemplate = "https://fcmdata.UNIVERSE_DOMAIN/"
const mtlsBasePath = "https://fcmdata.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// See, edit, configure, and delete your Google Cloud data and see the email
// address for your Google Account.
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := internaloption.WithDefaultScopes(
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
opts = append(opts, internaloption.EnableNewAuthLibrary())
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Projects = NewProjectsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Projects *ProjectsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.AndroidApps = NewProjectsAndroidAppsService(s)
return rs
}
type ProjectsService struct {
s *Service
AndroidApps *ProjectsAndroidAppsService
}
func NewProjectsAndroidAppsService(s *Service) *ProjectsAndroidAppsService {
rs := &ProjectsAndroidAppsService{s: s}
rs.DeliveryData = NewProjectsAndroidAppsDeliveryDataService(s)
return rs
}
type ProjectsAndroidAppsService struct {
s *Service
DeliveryData *ProjectsAndroidAppsDeliveryDataService
}
func NewProjectsAndroidAppsDeliveryDataService(s *Service) *ProjectsAndroidAppsDeliveryDataService {
rs := &ProjectsAndroidAppsDeliveryDataService{s: s}
return rs
}
type ProjectsAndroidAppsDeliveryDataService struct {
s *Service
}
// GoogleFirebaseFcmDataV1beta1AndroidDeliveryData: Message delivery data for a
// given date, app, and analytics label combination.
type GoogleFirebaseFcmDataV1beta1AndroidDeliveryData struct {
// AnalyticsLabel: The analytics label associated with the messages sent. All
// messages sent without an analytics label will be grouped together in a
// single entry.
AnalyticsLabel string `json:"analyticsLabel,omitempty"`
// AppId: The app ID to which the messages were sent.
AppId string `json:"appId,omitempty"`
// Data: The data for the specified appId, date, and analyticsLabel.
Data *GoogleFirebaseFcmDataV1beta1Data `json:"data,omitempty"`
// Date: The date represented by this entry.
Date *GoogleTypeDate `json:"date,omitempty"`
// ForceSendFields is a list of field names (e.g. "AnalyticsLabel") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AnalyticsLabel") to include in
// API requests with the JSON null value. By default, fields with empty values
// are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s GoogleFirebaseFcmDataV1beta1AndroidDeliveryData) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseFcmDataV1beta1AndroidDeliveryData
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseFcmDataV1beta1Data: Data detailing messaging delivery
type GoogleFirebaseFcmDataV1beta1Data struct {
// CountMessagesAccepted: Count of messages accepted by FCM intended for
// Android devices. The targeted device must have opted in to the collection of
// usage and diagnostic information.
CountMessagesAccepted int64 `json:"countMessagesAccepted,omitempty,string"`
// CountNotificationsAccepted: Count of notifications accepted by FCM intended
// for Android devices. The targeted device must have opted in to the
// collection of usage and diagnostic information.
CountNotificationsAccepted int64 `json:"countNotificationsAccepted,omitempty,string"`
// DeliveryPerformancePercents: Additional information about delivery
// performance for messages that were successfully delivered.
DeliveryPerformancePercents *GoogleFirebaseFcmDataV1beta1DeliveryPerformancePercents `json:"deliveryPerformancePercents,omitempty"`
// MessageInsightPercents: Additional general insights about message delivery.
MessageInsightPercents *GoogleFirebaseFcmDataV1beta1MessageInsightPercents `json:"messageInsightPercents,omitempty"`
// MessageOutcomePercents: Mutually exclusive breakdown of message delivery
// outcomes.
MessageOutcomePercents *GoogleFirebaseFcmDataV1beta1MessageOutcomePercents `json:"messageOutcomePercents,omitempty"`
// ProxyNotificationInsightPercents: Additional insights about proxy
// notification delivery.
ProxyNotificationInsightPercents *GoogleFirebaseFcmDataV1beta1ProxyNotificationInsightPercents `json:"proxyNotificationInsightPercents,omitempty"`
// ForceSendFields is a list of field names (e.g. "CountMessagesAccepted") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CountMessagesAccepted") to
// include in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s GoogleFirebaseFcmDataV1beta1Data) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseFcmDataV1beta1Data
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseFcmDataV1beta1DeliveryPerformancePercents: Overview of
// delivery performance for messages that were successfully delivered. All
// percentages are calculated with countMessagesAccepted as the denominator.
// These categories are not mutually exclusive; a message can be delayed for
// multiple reasons.
type GoogleFirebaseFcmDataV1beta1DeliveryPerformancePercents struct {
// DelayedDeviceDoze: The percentage of accepted messages that were delayed
// because the device was in doze mode. Only normal priority messages
// (https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message)
// should be delayed due to doze mode.
DelayedDeviceDoze float64 `json:"delayedDeviceDoze,omitempty"`
// DelayedDeviceOffline: The percentage of accepted messages that were delayed
// because the target device was not connected at the time of sending. These
// messages were eventually delivered when the device reconnected.
DelayedDeviceOffline float64 `json:"delayedDeviceOffline,omitempty"`
// DelayedMessageThrottled: The percentage of accepted messages that were
// delayed due to message throttling, such as collapsible message throttling
// (https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_throttling)
// or maximum message rate throttling
// (https://firebase.google.com/docs/cloud-messaging/concept-options#device_throttling).
DelayedMessageThrottled float64 `json:"delayedMessageThrottled,omitempty"`
// DelayedUserStopped: The percentage of accepted messages that were delayed
// because the intended device user-profile was stopped
// (https://firebase.google.com/docs/cloud-messaging/android/receive#handling_messages)
// on the target device at the time of the send. The messages were eventually
// delivered when the user-profile was started again.
DelayedUserStopped float64 `json:"delayedUserStopped,omitempty"`
// DeliveredNoDelay: The percentage of accepted messages that were delivered to
// the device without delay from the FCM system.
DeliveredNoDelay float64 `json:"deliveredNoDelay,omitempty"`
// ForceSendFields is a list of field names (e.g. "DelayedDeviceDoze") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DelayedDeviceDoze") to include in
// API requests with the JSON null value. By default, fields with empty values
// are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s GoogleFirebaseFcmDataV1beta1DeliveryPerformancePercents) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseFcmDataV1beta1DeliveryPerformancePercents
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *GoogleFirebaseFcmDataV1beta1DeliveryPerformancePercents) UnmarshalJSON(data []byte) error {
type NoMethod GoogleFirebaseFcmDataV1beta1DeliveryPerformancePercents
var s1 struct {
DelayedDeviceDoze gensupport.JSONFloat64 `json:"delayedDeviceDoze"`
DelayedDeviceOffline gensupport.JSONFloat64 `json:"delayedDeviceOffline"`
DelayedMessageThrottled gensupport.JSONFloat64 `json:"delayedMessageThrottled"`
DelayedUserStopped gensupport.JSONFloat64 `json:"delayedUserStopped"`
DeliveredNoDelay gensupport.JSONFloat64 `json:"deliveredNoDelay"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.DelayedDeviceDoze = float64(s1.DelayedDeviceDoze)
s.DelayedDeviceOffline = float64(s1.DelayedDeviceOffline)
s.DelayedMessageThrottled = float64(s1.DelayedMessageThrottled)
s.DelayedUserStopped = float64(s1.DelayedUserStopped)
s.DeliveredNoDelay = float64(s1.DeliveredNoDelay)
return nil
}
// GoogleFirebaseFcmDataV1beta1ListAndroidDeliveryDataResponse: Response
// message for ListAndroidDeliveryData.
type GoogleFirebaseFcmDataV1beta1ListAndroidDeliveryDataResponse struct {
// AndroidDeliveryData: The delivery data for the provided app. There will be
// one entry per combination of app, date, and analytics label.
AndroidDeliveryData []*GoogleFirebaseFcmDataV1beta1AndroidDeliveryData `json:"androidDeliveryData,omitempty"`
// NextPageToken: A token, which can be sent as `page_token` to retrieve the
// next page. If this field is omitted, there are no subsequent pages.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AndroidDeliveryData") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AndroidDeliveryData") to include
// in API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s GoogleFirebaseFcmDataV1beta1ListAndroidDeliveryDataResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseFcmDataV1beta1ListAndroidDeliveryDataResponse
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
// GoogleFirebaseFcmDataV1beta1MessageInsightPercents: Additional information
// about message delivery. All percentages are calculated with
// countMessagesAccepted as the denominator.
type GoogleFirebaseFcmDataV1beta1MessageInsightPercents struct {
// PriorityLowered: The percentage of accepted messages that had their priority
// lowered from high to normal. See documentation for setting message priority
// (https://firebase.google.com/docs/cloud-messaging/android/message-priority).
PriorityLowered float64 `json:"priorityLowered,omitempty"`
// ForceSendFields is a list of field names (e.g. "PriorityLowered") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "PriorityLowered") to include in
// API requests with the JSON null value. By default, fields with empty values
// are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s GoogleFirebaseFcmDataV1beta1MessageInsightPercents) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseFcmDataV1beta1MessageInsightPercents
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *GoogleFirebaseFcmDataV1beta1MessageInsightPercents) UnmarshalJSON(data []byte) error {
type NoMethod GoogleFirebaseFcmDataV1beta1MessageInsightPercents
var s1 struct {
PriorityLowered gensupport.JSONFloat64 `json:"priorityLowered"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.PriorityLowered = float64(s1.PriorityLowered)
return nil
}
// GoogleFirebaseFcmDataV1beta1MessageOutcomePercents: Percentage breakdown of
// message delivery outcomes. These categories are mutually exclusive. All
// percentages are calculated with countMessagesAccepted as the denominator.
// These categories may not account for all message outcomes.
type GoogleFirebaseFcmDataV1beta1MessageOutcomePercents struct {
// Collapsed: The percentage of accepted messages that were collapsed
// (https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages)
// by another message.
Collapsed float64 `json:"collapsed,omitempty"`
// Delivered: The percentage of all accepted messages that were successfully
// delivered to the device.
Delivered float64 `json:"delivered,omitempty"`
// DroppedAppForceStopped: The percentage of accepted messages that were
// dropped because the application was force stopped on the device at the time
// of delivery and retries were unsuccessful.
DroppedAppForceStopped float64 `json:"droppedAppForceStopped,omitempty"`
// DroppedDeviceInactive: The percentage of accepted messages that were dropped
// because the target device is inactive. FCM will drop messages if the target
// device is deemed inactive by our servers. If a device does reconnect, we
// call OnDeletedMessages()
// (https://firebase.google.com/docs/cloud-messaging/android/receive#override-ondeletedmessages)
// in our SDK instead of delivering the messages.
DroppedDeviceInactive float64 `json:"droppedDeviceInactive,omitempty"`
// DroppedTooManyPendingMessages: The percentage of accepted messages that were
// dropped due to too many undelivered non-collapsible messages
// (https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages).
// Specifically, each app instance can only have 100 pending messages stored on
// our servers for a device which is disconnected. When that device reconnects,
// those messages are delivered. When there are more than the maximum pending
// messages, we call OnDeletedMessages()
// (https://firebase.google.com/docs/cloud-messaging/android/receive#override-ondeletedmessages)
// in our SDK instead of delivering the messages.
DroppedTooManyPendingMessages float64 `json:"droppedTooManyPendingMessages,omitempty"`
// DroppedTtlExpired: The percentage of accepted messages that expired because
// Time To Live (TTL)
// (https://firebase.google.com/docs/cloud-messaging/concept-options#ttl)
// elapsed before the target device reconnected.
DroppedTtlExpired float64 `json:"droppedTtlExpired,omitempty"`
// Pending: The percentage of messages accepted on this day that were not
// dropped and not delivered, due to the device being disconnected (as of the
// end of the America/Los_Angeles day when the message was sent to FCM). A
// portion of these messages will be delivered the next day when the device
// connects but others may be destined to devices that ultimately never
// reconnect.
Pending float64 `json:"pending,omitempty"`
// ForceSendFields is a list of field names (e.g. "Collapsed") to
// unconditionally include in API requests. By default, fields with empty or
// default values are omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Collapsed") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s GoogleFirebaseFcmDataV1beta1MessageOutcomePercents) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseFcmDataV1beta1MessageOutcomePercents
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *GoogleFirebaseFcmDataV1beta1MessageOutcomePercents) UnmarshalJSON(data []byte) error {
type NoMethod GoogleFirebaseFcmDataV1beta1MessageOutcomePercents
var s1 struct {
Collapsed gensupport.JSONFloat64 `json:"collapsed"`
Delivered gensupport.JSONFloat64 `json:"delivered"`
DroppedAppForceStopped gensupport.JSONFloat64 `json:"droppedAppForceStopped"`
DroppedDeviceInactive gensupport.JSONFloat64 `json:"droppedDeviceInactive"`
DroppedTooManyPendingMessages gensupport.JSONFloat64 `json:"droppedTooManyPendingMessages"`
DroppedTtlExpired gensupport.JSONFloat64 `json:"droppedTtlExpired"`
Pending gensupport.JSONFloat64 `json:"pending"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Collapsed = float64(s1.Collapsed)
s.Delivered = float64(s1.Delivered)
s.DroppedAppForceStopped = float64(s1.DroppedAppForceStopped)
s.DroppedDeviceInactive = float64(s1.DroppedDeviceInactive)
s.DroppedTooManyPendingMessages = float64(s1.DroppedTooManyPendingMessages)
s.DroppedTtlExpired = float64(s1.DroppedTtlExpired)
s.Pending = float64(s1.Pending)
return nil
}
// GoogleFirebaseFcmDataV1beta1ProxyNotificationInsightPercents: Additional
// information about proxy notification
// (https://firebase.google.com/docs/cloud-messaging/android/message-priority#proxy)
// delivery. All percentages are calculated with countNotificationsAccepted as
// the denominator.
type GoogleFirebaseFcmDataV1beta1ProxyNotificationInsightPercents struct {
// Failed: The percentage of accepted notifications that failed to be proxied.
// This is usually caused by exceptions that occurred while calling
// notifyAsPackage
// (https://developer.android.com/reference/android/app/NotificationManager#notifyAsPackage%28java.lang.String,%20java.lang.String,%20int,%20android.app.Notification%29).
Failed float64 `json:"failed,omitempty"`
// Proxied: The percentage of accepted notifications that were successfully
// proxied by Google Play services
// (https://developers.google.com/android/guides/overview).
Proxied float64 `json:"proxied,omitempty"`
// SkippedNotThrottled: The percentage of accepted notifications that were
// skipped because the messages were not throttled.
SkippedNotThrottled float64 `json:"skippedNotThrottled,omitempty"`
// SkippedOptedOut: The percentage of accepted notifications that were skipped
// because the app disallowed these messages to be proxied.
SkippedOptedOut float64 `json:"skippedOptedOut,omitempty"`
// SkippedUnconfigured: The percentage of accepted notifications that were
// skipped because configurations required for notifications to be proxied were
// missing.
SkippedUnconfigured float64 `json:"skippedUnconfigured,omitempty"`
// SkippedUnsupported: The percentage of accepted notifications that were
// skipped because proxy notification is unsupported for the recipient.
SkippedUnsupported float64 `json:"skippedUnsupported,omitempty"`
// ForceSendFields is a list of field names (e.g. "Failed") to unconditionally
// include in API requests. By default, fields with empty or default values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Failed") to include in API
// requests with the JSON null value. By default, fields with empty values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s GoogleFirebaseFcmDataV1beta1ProxyNotificationInsightPercents) MarshalJSON() ([]byte, error) {
type NoMethod GoogleFirebaseFcmDataV1beta1ProxyNotificationInsightPercents
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
func (s *GoogleFirebaseFcmDataV1beta1ProxyNotificationInsightPercents) UnmarshalJSON(data []byte) error {
type NoMethod GoogleFirebaseFcmDataV1beta1ProxyNotificationInsightPercents
var s1 struct {
Failed gensupport.JSONFloat64 `json:"failed"`
Proxied gensupport.JSONFloat64 `json:"proxied"`
SkippedNotThrottled gensupport.JSONFloat64 `json:"skippedNotThrottled"`
SkippedOptedOut gensupport.JSONFloat64 `json:"skippedOptedOut"`
SkippedUnconfigured gensupport.JSONFloat64 `json:"skippedUnconfigured"`
SkippedUnsupported gensupport.JSONFloat64 `json:"skippedUnsupported"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Failed = float64(s1.Failed)
s.Proxied = float64(s1.Proxied)
s.SkippedNotThrottled = float64(s1.SkippedNotThrottled)
s.SkippedOptedOut = float64(s1.SkippedOptedOut)
s.SkippedUnconfigured = float64(s1.SkippedUnconfigured)
s.SkippedUnsupported = float64(s1.SkippedUnsupported)
return nil
}
// GoogleTypeDate: Represents a whole or partial calendar date, such as a
// birthday. The time of day and time zone are either specified elsewhere or
// are insignificant. The date is relative to the Gregorian Calendar. This can
// represent one of the following: * A full date, with non-zero year, month,
// and day values. * A month and day, with a zero year (for example, an
// anniversary). * A year on its own, with a zero month and a zero day. * A
// year and month, with a zero day (for example, a credit card expiration
// date). Related types: * google.type.TimeOfDay * google.type.DateTime *
// google.protobuf.Timestamp
type GoogleTypeDate struct {
// Day: Day of a month. Must be from 1 to 31 and valid for the year and month,
// or 0 to specify a year by itself or a year and month where the day isn't
// significant.
Day int64 `json:"day,omitempty"`
// Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without
// a month and day.
Month int64 `json:"month,omitempty"`
// Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date
// without a year.
Year int64 `json:"year,omitempty"`
// ForceSendFields is a list of field names (e.g. "Day") to unconditionally
// include in API requests. By default, fields with empty or default values are
// omitted from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
// details.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Day") to include in API requests
// with the JSON null value. By default, fields with empty values are omitted
// from API requests. See
// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
NullFields []string `json:"-"`
}
func (s GoogleTypeDate) MarshalJSON() ([]byte, error) {
type NoMethod GoogleTypeDate
return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}
type ProjectsAndroidAppsDeliveryDataListCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: List aggregate delivery data for the given Android application.
//
// - parent: The application for which to list delivery data. Format:
// `projects/{project_id}/androidApps/{app_id}`.
func (r *ProjectsAndroidAppsDeliveryDataService) List(parent string) *ProjectsAndroidAppsDeliveryDataListCall {
c := &ProjectsAndroidAppsDeliveryDataListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// PageSize sets the optional parameter "pageSize": The maximum number of
// entries to return. The service may return fewer than this value. If
// unspecified, at most 1,000 entries will be returned. The maximum value is
// 10,000; values above 10,000 will be capped to 10,000. This default may
// change over time.
func (c *ProjectsAndroidAppsDeliveryDataListCall) PageSize(pageSize int64) *ProjectsAndroidAppsDeliveryDataListCall {
c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
return c
}
// PageToken sets the optional parameter "pageToken": A page token, received
// from a previous `ListAndroidDeliveryDataRequest` call. Provide this to
// retrieve the subsequent page. When paginating, all other parameters provided
// to `ListAndroidDeliveryDataRequest` must match the call that provided the
// page token.
func (c *ProjectsAndroidAppsDeliveryDataListCall) PageToken(pageToken string) *ProjectsAndroidAppsDeliveryDataListCall {
c.urlParams_.Set("pageToken", pageToken)
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *ProjectsAndroidAppsDeliveryDataListCall) Fields(s ...googleapi.Field) *ProjectsAndroidAppsDeliveryDataListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *ProjectsAndroidAppsDeliveryDataListCall) IfNoneMatch(entityTag string) *ProjectsAndroidAppsDeliveryDataListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method.
func (c *ProjectsAndroidAppsDeliveryDataListCall) Context(ctx context.Context) *ProjectsAndroidAppsDeliveryDataListCall {
c.ctx_ = ctx
return c
}
// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *ProjectsAndroidAppsDeliveryDataListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsAndroidAppsDeliveryDataListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/deliveryData")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "fcmdata.projects.androidApps.deliveryData.list" call.
// Any non-2xx status code is an error. Response headers are in either
// *GoogleFirebaseFcmDataV1beta1ListAndroidDeliveryDataResponse.ServerResponse.H
// eader or (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was returned.
func (c *ProjectsAndroidAppsDeliveryDataListCall) Do(opts ...googleapi.CallOption) (*GoogleFirebaseFcmDataV1beta1ListAndroidDeliveryDataResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, gensupport.WrapError(&googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
})
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, gensupport.WrapError(err)
}
ret := &GoogleFirebaseFcmDataV1beta1ListAndroidDeliveryDataResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
}
// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *ProjectsAndroidAppsDeliveryDataListCall) Pages(ctx context.Context, f func(*GoogleFirebaseFcmDataV1beta1ListAndroidDeliveryDataResponse) error) error {
c.ctx_ = ctx
defer c.PageToken(c.urlParams_.Get("pageToken"))
for {
x, err := c.Do()
if err != nil {
return err
}
if err := f(x); err != nil {
return err
}
if x.NextPageToken == "" {
return nil
}
c.PageToken(x.NextPageToken)
}
}