1// Copyright 2020 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package alertcenter provides access to the G Suite Alert Center API. 8// 9// For product documentation, see: https://developers.google.com/admin-sdk/alertcenter/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/alertcenter/v1beta1" 16// ... 17// ctx := context.Background() 18// alertcenterService, err := alertcenter.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// alertcenterService, err := alertcenter.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// alertcenterService, err := alertcenter.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package alertcenter // import "google.golang.org/api/alertcenter/v1beta1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "alertcenter:v1beta1" 75const apiName = "alertcenter" 76const apiVersion = "v1beta1" 77const basePath = "https://alertcenter.googleapis.com/" 78const mtlsBasePath = "https://alertcenter.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // See and delete your domain's G Suite alerts, and send alert feedback 83 AppsAlertsScope = "https://www.googleapis.com/auth/apps.alerts" 84) 85 86// NewService creates a new Service. 87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 88 scopesOption := option.WithScopes( 89 "https://www.googleapis.com/auth/apps.alerts", 90 ) 91 // NOTE: prepend, so we don't override user-specified scopes. 92 opts = append([]option.ClientOption{scopesOption}, opts...) 93 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 94 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 95 client, endpoint, err := htransport.NewClient(ctx, opts...) 96 if err != nil { 97 return nil, err 98 } 99 s, err := New(client) 100 if err != nil { 101 return nil, err 102 } 103 if endpoint != "" { 104 s.BasePath = endpoint 105 } 106 return s, nil 107} 108 109// New creates a new Service. It uses the provided http.Client for requests. 110// 111// Deprecated: please use NewService instead. 112// To provide a custom HTTP client, use option.WithHTTPClient. 113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 114func New(client *http.Client) (*Service, error) { 115 if client == nil { 116 return nil, errors.New("client is nil") 117 } 118 s := &Service{client: client, BasePath: basePath} 119 s.Alerts = NewAlertsService(s) 120 s.V1beta1 = NewV1beta1Service(s) 121 return s, nil 122} 123 124type Service struct { 125 client *http.Client 126 BasePath string // API endpoint base URL 127 UserAgent string // optional additional User-Agent fragment 128 129 Alerts *AlertsService 130 131 V1beta1 *V1beta1Service 132} 133 134func (s *Service) userAgent() string { 135 if s.UserAgent == "" { 136 return googleapi.UserAgent 137 } 138 return googleapi.UserAgent + " " + s.UserAgent 139} 140 141func NewAlertsService(s *Service) *AlertsService { 142 rs := &AlertsService{s: s} 143 rs.Feedback = NewAlertsFeedbackService(s) 144 return rs 145} 146 147type AlertsService struct { 148 s *Service 149 150 Feedback *AlertsFeedbackService 151} 152 153func NewAlertsFeedbackService(s *Service) *AlertsFeedbackService { 154 rs := &AlertsFeedbackService{s: s} 155 return rs 156} 157 158type AlertsFeedbackService struct { 159 s *Service 160} 161 162func NewV1beta1Service(s *Service) *V1beta1Service { 163 rs := &V1beta1Service{s: s} 164 return rs 165} 166 167type V1beta1Service struct { 168 s *Service 169} 170 171// AccountWarning: Alerts for user account warning events. 172type AccountWarning struct { 173 // Email: Required. The email of the user that this event belongs to. 174 Email string `json:"email,omitempty"` 175 176 // LoginDetails: Optional. Details of the login action associated with 177 // the warning event. 178 // This is only available for: 179 // 180 // * Suspicious login 181 // * Suspicious login (less secure app) 182 // * Suspicious programmatic login 183 // * User suspended (suspicious activity) 184 LoginDetails *LoginDetails `json:"loginDetails,omitempty"` 185 186 // ForceSendFields is a list of field names (e.g. "Email") to 187 // unconditionally include in API requests. By default, fields with 188 // empty values are omitted from API requests. However, any non-pointer, 189 // non-interface field appearing in ForceSendFields will be sent to the 190 // server regardless of whether the field is empty or not. This may be 191 // used to include empty fields in Patch requests. 192 ForceSendFields []string `json:"-"` 193 194 // NullFields is a list of field names (e.g. "Email") to include in API 195 // requests with the JSON null value. By default, fields with empty 196 // values are omitted from API requests. However, any field with an 197 // empty value appearing in NullFields will be sent to the server as 198 // null. It is an error if a field in this list has a non-empty value. 199 // This may be used to include null fields in Patch requests. 200 NullFields []string `json:"-"` 201} 202 203func (s *AccountWarning) MarshalJSON() ([]byte, error) { 204 type NoMethod AccountWarning 205 raw := NoMethod(*s) 206 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 207} 208 209// ActivityRule: Alerts from G Suite Security Center rules service 210// configured by admin. 211type ActivityRule struct { 212 // ActionNames: List of action names associated with the rule threshold. 213 ActionNames []string `json:"actionNames,omitempty"` 214 215 // CreateTime: Rule create timestamp. 216 CreateTime string `json:"createTime,omitempty"` 217 218 // Description: Description of the rule. 219 Description string `json:"description,omitempty"` 220 221 // DisplayName: Alert display name. 222 DisplayName string `json:"displayName,omitempty"` 223 224 // Name: Rule name. 225 Name string `json:"name,omitempty"` 226 227 // Query: Query that is used to get the data from the associated source. 228 Query string `json:"query,omitempty"` 229 230 // SupersededAlerts: List of alert IDs superseded by this alert. It is 231 // used to indicate that 232 // this alert is essentially extension of superseded alerts and we found 233 // the 234 // relationship after creating these alerts. 235 SupersededAlerts []string `json:"supersededAlerts,omitempty"` 236 237 // SupersedingAlert: Alert ID superseding this alert. It is used to 238 // indicate that superseding 239 // alert is essentially extension of this alert and we found the 240 // relationship 241 // after creating both alerts. 242 SupersedingAlert string `json:"supersedingAlert,omitempty"` 243 244 // Threshold: Alert threshold is for example “COUNT > 5”. 245 Threshold string `json:"threshold,omitempty"` 246 247 // TriggerSource: The trigger sources for this rule. 248 // 249 // * GMAIL_EVENTS 250 // * DEVICE_EVENTS 251 // * USER_EVENTS 252 TriggerSource string `json:"triggerSource,omitempty"` 253 254 // UpdateTime: The timestamp of the last update to the rule. 255 UpdateTime string `json:"updateTime,omitempty"` 256 257 // WindowSize: Rule window size. Possible values are 1 hour or 24 hours. 258 WindowSize string `json:"windowSize,omitempty"` 259 260 // ForceSendFields is a list of field names (e.g. "ActionNames") to 261 // unconditionally include in API requests. By default, fields with 262 // empty values are omitted from API requests. However, any non-pointer, 263 // non-interface field appearing in ForceSendFields will be sent to the 264 // server regardless of whether the field is empty or not. This may be 265 // used to include empty fields in Patch requests. 266 ForceSendFields []string `json:"-"` 267 268 // NullFields is a list of field names (e.g. "ActionNames") to include 269 // in API requests with the JSON null value. By default, fields with 270 // empty values are omitted from API requests. However, any field with 271 // an empty value appearing in NullFields will be sent to the server as 272 // null. It is an error if a field in this list has a non-empty value. 273 // This may be used to include null fields in Patch requests. 274 NullFields []string `json:"-"` 275} 276 277func (s *ActivityRule) MarshalJSON() ([]byte, error) { 278 type NoMethod ActivityRule 279 raw := NoMethod(*s) 280 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 281} 282 283// Alert: An alert affecting a customer. 284type Alert struct { 285 // AlertId: Output only. The unique identifier for the alert. 286 AlertId string `json:"alertId,omitempty"` 287 288 // CreateTime: Output only. The time this alert was created. 289 CreateTime string `json:"createTime,omitempty"` 290 291 // CustomerId: Output only. The unique identifier of the Google account 292 // of the customer. 293 CustomerId string `json:"customerId,omitempty"` 294 295 // Data: Optional. The data associated with this alert, for 296 // example 297 // google.apps.alertcenter.type.DeviceCompromised. 298 Data googleapi.RawMessage `json:"data,omitempty"` 299 300 // Deleted: Output only. `True` if this alert is marked for deletion. 301 Deleted bool `json:"deleted,omitempty"` 302 303 // EndTime: Optional. The time the event that caused this alert ceased 304 // being active. 305 // If provided, the end time must not be earlier than the start time. 306 // If not provided, it indicates an ongoing alert. 307 EndTime string `json:"endTime,omitempty"` 308 309 // Etag: Optional. `etag` is used for optimistic concurrency control as 310 // a way to help 311 // prevent simultaneous updates of an alert from overwriting each 312 // other. 313 // It is strongly suggested that systems make use of the `etag` in 314 // the 315 // read-modify-write cycle to perform alert updates in order to avoid 316 // race 317 // conditions: An `etag` is returned in the response which contains 318 // alerts, 319 // and systems are expected to put that etag in the request to update 320 // alert to 321 // ensure that their change will be applied to the same version of the 322 // alert. 323 // 324 // If no `etag` is provided in the call to update alert, then the 325 // existing 326 // alert is overwritten blindly. 327 Etag string `json:"etag,omitempty"` 328 329 // Metadata: Output only. The metadata associated with this alert. 330 Metadata *AlertMetadata `json:"metadata,omitempty"` 331 332 // SecurityInvestigationToolLink: Output only. An optional 333 // [Security Investigation 334 // Tool](https://support.google.com/a/answer/7575955) 335 // query for this alert. 336 SecurityInvestigationToolLink string `json:"securityInvestigationToolLink,omitempty"` 337 338 // Source: Required. A unique identifier for the system that reported 339 // the alert. 340 // This is output only after alert is created. 341 // 342 // Supported sources are any of the following: 343 // 344 // * Google Operations 345 // * Mobile device management 346 // * Gmail phishing 347 // * Domain wide takeout 348 // * State sponsored attack 349 // * Google identity 350 Source string `json:"source,omitempty"` 351 352 // StartTime: Required. The time the event that caused this alert was 353 // started or 354 // detected. 355 StartTime string `json:"startTime,omitempty"` 356 357 // Type: Required. The type of the alert. 358 // This is output only after alert is created. 359 // For a list of available alert types see 360 // [G Suite Alert types](/admin-sdk/alertcenter/reference/alert-types). 361 Type string `json:"type,omitempty"` 362 363 // UpdateTime: Output only. The time this alert was last updated. 364 UpdateTime string `json:"updateTime,omitempty"` 365 366 // ServerResponse contains the HTTP response code and headers from the 367 // server. 368 googleapi.ServerResponse `json:"-"` 369 370 // ForceSendFields is a list of field names (e.g. "AlertId") to 371 // unconditionally include in API requests. By default, fields with 372 // empty values are omitted from API requests. However, any non-pointer, 373 // non-interface field appearing in ForceSendFields will be sent to the 374 // server regardless of whether the field is empty or not. This may be 375 // used to include empty fields in Patch requests. 376 ForceSendFields []string `json:"-"` 377 378 // NullFields is a list of field names (e.g. "AlertId") to include in 379 // API requests with the JSON null value. By default, fields with empty 380 // values are omitted from API requests. However, any field with an 381 // empty value appearing in NullFields will be sent to the server as 382 // null. It is an error if a field in this list has a non-empty value. 383 // This may be used to include null fields in Patch requests. 384 NullFields []string `json:"-"` 385} 386 387func (s *Alert) MarshalJSON() ([]byte, error) { 388 type NoMethod Alert 389 raw := NoMethod(*s) 390 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 391} 392 393// AlertFeedback: A customer feedback about an alert. 394type AlertFeedback struct { 395 // AlertId: Output only. The alert identifier. 396 AlertId string `json:"alertId,omitempty"` 397 398 // CreateTime: Output only. The time this feedback was created. 399 CreateTime string `json:"createTime,omitempty"` 400 401 // CustomerId: Output only. The unique identifier of the Google account 402 // of the customer. 403 CustomerId string `json:"customerId,omitempty"` 404 405 // Email: Output only. The email of the user that provided the feedback. 406 Email string `json:"email,omitempty"` 407 408 // FeedbackId: Output only. The unique identifier for the feedback. 409 FeedbackId string `json:"feedbackId,omitempty"` 410 411 // Type: Required. The type of the feedback. 412 // 413 // Possible values: 414 // "ALERT_FEEDBACK_TYPE_UNSPECIFIED" - The feedback type is not 415 // specified. 416 // "NOT_USEFUL" - The alert report is not useful. 417 // "SOMEWHAT_USEFUL" - The alert report is somewhat useful. 418 // "VERY_USEFUL" - The alert report is very useful. 419 Type string `json:"type,omitempty"` 420 421 // ServerResponse contains the HTTP response code and headers from the 422 // server. 423 googleapi.ServerResponse `json:"-"` 424 425 // ForceSendFields is a list of field names (e.g. "AlertId") to 426 // unconditionally include in API requests. By default, fields with 427 // empty values are omitted from API requests. However, any non-pointer, 428 // non-interface field appearing in ForceSendFields will be sent to the 429 // server regardless of whether the field is empty or not. This may be 430 // used to include empty fields in Patch requests. 431 ForceSendFields []string `json:"-"` 432 433 // NullFields is a list of field names (e.g. "AlertId") to include in 434 // API requests with the JSON null value. By default, fields with empty 435 // values are omitted from API requests. However, any field with an 436 // empty value appearing in NullFields will be sent to the server as 437 // null. It is an error if a field in this list has a non-empty value. 438 // This may be used to include null fields in Patch requests. 439 NullFields []string `json:"-"` 440} 441 442func (s *AlertFeedback) MarshalJSON() ([]byte, error) { 443 type NoMethod AlertFeedback 444 raw := NoMethod(*s) 445 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 446} 447 448// AlertMetadata: An alert metadata. 449type AlertMetadata struct { 450 // AlertId: Output only. The alert identifier. 451 AlertId string `json:"alertId,omitempty"` 452 453 // Assignee: The email address of the user assigned to the alert. 454 Assignee string `json:"assignee,omitempty"` 455 456 // CustomerId: Output only. The unique identifier of the Google account 457 // of the customer. 458 CustomerId string `json:"customerId,omitempty"` 459 460 // Etag: Optional. `etag` is used for optimistic concurrency control as 461 // a way to 462 // help prevent simultaneous updates of an alert metadata from 463 // overwriting 464 // each other. It is strongly suggested that systems make use of the 465 // `etag` in 466 // the read-modify-write cycle to perform metatdata updates in order to 467 // avoid 468 // race conditions: An `etag` is returned in the response which contains 469 // alert 470 // metadata, and systems are expected to put that etag in the request 471 // to 472 // update alert metadata to ensure that their change will be applied to 473 // the 474 // same version of the alert metadata. 475 // 476 // If no `etag` is provided in the call to update alert metadata, then 477 // the 478 // existing alert metadata is overwritten blindly. 479 Etag string `json:"etag,omitempty"` 480 481 // Severity: The severity value of the alert. Alert Center will set this 482 // field at alert 483 // creation time, default's to an empty string when it could not 484 // be 485 // determined. 486 // The supported values for update actions on this field are the 487 // following: 488 // 489 // * HIGH 490 // * MEDIUM 491 // * LOW 492 Severity string `json:"severity,omitempty"` 493 494 // Status: The current status of the alert. 495 // The supported values are the following: 496 // 497 // * NOT_STARTED 498 // * IN_PROGRESS 499 // * CLOSED 500 Status string `json:"status,omitempty"` 501 502 // UpdateTime: Output only. The time this metadata was last updated. 503 UpdateTime string `json:"updateTime,omitempty"` 504 505 // ServerResponse contains the HTTP response code and headers from the 506 // server. 507 googleapi.ServerResponse `json:"-"` 508 509 // ForceSendFields is a list of field names (e.g. "AlertId") to 510 // unconditionally include in API requests. By default, fields with 511 // empty values are omitted from API requests. However, any non-pointer, 512 // non-interface field appearing in ForceSendFields will be sent to the 513 // server regardless of whether the field is empty or not. This may be 514 // used to include empty fields in Patch requests. 515 ForceSendFields []string `json:"-"` 516 517 // NullFields is a list of field names (e.g. "AlertId") to include in 518 // API requests with the JSON null value. By default, fields with empty 519 // values are omitted from API requests. However, any field with an 520 // empty value appearing in NullFields will be sent to the server as 521 // null. It is an error if a field in this list has a non-empty value. 522 // This may be used to include null fields in Patch requests. 523 NullFields []string `json:"-"` 524} 525 526func (s *AlertMetadata) MarshalJSON() ([]byte, error) { 527 type NoMethod AlertMetadata 528 raw := NoMethod(*s) 529 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 530} 531 532// AppMakerSqlSetupNotification: Alerts from App Maker to notify admins 533// to set up default SQL instance. 534type AppMakerSqlSetupNotification struct { 535 // RequestInfo: List of applications with requests for default SQL set 536 // up. 537 RequestInfo []*RequestInfo `json:"requestInfo,omitempty"` 538 539 // ForceSendFields is a list of field names (e.g. "RequestInfo") to 540 // unconditionally include in API requests. By default, fields with 541 // empty values are omitted from API requests. However, any non-pointer, 542 // non-interface field appearing in ForceSendFields will be sent to the 543 // server regardless of whether the field is empty or not. This may be 544 // used to include empty fields in Patch requests. 545 ForceSendFields []string `json:"-"` 546 547 // NullFields is a list of field names (e.g. "RequestInfo") to include 548 // in API requests with the JSON null value. By default, fields with 549 // empty values are omitted from API requests. However, any field with 550 // an empty value appearing in NullFields will be sent to the server as 551 // null. It is an error if a field in this list has a non-empty value. 552 // This may be used to include null fields in Patch requests. 553 NullFields []string `json:"-"` 554} 555 556func (s *AppMakerSqlSetupNotification) MarshalJSON() ([]byte, error) { 557 type NoMethod AppMakerSqlSetupNotification 558 raw := NoMethod(*s) 559 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 560} 561 562// Attachment: Attachment with application-specific information about an 563// alert. 564type Attachment struct { 565 // Csv: A CSV file attachment. 566 Csv *Csv `json:"csv,omitempty"` 567 568 // ForceSendFields is a list of field names (e.g. "Csv") to 569 // unconditionally include in API requests. By default, fields with 570 // empty values are omitted from API requests. However, any non-pointer, 571 // non-interface field appearing in ForceSendFields will be sent to the 572 // server regardless of whether the field is empty or not. This may be 573 // used to include empty fields in Patch requests. 574 ForceSendFields []string `json:"-"` 575 576 // NullFields is a list of field names (e.g. "Csv") to include in API 577 // requests with the JSON null value. By default, fields with empty 578 // values are omitted from API requests. However, any field with an 579 // empty value appearing in NullFields will be sent to the server as 580 // null. It is an error if a field in this list has a non-empty value. 581 // This may be used to include null fields in Patch requests. 582 NullFields []string `json:"-"` 583} 584 585func (s *Attachment) MarshalJSON() ([]byte, error) { 586 type NoMethod Attachment 587 raw := NoMethod(*s) 588 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 589} 590 591// BadWhitelist: Alert for setting the domain or IP that malicious email 592// comes from as 593// whitelisted domain or IP in Gmail advanced settings. 594type BadWhitelist struct { 595 // DomainId: The domain ID. 596 DomainId *DomainId `json:"domainId,omitempty"` 597 598 // MaliciousEntity: The entity whose actions triggered a Gmail phishing 599 // alert. 600 MaliciousEntity *MaliciousEntity `json:"maliciousEntity,omitempty"` 601 602 // Messages: The list of messages contained by this alert. 603 Messages []*GmailMessageInfo `json:"messages,omitempty"` 604 605 // SourceIp: The source IP address of the malicious email, for 606 // example, 607 // `127.0.0.1`. 608 SourceIp string `json:"sourceIp,omitempty"` 609 610 // ForceSendFields is a list of field names (e.g. "DomainId") to 611 // unconditionally include in API requests. By default, fields with 612 // empty values are omitted from API requests. However, any non-pointer, 613 // non-interface field appearing in ForceSendFields will be sent to the 614 // server regardless of whether the field is empty or not. This may be 615 // used to include empty fields in Patch requests. 616 ForceSendFields []string `json:"-"` 617 618 // NullFields is a list of field names (e.g. "DomainId") to include in 619 // API requests with the JSON null value. By default, fields with empty 620 // values are omitted from API requests. However, any field with an 621 // empty value appearing in NullFields will be sent to the server as 622 // null. It is an error if a field in this list has a non-empty value. 623 // This may be used to include null fields in Patch requests. 624 NullFields []string `json:"-"` 625} 626 627func (s *BadWhitelist) MarshalJSON() ([]byte, error) { 628 type NoMethod BadWhitelist 629 raw := NoMethod(*s) 630 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 631} 632 633// BatchDeleteAlertsRequest: A request to perform batch delete on 634// alerts. 635type BatchDeleteAlertsRequest struct { 636 // AlertId: Required. list of alert IDs. 637 AlertId []string `json:"alertId,omitempty"` 638 639 // CustomerId: Optional. The unique identifier of the G Suite 640 // organization account of the 641 // customer the alerts are associated with. 642 CustomerId string `json:"customerId,omitempty"` 643 644 // ForceSendFields is a list of field names (e.g. "AlertId") to 645 // unconditionally include in API requests. By default, fields with 646 // empty values are omitted from API requests. However, any non-pointer, 647 // non-interface field appearing in ForceSendFields will be sent to the 648 // server regardless of whether the field is empty or not. This may be 649 // used to include empty fields in Patch requests. 650 ForceSendFields []string `json:"-"` 651 652 // NullFields is a list of field names (e.g. "AlertId") to include in 653 // API requests with the JSON null value. By default, fields with empty 654 // values are omitted from API requests. However, any field with an 655 // empty value appearing in NullFields will be sent to the server as 656 // null. It is an error if a field in this list has a non-empty value. 657 // This may be used to include null fields in Patch requests. 658 NullFields []string `json:"-"` 659} 660 661func (s *BatchDeleteAlertsRequest) MarshalJSON() ([]byte, error) { 662 type NoMethod BatchDeleteAlertsRequest 663 raw := NoMethod(*s) 664 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 665} 666 667// BatchDeleteAlertsResponse: Response to batch delete operation on 668// alerts. 669type BatchDeleteAlertsResponse struct { 670 // FailedAlertStatus: The status details for each failed alert_id. 671 FailedAlertStatus map[string]Status `json:"failedAlertStatus,omitempty"` 672 673 // SuccessAlertIds: The successful list of alert IDs. 674 SuccessAlertIds []string `json:"successAlertIds,omitempty"` 675 676 // ServerResponse contains the HTTP response code and headers from the 677 // server. 678 googleapi.ServerResponse `json:"-"` 679 680 // ForceSendFields is a list of field names (e.g. "FailedAlertStatus") 681 // to unconditionally include in API requests. By default, fields with 682 // empty values are omitted from API requests. However, any non-pointer, 683 // non-interface field appearing in ForceSendFields will be sent to the 684 // server regardless of whether the field is empty or not. This may be 685 // used to include empty fields in Patch requests. 686 ForceSendFields []string `json:"-"` 687 688 // NullFields is a list of field names (e.g. "FailedAlertStatus") to 689 // include in API requests with the JSON null value. By default, fields 690 // with empty values are omitted from API requests. However, any field 691 // with an empty value appearing in NullFields will be sent to the 692 // server as null. It is an error if a field in this list has a 693 // non-empty value. This may be used to include null fields in Patch 694 // requests. 695 NullFields []string `json:"-"` 696} 697 698func (s *BatchDeleteAlertsResponse) MarshalJSON() ([]byte, error) { 699 type NoMethod BatchDeleteAlertsResponse 700 raw := NoMethod(*s) 701 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 702} 703 704// BatchUndeleteAlertsRequest: A request to perform batch undelete on 705// alerts. 706type BatchUndeleteAlertsRequest struct { 707 // AlertId: Required. list of alert IDs. 708 AlertId []string `json:"alertId,omitempty"` 709 710 // CustomerId: Optional. The unique identifier of the G Suite 711 // organization account of the 712 // customer the alerts are associated with. 713 CustomerId string `json:"customerId,omitempty"` 714 715 // ForceSendFields is a list of field names (e.g. "AlertId") to 716 // unconditionally include in API requests. By default, fields with 717 // empty values are omitted from API requests. However, any non-pointer, 718 // non-interface field appearing in ForceSendFields will be sent to the 719 // server regardless of whether the field is empty or not. This may be 720 // used to include empty fields in Patch requests. 721 ForceSendFields []string `json:"-"` 722 723 // NullFields is a list of field names (e.g. "AlertId") to include in 724 // API requests with the JSON null value. By default, fields with empty 725 // values are omitted from API requests. However, any field with an 726 // empty value appearing in NullFields will be sent to the server as 727 // null. It is an error if a field in this list has a non-empty value. 728 // This may be used to include null fields in Patch requests. 729 NullFields []string `json:"-"` 730} 731 732func (s *BatchUndeleteAlertsRequest) MarshalJSON() ([]byte, error) { 733 type NoMethod BatchUndeleteAlertsRequest 734 raw := NoMethod(*s) 735 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 736} 737 738// BatchUndeleteAlertsResponse: Response to batch undelete operation on 739// alerts. 740type BatchUndeleteAlertsResponse struct { 741 // FailedAlertStatus: The status details for each failed alert_id. 742 FailedAlertStatus map[string]Status `json:"failedAlertStatus,omitempty"` 743 744 // SuccessAlertIds: The successful list of alert IDs. 745 SuccessAlertIds []string `json:"successAlertIds,omitempty"` 746 747 // ServerResponse contains the HTTP response code and headers from the 748 // server. 749 googleapi.ServerResponse `json:"-"` 750 751 // ForceSendFields is a list of field names (e.g. "FailedAlertStatus") 752 // to unconditionally include in API requests. By default, fields with 753 // empty values are omitted from API requests. However, any non-pointer, 754 // non-interface field appearing in ForceSendFields will be sent to the 755 // server regardless of whether the field is empty or not. This may be 756 // used to include empty fields in Patch requests. 757 ForceSendFields []string `json:"-"` 758 759 // NullFields is a list of field names (e.g. "FailedAlertStatus") to 760 // include in API requests with the JSON null value. By default, fields 761 // with empty values are omitted from API requests. However, any field 762 // with an empty value appearing in NullFields will be sent to the 763 // server as null. It is an error if a field in this list has a 764 // non-empty value. This may be used to include null fields in Patch 765 // requests. 766 NullFields []string `json:"-"` 767} 768 769func (s *BatchUndeleteAlertsResponse) MarshalJSON() ([]byte, error) { 770 type NoMethod BatchUndeleteAlertsResponse 771 raw := NoMethod(*s) 772 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 773} 774 775// CloudPubsubTopic: A reference to a Cloud Pubsub topic. 776// 777// To register for notifications, the owner of the topic must 778// grant 779// `alerts-api-push-notifications@system.gserviceaccount.com` the 780// `projects.topics.publish` permission. 781type CloudPubsubTopic struct { 782 // PayloadFormat: Optional. The format of the payload that would be 783 // sent. 784 // If not specified the format will be JSON. 785 // 786 // Possible values: 787 // "PAYLOAD_FORMAT_UNSPECIFIED" - Payload format is not specified 788 // (will use JSON as default). 789 // "JSON" - Use JSON. 790 PayloadFormat string `json:"payloadFormat,omitempty"` 791 792 // TopicName: The `name` field of a Cloud Pubsub 793 // [Topic] 794 // (https://cloud.google.com/pubsub/docs/reference/rest/v1/projec 795 // ts.topics#Topic). 796 TopicName string `json:"topicName,omitempty"` 797 798 // ForceSendFields is a list of field names (e.g. "PayloadFormat") to 799 // unconditionally include in API requests. By default, fields with 800 // empty values are omitted from API requests. However, any non-pointer, 801 // non-interface field appearing in ForceSendFields will be sent to the 802 // server regardless of whether the field is empty or not. This may be 803 // used to include empty fields in Patch requests. 804 ForceSendFields []string `json:"-"` 805 806 // NullFields is a list of field names (e.g. "PayloadFormat") to include 807 // in API requests with the JSON null value. By default, fields with 808 // empty values are omitted from API requests. However, any field with 809 // an empty value appearing in NullFields will be sent to the server as 810 // null. It is an error if a field in this list has a non-empty value. 811 // This may be used to include null fields in Patch requests. 812 NullFields []string `json:"-"` 813} 814 815func (s *CloudPubsubTopic) MarshalJSON() ([]byte, error) { 816 type NoMethod CloudPubsubTopic 817 raw := NoMethod(*s) 818 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 819} 820 821// Csv: A representation of a CSV file attachment, as a list of column 822// headers and 823// a list of data rows. 824type Csv struct { 825 // DataRows: The list of data rows in a CSV file, as string arrays 826 // rather than as a 827 // single comma-separated string. 828 DataRows []*CsvRow `json:"dataRows,omitempty"` 829 830 // Headers: The list of headers for data columns in a CSV file. 831 Headers []string `json:"headers,omitempty"` 832 833 // ForceSendFields is a list of field names (e.g. "DataRows") to 834 // unconditionally include in API requests. By default, fields with 835 // empty values are omitted from API requests. However, any non-pointer, 836 // non-interface field appearing in ForceSendFields will be sent to the 837 // server regardless of whether the field is empty or not. This may be 838 // used to include empty fields in Patch requests. 839 ForceSendFields []string `json:"-"` 840 841 // NullFields is a list of field names (e.g. "DataRows") to include in 842 // API requests with the JSON null value. By default, fields with empty 843 // values are omitted from API requests. However, any field with an 844 // empty value appearing in NullFields will be sent to the server as 845 // null. It is an error if a field in this list has a non-empty value. 846 // This may be used to include null fields in Patch requests. 847 NullFields []string `json:"-"` 848} 849 850func (s *Csv) MarshalJSON() ([]byte, error) { 851 type NoMethod Csv 852 raw := NoMethod(*s) 853 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 854} 855 856// CsvRow: A representation of a single data row in a CSV file. 857type CsvRow struct { 858 // Entries: The data entries in a CSV file row, as a string array rather 859 // than a 860 // single comma-separated string. 861 Entries []string `json:"entries,omitempty"` 862 863 // ForceSendFields is a list of field names (e.g. "Entries") to 864 // unconditionally include in API requests. By default, fields with 865 // empty values are omitted from API requests. However, any non-pointer, 866 // non-interface field appearing in ForceSendFields will be sent to the 867 // server regardless of whether the field is empty or not. This may be 868 // used to include empty fields in Patch requests. 869 ForceSendFields []string `json:"-"` 870 871 // NullFields is a list of field names (e.g. "Entries") to include in 872 // API requests with the JSON null value. By default, fields with empty 873 // values are omitted from API requests. However, any field with an 874 // empty value appearing in NullFields will be sent to the server as 875 // null. It is an error if a field in this list has a non-empty value. 876 // This may be used to include null fields in Patch requests. 877 NullFields []string `json:"-"` 878} 879 880func (s *CsvRow) MarshalJSON() ([]byte, error) { 881 type NoMethod CsvRow 882 raw := NoMethod(*s) 883 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 884} 885 886// DeviceCompromised: A mobile device compromised alert. Derived from 887// audit logs. 888type DeviceCompromised struct { 889 // Email: The email of the user this alert was created for. 890 Email string `json:"email,omitempty"` 891 892 // Events: Required. The list of security events. 893 Events []*DeviceCompromisedSecurityDetail `json:"events,omitempty"` 894 895 // ForceSendFields is a list of field names (e.g. "Email") to 896 // unconditionally include in API requests. By default, fields with 897 // empty values are omitted from API requests. However, any non-pointer, 898 // non-interface field appearing in ForceSendFields will be sent to the 899 // server regardless of whether the field is empty or not. This may be 900 // used to include empty fields in Patch requests. 901 ForceSendFields []string `json:"-"` 902 903 // NullFields is a list of field names (e.g. "Email") to include in API 904 // requests with the JSON null value. By default, fields with empty 905 // values are omitted from API requests. However, any field with an 906 // empty value appearing in NullFields will be sent to the server as 907 // null. It is an error if a field in this list has a non-empty value. 908 // This may be used to include null fields in Patch requests. 909 NullFields []string `json:"-"` 910} 911 912func (s *DeviceCompromised) MarshalJSON() ([]byte, error) { 913 type NoMethod DeviceCompromised 914 raw := NoMethod(*s) 915 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 916} 917 918// DeviceCompromisedSecurityDetail: Detailed information of a single MDM 919// device compromised event. 920type DeviceCompromisedSecurityDetail struct { 921 // DeviceCompromisedState: The device compromised state. Possible values 922 // are "Compromised" or 923 // "Not Compromised". 924 DeviceCompromisedState string `json:"deviceCompromisedState,omitempty"` 925 926 // DeviceId: Required. The device ID. 927 DeviceId string `json:"deviceId,omitempty"` 928 929 // DeviceModel: The model of the device. 930 DeviceModel string `json:"deviceModel,omitempty"` 931 932 // DeviceType: The type of the device. 933 DeviceType string `json:"deviceType,omitempty"` 934 935 // IosVendorId: Required for iOS, empty for others. 936 IosVendorId string `json:"iosVendorId,omitempty"` 937 938 // ResourceId: The device resource ID. 939 ResourceId string `json:"resourceId,omitempty"` 940 941 // SerialNumber: The serial number of the device. 942 SerialNumber string `json:"serialNumber,omitempty"` 943 944 // ForceSendFields is a list of field names (e.g. 945 // "DeviceCompromisedState") to unconditionally include in API requests. 946 // By default, fields with empty values are omitted from API requests. 947 // However, any non-pointer, non-interface field appearing in 948 // ForceSendFields will be sent to the server regardless of whether the 949 // field is empty or not. This may be used to include empty fields in 950 // Patch requests. 951 ForceSendFields []string `json:"-"` 952 953 // NullFields is a list of field names (e.g. "DeviceCompromisedState") 954 // to include in API requests with the JSON null value. By default, 955 // fields with empty values are omitted from API requests. However, any 956 // field with an empty value appearing in NullFields will be sent to the 957 // server as null. It is an error if a field in this list has a 958 // non-empty value. This may be used to include null fields in Patch 959 // requests. 960 NullFields []string `json:"-"` 961} 962 963func (s *DeviceCompromisedSecurityDetail) MarshalJSON() ([]byte, error) { 964 type NoMethod DeviceCompromisedSecurityDetail 965 raw := NoMethod(*s) 966 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 967} 968 969// DlpRuleViolation: Alerts that get triggered on violations of Data 970// Loss Prevention (DLP) rules. 971type DlpRuleViolation struct { 972 // RuleViolationInfo: Details about the violated DLP rule. 973 // 974 // Admins can use the predefined detectors provided by Google Cloud 975 // DLP 976 // https://cloud.google.com/dlp/ when setting up a DLP rule. Matched 977 // Cloud DLP 978 // detectors in this violation if any will be captured in 979 // the 980 // MatchInfo.predefined_detector. 981 RuleViolationInfo *RuleViolationInfo `json:"ruleViolationInfo,omitempty"` 982 983 // ForceSendFields is a list of field names (e.g. "RuleViolationInfo") 984 // to unconditionally include in API requests. By default, fields with 985 // empty values are omitted from API requests. However, any non-pointer, 986 // non-interface field appearing in ForceSendFields will be sent to the 987 // server regardless of whether the field is empty or not. This may be 988 // used to include empty fields in Patch requests. 989 ForceSendFields []string `json:"-"` 990 991 // NullFields is a list of field names (e.g. "RuleViolationInfo") to 992 // include in API requests with the JSON null value. By default, fields 993 // with empty values are omitted from API requests. However, any field 994 // with an empty value appearing in NullFields will be sent to the 995 // server as null. It is an error if a field in this list has a 996 // non-empty value. This may be used to include null fields in Patch 997 // requests. 998 NullFields []string `json:"-"` 999} 1000 1001func (s *DlpRuleViolation) MarshalJSON() ([]byte, error) { 1002 type NoMethod DlpRuleViolation 1003 raw := NoMethod(*s) 1004 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1005} 1006 1007// DomainId: Domain ID of Gmail phishing alerts. 1008type DomainId struct { 1009 // CustomerPrimaryDomain: The primary domain for the customer. 1010 CustomerPrimaryDomain string `json:"customerPrimaryDomain,omitempty"` 1011 1012 // ForceSendFields is a list of field names (e.g. 1013 // "CustomerPrimaryDomain") to unconditionally include in API requests. 1014 // By default, fields with empty values are omitted from API requests. 1015 // However, any non-pointer, non-interface field appearing in 1016 // ForceSendFields will be sent to the server regardless of whether the 1017 // field is empty or not. This may be used to include empty fields in 1018 // Patch requests. 1019 ForceSendFields []string `json:"-"` 1020 1021 // NullFields is a list of field names (e.g. "CustomerPrimaryDomain") to 1022 // include in API requests with the JSON null value. By default, fields 1023 // with empty values are omitted from API requests. However, any field 1024 // with an empty value appearing in NullFields will be sent to the 1025 // server as null. It is an error if a field in this list has a 1026 // non-empty value. This may be used to include null fields in Patch 1027 // requests. 1028 NullFields []string `json:"-"` 1029} 1030 1031func (s *DomainId) MarshalJSON() ([]byte, error) { 1032 type NoMethod DomainId 1033 raw := NoMethod(*s) 1034 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1035} 1036 1037// DomainWideTakeoutInitiated: A takeout operation for the entire domain 1038// was initiated by an admin. Derived 1039// from audit logs. 1040type DomainWideTakeoutInitiated struct { 1041 // Email: The email of the admin who initiated the takeout. 1042 Email string `json:"email,omitempty"` 1043 1044 // TakeoutRequestId: The takeout request ID. 1045 TakeoutRequestId string `json:"takeoutRequestId,omitempty"` 1046 1047 // ForceSendFields is a list of field names (e.g. "Email") to 1048 // unconditionally include in API requests. By default, fields with 1049 // empty values are omitted from API requests. However, any non-pointer, 1050 // non-interface field appearing in ForceSendFields will be sent to the 1051 // server regardless of whether the field is empty or not. This may be 1052 // used to include empty fields in Patch requests. 1053 ForceSendFields []string `json:"-"` 1054 1055 // NullFields is a list of field names (e.g. "Email") to include in API 1056 // requests with the JSON null value. By default, fields with empty 1057 // values are omitted from API requests. However, any field with an 1058 // empty value appearing in NullFields will be sent to the server as 1059 // null. It is an error if a field in this list has a non-empty value. 1060 // This may be used to include null fields in Patch requests. 1061 NullFields []string `json:"-"` 1062} 1063 1064func (s *DomainWideTakeoutInitiated) MarshalJSON() ([]byte, error) { 1065 type NoMethod DomainWideTakeoutInitiated 1066 raw := NoMethod(*s) 1067 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1068} 1069 1070// Empty: A generic empty message that you can re-use to avoid defining 1071// duplicated 1072// empty messages in your APIs. A typical example is to use it as the 1073// request 1074// or the response type of an API method. For instance: 1075// 1076// service Foo { 1077// rpc Bar(google.protobuf.Empty) returns 1078// (google.protobuf.Empty); 1079// } 1080// 1081// The JSON representation for `Empty` is empty JSON object `{}`. 1082type Empty struct { 1083 // ServerResponse contains the HTTP response code and headers from the 1084 // server. 1085 googleapi.ServerResponse `json:"-"` 1086} 1087 1088// GmailMessageInfo: Details of a message in phishing spike alert. 1089type GmailMessageInfo struct { 1090 // AttachmentsSha256Hash: The `SHA256` hash of email's attachment and 1091 // all MIME parts. 1092 AttachmentsSha256Hash []string `json:"attachmentsSha256Hash,omitempty"` 1093 1094 // Date: The date the malicious email was sent. 1095 Date string `json:"date,omitempty"` 1096 1097 // Md5HashMessageBody: The hash of the message body text. 1098 Md5HashMessageBody string `json:"md5HashMessageBody,omitempty"` 1099 1100 // Md5HashSubject: The MD5 Hash of email's subject (only available for 1101 // reported emails). 1102 Md5HashSubject string `json:"md5HashSubject,omitempty"` 1103 1104 // MessageBodySnippet: The snippet of the message body text (only 1105 // available for reported emails). 1106 MessageBodySnippet string `json:"messageBodySnippet,omitempty"` 1107 1108 // MessageId: The message ID. 1109 MessageId string `json:"messageId,omitempty"` 1110 1111 // Recipient: The recipient of this email. 1112 Recipient string `json:"recipient,omitempty"` 1113 1114 // SubjectText: The email subject text (only available for reported 1115 // emails). 1116 SubjectText string `json:"subjectText,omitempty"` 1117 1118 // ForceSendFields is a list of field names (e.g. 1119 // "AttachmentsSha256Hash") to unconditionally include in API requests. 1120 // By default, fields with empty values are omitted from API requests. 1121 // However, any non-pointer, non-interface field appearing in 1122 // ForceSendFields will be sent to the server regardless of whether the 1123 // field is empty or not. This may be used to include empty fields in 1124 // Patch requests. 1125 ForceSendFields []string `json:"-"` 1126 1127 // NullFields is a list of field names (e.g. "AttachmentsSha256Hash") to 1128 // include in API requests with the JSON null value. By default, fields 1129 // with empty values are omitted from API requests. However, any field 1130 // with an empty value appearing in NullFields will be sent to the 1131 // server as null. It is an error if a field in this list has a 1132 // non-empty value. This may be used to include null fields in Patch 1133 // requests. 1134 NullFields []string `json:"-"` 1135} 1136 1137func (s *GmailMessageInfo) MarshalJSON() ([]byte, error) { 1138 type NoMethod GmailMessageInfo 1139 raw := NoMethod(*s) 1140 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1141} 1142 1143// GoogleOperations: An incident reported by Google Operations for a G 1144// Suite application. 1145type GoogleOperations struct { 1146 // AffectedUserEmails: The list of emails which correspond to the users 1147 // directly affected by the 1148 // incident. 1149 AffectedUserEmails []string `json:"affectedUserEmails,omitempty"` 1150 1151 // AttachmentData: Optional. Application-specific data for an incident, 1152 // provided when the 1153 // G Suite application which reported the incident cannot be 1154 // completely 1155 // restored to a valid state. 1156 AttachmentData *Attachment `json:"attachmentData,omitempty"` 1157 1158 // Description: A detailed, freeform incident description. 1159 Description string `json:"description,omitempty"` 1160 1161 // Title: A one-line incident description. 1162 Title string `json:"title,omitempty"` 1163 1164 // ForceSendFields is a list of field names (e.g. "AffectedUserEmails") 1165 // to unconditionally include in API requests. By default, fields with 1166 // empty values are omitted from API requests. However, any non-pointer, 1167 // non-interface field appearing in ForceSendFields will be sent to the 1168 // server regardless of whether the field is empty or not. This may be 1169 // used to include empty fields in Patch requests. 1170 ForceSendFields []string `json:"-"` 1171 1172 // NullFields is a list of field names (e.g. "AffectedUserEmails") to 1173 // include in API requests with the JSON null value. By default, fields 1174 // with empty values are omitted from API requests. However, any field 1175 // with an empty value appearing in NullFields will be sent to the 1176 // server as null. It is an error if a field in this list has a 1177 // non-empty value. This may be used to include null fields in Patch 1178 // requests. 1179 NullFields []string `json:"-"` 1180} 1181 1182func (s *GoogleOperations) MarshalJSON() ([]byte, error) { 1183 type NoMethod GoogleOperations 1184 raw := NoMethod(*s) 1185 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1186} 1187 1188// ListAlertFeedbackResponse: Response message for an alert feedback 1189// listing request. 1190type ListAlertFeedbackResponse struct { 1191 // Feedback: The list of alert feedback. 1192 // Feedback entries for each alert are ordered by creation time 1193 // descending. 1194 Feedback []*AlertFeedback `json:"feedback,omitempty"` 1195 1196 // ServerResponse contains the HTTP response code and headers from the 1197 // server. 1198 googleapi.ServerResponse `json:"-"` 1199 1200 // ForceSendFields is a list of field names (e.g. "Feedback") to 1201 // unconditionally include in API requests. By default, fields with 1202 // empty values are omitted from API requests. However, any non-pointer, 1203 // non-interface field appearing in ForceSendFields will be sent to the 1204 // server regardless of whether the field is empty or not. This may be 1205 // used to include empty fields in Patch requests. 1206 ForceSendFields []string `json:"-"` 1207 1208 // NullFields is a list of field names (e.g. "Feedback") to include in 1209 // API requests with the JSON null value. By default, fields with empty 1210 // values are omitted from API requests. However, any field with an 1211 // empty value appearing in NullFields will be sent to the server as 1212 // null. It is an error if a field in this list has a non-empty value. 1213 // This may be used to include null fields in Patch requests. 1214 NullFields []string `json:"-"` 1215} 1216 1217func (s *ListAlertFeedbackResponse) MarshalJSON() ([]byte, error) { 1218 type NoMethod ListAlertFeedbackResponse 1219 raw := NoMethod(*s) 1220 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1221} 1222 1223// ListAlertsResponse: Response message for an alert listing request. 1224type ListAlertsResponse struct { 1225 // Alerts: The list of alerts. 1226 Alerts []*Alert `json:"alerts,omitempty"` 1227 1228 // NextPageToken: The token for the next page. If not empty, indicates 1229 // that there may be more 1230 // alerts that match the listing request; this value can be used in 1231 // a 1232 // subsequent ListAlertsRequest to get alerts continuing from last 1233 // result 1234 // of the current list call. 1235 NextPageToken string `json:"nextPageToken,omitempty"` 1236 1237 // ServerResponse contains the HTTP response code and headers from the 1238 // server. 1239 googleapi.ServerResponse `json:"-"` 1240 1241 // ForceSendFields is a list of field names (e.g. "Alerts") to 1242 // unconditionally include in API requests. By default, fields with 1243 // empty values are omitted from API requests. However, any non-pointer, 1244 // non-interface field appearing in ForceSendFields will be sent to the 1245 // server regardless of whether the field is empty or not. This may be 1246 // used to include empty fields in Patch requests. 1247 ForceSendFields []string `json:"-"` 1248 1249 // NullFields is a list of field names (e.g. "Alerts") to include in API 1250 // requests with the JSON null value. By default, fields with empty 1251 // values are omitted from API requests. However, any field with an 1252 // empty value appearing in NullFields will be sent to the server as 1253 // null. It is an error if a field in this list has a non-empty value. 1254 // This may be used to include null fields in Patch requests. 1255 NullFields []string `json:"-"` 1256} 1257 1258func (s *ListAlertsResponse) MarshalJSON() ([]byte, error) { 1259 type NoMethod ListAlertsResponse 1260 raw := NoMethod(*s) 1261 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1262} 1263 1264// LoginDetails: The details of the login action. 1265type LoginDetails struct { 1266 // IpAddress: Optional. The human-readable IP address (for 1267 // example, 1268 // `11.22.33.44`) that is associated with the warning event. 1269 IpAddress string `json:"ipAddress,omitempty"` 1270 1271 // LoginTime: Optional. The successful login time that is associated 1272 // with the warning 1273 // event. This isn't present for blocked login attempts. 1274 LoginTime string `json:"loginTime,omitempty"` 1275 1276 // ForceSendFields is a list of field names (e.g. "IpAddress") to 1277 // unconditionally include in API requests. By default, fields with 1278 // empty values are omitted from API requests. However, any non-pointer, 1279 // non-interface field appearing in ForceSendFields will be sent to the 1280 // server regardless of whether the field is empty or not. This may be 1281 // used to include empty fields in Patch requests. 1282 ForceSendFields []string `json:"-"` 1283 1284 // NullFields is a list of field names (e.g. "IpAddress") to include in 1285 // API requests with the JSON null value. By default, fields with empty 1286 // values are omitted from API requests. However, any field with an 1287 // empty value appearing in NullFields will be sent to the server as 1288 // null. It is an error if a field in this list has a non-empty value. 1289 // This may be used to include null fields in Patch requests. 1290 NullFields []string `json:"-"` 1291} 1292 1293func (s *LoginDetails) MarshalJSON() ([]byte, error) { 1294 type NoMethod LoginDetails 1295 raw := NoMethod(*s) 1296 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1297} 1298 1299// MailPhishing: Proto for all phishing alerts with common 1300// payload. 1301// Supported types are any of the following: 1302// 1303// * User reported phishing 1304// * User reported spam spike 1305// * Suspicious message reported 1306// * Phishing reclassification 1307// * Malware reclassification 1308// * Gmail potential employee spoofing 1309type MailPhishing struct { 1310 // DomainId: The domain ID. 1311 DomainId *DomainId `json:"domainId,omitempty"` 1312 1313 // IsInternal: If `true`, the email originated from within the 1314 // organization. 1315 IsInternal bool `json:"isInternal,omitempty"` 1316 1317 // MaliciousEntity: The entity whose actions triggered a Gmail phishing 1318 // alert. 1319 MaliciousEntity *MaliciousEntity `json:"maliciousEntity,omitempty"` 1320 1321 // Messages: The list of messages contained by this alert. 1322 Messages []*GmailMessageInfo `json:"messages,omitempty"` 1323 1324 // SystemActionType: System actions on the messages. 1325 // 1326 // Possible values: 1327 // "SYSTEM_ACTION_TYPE_UNSPECIFIED" - System action is unspecified. 1328 // "NO_OPERATION" - No operation. 1329 // "REMOVED_FROM_INBOX" - Messages were removed from the inbox. 1330 SystemActionType string `json:"systemActionType,omitempty"` 1331 1332 // ForceSendFields is a list of field names (e.g. "DomainId") to 1333 // unconditionally include in API requests. By default, fields with 1334 // empty values are omitted from API requests. However, any non-pointer, 1335 // non-interface field appearing in ForceSendFields will be sent to the 1336 // server regardless of whether the field is empty or not. This may be 1337 // used to include empty fields in Patch requests. 1338 ForceSendFields []string `json:"-"` 1339 1340 // NullFields is a list of field names (e.g. "DomainId") to include in 1341 // API requests with the JSON null value. By default, fields with empty 1342 // values are omitted from API requests. However, any field with an 1343 // empty value appearing in NullFields will be sent to the server as 1344 // null. It is an error if a field in this list has a non-empty value. 1345 // This may be used to include null fields in Patch requests. 1346 NullFields []string `json:"-"` 1347} 1348 1349func (s *MailPhishing) MarshalJSON() ([]byte, error) { 1350 type NoMethod MailPhishing 1351 raw := NoMethod(*s) 1352 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1353} 1354 1355// MaliciousEntity: Entity whose actions triggered a Gmail phishing 1356// alert. 1357type MaliciousEntity struct { 1358 // DisplayName: The header from display name. 1359 DisplayName string `json:"displayName,omitempty"` 1360 1361 // Entity: The actor who triggered a gmail phishing alert. 1362 Entity *User `json:"entity,omitempty"` 1363 1364 // FromHeader: The sender email address. 1365 FromHeader string `json:"fromHeader,omitempty"` 1366 1367 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1368 // unconditionally include in API requests. By default, fields with 1369 // empty values are omitted from API requests. However, any non-pointer, 1370 // non-interface field appearing in ForceSendFields will be sent to the 1371 // server regardless of whether the field is empty or not. This may be 1372 // used to include empty fields in Patch requests. 1373 ForceSendFields []string `json:"-"` 1374 1375 // NullFields is a list of field names (e.g. "DisplayName") to include 1376 // in API requests with the JSON null value. By default, fields with 1377 // empty values are omitted from API requests. However, any field with 1378 // an empty value appearing in NullFields will be sent to the server as 1379 // null. It is an error if a field in this list has a non-empty value. 1380 // This may be used to include null fields in Patch requests. 1381 NullFields []string `json:"-"` 1382} 1383 1384func (s *MaliciousEntity) MarshalJSON() ([]byte, error) { 1385 type NoMethod MaliciousEntity 1386 raw := NoMethod(*s) 1387 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1388} 1389 1390// MatchInfo: Proto that contains match information from the condition 1391// part of the rule. 1392type MatchInfo struct { 1393 // PredefinedDetector: For matched detector predefined by Google. 1394 PredefinedDetector *PredefinedDetectorInfo `json:"predefinedDetector,omitempty"` 1395 1396 // UserDefinedDetector: For matched detector defined by administrators. 1397 UserDefinedDetector *UserDefinedDetectorInfo `json:"userDefinedDetector,omitempty"` 1398 1399 // ForceSendFields is a list of field names (e.g. "PredefinedDetector") 1400 // to unconditionally include in API requests. By default, fields with 1401 // empty values are omitted from API requests. However, any non-pointer, 1402 // non-interface field appearing in ForceSendFields will be sent to the 1403 // server regardless of whether the field is empty or not. This may be 1404 // used to include empty fields in Patch requests. 1405 ForceSendFields []string `json:"-"` 1406 1407 // NullFields is a list of field names (e.g. "PredefinedDetector") to 1408 // include in API requests with the JSON null value. By default, fields 1409 // with empty values are omitted from API requests. However, any field 1410 // with an empty value appearing in NullFields will be sent to the 1411 // server as null. It is an error if a field in this list has a 1412 // non-empty value. This may be used to include null fields in Patch 1413 // requests. 1414 NullFields []string `json:"-"` 1415} 1416 1417func (s *MatchInfo) MarshalJSON() ([]byte, error) { 1418 type NoMethod MatchInfo 1419 raw := NoMethod(*s) 1420 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1421} 1422 1423// Notification: Settings for callback notifications. 1424// For more details see [G Suite 1425// Alert 1426// Notification](/admin-sdk/alertcenter/guides/notifications). 1427type Notification struct { 1428 // CloudPubsubTopic: A Google Cloud Pub/sub topic destination. 1429 CloudPubsubTopic *CloudPubsubTopic `json:"cloudPubsubTopic,omitempty"` 1430 1431 // ForceSendFields is a list of field names (e.g. "CloudPubsubTopic") to 1432 // unconditionally include in API requests. By default, fields with 1433 // empty values are omitted from API requests. However, any non-pointer, 1434 // non-interface field appearing in ForceSendFields will be sent to the 1435 // server regardless of whether the field is empty or not. This may be 1436 // used to include empty fields in Patch requests. 1437 ForceSendFields []string `json:"-"` 1438 1439 // NullFields is a list of field names (e.g. "CloudPubsubTopic") to 1440 // include in API requests with the JSON null value. By default, fields 1441 // with empty values are omitted from API requests. However, any field 1442 // with an empty value appearing in NullFields will be sent to the 1443 // server as null. It is an error if a field in this list has a 1444 // non-empty value. This may be used to include null fields in Patch 1445 // requests. 1446 NullFields []string `json:"-"` 1447} 1448 1449func (s *Notification) MarshalJSON() ([]byte, error) { 1450 type NoMethod Notification 1451 raw := NoMethod(*s) 1452 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1453} 1454 1455// PhishingSpike: Alert for a spike in user reported phishing. 1456// <aside class="warning"><b>Warning</b>: This type has been deprecated. 1457// Use 1458// [MailPhishing](/admin-sdk/alertcenter/reference/rest/v1beta1/MailP 1459// hishing) 1460// instead.</aside> 1461type PhishingSpike struct { 1462 // DomainId: The domain ID. 1463 DomainId *DomainId `json:"domainId,omitempty"` 1464 1465 // IsInternal: If `true`, the email originated from within the 1466 // organization. 1467 IsInternal bool `json:"isInternal,omitempty"` 1468 1469 // MaliciousEntity: The entity whose actions triggered a Gmail phishing 1470 // alert. 1471 MaliciousEntity *MaliciousEntity `json:"maliciousEntity,omitempty"` 1472 1473 // Messages: The list of messages contained by this alert. 1474 Messages []*GmailMessageInfo `json:"messages,omitempty"` 1475 1476 // ForceSendFields is a list of field names (e.g. "DomainId") to 1477 // unconditionally include in API requests. By default, fields with 1478 // empty values are omitted from API requests. However, any non-pointer, 1479 // non-interface field appearing in ForceSendFields will be sent to the 1480 // server regardless of whether the field is empty or not. This may be 1481 // used to include empty fields in Patch requests. 1482 ForceSendFields []string `json:"-"` 1483 1484 // NullFields is a list of field names (e.g. "DomainId") to include in 1485 // API requests with the JSON null value. By default, fields with empty 1486 // values are omitted from API requests. However, any field with an 1487 // empty value appearing in NullFields will be sent to the server as 1488 // null. It is an error if a field in this list has a non-empty value. 1489 // This may be used to include null fields in Patch requests. 1490 NullFields []string `json:"-"` 1491} 1492 1493func (s *PhishingSpike) MarshalJSON() ([]byte, error) { 1494 type NoMethod PhishingSpike 1495 raw := NoMethod(*s) 1496 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1497} 1498 1499// PredefinedDetectorInfo: Detector provided by Google. 1500type PredefinedDetectorInfo struct { 1501 // DetectorName: Name that uniquely identifies the detector. 1502 DetectorName string `json:"detectorName,omitempty"` 1503 1504 // ForceSendFields is a list of field names (e.g. "DetectorName") to 1505 // unconditionally include in API requests. By default, fields with 1506 // empty values are omitted from API requests. However, any non-pointer, 1507 // non-interface field appearing in ForceSendFields will be sent to the 1508 // server regardless of whether the field is empty or not. This may be 1509 // used to include empty fields in Patch requests. 1510 ForceSendFields []string `json:"-"` 1511 1512 // NullFields is a list of field names (e.g. "DetectorName") to include 1513 // in API requests with the JSON null value. By default, fields with 1514 // empty values are omitted from API requests. However, any field with 1515 // an empty value appearing in NullFields will be sent to the server as 1516 // null. It is an error if a field in this list has a non-empty value. 1517 // This may be used to include null fields in Patch requests. 1518 NullFields []string `json:"-"` 1519} 1520 1521func (s *PredefinedDetectorInfo) MarshalJSON() ([]byte, error) { 1522 type NoMethod PredefinedDetectorInfo 1523 raw := NoMethod(*s) 1524 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1525} 1526 1527// RequestInfo: Requests for one application that needs default SQL 1528// setup. 1529type RequestInfo struct { 1530 // AppDeveloperEmail: List of app developers who triggered notifications 1531 // for above 1532 // application. 1533 AppDeveloperEmail []string `json:"appDeveloperEmail,omitempty"` 1534 1535 // AppKey: Required. The application that requires the SQL setup. 1536 AppKey string `json:"appKey,omitempty"` 1537 1538 // NumberOfRequests: Required. Number of requests sent for this 1539 // application to set up default 1540 // SQL instance. 1541 NumberOfRequests int64 `json:"numberOfRequests,omitempty,string"` 1542 1543 // ForceSendFields is a list of field names (e.g. "AppDeveloperEmail") 1544 // to unconditionally include in API requests. By default, fields with 1545 // empty values are omitted from API requests. However, any non-pointer, 1546 // non-interface field appearing in ForceSendFields will be sent to the 1547 // server regardless of whether the field is empty or not. This may be 1548 // used to include empty fields in Patch requests. 1549 ForceSendFields []string `json:"-"` 1550 1551 // NullFields is a list of field names (e.g. "AppDeveloperEmail") to 1552 // include in API requests with the JSON null value. By default, fields 1553 // with empty values are omitted from API requests. However, any field 1554 // with an empty value appearing in NullFields will be sent to the 1555 // server as null. It is an error if a field in this list has a 1556 // non-empty value. This may be used to include null fields in Patch 1557 // requests. 1558 NullFields []string `json:"-"` 1559} 1560 1561func (s *RequestInfo) MarshalJSON() ([]byte, error) { 1562 type NoMethod RequestInfo 1563 raw := NoMethod(*s) 1564 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1565} 1566 1567// ResourceInfo: Proto that contains resource information. 1568type ResourceInfo struct { 1569 // DocumentId: Drive file ID. 1570 DocumentId string `json:"documentId,omitempty"` 1571 1572 // ResourceTitle: Title of the resource, for example email subject, or 1573 // document title. 1574 ResourceTitle string `json:"resourceTitle,omitempty"` 1575 1576 // ForceSendFields is a list of field names (e.g. "DocumentId") to 1577 // unconditionally include in API requests. By default, fields with 1578 // empty values are omitted from API requests. However, any non-pointer, 1579 // non-interface field appearing in ForceSendFields will be sent to the 1580 // server regardless of whether the field is empty or not. This may be 1581 // used to include empty fields in Patch requests. 1582 ForceSendFields []string `json:"-"` 1583 1584 // NullFields is a list of field names (e.g. "DocumentId") to include in 1585 // API requests with the JSON null value. By default, fields with empty 1586 // values are omitted from API requests. However, any field with an 1587 // empty value appearing in NullFields will be sent to the server as 1588 // null. It is an error if a field in this list has a non-empty value. 1589 // This may be used to include null fields in Patch requests. 1590 NullFields []string `json:"-"` 1591} 1592 1593func (s *ResourceInfo) MarshalJSON() ([]byte, error) { 1594 type NoMethod ResourceInfo 1595 raw := NoMethod(*s) 1596 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1597} 1598 1599// RuleInfo: Proto that contains rule information. 1600type RuleInfo struct { 1601 // DisplayName: User provided name of the rule. 1602 DisplayName string `json:"displayName,omitempty"` 1603 1604 // ResourceName: Resource name that uniquely identifies the rule. 1605 ResourceName string `json:"resourceName,omitempty"` 1606 1607 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1608 // unconditionally include in API requests. By default, fields with 1609 // empty values are omitted from API requests. However, any non-pointer, 1610 // non-interface field appearing in ForceSendFields will be sent to the 1611 // server regardless of whether the field is empty or not. This may be 1612 // used to include empty fields in Patch requests. 1613 ForceSendFields []string `json:"-"` 1614 1615 // NullFields is a list of field names (e.g. "DisplayName") to include 1616 // in API requests with the JSON null value. By default, fields with 1617 // empty values are omitted from API requests. However, any field with 1618 // an empty value appearing in NullFields will be sent to the server as 1619 // null. It is an error if a field in this list has a non-empty value. 1620 // This may be used to include null fields in Patch requests. 1621 NullFields []string `json:"-"` 1622} 1623 1624func (s *RuleInfo) MarshalJSON() ([]byte, error) { 1625 type NoMethod RuleInfo 1626 raw := NoMethod(*s) 1627 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1628} 1629 1630// RuleViolationInfo: Common alert information about violated rules that 1631// are configured by G Suite 1632// administrators. 1633type RuleViolationInfo struct { 1634 // DataSource: Source of the data. 1635 // 1636 // Possible values: 1637 // "DATA_SOURCE_UNSPECIFIED" - Data source is unspecified. 1638 // "DRIVE" - Drive data source. 1639 DataSource string `json:"dataSource,omitempty"` 1640 1641 // MatchInfo: List of matches that were found in the resource content. 1642 MatchInfo []*MatchInfo `json:"matchInfo,omitempty"` 1643 1644 // Recipients: Resource recipients. 1645 // 1646 // For Drive, they are grantees that the Drive file was shared with at 1647 // the 1648 // time of rule triggering. Valid values include user emails, group 1649 // emails, 1650 // domains, or 'anyone' if the file was publicly accessible. If the file 1651 // was 1652 // private the recipients list will be empty. 1653 // 1654 // For Gmail, they are emails of the users or groups that the Gmail 1655 // message 1656 // was sent to. 1657 Recipients []string `json:"recipients,omitempty"` 1658 1659 // ResourceInfo: Details of the resource which violated the rule. 1660 ResourceInfo *ResourceInfo `json:"resourceInfo,omitempty"` 1661 1662 // RuleInfo: Details of the violated rule. 1663 RuleInfo *RuleInfo `json:"ruleInfo,omitempty"` 1664 1665 // SuppressedActionTypes: Actions suppressed due to other actions with 1666 // higher priority. 1667 // 1668 // Possible values: 1669 // "ACTION_TYPE_UNSPECIFIED" - Action type is unspecified. 1670 // "DRIVE_BLOCK_EXTERNAL_SHARING" - Block sharing a file externally. 1671 // "DRIVE_WARN_ON_EXTERNAL_SHARING" - Show a warning message when 1672 // sharing a file externally. 1673 // "ALERT" - Send alert. 1674 SuppressedActionTypes []string `json:"suppressedActionTypes,omitempty"` 1675 1676 // Trigger: Trigger of the rule. 1677 // 1678 // Possible values: 1679 // "TRIGGER_UNSPECIFIED" - Trigger is unspecified. 1680 // "DRIVE_SHARE" - A Drive file is shared. 1681 Trigger string `json:"trigger,omitempty"` 1682 1683 // TriggeredActionTypes: Actions applied as a consequence of the rule 1684 // being triggered. 1685 // 1686 // Possible values: 1687 // "ACTION_TYPE_UNSPECIFIED" - Action type is unspecified. 1688 // "DRIVE_BLOCK_EXTERNAL_SHARING" - Block sharing a file externally. 1689 // "DRIVE_WARN_ON_EXTERNAL_SHARING" - Show a warning message when 1690 // sharing a file externally. 1691 // "ALERT" - Send alert. 1692 TriggeredActionTypes []string `json:"triggeredActionTypes,omitempty"` 1693 1694 // TriggeringUserEmail: Email of the user who caused the violation. 1695 // Value could be empty if not 1696 // applicable, for example, a violation found by drive continuous scan. 1697 TriggeringUserEmail string `json:"triggeringUserEmail,omitempty"` 1698 1699 // ForceSendFields is a list of field names (e.g. "DataSource") to 1700 // unconditionally include in API requests. By default, fields with 1701 // empty values are omitted from API requests. However, any non-pointer, 1702 // non-interface field appearing in ForceSendFields will be sent to the 1703 // server regardless of whether the field is empty or not. This may be 1704 // used to include empty fields in Patch requests. 1705 ForceSendFields []string `json:"-"` 1706 1707 // NullFields is a list of field names (e.g. "DataSource") to include in 1708 // API requests with the JSON null value. By default, fields with empty 1709 // values are omitted from API requests. However, any field with an 1710 // empty value appearing in NullFields will be sent to the server as 1711 // null. It is an error if a field in this list has a non-empty value. 1712 // This may be used to include null fields in Patch requests. 1713 NullFields []string `json:"-"` 1714} 1715 1716func (s *RuleViolationInfo) MarshalJSON() ([]byte, error) { 1717 type NoMethod RuleViolationInfo 1718 raw := NoMethod(*s) 1719 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1720} 1721 1722// Settings: Customer-level settings. 1723type Settings struct { 1724 // Notifications: The list of notifications. 1725 Notifications []*Notification `json:"notifications,omitempty"` 1726 1727 // ServerResponse contains the HTTP response code and headers from the 1728 // server. 1729 googleapi.ServerResponse `json:"-"` 1730 1731 // ForceSendFields is a list of field names (e.g. "Notifications") to 1732 // unconditionally include in API requests. By default, fields with 1733 // empty values are omitted from API requests. However, any non-pointer, 1734 // non-interface field appearing in ForceSendFields will be sent to the 1735 // server regardless of whether the field is empty or not. This may be 1736 // used to include empty fields in Patch requests. 1737 ForceSendFields []string `json:"-"` 1738 1739 // NullFields is a list of field names (e.g. "Notifications") to include 1740 // in API requests with the JSON null value. By default, fields with 1741 // empty values are omitted from API requests. However, any field with 1742 // an empty value appearing in NullFields will be sent to the server as 1743 // null. It is an error if a field in this list has a non-empty value. 1744 // This may be used to include null fields in Patch requests. 1745 NullFields []string `json:"-"` 1746} 1747 1748func (s *Settings) MarshalJSON() ([]byte, error) { 1749 type NoMethod Settings 1750 raw := NoMethod(*s) 1751 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1752} 1753 1754// StateSponsoredAttack: A state-sponsored attack alert. Derived from 1755// audit logs. 1756type StateSponsoredAttack struct { 1757 // Email: The email of the user this incident was created for. 1758 Email string `json:"email,omitempty"` 1759 1760 // ForceSendFields is a list of field names (e.g. "Email") to 1761 // unconditionally include in API requests. By default, fields with 1762 // empty values are omitted from API requests. However, any non-pointer, 1763 // non-interface field appearing in ForceSendFields will be sent to the 1764 // server regardless of whether the field is empty or not. This may be 1765 // used to include empty fields in Patch requests. 1766 ForceSendFields []string `json:"-"` 1767 1768 // NullFields is a list of field names (e.g. "Email") to include in API 1769 // requests with the JSON null value. By default, fields with empty 1770 // values are omitted from API requests. However, any field with an 1771 // empty value appearing in NullFields will be sent to the server as 1772 // null. It is an error if a field in this list has a non-empty value. 1773 // This may be used to include null fields in Patch requests. 1774 NullFields []string `json:"-"` 1775} 1776 1777func (s *StateSponsoredAttack) MarshalJSON() ([]byte, error) { 1778 type NoMethod StateSponsoredAttack 1779 raw := NoMethod(*s) 1780 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1781} 1782 1783// Status: The `Status` type defines a logical error model that is 1784// suitable for 1785// different programming environments, including REST APIs and RPC APIs. 1786// It is 1787// used by [gRPC](https://github.com/grpc). Each `Status` message 1788// contains 1789// three pieces of data: error code, error message, and error 1790// details. 1791// 1792// You can find out more about this error model and how to work with it 1793// in the 1794// [API Design Guide](https://cloud.google.com/apis/design/errors). 1795type Status struct { 1796 // Code: The status code, which should be an enum value of 1797 // google.rpc.Code. 1798 Code int64 `json:"code,omitempty"` 1799 1800 // Details: A list of messages that carry the error details. There is a 1801 // common set of 1802 // message types for APIs to use. 1803 Details []googleapi.RawMessage `json:"details,omitempty"` 1804 1805 // Message: A developer-facing error message, which should be in 1806 // English. Any 1807 // user-facing error message should be localized and sent in 1808 // the 1809 // google.rpc.Status.details field, or localized by the client. 1810 Message string `json:"message,omitempty"` 1811 1812 // ForceSendFields is a list of field names (e.g. "Code") to 1813 // unconditionally include in API requests. By default, fields with 1814 // empty values are omitted from API requests. However, any non-pointer, 1815 // non-interface field appearing in ForceSendFields will be sent to the 1816 // server regardless of whether the field is empty or not. This may be 1817 // used to include empty fields in Patch requests. 1818 ForceSendFields []string `json:"-"` 1819 1820 // NullFields is a list of field names (e.g. "Code") to include in API 1821 // requests with the JSON null value. By default, fields with empty 1822 // values are omitted from API requests. However, any field with an 1823 // empty value appearing in NullFields will be sent to the server as 1824 // null. It is an error if a field in this list has a non-empty value. 1825 // This may be used to include null fields in Patch requests. 1826 NullFields []string `json:"-"` 1827} 1828 1829func (s *Status) MarshalJSON() ([]byte, error) { 1830 type NoMethod Status 1831 raw := NoMethod(*s) 1832 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1833} 1834 1835// SuspiciousActivity: A mobile suspicious activity alert. Derived from 1836// audit logs. 1837type SuspiciousActivity struct { 1838 // Email: The email of the user this alert was created for. 1839 Email string `json:"email,omitempty"` 1840 1841 // Events: Required. The list of security events. 1842 Events []*SuspiciousActivitySecurityDetail `json:"events,omitempty"` 1843 1844 // ForceSendFields is a list of field names (e.g. "Email") to 1845 // unconditionally include in API requests. By default, fields with 1846 // empty values are omitted from API requests. However, any non-pointer, 1847 // non-interface field appearing in ForceSendFields will be sent to the 1848 // server regardless of whether the field is empty or not. This may be 1849 // used to include empty fields in Patch requests. 1850 ForceSendFields []string `json:"-"` 1851 1852 // NullFields is a list of field names (e.g. "Email") to include in API 1853 // requests with the JSON null value. By default, fields with empty 1854 // values are omitted from API requests. However, any field with an 1855 // empty value appearing in NullFields will be sent to the server as 1856 // null. It is an error if a field in this list has a non-empty value. 1857 // This may be used to include null fields in Patch requests. 1858 NullFields []string `json:"-"` 1859} 1860 1861func (s *SuspiciousActivity) MarshalJSON() ([]byte, error) { 1862 type NoMethod SuspiciousActivity 1863 raw := NoMethod(*s) 1864 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1865} 1866 1867// SuspiciousActivitySecurityDetail: Detailed information of a single 1868// MDM suspicious activity event. 1869type SuspiciousActivitySecurityDetail struct { 1870 // DeviceId: Required. The device ID. 1871 DeviceId string `json:"deviceId,omitempty"` 1872 1873 // DeviceModel: The model of the device. 1874 DeviceModel string `json:"deviceModel,omitempty"` 1875 1876 // DeviceProperty: The device property which was changed. 1877 DeviceProperty string `json:"deviceProperty,omitempty"` 1878 1879 // DeviceType: The type of the device. 1880 DeviceType string `json:"deviceType,omitempty"` 1881 1882 // IosVendorId: Required for iOS, empty for others. 1883 IosVendorId string `json:"iosVendorId,omitempty"` 1884 1885 // NewValue: The new value of the device property after the change. 1886 NewValue string `json:"newValue,omitempty"` 1887 1888 // OldValue: The old value of the device property before the change. 1889 OldValue string `json:"oldValue,omitempty"` 1890 1891 // ResourceId: The device resource ID. 1892 ResourceId string `json:"resourceId,omitempty"` 1893 1894 // SerialNumber: The serial number of the device. 1895 SerialNumber string `json:"serialNumber,omitempty"` 1896 1897 // ForceSendFields is a list of field names (e.g. "DeviceId") to 1898 // unconditionally include in API requests. By default, fields with 1899 // empty values are omitted from API requests. However, any non-pointer, 1900 // non-interface field appearing in ForceSendFields will be sent to the 1901 // server regardless of whether the field is empty or not. This may be 1902 // used to include empty fields in Patch requests. 1903 ForceSendFields []string `json:"-"` 1904 1905 // NullFields is a list of field names (e.g. "DeviceId") to include in 1906 // API requests with the JSON null value. By default, fields with empty 1907 // values are omitted from API requests. However, any field with an 1908 // empty value appearing in NullFields will be sent to the server as 1909 // null. It is an error if a field in this list has a non-empty value. 1910 // This may be used to include null fields in Patch requests. 1911 NullFields []string `json:"-"` 1912} 1913 1914func (s *SuspiciousActivitySecurityDetail) MarshalJSON() ([]byte, error) { 1915 type NoMethod SuspiciousActivitySecurityDetail 1916 raw := NoMethod(*s) 1917 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1918} 1919 1920// UndeleteAlertRequest: A request to undelete a specific alert that was 1921// marked for deletion. 1922type UndeleteAlertRequest struct { 1923 // CustomerId: Optional. The unique identifier of the G Suite 1924 // organization account of the 1925 // customer the alert is associated with. 1926 // Inferred from the caller identity if not provided. 1927 CustomerId string `json:"customerId,omitempty"` 1928 1929 // ForceSendFields is a list of field names (e.g. "CustomerId") to 1930 // unconditionally include in API requests. By default, fields with 1931 // empty values are omitted from API requests. However, any non-pointer, 1932 // non-interface field appearing in ForceSendFields will be sent to the 1933 // server regardless of whether the field is empty or not. This may be 1934 // used to include empty fields in Patch requests. 1935 ForceSendFields []string `json:"-"` 1936 1937 // NullFields is a list of field names (e.g. "CustomerId") to include in 1938 // API requests with the JSON null value. By default, fields with empty 1939 // values are omitted from API requests. However, any field with an 1940 // empty value appearing in NullFields will be sent to the server as 1941 // null. It is an error if a field in this list has a non-empty value. 1942 // This may be used to include null fields in Patch requests. 1943 NullFields []string `json:"-"` 1944} 1945 1946func (s *UndeleteAlertRequest) MarshalJSON() ([]byte, error) { 1947 type NoMethod UndeleteAlertRequest 1948 raw := NoMethod(*s) 1949 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1950} 1951 1952// User: A user. 1953type User struct { 1954 // DisplayName: Display name of the user. 1955 DisplayName string `json:"displayName,omitempty"` 1956 1957 // EmailAddress: Email address of the user. 1958 EmailAddress string `json:"emailAddress,omitempty"` 1959 1960 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1961 // unconditionally include in API requests. By default, fields with 1962 // empty values are omitted from API requests. However, any non-pointer, 1963 // non-interface field appearing in ForceSendFields will be sent to the 1964 // server regardless of whether the field is empty or not. This may be 1965 // used to include empty fields in Patch requests. 1966 ForceSendFields []string `json:"-"` 1967 1968 // NullFields is a list of field names (e.g. "DisplayName") to include 1969 // in API requests with the JSON null value. By default, fields with 1970 // empty values are omitted from API requests. However, any field with 1971 // an empty value appearing in NullFields will be sent to the server as 1972 // null. It is an error if a field in this list has a non-empty value. 1973 // This may be used to include null fields in Patch requests. 1974 NullFields []string `json:"-"` 1975} 1976 1977func (s *User) MarshalJSON() ([]byte, error) { 1978 type NoMethod User 1979 raw := NoMethod(*s) 1980 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1981} 1982 1983// UserDefinedDetectorInfo: Detector defined by administrators. 1984type UserDefinedDetectorInfo struct { 1985 // DisplayName: Display name of the detector. 1986 DisplayName string `json:"displayName,omitempty"` 1987 1988 // ResourceName: Resource name that uniquely identifies the detector. 1989 ResourceName string `json:"resourceName,omitempty"` 1990 1991 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1992 // unconditionally include in API requests. By default, fields with 1993 // empty values are omitted from API requests. However, any non-pointer, 1994 // non-interface field appearing in ForceSendFields will be sent to the 1995 // server regardless of whether the field is empty or not. This may be 1996 // used to include empty fields in Patch requests. 1997 ForceSendFields []string `json:"-"` 1998 1999 // NullFields is a list of field names (e.g. "DisplayName") to include 2000 // in API requests with the JSON null value. By default, fields with 2001 // empty values are omitted from API requests. However, any field with 2002 // an empty value appearing in NullFields will be sent to the server as 2003 // null. It is an error if a field in this list has a non-empty value. 2004 // This may be used to include null fields in Patch requests. 2005 NullFields []string `json:"-"` 2006} 2007 2008func (s *UserDefinedDetectorInfo) MarshalJSON() ([]byte, error) { 2009 type NoMethod UserDefinedDetectorInfo 2010 raw := NoMethod(*s) 2011 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2012} 2013 2014// method id "alertcenter.alerts.batchDelete": 2015 2016type AlertsBatchDeleteCall struct { 2017 s *Service 2018 batchdeletealertsrequest *BatchDeleteAlertsRequest 2019 urlParams_ gensupport.URLParams 2020 ctx_ context.Context 2021 header_ http.Header 2022} 2023 2024// BatchDelete: Performs batch delete operation on alerts. 2025func (r *AlertsService) BatchDelete(batchdeletealertsrequest *BatchDeleteAlertsRequest) *AlertsBatchDeleteCall { 2026 c := &AlertsBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2027 c.batchdeletealertsrequest = batchdeletealertsrequest 2028 return c 2029} 2030 2031// Fields allows partial responses to be retrieved. See 2032// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2033// for more information. 2034func (c *AlertsBatchDeleteCall) Fields(s ...googleapi.Field) *AlertsBatchDeleteCall { 2035 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2036 return c 2037} 2038 2039// Context sets the context to be used in this call's Do method. Any 2040// pending HTTP request will be aborted if the provided context is 2041// canceled. 2042func (c *AlertsBatchDeleteCall) Context(ctx context.Context) *AlertsBatchDeleteCall { 2043 c.ctx_ = ctx 2044 return c 2045} 2046 2047// Header returns an http.Header that can be modified by the caller to 2048// add HTTP headers to the request. 2049func (c *AlertsBatchDeleteCall) Header() http.Header { 2050 if c.header_ == nil { 2051 c.header_ = make(http.Header) 2052 } 2053 return c.header_ 2054} 2055 2056func (c *AlertsBatchDeleteCall) doRequest(alt string) (*http.Response, error) { 2057 reqHeaders := make(http.Header) 2058 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 2059 for k, v := range c.header_ { 2060 reqHeaders[k] = v 2061 } 2062 reqHeaders.Set("User-Agent", c.s.userAgent()) 2063 var body io.Reader = nil 2064 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeletealertsrequest) 2065 if err != nil { 2066 return nil, err 2067 } 2068 reqHeaders.Set("Content-Type", "application/json") 2069 c.urlParams_.Set("alt", alt) 2070 c.urlParams_.Set("prettyPrint", "false") 2071 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts:batchDelete") 2072 urls += "?" + c.urlParams_.Encode() 2073 req, err := http.NewRequest("POST", urls, body) 2074 if err != nil { 2075 return nil, err 2076 } 2077 req.Header = reqHeaders 2078 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2079} 2080 2081// Do executes the "alertcenter.alerts.batchDelete" call. 2082// Exactly one of *BatchDeleteAlertsResponse or error will be non-nil. 2083// Any non-2xx status code is an error. Response headers are in either 2084// *BatchDeleteAlertsResponse.ServerResponse.Header or (if a response 2085// was returned at all) in error.(*googleapi.Error).Header. Use 2086// googleapi.IsNotModified to check whether the returned error was 2087// because http.StatusNotModified was returned. 2088func (c *AlertsBatchDeleteCall) Do(opts ...googleapi.CallOption) (*BatchDeleteAlertsResponse, error) { 2089 gensupport.SetOptions(c.urlParams_, opts...) 2090 res, err := c.doRequest("json") 2091 if res != nil && res.StatusCode == http.StatusNotModified { 2092 if res.Body != nil { 2093 res.Body.Close() 2094 } 2095 return nil, &googleapi.Error{ 2096 Code: res.StatusCode, 2097 Header: res.Header, 2098 } 2099 } 2100 if err != nil { 2101 return nil, err 2102 } 2103 defer googleapi.CloseBody(res) 2104 if err := googleapi.CheckResponse(res); err != nil { 2105 return nil, err 2106 } 2107 ret := &BatchDeleteAlertsResponse{ 2108 ServerResponse: googleapi.ServerResponse{ 2109 Header: res.Header, 2110 HTTPStatusCode: res.StatusCode, 2111 }, 2112 } 2113 target := &ret 2114 if err := gensupport.DecodeResponse(target, res); err != nil { 2115 return nil, err 2116 } 2117 return ret, nil 2118 // { 2119 // "description": "Performs batch delete operation on alerts.", 2120 // "flatPath": "v1beta1/alerts:batchDelete", 2121 // "httpMethod": "POST", 2122 // "id": "alertcenter.alerts.batchDelete", 2123 // "parameterOrder": [], 2124 // "parameters": {}, 2125 // "path": "v1beta1/alerts:batchDelete", 2126 // "request": { 2127 // "$ref": "BatchDeleteAlertsRequest" 2128 // }, 2129 // "response": { 2130 // "$ref": "BatchDeleteAlertsResponse" 2131 // }, 2132 // "scopes": [ 2133 // "https://www.googleapis.com/auth/apps.alerts" 2134 // ] 2135 // } 2136 2137} 2138 2139// method id "alertcenter.alerts.batchUndelete": 2140 2141type AlertsBatchUndeleteCall struct { 2142 s *Service 2143 batchundeletealertsrequest *BatchUndeleteAlertsRequest 2144 urlParams_ gensupport.URLParams 2145 ctx_ context.Context 2146 header_ http.Header 2147} 2148 2149// BatchUndelete: Performs batch undelete operation on alerts. 2150func (r *AlertsService) BatchUndelete(batchundeletealertsrequest *BatchUndeleteAlertsRequest) *AlertsBatchUndeleteCall { 2151 c := &AlertsBatchUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2152 c.batchundeletealertsrequest = batchundeletealertsrequest 2153 return c 2154} 2155 2156// Fields allows partial responses to be retrieved. See 2157// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2158// for more information. 2159func (c *AlertsBatchUndeleteCall) Fields(s ...googleapi.Field) *AlertsBatchUndeleteCall { 2160 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2161 return c 2162} 2163 2164// Context sets the context to be used in this call's Do method. Any 2165// pending HTTP request will be aborted if the provided context is 2166// canceled. 2167func (c *AlertsBatchUndeleteCall) Context(ctx context.Context) *AlertsBatchUndeleteCall { 2168 c.ctx_ = ctx 2169 return c 2170} 2171 2172// Header returns an http.Header that can be modified by the caller to 2173// add HTTP headers to the request. 2174func (c *AlertsBatchUndeleteCall) Header() http.Header { 2175 if c.header_ == nil { 2176 c.header_ = make(http.Header) 2177 } 2178 return c.header_ 2179} 2180 2181func (c *AlertsBatchUndeleteCall) doRequest(alt string) (*http.Response, error) { 2182 reqHeaders := make(http.Header) 2183 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 2184 for k, v := range c.header_ { 2185 reqHeaders[k] = v 2186 } 2187 reqHeaders.Set("User-Agent", c.s.userAgent()) 2188 var body io.Reader = nil 2189 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchundeletealertsrequest) 2190 if err != nil { 2191 return nil, err 2192 } 2193 reqHeaders.Set("Content-Type", "application/json") 2194 c.urlParams_.Set("alt", alt) 2195 c.urlParams_.Set("prettyPrint", "false") 2196 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts:batchUndelete") 2197 urls += "?" + c.urlParams_.Encode() 2198 req, err := http.NewRequest("POST", urls, body) 2199 if err != nil { 2200 return nil, err 2201 } 2202 req.Header = reqHeaders 2203 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2204} 2205 2206// Do executes the "alertcenter.alerts.batchUndelete" call. 2207// Exactly one of *BatchUndeleteAlertsResponse or error will be non-nil. 2208// Any non-2xx status code is an error. Response headers are in either 2209// *BatchUndeleteAlertsResponse.ServerResponse.Header or (if a response 2210// was returned at all) in error.(*googleapi.Error).Header. Use 2211// googleapi.IsNotModified to check whether the returned error was 2212// because http.StatusNotModified was returned. 2213func (c *AlertsBatchUndeleteCall) Do(opts ...googleapi.CallOption) (*BatchUndeleteAlertsResponse, error) { 2214 gensupport.SetOptions(c.urlParams_, opts...) 2215 res, err := c.doRequest("json") 2216 if res != nil && res.StatusCode == http.StatusNotModified { 2217 if res.Body != nil { 2218 res.Body.Close() 2219 } 2220 return nil, &googleapi.Error{ 2221 Code: res.StatusCode, 2222 Header: res.Header, 2223 } 2224 } 2225 if err != nil { 2226 return nil, err 2227 } 2228 defer googleapi.CloseBody(res) 2229 if err := googleapi.CheckResponse(res); err != nil { 2230 return nil, err 2231 } 2232 ret := &BatchUndeleteAlertsResponse{ 2233 ServerResponse: googleapi.ServerResponse{ 2234 Header: res.Header, 2235 HTTPStatusCode: res.StatusCode, 2236 }, 2237 } 2238 target := &ret 2239 if err := gensupport.DecodeResponse(target, res); err != nil { 2240 return nil, err 2241 } 2242 return ret, nil 2243 // { 2244 // "description": "Performs batch undelete operation on alerts.", 2245 // "flatPath": "v1beta1/alerts:batchUndelete", 2246 // "httpMethod": "POST", 2247 // "id": "alertcenter.alerts.batchUndelete", 2248 // "parameterOrder": [], 2249 // "parameters": {}, 2250 // "path": "v1beta1/alerts:batchUndelete", 2251 // "request": { 2252 // "$ref": "BatchUndeleteAlertsRequest" 2253 // }, 2254 // "response": { 2255 // "$ref": "BatchUndeleteAlertsResponse" 2256 // }, 2257 // "scopes": [ 2258 // "https://www.googleapis.com/auth/apps.alerts" 2259 // ] 2260 // } 2261 2262} 2263 2264// method id "alertcenter.alerts.delete": 2265 2266type AlertsDeleteCall struct { 2267 s *Service 2268 alertId string 2269 urlParams_ gensupport.URLParams 2270 ctx_ context.Context 2271 header_ http.Header 2272} 2273 2274// Delete: Marks the specified alert for deletion. An alert that has 2275// been marked for 2276// deletion is removed from Alert Center after 30 days. 2277// Marking an alert for deletion has no effect on an alert which 2278// has 2279// already been marked for deletion. Attempting to mark a nonexistent 2280// alert 2281// for deletion results in a `NOT_FOUND` error. 2282func (r *AlertsService) Delete(alertId string) *AlertsDeleteCall { 2283 c := &AlertsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2284 c.alertId = alertId 2285 return c 2286} 2287 2288// CustomerId sets the optional parameter "customerId": The unique 2289// identifier of the G Suite organization account of the 2290// customer the alert is associated with. 2291// Inferred from the caller identity if not provided. 2292func (c *AlertsDeleteCall) CustomerId(customerId string) *AlertsDeleteCall { 2293 c.urlParams_.Set("customerId", customerId) 2294 return c 2295} 2296 2297// Fields allows partial responses to be retrieved. See 2298// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2299// for more information. 2300func (c *AlertsDeleteCall) Fields(s ...googleapi.Field) *AlertsDeleteCall { 2301 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2302 return c 2303} 2304 2305// Context sets the context to be used in this call's Do method. Any 2306// pending HTTP request will be aborted if the provided context is 2307// canceled. 2308func (c *AlertsDeleteCall) Context(ctx context.Context) *AlertsDeleteCall { 2309 c.ctx_ = ctx 2310 return c 2311} 2312 2313// Header returns an http.Header that can be modified by the caller to 2314// add HTTP headers to the request. 2315func (c *AlertsDeleteCall) Header() http.Header { 2316 if c.header_ == nil { 2317 c.header_ = make(http.Header) 2318 } 2319 return c.header_ 2320} 2321 2322func (c *AlertsDeleteCall) doRequest(alt string) (*http.Response, error) { 2323 reqHeaders := make(http.Header) 2324 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 2325 for k, v := range c.header_ { 2326 reqHeaders[k] = v 2327 } 2328 reqHeaders.Set("User-Agent", c.s.userAgent()) 2329 var body io.Reader = nil 2330 c.urlParams_.Set("alt", alt) 2331 c.urlParams_.Set("prettyPrint", "false") 2332 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts/{alertId}") 2333 urls += "?" + c.urlParams_.Encode() 2334 req, err := http.NewRequest("DELETE", urls, body) 2335 if err != nil { 2336 return nil, err 2337 } 2338 req.Header = reqHeaders 2339 googleapi.Expand(req.URL, map[string]string{ 2340 "alertId": c.alertId, 2341 }) 2342 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2343} 2344 2345// Do executes the "alertcenter.alerts.delete" call. 2346// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2347// code is an error. Response headers are in either 2348// *Empty.ServerResponse.Header or (if a response was returned at all) 2349// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2350// check whether the returned error was because http.StatusNotModified 2351// was returned. 2352func (c *AlertsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2353 gensupport.SetOptions(c.urlParams_, opts...) 2354 res, err := c.doRequest("json") 2355 if res != nil && res.StatusCode == http.StatusNotModified { 2356 if res.Body != nil { 2357 res.Body.Close() 2358 } 2359 return nil, &googleapi.Error{ 2360 Code: res.StatusCode, 2361 Header: res.Header, 2362 } 2363 } 2364 if err != nil { 2365 return nil, err 2366 } 2367 defer googleapi.CloseBody(res) 2368 if err := googleapi.CheckResponse(res); err != nil { 2369 return nil, err 2370 } 2371 ret := &Empty{ 2372 ServerResponse: googleapi.ServerResponse{ 2373 Header: res.Header, 2374 HTTPStatusCode: res.StatusCode, 2375 }, 2376 } 2377 target := &ret 2378 if err := gensupport.DecodeResponse(target, res); err != nil { 2379 return nil, err 2380 } 2381 return ret, nil 2382 // { 2383 // "description": "Marks the specified alert for deletion. An alert that has been marked for\ndeletion is removed from Alert Center after 30 days.\nMarking an alert for deletion has no effect on an alert which has\nalready been marked for deletion. Attempting to mark a nonexistent alert\nfor deletion results in a `NOT_FOUND` error.", 2384 // "flatPath": "v1beta1/alerts/{alertId}", 2385 // "httpMethod": "DELETE", 2386 // "id": "alertcenter.alerts.delete", 2387 // "parameterOrder": [ 2388 // "alertId" 2389 // ], 2390 // "parameters": { 2391 // "alertId": { 2392 // "description": "Required. The identifier of the alert to delete.", 2393 // "location": "path", 2394 // "required": true, 2395 // "type": "string" 2396 // }, 2397 // "customerId": { 2398 // "description": "Optional. The unique identifier of the G Suite organization account of the\ncustomer the alert is associated with.\nInferred from the caller identity if not provided.", 2399 // "location": "query", 2400 // "type": "string" 2401 // } 2402 // }, 2403 // "path": "v1beta1/alerts/{alertId}", 2404 // "response": { 2405 // "$ref": "Empty" 2406 // }, 2407 // "scopes": [ 2408 // "https://www.googleapis.com/auth/apps.alerts" 2409 // ] 2410 // } 2411 2412} 2413 2414// method id "alertcenter.alerts.get": 2415 2416type AlertsGetCall struct { 2417 s *Service 2418 alertId string 2419 urlParams_ gensupport.URLParams 2420 ifNoneMatch_ string 2421 ctx_ context.Context 2422 header_ http.Header 2423} 2424 2425// Get: Gets the specified alert. Attempting to get a nonexistent alert 2426// returns 2427// `NOT_FOUND` error. 2428func (r *AlertsService) Get(alertId string) *AlertsGetCall { 2429 c := &AlertsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2430 c.alertId = alertId 2431 return c 2432} 2433 2434// CustomerId sets the optional parameter "customerId": The unique 2435// identifier of the G Suite organization account of the 2436// customer the alert is associated with. 2437// Inferred from the caller identity if not provided. 2438func (c *AlertsGetCall) CustomerId(customerId string) *AlertsGetCall { 2439 c.urlParams_.Set("customerId", customerId) 2440 return c 2441} 2442 2443// Fields allows partial responses to be retrieved. See 2444// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2445// for more information. 2446func (c *AlertsGetCall) Fields(s ...googleapi.Field) *AlertsGetCall { 2447 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2448 return c 2449} 2450 2451// IfNoneMatch sets the optional parameter which makes the operation 2452// fail if the object's ETag matches the given value. This is useful for 2453// getting updates only after the object has changed since the last 2454// request. Use googleapi.IsNotModified to check whether the response 2455// error from Do is the result of In-None-Match. 2456func (c *AlertsGetCall) IfNoneMatch(entityTag string) *AlertsGetCall { 2457 c.ifNoneMatch_ = entityTag 2458 return c 2459} 2460 2461// Context sets the context to be used in this call's Do method. Any 2462// pending HTTP request will be aborted if the provided context is 2463// canceled. 2464func (c *AlertsGetCall) Context(ctx context.Context) *AlertsGetCall { 2465 c.ctx_ = ctx 2466 return c 2467} 2468 2469// Header returns an http.Header that can be modified by the caller to 2470// add HTTP headers to the request. 2471func (c *AlertsGetCall) Header() http.Header { 2472 if c.header_ == nil { 2473 c.header_ = make(http.Header) 2474 } 2475 return c.header_ 2476} 2477 2478func (c *AlertsGetCall) doRequest(alt string) (*http.Response, error) { 2479 reqHeaders := make(http.Header) 2480 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 2481 for k, v := range c.header_ { 2482 reqHeaders[k] = v 2483 } 2484 reqHeaders.Set("User-Agent", c.s.userAgent()) 2485 if c.ifNoneMatch_ != "" { 2486 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2487 } 2488 var body io.Reader = nil 2489 c.urlParams_.Set("alt", alt) 2490 c.urlParams_.Set("prettyPrint", "false") 2491 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts/{alertId}") 2492 urls += "?" + c.urlParams_.Encode() 2493 req, err := http.NewRequest("GET", urls, body) 2494 if err != nil { 2495 return nil, err 2496 } 2497 req.Header = reqHeaders 2498 googleapi.Expand(req.URL, map[string]string{ 2499 "alertId": c.alertId, 2500 }) 2501 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2502} 2503 2504// Do executes the "alertcenter.alerts.get" call. 2505// Exactly one of *Alert or error will be non-nil. Any non-2xx status 2506// code is an error. Response headers are in either 2507// *Alert.ServerResponse.Header or (if a response was returned at all) 2508// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2509// check whether the returned error was because http.StatusNotModified 2510// was returned. 2511func (c *AlertsGetCall) Do(opts ...googleapi.CallOption) (*Alert, error) { 2512 gensupport.SetOptions(c.urlParams_, opts...) 2513 res, err := c.doRequest("json") 2514 if res != nil && res.StatusCode == http.StatusNotModified { 2515 if res.Body != nil { 2516 res.Body.Close() 2517 } 2518 return nil, &googleapi.Error{ 2519 Code: res.StatusCode, 2520 Header: res.Header, 2521 } 2522 } 2523 if err != nil { 2524 return nil, err 2525 } 2526 defer googleapi.CloseBody(res) 2527 if err := googleapi.CheckResponse(res); err != nil { 2528 return nil, err 2529 } 2530 ret := &Alert{ 2531 ServerResponse: googleapi.ServerResponse{ 2532 Header: res.Header, 2533 HTTPStatusCode: res.StatusCode, 2534 }, 2535 } 2536 target := &ret 2537 if err := gensupport.DecodeResponse(target, res); err != nil { 2538 return nil, err 2539 } 2540 return ret, nil 2541 // { 2542 // "description": "Gets the specified alert. Attempting to get a nonexistent alert returns\n`NOT_FOUND` error.", 2543 // "flatPath": "v1beta1/alerts/{alertId}", 2544 // "httpMethod": "GET", 2545 // "id": "alertcenter.alerts.get", 2546 // "parameterOrder": [ 2547 // "alertId" 2548 // ], 2549 // "parameters": { 2550 // "alertId": { 2551 // "description": "Required. The identifier of the alert to retrieve.", 2552 // "location": "path", 2553 // "required": true, 2554 // "type": "string" 2555 // }, 2556 // "customerId": { 2557 // "description": "Optional. The unique identifier of the G Suite organization account of the\ncustomer the alert is associated with.\nInferred from the caller identity if not provided.", 2558 // "location": "query", 2559 // "type": "string" 2560 // } 2561 // }, 2562 // "path": "v1beta1/alerts/{alertId}", 2563 // "response": { 2564 // "$ref": "Alert" 2565 // }, 2566 // "scopes": [ 2567 // "https://www.googleapis.com/auth/apps.alerts" 2568 // ] 2569 // } 2570 2571} 2572 2573// method id "alertcenter.alerts.getMetadata": 2574 2575type AlertsGetMetadataCall struct { 2576 s *Service 2577 alertId string 2578 urlParams_ gensupport.URLParams 2579 ifNoneMatch_ string 2580 ctx_ context.Context 2581 header_ http.Header 2582} 2583 2584// GetMetadata: Returns the metadata of an alert. Attempting to get 2585// metadata for 2586// a non-existent alert returns `NOT_FOUND` error. 2587func (r *AlertsService) GetMetadata(alertId string) *AlertsGetMetadataCall { 2588 c := &AlertsGetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2589 c.alertId = alertId 2590 return c 2591} 2592 2593// CustomerId sets the optional parameter "customerId": The unique 2594// identifier of the G Suite organization account of the 2595// customer the alert metadata is associated with. 2596// Inferred from the caller identity if not provided. 2597func (c *AlertsGetMetadataCall) CustomerId(customerId string) *AlertsGetMetadataCall { 2598 c.urlParams_.Set("customerId", customerId) 2599 return c 2600} 2601 2602// Fields allows partial responses to be retrieved. See 2603// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2604// for more information. 2605func (c *AlertsGetMetadataCall) Fields(s ...googleapi.Field) *AlertsGetMetadataCall { 2606 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2607 return c 2608} 2609 2610// IfNoneMatch sets the optional parameter which makes the operation 2611// fail if the object's ETag matches the given value. This is useful for 2612// getting updates only after the object has changed since the last 2613// request. Use googleapi.IsNotModified to check whether the response 2614// error from Do is the result of In-None-Match. 2615func (c *AlertsGetMetadataCall) IfNoneMatch(entityTag string) *AlertsGetMetadataCall { 2616 c.ifNoneMatch_ = entityTag 2617 return c 2618} 2619 2620// Context sets the context to be used in this call's Do method. Any 2621// pending HTTP request will be aborted if the provided context is 2622// canceled. 2623func (c *AlertsGetMetadataCall) Context(ctx context.Context) *AlertsGetMetadataCall { 2624 c.ctx_ = ctx 2625 return c 2626} 2627 2628// Header returns an http.Header that can be modified by the caller to 2629// add HTTP headers to the request. 2630func (c *AlertsGetMetadataCall) Header() http.Header { 2631 if c.header_ == nil { 2632 c.header_ = make(http.Header) 2633 } 2634 return c.header_ 2635} 2636 2637func (c *AlertsGetMetadataCall) doRequest(alt string) (*http.Response, error) { 2638 reqHeaders := make(http.Header) 2639 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 2640 for k, v := range c.header_ { 2641 reqHeaders[k] = v 2642 } 2643 reqHeaders.Set("User-Agent", c.s.userAgent()) 2644 if c.ifNoneMatch_ != "" { 2645 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2646 } 2647 var body io.Reader = nil 2648 c.urlParams_.Set("alt", alt) 2649 c.urlParams_.Set("prettyPrint", "false") 2650 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts/{alertId}/metadata") 2651 urls += "?" + c.urlParams_.Encode() 2652 req, err := http.NewRequest("GET", urls, body) 2653 if err != nil { 2654 return nil, err 2655 } 2656 req.Header = reqHeaders 2657 googleapi.Expand(req.URL, map[string]string{ 2658 "alertId": c.alertId, 2659 }) 2660 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2661} 2662 2663// Do executes the "alertcenter.alerts.getMetadata" call. 2664// Exactly one of *AlertMetadata or error will be non-nil. Any non-2xx 2665// status code is an error. Response headers are in either 2666// *AlertMetadata.ServerResponse.Header or (if a response was returned 2667// at all) in error.(*googleapi.Error).Header. Use 2668// googleapi.IsNotModified to check whether the returned error was 2669// because http.StatusNotModified was returned. 2670func (c *AlertsGetMetadataCall) Do(opts ...googleapi.CallOption) (*AlertMetadata, error) { 2671 gensupport.SetOptions(c.urlParams_, opts...) 2672 res, err := c.doRequest("json") 2673 if res != nil && res.StatusCode == http.StatusNotModified { 2674 if res.Body != nil { 2675 res.Body.Close() 2676 } 2677 return nil, &googleapi.Error{ 2678 Code: res.StatusCode, 2679 Header: res.Header, 2680 } 2681 } 2682 if err != nil { 2683 return nil, err 2684 } 2685 defer googleapi.CloseBody(res) 2686 if err := googleapi.CheckResponse(res); err != nil { 2687 return nil, err 2688 } 2689 ret := &AlertMetadata{ 2690 ServerResponse: googleapi.ServerResponse{ 2691 Header: res.Header, 2692 HTTPStatusCode: res.StatusCode, 2693 }, 2694 } 2695 target := &ret 2696 if err := gensupport.DecodeResponse(target, res); err != nil { 2697 return nil, err 2698 } 2699 return ret, nil 2700 // { 2701 // "description": "Returns the metadata of an alert. Attempting to get metadata for\na non-existent alert returns `NOT_FOUND` error.", 2702 // "flatPath": "v1beta1/alerts/{alertId}/metadata", 2703 // "httpMethod": "GET", 2704 // "id": "alertcenter.alerts.getMetadata", 2705 // "parameterOrder": [ 2706 // "alertId" 2707 // ], 2708 // "parameters": { 2709 // "alertId": { 2710 // "description": "Required. The identifier of the alert this metadata belongs to.", 2711 // "location": "path", 2712 // "required": true, 2713 // "type": "string" 2714 // }, 2715 // "customerId": { 2716 // "description": "Optional. The unique identifier of the G Suite organization account of the\ncustomer the alert metadata is associated with.\nInferred from the caller identity if not provided.", 2717 // "location": "query", 2718 // "type": "string" 2719 // } 2720 // }, 2721 // "path": "v1beta1/alerts/{alertId}/metadata", 2722 // "response": { 2723 // "$ref": "AlertMetadata" 2724 // }, 2725 // "scopes": [ 2726 // "https://www.googleapis.com/auth/apps.alerts" 2727 // ] 2728 // } 2729 2730} 2731 2732// method id "alertcenter.alerts.list": 2733 2734type AlertsListCall struct { 2735 s *Service 2736 urlParams_ gensupport.URLParams 2737 ifNoneMatch_ string 2738 ctx_ context.Context 2739 header_ http.Header 2740} 2741 2742// List: Lists the alerts. 2743func (r *AlertsService) List() *AlertsListCall { 2744 c := &AlertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2745 return c 2746} 2747 2748// CustomerId sets the optional parameter "customerId": The unique 2749// identifier of the G Suite organization account of the 2750// customer the alerts are associated with. 2751// Inferred from the caller identity if not provided. 2752func (c *AlertsListCall) CustomerId(customerId string) *AlertsListCall { 2753 c.urlParams_.Set("customerId", customerId) 2754 return c 2755} 2756 2757// Filter sets the optional parameter "filter": A query string for 2758// filtering alert results. 2759// For more details, see 2760// [Query 2761// filters](/admin-sdk/alertcenter/guides/query-filters) and 2762// [Supported 2763// query 2764// filter 2765// fields](/admin-sdk/alertcenter/reference/filter-fields#alerts.l 2766// ist). 2767func (c *AlertsListCall) Filter(filter string) *AlertsListCall { 2768 c.urlParams_.Set("filter", filter) 2769 return c 2770} 2771 2772// OrderBy sets the optional parameter "orderBy": The sort order of the 2773// list results. 2774// If not specified results may be returned in arbitrary order. 2775// You can sort the results in descending order based on the 2776// creation 2777// timestamp using `order_by="create_time desc". 2778// Currently, supported sorting are `create_time asc`, `create_time 2779// desc`, 2780// `update_time desc` 2781func (c *AlertsListCall) OrderBy(orderBy string) *AlertsListCall { 2782 c.urlParams_.Set("orderBy", orderBy) 2783 return c 2784} 2785 2786// PageSize sets the optional parameter "pageSize": The requested page 2787// size. Server may return fewer items than 2788// requested. If unspecified, server picks an appropriate default. 2789func (c *AlertsListCall) PageSize(pageSize int64) *AlertsListCall { 2790 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2791 return c 2792} 2793 2794// PageToken sets the optional parameter "pageToken": A token 2795// identifying a page of results the server should return. 2796// If empty, a new iteration is started. To continue an iteration, pass 2797// in 2798// the value from the previous ListAlertsResponse's 2799// next_page_token field. 2800func (c *AlertsListCall) PageToken(pageToken string) *AlertsListCall { 2801 c.urlParams_.Set("pageToken", pageToken) 2802 return c 2803} 2804 2805// Fields allows partial responses to be retrieved. See 2806// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2807// for more information. 2808func (c *AlertsListCall) Fields(s ...googleapi.Field) *AlertsListCall { 2809 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2810 return c 2811} 2812 2813// IfNoneMatch sets the optional parameter which makes the operation 2814// fail if the object's ETag matches the given value. This is useful for 2815// getting updates only after the object has changed since the last 2816// request. Use googleapi.IsNotModified to check whether the response 2817// error from Do is the result of In-None-Match. 2818func (c *AlertsListCall) IfNoneMatch(entityTag string) *AlertsListCall { 2819 c.ifNoneMatch_ = entityTag 2820 return c 2821} 2822 2823// Context sets the context to be used in this call's Do method. Any 2824// pending HTTP request will be aborted if the provided context is 2825// canceled. 2826func (c *AlertsListCall) Context(ctx context.Context) *AlertsListCall { 2827 c.ctx_ = ctx 2828 return c 2829} 2830 2831// Header returns an http.Header that can be modified by the caller to 2832// add HTTP headers to the request. 2833func (c *AlertsListCall) Header() http.Header { 2834 if c.header_ == nil { 2835 c.header_ = make(http.Header) 2836 } 2837 return c.header_ 2838} 2839 2840func (c *AlertsListCall) doRequest(alt string) (*http.Response, error) { 2841 reqHeaders := make(http.Header) 2842 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 2843 for k, v := range c.header_ { 2844 reqHeaders[k] = v 2845 } 2846 reqHeaders.Set("User-Agent", c.s.userAgent()) 2847 if c.ifNoneMatch_ != "" { 2848 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2849 } 2850 var body io.Reader = nil 2851 c.urlParams_.Set("alt", alt) 2852 c.urlParams_.Set("prettyPrint", "false") 2853 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts") 2854 urls += "?" + c.urlParams_.Encode() 2855 req, err := http.NewRequest("GET", urls, body) 2856 if err != nil { 2857 return nil, err 2858 } 2859 req.Header = reqHeaders 2860 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2861} 2862 2863// Do executes the "alertcenter.alerts.list" call. 2864// Exactly one of *ListAlertsResponse or error will be non-nil. Any 2865// non-2xx status code is an error. Response headers are in either 2866// *ListAlertsResponse.ServerResponse.Header or (if a response was 2867// returned at all) in error.(*googleapi.Error).Header. Use 2868// googleapi.IsNotModified to check whether the returned error was 2869// because http.StatusNotModified was returned. 2870func (c *AlertsListCall) Do(opts ...googleapi.CallOption) (*ListAlertsResponse, error) { 2871 gensupport.SetOptions(c.urlParams_, opts...) 2872 res, err := c.doRequest("json") 2873 if res != nil && res.StatusCode == http.StatusNotModified { 2874 if res.Body != nil { 2875 res.Body.Close() 2876 } 2877 return nil, &googleapi.Error{ 2878 Code: res.StatusCode, 2879 Header: res.Header, 2880 } 2881 } 2882 if err != nil { 2883 return nil, err 2884 } 2885 defer googleapi.CloseBody(res) 2886 if err := googleapi.CheckResponse(res); err != nil { 2887 return nil, err 2888 } 2889 ret := &ListAlertsResponse{ 2890 ServerResponse: googleapi.ServerResponse{ 2891 Header: res.Header, 2892 HTTPStatusCode: res.StatusCode, 2893 }, 2894 } 2895 target := &ret 2896 if err := gensupport.DecodeResponse(target, res); err != nil { 2897 return nil, err 2898 } 2899 return ret, nil 2900 // { 2901 // "description": "Lists the alerts.", 2902 // "flatPath": "v1beta1/alerts", 2903 // "httpMethod": "GET", 2904 // "id": "alertcenter.alerts.list", 2905 // "parameterOrder": [], 2906 // "parameters": { 2907 // "customerId": { 2908 // "description": "Optional. The unique identifier of the G Suite organization account of the\ncustomer the alerts are associated with.\nInferred from the caller identity if not provided.", 2909 // "location": "query", 2910 // "type": "string" 2911 // }, 2912 // "filter": { 2913 // "description": "Optional. A query string for filtering alert results.\nFor more details, see [Query\nfilters](/admin-sdk/alertcenter/guides/query-filters) and [Supported\nquery filter\nfields](/admin-sdk/alertcenter/reference/filter-fields#alerts.list).", 2914 // "location": "query", 2915 // "type": "string" 2916 // }, 2917 // "orderBy": { 2918 // "description": "Optional. The sort order of the list results.\nIf not specified results may be returned in arbitrary order.\nYou can sort the results in descending order based on the creation\ntimestamp using `order_by=\"create_time desc\"`.\nCurrently, supported sorting are `create_time asc`, `create_time desc`,\n`update_time desc`", 2919 // "location": "query", 2920 // "type": "string" 2921 // }, 2922 // "pageSize": { 2923 // "description": "Optional. The requested page size. Server may return fewer items than\nrequested. If unspecified, server picks an appropriate default.", 2924 // "format": "int32", 2925 // "location": "query", 2926 // "type": "integer" 2927 // }, 2928 // "pageToken": { 2929 // "description": "Optional. A token identifying a page of results the server should return.\nIf empty, a new iteration is started. To continue an iteration, pass in\nthe value from the previous ListAlertsResponse's\nnext_page_token field.", 2930 // "location": "query", 2931 // "type": "string" 2932 // } 2933 // }, 2934 // "path": "v1beta1/alerts", 2935 // "response": { 2936 // "$ref": "ListAlertsResponse" 2937 // }, 2938 // "scopes": [ 2939 // "https://www.googleapis.com/auth/apps.alerts" 2940 // ] 2941 // } 2942 2943} 2944 2945// Pages invokes f for each page of results. 2946// A non-nil error returned from f will halt the iteration. 2947// The provided context supersedes any context provided to the Context method. 2948func (c *AlertsListCall) Pages(ctx context.Context, f func(*ListAlertsResponse) error) error { 2949 c.ctx_ = ctx 2950 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2951 for { 2952 x, err := c.Do() 2953 if err != nil { 2954 return err 2955 } 2956 if err := f(x); err != nil { 2957 return err 2958 } 2959 if x.NextPageToken == "" { 2960 return nil 2961 } 2962 c.PageToken(x.NextPageToken) 2963 } 2964} 2965 2966// method id "alertcenter.alerts.undelete": 2967 2968type AlertsUndeleteCall struct { 2969 s *Service 2970 alertId string 2971 undeletealertrequest *UndeleteAlertRequest 2972 urlParams_ gensupport.URLParams 2973 ctx_ context.Context 2974 header_ http.Header 2975} 2976 2977// Undelete: Restores, or "undeletes", an alert that was marked for 2978// deletion within the 2979// past 30 days. Attempting to undelete an alert which was marked for 2980// deletion 2981// over 30 days ago (which has been removed from the Alert Center 2982// database) or 2983// a nonexistent alert returns a `NOT_FOUND` error. Attempting 2984// to 2985// undelete an alert which has not been marked for deletion has no 2986// effect. 2987func (r *AlertsService) Undelete(alertId string, undeletealertrequest *UndeleteAlertRequest) *AlertsUndeleteCall { 2988 c := &AlertsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2989 c.alertId = alertId 2990 c.undeletealertrequest = undeletealertrequest 2991 return c 2992} 2993 2994// Fields allows partial responses to be retrieved. See 2995// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2996// for more information. 2997func (c *AlertsUndeleteCall) Fields(s ...googleapi.Field) *AlertsUndeleteCall { 2998 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2999 return c 3000} 3001 3002// Context sets the context to be used in this call's Do method. Any 3003// pending HTTP request will be aborted if the provided context is 3004// canceled. 3005func (c *AlertsUndeleteCall) Context(ctx context.Context) *AlertsUndeleteCall { 3006 c.ctx_ = ctx 3007 return c 3008} 3009 3010// Header returns an http.Header that can be modified by the caller to 3011// add HTTP headers to the request. 3012func (c *AlertsUndeleteCall) Header() http.Header { 3013 if c.header_ == nil { 3014 c.header_ = make(http.Header) 3015 } 3016 return c.header_ 3017} 3018 3019func (c *AlertsUndeleteCall) doRequest(alt string) (*http.Response, error) { 3020 reqHeaders := make(http.Header) 3021 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 3022 for k, v := range c.header_ { 3023 reqHeaders[k] = v 3024 } 3025 reqHeaders.Set("User-Agent", c.s.userAgent()) 3026 var body io.Reader = nil 3027 body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletealertrequest) 3028 if err != nil { 3029 return nil, err 3030 } 3031 reqHeaders.Set("Content-Type", "application/json") 3032 c.urlParams_.Set("alt", alt) 3033 c.urlParams_.Set("prettyPrint", "false") 3034 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts/{alertId}:undelete") 3035 urls += "?" + c.urlParams_.Encode() 3036 req, err := http.NewRequest("POST", urls, body) 3037 if err != nil { 3038 return nil, err 3039 } 3040 req.Header = reqHeaders 3041 googleapi.Expand(req.URL, map[string]string{ 3042 "alertId": c.alertId, 3043 }) 3044 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3045} 3046 3047// Do executes the "alertcenter.alerts.undelete" call. 3048// Exactly one of *Alert or error will be non-nil. Any non-2xx status 3049// code is an error. Response headers are in either 3050// *Alert.ServerResponse.Header or (if a response was returned at all) 3051// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3052// check whether the returned error was because http.StatusNotModified 3053// was returned. 3054func (c *AlertsUndeleteCall) Do(opts ...googleapi.CallOption) (*Alert, error) { 3055 gensupport.SetOptions(c.urlParams_, opts...) 3056 res, err := c.doRequest("json") 3057 if res != nil && res.StatusCode == http.StatusNotModified { 3058 if res.Body != nil { 3059 res.Body.Close() 3060 } 3061 return nil, &googleapi.Error{ 3062 Code: res.StatusCode, 3063 Header: res.Header, 3064 } 3065 } 3066 if err != nil { 3067 return nil, err 3068 } 3069 defer googleapi.CloseBody(res) 3070 if err := googleapi.CheckResponse(res); err != nil { 3071 return nil, err 3072 } 3073 ret := &Alert{ 3074 ServerResponse: googleapi.ServerResponse{ 3075 Header: res.Header, 3076 HTTPStatusCode: res.StatusCode, 3077 }, 3078 } 3079 target := &ret 3080 if err := gensupport.DecodeResponse(target, res); err != nil { 3081 return nil, err 3082 } 3083 return ret, nil 3084 // { 3085 // "description": "Restores, or \"undeletes\", an alert that was marked for deletion within the\npast 30 days. Attempting to undelete an alert which was marked for deletion\nover 30 days ago (which has been removed from the Alert Center database) or\na nonexistent alert returns a `NOT_FOUND` error. Attempting to\nundelete an alert which has not been marked for deletion has no effect.", 3086 // "flatPath": "v1beta1/alerts/{alertId}:undelete", 3087 // "httpMethod": "POST", 3088 // "id": "alertcenter.alerts.undelete", 3089 // "parameterOrder": [ 3090 // "alertId" 3091 // ], 3092 // "parameters": { 3093 // "alertId": { 3094 // "description": "Required. The identifier of the alert to undelete.", 3095 // "location": "path", 3096 // "required": true, 3097 // "type": "string" 3098 // } 3099 // }, 3100 // "path": "v1beta1/alerts/{alertId}:undelete", 3101 // "request": { 3102 // "$ref": "UndeleteAlertRequest" 3103 // }, 3104 // "response": { 3105 // "$ref": "Alert" 3106 // }, 3107 // "scopes": [ 3108 // "https://www.googleapis.com/auth/apps.alerts" 3109 // ] 3110 // } 3111 3112} 3113 3114// method id "alertcenter.alerts.feedback.create": 3115 3116type AlertsFeedbackCreateCall struct { 3117 s *Service 3118 alertId string 3119 alertfeedback *AlertFeedback 3120 urlParams_ gensupport.URLParams 3121 ctx_ context.Context 3122 header_ http.Header 3123} 3124 3125// Create: Creates new feedback for an alert. Attempting to create a 3126// feedback for 3127// a non-existent alert returns `NOT_FOUND` error. Attempting to create 3128// a 3129// feedback for an alert that is marked for deletion 3130// returns 3131// `FAILED_PRECONDITION' error. 3132func (r *AlertsFeedbackService) Create(alertId string, alertfeedback *AlertFeedback) *AlertsFeedbackCreateCall { 3133 c := &AlertsFeedbackCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3134 c.alertId = alertId 3135 c.alertfeedback = alertfeedback 3136 return c 3137} 3138 3139// CustomerId sets the optional parameter "customerId": The unique 3140// identifier of the G Suite organization account of the 3141// customer the alert is associated with. 3142// Inferred from the caller identity if not provided. 3143func (c *AlertsFeedbackCreateCall) CustomerId(customerId string) *AlertsFeedbackCreateCall { 3144 c.urlParams_.Set("customerId", customerId) 3145 return c 3146} 3147 3148// Fields allows partial responses to be retrieved. See 3149// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3150// for more information. 3151func (c *AlertsFeedbackCreateCall) Fields(s ...googleapi.Field) *AlertsFeedbackCreateCall { 3152 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3153 return c 3154} 3155 3156// Context sets the context to be used in this call's Do method. Any 3157// pending HTTP request will be aborted if the provided context is 3158// canceled. 3159func (c *AlertsFeedbackCreateCall) Context(ctx context.Context) *AlertsFeedbackCreateCall { 3160 c.ctx_ = ctx 3161 return c 3162} 3163 3164// Header returns an http.Header that can be modified by the caller to 3165// add HTTP headers to the request. 3166func (c *AlertsFeedbackCreateCall) Header() http.Header { 3167 if c.header_ == nil { 3168 c.header_ = make(http.Header) 3169 } 3170 return c.header_ 3171} 3172 3173func (c *AlertsFeedbackCreateCall) doRequest(alt string) (*http.Response, error) { 3174 reqHeaders := make(http.Header) 3175 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 3176 for k, v := range c.header_ { 3177 reqHeaders[k] = v 3178 } 3179 reqHeaders.Set("User-Agent", c.s.userAgent()) 3180 var body io.Reader = nil 3181 body, err := googleapi.WithoutDataWrapper.JSONReader(c.alertfeedback) 3182 if err != nil { 3183 return nil, err 3184 } 3185 reqHeaders.Set("Content-Type", "application/json") 3186 c.urlParams_.Set("alt", alt) 3187 c.urlParams_.Set("prettyPrint", "false") 3188 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts/{alertId}/feedback") 3189 urls += "?" + c.urlParams_.Encode() 3190 req, err := http.NewRequest("POST", urls, body) 3191 if err != nil { 3192 return nil, err 3193 } 3194 req.Header = reqHeaders 3195 googleapi.Expand(req.URL, map[string]string{ 3196 "alertId": c.alertId, 3197 }) 3198 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3199} 3200 3201// Do executes the "alertcenter.alerts.feedback.create" call. 3202// Exactly one of *AlertFeedback or error will be non-nil. Any non-2xx 3203// status code is an error. Response headers are in either 3204// *AlertFeedback.ServerResponse.Header or (if a response was returned 3205// at all) in error.(*googleapi.Error).Header. Use 3206// googleapi.IsNotModified to check whether the returned error was 3207// because http.StatusNotModified was returned. 3208func (c *AlertsFeedbackCreateCall) Do(opts ...googleapi.CallOption) (*AlertFeedback, error) { 3209 gensupport.SetOptions(c.urlParams_, opts...) 3210 res, err := c.doRequest("json") 3211 if res != nil && res.StatusCode == http.StatusNotModified { 3212 if res.Body != nil { 3213 res.Body.Close() 3214 } 3215 return nil, &googleapi.Error{ 3216 Code: res.StatusCode, 3217 Header: res.Header, 3218 } 3219 } 3220 if err != nil { 3221 return nil, err 3222 } 3223 defer googleapi.CloseBody(res) 3224 if err := googleapi.CheckResponse(res); err != nil { 3225 return nil, err 3226 } 3227 ret := &AlertFeedback{ 3228 ServerResponse: googleapi.ServerResponse{ 3229 Header: res.Header, 3230 HTTPStatusCode: res.StatusCode, 3231 }, 3232 } 3233 target := &ret 3234 if err := gensupport.DecodeResponse(target, res); err != nil { 3235 return nil, err 3236 } 3237 return ret, nil 3238 // { 3239 // "description": "Creates new feedback for an alert. Attempting to create a feedback for\na non-existent alert returns `NOT_FOUND` error. Attempting to create a\nfeedback for an alert that is marked for deletion returns\n`FAILED_PRECONDITION' error.", 3240 // "flatPath": "v1beta1/alerts/{alertId}/feedback", 3241 // "httpMethod": "POST", 3242 // "id": "alertcenter.alerts.feedback.create", 3243 // "parameterOrder": [ 3244 // "alertId" 3245 // ], 3246 // "parameters": { 3247 // "alertId": { 3248 // "description": "Required. The identifier of the alert this feedback belongs to.", 3249 // "location": "path", 3250 // "required": true, 3251 // "type": "string" 3252 // }, 3253 // "customerId": { 3254 // "description": "Optional. The unique identifier of the G Suite organization account of the\ncustomer the alert is associated with.\nInferred from the caller identity if not provided.", 3255 // "location": "query", 3256 // "type": "string" 3257 // } 3258 // }, 3259 // "path": "v1beta1/alerts/{alertId}/feedback", 3260 // "request": { 3261 // "$ref": "AlertFeedback" 3262 // }, 3263 // "response": { 3264 // "$ref": "AlertFeedback" 3265 // }, 3266 // "scopes": [ 3267 // "https://www.googleapis.com/auth/apps.alerts" 3268 // ] 3269 // } 3270 3271} 3272 3273// method id "alertcenter.alerts.feedback.list": 3274 3275type AlertsFeedbackListCall struct { 3276 s *Service 3277 alertId string 3278 urlParams_ gensupport.URLParams 3279 ifNoneMatch_ string 3280 ctx_ context.Context 3281 header_ http.Header 3282} 3283 3284// List: Lists all the feedback for an alert. Attempting to list 3285// feedbacks for 3286// a non-existent alert returns `NOT_FOUND` error. 3287func (r *AlertsFeedbackService) List(alertId string) *AlertsFeedbackListCall { 3288 c := &AlertsFeedbackListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3289 c.alertId = alertId 3290 return c 3291} 3292 3293// CustomerId sets the optional parameter "customerId": The unique 3294// identifier of the G Suite organization account of the 3295// customer the alert feedback are associated with. 3296// Inferred from the caller identity if not provided. 3297func (c *AlertsFeedbackListCall) CustomerId(customerId string) *AlertsFeedbackListCall { 3298 c.urlParams_.Set("customerId", customerId) 3299 return c 3300} 3301 3302// Filter sets the optional parameter "filter": A query string for 3303// filtering alert feedback results. 3304// For more details, see 3305// [Query 3306// filters](/admin-sdk/alertcenter/guides/query-filters) and 3307// [Supported 3308// query 3309// filter 3310// fields](/admin-sdk/alertcenter/reference/filter-fields#alerts.f 3311// eedback.list). 3312func (c *AlertsFeedbackListCall) Filter(filter string) *AlertsFeedbackListCall { 3313 c.urlParams_.Set("filter", filter) 3314 return c 3315} 3316 3317// Fields allows partial responses to be retrieved. See 3318// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3319// for more information. 3320func (c *AlertsFeedbackListCall) Fields(s ...googleapi.Field) *AlertsFeedbackListCall { 3321 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3322 return c 3323} 3324 3325// IfNoneMatch sets the optional parameter which makes the operation 3326// fail if the object's ETag matches the given value. This is useful for 3327// getting updates only after the object has changed since the last 3328// request. Use googleapi.IsNotModified to check whether the response 3329// error from Do is the result of In-None-Match. 3330func (c *AlertsFeedbackListCall) IfNoneMatch(entityTag string) *AlertsFeedbackListCall { 3331 c.ifNoneMatch_ = entityTag 3332 return c 3333} 3334 3335// Context sets the context to be used in this call's Do method. Any 3336// pending HTTP request will be aborted if the provided context is 3337// canceled. 3338func (c *AlertsFeedbackListCall) Context(ctx context.Context) *AlertsFeedbackListCall { 3339 c.ctx_ = ctx 3340 return c 3341} 3342 3343// Header returns an http.Header that can be modified by the caller to 3344// add HTTP headers to the request. 3345func (c *AlertsFeedbackListCall) Header() http.Header { 3346 if c.header_ == nil { 3347 c.header_ = make(http.Header) 3348 } 3349 return c.header_ 3350} 3351 3352func (c *AlertsFeedbackListCall) doRequest(alt string) (*http.Response, error) { 3353 reqHeaders := make(http.Header) 3354 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 3355 for k, v := range c.header_ { 3356 reqHeaders[k] = v 3357 } 3358 reqHeaders.Set("User-Agent", c.s.userAgent()) 3359 if c.ifNoneMatch_ != "" { 3360 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3361 } 3362 var body io.Reader = nil 3363 c.urlParams_.Set("alt", alt) 3364 c.urlParams_.Set("prettyPrint", "false") 3365 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/alerts/{alertId}/feedback") 3366 urls += "?" + c.urlParams_.Encode() 3367 req, err := http.NewRequest("GET", urls, body) 3368 if err != nil { 3369 return nil, err 3370 } 3371 req.Header = reqHeaders 3372 googleapi.Expand(req.URL, map[string]string{ 3373 "alertId": c.alertId, 3374 }) 3375 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3376} 3377 3378// Do executes the "alertcenter.alerts.feedback.list" call. 3379// Exactly one of *ListAlertFeedbackResponse or error will be non-nil. 3380// Any non-2xx status code is an error. Response headers are in either 3381// *ListAlertFeedbackResponse.ServerResponse.Header or (if a response 3382// was returned at all) in error.(*googleapi.Error).Header. Use 3383// googleapi.IsNotModified to check whether the returned error was 3384// because http.StatusNotModified was returned. 3385func (c *AlertsFeedbackListCall) Do(opts ...googleapi.CallOption) (*ListAlertFeedbackResponse, error) { 3386 gensupport.SetOptions(c.urlParams_, opts...) 3387 res, err := c.doRequest("json") 3388 if res != nil && res.StatusCode == http.StatusNotModified { 3389 if res.Body != nil { 3390 res.Body.Close() 3391 } 3392 return nil, &googleapi.Error{ 3393 Code: res.StatusCode, 3394 Header: res.Header, 3395 } 3396 } 3397 if err != nil { 3398 return nil, err 3399 } 3400 defer googleapi.CloseBody(res) 3401 if err := googleapi.CheckResponse(res); err != nil { 3402 return nil, err 3403 } 3404 ret := &ListAlertFeedbackResponse{ 3405 ServerResponse: googleapi.ServerResponse{ 3406 Header: res.Header, 3407 HTTPStatusCode: res.StatusCode, 3408 }, 3409 } 3410 target := &ret 3411 if err := gensupport.DecodeResponse(target, res); err != nil { 3412 return nil, err 3413 } 3414 return ret, nil 3415 // { 3416 // "description": "Lists all the feedback for an alert. Attempting to list feedbacks for\na non-existent alert returns `NOT_FOUND` error.", 3417 // "flatPath": "v1beta1/alerts/{alertId}/feedback", 3418 // "httpMethod": "GET", 3419 // "id": "alertcenter.alerts.feedback.list", 3420 // "parameterOrder": [ 3421 // "alertId" 3422 // ], 3423 // "parameters": { 3424 // "alertId": { 3425 // "description": "Required. The alert identifier.\nThe \"-\" wildcard could be used to represent all alerts.", 3426 // "location": "path", 3427 // "required": true, 3428 // "type": "string" 3429 // }, 3430 // "customerId": { 3431 // "description": "Optional. The unique identifier of the G Suite organization account of the\ncustomer the alert feedback are associated with.\nInferred from the caller identity if not provided.", 3432 // "location": "query", 3433 // "type": "string" 3434 // }, 3435 // "filter": { 3436 // "description": "Optional. A query string for filtering alert feedback results.\nFor more details, see [Query\nfilters](/admin-sdk/alertcenter/guides/query-filters) and [Supported\nquery filter\nfields](/admin-sdk/alertcenter/reference/filter-fields#alerts.feedback.list).", 3437 // "location": "query", 3438 // "type": "string" 3439 // } 3440 // }, 3441 // "path": "v1beta1/alerts/{alertId}/feedback", 3442 // "response": { 3443 // "$ref": "ListAlertFeedbackResponse" 3444 // }, 3445 // "scopes": [ 3446 // "https://www.googleapis.com/auth/apps.alerts" 3447 // ] 3448 // } 3449 3450} 3451 3452// method id "alertcenter.getSettings": 3453 3454type V1beta1GetSettingsCall struct { 3455 s *Service 3456 urlParams_ gensupport.URLParams 3457 ifNoneMatch_ string 3458 ctx_ context.Context 3459 header_ http.Header 3460} 3461 3462// GetSettings: Returns customer-level settings. 3463func (r *V1beta1Service) GetSettings() *V1beta1GetSettingsCall { 3464 c := &V1beta1GetSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3465 return c 3466} 3467 3468// CustomerId sets the optional parameter "customerId": The unique 3469// identifier of the G Suite organization account of the 3470// customer the alert settings are associated with. 3471// Inferred from the caller identity if not provided. 3472func (c *V1beta1GetSettingsCall) CustomerId(customerId string) *V1beta1GetSettingsCall { 3473 c.urlParams_.Set("customerId", customerId) 3474 return c 3475} 3476 3477// Fields allows partial responses to be retrieved. See 3478// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3479// for more information. 3480func (c *V1beta1GetSettingsCall) Fields(s ...googleapi.Field) *V1beta1GetSettingsCall { 3481 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3482 return c 3483} 3484 3485// IfNoneMatch sets the optional parameter which makes the operation 3486// fail if the object's ETag matches the given value. This is useful for 3487// getting updates only after the object has changed since the last 3488// request. Use googleapi.IsNotModified to check whether the response 3489// error from Do is the result of In-None-Match. 3490func (c *V1beta1GetSettingsCall) IfNoneMatch(entityTag string) *V1beta1GetSettingsCall { 3491 c.ifNoneMatch_ = entityTag 3492 return c 3493} 3494 3495// Context sets the context to be used in this call's Do method. Any 3496// pending HTTP request will be aborted if the provided context is 3497// canceled. 3498func (c *V1beta1GetSettingsCall) Context(ctx context.Context) *V1beta1GetSettingsCall { 3499 c.ctx_ = ctx 3500 return c 3501} 3502 3503// Header returns an http.Header that can be modified by the caller to 3504// add HTTP headers to the request. 3505func (c *V1beta1GetSettingsCall) Header() http.Header { 3506 if c.header_ == nil { 3507 c.header_ = make(http.Header) 3508 } 3509 return c.header_ 3510} 3511 3512func (c *V1beta1GetSettingsCall) doRequest(alt string) (*http.Response, error) { 3513 reqHeaders := make(http.Header) 3514 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 3515 for k, v := range c.header_ { 3516 reqHeaders[k] = v 3517 } 3518 reqHeaders.Set("User-Agent", c.s.userAgent()) 3519 if c.ifNoneMatch_ != "" { 3520 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3521 } 3522 var body io.Reader = nil 3523 c.urlParams_.Set("alt", alt) 3524 c.urlParams_.Set("prettyPrint", "false") 3525 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/settings") 3526 urls += "?" + c.urlParams_.Encode() 3527 req, err := http.NewRequest("GET", urls, body) 3528 if err != nil { 3529 return nil, err 3530 } 3531 req.Header = reqHeaders 3532 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3533} 3534 3535// Do executes the "alertcenter.getSettings" call. 3536// Exactly one of *Settings or error will be non-nil. Any non-2xx status 3537// code is an error. Response headers are in either 3538// *Settings.ServerResponse.Header or (if a response was returned at 3539// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3540// to check whether the returned error was because 3541// http.StatusNotModified was returned. 3542func (c *V1beta1GetSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { 3543 gensupport.SetOptions(c.urlParams_, opts...) 3544 res, err := c.doRequest("json") 3545 if res != nil && res.StatusCode == http.StatusNotModified { 3546 if res.Body != nil { 3547 res.Body.Close() 3548 } 3549 return nil, &googleapi.Error{ 3550 Code: res.StatusCode, 3551 Header: res.Header, 3552 } 3553 } 3554 if err != nil { 3555 return nil, err 3556 } 3557 defer googleapi.CloseBody(res) 3558 if err := googleapi.CheckResponse(res); err != nil { 3559 return nil, err 3560 } 3561 ret := &Settings{ 3562 ServerResponse: googleapi.ServerResponse{ 3563 Header: res.Header, 3564 HTTPStatusCode: res.StatusCode, 3565 }, 3566 } 3567 target := &ret 3568 if err := gensupport.DecodeResponse(target, res); err != nil { 3569 return nil, err 3570 } 3571 return ret, nil 3572 // { 3573 // "description": "Returns customer-level settings.", 3574 // "flatPath": "v1beta1/settings", 3575 // "httpMethod": "GET", 3576 // "id": "alertcenter.getSettings", 3577 // "parameterOrder": [], 3578 // "parameters": { 3579 // "customerId": { 3580 // "description": "Optional. The unique identifier of the G Suite organization account of the\ncustomer the alert settings are associated with.\nInferred from the caller identity if not provided.", 3581 // "location": "query", 3582 // "type": "string" 3583 // } 3584 // }, 3585 // "path": "v1beta1/settings", 3586 // "response": { 3587 // "$ref": "Settings" 3588 // }, 3589 // "scopes": [ 3590 // "https://www.googleapis.com/auth/apps.alerts" 3591 // ] 3592 // } 3593 3594} 3595 3596// method id "alertcenter.updateSettings": 3597 3598type V1beta1UpdateSettingsCall struct { 3599 s *Service 3600 settings *Settings 3601 urlParams_ gensupport.URLParams 3602 ctx_ context.Context 3603 header_ http.Header 3604} 3605 3606// UpdateSettings: Updates the customer-level settings. 3607func (r *V1beta1Service) UpdateSettings(settings *Settings) *V1beta1UpdateSettingsCall { 3608 c := &V1beta1UpdateSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3609 c.settings = settings 3610 return c 3611} 3612 3613// CustomerId sets the optional parameter "customerId": The unique 3614// identifier of the G Suite organization account of the 3615// customer the alert settings are associated with. 3616// Inferred from the caller identity if not provided. 3617func (c *V1beta1UpdateSettingsCall) CustomerId(customerId string) *V1beta1UpdateSettingsCall { 3618 c.urlParams_.Set("customerId", customerId) 3619 return c 3620} 3621 3622// Fields allows partial responses to be retrieved. See 3623// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3624// for more information. 3625func (c *V1beta1UpdateSettingsCall) Fields(s ...googleapi.Field) *V1beta1UpdateSettingsCall { 3626 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3627 return c 3628} 3629 3630// Context sets the context to be used in this call's Do method. Any 3631// pending HTTP request will be aborted if the provided context is 3632// canceled. 3633func (c *V1beta1UpdateSettingsCall) Context(ctx context.Context) *V1beta1UpdateSettingsCall { 3634 c.ctx_ = ctx 3635 return c 3636} 3637 3638// Header returns an http.Header that can be modified by the caller to 3639// add HTTP headers to the request. 3640func (c *V1beta1UpdateSettingsCall) Header() http.Header { 3641 if c.header_ == nil { 3642 c.header_ = make(http.Header) 3643 } 3644 return c.header_ 3645} 3646 3647func (c *V1beta1UpdateSettingsCall) doRequest(alt string) (*http.Response, error) { 3648 reqHeaders := make(http.Header) 3649 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 3650 for k, v := range c.header_ { 3651 reqHeaders[k] = v 3652 } 3653 reqHeaders.Set("User-Agent", c.s.userAgent()) 3654 var body io.Reader = nil 3655 body, err := googleapi.WithoutDataWrapper.JSONReader(c.settings) 3656 if err != nil { 3657 return nil, err 3658 } 3659 reqHeaders.Set("Content-Type", "application/json") 3660 c.urlParams_.Set("alt", alt) 3661 c.urlParams_.Set("prettyPrint", "false") 3662 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/settings") 3663 urls += "?" + c.urlParams_.Encode() 3664 req, err := http.NewRequest("PATCH", urls, body) 3665 if err != nil { 3666 return nil, err 3667 } 3668 req.Header = reqHeaders 3669 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3670} 3671 3672// Do executes the "alertcenter.updateSettings" call. 3673// Exactly one of *Settings or error will be non-nil. Any non-2xx status 3674// code is an error. Response headers are in either 3675// *Settings.ServerResponse.Header or (if a response was returned at 3676// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3677// to check whether the returned error was because 3678// http.StatusNotModified was returned. 3679func (c *V1beta1UpdateSettingsCall) Do(opts ...googleapi.CallOption) (*Settings, error) { 3680 gensupport.SetOptions(c.urlParams_, opts...) 3681 res, err := c.doRequest("json") 3682 if res != nil && res.StatusCode == http.StatusNotModified { 3683 if res.Body != nil { 3684 res.Body.Close() 3685 } 3686 return nil, &googleapi.Error{ 3687 Code: res.StatusCode, 3688 Header: res.Header, 3689 } 3690 } 3691 if err != nil { 3692 return nil, err 3693 } 3694 defer googleapi.CloseBody(res) 3695 if err := googleapi.CheckResponse(res); err != nil { 3696 return nil, err 3697 } 3698 ret := &Settings{ 3699 ServerResponse: googleapi.ServerResponse{ 3700 Header: res.Header, 3701 HTTPStatusCode: res.StatusCode, 3702 }, 3703 } 3704 target := &ret 3705 if err := gensupport.DecodeResponse(target, res); err != nil { 3706 return nil, err 3707 } 3708 return ret, nil 3709 // { 3710 // "description": "Updates the customer-level settings.", 3711 // "flatPath": "v1beta1/settings", 3712 // "httpMethod": "PATCH", 3713 // "id": "alertcenter.updateSettings", 3714 // "parameterOrder": [], 3715 // "parameters": { 3716 // "customerId": { 3717 // "description": "Optional. The unique identifier of the G Suite organization account of the\ncustomer the alert settings are associated with.\nInferred from the caller identity if not provided.", 3718 // "location": "query", 3719 // "type": "string" 3720 // } 3721 // }, 3722 // "path": "v1beta1/settings", 3723 // "request": { 3724 // "$ref": "Settings" 3725 // }, 3726 // "response": { 3727 // "$ref": "Settings" 3728 // }, 3729 // "scopes": [ 3730 // "https://www.googleapis.com/auth/apps.alerts" 3731 // ] 3732 // } 3733 3734} 3735