1 // Copyright 2024 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 monitoring provides access to the Cloud Monitoring API. 8 // 9 // This package is DEPRECATED. Use package cloud.google.com/go/monitoring/apiv3 instead. 10 // 11 // For product documentation, see: https://cloud.google.com/monitoring/api/ 12 // 13 // # Library status 14 // 15 // These client libraries are officially supported by Google. However, this 16 // library is considered complete and is in maintenance mode. This means 17 // that we will address critical bugs and security issues but will not add 18 // any new features. 19 // 20 // When possible, we recommend using our newer 21 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 22 // that are still actively being worked and iterated on. 23 // 24 // # Creating a client 25 // 26 // Usage example: 27 // 28 // import "google.golang.org/api/monitoring/v3" 29 // ... 30 // ctx := context.Background() 31 // monitoringService, err := monitoring.NewService(ctx) 32 // 33 // In this example, Google Application Default Credentials are used for 34 // authentication. For information on how to create and obtain Application 35 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 36 // 37 // # Other authentication options 38 // 39 // By default, all available scopes (see "Constants") are used to authenticate. 40 // To restrict scopes, use [google.golang.org/api/option.WithScopes]: 41 // 42 // monitoringService, err := monitoring.NewService(ctx, option.WithScopes(monitoring.MonitoringWriteScope)) 43 // 44 // To use an API key for authentication (note: some APIs do not support API 45 // keys), use [google.golang.org/api/option.WithAPIKey]: 46 // 47 // monitoringService, err := monitoring.NewService(ctx, option.WithAPIKey("AIza...")) 48 // 49 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 50 // flow, use [google.golang.org/api/option.WithTokenSource]: 51 // 52 // config := &oauth2.Config{...} 53 // // ... 54 // token, err := config.Exchange(ctx, ...) 55 // monitoringService, err := monitoring.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 56 // 57 // See [google.golang.org/api/option.ClientOption] for details on options. 58 package monitoring // import "google.golang.org/api/monitoring/v3" 59 60 import ( 61 "bytes" 62 "context" 63 "encoding/json" 64 "errors" 65 "fmt" 66 "io" 67 "net/http" 68 "net/url" 69 "strconv" 70 "strings" 71 72 googleapi "google.golang.org/api/googleapi" 73 internal "google.golang.org/api/internal" 74 gensupport "google.golang.org/api/internal/gensupport" 75 option "google.golang.org/api/option" 76 internaloption "google.golang.org/api/option/internaloption" 77 htransport "google.golang.org/api/transport/http" 78 ) 79 80 // Always reference these packages, just in case the auto-generated code 81 // below doesn't. 82 var _ = bytes.NewBuffer 83 var _ = strconv.Itoa 84 var _ = fmt.Sprintf 85 var _ = json.NewDecoder 86 var _ = io.Copy 87 var _ = url.Parse 88 var _ = gensupport.MarshalJSON 89 var _ = googleapi.Version 90 var _ = errors.New 91 var _ = strings.Replace 92 var _ = context.Canceled 93 var _ = internaloption.WithDefaultEndpoint 94 var _ = internal.Version 95 96 const apiId = "monitoring:v3" 97 const apiName = "monitoring" 98 const apiVersion = "v3" 99 const basePath = "https://monitoring.googleapis.com/" 100 const basePathTemplate = "https://monitoring.UNIVERSE_DOMAIN/" 101 const mtlsBasePath = "https://monitoring.mtls.googleapis.com/" 102 103 // OAuth2 scopes used by this API. 104 const ( 105 // See, edit, configure, and delete your Google Cloud data and see the email 106 // address for your Google Account. 107 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 108 109 // View and write monitoring data for all of your Google and third-party Cloud 110 // and API projects 111 MonitoringScope = "https://www.googleapis.com/auth/monitoring" 112 113 // View monitoring data for all of your Google Cloud and third-party projects 114 MonitoringReadScope = "https://www.googleapis.com/auth/monitoring.read" 115 116 // Publish metric data to your Google Cloud projects 117 MonitoringWriteScope = "https://www.googleapis.com/auth/monitoring.write" 118 ) 119 120 // NewService creates a new Service. 121 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 122 scopesOption := internaloption.WithDefaultScopes( 123 "https://www.googleapis.com/auth/cloud-platform", 124 "https://www.googleapis.com/auth/monitoring", 125 "https://www.googleapis.com/auth/monitoring.read", 126 "https://www.googleapis.com/auth/monitoring.write", 127 ) 128 // NOTE: prepend, so we don't override user-specified scopes. 129 opts = append([]option.ClientOption{scopesOption}, opts...) 130 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 131 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 132 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 133 opts = append(opts, internaloption.EnableNewAuthLibrary()) 134 client, endpoint, err := htransport.NewClient(ctx, opts...) 135 if err != nil { 136 return nil, err 137 } 138 s, err := New(client) 139 if err != nil { 140 return nil, err 141 } 142 if endpoint != "" { 143 s.BasePath = endpoint 144 } 145 return s, nil 146 } 147 148 // New creates a new Service. It uses the provided http.Client for requests. 149 // 150 // Deprecated: please use NewService instead. 151 // To provide a custom HTTP client, use option.WithHTTPClient. 152 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 153 func New(client *http.Client) (*Service, error) { 154 if client == nil { 155 return nil, errors.New("client is nil") 156 } 157 s := &Service{client: client, BasePath: basePath} 158 s.Folders = NewFoldersService(s) 159 s.Organizations = NewOrganizationsService(s) 160 s.Projects = NewProjectsService(s) 161 s.Services = NewServicesService(s) 162 s.UptimeCheckIps = NewUptimeCheckIpsService(s) 163 return s, nil 164 } 165 166 type Service struct { 167 client *http.Client 168 BasePath string // API endpoint base URL 169 UserAgent string // optional additional User-Agent fragment 170 171 Folders *FoldersService 172 173 Organizations *OrganizationsService 174 175 Projects *ProjectsService 176 177 Services *ServicesService 178 179 UptimeCheckIps *UptimeCheckIpsService 180 } 181 182 func (s *Service) userAgent() string { 183 if s.UserAgent == "" { 184 return googleapi.UserAgent 185 } 186 return googleapi.UserAgent + " " + s.UserAgent 187 } 188 189 func NewFoldersService(s *Service) *FoldersService { 190 rs := &FoldersService{s: s} 191 rs.TimeSeries = NewFoldersTimeSeriesService(s) 192 return rs 193 } 194 195 type FoldersService struct { 196 s *Service 197 198 TimeSeries *FoldersTimeSeriesService 199 } 200 201 func NewFoldersTimeSeriesService(s *Service) *FoldersTimeSeriesService { 202 rs := &FoldersTimeSeriesService{s: s} 203 return rs 204 } 205 206 type FoldersTimeSeriesService struct { 207 s *Service 208 } 209 210 func NewOrganizationsService(s *Service) *OrganizationsService { 211 rs := &OrganizationsService{s: s} 212 rs.TimeSeries = NewOrganizationsTimeSeriesService(s) 213 return rs 214 } 215 216 type OrganizationsService struct { 217 s *Service 218 219 TimeSeries *OrganizationsTimeSeriesService 220 } 221 222 func NewOrganizationsTimeSeriesService(s *Service) *OrganizationsTimeSeriesService { 223 rs := &OrganizationsTimeSeriesService{s: s} 224 return rs 225 } 226 227 type OrganizationsTimeSeriesService struct { 228 s *Service 229 } 230 231 func NewProjectsService(s *Service) *ProjectsService { 232 rs := &ProjectsService{s: s} 233 rs.AlertPolicies = NewProjectsAlertPoliciesService(s) 234 rs.CollectdTimeSeries = NewProjectsCollectdTimeSeriesService(s) 235 rs.Groups = NewProjectsGroupsService(s) 236 rs.MetricDescriptors = NewProjectsMetricDescriptorsService(s) 237 rs.MonitoredResourceDescriptors = NewProjectsMonitoredResourceDescriptorsService(s) 238 rs.NotificationChannelDescriptors = NewProjectsNotificationChannelDescriptorsService(s) 239 rs.NotificationChannels = NewProjectsNotificationChannelsService(s) 240 rs.Snoozes = NewProjectsSnoozesService(s) 241 rs.TimeSeries = NewProjectsTimeSeriesService(s) 242 rs.UptimeCheckConfigs = NewProjectsUptimeCheckConfigsService(s) 243 return rs 244 } 245 246 type ProjectsService struct { 247 s *Service 248 249 AlertPolicies *ProjectsAlertPoliciesService 250 251 CollectdTimeSeries *ProjectsCollectdTimeSeriesService 252 253 Groups *ProjectsGroupsService 254 255 MetricDescriptors *ProjectsMetricDescriptorsService 256 257 MonitoredResourceDescriptors *ProjectsMonitoredResourceDescriptorsService 258 259 NotificationChannelDescriptors *ProjectsNotificationChannelDescriptorsService 260 261 NotificationChannels *ProjectsNotificationChannelsService 262 263 Snoozes *ProjectsSnoozesService 264 265 TimeSeries *ProjectsTimeSeriesService 266 267 UptimeCheckConfigs *ProjectsUptimeCheckConfigsService 268 } 269 270 func NewProjectsAlertPoliciesService(s *Service) *ProjectsAlertPoliciesService { 271 rs := &ProjectsAlertPoliciesService{s: s} 272 return rs 273 } 274 275 type ProjectsAlertPoliciesService struct { 276 s *Service 277 } 278 279 func NewProjectsCollectdTimeSeriesService(s *Service) *ProjectsCollectdTimeSeriesService { 280 rs := &ProjectsCollectdTimeSeriesService{s: s} 281 return rs 282 } 283 284 type ProjectsCollectdTimeSeriesService struct { 285 s *Service 286 } 287 288 func NewProjectsGroupsService(s *Service) *ProjectsGroupsService { 289 rs := &ProjectsGroupsService{s: s} 290 rs.Members = NewProjectsGroupsMembersService(s) 291 return rs 292 } 293 294 type ProjectsGroupsService struct { 295 s *Service 296 297 Members *ProjectsGroupsMembersService 298 } 299 300 func NewProjectsGroupsMembersService(s *Service) *ProjectsGroupsMembersService { 301 rs := &ProjectsGroupsMembersService{s: s} 302 return rs 303 } 304 305 type ProjectsGroupsMembersService struct { 306 s *Service 307 } 308 309 func NewProjectsMetricDescriptorsService(s *Service) *ProjectsMetricDescriptorsService { 310 rs := &ProjectsMetricDescriptorsService{s: s} 311 return rs 312 } 313 314 type ProjectsMetricDescriptorsService struct { 315 s *Service 316 } 317 318 func NewProjectsMonitoredResourceDescriptorsService(s *Service) *ProjectsMonitoredResourceDescriptorsService { 319 rs := &ProjectsMonitoredResourceDescriptorsService{s: s} 320 return rs 321 } 322 323 type ProjectsMonitoredResourceDescriptorsService struct { 324 s *Service 325 } 326 327 func NewProjectsNotificationChannelDescriptorsService(s *Service) *ProjectsNotificationChannelDescriptorsService { 328 rs := &ProjectsNotificationChannelDescriptorsService{s: s} 329 return rs 330 } 331 332 type ProjectsNotificationChannelDescriptorsService struct { 333 s *Service 334 } 335 336 func NewProjectsNotificationChannelsService(s *Service) *ProjectsNotificationChannelsService { 337 rs := &ProjectsNotificationChannelsService{s: s} 338 return rs 339 } 340 341 type ProjectsNotificationChannelsService struct { 342 s *Service 343 } 344 345 func NewProjectsSnoozesService(s *Service) *ProjectsSnoozesService { 346 rs := &ProjectsSnoozesService{s: s} 347 return rs 348 } 349 350 type ProjectsSnoozesService struct { 351 s *Service 352 } 353 354 func NewProjectsTimeSeriesService(s *Service) *ProjectsTimeSeriesService { 355 rs := &ProjectsTimeSeriesService{s: s} 356 return rs 357 } 358 359 type ProjectsTimeSeriesService struct { 360 s *Service 361 } 362 363 func NewProjectsUptimeCheckConfigsService(s *Service) *ProjectsUptimeCheckConfigsService { 364 rs := &ProjectsUptimeCheckConfigsService{s: s} 365 return rs 366 } 367 368 type ProjectsUptimeCheckConfigsService struct { 369 s *Service 370 } 371 372 func NewServicesService(s *Service) *ServicesService { 373 rs := &ServicesService{s: s} 374 rs.ServiceLevelObjectives = NewServicesServiceLevelObjectivesService(s) 375 return rs 376 } 377 378 type ServicesService struct { 379 s *Service 380 381 ServiceLevelObjectives *ServicesServiceLevelObjectivesService 382 } 383 384 func NewServicesServiceLevelObjectivesService(s *Service) *ServicesServiceLevelObjectivesService { 385 rs := &ServicesServiceLevelObjectivesService{s: s} 386 return rs 387 } 388 389 type ServicesServiceLevelObjectivesService struct { 390 s *Service 391 } 392 393 func NewUptimeCheckIpsService(s *Service) *UptimeCheckIpsService { 394 rs := &UptimeCheckIpsService{s: s} 395 return rs 396 } 397 398 type UptimeCheckIpsService struct { 399 s *Service 400 } 401 402 // Aggregation: Describes how to combine multiple time series to provide a 403 // different view of the data. Aggregation of time series is done in two steps. 404 // First, each time series in the set is aligned to the same time interval 405 // boundaries, then the set of time series is optionally reduced in 406 // number.Alignment consists of applying the per_series_aligner operation to 407 // each time series after its data has been divided into regular 408 // alignment_period time intervals. This process takes all of the data points 409 // in an alignment period, applies a mathematical transformation such as 410 // averaging, minimum, maximum, delta, etc., and converts them into a single 411 // data point per period.Reduction is when the aligned and transformed time 412 // series can optionally be combined, reducing the number of time series 413 // through similar mathematical transformations. Reduction involves applying a 414 // cross_series_reducer to all the time series, optionally sorting the time 415 // series into subsets with group_by_fields, and applying the reducer to each 416 // subset.The raw time series data can contain a huge amount of information 417 // from multiple sources. Alignment and reduction transforms this mass of data 418 // into a more manageable and representative collection of data, for example 419 // "the 95% latency across the average of all tasks in a cluster". This 420 // representative data can be more easily graphed and comprehended, and the 421 // individual time series data is still available for later drilldown. For more 422 // details, see Filtering and aggregation 423 // (https://cloud.google.com/monitoring/api/v3/aggregation). 424 type Aggregation struct { 425 // AlignmentPeriod: The alignment_period specifies a time interval, in seconds, 426 // that is used to divide the data in all the time series into consistent 427 // blocks of time. This will be done before the per-series aligner can be 428 // applied to the data.The value must be at least 60 seconds. If a per-series 429 // aligner other than ALIGN_NONE is specified, this field is required or an 430 // error is returned. If no per-series aligner is specified, or the aligner 431 // ALIGN_NONE is specified, then this field is ignored.The maximum value of the 432 // alignment_period is 104 weeks (2 years) for charts, and 90,000 seconds (25 433 // hours) for alerting policies. 434 AlignmentPeriod string `json:"alignmentPeriod,omitempty"` 435 // CrossSeriesReducer: The reduction operation to be used to combine time 436 // series into a single time series, where the value of each data point in the 437 // resulting series is a function of all the already aligned values in the 438 // input time series.Not all reducer operations can be applied to all time 439 // series. The valid choices depend on the metric_kind and the value_type of 440 // the original time series. Reduction can yield a time series with a different 441 // metric_kind or value_type than the input time series.Time series data must 442 // first be aligned (see per_series_aligner) in order to perform cross-time 443 // series reduction. If cross_series_reducer is specified, then 444 // per_series_aligner must be specified, and must not be ALIGN_NONE. An 445 // alignment_period must also be specified; otherwise, an error is returned. 446 // 447 // Possible values: 448 // "REDUCE_NONE" - No cross-time series reduction. The output of the Aligner 449 // is returned. 450 // "REDUCE_MEAN" - Reduce by computing the mean value across time series for 451 // each alignment period. This reducer is valid for DELTA and GAUGE metrics 452 // with numeric or distribution values. The value_type of the output is DOUBLE. 453 // "REDUCE_MIN" - Reduce by computing the minimum value across time series 454 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 455 // with numeric values. The value_type of the output is the same as the 456 // value_type of the input. 457 // "REDUCE_MAX" - Reduce by computing the maximum value across time series 458 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 459 // with numeric values. The value_type of the output is the same as the 460 // value_type of the input. 461 // "REDUCE_SUM" - Reduce by computing the sum across time series for each 462 // alignment period. This reducer is valid for DELTA and GAUGE metrics with 463 // numeric and distribution values. The value_type of the output is the same as 464 // the value_type of the input. 465 // "REDUCE_STDDEV" - Reduce by computing the standard deviation across time 466 // series for each alignment period. This reducer is valid for DELTA and GAUGE 467 // metrics with numeric or distribution values. The value_type of the output is 468 // DOUBLE. 469 // "REDUCE_COUNT" - Reduce by computing the number of data points across time 470 // series for each alignment period. This reducer is valid for DELTA and GAUGE 471 // metrics of numeric, Boolean, distribution, and string value_type. The 472 // value_type of the output is INT64. 473 // "REDUCE_COUNT_TRUE" - Reduce by computing the number of True-valued data 474 // points across time series for each alignment period. This reducer is valid 475 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 476 // output is INT64. 477 // "REDUCE_COUNT_FALSE" - Reduce by computing the number of False-valued data 478 // points across time series for each alignment period. This reducer is valid 479 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 480 // output is INT64. 481 // "REDUCE_FRACTION_TRUE" - Reduce by computing the ratio of the number of 482 // True-valued data points to the total number of data points for each 483 // alignment period. This reducer is valid for DELTA and GAUGE metrics of 484 // Boolean value_type. The output value is in the range 0.0, 1.0 and has 485 // value_type DOUBLE. 486 // "REDUCE_PERCENTILE_99" - Reduce by computing the 99th percentile 487 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 488 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 489 // of numeric and distribution type. The value of the output is DOUBLE. 490 // "REDUCE_PERCENTILE_95" - Reduce by computing the 95th percentile 491 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 492 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 493 // of numeric and distribution type. The value of the output is DOUBLE. 494 // "REDUCE_PERCENTILE_50" - Reduce by computing the 50th percentile 495 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 496 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 497 // of numeric and distribution type. The value of the output is DOUBLE. 498 // "REDUCE_PERCENTILE_05" - Reduce by computing the 5th percentile 499 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 500 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 501 // of numeric and distribution type. The value of the output is DOUBLE. 502 CrossSeriesReducer string `json:"crossSeriesReducer,omitempty"` 503 // GroupByFields: The set of fields to preserve when cross_series_reducer is 504 // specified. The group_by_fields determine how the time series are partitioned 505 // into subsets prior to applying the aggregation operation. Each subset 506 // contains time series that have the same value for each of the grouping 507 // fields. Each individual time series is a member of exactly one subset. The 508 // cross_series_reducer is applied to each subset of time series. It is not 509 // possible to reduce across different resource types, so this field implicitly 510 // contains resource.type. Fields not specified in group_by_fields are 511 // aggregated away. If group_by_fields is not specified and all the time series 512 // have the same resource type, then the time series are aggregated into a 513 // single output time series. If cross_series_reducer is not defined, this 514 // field is ignored. 515 GroupByFields []string `json:"groupByFields,omitempty"` 516 // PerSeriesAligner: An Aligner describes how to bring the data points in a 517 // single time series into temporal alignment. Except for ALIGN_NONE, all 518 // alignments cause all the data points in an alignment_period to be 519 // mathematically grouped together, resulting in a single data point for each 520 // alignment_period with end timestamp at the end of the period.Not all 521 // alignment operations may be applied to all time series. The valid choices 522 // depend on the metric_kind and value_type of the original time series. 523 // Alignment can change the metric_kind or the value_type of the time 524 // series.Time series data must be aligned in order to perform cross-time 525 // series reduction. If cross_series_reducer is specified, then 526 // per_series_aligner must be specified and not equal to ALIGN_NONE and 527 // alignment_period must be specified; otherwise, an error is returned. 528 // 529 // Possible values: 530 // "ALIGN_NONE" - No alignment. Raw data is returned. Not valid if 531 // cross-series reduction is requested. The value_type of the result is the 532 // same as the value_type of the input. 533 // "ALIGN_DELTA" - Align and convert to DELTA. The output is delta = y1 - 534 // y0.This alignment is valid for CUMULATIVE and DELTA metrics. If the selected 535 // alignment period results in periods with no data, then the aligned value for 536 // such a period is created by interpolation. The value_type of the aligned 537 // result is the same as the value_type of the input. 538 // "ALIGN_RATE" - Align and convert to a rate. The result is computed as rate 539 // = (y1 - y0)/(t1 - t0), or "delta over time". Think of this aligner as 540 // providing the slope of the line that passes through the value at the start 541 // and at the end of the alignment_period.This aligner is valid for CUMULATIVE 542 // and DELTA metrics with numeric values. If the selected alignment period 543 // results in periods with no data, then the aligned value for such a period is 544 // created by interpolation. The output is a GAUGE metric with value_type 545 // DOUBLE.If, by "rate", you mean "percentage change", see the 546 // ALIGN_PERCENT_CHANGE aligner instead. 547 // "ALIGN_INTERPOLATE" - Align by interpolating between adjacent points 548 // around the alignment period boundary. This aligner is valid for GAUGE 549 // metrics with numeric values. The value_type of the aligned result is the 550 // same as the value_type of the input. 551 // "ALIGN_NEXT_OLDER" - Align by moving the most recent data point before the 552 // end of the alignment period to the boundary at the end of the alignment 553 // period. This aligner is valid for GAUGE metrics. The value_type of the 554 // aligned result is the same as the value_type of the input. 555 // "ALIGN_MIN" - Align the time series by returning the minimum value in each 556 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 557 // numeric values. The value_type of the aligned result is the same as the 558 // value_type of the input. 559 // "ALIGN_MAX" - Align the time series by returning the maximum value in each 560 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 561 // numeric values. The value_type of the aligned result is the same as the 562 // value_type of the input. 563 // "ALIGN_MEAN" - Align the time series by returning the mean value in each 564 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 565 // numeric values. The value_type of the aligned result is DOUBLE. 566 // "ALIGN_COUNT" - Align the time series by returning the number of values in 567 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 568 // with numeric or Boolean values. The value_type of the aligned result is 569 // INT64. 570 // "ALIGN_SUM" - Align the time series by returning the sum of the values in 571 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 572 // with numeric and distribution values. The value_type of the aligned result 573 // is the same as the value_type of the input. 574 // "ALIGN_STDDEV" - Align the time series by returning the standard deviation 575 // of the values in each alignment period. This aligner is valid for GAUGE and 576 // DELTA metrics with numeric values. The value_type of the output is DOUBLE. 577 // "ALIGN_COUNT_TRUE" - Align the time series by returning the number of True 578 // values in each alignment period. This aligner is valid for GAUGE metrics 579 // with Boolean values. The value_type of the output is INT64. 580 // "ALIGN_COUNT_FALSE" - Align the time series by returning the number of 581 // False values in each alignment period. This aligner is valid for GAUGE 582 // metrics with Boolean values. The value_type of the output is INT64. 583 // "ALIGN_FRACTION_TRUE" - Align the time series by returning the ratio of 584 // the number of True values to the total number of values in each alignment 585 // period. This aligner is valid for GAUGE metrics with Boolean values. The 586 // output value is in the range 0.0, 1.0 and has value_type DOUBLE. 587 // "ALIGN_PERCENTILE_99" - Align the time series by using percentile 588 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 589 // point in each alignment period is the 99th percentile of all data points in 590 // the period. This aligner is valid for GAUGE and DELTA metrics with 591 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 592 // "ALIGN_PERCENTILE_95" - Align the time series by using percentile 593 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 594 // point in each alignment period is the 95th percentile of all data points in 595 // the period. This aligner is valid for GAUGE and DELTA metrics with 596 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 597 // "ALIGN_PERCENTILE_50" - Align the time series by using percentile 598 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 599 // point in each alignment period is the 50th percentile of all data points in 600 // the period. This aligner is valid for GAUGE and DELTA metrics with 601 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 602 // "ALIGN_PERCENTILE_05" - Align the time series by using percentile 603 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 604 // point in each alignment period is the 5th percentile of all data points in 605 // the period. This aligner is valid for GAUGE and DELTA metrics with 606 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 607 // "ALIGN_PERCENT_CHANGE" - Align and convert to a percentage change. This 608 // aligner is valid for GAUGE and DELTA metrics with numeric values. This 609 // alignment returns ((current - previous)/previous) * 100, where the value of 610 // previous is determined based on the alignment_period.If the values of 611 // current and previous are both 0, then the returned value is 0. If only 612 // previous is 0, the returned value is infinity.A 10-minute moving mean is 613 // computed at each point of the alignment period prior to the above 614 // calculation to smooth the metric and prevent false positives from very 615 // short-lived spikes. The moving mean is only applicable for data whose values 616 // are >= 0. Any values < 0 are treated as a missing datapoint, and are 617 // ignored. While DELTA metrics are accepted by this alignment, special care 618 // should be taken that the values for the metric will always be positive. The 619 // output is a GAUGE metric with value_type DOUBLE. 620 PerSeriesAligner string `json:"perSeriesAligner,omitempty"` 621 // ForceSendFields is a list of field names (e.g. "AlignmentPeriod") to 622 // unconditionally include in API requests. By default, fields with empty or 623 // default values are omitted from API requests. See 624 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 625 // details. 626 ForceSendFields []string `json:"-"` 627 // NullFields is a list of field names (e.g. "AlignmentPeriod") to include in 628 // API requests with the JSON null value. By default, fields with empty values 629 // are omitted from API requests. See 630 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 631 NullFields []string `json:"-"` 632 } 633 634 func (s *Aggregation) MarshalJSON() ([]byte, error) { 635 type NoMethod Aggregation 636 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 637 } 638 639 // AlertPolicy: A description of the conditions under which some aspect of your 640 // system is considered to be "unhealthy" and the ways to notify people or 641 // services about this state. For an overview of alert policies, see 642 // Introduction to Alerting (https://cloud.google.com/monitoring/alerts/). 643 type AlertPolicy struct { 644 // AlertStrategy: Control over how this alert policy's notification channels 645 // are notified. 646 AlertStrategy *AlertStrategy `json:"alertStrategy,omitempty"` 647 // Combiner: How to combine the results of multiple conditions to determine if 648 // an incident should be opened. If condition_time_series_query_language is 649 // present, this must be COMBINE_UNSPECIFIED. 650 // 651 // Possible values: 652 // "COMBINE_UNSPECIFIED" - An unspecified combiner. 653 // "AND" - Combine conditions using the logical AND operator. An incident is 654 // created only if all the conditions are met simultaneously. This combiner is 655 // satisfied if all conditions are met, even if they are met on completely 656 // different resources. 657 // "OR" - Combine conditions using the logical OR operator. An incident is 658 // created if any of the listed conditions is met. 659 // "AND_WITH_MATCHING_RESOURCE" - Combine conditions using logical AND 660 // operator, but unlike the regular AND option, an incident is created only if 661 // all conditions are met simultaneously on at least one resource. 662 Combiner string `json:"combiner,omitempty"` 663 // Conditions: A list of conditions for the policy. The conditions are combined 664 // by AND or OR according to the combiner field. If the combined conditions 665 // evaluate to true, then an incident is created. A policy can have from one to 666 // six conditions. If condition_time_series_query_language is present, it must 667 // be the only condition. If condition_monitoring_query_language is present, it 668 // must be the only condition. 669 Conditions []*Condition `json:"conditions,omitempty"` 670 // CreationRecord: A read-only record of the creation of the alerting policy. 671 // If provided in a call to create or update, this field will be ignored. 672 CreationRecord *MutationRecord `json:"creationRecord,omitempty"` 673 // DisplayName: A short name or phrase used to identify the policy in 674 // dashboards, notifications, and incidents. To avoid confusion, don't use the 675 // same display name for multiple policies in the same project. The name is 676 // limited to 512 Unicode characters.The convention for the display_name of a 677 // PrometheusQueryLanguageCondition is "{rule group name}/{alert name}", where 678 // the {rule group name} and {alert name} should be taken from the 679 // corresponding Prometheus configuration file. This convention is not 680 // enforced. In any case the display_name is not a unique key of the 681 // AlertPolicy. 682 DisplayName string `json:"displayName,omitempty"` 683 // Documentation: Documentation that is included with notifications and 684 // incidents related to this policy. Best practice is for the documentation to 685 // include information to help responders understand, mitigate, escalate, and 686 // correct the underlying problems detected by the alerting policy. 687 // Notification channels that have limited capacity might not show this 688 // documentation. 689 Documentation *Documentation `json:"documentation,omitempty"` 690 // Enabled: Whether or not the policy is enabled. On write, the default 691 // interpretation if unset is that the policy is enabled. On read, clients 692 // should not make any assumption about the state if it has not been populated. 693 // The field should always be populated on List and Get operations, unless a 694 // field projection has been specified that strips it out. 695 Enabled bool `json:"enabled,omitempty"` 696 // MutationRecord: A read-only record of the most recent change to the alerting 697 // policy. If provided in a call to create or update, this field will be 698 // ignored. 699 MutationRecord *MutationRecord `json:"mutationRecord,omitempty"` 700 // Name: Required if the policy exists. The resource name for this policy. The 701 // format is: projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] 702 // [ALERT_POLICY_ID] is assigned by Cloud Monitoring when the policy is 703 // created. When calling the alertPolicies.create method, do not include the 704 // name field in the alerting policy passed as part of the request. 705 Name string `json:"name,omitempty"` 706 // NotificationChannels: Identifies the notification channels to which 707 // notifications should be sent when incidents are opened or closed or when new 708 // violations occur on an already opened incident. Each element of this array 709 // corresponds to the name field in each of the NotificationChannel objects 710 // that are returned from the ListNotificationChannels method. The format of 711 // the entries in this field is: 712 // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] 713 NotificationChannels []string `json:"notificationChannels,omitempty"` 714 // Severity: Optional. The severity of an alert policy indicates how important 715 // incidents generated by that policy are. The severity level will be displayed 716 // on the Incident detail page and in notifications. 717 // 718 // Possible values: 719 // "SEVERITY_UNSPECIFIED" - No severity is specified. This is the default 720 // value. 721 // "CRITICAL" - This is the highest severity level. Use this if the problem 722 // could cause significant damage or downtime. 723 // "ERROR" - This is the medium severity level. Use this if the problem could 724 // cause minor damage or downtime. 725 // "WARNING" - This is the lowest severity level. Use this if the problem is 726 // not causing any damage or downtime, but could potentially lead to a problem 727 // in the future. 728 Severity string `json:"severity,omitempty"` 729 // UserLabels: User-supplied key/value data to be used for organizing and 730 // identifying the AlertPolicy objects.The field can contain up to 64 entries. 731 // Each key and value is limited to 63 Unicode characters or 128 bytes, 732 // whichever is smaller. Labels and values can contain only lowercase letters, 733 // numerals, underscores, and dashes. Keys must begin with a letter.Note that 734 // Prometheus {alert name} is a valid Prometheus label names 735 // (https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), 736 // whereas Prometheus {rule group} is an unrestricted UTF-8 string. This means 737 // that they cannot be stored as-is in user labels, because they may contain 738 // characters that are not allowed in user-label values. 739 UserLabels map[string]string `json:"userLabels,omitempty"` 740 // Validity: Read-only description of how the alert policy is invalid. This 741 // field is only set when the alert policy is invalid. An invalid alert policy 742 // will not generate incidents. 743 Validity *Status `json:"validity,omitempty"` 744 745 // ServerResponse contains the HTTP response code and headers from the server. 746 googleapi.ServerResponse `json:"-"` 747 // ForceSendFields is a list of field names (e.g. "AlertStrategy") to 748 // unconditionally include in API requests. By default, fields with empty or 749 // default values are omitted from API requests. See 750 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 751 // details. 752 ForceSendFields []string `json:"-"` 753 // NullFields is a list of field names (e.g. "AlertStrategy") to include in API 754 // requests with the JSON null value. By default, fields with empty values are 755 // omitted from API requests. See 756 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 757 NullFields []string `json:"-"` 758 } 759 760 func (s *AlertPolicy) MarshalJSON() ([]byte, error) { 761 type NoMethod AlertPolicy 762 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 763 } 764 765 // AlertStrategy: Control over how the notification channels in 766 // notification_channels are notified when this alert fires. 767 type AlertStrategy struct { 768 // AutoClose: If an alert policy that was active has no data for this long, any 769 // open incidents will close 770 AutoClose string `json:"autoClose,omitempty"` 771 // NotificationChannelStrategy: Control how notifications will be sent out, on 772 // a per-channel basis. 773 NotificationChannelStrategy []*NotificationChannelStrategy `json:"notificationChannelStrategy,omitempty"` 774 // NotificationRateLimit: Required for alert policies with a LogMatch 775 // condition.This limit is not implemented for alert policies that are not 776 // log-based. 777 NotificationRateLimit *NotificationRateLimit `json:"notificationRateLimit,omitempty"` 778 // ForceSendFields is a list of field names (e.g. "AutoClose") to 779 // unconditionally include in API requests. By default, fields with empty or 780 // default values are omitted from API requests. See 781 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 782 // details. 783 ForceSendFields []string `json:"-"` 784 // NullFields is a list of field names (e.g. "AutoClose") to include in API 785 // requests with the JSON null value. By default, fields with empty values are 786 // omitted from API requests. See 787 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 788 NullFields []string `json:"-"` 789 } 790 791 func (s *AlertStrategy) MarshalJSON() ([]byte, error) { 792 type NoMethod AlertStrategy 793 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 794 } 795 796 // AppEngine: App Engine service. Learn more at 797 // https://cloud.google.com/appengine. 798 type AppEngine struct { 799 // ModuleId: The ID of the App Engine module underlying this service. 800 // Corresponds to the module_id resource label in the gae_app monitored 801 // resource (https://cloud.google.com/monitoring/api/resources#tag_gae_app). 802 ModuleId string `json:"moduleId,omitempty"` 803 // ForceSendFields is a list of field names (e.g. "ModuleId") to 804 // unconditionally include in API requests. By default, fields with empty or 805 // default values are omitted from API requests. See 806 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 807 // details. 808 ForceSendFields []string `json:"-"` 809 // NullFields is a list of field names (e.g. "ModuleId") to include in API 810 // requests with the JSON null value. By default, fields with empty values are 811 // omitted from API requests. See 812 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 813 NullFields []string `json:"-"` 814 } 815 816 func (s *AppEngine) MarshalJSON() ([]byte, error) { 817 type NoMethod AppEngine 818 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 819 } 820 821 // AvailabilityCriteria: Future parameters for the availability SLI. 822 type AvailabilityCriteria struct { 823 } 824 825 // BasicAuthentication: The authentication parameters to provide to the 826 // specified resource or URL that requires a username and password. Currently, 827 // only Basic HTTP authentication (https://tools.ietf.org/html/rfc7617) is 828 // supported in Uptime checks. 829 type BasicAuthentication struct { 830 // Password: The password to use when authenticating with the HTTP server. 831 Password string `json:"password,omitempty"` 832 // Username: The username to use when authenticating with the HTTP server. 833 Username string `json:"username,omitempty"` 834 // ForceSendFields is a list of field names (e.g. "Password") to 835 // unconditionally include in API requests. By default, fields with empty or 836 // default values are omitted from API requests. See 837 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 838 // details. 839 ForceSendFields []string `json:"-"` 840 // NullFields is a list of field names (e.g. "Password") to include in API 841 // requests with the JSON null value. By default, fields with empty values are 842 // omitted from API requests. See 843 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 844 NullFields []string `json:"-"` 845 } 846 847 func (s *BasicAuthentication) MarshalJSON() ([]byte, error) { 848 type NoMethod BasicAuthentication 849 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 850 } 851 852 // BasicService: A well-known service type, defined by its service type and 853 // service labels. Documentation and examples here 854 // (https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli). 855 type BasicService struct { 856 // ServiceLabels: Labels that specify the resource that emits the monitoring 857 // data which is used for SLO reporting of this Service. Documentation and 858 // valid values for given service types here 859 // (https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli). 860 ServiceLabels map[string]string `json:"serviceLabels,omitempty"` 861 // ServiceType: The type of service that this basic service defines, e.g. 862 // APP_ENGINE service type. Documentation and valid values here 863 // (https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli). 864 ServiceType string `json:"serviceType,omitempty"` 865 // ForceSendFields is a list of field names (e.g. "ServiceLabels") to 866 // unconditionally include in API requests. By default, fields with empty or 867 // default values are omitted from API requests. See 868 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 869 // details. 870 ForceSendFields []string `json:"-"` 871 // NullFields is a list of field names (e.g. "ServiceLabels") to include in API 872 // requests with the JSON null value. By default, fields with empty values are 873 // omitted from API requests. See 874 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 875 NullFields []string `json:"-"` 876 } 877 878 func (s *BasicService) MarshalJSON() ([]byte, error) { 879 type NoMethod BasicService 880 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 881 } 882 883 // BasicSli: An SLI measuring performance on a well-known service type. 884 // Performance will be computed on the basis of pre-defined metrics. The type 885 // of the service_resource determines the metrics to use and the 886 // service_resource.labels and metric_labels are used to construct a monitoring 887 // filter to filter that metric down to just the data relevant to this service. 888 type BasicSli struct { 889 // Availability: Good service is defined to be the count of requests made to 890 // this service that return successfully. 891 Availability *AvailabilityCriteria `json:"availability,omitempty"` 892 // Latency: Good service is defined to be the count of requests made to this 893 // service that are fast enough with respect to latency.threshold. 894 Latency *LatencyCriteria `json:"latency,omitempty"` 895 // Location: OPTIONAL: The set of locations to which this SLI is relevant. 896 // Telemetry from other locations will not be used to calculate performance for 897 // this SLI. If omitted, this SLI applies to all locations in which the Service 898 // has activity. For service types that don't support breaking down by 899 // location, setting this field will result in an error. 900 Location []string `json:"location,omitempty"` 901 // Method: OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry 902 // from other methods will not be used to calculate performance for this SLI. 903 // If omitted, this SLI applies to all the Service's methods. For service types 904 // that don't support breaking down by method, setting this field will result 905 // in an error. 906 Method []string `json:"method,omitempty"` 907 // Version: OPTIONAL: The set of API versions to which this SLI is relevant. 908 // Telemetry from other API versions will not be used to calculate performance 909 // for this SLI. If omitted, this SLI applies to all API versions. For service 910 // types that don't support breaking down by version, setting this field will 911 // result in an error. 912 Version []string `json:"version,omitempty"` 913 // ForceSendFields is a list of field names (e.g. "Availability") to 914 // unconditionally include in API requests. By default, fields with empty or 915 // default values are omitted from API requests. See 916 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 917 // details. 918 ForceSendFields []string `json:"-"` 919 // NullFields is a list of field names (e.g. "Availability") to include in API 920 // requests with the JSON null value. By default, fields with empty values are 921 // omitted from API requests. See 922 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 923 NullFields []string `json:"-"` 924 } 925 926 func (s *BasicSli) MarshalJSON() ([]byte, error) { 927 type NoMethod BasicSli 928 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 929 } 930 931 // BucketOptions: BucketOptions describes the bucket boundaries used to create 932 // a histogram for the distribution. The buckets can be in a linear sequence, 933 // an exponential sequence, or each bucket can be specified explicitly. 934 // BucketOptions does not include the number of values in each bucket.A bucket 935 // has an inclusive lower bound and exclusive upper bound for the values that 936 // are counted for that bucket. The upper bound of a bucket must be strictly 937 // greater than the lower bound. The sequence of N buckets for a distribution 938 // consists of an underflow bucket (number 0), zero or more finite buckets 939 // (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets 940 // are contiguous: the lower bound of bucket i (i > 0) is the same as the upper 941 // bound of bucket i - 1. The buckets span the whole range of finite values: 942 // lower bound of the underflow bucket is -infinity and the upper bound of the 943 // overflow bucket is +infinity. The finite buckets are so-called because both 944 // bounds are finite. 945 type BucketOptions struct { 946 // ExplicitBuckets: The explicit buckets. 947 ExplicitBuckets *Explicit `json:"explicitBuckets,omitempty"` 948 // ExponentialBuckets: The exponential buckets. 949 ExponentialBuckets *Exponential `json:"exponentialBuckets,omitempty"` 950 // LinearBuckets: The linear bucket. 951 LinearBuckets *Linear `json:"linearBuckets,omitempty"` 952 // ForceSendFields is a list of field names (e.g. "ExplicitBuckets") to 953 // unconditionally include in API requests. By default, fields with empty or 954 // default values are omitted from API requests. See 955 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 956 // details. 957 ForceSendFields []string `json:"-"` 958 // NullFields is a list of field names (e.g. "ExplicitBuckets") to include in 959 // API requests with the JSON null value. By default, fields with empty values 960 // are omitted from API requests. See 961 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 962 NullFields []string `json:"-"` 963 } 964 965 func (s *BucketOptions) MarshalJSON() ([]byte, error) { 966 type NoMethod BucketOptions 967 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 968 } 969 970 // CloudEndpoints: Cloud Endpoints service. Learn more at 971 // https://cloud.google.com/endpoints. 972 type CloudEndpoints struct { 973 // Service: The name of the Cloud Endpoints service underlying this service. 974 // Corresponds to the service resource label in the api monitored resource 975 // (https://cloud.google.com/monitoring/api/resources#tag_api). 976 Service string `json:"service,omitempty"` 977 // ForceSendFields is a list of field names (e.g. "Service") to unconditionally 978 // include in API requests. By default, fields with empty or default values are 979 // omitted from API requests. See 980 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 981 // details. 982 ForceSendFields []string `json:"-"` 983 // NullFields is a list of field names (e.g. "Service") to include in API 984 // requests with the JSON null value. By default, fields with empty values are 985 // omitted from API requests. See 986 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 987 NullFields []string `json:"-"` 988 } 989 990 func (s *CloudEndpoints) MarshalJSON() ([]byte, error) { 991 type NoMethod CloudEndpoints 992 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 993 } 994 995 // CloudFunctionV2Target: A Synthetic Monitor deployed to a Cloud Functions V2 996 // instance. 997 type CloudFunctionV2Target struct { 998 // CloudRunRevision: Output only. The cloud_run_revision Monitored Resource 999 // associated with the GCFv2. The Synthetic Monitor execution results (metrics, 1000 // logs, and spans) are reported against this Monitored Resource. This field is 1001 // output only. 1002 CloudRunRevision *MonitoredResource `json:"cloudRunRevision,omitempty"` 1003 // Name: Required. Fully qualified GCFv2 resource name i.e. 1004 // projects/{project}/locations/{location}/functions/{function} Required. 1005 Name string `json:"name,omitempty"` 1006 // ForceSendFields is a list of field names (e.g. "CloudRunRevision") to 1007 // unconditionally include in API requests. By default, fields with empty or 1008 // default values are omitted from API requests. See 1009 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1010 // details. 1011 ForceSendFields []string `json:"-"` 1012 // NullFields is a list of field names (e.g. "CloudRunRevision") to include in 1013 // API requests with the JSON null value. By default, fields with empty values 1014 // are omitted from API requests. See 1015 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1016 NullFields []string `json:"-"` 1017 } 1018 1019 func (s *CloudFunctionV2Target) MarshalJSON() ([]byte, error) { 1020 type NoMethod CloudFunctionV2Target 1021 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1022 } 1023 1024 // CloudRun: Cloud Run service. Learn more at https://cloud.google.com/run. 1025 type CloudRun struct { 1026 // Location: The location the service is run. Corresponds to the location 1027 // resource label in the cloud_run_revision monitored resource 1028 // (https://cloud.google.com/monitoring/api/resources#tag_cloud_run_revision). 1029 Location string `json:"location,omitempty"` 1030 // ServiceName: The name of the Cloud Run service. Corresponds to the 1031 // service_name resource label in the cloud_run_revision monitored resource 1032 // (https://cloud.google.com/monitoring/api/resources#tag_cloud_run_revision). 1033 ServiceName string `json:"serviceName,omitempty"` 1034 // ForceSendFields is a list of field names (e.g. "Location") to 1035 // unconditionally include in API requests. By default, fields with empty or 1036 // default values are omitted from API requests. See 1037 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1038 // details. 1039 ForceSendFields []string `json:"-"` 1040 // NullFields is a list of field names (e.g. "Location") to include in API 1041 // requests with the JSON null value. By default, fields with empty values are 1042 // omitted from API requests. See 1043 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1044 NullFields []string `json:"-"` 1045 } 1046 1047 func (s *CloudRun) MarshalJSON() ([]byte, error) { 1048 type NoMethod CloudRun 1049 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1050 } 1051 1052 // ClusterIstio: Istio service scoped to a single Kubernetes cluster. Learn 1053 // more at https://istio.io. Clusters running OSS Istio will have their 1054 // services ingested as this type. 1055 type ClusterIstio struct { 1056 // ClusterName: The name of the Kubernetes cluster in which this Istio service 1057 // is defined. Corresponds to the cluster_name resource label in k8s_cluster 1058 // resources. 1059 ClusterName string `json:"clusterName,omitempty"` 1060 // Location: The location of the Kubernetes cluster in which this Istio service 1061 // is defined. Corresponds to the location resource label in k8s_cluster 1062 // resources. 1063 Location string `json:"location,omitempty"` 1064 // ServiceName: The name of the Istio service underlying this service. 1065 // Corresponds to the destination_service_name metric label in Istio metrics. 1066 ServiceName string `json:"serviceName,omitempty"` 1067 // ServiceNamespace: The namespace of the Istio service underlying this 1068 // service. Corresponds to the destination_service_namespace metric label in 1069 // Istio metrics. 1070 ServiceNamespace string `json:"serviceNamespace,omitempty"` 1071 // ForceSendFields is a list of field names (e.g. "ClusterName") to 1072 // unconditionally include in API requests. By default, fields with empty or 1073 // default values are omitted from API requests. See 1074 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1075 // details. 1076 ForceSendFields []string `json:"-"` 1077 // NullFields is a list of field names (e.g. "ClusterName") to include in API 1078 // requests with the JSON null value. By default, fields with empty values are 1079 // omitted from API requests. See 1080 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1081 NullFields []string `json:"-"` 1082 } 1083 1084 func (s *ClusterIstio) MarshalJSON() ([]byte, error) { 1085 type NoMethod ClusterIstio 1086 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1087 } 1088 1089 // CollectdPayload: A collection of data points sent from a collectd-based 1090 // plugin. See the collectd documentation for more information. 1091 type CollectdPayload struct { 1092 // EndTime: The end time of the interval. 1093 EndTime string `json:"endTime,omitempty"` 1094 // Metadata: The measurement metadata. Example: "process_id" -> 12345 1095 Metadata map[string]TypedValue `json:"metadata,omitempty"` 1096 // Plugin: The name of the plugin. Example: "disk". 1097 Plugin string `json:"plugin,omitempty"` 1098 // PluginInstance: The instance name of the plugin Example: "hdcl". 1099 PluginInstance string `json:"pluginInstance,omitempty"` 1100 // StartTime: The start time of the interval. 1101 StartTime string `json:"startTime,omitempty"` 1102 // Type: The measurement type. Example: "memory". 1103 Type string `json:"type,omitempty"` 1104 // TypeInstance: The measurement type instance. Example: "used". 1105 TypeInstance string `json:"typeInstance,omitempty"` 1106 // Values: The measured values during this time interval. Each value must have 1107 // a different data_source_name. 1108 Values []*CollectdValue `json:"values,omitempty"` 1109 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 1110 // include in API requests. By default, fields with empty or default values are 1111 // omitted from API requests. See 1112 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1113 // details. 1114 ForceSendFields []string `json:"-"` 1115 // NullFields is a list of field names (e.g. "EndTime") to include in API 1116 // requests with the JSON null value. By default, fields with empty values are 1117 // omitted from API requests. See 1118 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1119 NullFields []string `json:"-"` 1120 } 1121 1122 func (s *CollectdPayload) MarshalJSON() ([]byte, error) { 1123 type NoMethod CollectdPayload 1124 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1125 } 1126 1127 // CollectdPayloadError: Describes the error status for payloads that were not 1128 // written. 1129 type CollectdPayloadError struct { 1130 // Error: Records the error status for the payload. If this field is present, 1131 // the partial errors for nested values won't be populated. 1132 Error *Status `json:"error,omitempty"` 1133 // Index: The zero-based index in 1134 // CreateCollectdTimeSeriesRequest.collectd_payloads. 1135 Index int64 `json:"index,omitempty"` 1136 // ValueErrors: Records the error status for values that were not written due 1137 // to an error.Failed payloads for which nothing is written will not include 1138 // partial value errors. 1139 ValueErrors []*CollectdValueError `json:"valueErrors,omitempty"` 1140 // ForceSendFields is a list of field names (e.g. "Error") to unconditionally 1141 // include in API requests. By default, fields with empty or default values are 1142 // omitted from API requests. See 1143 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1144 // details. 1145 ForceSendFields []string `json:"-"` 1146 // NullFields is a list of field names (e.g. "Error") to include in API 1147 // requests with the JSON null value. By default, fields with empty values are 1148 // omitted from API requests. See 1149 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1150 NullFields []string `json:"-"` 1151 } 1152 1153 func (s *CollectdPayloadError) MarshalJSON() ([]byte, error) { 1154 type NoMethod CollectdPayloadError 1155 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1156 } 1157 1158 // CollectdValue: A single data point from a collectd-based plugin. 1159 type CollectdValue struct { 1160 // DataSourceName: The data source for the collectd value. For example, there 1161 // are two data sources for network measurements: "rx" and "tx". 1162 DataSourceName string `json:"dataSourceName,omitempty"` 1163 // DataSourceType: The type of measurement. 1164 // 1165 // Possible values: 1166 // "UNSPECIFIED_DATA_SOURCE_TYPE" - An unspecified data source type. This 1167 // corresponds to 1168 // google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED. 1169 // "GAUGE" - An instantaneous measurement of a varying quantity. This 1170 // corresponds to google.api.MetricDescriptor.MetricKind.GAUGE. 1171 // "COUNTER" - A cumulative value over time. This corresponds to 1172 // google.api.MetricDescriptor.MetricKind.CUMULATIVE. 1173 // "DERIVE" - A rate of change of the measurement. 1174 // "ABSOLUTE" - An amount of change since the last measurement interval. This 1175 // corresponds to google.api.MetricDescriptor.MetricKind.DELTA. 1176 DataSourceType string `json:"dataSourceType,omitempty"` 1177 // Value: The measurement value. 1178 Value *TypedValue `json:"value,omitempty"` 1179 // ForceSendFields is a list of field names (e.g. "DataSourceName") to 1180 // unconditionally include in API requests. By default, fields with empty or 1181 // default values are omitted from API requests. See 1182 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1183 // details. 1184 ForceSendFields []string `json:"-"` 1185 // NullFields is a list of field names (e.g. "DataSourceName") to include in 1186 // API requests with the JSON null value. By default, fields with empty values 1187 // are omitted from API requests. See 1188 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1189 NullFields []string `json:"-"` 1190 } 1191 1192 func (s *CollectdValue) MarshalJSON() ([]byte, error) { 1193 type NoMethod CollectdValue 1194 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1195 } 1196 1197 // CollectdValueError: Describes the error status for values that were not 1198 // written. 1199 type CollectdValueError struct { 1200 // Error: Records the error status for the value. 1201 Error *Status `json:"error,omitempty"` 1202 // Index: The zero-based index in CollectdPayload.values within the parent 1203 // CreateCollectdTimeSeriesRequest.collectd_payloads. 1204 Index int64 `json:"index,omitempty"` 1205 // ForceSendFields is a list of field names (e.g. "Error") to unconditionally 1206 // include in API requests. By default, fields with empty or default values are 1207 // omitted from API requests. See 1208 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1209 // details. 1210 ForceSendFields []string `json:"-"` 1211 // NullFields is a list of field names (e.g. "Error") to include in API 1212 // requests with the JSON null value. By default, fields with empty values are 1213 // omitted from API requests. See 1214 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1215 NullFields []string `json:"-"` 1216 } 1217 1218 func (s *CollectdValueError) MarshalJSON() ([]byte, error) { 1219 type NoMethod CollectdValueError 1220 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1221 } 1222 1223 // Condition: A condition is a true/false test that determines when an alerting 1224 // policy should open an incident. If a condition evaluates to true, it 1225 // signifies that something is wrong. 1226 type Condition struct { 1227 // ConditionAbsent: A condition that checks that a time series continues to 1228 // receive new data points. 1229 ConditionAbsent *MetricAbsence `json:"conditionAbsent,omitempty"` 1230 // ConditionMatchedLog: A condition that checks for log messages matching given 1231 // constraints. If set, no other conditions can be present. 1232 ConditionMatchedLog *LogMatch `json:"conditionMatchedLog,omitempty"` 1233 // ConditionMonitoringQueryLanguage: A condition that uses the Monitoring Query 1234 // Language to define alerts. 1235 ConditionMonitoringQueryLanguage *MonitoringQueryLanguageCondition `json:"conditionMonitoringQueryLanguage,omitempty"` 1236 // ConditionPrometheusQueryLanguage: A condition that uses the Prometheus query 1237 // language to define alerts. 1238 ConditionPrometheusQueryLanguage *PrometheusQueryLanguageCondition `json:"conditionPrometheusQueryLanguage,omitempty"` 1239 // ConditionThreshold: A condition that compares a time series against a 1240 // threshold. 1241 ConditionThreshold *MetricThreshold `json:"conditionThreshold,omitempty"` 1242 // DisplayName: A short name or phrase used to identify the condition in 1243 // dashboards, notifications, and incidents. To avoid confusion, don't use the 1244 // same display name for multiple conditions in the same policy. 1245 DisplayName string `json:"displayName,omitempty"` 1246 // Name: Required if the condition exists. The unique resource name for this 1247 // condition. Its format is: 1248 // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITI 1249 // ON_ID] [CONDITION_ID] is assigned by Cloud Monitoring when the condition is 1250 // created as part of a new or updated alerting policy.When calling the 1251 // alertPolicies.create method, do not include the name field in the conditions 1252 // of the requested alerting policy. Cloud Monitoring creates the condition 1253 // identifiers and includes them in the new policy.When calling the 1254 // alertPolicies.update method to update a policy, including a condition name 1255 // causes the existing condition to be updated. Conditions without names are 1256 // added to the updated policy. Existing conditions are deleted if they are not 1257 // updated.Best practice is to preserve [CONDITION_ID] if you make only small 1258 // changes, such as those to condition thresholds, durations, or trigger 1259 // values. Otherwise, treat the change as a new condition and let the existing 1260 // condition be deleted. 1261 Name string `json:"name,omitempty"` 1262 // ForceSendFields is a list of field names (e.g. "ConditionAbsent") to 1263 // unconditionally include in API requests. By default, fields with empty or 1264 // default values are omitted from API requests. See 1265 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1266 // details. 1267 ForceSendFields []string `json:"-"` 1268 // NullFields is a list of field names (e.g. "ConditionAbsent") to include in 1269 // API requests with the JSON null value. By default, fields with empty values 1270 // are omitted from API requests. See 1271 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1272 NullFields []string `json:"-"` 1273 } 1274 1275 func (s *Condition) MarshalJSON() ([]byte, error) { 1276 type NoMethod Condition 1277 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1278 } 1279 1280 // ContentMatcher: Optional. Used to perform content matching. This allows 1281 // matching based on substrings and regular expressions, together with their 1282 // negations. Only the first 4 MB of an HTTP or HTTPS check's response (and the 1283 // first 1 MB of a TCP check's response) are examined for purposes of content 1284 // matching. 1285 type ContentMatcher struct { 1286 // Content: String, regex or JSON content to match. Maximum 1024 bytes. An 1287 // empty content string indicates no content matching is to be performed. 1288 Content string `json:"content,omitempty"` 1289 // JsonPathMatcher: Matcher information for MATCHES_JSON_PATH and 1290 // NOT_MATCHES_JSON_PATH 1291 JsonPathMatcher *JsonPathMatcher `json:"jsonPathMatcher,omitempty"` 1292 // Matcher: The type of content matcher that will be applied to the server 1293 // output, compared to the content string when the check is run. 1294 // 1295 // Possible values: 1296 // "CONTENT_MATCHER_OPTION_UNSPECIFIED" - No content matcher type specified 1297 // (maintained for backward compatibility, but deprecated for future use). 1298 // Treated as CONTAINS_STRING. 1299 // "CONTAINS_STRING" - Selects substring matching. The match succeeds if the 1300 // output contains the content string. This is the default value for checks 1301 // without a matcher option, or where the value of matcher is 1302 // CONTENT_MATCHER_OPTION_UNSPECIFIED. 1303 // "NOT_CONTAINS_STRING" - Selects negation of substring matching. The match 1304 // succeeds if the output does NOT contain the content string. 1305 // "MATCHES_REGEX" - Selects regular-expression matching. The match succeeds 1306 // if the output matches the regular expression specified in the content 1307 // string. Regex matching is only supported for HTTP/HTTPS checks. 1308 // "NOT_MATCHES_REGEX" - Selects negation of regular-expression matching. The 1309 // match succeeds if the output does NOT match the regular expression specified 1310 // in the content string. Regex matching is only supported for HTTP/HTTPS 1311 // checks. 1312 // "MATCHES_JSON_PATH" - Selects JSONPath matching. See JsonPathMatcher for 1313 // details on when the match succeeds. JSONPath matching is only supported for 1314 // HTTP/HTTPS checks. 1315 // "NOT_MATCHES_JSON_PATH" - Selects JSONPath matching. See JsonPathMatcher 1316 // for details on when the match succeeds. Succeeds when output does NOT match 1317 // as specified. JSONPath is only supported for HTTP/HTTPS checks. 1318 Matcher string `json:"matcher,omitempty"` 1319 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 1320 // include in API requests. By default, fields with empty or default values are 1321 // omitted from API requests. See 1322 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1323 // details. 1324 ForceSendFields []string `json:"-"` 1325 // NullFields is a list of field names (e.g. "Content") to include in API 1326 // requests with the JSON null value. By default, fields with empty values are 1327 // omitted from API requests. See 1328 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1329 NullFields []string `json:"-"` 1330 } 1331 1332 func (s *ContentMatcher) MarshalJSON() ([]byte, error) { 1333 type NoMethod ContentMatcher 1334 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1335 } 1336 1337 // CreateCollectdTimeSeriesRequest: The CreateCollectdTimeSeries request. 1338 type CreateCollectdTimeSeriesRequest struct { 1339 // CollectdPayloads: The collectd payloads representing the time series data. 1340 // You must not include more than a single point for each time series, so no 1341 // two payloads can have the same values for all of the fields plugin, 1342 // plugin_instance, type, and type_instance. 1343 CollectdPayloads []*CollectdPayload `json:"collectdPayloads,omitempty"` 1344 // CollectdVersion: The version of collectd that collected the data. Example: 1345 // "5.3.0-192.el6". 1346 CollectdVersion string `json:"collectdVersion,omitempty"` 1347 // Resource: The monitored resource associated with the time series. 1348 Resource *MonitoredResource `json:"resource,omitempty"` 1349 // ForceSendFields is a list of field names (e.g. "CollectdPayloads") to 1350 // unconditionally include in API requests. By default, fields with empty or 1351 // default values are omitted from API requests. See 1352 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1353 // details. 1354 ForceSendFields []string `json:"-"` 1355 // NullFields is a list of field names (e.g. "CollectdPayloads") to include in 1356 // API requests with the JSON null value. By default, fields with empty values 1357 // are omitted from API requests. See 1358 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1359 NullFields []string `json:"-"` 1360 } 1361 1362 func (s *CreateCollectdTimeSeriesRequest) MarshalJSON() ([]byte, error) { 1363 type NoMethod CreateCollectdTimeSeriesRequest 1364 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1365 } 1366 1367 // CreateCollectdTimeSeriesResponse: The CreateCollectdTimeSeries response. 1368 type CreateCollectdTimeSeriesResponse struct { 1369 // PayloadErrors: Records the error status for points that were not written due 1370 // to an error in the request.Failed requests for which nothing is written will 1371 // return an error response instead. Requests where data points were rejected 1372 // by the backend will set summary instead. 1373 PayloadErrors []*CollectdPayloadError `json:"payloadErrors,omitempty"` 1374 // Summary: Aggregate statistics from writing the payloads. This field is 1375 // omitted if all points were successfully written, so that the response is 1376 // empty. This is for backwards compatibility with clients that log errors on 1377 // any non-empty response. 1378 Summary *CreateTimeSeriesSummary `json:"summary,omitempty"` 1379 1380 // ServerResponse contains the HTTP response code and headers from the server. 1381 googleapi.ServerResponse `json:"-"` 1382 // ForceSendFields is a list of field names (e.g. "PayloadErrors") to 1383 // unconditionally include in API requests. By default, fields with empty or 1384 // default values are omitted from API requests. See 1385 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1386 // details. 1387 ForceSendFields []string `json:"-"` 1388 // NullFields is a list of field names (e.g. "PayloadErrors") to include in API 1389 // requests with the JSON null value. By default, fields with empty values are 1390 // omitted from API requests. See 1391 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1392 NullFields []string `json:"-"` 1393 } 1394 1395 func (s *CreateCollectdTimeSeriesResponse) MarshalJSON() ([]byte, error) { 1396 type NoMethod CreateCollectdTimeSeriesResponse 1397 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1398 } 1399 1400 // CreateTimeSeriesRequest: The CreateTimeSeries request. 1401 type CreateTimeSeriesRequest struct { 1402 // TimeSeries: Required. The new data to be added to a list of time series. 1403 // Adds at most one data point to each of several time series. The new data 1404 // point must be more recent than any other point in its time series. Each 1405 // TimeSeries value must fully specify a unique time series by supplying all 1406 // label values for the metric and the monitored resource.The maximum number of 1407 // TimeSeries objects per Create request is 200. 1408 TimeSeries []*TimeSeries `json:"timeSeries,omitempty"` 1409 // ForceSendFields is a list of field names (e.g. "TimeSeries") to 1410 // unconditionally include in API requests. By default, fields with empty or 1411 // default values are omitted from API requests. See 1412 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1413 // details. 1414 ForceSendFields []string `json:"-"` 1415 // NullFields is a list of field names (e.g. "TimeSeries") to include in API 1416 // requests with the JSON null value. By default, fields with empty values are 1417 // omitted from API requests. See 1418 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1419 NullFields []string `json:"-"` 1420 } 1421 1422 func (s *CreateTimeSeriesRequest) MarshalJSON() ([]byte, error) { 1423 type NoMethod CreateTimeSeriesRequest 1424 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1425 } 1426 1427 // CreateTimeSeriesSummary: Summary of the result of a failed request to write 1428 // data to a time series. 1429 type CreateTimeSeriesSummary struct { 1430 // Errors: The number of points that failed to be written. Order is not 1431 // guaranteed. 1432 Errors []*Error `json:"errors,omitempty"` 1433 // SuccessPointCount: The number of points that were successfully written. 1434 SuccessPointCount int64 `json:"successPointCount,omitempty"` 1435 // TotalPointCount: The number of points in the request. 1436 TotalPointCount int64 `json:"totalPointCount,omitempty"` 1437 // ForceSendFields is a list of field names (e.g. "Errors") to unconditionally 1438 // include in API requests. By default, fields with empty or default values are 1439 // omitted from API requests. See 1440 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1441 // details. 1442 ForceSendFields []string `json:"-"` 1443 // NullFields is a list of field names (e.g. "Errors") to include in API 1444 // requests with the JSON null value. By default, fields with empty values are 1445 // omitted from API requests. See 1446 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1447 NullFields []string `json:"-"` 1448 } 1449 1450 func (s *CreateTimeSeriesSummary) MarshalJSON() ([]byte, error) { 1451 type NoMethod CreateTimeSeriesSummary 1452 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1453 } 1454 1455 // Criteria: Criteria specific to the AlertPolicys that this Snooze applies to. 1456 // The Snooze will suppress alerts that come from one of the AlertPolicys whose 1457 // names are supplied. 1458 type Criteria struct { 1459 // Policies: The specific AlertPolicy names for the alert that should be 1460 // snoozed. The format is: 1461 // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID] There is a limit 1462 // of 16 policies per snooze. This limit is checked during snooze creation. 1463 Policies []string `json:"policies,omitempty"` 1464 // ForceSendFields is a list of field names (e.g. "Policies") to 1465 // unconditionally include in API requests. By default, fields with empty or 1466 // default values are omitted from API requests. See 1467 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1468 // details. 1469 ForceSendFields []string `json:"-"` 1470 // NullFields is a list of field names (e.g. "Policies") to include in API 1471 // requests with the JSON null value. By default, fields with empty values are 1472 // omitted from API requests. See 1473 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1474 NullFields []string `json:"-"` 1475 } 1476 1477 func (s *Criteria) MarshalJSON() ([]byte, error) { 1478 type NoMethod Criteria 1479 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1480 } 1481 1482 // Custom: Use a custom service to designate a service that you want to monitor 1483 // when none of the other service types (like App Engine, Cloud Run, or a GKE 1484 // type) matches your intended service. 1485 type Custom struct { 1486 } 1487 1488 // Distribution: Distribution contains summary statistics for a population of 1489 // values. It optionally contains a histogram representing the distribution of 1490 // those values across a set of buckets.The summary statistics are the count, 1491 // mean, sum of the squared deviation from the mean, the minimum, and the 1492 // maximum of the set of population of values. The histogram is based on a 1493 // sequence of buckets and gives a count of values that fall into each bucket. 1494 // The boundaries of the buckets are given either explicitly or by formulas for 1495 // buckets of fixed or exponentially increasing widths.Although it is not 1496 // forbidden, it is generally a bad idea to include non-finite values 1497 // (infinities or NaNs) in the population of values, as this will render the 1498 // mean and sum_of_squared_deviation fields meaningless. 1499 type Distribution struct { 1500 // BucketCounts: Required in the Cloud Monitoring API v3. The values for each 1501 // bucket specified in bucket_options. The sum of the values in bucketCounts 1502 // must equal the value in the count field of the Distribution object. The 1503 // order of the bucket counts follows the numbering schemes described for the 1504 // three bucket types. The underflow bucket has number 0; the finite buckets, 1505 // if any, have numbers 1 through N-2; and the overflow bucket has number N-1. 1506 // The size of bucket_counts must not be greater than N. If the size is less 1507 // than N, then the remaining buckets are assigned values of zero. 1508 BucketCounts googleapi.Int64s `json:"bucketCounts,omitempty"` 1509 // BucketOptions: Required in the Cloud Monitoring API v3. Defines the 1510 // histogram bucket boundaries. 1511 BucketOptions *BucketOptions `json:"bucketOptions,omitempty"` 1512 // Count: The number of values in the population. Must be non-negative. This 1513 // value must equal the sum of the values in bucket_counts if a histogram is 1514 // provided. 1515 Count int64 `json:"count,omitempty,string"` 1516 // Exemplars: Must be in increasing order of value field. 1517 Exemplars []*Exemplar `json:"exemplars,omitempty"` 1518 // Mean: The arithmetic mean of the values in the population. If count is zero 1519 // then this field must be zero. 1520 Mean float64 `json:"mean,omitempty"` 1521 // Range: If specified, contains the range of the population values. The field 1522 // must not be present if the count is zero. This field is presently ignored by 1523 // the Cloud Monitoring API v3. 1524 Range *Range `json:"range,omitempty"` 1525 // SumOfSquaredDeviation: The sum of squared deviations from the mean of the 1526 // values in the population. For values x_i this is: Sumi=1..n ((x_i - mean)^2) 1527 // Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition 1528 // describes Welford's method for accumulating this sum in one pass.If count is 1529 // zero then this field must be zero. 1530 SumOfSquaredDeviation float64 `json:"sumOfSquaredDeviation,omitempty"` 1531 // ForceSendFields is a list of field names (e.g. "BucketCounts") to 1532 // unconditionally include in API requests. By default, fields with empty or 1533 // default values are omitted from API requests. See 1534 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1535 // details. 1536 ForceSendFields []string `json:"-"` 1537 // NullFields is a list of field names (e.g. "BucketCounts") to include in API 1538 // requests with the JSON null value. By default, fields with empty values are 1539 // omitted from API requests. See 1540 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1541 NullFields []string `json:"-"` 1542 } 1543 1544 func (s *Distribution) MarshalJSON() ([]byte, error) { 1545 type NoMethod Distribution 1546 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1547 } 1548 1549 func (s *Distribution) UnmarshalJSON(data []byte) error { 1550 type NoMethod Distribution 1551 var s1 struct { 1552 Mean gensupport.JSONFloat64 `json:"mean"` 1553 SumOfSquaredDeviation gensupport.JSONFloat64 `json:"sumOfSquaredDeviation"` 1554 *NoMethod 1555 } 1556 s1.NoMethod = (*NoMethod)(s) 1557 if err := json.Unmarshal(data, &s1); err != nil { 1558 return err 1559 } 1560 s.Mean = float64(s1.Mean) 1561 s.SumOfSquaredDeviation = float64(s1.SumOfSquaredDeviation) 1562 return nil 1563 } 1564 1565 // DistributionCut: A DistributionCut defines a TimeSeries and thresholds used 1566 // for measuring good service and total service. The TimeSeries must have 1567 // ValueType = DISTRIBUTION and MetricKind = DELTA or MetricKind = CUMULATIVE. 1568 // The computed good_service will be the estimated count of values in the 1569 // Distribution that fall within the specified min and max. 1570 type DistributionCut struct { 1571 // DistributionFilter: A monitoring filter 1572 // (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries 1573 // aggregating values. Must have ValueType = DISTRIBUTION and MetricKind = 1574 // DELTA or MetricKind = CUMULATIVE. 1575 DistributionFilter string `json:"distributionFilter,omitempty"` 1576 // Range: Range of values considered "good." For a one-sided range, set one 1577 // bound to an infinite value. 1578 Range *GoogleMonitoringV3Range `json:"range,omitempty"` 1579 // ForceSendFields is a list of field names (e.g. "DistributionFilter") to 1580 // unconditionally include in API requests. By default, fields with empty or 1581 // default values are omitted from API requests. See 1582 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1583 // details. 1584 ForceSendFields []string `json:"-"` 1585 // NullFields is a list of field names (e.g. "DistributionFilter") to include 1586 // in API requests with the JSON null value. By default, fields with empty 1587 // values are omitted from API requests. See 1588 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1589 NullFields []string `json:"-"` 1590 } 1591 1592 func (s *DistributionCut) MarshalJSON() ([]byte, error) { 1593 type NoMethod DistributionCut 1594 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1595 } 1596 1597 // Documentation: Documentation that is included in the notifications and 1598 // incidents pertaining to this policy. 1599 type Documentation struct { 1600 // Content: The body of the documentation, interpreted according to mime_type. 1601 // The content may not exceed 8,192 Unicode characters and may not exceed more 1602 // than 10,240 bytes when encoded in UTF-8 format, whichever is smaller. This 1603 // text can be templatized by using variables 1604 // (https://cloud.google.com/monitoring/alerts/doc-variables). 1605 Content string `json:"content,omitempty"` 1606 // MimeType: The format of the content field. Presently, only the value 1607 // "text/markdown" is supported. See Markdown 1608 // (https://en.wikipedia.org/wiki/Markdown) for more information. 1609 MimeType string `json:"mimeType,omitempty"` 1610 // Subject: Optional. The subject line of the notification. The subject line 1611 // may not exceed 10,240 bytes. In notifications generated by this policy, the 1612 // contents of the subject line after variable expansion will be truncated to 1613 // 255 bytes or shorter at the latest UTF-8 character boundary. The 255-byte 1614 // limit is recommended by this thread 1615 // (https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). 1616 // It is both the limit imposed by some third-party ticketing products and it 1617 // is common to define textual fields in databases as VARCHAR(255).The contents 1618 // of the subject line can be templatized by using variables 1619 // (https://cloud.google.com/monitoring/alerts/doc-variables). If this field is 1620 // missing or empty, a default subject line will be generated. 1621 Subject string `json:"subject,omitempty"` 1622 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 1623 // include in API requests. By default, fields with empty or default values are 1624 // omitted from API requests. See 1625 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1626 // details. 1627 ForceSendFields []string `json:"-"` 1628 // NullFields is a list of field names (e.g. "Content") to include in API 1629 // requests with the JSON null value. By default, fields with empty values are 1630 // omitted from API requests. See 1631 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1632 NullFields []string `json:"-"` 1633 } 1634 1635 func (s *Documentation) MarshalJSON() ([]byte, error) { 1636 type NoMethod Documentation 1637 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1638 } 1639 1640 // DroppedLabels: A set of (label, value) pairs that were removed from a 1641 // Distribution time series during aggregation and then added as an attachment 1642 // to a Distribution.Exemplar.The full label set for the exemplars is 1643 // constructed by using the dropped pairs in combination with the label values 1644 // that remain on the aggregated Distribution time series. The constructed full 1645 // label set can be used to identify the specific entity, such as the instance 1646 // or job, which might be contributing to a long-tail. However, with dropped 1647 // labels, the storage requirements are reduced because only the aggregated 1648 // distribution values for a large group of time series are stored.Note that 1649 // there are no guarantees on ordering of the labels from exemplar-to-exemplar 1650 // and from distribution-to-distribution in the same stream, and there may be 1651 // duplicates. It is up to clients to resolve any ambiguities. 1652 type DroppedLabels struct { 1653 // Label: Map from label to its value, for all labels dropped in any 1654 // aggregation. 1655 Label map[string]string `json:"label,omitempty"` 1656 // ForceSendFields is a list of field names (e.g. "Label") to unconditionally 1657 // include in API requests. By default, fields with empty or default values are 1658 // omitted from API requests. See 1659 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1660 // details. 1661 ForceSendFields []string `json:"-"` 1662 // NullFields is a list of field names (e.g. "Label") to include in API 1663 // requests with the JSON null value. By default, fields with empty values are 1664 // omitted from API requests. See 1665 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1666 NullFields []string `json:"-"` 1667 } 1668 1669 func (s *DroppedLabels) MarshalJSON() ([]byte, error) { 1670 type NoMethod DroppedLabels 1671 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1672 } 1673 1674 // Empty: A generic empty message that you can re-use to avoid defining 1675 // duplicated empty messages in your APIs. A typical example is to use it as 1676 // the request or the response type of an API method. For instance: service Foo 1677 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } 1678 type Empty struct { 1679 // ServerResponse contains the HTTP response code and headers from the server. 1680 googleapi.ServerResponse `json:"-"` 1681 } 1682 1683 // Error: Detailed information about an error category. 1684 type Error struct { 1685 // PointCount: The number of points that couldn't be written because of status. 1686 PointCount int64 `json:"pointCount,omitempty"` 1687 // Status: The status of the requested write operation. 1688 Status *Status `json:"status,omitempty"` 1689 // ForceSendFields is a list of field names (e.g. "PointCount") to 1690 // unconditionally include in API requests. By default, fields with empty or 1691 // default values are omitted from API requests. See 1692 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1693 // details. 1694 ForceSendFields []string `json:"-"` 1695 // NullFields is a list of field names (e.g. "PointCount") to include in API 1696 // requests with the JSON null value. By default, fields with empty values are 1697 // omitted from API requests. See 1698 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1699 NullFields []string `json:"-"` 1700 } 1701 1702 func (s *Error) MarshalJSON() ([]byte, error) { 1703 type NoMethod Error 1704 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1705 } 1706 1707 // Exemplar: Exemplars are example points that may be used to annotate 1708 // aggregated distribution values. They are metadata that gives information 1709 // about a particular value added to a Distribution bucket, such as a trace ID 1710 // that was active when a value was added. They may contain further 1711 // information, such as a example values and timestamps, origin, etc. 1712 type Exemplar struct { 1713 // Attachments: Contextual information about the example value. Examples 1714 // are:Trace: type.googleapis.com/google.monitoring.v3.SpanContextLiteral 1715 // string: type.googleapis.com/google.protobuf.StringValueLabels dropped during 1716 // aggregation: type.googleapis.com/google.monitoring.v3.DroppedLabelsThere may 1717 // be only a single attachment of any given message type in a single exemplar, 1718 // and this is enforced by the system. 1719 Attachments []googleapi.RawMessage `json:"attachments,omitempty"` 1720 // Timestamp: The observation (sampling) time of the above value. 1721 Timestamp string `json:"timestamp,omitempty"` 1722 // Value: Value of the exemplar point. This value determines to which bucket 1723 // the exemplar belongs. 1724 Value float64 `json:"value,omitempty"` 1725 // ForceSendFields is a list of field names (e.g. "Attachments") to 1726 // unconditionally include in API requests. By default, fields with empty or 1727 // default values are omitted from API requests. See 1728 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1729 // details. 1730 ForceSendFields []string `json:"-"` 1731 // NullFields is a list of field names (e.g. "Attachments") to include in API 1732 // requests with the JSON null value. By default, fields with empty values are 1733 // omitted from API requests. See 1734 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1735 NullFields []string `json:"-"` 1736 } 1737 1738 func (s *Exemplar) MarshalJSON() ([]byte, error) { 1739 type NoMethod Exemplar 1740 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1741 } 1742 1743 func (s *Exemplar) UnmarshalJSON(data []byte) error { 1744 type NoMethod Exemplar 1745 var s1 struct { 1746 Value gensupport.JSONFloat64 `json:"value"` 1747 *NoMethod 1748 } 1749 s1.NoMethod = (*NoMethod)(s) 1750 if err := json.Unmarshal(data, &s1); err != nil { 1751 return err 1752 } 1753 s.Value = float64(s1.Value) 1754 return nil 1755 } 1756 1757 // Explicit: Specifies a set of buckets with arbitrary widths.There are 1758 // size(bounds) + 1 (= N) buckets. Bucket i has the following boundaries:Upper 1759 // bound (0 <= i < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The 1760 // bounds field must contain at least one element. If bounds has only one 1761 // element, then there are no finite buckets, and that single element is the 1762 // common boundary of the overflow and underflow buckets. 1763 type Explicit struct { 1764 // Bounds: The values must be monotonically increasing. 1765 Bounds []float64 `json:"bounds,omitempty"` 1766 // ForceSendFields is a list of field names (e.g. "Bounds") to unconditionally 1767 // include in API requests. By default, fields with empty or default values are 1768 // omitted from API requests. See 1769 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1770 // details. 1771 ForceSendFields []string `json:"-"` 1772 // NullFields is a list of field names (e.g. "Bounds") to include in API 1773 // requests with the JSON null value. By default, fields with empty values are 1774 // omitted from API requests. See 1775 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1776 NullFields []string `json:"-"` 1777 } 1778 1779 func (s *Explicit) MarshalJSON() ([]byte, error) { 1780 type NoMethod Explicit 1781 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1782 } 1783 1784 func (s *Explicit) UnmarshalJSON(data []byte) error { 1785 type NoMethod Explicit 1786 var s1 struct { 1787 Bounds []gensupport.JSONFloat64 `json:"bounds"` 1788 *NoMethod 1789 } 1790 s1.NoMethod = (*NoMethod)(s) 1791 if err := json.Unmarshal(data, &s1); err != nil { 1792 return err 1793 } 1794 s.Bounds = make([]float64, len(s1.Bounds)) 1795 for i := range s1.Bounds { 1796 s.Bounds[i] = float64(s1.Bounds[i]) 1797 } 1798 return nil 1799 } 1800 1801 // Exponential: Specifies an exponential sequence of buckets that have a width 1802 // that is proportional to the value of the lower bound. Each bucket represents 1803 // a constant relative uncertainty on a specific value in the bucket.There are 1804 // num_finite_buckets + 2 (= N) buckets. Bucket i has the following 1805 // boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i).Lower 1806 // bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). 1807 type Exponential struct { 1808 // GrowthFactor: Must be greater than 1. 1809 GrowthFactor float64 `json:"growthFactor,omitempty"` 1810 // NumFiniteBuckets: Must be greater than 0. 1811 NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"` 1812 // Scale: Must be greater than 0. 1813 Scale float64 `json:"scale,omitempty"` 1814 // ForceSendFields is a list of field names (e.g. "GrowthFactor") to 1815 // unconditionally include in API requests. By default, fields with empty or 1816 // default values are omitted from API requests. See 1817 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1818 // details. 1819 ForceSendFields []string `json:"-"` 1820 // NullFields is a list of field names (e.g. "GrowthFactor") to include in API 1821 // requests with the JSON null value. By default, fields with empty values are 1822 // omitted from API requests. See 1823 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1824 NullFields []string `json:"-"` 1825 } 1826 1827 func (s *Exponential) MarshalJSON() ([]byte, error) { 1828 type NoMethod Exponential 1829 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1830 } 1831 1832 func (s *Exponential) UnmarshalJSON(data []byte) error { 1833 type NoMethod Exponential 1834 var s1 struct { 1835 GrowthFactor gensupport.JSONFloat64 `json:"growthFactor"` 1836 Scale gensupport.JSONFloat64 `json:"scale"` 1837 *NoMethod 1838 } 1839 s1.NoMethod = (*NoMethod)(s) 1840 if err := json.Unmarshal(data, &s1); err != nil { 1841 return err 1842 } 1843 s.GrowthFactor = float64(s1.GrowthFactor) 1844 s.Scale = float64(s1.Scale) 1845 return nil 1846 } 1847 1848 // Field: A single field of a message type. 1849 type Field struct { 1850 // Cardinality: The field cardinality. 1851 // 1852 // Possible values: 1853 // "CARDINALITY_UNKNOWN" - For fields with unknown cardinality. 1854 // "CARDINALITY_OPTIONAL" - For optional fields. 1855 // "CARDINALITY_REQUIRED" - For required fields. Proto2 syntax only. 1856 // "CARDINALITY_REPEATED" - For repeated fields. 1857 Cardinality string `json:"cardinality,omitempty"` 1858 // DefaultValue: The string value of the default value of this field. Proto2 1859 // syntax only. 1860 DefaultValue string `json:"defaultValue,omitempty"` 1861 // JsonName: The field JSON name. 1862 JsonName string `json:"jsonName,omitempty"` 1863 // Kind: The field type. 1864 // 1865 // Possible values: 1866 // "TYPE_UNKNOWN" - Field type unknown. 1867 // "TYPE_DOUBLE" - Field type double. 1868 // "TYPE_FLOAT" - Field type float. 1869 // "TYPE_INT64" - Field type int64. 1870 // "TYPE_UINT64" - Field type uint64. 1871 // "TYPE_INT32" - Field type int32. 1872 // "TYPE_FIXED64" - Field type fixed64. 1873 // "TYPE_FIXED32" - Field type fixed32. 1874 // "TYPE_BOOL" - Field type bool. 1875 // "TYPE_STRING" - Field type string. 1876 // "TYPE_GROUP" - Field type group. Proto2 syntax only, and deprecated. 1877 // "TYPE_MESSAGE" - Field type message. 1878 // "TYPE_BYTES" - Field type bytes. 1879 // "TYPE_UINT32" - Field type uint32. 1880 // "TYPE_ENUM" - Field type enum. 1881 // "TYPE_SFIXED32" - Field type sfixed32. 1882 // "TYPE_SFIXED64" - Field type sfixed64. 1883 // "TYPE_SINT32" - Field type sint32. 1884 // "TYPE_SINT64" - Field type sint64. 1885 Kind string `json:"kind,omitempty"` 1886 // Name: The field name. 1887 Name string `json:"name,omitempty"` 1888 // Number: The field number. 1889 Number int64 `json:"number,omitempty"` 1890 // OneofIndex: The index of the field type in Type.oneofs, for message or 1891 // enumeration types. The first type has index 1; zero means the type is not in 1892 // the list. 1893 OneofIndex int64 `json:"oneofIndex,omitempty"` 1894 // Options: The protocol buffer options. 1895 Options []*Option `json:"options,omitempty"` 1896 // Packed: Whether to use alternative packed wire representation. 1897 Packed bool `json:"packed,omitempty"` 1898 // TypeUrl: The field type URL, without the scheme, for message or enumeration 1899 // types. Example: "type.googleapis.com/google.protobuf.Timestamp". 1900 TypeUrl string `json:"typeUrl,omitempty"` 1901 // ForceSendFields is a list of field names (e.g. "Cardinality") to 1902 // unconditionally include in API requests. By default, fields with empty or 1903 // default values are omitted from API requests. See 1904 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1905 // details. 1906 ForceSendFields []string `json:"-"` 1907 // NullFields is a list of field names (e.g. "Cardinality") to include in API 1908 // requests with the JSON null value. By default, fields with empty values are 1909 // omitted from API requests. See 1910 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1911 NullFields []string `json:"-"` 1912 } 1913 1914 func (s *Field) MarshalJSON() ([]byte, error) { 1915 type NoMethod Field 1916 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1917 } 1918 1919 // ForecastOptions: Options used when forecasting the time series and testing 1920 // the predicted value against the threshold. 1921 type ForecastOptions struct { 1922 // ForecastHorizon: Required. The length of time into the future to forecast 1923 // whether a time series will violate the threshold. If the predicted value is 1924 // found to violate the threshold, and the violation is observed in all 1925 // forecasts made for the configured duration, then the time series is 1926 // considered to be failing. The forecast horizon can range from 1 hour to 60 1927 // hours. 1928 ForecastHorizon string `json:"forecastHorizon,omitempty"` 1929 // ForceSendFields is a list of field names (e.g. "ForecastHorizon") to 1930 // unconditionally include in API requests. By default, fields with empty or 1931 // default values are omitted from API requests. See 1932 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1933 // details. 1934 ForceSendFields []string `json:"-"` 1935 // NullFields is a list of field names (e.g. "ForecastHorizon") to include in 1936 // API requests with the JSON null value. By default, fields with empty values 1937 // are omitted from API requests. See 1938 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1939 NullFields []string `json:"-"` 1940 } 1941 1942 func (s *ForecastOptions) MarshalJSON() ([]byte, error) { 1943 type NoMethod ForecastOptions 1944 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1945 } 1946 1947 // GetNotificationChannelVerificationCodeRequest: The 1948 // GetNotificationChannelVerificationCode request. 1949 type GetNotificationChannelVerificationCodeRequest struct { 1950 // ExpireTime: The desired expiration time. If specified, the API will 1951 // guarantee that the returned code will not be valid after the specified 1952 // timestamp; however, the API cannot guarantee that the returned code will be 1953 // valid for at least as long as the requested time (the API puts an upper 1954 // bound on the amount of time for which a code may be valid). If omitted, a 1955 // default expiration will be used, which may be less than the max permissible 1956 // expiration (so specifying an expiration may extend the code's lifetime over 1957 // omitting an expiration, even though the API does impose an upper limit on 1958 // the maximum expiration that is permitted). 1959 ExpireTime string `json:"expireTime,omitempty"` 1960 // ForceSendFields is a list of field names (e.g. "ExpireTime") to 1961 // unconditionally include in API requests. By default, fields with empty or 1962 // default values are omitted from API requests. See 1963 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1964 // details. 1965 ForceSendFields []string `json:"-"` 1966 // NullFields is a list of field names (e.g. "ExpireTime") to include in API 1967 // requests with the JSON null value. By default, fields with empty values are 1968 // omitted from API requests. See 1969 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1970 NullFields []string `json:"-"` 1971 } 1972 1973 func (s *GetNotificationChannelVerificationCodeRequest) MarshalJSON() ([]byte, error) { 1974 type NoMethod GetNotificationChannelVerificationCodeRequest 1975 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1976 } 1977 1978 // GetNotificationChannelVerificationCodeResponse: The 1979 // GetNotificationChannelVerificationCode request. 1980 type GetNotificationChannelVerificationCodeResponse struct { 1981 // Code: The verification code, which may be used to verify other channels that 1982 // have an equivalent identity (i.e. other channels of the same type with the 1983 // same fingerprint such as other email channels with the same email address or 1984 // other sms channels with the same number). 1985 Code string `json:"code,omitempty"` 1986 // ExpireTime: The expiration time associated with the code that was returned. 1987 // If an expiration was provided in the request, this is the minimum of the 1988 // requested expiration in the request and the max permitted expiration. 1989 ExpireTime string `json:"expireTime,omitempty"` 1990 1991 // ServerResponse contains the HTTP response code and headers from the server. 1992 googleapi.ServerResponse `json:"-"` 1993 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 1994 // include in API requests. By default, fields with empty or default values are 1995 // omitted from API requests. See 1996 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1997 // details. 1998 ForceSendFields []string `json:"-"` 1999 // NullFields is a list of field names (e.g. "Code") to include in API requests 2000 // with the JSON null value. By default, fields with empty values are omitted 2001 // from API requests. See 2002 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2003 NullFields []string `json:"-"` 2004 } 2005 2006 func (s *GetNotificationChannelVerificationCodeResponse) MarshalJSON() ([]byte, error) { 2007 type NoMethod GetNotificationChannelVerificationCodeResponse 2008 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2009 } 2010 2011 // GkeNamespace: GKE Namespace. The field names correspond to the resource 2012 // metadata labels on monitored resources that fall under a namespace (for 2013 // example, k8s_container or k8s_pod). 2014 type GkeNamespace struct { 2015 // ClusterName: The name of the parent cluster. 2016 ClusterName string `json:"clusterName,omitempty"` 2017 // Location: The location of the parent cluster. This may be a zone or region. 2018 Location string `json:"location,omitempty"` 2019 // NamespaceName: The name of this namespace. 2020 NamespaceName string `json:"namespaceName,omitempty"` 2021 // ProjectId: Output only. The project this resource lives in. For legacy 2022 // services migrated from the Custom type, this may be a distinct project from 2023 // the one parenting the service itself. 2024 ProjectId string `json:"projectId,omitempty"` 2025 // ForceSendFields is a list of field names (e.g. "ClusterName") to 2026 // unconditionally include in API requests. By default, fields with empty or 2027 // default values are omitted from API requests. See 2028 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2029 // details. 2030 ForceSendFields []string `json:"-"` 2031 // NullFields is a list of field names (e.g. "ClusterName") to include in API 2032 // requests with the JSON null value. By default, fields with empty values are 2033 // omitted from API requests. See 2034 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2035 NullFields []string `json:"-"` 2036 } 2037 2038 func (s *GkeNamespace) MarshalJSON() ([]byte, error) { 2039 type NoMethod GkeNamespace 2040 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2041 } 2042 2043 // GkeService: GKE Service. The "service" here represents a Kubernetes service 2044 // object (https://kubernetes.io/docs/concepts/services-networking/service). 2045 // The field names correspond to the resource labels on k8s_service monitored 2046 // resources 2047 // (https://cloud.google.com/monitoring/api/resources#tag_k8s_service). 2048 type GkeService struct { 2049 // ClusterName: The name of the parent cluster. 2050 ClusterName string `json:"clusterName,omitempty"` 2051 // Location: The location of the parent cluster. This may be a zone or region. 2052 Location string `json:"location,omitempty"` 2053 // NamespaceName: The name of the parent namespace. 2054 NamespaceName string `json:"namespaceName,omitempty"` 2055 // ProjectId: Output only. The project this resource lives in. For legacy 2056 // services migrated from the Custom type, this may be a distinct project from 2057 // the one parenting the service itself. 2058 ProjectId string `json:"projectId,omitempty"` 2059 // ServiceName: The name of this service. 2060 ServiceName string `json:"serviceName,omitempty"` 2061 // ForceSendFields is a list of field names (e.g. "ClusterName") to 2062 // unconditionally include in API requests. By default, fields with empty or 2063 // default values are omitted from API requests. See 2064 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2065 // details. 2066 ForceSendFields []string `json:"-"` 2067 // NullFields is a list of field names (e.g. "ClusterName") to include in API 2068 // requests with the JSON null value. By default, fields with empty values are 2069 // omitted from API requests. See 2070 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2071 NullFields []string `json:"-"` 2072 } 2073 2074 func (s *GkeService) MarshalJSON() ([]byte, error) { 2075 type NoMethod GkeService 2076 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2077 } 2078 2079 // GkeWorkload: A GKE Workload (Deployment, StatefulSet, etc). The field names 2080 // correspond to the metadata labels on monitored resources that fall under a 2081 // workload (for example, k8s_container or k8s_pod). 2082 type GkeWorkload struct { 2083 // ClusterName: The name of the parent cluster. 2084 ClusterName string `json:"clusterName,omitempty"` 2085 // Location: The location of the parent cluster. This may be a zone or region. 2086 Location string `json:"location,omitempty"` 2087 // NamespaceName: The name of the parent namespace. 2088 NamespaceName string `json:"namespaceName,omitempty"` 2089 // ProjectId: Output only. The project this resource lives in. For legacy 2090 // services migrated from the Custom type, this may be a distinct project from 2091 // the one parenting the service itself. 2092 ProjectId string `json:"projectId,omitempty"` 2093 // TopLevelControllerName: The name of this workload. 2094 TopLevelControllerName string `json:"topLevelControllerName,omitempty"` 2095 // TopLevelControllerType: The type of this workload (for example, "Deployment" 2096 // or "DaemonSet") 2097 TopLevelControllerType string `json:"topLevelControllerType,omitempty"` 2098 // ForceSendFields is a list of field names (e.g. "ClusterName") to 2099 // unconditionally include in API requests. By default, fields with empty or 2100 // default values are omitted from API requests. See 2101 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2102 // details. 2103 ForceSendFields []string `json:"-"` 2104 // NullFields is a list of field names (e.g. "ClusterName") to include in API 2105 // requests with the JSON null value. By default, fields with empty values are 2106 // omitted from API requests. See 2107 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2108 NullFields []string `json:"-"` 2109 } 2110 2111 func (s *GkeWorkload) MarshalJSON() ([]byte, error) { 2112 type NoMethod GkeWorkload 2113 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2114 } 2115 2116 // GoogleMonitoringV3Range: Range of numerical values within min and max. 2117 type GoogleMonitoringV3Range struct { 2118 // Max: Range maximum. 2119 Max float64 `json:"max,omitempty"` 2120 // Min: Range minimum. 2121 Min float64 `json:"min,omitempty"` 2122 // ForceSendFields is a list of field names (e.g. "Max") to unconditionally 2123 // include in API requests. By default, fields with empty or default values are 2124 // omitted from API requests. See 2125 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2126 // details. 2127 ForceSendFields []string `json:"-"` 2128 // NullFields is a list of field names (e.g. "Max") to include in API requests 2129 // with the JSON null value. By default, fields with empty values are omitted 2130 // from API requests. See 2131 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2132 NullFields []string `json:"-"` 2133 } 2134 2135 func (s *GoogleMonitoringV3Range) MarshalJSON() ([]byte, error) { 2136 type NoMethod GoogleMonitoringV3Range 2137 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2138 } 2139 2140 func (s *GoogleMonitoringV3Range) UnmarshalJSON(data []byte) error { 2141 type NoMethod GoogleMonitoringV3Range 2142 var s1 struct { 2143 Max gensupport.JSONFloat64 `json:"max"` 2144 Min gensupport.JSONFloat64 `json:"min"` 2145 *NoMethod 2146 } 2147 s1.NoMethod = (*NoMethod)(s) 2148 if err := json.Unmarshal(data, &s1); err != nil { 2149 return err 2150 } 2151 s.Max = float64(s1.Max) 2152 s.Min = float64(s1.Min) 2153 return nil 2154 } 2155 2156 // Group: The description of a dynamic collection of monitored resources. Each 2157 // group has a filter that is matched against monitored resources and their 2158 // associated metadata. If a group's filter matches an available monitored 2159 // resource, then that resource is a member of that group. Groups can contain 2160 // any number of monitored resources, and each monitored resource can be a 2161 // member of any number of groups.Groups can be nested in parent-child 2162 // hierarchies. The parentName field identifies an optional parent for each 2163 // group. If a group has a parent, then the only monitored resources available 2164 // to be matched by the group's filter are the resources contained in the 2165 // parent group. In other words, a group contains the monitored resources that 2166 // match its filter and the filters of all the group's ancestors. A group 2167 // without a parent can contain any monitored resource.For example, consider an 2168 // infrastructure running a set of instances with two user-defined tags: 2169 // "environment" and "role". A parent group has a filter, 2170 // environment="production". A child of that parent group has a filter, 2171 // role="transcoder". The parent group contains all instances in the production 2172 // environment, regardless of their roles. The child group contains instances 2173 // that have the transcoder role and are in the production environment.The 2174 // monitored resources contained in a group can change at any moment, depending 2175 // on what resources exist and what filters are associated with the group and 2176 // its ancestors. 2177 type Group struct { 2178 // DisplayName: A user-assigned name for this group, used only for display 2179 // purposes. 2180 DisplayName string `json:"displayName,omitempty"` 2181 // Filter: The filter used to determine which monitored resources belong to 2182 // this group. 2183 Filter string `json:"filter,omitempty"` 2184 // IsCluster: If true, the members of this group are considered to be a 2185 // cluster. The system can perform additional analysis on groups that are 2186 // clusters. 2187 IsCluster bool `json:"isCluster,omitempty"` 2188 // Name: Output only. The name of this group. The format is: 2189 // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] When creating a group, 2190 // this field is ignored and a new name is created consisting of the project 2191 // specified in the call to CreateGroup and a unique [GROUP_ID] that is 2192 // generated automatically. 2193 Name string `json:"name,omitempty"` 2194 // ParentName: The name of the group's parent, if it has one. The format is: 2195 // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] For groups with no parent, 2196 // parent_name is the empty string, "". 2197 ParentName string `json:"parentName,omitempty"` 2198 2199 // ServerResponse contains the HTTP response code and headers from the server. 2200 googleapi.ServerResponse `json:"-"` 2201 // ForceSendFields is a list of field names (e.g. "DisplayName") to 2202 // unconditionally include in API requests. By default, fields with empty or 2203 // default values are omitted from API requests. See 2204 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2205 // details. 2206 ForceSendFields []string `json:"-"` 2207 // NullFields is a list of field names (e.g. "DisplayName") to include in API 2208 // requests with the JSON null value. By default, fields with empty values are 2209 // omitted from API requests. See 2210 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2211 NullFields []string `json:"-"` 2212 } 2213 2214 func (s *Group) MarshalJSON() ([]byte, error) { 2215 type NoMethod Group 2216 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2217 } 2218 2219 // HttpCheck: Information involved in an HTTP/HTTPS Uptime check request. 2220 type HttpCheck struct { 2221 // AcceptedResponseStatusCodes: If present, the check will only pass if the 2222 // HTTP response status code is in this set of status codes. If empty, the HTTP 2223 // status code will only pass if the HTTP status code is 200-299. 2224 AcceptedResponseStatusCodes []*ResponseStatusCode `json:"acceptedResponseStatusCodes,omitempty"` 2225 // AuthInfo: The authentication information. Optional when creating an HTTP 2226 // check; defaults to empty. Do not set both auth_method and auth_info. 2227 AuthInfo *BasicAuthentication `json:"authInfo,omitempty"` 2228 // Body: The request body associated with the HTTP POST request. If 2229 // content_type is URL_ENCODED, the body passed in must be URL-encoded. Users 2230 // can provide a Content-Length header via the headers field or the API will do 2231 // so. If the request_method is GET and body is not empty, the API will return 2232 // an error. The maximum byte size is 1 megabyte.Note: If client libraries 2233 // aren't used (which performs the conversion automatically) base64 encode your 2234 // body data since the field is of bytes type. 2235 Body string `json:"body,omitempty"` 2236 // ContentType: The content type header to use for the check. The following 2237 // configurations result in errors: 1. Content type is specified in both the 2238 // headers field and the content_type field. 2. Request method is GET and 2239 // content_type is not TYPE_UNSPECIFIED 3. Request method is POST and 2240 // content_type is TYPE_UNSPECIFIED. 4. Request method is POST and a 2241 // "Content-Type" header is provided via headers field. The content_type field 2242 // should be used instead. 2243 // 2244 // Possible values: 2245 // "TYPE_UNSPECIFIED" - No content type specified. 2246 // "URL_ENCODED" - body is in URL-encoded form. Equivalent to setting the 2247 // Content-Type to application/x-www-form-urlencoded in the HTTP request. 2248 // "USER_PROVIDED" - body is in custom_content_type form. Equivalent to 2249 // setting the Content-Type to the contents of custom_content_type in the HTTP 2250 // request. 2251 ContentType string `json:"contentType,omitempty"` 2252 // CustomContentType: A user provided content type header to use for the check. 2253 // The invalid configurations outlined in the content_type field apply to 2254 // custom_content_type, as well as the following: 1. content_type is 2255 // URL_ENCODED and custom_content_type is set. 2. content_type is USER_PROVIDED 2256 // and custom_content_type is not set. 2257 CustomContentType string `json:"customContentType,omitempty"` 2258 // Headers: The list of headers to send as part of the Uptime check request. If 2259 // two headers have the same key and different values, they should be entered 2260 // as a single header, with the value being a comma-separated list of all the 2261 // desired values as described at 2262 // https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). Entering two 2263 // separate headers with the same key in a Create call will cause the first to 2264 // be overwritten by the second. The maximum number of headers allowed is 100. 2265 Headers map[string]string `json:"headers,omitempty"` 2266 // MaskHeaders: Boolean specifying whether to encrypt the header information. 2267 // Encryption should be specified for any headers related to authentication 2268 // that you do not wish to be seen when retrieving the configuration. The 2269 // server will be responsible for encrypting the headers. On Get/List calls, if 2270 // mask_headers is set to true then the headers will be obscured with ******. 2271 MaskHeaders bool `json:"maskHeaders,omitempty"` 2272 // Path: Optional (defaults to "/"). The path to the page against which to run 2273 // the check. Will be combined with the host (specified within the 2274 // monitored_resource) and port to construct the full URL. If the provided path 2275 // does not begin with "/", a "/" will be prepended automatically. 2276 Path string `json:"path,omitempty"` 2277 // PingConfig: Contains information needed to add pings to an HTTP check. 2278 PingConfig *PingConfig `json:"pingConfig,omitempty"` 2279 // Port: Optional (defaults to 80 when use_ssl is false, and 443 when use_ssl 2280 // is true). The TCP port on the HTTP server against which to run the check. 2281 // Will be combined with host (specified within the monitored_resource) and 2282 // path to construct the full URL. 2283 Port int64 `json:"port,omitempty"` 2284 // RequestMethod: The HTTP request method to use for the check. If set to 2285 // METHOD_UNSPECIFIED then request_method defaults to GET. 2286 // 2287 // Possible values: 2288 // "METHOD_UNSPECIFIED" - No request method specified. 2289 // "GET" - GET request. 2290 // "POST" - POST request. 2291 RequestMethod string `json:"requestMethod,omitempty"` 2292 // ServiceAgentAuthentication: If specified, Uptime will generate and attach an 2293 // OIDC JWT token for the Monitoring service agent service account as an 2294 // Authorization header in the HTTP request when probing. 2295 ServiceAgentAuthentication *ServiceAgentAuthentication `json:"serviceAgentAuthentication,omitempty"` 2296 // UseSsl: If true, use HTTPS instead of HTTP to run the check. 2297 UseSsl bool `json:"useSsl,omitempty"` 2298 // ValidateSsl: Boolean specifying whether to include SSL certificate 2299 // validation as a part of the Uptime check. Only applies to checks where 2300 // monitored_resource is set to uptime_url. If use_ssl is false, setting 2301 // validate_ssl to true has no effect. 2302 ValidateSsl bool `json:"validateSsl,omitempty"` 2303 // ForceSendFields is a list of field names (e.g. 2304 // "AcceptedResponseStatusCodes") to unconditionally include in API requests. 2305 // By default, fields with empty or default values are omitted from API 2306 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields 2307 // for more details. 2308 ForceSendFields []string `json:"-"` 2309 // NullFields is a list of field names (e.g. "AcceptedResponseStatusCodes") to 2310 // include in API requests with the JSON null value. By default, fields with 2311 // empty values are omitted from API requests. See 2312 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2313 NullFields []string `json:"-"` 2314 } 2315 2316 func (s *HttpCheck) MarshalJSON() ([]byte, error) { 2317 type NoMethod HttpCheck 2318 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2319 } 2320 2321 // InternalChecker: An internal checker allows Uptime checks to run on 2322 // private/internal GCP resources. 2323 type InternalChecker struct { 2324 // DisplayName: The checker's human-readable name. The display name should be 2325 // unique within a Cloud Monitoring Metrics Scope in order to make it easier to 2326 // identify; however, uniqueness is not enforced. 2327 DisplayName string `json:"displayName,omitempty"` 2328 // GcpZone: The GCP zone the Uptime check should egress from. Only respected 2329 // for internal Uptime checks, where internal_network is specified. 2330 GcpZone string `json:"gcpZone,omitempty"` 2331 // Name: A unique resource name for this InternalChecker. The format is: 2332 // projects/[PROJECT_ID_OR_NUMBER]/internalCheckers/[INTERNAL_CHECKER_ID] 2333 // [PROJECT_ID_OR_NUMBER] is the Cloud Monitoring Metrics Scope project for the 2334 // Uptime check config associated with the internal checker. 2335 Name string `json:"name,omitempty"` 2336 // Network: The GCP VPC network (https://cloud.google.com/vpc/docs/vpc) where 2337 // the internal resource lives (ex: "default"). 2338 Network string `json:"network,omitempty"` 2339 // PeerProjectId: The GCP project ID where the internal checker lives. Not 2340 // necessary the same as the Metrics Scope project. 2341 PeerProjectId string `json:"peerProjectId,omitempty"` 2342 // State: The current operational state of the internal checker. 2343 // 2344 // Possible values: 2345 // "UNSPECIFIED" - An internal checker should never be in the unspecified 2346 // state. 2347 // "CREATING" - The checker is being created, provisioned, and configured. A 2348 // checker in this state can be returned by ListInternalCheckers or 2349 // GetInternalChecker, as well as by examining the long running Operation 2350 // (https://cloud.google.com/apis/design/design_patterns#long_running_operations) 2351 // that created it. 2352 // "RUNNING" - The checker is running and available for use. A checker in 2353 // this state can be returned by ListInternalCheckers or GetInternalChecker as 2354 // well as by examining the long running Operation 2355 // (https://cloud.google.com/apis/design/design_patterns#long_running_operations) 2356 // that created it. If a checker is being torn down, it is neither visible nor 2357 // usable, so there is no "deleting" or "down" state. 2358 State string `json:"state,omitempty"` 2359 // ForceSendFields is a list of field names (e.g. "DisplayName") to 2360 // unconditionally include in API requests. By default, fields with empty or 2361 // default values are omitted from API requests. See 2362 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2363 // details. 2364 ForceSendFields []string `json:"-"` 2365 // NullFields is a list of field names (e.g. "DisplayName") to include in API 2366 // requests with the JSON null value. By default, fields with empty values are 2367 // omitted from API requests. See 2368 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2369 NullFields []string `json:"-"` 2370 } 2371 2372 func (s *InternalChecker) MarshalJSON() ([]byte, error) { 2373 type NoMethod InternalChecker 2374 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2375 } 2376 2377 // IstioCanonicalService: Canonical service scoped to an Istio mesh. Anthos 2378 // clusters running ASM >= 1.6.8 will have their services ingested as this 2379 // type. 2380 type IstioCanonicalService struct { 2381 // CanonicalService: The name of the canonical service underlying this service. 2382 // Corresponds to the destination_canonical_service_name metric label in label 2383 // in Istio metrics (https://cloud.google.com/monitoring/api/metrics_istio). 2384 CanonicalService string `json:"canonicalService,omitempty"` 2385 // CanonicalServiceNamespace: The namespace of the canonical service underlying 2386 // this service. Corresponds to the destination_canonical_service_namespace 2387 // metric label in Istio metrics 2388 // (https://cloud.google.com/monitoring/api/metrics_istio). 2389 CanonicalServiceNamespace string `json:"canonicalServiceNamespace,omitempty"` 2390 // MeshUid: Identifier for the Istio mesh in which this canonical service is 2391 // defined. Corresponds to the mesh_uid metric label in Istio metrics 2392 // (https://cloud.google.com/monitoring/api/metrics_istio). 2393 MeshUid string `json:"meshUid,omitempty"` 2394 // ForceSendFields is a list of field names (e.g. "CanonicalService") to 2395 // unconditionally include in API requests. By default, fields with empty or 2396 // default values are omitted from API requests. See 2397 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2398 // details. 2399 ForceSendFields []string `json:"-"` 2400 // NullFields is a list of field names (e.g. "CanonicalService") to include in 2401 // API requests with the JSON null value. By default, fields with empty values 2402 // are omitted from API requests. See 2403 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2404 NullFields []string `json:"-"` 2405 } 2406 2407 func (s *IstioCanonicalService) MarshalJSON() ([]byte, error) { 2408 type NoMethod IstioCanonicalService 2409 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2410 } 2411 2412 // JsonPathMatcher: Information needed to perform a JSONPath content match. 2413 // Used for ContentMatcherOption::MATCHES_JSON_PATH and 2414 // ContentMatcherOption::NOT_MATCHES_JSON_PATH. 2415 type JsonPathMatcher struct { 2416 // JsonMatcher: The type of JSONPath match that will be applied to the JSON 2417 // output (ContentMatcher.content) 2418 // 2419 // Possible values: 2420 // "JSON_PATH_MATCHER_OPTION_UNSPECIFIED" - No JSONPath matcher type 2421 // specified (not valid). 2422 // "EXACT_MATCH" - Selects 'exact string' matching. The match succeeds if the 2423 // content at the json_path within the output is exactly the same as the 2424 // content string. 2425 // "REGEX_MATCH" - Selects regular-expression matching. The match succeeds if 2426 // the content at the json_path within the output matches the regular 2427 // expression specified in the content string. 2428 JsonMatcher string `json:"jsonMatcher,omitempty"` 2429 // JsonPath: JSONPath within the response output pointing to the expected 2430 // ContentMatcher::content to match against. 2431 JsonPath string `json:"jsonPath,omitempty"` 2432 // ForceSendFields is a list of field names (e.g. "JsonMatcher") to 2433 // unconditionally include in API requests. By default, fields with empty or 2434 // default values are omitted from API requests. See 2435 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2436 // details. 2437 ForceSendFields []string `json:"-"` 2438 // NullFields is a list of field names (e.g. "JsonMatcher") to include in API 2439 // requests with the JSON null value. By default, fields with empty values are 2440 // omitted from API requests. See 2441 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2442 NullFields []string `json:"-"` 2443 } 2444 2445 func (s *JsonPathMatcher) MarshalJSON() ([]byte, error) { 2446 type NoMethod JsonPathMatcher 2447 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2448 } 2449 2450 // LabelDescriptor: A description of a label. 2451 type LabelDescriptor struct { 2452 // Description: A human-readable description for the label. 2453 Description string `json:"description,omitempty"` 2454 // Key: The key for this label. The key must meet the following criteria: Does 2455 // not exceed 100 characters. Matches the following regular expression: 2456 // [a-zA-Z][a-zA-Z0-9_]* The first character must be an upper- or lower-case 2457 // letter. The remaining characters must be letters, digits, or underscores. 2458 Key string `json:"key,omitempty"` 2459 // ValueType: The type of data that can be assigned to the label. 2460 // 2461 // Possible values: 2462 // "STRING" - A variable-length string, not to exceed 1,024 characters. This 2463 // is the default value type. 2464 // "BOOL" - Boolean; true or false. 2465 // "INT64" - A 64-bit signed integer. 2466 ValueType string `json:"valueType,omitempty"` 2467 // ForceSendFields is a list of field names (e.g. "Description") to 2468 // unconditionally include in API requests. By default, fields with empty or 2469 // default values are omitted from API requests. See 2470 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2471 // details. 2472 ForceSendFields []string `json:"-"` 2473 // NullFields is a list of field names (e.g. "Description") to include in API 2474 // requests with the JSON null value. By default, fields with empty values are 2475 // omitted from API requests. See 2476 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2477 NullFields []string `json:"-"` 2478 } 2479 2480 func (s *LabelDescriptor) MarshalJSON() ([]byte, error) { 2481 type NoMethod LabelDescriptor 2482 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2483 } 2484 2485 // LabelValue: A label value. 2486 type LabelValue struct { 2487 // BoolValue: A bool label value. 2488 BoolValue bool `json:"boolValue,omitempty"` 2489 // Int64Value: An int64 label value. 2490 Int64Value int64 `json:"int64Value,omitempty,string"` 2491 // StringValue: A string label value. 2492 StringValue string `json:"stringValue,omitempty"` 2493 // ForceSendFields is a list of field names (e.g. "BoolValue") to 2494 // unconditionally include in API requests. By default, fields with empty or 2495 // default values are omitted from API requests. See 2496 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2497 // details. 2498 ForceSendFields []string `json:"-"` 2499 // NullFields is a list of field names (e.g. "BoolValue") to include in API 2500 // requests with the JSON null value. By default, fields with empty values are 2501 // omitted from API requests. See 2502 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2503 NullFields []string `json:"-"` 2504 } 2505 2506 func (s *LabelValue) MarshalJSON() ([]byte, error) { 2507 type NoMethod LabelValue 2508 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2509 } 2510 2511 // LatencyCriteria: Parameters for a latency threshold SLI. 2512 type LatencyCriteria struct { 2513 // Threshold: Good service is defined to be the count of requests made to this 2514 // service that return in no more than threshold. 2515 Threshold string `json:"threshold,omitempty"` 2516 // ForceSendFields is a list of field names (e.g. "Threshold") to 2517 // unconditionally include in API requests. By default, fields with empty or 2518 // default values are omitted from API requests. See 2519 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2520 // details. 2521 ForceSendFields []string `json:"-"` 2522 // NullFields is a list of field names (e.g. "Threshold") to include in API 2523 // requests with the JSON null value. By default, fields with empty values are 2524 // omitted from API requests. See 2525 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2526 NullFields []string `json:"-"` 2527 } 2528 2529 func (s *LatencyCriteria) MarshalJSON() ([]byte, error) { 2530 type NoMethod LatencyCriteria 2531 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2532 } 2533 2534 // Linear: Specifies a linear sequence of buckets that all have the same width 2535 // (except overflow and underflow). Each bucket represents a constant absolute 2536 // uncertainty on the specific value in the bucket.There are num_finite_buckets 2537 // + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i 2538 // < N-1): offset + (width * i).Lower bound (1 <= i < N): offset + (width * (i 2539 // - 1)). 2540 type Linear struct { 2541 // NumFiniteBuckets: Must be greater than 0. 2542 NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"` 2543 // Offset: Lower bound of the first bucket. 2544 Offset float64 `json:"offset,omitempty"` 2545 // Width: Must be greater than 0. 2546 Width float64 `json:"width,omitempty"` 2547 // ForceSendFields is a list of field names (e.g. "NumFiniteBuckets") to 2548 // unconditionally include in API requests. By default, fields with empty or 2549 // default values are omitted from API requests. See 2550 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2551 // details. 2552 ForceSendFields []string `json:"-"` 2553 // NullFields is a list of field names (e.g. "NumFiniteBuckets") to include in 2554 // API requests with the JSON null value. By default, fields with empty values 2555 // are omitted from API requests. See 2556 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2557 NullFields []string `json:"-"` 2558 } 2559 2560 func (s *Linear) MarshalJSON() ([]byte, error) { 2561 type NoMethod Linear 2562 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2563 } 2564 2565 func (s *Linear) UnmarshalJSON(data []byte) error { 2566 type NoMethod Linear 2567 var s1 struct { 2568 Offset gensupport.JSONFloat64 `json:"offset"` 2569 Width gensupport.JSONFloat64 `json:"width"` 2570 *NoMethod 2571 } 2572 s1.NoMethod = (*NoMethod)(s) 2573 if err := json.Unmarshal(data, &s1); err != nil { 2574 return err 2575 } 2576 s.Offset = float64(s1.Offset) 2577 s.Width = float64(s1.Width) 2578 return nil 2579 } 2580 2581 // ListAlertPoliciesResponse: The protocol for the ListAlertPolicies response. 2582 type ListAlertPoliciesResponse struct { 2583 // AlertPolicies: The returned alert policies. 2584 AlertPolicies []*AlertPolicy `json:"alertPolicies,omitempty"` 2585 // NextPageToken: If there might be more results than were returned, then this 2586 // field is set to a non-empty value. To see the additional results, use that 2587 // value as page_token in the next call to this method. 2588 NextPageToken string `json:"nextPageToken,omitempty"` 2589 // TotalSize: The total number of alert policies in all pages. This number is 2590 // only an estimate, and may change in subsequent pages. https://aip.dev/158 2591 TotalSize int64 `json:"totalSize,omitempty"` 2592 2593 // ServerResponse contains the HTTP response code and headers from the server. 2594 googleapi.ServerResponse `json:"-"` 2595 // ForceSendFields is a list of field names (e.g. "AlertPolicies") to 2596 // unconditionally include in API requests. By default, fields with empty or 2597 // default values are omitted from API requests. See 2598 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2599 // details. 2600 ForceSendFields []string `json:"-"` 2601 // NullFields is a list of field names (e.g. "AlertPolicies") to include in API 2602 // requests with the JSON null value. By default, fields with empty values are 2603 // omitted from API requests. See 2604 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2605 NullFields []string `json:"-"` 2606 } 2607 2608 func (s *ListAlertPoliciesResponse) MarshalJSON() ([]byte, error) { 2609 type NoMethod ListAlertPoliciesResponse 2610 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2611 } 2612 2613 // ListGroupMembersResponse: The ListGroupMembers response. 2614 type ListGroupMembersResponse struct { 2615 // Members: A set of monitored resources in the group. 2616 Members []*MonitoredResource `json:"members,omitempty"` 2617 // NextPageToken: If there are more results than have been returned, then this 2618 // field is set to a non-empty value. To see the additional results, use that 2619 // value as page_token in the next call to this method. 2620 NextPageToken string `json:"nextPageToken,omitempty"` 2621 // TotalSize: The total number of elements matching this request. 2622 TotalSize int64 `json:"totalSize,omitempty"` 2623 2624 // ServerResponse contains the HTTP response code and headers from the server. 2625 googleapi.ServerResponse `json:"-"` 2626 // ForceSendFields is a list of field names (e.g. "Members") to unconditionally 2627 // include in API requests. By default, fields with empty or default values are 2628 // omitted from API requests. See 2629 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2630 // details. 2631 ForceSendFields []string `json:"-"` 2632 // NullFields is a list of field names (e.g. "Members") to include in API 2633 // requests with the JSON null value. By default, fields with empty values are 2634 // omitted from API requests. See 2635 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2636 NullFields []string `json:"-"` 2637 } 2638 2639 func (s *ListGroupMembersResponse) MarshalJSON() ([]byte, error) { 2640 type NoMethod ListGroupMembersResponse 2641 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2642 } 2643 2644 // ListGroupsResponse: The ListGroups response. 2645 type ListGroupsResponse struct { 2646 // Group: The groups that match the specified filters. 2647 Group []*Group `json:"group,omitempty"` 2648 // NextPageToken: If there are more results than have been returned, then this 2649 // field is set to a non-empty value. To see the additional results, use that 2650 // value as page_token in the next call to this method. 2651 NextPageToken string `json:"nextPageToken,omitempty"` 2652 2653 // ServerResponse contains the HTTP response code and headers from the server. 2654 googleapi.ServerResponse `json:"-"` 2655 // ForceSendFields is a list of field names (e.g. "Group") to unconditionally 2656 // include in API requests. By default, fields with empty or default values are 2657 // omitted from API requests. See 2658 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2659 // details. 2660 ForceSendFields []string `json:"-"` 2661 // NullFields is a list of field names (e.g. "Group") to include in API 2662 // requests with the JSON null value. By default, fields with empty values are 2663 // omitted from API requests. See 2664 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2665 NullFields []string `json:"-"` 2666 } 2667 2668 func (s *ListGroupsResponse) MarshalJSON() ([]byte, error) { 2669 type NoMethod ListGroupsResponse 2670 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2671 } 2672 2673 // ListMetricDescriptorsResponse: The ListMetricDescriptors response. 2674 type ListMetricDescriptorsResponse struct { 2675 // MetricDescriptors: The metric descriptors that are available to the project 2676 // and that match the value of filter, if present. 2677 MetricDescriptors []*MetricDescriptor `json:"metricDescriptors,omitempty"` 2678 // NextPageToken: If there are more results than have been returned, then this 2679 // field is set to a non-empty value. To see the additional results, use that 2680 // value as page_token in the next call to this method. 2681 NextPageToken string `json:"nextPageToken,omitempty"` 2682 2683 // ServerResponse contains the HTTP response code and headers from the server. 2684 googleapi.ServerResponse `json:"-"` 2685 // ForceSendFields is a list of field names (e.g. "MetricDescriptors") to 2686 // unconditionally include in API requests. By default, fields with empty or 2687 // default values are omitted from API requests. See 2688 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2689 // details. 2690 ForceSendFields []string `json:"-"` 2691 // NullFields is a list of field names (e.g. "MetricDescriptors") to include in 2692 // API requests with the JSON null value. By default, fields with empty values 2693 // are omitted from API requests. See 2694 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2695 NullFields []string `json:"-"` 2696 } 2697 2698 func (s *ListMetricDescriptorsResponse) MarshalJSON() ([]byte, error) { 2699 type NoMethod ListMetricDescriptorsResponse 2700 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2701 } 2702 2703 // ListMonitoredResourceDescriptorsResponse: The 2704 // ListMonitoredResourceDescriptors response. 2705 type ListMonitoredResourceDescriptorsResponse struct { 2706 // NextPageToken: If there are more results than have been returned, then this 2707 // field is set to a non-empty value. To see the additional results, use that 2708 // value as page_token in the next call to this method. 2709 NextPageToken string `json:"nextPageToken,omitempty"` 2710 // ResourceDescriptors: The monitored resource descriptors that are available 2711 // to this project and that match filter, if present. 2712 ResourceDescriptors []*MonitoredResourceDescriptor `json:"resourceDescriptors,omitempty"` 2713 2714 // ServerResponse contains the HTTP response code and headers from the server. 2715 googleapi.ServerResponse `json:"-"` 2716 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2717 // unconditionally include in API requests. By default, fields with empty or 2718 // default values are omitted from API requests. See 2719 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2720 // details. 2721 ForceSendFields []string `json:"-"` 2722 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 2723 // requests with the JSON null value. By default, fields with empty values are 2724 // omitted from API requests. See 2725 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2726 NullFields []string `json:"-"` 2727 } 2728 2729 func (s *ListMonitoredResourceDescriptorsResponse) MarshalJSON() ([]byte, error) { 2730 type NoMethod ListMonitoredResourceDescriptorsResponse 2731 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2732 } 2733 2734 // ListNotificationChannelDescriptorsResponse: The 2735 // ListNotificationChannelDescriptors response. 2736 type ListNotificationChannelDescriptorsResponse struct { 2737 // ChannelDescriptors: The monitored resource descriptors supported for the 2738 // specified project, optionally filtered. 2739 ChannelDescriptors []*NotificationChannelDescriptor `json:"channelDescriptors,omitempty"` 2740 // NextPageToken: If not empty, indicates that there may be more results that 2741 // match the request. Use the value in the page_token field in a subsequent 2742 // request to fetch the next set of results. If empty, all results have been 2743 // returned. 2744 NextPageToken string `json:"nextPageToken,omitempty"` 2745 2746 // ServerResponse contains the HTTP response code and headers from the server. 2747 googleapi.ServerResponse `json:"-"` 2748 // ForceSendFields is a list of field names (e.g. "ChannelDescriptors") to 2749 // unconditionally include in API requests. By default, fields with empty or 2750 // default values are omitted from API requests. See 2751 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2752 // details. 2753 ForceSendFields []string `json:"-"` 2754 // NullFields is a list of field names (e.g. "ChannelDescriptors") to include 2755 // in API requests with the JSON null value. By default, fields with empty 2756 // values are omitted from API requests. See 2757 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2758 NullFields []string `json:"-"` 2759 } 2760 2761 func (s *ListNotificationChannelDescriptorsResponse) MarshalJSON() ([]byte, error) { 2762 type NoMethod ListNotificationChannelDescriptorsResponse 2763 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2764 } 2765 2766 // ListNotificationChannelsResponse: The ListNotificationChannels response. 2767 type ListNotificationChannelsResponse struct { 2768 // NextPageToken: If not empty, indicates that there may be more results that 2769 // match the request. Use the value in the page_token field in a subsequent 2770 // request to fetch the next set of results. If empty, all results have been 2771 // returned. 2772 NextPageToken string `json:"nextPageToken,omitempty"` 2773 // NotificationChannels: The notification channels defined for the specified 2774 // project. 2775 NotificationChannels []*NotificationChannel `json:"notificationChannels,omitempty"` 2776 // TotalSize: The total number of notification channels in all pages. This 2777 // number is only an estimate, and may change in subsequent pages. 2778 // https://aip.dev/158 2779 TotalSize int64 `json:"totalSize,omitempty"` 2780 2781 // ServerResponse contains the HTTP response code and headers from the server. 2782 googleapi.ServerResponse `json:"-"` 2783 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2784 // unconditionally include in API requests. By default, fields with empty or 2785 // default values are omitted from API requests. See 2786 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2787 // details. 2788 ForceSendFields []string `json:"-"` 2789 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 2790 // requests with the JSON null value. By default, fields with empty values are 2791 // omitted from API requests. See 2792 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2793 NullFields []string `json:"-"` 2794 } 2795 2796 func (s *ListNotificationChannelsResponse) MarshalJSON() ([]byte, error) { 2797 type NoMethod ListNotificationChannelsResponse 2798 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2799 } 2800 2801 // ListServiceLevelObjectivesResponse: The ListServiceLevelObjectives response. 2802 type ListServiceLevelObjectivesResponse struct { 2803 // NextPageToken: If there are more results than have been returned, then this 2804 // field is set to a non-empty value. To see the additional results, use that 2805 // value as page_token in the next call to this method. 2806 NextPageToken string `json:"nextPageToken,omitempty"` 2807 // ServiceLevelObjectives: The ServiceLevelObjectives matching the specified 2808 // filter. 2809 ServiceLevelObjectives []*ServiceLevelObjective `json:"serviceLevelObjectives,omitempty"` 2810 2811 // ServerResponse contains the HTTP response code and headers from the server. 2812 googleapi.ServerResponse `json:"-"` 2813 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2814 // unconditionally include in API requests. By default, fields with empty or 2815 // default values are omitted from API requests. See 2816 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2817 // details. 2818 ForceSendFields []string `json:"-"` 2819 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 2820 // requests with the JSON null value. By default, fields with empty values are 2821 // omitted from API requests. See 2822 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2823 NullFields []string `json:"-"` 2824 } 2825 2826 func (s *ListServiceLevelObjectivesResponse) MarshalJSON() ([]byte, error) { 2827 type NoMethod ListServiceLevelObjectivesResponse 2828 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2829 } 2830 2831 // ListServicesResponse: The ListServices response. 2832 type ListServicesResponse struct { 2833 // NextPageToken: If there are more results than have been returned, then this 2834 // field is set to a non-empty value. To see the additional results, use that 2835 // value as page_token in the next call to this method. 2836 NextPageToken string `json:"nextPageToken,omitempty"` 2837 // Services: The Services matching the specified filter. 2838 Services []*MService `json:"services,omitempty"` 2839 2840 // ServerResponse contains the HTTP response code and headers from the server. 2841 googleapi.ServerResponse `json:"-"` 2842 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2843 // unconditionally include in API requests. By default, fields with empty or 2844 // default values are omitted from API requests. See 2845 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2846 // details. 2847 ForceSendFields []string `json:"-"` 2848 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 2849 // requests with the JSON null value. By default, fields with empty values are 2850 // omitted from API requests. See 2851 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2852 NullFields []string `json:"-"` 2853 } 2854 2855 func (s *ListServicesResponse) MarshalJSON() ([]byte, error) { 2856 type NoMethod ListServicesResponse 2857 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2858 } 2859 2860 // ListSnoozesResponse: The results of a successful ListSnoozes call, 2861 // containing the matching Snoozes. 2862 type ListSnoozesResponse struct { 2863 // NextPageToken: Page token for repeated calls to ListSnoozes, to fetch 2864 // additional pages of results. If this is empty or missing, there are no more 2865 // pages. 2866 NextPageToken string `json:"nextPageToken,omitempty"` 2867 // Snoozes: Snoozes matching this list call. 2868 Snoozes []*Snooze `json:"snoozes,omitempty"` 2869 2870 // ServerResponse contains the HTTP response code and headers from the server. 2871 googleapi.ServerResponse `json:"-"` 2872 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2873 // unconditionally include in API requests. By default, fields with empty or 2874 // default values are omitted from API requests. See 2875 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2876 // details. 2877 ForceSendFields []string `json:"-"` 2878 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 2879 // requests with the JSON null value. By default, fields with empty values are 2880 // omitted from API requests. See 2881 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2882 NullFields []string `json:"-"` 2883 } 2884 2885 func (s *ListSnoozesResponse) MarshalJSON() ([]byte, error) { 2886 type NoMethod ListSnoozesResponse 2887 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2888 } 2889 2890 // ListTimeSeriesResponse: The ListTimeSeries response. 2891 type ListTimeSeriesResponse struct { 2892 // ExecutionErrors: Query execution errors that may have caused the time series 2893 // data returned to be incomplete. 2894 ExecutionErrors []*Status `json:"executionErrors,omitempty"` 2895 // NextPageToken: If there are more results than have been returned, then this 2896 // field is set to a non-empty value. To see the additional results, use that 2897 // value as page_token in the next call to this method. 2898 NextPageToken string `json:"nextPageToken,omitempty"` 2899 // TimeSeries: One or more time series that match the filter included in the 2900 // request. 2901 TimeSeries []*TimeSeries `json:"timeSeries,omitempty"` 2902 // Unit: The unit in which all time_series point values are reported. unit 2903 // follows the UCUM format for units as seen in 2904 // https://unitsofmeasure.org/ucum.html. If different time_series have 2905 // different units (for example, because they come from different metric types, 2906 // or a unit is absent), then unit will be "{not_a_unit}". 2907 Unit string `json:"unit,omitempty"` 2908 2909 // ServerResponse contains the HTTP response code and headers from the server. 2910 googleapi.ServerResponse `json:"-"` 2911 // ForceSendFields is a list of field names (e.g. "ExecutionErrors") to 2912 // unconditionally include in API requests. By default, fields with empty or 2913 // default values are omitted from API requests. See 2914 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2915 // details. 2916 ForceSendFields []string `json:"-"` 2917 // NullFields is a list of field names (e.g. "ExecutionErrors") to include in 2918 // API requests with the JSON null value. By default, fields with empty values 2919 // are omitted from API requests. See 2920 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2921 NullFields []string `json:"-"` 2922 } 2923 2924 func (s *ListTimeSeriesResponse) MarshalJSON() ([]byte, error) { 2925 type NoMethod ListTimeSeriesResponse 2926 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2927 } 2928 2929 // ListUptimeCheckConfigsResponse: The protocol for the ListUptimeCheckConfigs 2930 // response. 2931 type ListUptimeCheckConfigsResponse struct { 2932 // NextPageToken: This field represents the pagination token to retrieve the 2933 // next page of results. If the value is empty, it means no further results for 2934 // the request. To retrieve the next page of results, the value of the 2935 // next_page_token is passed to the subsequent List method call (in the request 2936 // message's page_token field). 2937 NextPageToken string `json:"nextPageToken,omitempty"` 2938 // TotalSize: The total number of Uptime check configurations for the project, 2939 // irrespective of any pagination. 2940 TotalSize int64 `json:"totalSize,omitempty"` 2941 // UptimeCheckConfigs: The returned Uptime check configurations. 2942 UptimeCheckConfigs []*UptimeCheckConfig `json:"uptimeCheckConfigs,omitempty"` 2943 2944 // ServerResponse contains the HTTP response code and headers from the server. 2945 googleapi.ServerResponse `json:"-"` 2946 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2947 // unconditionally include in API requests. By default, fields with empty or 2948 // default values are omitted from API requests. See 2949 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2950 // details. 2951 ForceSendFields []string `json:"-"` 2952 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 2953 // requests with the JSON null value. By default, fields with empty values are 2954 // omitted from API requests. See 2955 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2956 NullFields []string `json:"-"` 2957 } 2958 2959 func (s *ListUptimeCheckConfigsResponse) MarshalJSON() ([]byte, error) { 2960 type NoMethod ListUptimeCheckConfigsResponse 2961 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2962 } 2963 2964 // ListUptimeCheckIpsResponse: The protocol for the ListUptimeCheckIps 2965 // response. 2966 type ListUptimeCheckIpsResponse struct { 2967 // NextPageToken: This field represents the pagination token to retrieve the 2968 // next page of results. If the value is empty, it means no further results for 2969 // the request. To retrieve the next page of results, the value of the 2970 // next_page_token is passed to the subsequent List method call (in the request 2971 // message's page_token field). NOTE: this field is not yet implemented 2972 NextPageToken string `json:"nextPageToken,omitempty"` 2973 // UptimeCheckIps: The returned list of IP addresses (including region and 2974 // location) that the checkers run from. 2975 UptimeCheckIps []*UptimeCheckIp `json:"uptimeCheckIps,omitempty"` 2976 2977 // ServerResponse contains the HTTP response code and headers from the server. 2978 googleapi.ServerResponse `json:"-"` 2979 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2980 // unconditionally include in API requests. By default, fields with empty or 2981 // default values are omitted from API requests. See 2982 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2983 // details. 2984 ForceSendFields []string `json:"-"` 2985 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 2986 // requests with the JSON null value. By default, fields with empty values are 2987 // omitted from API requests. See 2988 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2989 NullFields []string `json:"-"` 2990 } 2991 2992 func (s *ListUptimeCheckIpsResponse) MarshalJSON() ([]byte, error) { 2993 type NoMethod ListUptimeCheckIpsResponse 2994 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2995 } 2996 2997 // LogMatch: A condition type that checks whether a log message in the scoping 2998 // project (https://cloud.google.com/monitoring/api/v3#project_name) satisfies 2999 // the given filter. Logs from other projects in the metrics scope are not 3000 // evaluated. 3001 type LogMatch struct { 3002 // Filter: Required. A logs-based filter. See Advanced Logs Queries 3003 // (https://cloud.google.com/logging/docs/view/advanced-queries) for how this 3004 // filter should be constructed. 3005 Filter string `json:"filter,omitempty"` 3006 // LabelExtractors: Optional. A map from a label key to an extractor 3007 // expression, which is used to extract the value for this label key. Each 3008 // entry in this map is a specification for how data should be extracted from 3009 // log entries that match filter. Each combination of extracted values is 3010 // treated as a separate rule for the purposes of triggering notifications. 3011 // Label keys and corresponding values can be used in notifications generated 3012 // by this condition.Please see the documentation on logs-based metric 3013 // valueExtractors 3014 // (https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor) 3015 // for syntax and examples. 3016 LabelExtractors map[string]string `json:"labelExtractors,omitempty"` 3017 // ForceSendFields is a list of field names (e.g. "Filter") to unconditionally 3018 // include in API requests. By default, fields with empty or default values are 3019 // omitted from API requests. See 3020 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3021 // details. 3022 ForceSendFields []string `json:"-"` 3023 // NullFields is a list of field names (e.g. "Filter") to include in API 3024 // requests with the JSON null value. By default, fields with empty values are 3025 // omitted from API requests. See 3026 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3027 NullFields []string `json:"-"` 3028 } 3029 3030 func (s *LogMatch) MarshalJSON() ([]byte, error) { 3031 type NoMethod LogMatch 3032 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3033 } 3034 3035 // MeshIstio: Istio service scoped to an Istio mesh. Anthos clusters running 3036 // ASM < 1.6.8 will have their services ingested as this type. 3037 type MeshIstio struct { 3038 // MeshUid: Identifier for the mesh in which this Istio service is defined. 3039 // Corresponds to the mesh_uid metric label in Istio metrics. 3040 MeshUid string `json:"meshUid,omitempty"` 3041 // ServiceName: The name of the Istio service underlying this service. 3042 // Corresponds to the destination_service_name metric label in Istio metrics. 3043 ServiceName string `json:"serviceName,omitempty"` 3044 // ServiceNamespace: The namespace of the Istio service underlying this 3045 // service. Corresponds to the destination_service_namespace metric label in 3046 // Istio metrics. 3047 ServiceNamespace string `json:"serviceNamespace,omitempty"` 3048 // ForceSendFields is a list of field names (e.g. "MeshUid") to unconditionally 3049 // include in API requests. By default, fields with empty or default values are 3050 // omitted from API requests. See 3051 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3052 // details. 3053 ForceSendFields []string `json:"-"` 3054 // NullFields is a list of field names (e.g. "MeshUid") to include in API 3055 // requests with the JSON null value. By default, fields with empty values are 3056 // omitted from API requests. See 3057 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3058 NullFields []string `json:"-"` 3059 } 3060 3061 func (s *MeshIstio) MarshalJSON() ([]byte, error) { 3062 type NoMethod MeshIstio 3063 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3064 } 3065 3066 // Metric: A specific metric, identified by specifying values for all of the 3067 // labels of a MetricDescriptor. 3068 type Metric struct { 3069 // Labels: The set of label values that uniquely identify this metric. All 3070 // labels listed in the MetricDescriptor must be assigned values. 3071 Labels map[string]string `json:"labels,omitempty"` 3072 // Type: An existing metric type, see google.api.MetricDescriptor. For example, 3073 // custom.googleapis.com/invoice/paid/amount. 3074 Type string `json:"type,omitempty"` 3075 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally 3076 // include in API requests. By default, fields with empty or default values are 3077 // omitted from API requests. See 3078 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3079 // details. 3080 ForceSendFields []string `json:"-"` 3081 // NullFields is a list of field names (e.g. "Labels") to include in API 3082 // requests with the JSON null value. By default, fields with empty values are 3083 // omitted from API requests. See 3084 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3085 NullFields []string `json:"-"` 3086 } 3087 3088 func (s *Metric) MarshalJSON() ([]byte, error) { 3089 type NoMethod Metric 3090 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3091 } 3092 3093 // MetricAbsence: A condition type that checks that monitored resources are 3094 // reporting data. The configuration defines a metric and a set of monitored 3095 // resources. The predicate is considered in violation when a time series for 3096 // the specified metric of a monitored resource does not include any data in 3097 // the specified duration. 3098 type MetricAbsence struct { 3099 // Aggregations: Specifies the alignment of data points in individual time 3100 // series as well as how to combine the retrieved time series together (such as 3101 // when aggregating multiple streams on each resource to a single stream for 3102 // each resource or when aggregating streams across all members of a group of 3103 // resources). Multiple aggregations are applied in the order specified.This 3104 // field is similar to the one in the ListTimeSeries request 3105 // (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). 3106 // It is advisable to use the ListTimeSeries method when debugging this field. 3107 Aggregations []*Aggregation `json:"aggregations,omitempty"` 3108 // Duration: The amount of time that a time series must fail to report new data 3109 // to be considered failing. The minimum value of this field is 120 seconds. 3110 // Larger values that are a multiple of a minute--for example, 240 or 300 3111 // seconds--are supported. If an invalid value is given, an error will be 3112 // returned. The Duration.nanos field is ignored. 3113 Duration string `json:"duration,omitempty"` 3114 // Filter: Required. A filter 3115 // (https://cloud.google.com/monitoring/api/v3/filters) that identifies which 3116 // time series should be compared with the threshold.The filter is similar to 3117 // the one that is specified in the ListTimeSeries request 3118 // (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) 3119 // (that call is useful to verify the time series that will be retrieved / 3120 // processed). The filter must specify the metric type and the resource type. 3121 // Optionally, it can specify resource labels and metric labels. This field 3122 // must not exceed 2048 Unicode characters in length. 3123 Filter string `json:"filter,omitempty"` 3124 // Trigger: The number/percent of time series for which the comparison must 3125 // hold in order for the condition to trigger. If unspecified, then the 3126 // condition will trigger if the comparison is true for any of the time series 3127 // that have been identified by filter and aggregations. 3128 Trigger *Trigger `json:"trigger,omitempty"` 3129 // ForceSendFields is a list of field names (e.g. "Aggregations") to 3130 // unconditionally include in API requests. By default, fields with empty or 3131 // default values are omitted from API requests. See 3132 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3133 // details. 3134 ForceSendFields []string `json:"-"` 3135 // NullFields is a list of field names (e.g. "Aggregations") to include in API 3136 // requests with the JSON null value. By default, fields with empty values are 3137 // omitted from API requests. See 3138 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3139 NullFields []string `json:"-"` 3140 } 3141 3142 func (s *MetricAbsence) MarshalJSON() ([]byte, error) { 3143 type NoMethod MetricAbsence 3144 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3145 } 3146 3147 // MetricDescriptor: Defines a metric type and its schema. Once a metric 3148 // descriptor is created, deleting or altering it stops data collection and 3149 // makes the metric type's existing data unusable. 3150 type MetricDescriptor struct { 3151 // Description: A detailed description of the metric, which can be used in 3152 // documentation. 3153 Description string `json:"description,omitempty"` 3154 // DisplayName: A concise name for the metric, which can be displayed in user 3155 // interfaces. Use sentence case without an ending period, for example "Request 3156 // count". This field is optional but it is recommended to be set for any 3157 // metrics associated with user-visible concepts, such as Quota. 3158 DisplayName string `json:"displayName,omitempty"` 3159 // Labels: The set of labels that can be used to describe a specific instance 3160 // of this metric type. For example, the 3161 // appengine.googleapis.com/http/server/response_latencies metric type has a 3162 // label for the HTTP response code, response_code, so you can look at 3163 // latencies for successful responses or just for responses that failed. 3164 Labels []*LabelDescriptor `json:"labels,omitempty"` 3165 // LaunchStage: Optional. The launch stage of the metric definition. 3166 // 3167 // Possible values: 3168 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 3169 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not use 3170 // it. 3171 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 3172 // visible internally. 3173 // "EARLY_ACCESS" - Early Access features are limited to a closed group of 3174 // testers. To use these features, you must sign up in advance and sign a 3175 // Trusted Tester agreement (which includes confidentiality provisions). These 3176 // features may be unstable, changed in backward-incompatible ways, and are not 3177 // guaranteed to be released. 3178 // "ALPHA" - Alpha is a limited availability test for releases before they 3179 // are cleared for widespread use. By Alpha, all significant design issues are 3180 // resolved and we are in the process of verifying functionality. Alpha 3181 // customers need to apply for access, agree to applicable terms, and have 3182 // their projects allowlisted. Alpha releases don't have to be feature 3183 // complete, no SLAs are provided, and there are no technical support 3184 // obligations, but they will be far enough along that customers can actually 3185 // use them in test environments or for limited-use tests -- just like they 3186 // would in normal production cases. 3187 // "BETA" - Beta is the point at which we are ready to open a release for any 3188 // customer to use. There are no SLA or technical support obligations in a Beta 3189 // release. Products will be complete from a feature perspective, but may have 3190 // some open outstanding issues. Beta releases are suitable for limited 3191 // production use cases. 3192 // "GA" - GA features are open to all developers and are considered stable 3193 // and fully qualified for production use. 3194 // "DEPRECATED" - Deprecated features are scheduled to be shut down and 3195 // removed. For more information, see the "Deprecation Policy" section of our 3196 // Terms of Service (https://cloud.google.com/terms/) and the Google Cloud 3197 // Platform Subject to the Deprecation Policy 3198 // (https://cloud.google.com/terms/deprecation) documentation. 3199 LaunchStage string `json:"launchStage,omitempty"` 3200 // Metadata: Optional. Metadata which can be used to guide usage of the metric. 3201 Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"` 3202 // MetricKind: Whether the metric records instantaneous values, changes to a 3203 // value, etc. Some combinations of metric_kind and value_type might not be 3204 // supported. 3205 // 3206 // Possible values: 3207 // "METRIC_KIND_UNSPECIFIED" - Do not use this default value. 3208 // "GAUGE" - An instantaneous measurement of a value. 3209 // "DELTA" - The change in a value during a time interval. 3210 // "CUMULATIVE" - A value accumulated over a time interval. Cumulative 3211 // measurements in a time series should have the same start time and increasing 3212 // end times, until an event resets the cumulative value to zero and sets a new 3213 // start time for the following points. 3214 MetricKind string `json:"metricKind,omitempty"` 3215 // MonitoredResourceTypes: Read-only. If present, then a time series, which is 3216 // identified partially by a metric type and a MonitoredResourceDescriptor, 3217 // that is associated with this metric type can only be associated with one of 3218 // the monitored resource types listed here. 3219 MonitoredResourceTypes []string `json:"monitoredResourceTypes,omitempty"` 3220 // Name: The resource name of the metric descriptor. 3221 Name string `json:"name,omitempty"` 3222 // Type: The metric type, including its DNS name prefix. The type is not 3223 // URL-encoded. All user-defined metric types have the DNS name 3224 // custom.googleapis.com or external.googleapis.com. Metric types should use a 3225 // natural hierarchical grouping. For example: 3226 // "custom.googleapis.com/invoice/paid/amount" 3227 // "external.googleapis.com/prometheus/up" 3228 // "appengine.googleapis.com/http/server/response_latencies" 3229 Type string `json:"type,omitempty"` 3230 // Unit: The units in which the metric value is reported. It is only applicable 3231 // if the value_type is INT64, DOUBLE, or DISTRIBUTION. The unit defines the 3232 // representation of the stored metric values.Different systems might scale the 3233 // values to be more easily displayed (so a value of 0.02kBy might be displayed 3234 // as 20By, and a value of 3523kBy might be displayed as 3.5MBy). However, if 3235 // the unit is kBy, then the value of the metric is always in thousands of 3236 // bytes, no matter how it might be displayed.If you want a custom metric to 3237 // record the exact number of CPU-seconds used by a job, you can create an 3238 // INT64 CUMULATIVE metric whose unit is s{CPU} (or equivalently 1s{CPU} or 3239 // just s). If the job uses 12,005 CPU-seconds, then the value is written as 3240 // 12005.Alternatively, if you want a custom metric to record data in a more 3241 // granular way, you can create a DOUBLE CUMULATIVE metric whose unit is 3242 // ks{CPU}, and then write the value 12.005 (which is 12005/1000), or use 3243 // Kis{CPU} and write 11.723 (which is 12005/1024).The supported units are a 3244 // subset of The Unified Code for Units of Measure 3245 // (https://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) bit bit 3246 // By byte s second min minute h hour d day 1 dimensionlessPrefixes (PREFIX) k 3247 // kilo (10^3) M mega (10^6) G giga (10^9) T tera (10^12) P peta (10^15) E exa 3248 // (10^18) Z zetta (10^21) Y yotta (10^24) m milli (10^-3) u micro (10^-6) n 3249 // nano (10^-9) p pico (10^-12) f femto (10^-15) a atto (10^-18) z zepto 3250 // (10^-21) y yocto (10^-24) Ki kibi (2^10) Mi mebi (2^20) Gi gibi (2^30) Ti 3251 // tebi (2^40) Pi pebi (2^50)GrammarThe grammar also includes these connectors: 3252 // / division or ratio (as an infix operator). For examples, kBy/{email} or 3253 // MiBy/10ms (although you should almost never have /s in a metric unit; rates 3254 // should always be computed at query time from the underlying cumulative or 3255 // delta value). . multiplication or composition (as an infix operator). For 3256 // examples, GBy.d or k{watt}.h.The grammar for a unit is as follows: 3257 // Expression = Component { "." Component } { "/" Component } ; Component = ( [ 3258 // PREFIX ] UNIT | "%" ) [ Annotation ] | Annotation | "1" ; Annotation = "{" 3259 // NAME "}" ; Notes: Annotation is just a comment if it follows a UNIT. If the 3260 // annotation is used alone, then the unit is equivalent to 1. For examples, 3261 // {request}/s == 1/s, By{transmitted}/s == By/s. NAME is a sequence of 3262 // non-blank printable ASCII characters not containing { or }. 1 represents a 3263 // unitary dimensionless unit 3264 // (https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such as in 1/s. 3265 // It is typically used when none of the basic units are appropriate. For 3266 // example, "new users per day" can be represented as 1/d or {new-users}/d (and 3267 // a metric value 5 would mean "5 new users). Alternatively, "thousands of page 3268 // views per day" would be represented as 1000/d or k1/d or k{page_views}/d 3269 // (and a metric value of 5.3 would mean "5300 page views per day"). % 3270 // represents dimensionless value of 1/100, and annotates values giving a 3271 // percentage (so the metric values are typically in the range of 0..100, and a 3272 // metric value 3 means "3 percent"). 10^2.% indicates a metric contains a 3273 // ratio, typically in the range 0..1, that will be multiplied by 100 and 3274 // displayed as a percentage (so a metric value 0.03 means "3 percent"). 3275 Unit string `json:"unit,omitempty"` 3276 // ValueType: Whether the measurement is an integer, a floating-point number, 3277 // etc. Some combinations of metric_kind and value_type might not be supported. 3278 // 3279 // Possible values: 3280 // "VALUE_TYPE_UNSPECIFIED" - Do not use this default value. 3281 // "BOOL" - The value is a boolean. This value type can be used only if the 3282 // metric kind is GAUGE. 3283 // "INT64" - The value is a signed 64-bit integer. 3284 // "DOUBLE" - The value is a double precision floating point number. 3285 // "STRING" - The value is a text string. This value type can be used only if 3286 // the metric kind is GAUGE. 3287 // "DISTRIBUTION" - The value is a Distribution. 3288 // "MONEY" - The value is money. 3289 ValueType string `json:"valueType,omitempty"` 3290 3291 // ServerResponse contains the HTTP response code and headers from the server. 3292 googleapi.ServerResponse `json:"-"` 3293 // ForceSendFields is a list of field names (e.g. "Description") to 3294 // unconditionally include in API requests. By default, fields with empty or 3295 // default values are omitted from API requests. See 3296 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3297 // details. 3298 ForceSendFields []string `json:"-"` 3299 // NullFields is a list of field names (e.g. "Description") to include in API 3300 // requests with the JSON null value. By default, fields with empty values are 3301 // omitted from API requests. See 3302 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3303 NullFields []string `json:"-"` 3304 } 3305 3306 func (s *MetricDescriptor) MarshalJSON() ([]byte, error) { 3307 type NoMethod MetricDescriptor 3308 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3309 } 3310 3311 // MetricDescriptorMetadata: Additional annotations that can be used to guide 3312 // the usage of a metric. 3313 type MetricDescriptorMetadata struct { 3314 // IngestDelay: The delay of data points caused by ingestion. Data points older 3315 // than this age are guaranteed to be ingested and available to be read, 3316 // excluding data loss due to errors. 3317 IngestDelay string `json:"ingestDelay,omitempty"` 3318 // LaunchStage: Deprecated. Must use the MetricDescriptor.launch_stage instead. 3319 // 3320 // Possible values: 3321 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 3322 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not use 3323 // it. 3324 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 3325 // visible internally. 3326 // "EARLY_ACCESS" - Early Access features are limited to a closed group of 3327 // testers. To use these features, you must sign up in advance and sign a 3328 // Trusted Tester agreement (which includes confidentiality provisions). These 3329 // features may be unstable, changed in backward-incompatible ways, and are not 3330 // guaranteed to be released. 3331 // "ALPHA" - Alpha is a limited availability test for releases before they 3332 // are cleared for widespread use. By Alpha, all significant design issues are 3333 // resolved and we are in the process of verifying functionality. Alpha 3334 // customers need to apply for access, agree to applicable terms, and have 3335 // their projects allowlisted. Alpha releases don't have to be feature 3336 // complete, no SLAs are provided, and there are no technical support 3337 // obligations, but they will be far enough along that customers can actually 3338 // use them in test environments or for limited-use tests -- just like they 3339 // would in normal production cases. 3340 // "BETA" - Beta is the point at which we are ready to open a release for any 3341 // customer to use. There are no SLA or technical support obligations in a Beta 3342 // release. Products will be complete from a feature perspective, but may have 3343 // some open outstanding issues. Beta releases are suitable for limited 3344 // production use cases. 3345 // "GA" - GA features are open to all developers and are considered stable 3346 // and fully qualified for production use. 3347 // "DEPRECATED" - Deprecated features are scheduled to be shut down and 3348 // removed. For more information, see the "Deprecation Policy" section of our 3349 // Terms of Service (https://cloud.google.com/terms/) and the Google Cloud 3350 // Platform Subject to the Deprecation Policy 3351 // (https://cloud.google.com/terms/deprecation) documentation. 3352 LaunchStage string `json:"launchStage,omitempty"` 3353 // SamplePeriod: The sampling period of metric data points. For metrics which 3354 // are written periodically, consecutive data points are stored at this time 3355 // interval, excluding data loss due to errors. Metrics with a higher 3356 // granularity have a smaller sampling period. 3357 SamplePeriod string `json:"samplePeriod,omitempty"` 3358 // ForceSendFields is a list of field names (e.g. "IngestDelay") to 3359 // unconditionally include in API requests. By default, fields with empty or 3360 // default values are omitted from API requests. See 3361 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3362 // details. 3363 ForceSendFields []string `json:"-"` 3364 // NullFields is a list of field names (e.g. "IngestDelay") to include in API 3365 // requests with the JSON null value. By default, fields with empty values are 3366 // omitted from API requests. See 3367 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3368 NullFields []string `json:"-"` 3369 } 3370 3371 func (s *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) { 3372 type NoMethod MetricDescriptorMetadata 3373 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3374 } 3375 3376 // MetricRange: A MetricRange is used when each window is good when the value x 3377 // of a single TimeSeries satisfies range.min <= x <= range.max. The provided 3378 // TimeSeries must have ValueType = INT64 or ValueType = DOUBLE and MetricKind 3379 // = GAUGE. 3380 type MetricRange struct { 3381 // Range: Range of values considered "good." For a one-sided range, set one 3382 // bound to an infinite value. 3383 Range *GoogleMonitoringV3Range `json:"range,omitempty"` 3384 // TimeSeries: A monitoring filter 3385 // (https://cloud.google.com/monitoring/api/v3/filters) specifying the 3386 // TimeSeries to use for evaluating window quality. 3387 TimeSeries string `json:"timeSeries,omitempty"` 3388 // ForceSendFields is a list of field names (e.g. "Range") to unconditionally 3389 // include in API requests. By default, fields with empty or default values are 3390 // omitted from API requests. See 3391 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3392 // details. 3393 ForceSendFields []string `json:"-"` 3394 // NullFields is a list of field names (e.g. "Range") to include in API 3395 // requests with the JSON null value. By default, fields with empty values are 3396 // omitted from API requests. See 3397 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3398 NullFields []string `json:"-"` 3399 } 3400 3401 func (s *MetricRange) MarshalJSON() ([]byte, error) { 3402 type NoMethod MetricRange 3403 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3404 } 3405 3406 // MetricThreshold: A condition type that compares a collection of time series 3407 // against a threshold. 3408 type MetricThreshold struct { 3409 // Aggregations: Specifies the alignment of data points in individual time 3410 // series as well as how to combine the retrieved time series together (such as 3411 // when aggregating multiple streams on each resource to a single stream for 3412 // each resource or when aggregating streams across all members of a group of 3413 // resources). Multiple aggregations are applied in the order specified.This 3414 // field is similar to the one in the ListTimeSeries request 3415 // (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). 3416 // It is advisable to use the ListTimeSeries method when debugging this field. 3417 Aggregations []*Aggregation `json:"aggregations,omitempty"` 3418 // Comparison: The comparison to apply between the time series (indicated by 3419 // filter and aggregation) and the threshold (indicated by threshold_value). 3420 // The comparison is applied on each time series, with the time series on the 3421 // left-hand side and the threshold on the right-hand side.Only COMPARISON_LT 3422 // and COMPARISON_GT are supported currently. 3423 // 3424 // Possible values: 3425 // "COMPARISON_UNSPECIFIED" - No ordering relationship is specified. 3426 // "COMPARISON_GT" - True if the left argument is greater than the right 3427 // argument. 3428 // "COMPARISON_GE" - True if the left argument is greater than or equal to 3429 // the right argument. 3430 // "COMPARISON_LT" - True if the left argument is less than the right 3431 // argument. 3432 // "COMPARISON_LE" - True if the left argument is less than or equal to the 3433 // right argument. 3434 // "COMPARISON_EQ" - True if the left argument is equal to the right 3435 // argument. 3436 // "COMPARISON_NE" - True if the left argument is not equal to the right 3437 // argument. 3438 Comparison string `json:"comparison,omitempty"` 3439 // DenominatorAggregations: Specifies the alignment of data points in 3440 // individual time series selected by denominatorFilter as well as how to 3441 // combine the retrieved time series together (such as when aggregating 3442 // multiple streams on each resource to a single stream for each resource or 3443 // when aggregating streams across all members of a group of resources).When 3444 // computing ratios, the aggregations and denominator_aggregations fields must 3445 // use the same alignment period and produce time series that have the same 3446 // periodicity and labels. 3447 DenominatorAggregations []*Aggregation `json:"denominatorAggregations,omitempty"` 3448 // DenominatorFilter: A filter 3449 // (https://cloud.google.com/monitoring/api/v3/filters) that identifies a time 3450 // series that should be used as the denominator of a ratio that will be 3451 // compared with the threshold. If a denominator_filter is specified, the time 3452 // series specified by the filter field will be used as the numerator.The 3453 // filter must specify the metric type and optionally may contain restrictions 3454 // on resource type, resource labels, and metric labels. This field may not 3455 // exceed 2048 Unicode characters in length. 3456 DenominatorFilter string `json:"denominatorFilter,omitempty"` 3457 // Duration: The amount of time that a time series must violate the threshold 3458 // to be considered failing. Currently, only values that are a multiple of a 3459 // minute--e.g., 0, 60, 120, or 300 seconds--are supported. If an invalid value 3460 // is given, an error will be returned. When choosing a duration, it is useful 3461 // to keep in mind the frequency of the underlying time series data (which may 3462 // also be affected by any alignments specified in the aggregations field); a 3463 // good duration is long enough so that a single outlier does not generate 3464 // spurious alerts, but short enough that unhealthy states are detected and 3465 // alerted on quickly. 3466 Duration string `json:"duration,omitempty"` 3467 // EvaluationMissingData: A condition control that determines how 3468 // metric-threshold conditions are evaluated when data stops arriving. To use 3469 // this control, the value of the duration field must be greater than or equal 3470 // to 60 seconds. 3471 // 3472 // Possible values: 3473 // "EVALUATION_MISSING_DATA_UNSPECIFIED" - An unspecified evaluation missing 3474 // data option. Equivalent to EVALUATION_MISSING_DATA_NO_OP. 3475 // "EVALUATION_MISSING_DATA_INACTIVE" - If there is no data to evaluate the 3476 // condition, then evaluate the condition as false. 3477 // "EVALUATION_MISSING_DATA_ACTIVE" - If there is no data to evaluate the 3478 // condition, then evaluate the condition as true. 3479 // "EVALUATION_MISSING_DATA_NO_OP" - Do not evaluate the condition to any 3480 // value if there is no data. 3481 EvaluationMissingData string `json:"evaluationMissingData,omitempty"` 3482 // Filter: Required. A filter 3483 // (https://cloud.google.com/monitoring/api/v3/filters) that identifies which 3484 // time series should be compared with the threshold.The filter is similar to 3485 // the one that is specified in the ListTimeSeries request 3486 // (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) 3487 // (that call is useful to verify the time series that will be retrieved / 3488 // processed). The filter must specify the metric type and the resource type. 3489 // Optionally, it can specify resource labels and metric labels. This field 3490 // must not exceed 2048 Unicode characters in length. 3491 Filter string `json:"filter,omitempty"` 3492 // ForecastOptions: When this field is present, the MetricThreshold condition 3493 // forecasts whether the time series is predicted to violate the threshold 3494 // within the forecast_horizon. When this field is not set, the MetricThreshold 3495 // tests the current value of the timeseries against the threshold. 3496 ForecastOptions *ForecastOptions `json:"forecastOptions,omitempty"` 3497 // ThresholdValue: A value against which to compare the time series. 3498 ThresholdValue float64 `json:"thresholdValue,omitempty"` 3499 // Trigger: The number/percent of time series for which the comparison must 3500 // hold in order for the condition to trigger. If unspecified, then the 3501 // condition will trigger if the comparison is true for any of the time series 3502 // that have been identified by filter and aggregations, or by the ratio, if 3503 // denominator_filter and denominator_aggregations are specified. 3504 Trigger *Trigger `json:"trigger,omitempty"` 3505 // ForceSendFields is a list of field names (e.g. "Aggregations") to 3506 // unconditionally include in API requests. By default, fields with empty or 3507 // default values are omitted from API requests. See 3508 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3509 // details. 3510 ForceSendFields []string `json:"-"` 3511 // NullFields is a list of field names (e.g. "Aggregations") to include in API 3512 // requests with the JSON null value. By default, fields with empty values are 3513 // omitted from API requests. See 3514 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3515 NullFields []string `json:"-"` 3516 } 3517 3518 func (s *MetricThreshold) MarshalJSON() ([]byte, error) { 3519 type NoMethod MetricThreshold 3520 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3521 } 3522 3523 func (s *MetricThreshold) UnmarshalJSON(data []byte) error { 3524 type NoMethod MetricThreshold 3525 var s1 struct { 3526 ThresholdValue gensupport.JSONFloat64 `json:"thresholdValue"` 3527 *NoMethod 3528 } 3529 s1.NoMethod = (*NoMethod)(s) 3530 if err := json.Unmarshal(data, &s1); err != nil { 3531 return err 3532 } 3533 s.ThresholdValue = float64(s1.ThresholdValue) 3534 return nil 3535 } 3536 3537 // MonitoredResource: An object representing a resource that can be used for 3538 // monitoring, logging, billing, or other purposes. Examples include virtual 3539 // machine instances, databases, and storage devices such as disks. The type 3540 // field identifies a MonitoredResourceDescriptor object that describes the 3541 // resource's schema. Information in the labels field identifies the actual 3542 // resource and its attributes according to the schema. For example, a 3543 // particular Compute Engine VM instance could be represented by the following 3544 // object, because the MonitoredResourceDescriptor for "gce_instance" has 3545 // labels "project_id", "instance_id" and "zone": { "type": "gce_instance", 3546 // "labels": { "project_id": "my-project", "instance_id": "12345678901234", 3547 // "zone": "us-central1-a" }} 3548 type MonitoredResource struct { 3549 // Labels: Required. Values for all of the labels listed in the associated 3550 // monitored resource descriptor. For example, Compute Engine VM instances use 3551 // the labels "project_id", "instance_id", and "zone". 3552 Labels map[string]string `json:"labels,omitempty"` 3553 // Type: Required. The monitored resource type. This field must match the type 3554 // field of a MonitoredResourceDescriptor object. For example, the type of a 3555 // Compute Engine VM instance is gce_instance. For a list of types, see 3556 // Monitoring resource types 3557 // (https://cloud.google.com/monitoring/api/resources) and Logging resource 3558 // types (https://cloud.google.com/logging/docs/api/v2/resource-list). 3559 Type string `json:"type,omitempty"` 3560 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally 3561 // include in API requests. By default, fields with empty or default values are 3562 // omitted from API requests. See 3563 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3564 // details. 3565 ForceSendFields []string `json:"-"` 3566 // NullFields is a list of field names (e.g. "Labels") to include in API 3567 // requests with the JSON null value. By default, fields with empty values are 3568 // omitted from API requests. See 3569 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3570 NullFields []string `json:"-"` 3571 } 3572 3573 func (s *MonitoredResource) MarshalJSON() ([]byte, error) { 3574 type NoMethod MonitoredResource 3575 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3576 } 3577 3578 // MonitoredResourceDescriptor: An object that describes the schema of a 3579 // MonitoredResource object using a type name and a set of labels. For example, 3580 // the monitored resource descriptor for Google Compute Engine VM instances has 3581 // a type of "gce_instance" and specifies the use of the labels "instance_id" 3582 // and "zone" to identify particular VM instances.Different APIs can support 3583 // different monitored resource types. APIs generally provide a list method 3584 // that returns the monitored resource descriptors used by the API. 3585 type MonitoredResourceDescriptor struct { 3586 // Description: Optional. A detailed description of the monitored resource type 3587 // that might be used in documentation. 3588 Description string `json:"description,omitempty"` 3589 // DisplayName: Optional. A concise name for the monitored resource type that 3590 // might be displayed in user interfaces. It should be a Title Cased Noun 3591 // Phrase, without any article or other determiners. For example, "Google Cloud 3592 // SQL Database". 3593 DisplayName string `json:"displayName,omitempty"` 3594 // Labels: Required. A set of labels used to describe instances of this 3595 // monitored resource type. For example, an individual Google Cloud SQL 3596 // database is identified by values for the labels "database_id" and "zone". 3597 Labels []*LabelDescriptor `json:"labels,omitempty"` 3598 // LaunchStage: Optional. The launch stage of the monitored resource 3599 // definition. 3600 // 3601 // Possible values: 3602 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 3603 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not use 3604 // it. 3605 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 3606 // visible internally. 3607 // "EARLY_ACCESS" - Early Access features are limited to a closed group of 3608 // testers. To use these features, you must sign up in advance and sign a 3609 // Trusted Tester agreement (which includes confidentiality provisions). These 3610 // features may be unstable, changed in backward-incompatible ways, and are not 3611 // guaranteed to be released. 3612 // "ALPHA" - Alpha is a limited availability test for releases before they 3613 // are cleared for widespread use. By Alpha, all significant design issues are 3614 // resolved and we are in the process of verifying functionality. Alpha 3615 // customers need to apply for access, agree to applicable terms, and have 3616 // their projects allowlisted. Alpha releases don't have to be feature 3617 // complete, no SLAs are provided, and there are no technical support 3618 // obligations, but they will be far enough along that customers can actually 3619 // use them in test environments or for limited-use tests -- just like they 3620 // would in normal production cases. 3621 // "BETA" - Beta is the point at which we are ready to open a release for any 3622 // customer to use. There are no SLA or technical support obligations in a Beta 3623 // release. Products will be complete from a feature perspective, but may have 3624 // some open outstanding issues. Beta releases are suitable for limited 3625 // production use cases. 3626 // "GA" - GA features are open to all developers and are considered stable 3627 // and fully qualified for production use. 3628 // "DEPRECATED" - Deprecated features are scheduled to be shut down and 3629 // removed. For more information, see the "Deprecation Policy" section of our 3630 // Terms of Service (https://cloud.google.com/terms/) and the Google Cloud 3631 // Platform Subject to the Deprecation Policy 3632 // (https://cloud.google.com/terms/deprecation) documentation. 3633 LaunchStage string `json:"launchStage,omitempty"` 3634 // Name: Optional. The resource name of the monitored resource descriptor: 3635 // "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} is 3636 // the value of the type field in this object and {project_id} is a project ID 3637 // that provides API-specific context for accessing the type. APIs that do not 3638 // use project information can use the resource name format 3639 // "monitoredResourceDescriptors/{type}". 3640 Name string `json:"name,omitempty"` 3641 // Type: Required. The monitored resource type. For example, the type 3642 // "cloudsql_database" represents databases in Google Cloud SQL. For a list of 3643 // types, see Monitored resource types 3644 // (https://cloud.google.com/monitoring/api/resources) and Logging resource 3645 // types (https://cloud.google.com/logging/docs/api/v2/resource-list). 3646 Type string `json:"type,omitempty"` 3647 3648 // ServerResponse contains the HTTP response code and headers from the server. 3649 googleapi.ServerResponse `json:"-"` 3650 // ForceSendFields is a list of field names (e.g. "Description") to 3651 // unconditionally include in API requests. By default, fields with empty or 3652 // default values are omitted from API requests. See 3653 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3654 // details. 3655 ForceSendFields []string `json:"-"` 3656 // NullFields is a list of field names (e.g. "Description") to include in API 3657 // requests with the JSON null value. By default, fields with empty values are 3658 // omitted from API requests. See 3659 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3660 NullFields []string `json:"-"` 3661 } 3662 3663 func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) { 3664 type NoMethod MonitoredResourceDescriptor 3665 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3666 } 3667 3668 // MonitoredResourceMetadata: Auxiliary metadata for a MonitoredResource 3669 // object. MonitoredResource objects contain the minimum set of information to 3670 // uniquely identify a monitored resource instance. There is some other useful 3671 // auxiliary metadata. Monitoring and Logging use an ingestion pipeline to 3672 // extract metadata for cloud resources of all types, and store the metadata in 3673 // this message. 3674 type MonitoredResourceMetadata struct { 3675 // SystemLabels: Output only. Values for predefined system metadata labels. 3676 // System labels are a kind of metadata extracted by Google, including 3677 // "machine_image", "vpc", "subnet_id", "security_group", "name", etc. System 3678 // label values can be only strings, Boolean values, or a list of strings. For 3679 // example: { "name": "my-test-instance", "security_group": ["a", "b", "c"], 3680 // "spot_instance": false } 3681 SystemLabels googleapi.RawMessage `json:"systemLabels,omitempty"` 3682 // UserLabels: Output only. A map of user-defined metadata labels. 3683 UserLabels map[string]string `json:"userLabels,omitempty"` 3684 // ForceSendFields is a list of field names (e.g. "SystemLabels") to 3685 // unconditionally include in API requests. By default, fields with empty or 3686 // default values are omitted from API requests. See 3687 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3688 // details. 3689 ForceSendFields []string `json:"-"` 3690 // NullFields is a list of field names (e.g. "SystemLabels") to include in API 3691 // requests with the JSON null value. By default, fields with empty values are 3692 // omitted from API requests. See 3693 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3694 NullFields []string `json:"-"` 3695 } 3696 3697 func (s *MonitoredResourceMetadata) MarshalJSON() ([]byte, error) { 3698 type NoMethod MonitoredResourceMetadata 3699 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3700 } 3701 3702 // MonitoringQueryLanguageCondition: A condition type that allows alert 3703 // policies to be defined using Monitoring Query Language 3704 // (https://cloud.google.com/monitoring/mql). 3705 type MonitoringQueryLanguageCondition struct { 3706 // Duration: The amount of time that a time series must violate the threshold 3707 // to be considered failing. Currently, only values that are a multiple of a 3708 // minute--e.g., 0, 60, 120, or 300 seconds--are supported. If an invalid value 3709 // is given, an error will be returned. When choosing a duration, it is useful 3710 // to keep in mind the frequency of the underlying time series data (which may 3711 // also be affected by any alignments specified in the aggregations field); a 3712 // good duration is long enough so that a single outlier does not generate 3713 // spurious alerts, but short enough that unhealthy states are detected and 3714 // alerted on quickly. 3715 Duration string `json:"duration,omitempty"` 3716 // EvaluationMissingData: A condition control that determines how 3717 // metric-threshold conditions are evaluated when data stops arriving. 3718 // 3719 // Possible values: 3720 // "EVALUATION_MISSING_DATA_UNSPECIFIED" - An unspecified evaluation missing 3721 // data option. Equivalent to EVALUATION_MISSING_DATA_NO_OP. 3722 // "EVALUATION_MISSING_DATA_INACTIVE" - If there is no data to evaluate the 3723 // condition, then evaluate the condition as false. 3724 // "EVALUATION_MISSING_DATA_ACTIVE" - If there is no data to evaluate the 3725 // condition, then evaluate the condition as true. 3726 // "EVALUATION_MISSING_DATA_NO_OP" - Do not evaluate the condition to any 3727 // value if there is no data. 3728 EvaluationMissingData string `json:"evaluationMissingData,omitempty"` 3729 // Query: Monitoring Query Language (https://cloud.google.com/monitoring/mql) 3730 // query that outputs a boolean stream. 3731 Query string `json:"query,omitempty"` 3732 // Trigger: The number/percent of time series for which the comparison must 3733 // hold in order for the condition to trigger. If unspecified, then the 3734 // condition will trigger if the comparison is true for any of the time series 3735 // that have been identified by filter and aggregations, or by the ratio, if 3736 // denominator_filter and denominator_aggregations are specified. 3737 Trigger *Trigger `json:"trigger,omitempty"` 3738 // ForceSendFields is a list of field names (e.g. "Duration") to 3739 // unconditionally include in API requests. By default, fields with empty or 3740 // default values are omitted from API requests. See 3741 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3742 // details. 3743 ForceSendFields []string `json:"-"` 3744 // NullFields is a list of field names (e.g. "Duration") to include in API 3745 // requests with the JSON null value. By default, fields with empty values are 3746 // omitted from API requests. See 3747 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3748 NullFields []string `json:"-"` 3749 } 3750 3751 func (s *MonitoringQueryLanguageCondition) MarshalJSON() ([]byte, error) { 3752 type NoMethod MonitoringQueryLanguageCondition 3753 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3754 } 3755 3756 // MutationRecord: Describes a change made to a configuration. 3757 type MutationRecord struct { 3758 // MutateTime: When the change occurred. 3759 MutateTime string `json:"mutateTime,omitempty"` 3760 // MutatedBy: The email address of the user making the change. 3761 MutatedBy string `json:"mutatedBy,omitempty"` 3762 // ForceSendFields is a list of field names (e.g. "MutateTime") to 3763 // unconditionally include in API requests. By default, fields with empty or 3764 // default values are omitted from API requests. See 3765 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3766 // details. 3767 ForceSendFields []string `json:"-"` 3768 // NullFields is a list of field names (e.g. "MutateTime") to include in API 3769 // requests with the JSON null value. By default, fields with empty values are 3770 // omitted from API requests. See 3771 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3772 NullFields []string `json:"-"` 3773 } 3774 3775 func (s *MutationRecord) MarshalJSON() ([]byte, error) { 3776 type NoMethod MutationRecord 3777 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3778 } 3779 3780 // NotificationChannel: A NotificationChannel is a medium through which an 3781 // alert is delivered when a policy violation is detected. Examples of channels 3782 // include email, SMS, and third-party messaging applications. Fields 3783 // containing sensitive information like authentication tokens or contact info 3784 // are only partially populated on retrieval. 3785 type NotificationChannel struct { 3786 // CreationRecord: Record of the creation of this channel. 3787 CreationRecord *MutationRecord `json:"creationRecord,omitempty"` 3788 // Description: An optional human-readable description of this notification 3789 // channel. This description may provide additional details, beyond the display 3790 // name, for the channel. This may not exceed 1024 Unicode characters. 3791 Description string `json:"description,omitempty"` 3792 // DisplayName: An optional human-readable name for this notification channel. 3793 // It is recommended that you specify a non-empty and unique name in order to 3794 // make it easier to identify the channels in your project, though this is not 3795 // enforced. The display name is limited to 512 Unicode characters. 3796 DisplayName string `json:"displayName,omitempty"` 3797 // Enabled: Whether notifications are forwarded to the described channel. This 3798 // makes it possible to disable delivery of notifications to a particular 3799 // channel without removing the channel from all alerting policies that 3800 // reference the channel. This is a more convenient approach when the change is 3801 // temporary and you want to receive notifications from the same set of 3802 // alerting policies on the channel at some point in the future. 3803 Enabled bool `json:"enabled,omitempty"` 3804 // Labels: Configuration fields that define the channel and its behavior. The 3805 // permissible and required labels are specified in the 3806 // NotificationChannelDescriptor.labels of the NotificationChannelDescriptor 3807 // corresponding to the type field. 3808 Labels map[string]string `json:"labels,omitempty"` 3809 // MutationRecords: Records of the modification of this channel. 3810 MutationRecords []*MutationRecord `json:"mutationRecords,omitempty"` 3811 // Name: The full REST resource name for this channel. The format is: 3812 // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] The 3813 // [CHANNEL_ID] is automatically assigned by the server on creation. 3814 Name string `json:"name,omitempty"` 3815 // Type: The type of the notification channel. This field matches the value of 3816 // the NotificationChannelDescriptor.type field. 3817 Type string `json:"type,omitempty"` 3818 // UserLabels: User-supplied key/value data that does not need to conform to 3819 // the corresponding NotificationChannelDescriptor's schema, unlike the labels 3820 // field. This field is intended to be used for organizing and identifying the 3821 // NotificationChannel objects.The field can contain up to 64 entries. Each key 3822 // and value is limited to 63 Unicode characters or 128 bytes, whichever is 3823 // smaller. Labels and values can contain only lowercase letters, numerals, 3824 // underscores, and dashes. Keys must begin with a letter. 3825 UserLabels map[string]string `json:"userLabels,omitempty"` 3826 // VerificationStatus: Indicates whether this channel has been verified or not. 3827 // On a ListNotificationChannels or GetNotificationChannel operation, this 3828 // field is expected to be populated.If the value is UNVERIFIED, then it 3829 // indicates that the channel is non-functioning (it both requires verification 3830 // and lacks verification); otherwise, it is assumed that the channel works.If 3831 // the channel is neither VERIFIED nor UNVERIFIED, it implies that the channel 3832 // is of a type that does not require verification or that this specific 3833 // channel has been exempted from verification because it was created prior to 3834 // verification being required for channels of this type.This field cannot be 3835 // modified using a standard UpdateNotificationChannel operation. To change the 3836 // value of this field, you must call VerifyNotificationChannel. 3837 // 3838 // Possible values: 3839 // "VERIFICATION_STATUS_UNSPECIFIED" - Sentinel value used to indicate that 3840 // the state is unknown, omitted, or is not applicable (as in the case of 3841 // channels that neither support nor require verification in order to 3842 // function). 3843 // "UNVERIFIED" - The channel has yet to be verified and requires 3844 // verification to function. Note that this state also applies to the case 3845 // where the verification process has been initiated by sending a verification 3846 // code but where the verification code has not been submitted to complete the 3847 // process. 3848 // "VERIFIED" - It has been proven that notifications can be received on this 3849 // notification channel and that someone on the project has access to messages 3850 // that are delivered to that channel. 3851 VerificationStatus string `json:"verificationStatus,omitempty"` 3852 3853 // ServerResponse contains the HTTP response code and headers from the server. 3854 googleapi.ServerResponse `json:"-"` 3855 // ForceSendFields is a list of field names (e.g. "CreationRecord") to 3856 // unconditionally include in API requests. By default, fields with empty or 3857 // default values are omitted from API requests. See 3858 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3859 // details. 3860 ForceSendFields []string `json:"-"` 3861 // NullFields is a list of field names (e.g. "CreationRecord") to include in 3862 // API requests with the JSON null value. By default, fields with empty values 3863 // are omitted from API requests. See 3864 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3865 NullFields []string `json:"-"` 3866 } 3867 3868 func (s *NotificationChannel) MarshalJSON() ([]byte, error) { 3869 type NoMethod NotificationChannel 3870 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3871 } 3872 3873 // NotificationChannelDescriptor: A description of a notification channel. The 3874 // descriptor includes the properties of the channel and the set of labels or 3875 // fields that must be specified to configure channels of a given type. 3876 type NotificationChannelDescriptor struct { 3877 // Description: A human-readable description of the notification channel type. 3878 // The description may include a description of the properties of the channel 3879 // and pointers to external documentation. 3880 Description string `json:"description,omitempty"` 3881 // DisplayName: A human-readable name for the notification channel type. This 3882 // form of the name is suitable for a user interface. 3883 DisplayName string `json:"displayName,omitempty"` 3884 // Labels: The set of labels that must be defined to identify a particular 3885 // channel of the corresponding type. Each label includes a description for how 3886 // that field should be populated. 3887 Labels []*LabelDescriptor `json:"labels,omitempty"` 3888 // LaunchStage: The product launch stage for channels of this type. 3889 // 3890 // Possible values: 3891 // "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value. 3892 // "UNIMPLEMENTED" - The feature is not yet implemented. Users can not use 3893 // it. 3894 // "PRELAUNCH" - Prelaunch features are hidden from users and are only 3895 // visible internally. 3896 // "EARLY_ACCESS" - Early Access features are limited to a closed group of 3897 // testers. To use these features, you must sign up in advance and sign a 3898 // Trusted Tester agreement (which includes confidentiality provisions). These 3899 // features may be unstable, changed in backward-incompatible ways, and are not 3900 // guaranteed to be released. 3901 // "ALPHA" - Alpha is a limited availability test for releases before they 3902 // are cleared for widespread use. By Alpha, all significant design issues are 3903 // resolved and we are in the process of verifying functionality. Alpha 3904 // customers need to apply for access, agree to applicable terms, and have 3905 // their projects allowlisted. Alpha releases don't have to be feature 3906 // complete, no SLAs are provided, and there are no technical support 3907 // obligations, but they will be far enough along that customers can actually 3908 // use them in test environments or for limited-use tests -- just like they 3909 // would in normal production cases. 3910 // "BETA" - Beta is the point at which we are ready to open a release for any 3911 // customer to use. There are no SLA or technical support obligations in a Beta 3912 // release. Products will be complete from a feature perspective, but may have 3913 // some open outstanding issues. Beta releases are suitable for limited 3914 // production use cases. 3915 // "GA" - GA features are open to all developers and are considered stable 3916 // and fully qualified for production use. 3917 // "DEPRECATED" - Deprecated features are scheduled to be shut down and 3918 // removed. For more information, see the "Deprecation Policy" section of our 3919 // Terms of Service (https://cloud.google.com/terms/) and the Google Cloud 3920 // Platform Subject to the Deprecation Policy 3921 // (https://cloud.google.com/terms/deprecation) documentation. 3922 LaunchStage string `json:"launchStage,omitempty"` 3923 // Name: The full REST resource name for this descriptor. The format is: 3924 // projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[TYPE] In the 3925 // above, [TYPE] is the value of the type field. 3926 Name string `json:"name,omitempty"` 3927 // SupportedTiers: The tiers that support this notification channel; the 3928 // project service tier must be one of the supported_tiers. 3929 // 3930 // Possible values: 3931 // "SERVICE_TIER_UNSPECIFIED" - An invalid sentinel value, used to indicate 3932 // that a tier has not been provided explicitly. 3933 // "SERVICE_TIER_BASIC" - The Cloud Monitoring Basic tier, a free tier of 3934 // service that provides basic features, a moderate allotment of logs, and 3935 // access to built-in metrics. A number of features are not available in this 3936 // tier. For more details, see the service tiers documentation 3937 // (https://cloud.google.com/monitoring/workspaces/tiers). 3938 // "SERVICE_TIER_PREMIUM" - The Cloud Monitoring Premium tier, a higher, more 3939 // expensive tier of service that provides access to all Cloud Monitoring 3940 // features, lets you use Cloud Monitoring with AWS accounts, and has a larger 3941 // allotments for logs and metrics. For more details, see the service tiers 3942 // documentation (https://cloud.google.com/monitoring/workspaces/tiers). 3943 SupportedTiers []string `json:"supportedTiers,omitempty"` 3944 // Type: The type of notification channel, such as "email" and "sms". To view 3945 // the full list of channels, see Channel descriptors 3946 // (https://cloud.google.com/monitoring/alerts/using-channels-api#ncd). 3947 // Notification channel types are globally unique. 3948 Type string `json:"type,omitempty"` 3949 3950 // ServerResponse contains the HTTP response code and headers from the server. 3951 googleapi.ServerResponse `json:"-"` 3952 // ForceSendFields is a list of field names (e.g. "Description") to 3953 // unconditionally include in API requests. By default, fields with empty or 3954 // default values are omitted from API requests. See 3955 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3956 // details. 3957 ForceSendFields []string `json:"-"` 3958 // NullFields is a list of field names (e.g. "Description") to include in API 3959 // requests with the JSON null value. By default, fields with empty values are 3960 // omitted from API requests. See 3961 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3962 NullFields []string `json:"-"` 3963 } 3964 3965 func (s *NotificationChannelDescriptor) MarshalJSON() ([]byte, error) { 3966 type NoMethod NotificationChannelDescriptor 3967 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3968 } 3969 3970 // NotificationChannelStrategy: Control over how the notification channels in 3971 // notification_channels are notified when this alert fires, on a per-channel 3972 // basis. 3973 type NotificationChannelStrategy struct { 3974 // NotificationChannelNames: The full REST resource name for the notification 3975 // channels that these settings apply to. Each of these correspond to the name 3976 // field in one of the NotificationChannel objects referenced in the 3977 // notification_channels field of this AlertPolicy. The format is: 3978 // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] 3979 NotificationChannelNames []string `json:"notificationChannelNames,omitempty"` 3980 // RenotifyInterval: The frequency at which to send reminder notifications for 3981 // open incidents. 3982 RenotifyInterval string `json:"renotifyInterval,omitempty"` 3983 // ForceSendFields is a list of field names (e.g. "NotificationChannelNames") 3984 // to unconditionally include in API requests. By default, fields with empty or 3985 // default values are omitted from API requests. See 3986 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3987 // details. 3988 ForceSendFields []string `json:"-"` 3989 // NullFields is a list of field names (e.g. "NotificationChannelNames") to 3990 // include in API requests with the JSON null value. By default, fields with 3991 // empty values are omitted from API requests. See 3992 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3993 NullFields []string `json:"-"` 3994 } 3995 3996 func (s *NotificationChannelStrategy) MarshalJSON() ([]byte, error) { 3997 type NoMethod NotificationChannelStrategy 3998 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3999 } 4000 4001 // NotificationRateLimit: Control over the rate of notifications sent to this 4002 // alert policy's notification channels. 4003 type NotificationRateLimit struct { 4004 // Period: Not more than one notification per period. 4005 Period string `json:"period,omitempty"` 4006 // ForceSendFields is a list of field names (e.g. "Period") to unconditionally 4007 // include in API requests. By default, fields with empty or default values are 4008 // omitted from API requests. See 4009 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4010 // details. 4011 ForceSendFields []string `json:"-"` 4012 // NullFields is a list of field names (e.g. "Period") to include in API 4013 // requests with the JSON null value. By default, fields with empty values are 4014 // omitted from API requests. See 4015 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4016 NullFields []string `json:"-"` 4017 } 4018 4019 func (s *NotificationRateLimit) MarshalJSON() ([]byte, error) { 4020 type NoMethod NotificationRateLimit 4021 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4022 } 4023 4024 // OperationMetadata: Contains metadata for longrunning operation for the edit 4025 // Metrics Scope endpoints. 4026 type OperationMetadata struct { 4027 // CreateTime: The time when the batch request was received. 4028 CreateTime string `json:"createTime,omitempty"` 4029 // State: Current state of the batch operation. 4030 // 4031 // Possible values: 4032 // "STATE_UNSPECIFIED" - Invalid. 4033 // "CREATED" - Request has been received. 4034 // "RUNNING" - Request is actively being processed. 4035 // "DONE" - The batch processing is done. 4036 // "CANCELLED" - The batch processing was cancelled. 4037 State string `json:"state,omitempty"` 4038 // UpdateTime: The time when the operation result was last updated. 4039 UpdateTime string `json:"updateTime,omitempty"` 4040 // ForceSendFields is a list of field names (e.g. "CreateTime") to 4041 // unconditionally include in API requests. By default, fields with empty or 4042 // default values are omitted from API requests. See 4043 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4044 // details. 4045 ForceSendFields []string `json:"-"` 4046 // NullFields is a list of field names (e.g. "CreateTime") to include in API 4047 // requests with the JSON null value. By default, fields with empty values are 4048 // omitted from API requests. See 4049 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4050 NullFields []string `json:"-"` 4051 } 4052 4053 func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 4054 type NoMethod OperationMetadata 4055 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4056 } 4057 4058 // Option: A protocol buffer option, which can be attached to a message, field, 4059 // enumeration, etc. 4060 type Option struct { 4061 // Name: The option's name. For protobuf built-in options (options defined in 4062 // descriptor.proto), this is the short name. For example, "map_entry". For 4063 // custom options, it should be the fully-qualified name. For example, 4064 // "google.api.http". 4065 Name string `json:"name,omitempty"` 4066 // Value: The option's value packed in an Any message. If the value is a 4067 // primitive, the corresponding wrapper type defined in 4068 // google/protobuf/wrappers.proto should be used. If the value is an enum, it 4069 // should be stored as an int32 value using the google.protobuf.Int32Value 4070 // type. 4071 Value googleapi.RawMessage `json:"value,omitempty"` 4072 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally 4073 // include in API requests. By default, fields with empty or default values are 4074 // omitted from API requests. See 4075 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4076 // details. 4077 ForceSendFields []string `json:"-"` 4078 // NullFields is a list of field names (e.g. "Name") to include in API requests 4079 // with the JSON null value. By default, fields with empty values are omitted 4080 // from API requests. See 4081 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4082 NullFields []string `json:"-"` 4083 } 4084 4085 func (s *Option) MarshalJSON() ([]byte, error) { 4086 type NoMethod Option 4087 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4088 } 4089 4090 // PerformanceThreshold: A PerformanceThreshold is used when each window is 4091 // good when that window has a sufficiently high performance. 4092 type PerformanceThreshold struct { 4093 // BasicSliPerformance: BasicSli to evaluate to judge window quality. 4094 BasicSliPerformance *BasicSli `json:"basicSliPerformance,omitempty"` 4095 // Performance: RequestBasedSli to evaluate to judge window quality. 4096 Performance *RequestBasedSli `json:"performance,omitempty"` 4097 // Threshold: If window performance >= threshold, the window is counted as 4098 // good. 4099 Threshold float64 `json:"threshold,omitempty"` 4100 // ForceSendFields is a list of field names (e.g. "BasicSliPerformance") to 4101 // unconditionally include in API requests. By default, fields with empty or 4102 // default values are omitted from API requests. See 4103 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4104 // details. 4105 ForceSendFields []string `json:"-"` 4106 // NullFields is a list of field names (e.g. "BasicSliPerformance") to include 4107 // in API requests with the JSON null value. By default, fields with empty 4108 // values are omitted from API requests. See 4109 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4110 NullFields []string `json:"-"` 4111 } 4112 4113 func (s *PerformanceThreshold) MarshalJSON() ([]byte, error) { 4114 type NoMethod PerformanceThreshold 4115 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4116 } 4117 4118 func (s *PerformanceThreshold) UnmarshalJSON(data []byte) error { 4119 type NoMethod PerformanceThreshold 4120 var s1 struct { 4121 Threshold gensupport.JSONFloat64 `json:"threshold"` 4122 *NoMethod 4123 } 4124 s1.NoMethod = (*NoMethod)(s) 4125 if err := json.Unmarshal(data, &s1); err != nil { 4126 return err 4127 } 4128 s.Threshold = float64(s1.Threshold) 4129 return nil 4130 } 4131 4132 // PingConfig: Information involved in sending ICMP pings alongside public 4133 // HTTP/TCP checks. For HTTP, the pings are performed for each part of the 4134 // redirect chain. 4135 type PingConfig struct { 4136 // PingsCount: Number of ICMP pings. A maximum of 3 ICMP pings is currently 4137 // supported. 4138 PingsCount int64 `json:"pingsCount,omitempty"` 4139 // ForceSendFields is a list of field names (e.g. "PingsCount") to 4140 // unconditionally include in API requests. By default, fields with empty or 4141 // default values are omitted from API requests. See 4142 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4143 // details. 4144 ForceSendFields []string `json:"-"` 4145 // NullFields is a list of field names (e.g. "PingsCount") to include in API 4146 // requests with the JSON null value. By default, fields with empty values are 4147 // omitted from API requests. See 4148 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4149 NullFields []string `json:"-"` 4150 } 4151 4152 func (s *PingConfig) MarshalJSON() ([]byte, error) { 4153 type NoMethod PingConfig 4154 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4155 } 4156 4157 // Point: A single data point in a time series. 4158 type Point struct { 4159 // Interval: The time interval to which the data point applies. For GAUGE 4160 // metrics, the start time is optional, but if it is supplied, it must equal 4161 // the end time. For DELTA metrics, the start and end time should specify a 4162 // non-zero interval, with subsequent points specifying contiguous and 4163 // non-overlapping intervals. For CUMULATIVE metrics, the start and end time 4164 // should specify a non-zero interval, with subsequent points specifying the 4165 // same start time and increasing end times, until an event resets the 4166 // cumulative value to zero and sets a new start time for the following points. 4167 Interval *TimeInterval `json:"interval,omitempty"` 4168 // Value: The value of the data point. 4169 Value *TypedValue `json:"value,omitempty"` 4170 // ForceSendFields is a list of field names (e.g. "Interval") to 4171 // unconditionally include in API requests. By default, fields with empty or 4172 // default values are omitted from API requests. See 4173 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4174 // details. 4175 ForceSendFields []string `json:"-"` 4176 // NullFields is a list of field names (e.g. "Interval") to include in API 4177 // requests with the JSON null value. By default, fields with empty values are 4178 // omitted from API requests. See 4179 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4180 NullFields []string `json:"-"` 4181 } 4182 4183 func (s *Point) MarshalJSON() ([]byte, error) { 4184 type NoMethod Point 4185 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4186 } 4187 4188 // PointData: A point's value columns and time interval. Each point has one or 4189 // more point values corresponding to the entries in point_descriptors field in 4190 // the TimeSeriesDescriptor associated with this object. 4191 type PointData struct { 4192 // TimeInterval: The time interval associated with the point. 4193 TimeInterval *TimeInterval `json:"timeInterval,omitempty"` 4194 // Values: The values that make up the point. 4195 Values []*TypedValue `json:"values,omitempty"` 4196 // ForceSendFields is a list of field names (e.g. "TimeInterval") to 4197 // unconditionally include in API requests. By default, fields with empty or 4198 // default values are omitted from API requests. See 4199 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4200 // details. 4201 ForceSendFields []string `json:"-"` 4202 // NullFields is a list of field names (e.g. "TimeInterval") to include in API 4203 // requests with the JSON null value. By default, fields with empty values are 4204 // omitted from API requests. See 4205 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4206 NullFields []string `json:"-"` 4207 } 4208 4209 func (s *PointData) MarshalJSON() ([]byte, error) { 4210 type NoMethod PointData 4211 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4212 } 4213 4214 // PrometheusQueryLanguageCondition: A condition type that allows alert 4215 // policies to be defined using Prometheus Query Language (PromQL) 4216 // (https://prometheus.io/docs/prometheus/latest/querying/basics/).The 4217 // PrometheusQueryLanguageCondition message contains information from a 4218 // Prometheus alerting rule and its associated rule group.A Prometheus alerting 4219 // rule is described here 4220 // (https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/). 4221 // The semantics of a Prometheus alerting rule is described here 4222 // (https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule).A 4223 // Prometheus rule group is described here 4224 // (https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/). 4225 // The semantics of a Prometheus rule group is described here 4226 // (https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule_group).Because 4227 // Cloud Alerting has no representation of a Prometheus rule group resource, we 4228 // must embed the information of the parent rule group inside each of the 4229 // conditions that refer to it. We must also update the contents of all 4230 // Prometheus alerts in case the information of their rule group changes.The 4231 // PrometheusQueryLanguageCondition protocol buffer combines the information of 4232 // the corresponding rule group and alerting rule. The structure of the 4233 // PrometheusQueryLanguageCondition protocol buffer does NOT mimic the 4234 // structure of the Prometheus rule group and alerting rule YAML declarations. 4235 // The PrometheusQueryLanguageCondition protocol buffer may change in the 4236 // future to support future rule group and/or alerting rule features. There are 4237 // no new such features at the present time (2023-06-26). 4238 type PrometheusQueryLanguageCondition struct { 4239 // AlertRule: Optional. The alerting rule name of this alert in the 4240 // corresponding Prometheus configuration file.Some external tools may require 4241 // this field to be populated correctly in order to refer to the original 4242 // Prometheus configuration file. The rule group name and the alert name are 4243 // necessary to update the relevant AlertPolicies in case the definition of the 4244 // rule group changes in the future.This field is optional. If this field is 4245 // not empty, then it must be a valid Prometheus label name 4246 // (https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). 4247 // This field may not exceed 2048 Unicode characters in length. 4248 AlertRule string `json:"alertRule,omitempty"` 4249 // Duration: Optional. Alerts are considered firing once their PromQL 4250 // expression was evaluated to be "true" for this long. Alerts whose PromQL 4251 // expression was not evaluated to be "true" for long enough are considered 4252 // pending. Must be a non-negative duration or missing. This field is optional. 4253 // Its default value is zero. 4254 Duration string `json:"duration,omitempty"` 4255 // EvaluationInterval: Optional. How often this rule should be evaluated. Must 4256 // be a positive multiple of 30 seconds or missing. This field is optional. Its 4257 // default value is 30 seconds. If this PrometheusQueryLanguageCondition was 4258 // generated from a Prometheus alerting rule, then this value should be taken 4259 // from the enclosing rule group. 4260 EvaluationInterval string `json:"evaluationInterval,omitempty"` 4261 // Labels: Optional. Labels to add to or overwrite in the PromQL query result. 4262 // Label names must be valid 4263 // (https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). 4264 // Label values can be templatized by using variables 4265 // (https://cloud.google.com/monitoring/alerts/doc-variables). The only 4266 // available variable names are the names of the labels in the PromQL result, 4267 // including "__name__" and "value". "labels" may be empty. 4268 Labels map[string]string `json:"labels,omitempty"` 4269 // Query: Required. The PromQL expression to evaluate. Every evaluation cycle 4270 // this expression is evaluated at the current time, and all resultant time 4271 // series become pending/firing alerts. This field must not be empty. 4272 Query string `json:"query,omitempty"` 4273 // RuleGroup: Optional. The rule group name of this alert in the corresponding 4274 // Prometheus configuration file.Some external tools may require this field to 4275 // be populated correctly in order to refer to the original Prometheus 4276 // configuration file. The rule group name and the alert name are necessary to 4277 // update the relevant AlertPolicies in case the definition of the rule group 4278 // changes in the future.This field is optional. If this field is not empty, 4279 // then it must contain a valid UTF-8 string. This field may not exceed 2048 4280 // Unicode characters in length. 4281 RuleGroup string `json:"ruleGroup,omitempty"` 4282 // ForceSendFields is a list of field names (e.g. "AlertRule") to 4283 // unconditionally include in API requests. By default, fields with empty or 4284 // default values are omitted from API requests. See 4285 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4286 // details. 4287 ForceSendFields []string `json:"-"` 4288 // NullFields is a list of field names (e.g. "AlertRule") to include in API 4289 // requests with the JSON null value. By default, fields with empty values are 4290 // omitted from API requests. See 4291 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4292 NullFields []string `json:"-"` 4293 } 4294 4295 func (s *PrometheusQueryLanguageCondition) MarshalJSON() ([]byte, error) { 4296 type NoMethod PrometheusQueryLanguageCondition 4297 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4298 } 4299 4300 // QueryTimeSeriesRequest: The QueryTimeSeries request. 4301 type QueryTimeSeriesRequest struct { 4302 // PageSize: A positive number that is the maximum number of time_series_data 4303 // to return. 4304 PageSize int64 `json:"pageSize,omitempty"` 4305 // PageToken: If this field is not empty then it must contain the nextPageToken 4306 // value returned by a previous call to this method. Using this field causes 4307 // the method to return additional results from the previous method call. 4308 PageToken string `json:"pageToken,omitempty"` 4309 // Query: Required. The query in the Monitoring Query Language 4310 // (https://cloud.google.com/monitoring/mql/reference) format. The default time 4311 // zone is in UTC. 4312 Query string `json:"query,omitempty"` 4313 // ForceSendFields is a list of field names (e.g. "PageSize") to 4314 // unconditionally include in API requests. By default, fields with empty or 4315 // default values are omitted from API requests. See 4316 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4317 // details. 4318 ForceSendFields []string `json:"-"` 4319 // NullFields is a list of field names (e.g. "PageSize") to include in API 4320 // requests with the JSON null value. By default, fields with empty values are 4321 // omitted from API requests. See 4322 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4323 NullFields []string `json:"-"` 4324 } 4325 4326 func (s *QueryTimeSeriesRequest) MarshalJSON() ([]byte, error) { 4327 type NoMethod QueryTimeSeriesRequest 4328 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4329 } 4330 4331 // QueryTimeSeriesResponse: The QueryTimeSeries response. 4332 type QueryTimeSeriesResponse struct { 4333 // NextPageToken: If there are more results than have been returned, then this 4334 // field is set to a non-empty value. To see the additional results, use that 4335 // value as page_token in the next call to this method. 4336 NextPageToken string `json:"nextPageToken,omitempty"` 4337 // PartialErrors: Query execution errors that may have caused the time series 4338 // data returned to be incomplete. The available data will be available in the 4339 // response. 4340 PartialErrors []*Status `json:"partialErrors,omitempty"` 4341 // TimeSeriesData: The time series data. 4342 TimeSeriesData []*TimeSeriesData `json:"timeSeriesData,omitempty"` 4343 // TimeSeriesDescriptor: The descriptor for the time series data. 4344 TimeSeriesDescriptor *TimeSeriesDescriptor `json:"timeSeriesDescriptor,omitempty"` 4345 4346 // ServerResponse contains the HTTP response code and headers from the server. 4347 googleapi.ServerResponse `json:"-"` 4348 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 4349 // unconditionally include in API requests. By default, fields with empty or 4350 // default values are omitted from API requests. See 4351 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4352 // details. 4353 ForceSendFields []string `json:"-"` 4354 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 4355 // requests with the JSON null value. By default, fields with empty values are 4356 // omitted from API requests. See 4357 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4358 NullFields []string `json:"-"` 4359 } 4360 4361 func (s *QueryTimeSeriesResponse) MarshalJSON() ([]byte, error) { 4362 type NoMethod QueryTimeSeriesResponse 4363 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4364 } 4365 4366 // Range: The range of the population values. 4367 type Range struct { 4368 // Max: The maximum of the population values. 4369 Max float64 `json:"max,omitempty"` 4370 // Min: The minimum of the population values. 4371 Min float64 `json:"min,omitempty"` 4372 // ForceSendFields is a list of field names (e.g. "Max") to unconditionally 4373 // include in API requests. By default, fields with empty or default values are 4374 // omitted from API requests. See 4375 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4376 // details. 4377 ForceSendFields []string `json:"-"` 4378 // NullFields is a list of field names (e.g. "Max") to include in API requests 4379 // with the JSON null value. By default, fields with empty values are omitted 4380 // from API requests. See 4381 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4382 NullFields []string `json:"-"` 4383 } 4384 4385 func (s *Range) MarshalJSON() ([]byte, error) { 4386 type NoMethod Range 4387 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4388 } 4389 4390 func (s *Range) UnmarshalJSON(data []byte) error { 4391 type NoMethod Range 4392 var s1 struct { 4393 Max gensupport.JSONFloat64 `json:"max"` 4394 Min gensupport.JSONFloat64 `json:"min"` 4395 *NoMethod 4396 } 4397 s1.NoMethod = (*NoMethod)(s) 4398 if err := json.Unmarshal(data, &s1); err != nil { 4399 return err 4400 } 4401 s.Max = float64(s1.Max) 4402 s.Min = float64(s1.Min) 4403 return nil 4404 } 4405 4406 // RequestBasedSli: Service Level Indicators for which atomic units of service 4407 // are counted directly. 4408 type RequestBasedSli struct { 4409 // DistributionCut: distribution_cut is used when good_service is a count of 4410 // values aggregated in a Distribution that fall into a good range. The 4411 // total_service is the total count of all values aggregated in the 4412 // Distribution. 4413 DistributionCut *DistributionCut `json:"distributionCut,omitempty"` 4414 // GoodTotalRatio: good_total_ratio is used when the ratio of good_service to 4415 // total_service is computed from two TimeSeries. 4416 GoodTotalRatio *TimeSeriesRatio `json:"goodTotalRatio,omitempty"` 4417 // ForceSendFields is a list of field names (e.g. "DistributionCut") to 4418 // unconditionally include in API requests. By default, fields with empty or 4419 // default values are omitted from API requests. See 4420 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4421 // details. 4422 ForceSendFields []string `json:"-"` 4423 // NullFields is a list of field names (e.g. "DistributionCut") to include in 4424 // API requests with the JSON null value. By default, fields with empty values 4425 // are omitted from API requests. See 4426 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4427 NullFields []string `json:"-"` 4428 } 4429 4430 func (s *RequestBasedSli) MarshalJSON() ([]byte, error) { 4431 type NoMethod RequestBasedSli 4432 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4433 } 4434 4435 // ResourceGroup: The resource submessage for group checks. It can be used 4436 // instead of a monitored resource, when multiple resources are being 4437 // monitored. 4438 type ResourceGroup struct { 4439 // GroupId: The group of resources being monitored. Should be only the 4440 // [GROUP_ID], and not the full-path 4441 // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]. 4442 GroupId string `json:"groupId,omitempty"` 4443 // ResourceType: The resource type of the group members. 4444 // 4445 // Possible values: 4446 // "RESOURCE_TYPE_UNSPECIFIED" - Default value (not valid). 4447 // "INSTANCE" - A group of instances from Google Cloud Platform (GCP) or 4448 // Amazon Web Services (AWS). 4449 // "AWS_ELB_LOAD_BALANCER" - A group of Amazon ELB load balancers. 4450 ResourceType string `json:"resourceType,omitempty"` 4451 // ForceSendFields is a list of field names (e.g. "GroupId") to unconditionally 4452 // include in API requests. By default, fields with empty or default values are 4453 // omitted from API requests. See 4454 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4455 // details. 4456 ForceSendFields []string `json:"-"` 4457 // NullFields is a list of field names (e.g. "GroupId") to include in API 4458 // requests with the JSON null value. By default, fields with empty values are 4459 // omitted from API requests. See 4460 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4461 NullFields []string `json:"-"` 4462 } 4463 4464 func (s *ResourceGroup) MarshalJSON() ([]byte, error) { 4465 type NoMethod ResourceGroup 4466 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4467 } 4468 4469 // ResponseStatusCode: A status to accept. Either a status code class like 4470 // "2xx", or an integer status code like "200". 4471 type ResponseStatusCode struct { 4472 // StatusClass: A class of status codes to accept. 4473 // 4474 // Possible values: 4475 // "STATUS_CLASS_UNSPECIFIED" - Default value that matches no status codes. 4476 // "STATUS_CLASS_1XX" - The class of status codes between 100 and 199. 4477 // "STATUS_CLASS_2XX" - The class of status codes between 200 and 299. 4478 // "STATUS_CLASS_3XX" - The class of status codes between 300 and 399. 4479 // "STATUS_CLASS_4XX" - The class of status codes between 400 and 499. 4480 // "STATUS_CLASS_5XX" - The class of status codes between 500 and 599. 4481 // "STATUS_CLASS_ANY" - The class of all status codes. 4482 StatusClass string `json:"statusClass,omitempty"` 4483 // StatusValue: A status code to accept. 4484 StatusValue int64 `json:"statusValue,omitempty"` 4485 // ForceSendFields is a list of field names (e.g. "StatusClass") to 4486 // unconditionally include in API requests. By default, fields with empty or 4487 // default values are omitted from API requests. See 4488 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4489 // details. 4490 ForceSendFields []string `json:"-"` 4491 // NullFields is a list of field names (e.g. "StatusClass") to include in API 4492 // requests with the JSON null value. By default, fields with empty values are 4493 // omitted from API requests. See 4494 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4495 NullFields []string `json:"-"` 4496 } 4497 4498 func (s *ResponseStatusCode) MarshalJSON() ([]byte, error) { 4499 type NoMethod ResponseStatusCode 4500 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4501 } 4502 4503 // SendNotificationChannelVerificationCodeRequest: The 4504 // SendNotificationChannelVerificationCode request. 4505 type SendNotificationChannelVerificationCodeRequest struct { 4506 } 4507 4508 // MService: A Service is a discrete, autonomous, and network-accessible unit, 4509 // designed to solve an individual concern (Wikipedia 4510 // (https://en.wikipedia.org/wiki/Service-orientation)). In Cloud Monitoring, a 4511 // Service acts as the root resource under which operational aspects of the 4512 // service are accessible. 4513 type MService struct { 4514 // AppEngine: Type used for App Engine services. 4515 AppEngine *AppEngine `json:"appEngine,omitempty"` 4516 // BasicService: Message that contains the service type and service labels of 4517 // this service if it is a basic service. Documentation and examples here 4518 // (https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli). 4519 BasicService *BasicService `json:"basicService,omitempty"` 4520 // CloudEndpoints: Type used for Cloud Endpoints services. 4521 CloudEndpoints *CloudEndpoints `json:"cloudEndpoints,omitempty"` 4522 // CloudRun: Type used for Cloud Run services. 4523 CloudRun *CloudRun `json:"cloudRun,omitempty"` 4524 // ClusterIstio: Type used for Istio services that live in a Kubernetes 4525 // cluster. 4526 ClusterIstio *ClusterIstio `json:"clusterIstio,omitempty"` 4527 // Custom: Custom service type. 4528 Custom *Custom `json:"custom,omitempty"` 4529 // DisplayName: Name used for UI elements listing this Service. 4530 DisplayName string `json:"displayName,omitempty"` 4531 // GkeNamespace: Type used for GKE Namespaces. 4532 GkeNamespace *GkeNamespace `json:"gkeNamespace,omitempty"` 4533 // GkeService: Type used for GKE Services (the Kubernetes concept of a 4534 // service). 4535 GkeService *GkeService `json:"gkeService,omitempty"` 4536 // GkeWorkload: Type used for GKE Workloads. 4537 GkeWorkload *GkeWorkload `json:"gkeWorkload,omitempty"` 4538 // IstioCanonicalService: Type used for canonical services scoped to an Istio 4539 // mesh. Metrics for Istio are documented here 4540 // (https://istio.io/latest/docs/reference/config/metrics/) 4541 IstioCanonicalService *IstioCanonicalService `json:"istioCanonicalService,omitempty"` 4542 // MeshIstio: Type used for Istio services scoped to an Istio mesh. 4543 MeshIstio *MeshIstio `json:"meshIstio,omitempty"` 4544 // Name: Identifier. Resource name for this Service. The format is: 4545 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] 4546 Name string `json:"name,omitempty"` 4547 // Telemetry: Configuration for how to query telemetry on a Service. 4548 Telemetry *Telemetry `json:"telemetry,omitempty"` 4549 // UserLabels: Labels which have been used to annotate the service. Label keys 4550 // must start with a letter. Label keys and values may contain lowercase 4551 // letters, numbers, underscores, and dashes. Label keys and values have a 4552 // maximum length of 63 characters, and must be less than 128 bytes in size. Up 4553 // to 64 label entries may be stored. For labels which do not have a semantic 4554 // value, the empty string may be supplied for the label value. 4555 UserLabels map[string]string `json:"userLabels,omitempty"` 4556 4557 // ServerResponse contains the HTTP response code and headers from the server. 4558 googleapi.ServerResponse `json:"-"` 4559 // ForceSendFields is a list of field names (e.g. "AppEngine") to 4560 // unconditionally include in API requests. By default, fields with empty or 4561 // default values are omitted from API requests. See 4562 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4563 // details. 4564 ForceSendFields []string `json:"-"` 4565 // NullFields is a list of field names (e.g. "AppEngine") to include in API 4566 // requests with the JSON null value. By default, fields with empty values are 4567 // omitted from API requests. See 4568 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4569 NullFields []string `json:"-"` 4570 } 4571 4572 func (s *MService) MarshalJSON() ([]byte, error) { 4573 type NoMethod MService 4574 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4575 } 4576 4577 // ServiceAgentAuthentication: Contains information needed for generating 4578 // either an OpenID Connect token 4579 // (https://developers.google.com/identity/protocols/OpenIDConnect) or OAuth 4580 // token (https://developers.google.com/identity/protocols/oauth2). The token 4581 // will be generated for the Monitoring service agent service account. 4582 type ServiceAgentAuthentication struct { 4583 // Type: Type of authentication. 4584 // 4585 // Possible values: 4586 // "SERVICE_AGENT_AUTHENTICATION_TYPE_UNSPECIFIED" - Default value, will 4587 // result in OIDC Authentication. 4588 // "OIDC_TOKEN" - OIDC Authentication 4589 Type string `json:"type,omitempty"` 4590 // ForceSendFields is a list of field names (e.g. "Type") to unconditionally 4591 // include in API requests. By default, fields with empty or default values are 4592 // omitted from API requests. See 4593 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4594 // details. 4595 ForceSendFields []string `json:"-"` 4596 // NullFields is a list of field names (e.g. "Type") to include in API requests 4597 // with the JSON null value. By default, fields with empty values are omitted 4598 // from API requests. See 4599 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4600 NullFields []string `json:"-"` 4601 } 4602 4603 func (s *ServiceAgentAuthentication) MarshalJSON() ([]byte, error) { 4604 type NoMethod ServiceAgentAuthentication 4605 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4606 } 4607 4608 // ServiceLevelIndicator: A Service-Level Indicator (SLI) describes the 4609 // "performance" of a service. For some services, the SLI is well-defined. In 4610 // such cases, the SLI can be described easily by referencing the well-known 4611 // SLI and providing the needed parameters. Alternatively, a "custom" SLI can 4612 // be defined with a query to the underlying metric store. An SLI is defined to 4613 // be good_service / total_service over any queried time interval. The value of 4614 // performance always falls into the range 0 <= performance <= 1. A custom SLI 4615 // describes how to compute this ratio, whether this is by dividing values from 4616 // a pair of time series, cutting a Distribution into good and bad counts, or 4617 // counting time windows in which the service complies with a criterion. For 4618 // separation of concerns, a single Service-Level Indicator measures 4619 // performance for only one aspect of service quality, such as fraction of 4620 // successful queries or fast-enough queries. 4621 type ServiceLevelIndicator struct { 4622 // BasicSli: Basic SLI on a well-known service type. 4623 BasicSli *BasicSli `json:"basicSli,omitempty"` 4624 // RequestBased: Request-based SLIs 4625 RequestBased *RequestBasedSli `json:"requestBased,omitempty"` 4626 // WindowsBased: Windows-based SLIs 4627 WindowsBased *WindowsBasedSli `json:"windowsBased,omitempty"` 4628 // ForceSendFields is a list of field names (e.g. "BasicSli") to 4629 // unconditionally include in API requests. By default, fields with empty or 4630 // default values are omitted from API requests. See 4631 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4632 // details. 4633 ForceSendFields []string `json:"-"` 4634 // NullFields is a list of field names (e.g. "BasicSli") to include in API 4635 // requests with the JSON null value. By default, fields with empty values are 4636 // omitted from API requests. See 4637 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4638 NullFields []string `json:"-"` 4639 } 4640 4641 func (s *ServiceLevelIndicator) MarshalJSON() ([]byte, error) { 4642 type NoMethod ServiceLevelIndicator 4643 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4644 } 4645 4646 // ServiceLevelObjective: A Service-Level Objective (SLO) describes a level of 4647 // desired good service. It consists of a service-level indicator (SLI), a 4648 // performance goal, and a period over which the objective is to be evaluated 4649 // against that goal. The SLO can use SLIs defined in a number of different 4650 // manners. Typical SLOs might include "99% of requests in each rolling week 4651 // have latency below 200 milliseconds" or "99.5% of requests in each calendar 4652 // month return successfully." 4653 type ServiceLevelObjective struct { 4654 // CalendarPeriod: A calendar period, semantically "since the start of the 4655 // current ". At this time, only DAY, WEEK, FORTNIGHT, and MONTH are supported. 4656 // 4657 // Possible values: 4658 // "CALENDAR_PERIOD_UNSPECIFIED" - Undefined period, raises an error. 4659 // "DAY" - A day. 4660 // "WEEK" - A week. Weeks begin on Monday, following ISO 8601 4661 // (https://en.wikipedia.org/wiki/ISO_week_date). 4662 // "FORTNIGHT" - A fortnight. The first calendar fortnight of the year begins 4663 // at the start of week 1 according to ISO 8601 4664 // (https://en.wikipedia.org/wiki/ISO_week_date). 4665 // "MONTH" - A month. 4666 // "QUARTER" - A quarter. Quarters start on dates 1-Jan, 1-Apr, 1-Jul, and 4667 // 1-Oct of each year. 4668 // "HALF" - A half-year. Half-years start on dates 1-Jan and 1-Jul. 4669 // "YEAR" - A year. 4670 CalendarPeriod string `json:"calendarPeriod,omitempty"` 4671 // DisplayName: Name used for UI elements listing this SLO. 4672 DisplayName string `json:"displayName,omitempty"` 4673 // Goal: The fraction of service that must be good in order for this objective 4674 // to be met. 0 < goal <= 0.999. 4675 Goal float64 `json:"goal,omitempty"` 4676 // Name: Identifier. Resource name for this ServiceLevelObjective. The format 4677 // is: 4678 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/ 4679 // [SLO_NAME] 4680 Name string `json:"name,omitempty"` 4681 // RollingPeriod: A rolling time period, semantically "in the past ". Must be 4682 // an integer multiple of 1 day no larger than 30 days. 4683 RollingPeriod string `json:"rollingPeriod,omitempty"` 4684 // ServiceLevelIndicator: The definition of good service, used to measure and 4685 // calculate the quality of the Service's performance with respect to a single 4686 // aspect of service quality. 4687 ServiceLevelIndicator *ServiceLevelIndicator `json:"serviceLevelIndicator,omitempty"` 4688 // UserLabels: Labels which have been used to annotate the service-level 4689 // objective. Label keys must start with a letter. Label keys and values may 4690 // contain lowercase letters, numbers, underscores, and dashes. Label keys and 4691 // values have a maximum length of 63 characters, and must be less than 128 4692 // bytes in size. Up to 64 label entries may be stored. For labels which do not 4693 // have a semantic value, the empty string may be supplied for the label value. 4694 UserLabels map[string]string `json:"userLabels,omitempty"` 4695 4696 // ServerResponse contains the HTTP response code and headers from the server. 4697 googleapi.ServerResponse `json:"-"` 4698 // ForceSendFields is a list of field names (e.g. "CalendarPeriod") to 4699 // unconditionally include in API requests. By default, fields with empty or 4700 // default values are omitted from API requests. See 4701 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4702 // details. 4703 ForceSendFields []string `json:"-"` 4704 // NullFields is a list of field names (e.g. "CalendarPeriod") to include in 4705 // API requests with the JSON null value. By default, fields with empty values 4706 // are omitted from API requests. See 4707 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4708 NullFields []string `json:"-"` 4709 } 4710 4711 func (s *ServiceLevelObjective) MarshalJSON() ([]byte, error) { 4712 type NoMethod ServiceLevelObjective 4713 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4714 } 4715 4716 func (s *ServiceLevelObjective) UnmarshalJSON(data []byte) error { 4717 type NoMethod ServiceLevelObjective 4718 var s1 struct { 4719 Goal gensupport.JSONFloat64 `json:"goal"` 4720 *NoMethod 4721 } 4722 s1.NoMethod = (*NoMethod)(s) 4723 if err := json.Unmarshal(data, &s1); err != nil { 4724 return err 4725 } 4726 s.Goal = float64(s1.Goal) 4727 return nil 4728 } 4729 4730 // Snooze: A Snooze will prevent any alerts from being opened, and close any 4731 // that are already open. The Snooze will work on alerts that match the 4732 // criteria defined in the Snooze. The Snooze will be active from 4733 // interval.start_time through interval.end_time. 4734 type Snooze struct { 4735 // Criteria: Required. This defines the criteria for applying the Snooze. See 4736 // Criteria for more information. 4737 Criteria *Criteria `json:"criteria,omitempty"` 4738 // DisplayName: Required. A display name for the Snooze. This can be, at most, 4739 // 512 unicode characters. 4740 DisplayName string `json:"displayName,omitempty"` 4741 // Interval: Required. The Snooze will be active from interval.start_time 4742 // through interval.end_time. interval.start_time cannot be in the past. There 4743 // is a 15 second clock skew to account for the time it takes for a request to 4744 // reach the API from the UI. 4745 Interval *TimeInterval `json:"interval,omitempty"` 4746 // Name: Required. The name of the Snooze. The format is: 4747 // projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] The ID of the Snooze 4748 // will be generated by the system. 4749 Name string `json:"name,omitempty"` 4750 4751 // ServerResponse contains the HTTP response code and headers from the server. 4752 googleapi.ServerResponse `json:"-"` 4753 // ForceSendFields is a list of field names (e.g. "Criteria") to 4754 // unconditionally include in API requests. By default, fields with empty or 4755 // default values are omitted from API requests. See 4756 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4757 // details. 4758 ForceSendFields []string `json:"-"` 4759 // NullFields is a list of field names (e.g. "Criteria") to include in API 4760 // requests with the JSON null value. By default, fields with empty values are 4761 // omitted from API requests. See 4762 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4763 NullFields []string `json:"-"` 4764 } 4765 4766 func (s *Snooze) MarshalJSON() ([]byte, error) { 4767 type NoMethod Snooze 4768 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4769 } 4770 4771 // SourceContext: SourceContext represents information about the source of a 4772 // protobuf element, like the file in which it is defined. 4773 type SourceContext struct { 4774 // FileName: The path-qualified name of the .proto file that contained the 4775 // associated protobuf element. For example: 4776 // "google/protobuf/source_context.proto". 4777 FileName string `json:"fileName,omitempty"` 4778 // ForceSendFields is a list of field names (e.g. "FileName") to 4779 // unconditionally include in API requests. By default, fields with empty or 4780 // default values are omitted from API requests. See 4781 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4782 // details. 4783 ForceSendFields []string `json:"-"` 4784 // NullFields is a list of field names (e.g. "FileName") to include in API 4785 // requests with the JSON null value. By default, fields with empty values are 4786 // omitted from API requests. See 4787 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4788 NullFields []string `json:"-"` 4789 } 4790 4791 func (s *SourceContext) MarshalJSON() ([]byte, error) { 4792 type NoMethod SourceContext 4793 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4794 } 4795 4796 // SpanContext: The context of a span. This is attached to an Exemplar in 4797 // Distribution values during aggregation.It contains the name of a span with 4798 // format: projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] 4799 type SpanContext struct { 4800 // SpanName: The resource name of the span. The format is: 4801 // projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID] [TRACE_ID] 4802 // is a unique identifier for a trace within a project; it is a 32-character 4803 // hexadecimal encoding of a 16-byte array.[SPAN_ID] is a unique identifier for 4804 // a span within a trace; it is a 16-character hexadecimal encoding of an 4805 // 8-byte array. 4806 SpanName string `json:"spanName,omitempty"` 4807 // ForceSendFields is a list of field names (e.g. "SpanName") to 4808 // unconditionally include in API requests. By default, fields with empty or 4809 // default values are omitted from API requests. See 4810 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4811 // details. 4812 ForceSendFields []string `json:"-"` 4813 // NullFields is a list of field names (e.g. "SpanName") to include in API 4814 // requests with the JSON null value. By default, fields with empty values are 4815 // omitted from API requests. See 4816 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4817 NullFields []string `json:"-"` 4818 } 4819 4820 func (s *SpanContext) MarshalJSON() ([]byte, error) { 4821 type NoMethod SpanContext 4822 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4823 } 4824 4825 // Status: The Status type defines a logical error model that is suitable for 4826 // different programming environments, including REST APIs and RPC APIs. It is 4827 // used by gRPC (https://github.com/grpc). Each Status message contains three 4828 // pieces of data: error code, error message, and error details.You can find 4829 // out more about this error model and how to work with it in the API Design 4830 // Guide (https://cloud.google.com/apis/design/errors). 4831 type Status struct { 4832 // Code: The status code, which should be an enum value of google.rpc.Code. 4833 Code int64 `json:"code,omitempty"` 4834 // Details: A list of messages that carry the error details. There is a common 4835 // set of message types for APIs to use. 4836 Details []googleapi.RawMessage `json:"details,omitempty"` 4837 // Message: A developer-facing error message, which should be in English. Any 4838 // user-facing error message should be localized and sent in the 4839 // google.rpc.Status.details field, or localized by the client. 4840 Message string `json:"message,omitempty"` 4841 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 4842 // include in API requests. By default, fields with empty or default values are 4843 // omitted from API requests. See 4844 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4845 // details. 4846 ForceSendFields []string `json:"-"` 4847 // NullFields is a list of field names (e.g. "Code") to include in API requests 4848 // with the JSON null value. By default, fields with empty values are omitted 4849 // from API requests. See 4850 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4851 NullFields []string `json:"-"` 4852 } 4853 4854 func (s *Status) MarshalJSON() ([]byte, error) { 4855 type NoMethod Status 4856 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4857 } 4858 4859 // SyntheticMonitorTarget: Describes a Synthetic Monitor to be invoked by 4860 // Uptime. 4861 type SyntheticMonitorTarget struct { 4862 // CloudFunctionV2: Target a Synthetic Monitor GCFv2 instance. 4863 CloudFunctionV2 *CloudFunctionV2Target `json:"cloudFunctionV2,omitempty"` 4864 // ForceSendFields is a list of field names (e.g. "CloudFunctionV2") to 4865 // unconditionally include in API requests. By default, fields with empty or 4866 // default values are omitted from API requests. See 4867 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4868 // details. 4869 ForceSendFields []string `json:"-"` 4870 // NullFields is a list of field names (e.g. "CloudFunctionV2") to include in 4871 // API requests with the JSON null value. By default, fields with empty values 4872 // are omitted from API requests. See 4873 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4874 NullFields []string `json:"-"` 4875 } 4876 4877 func (s *SyntheticMonitorTarget) MarshalJSON() ([]byte, error) { 4878 type NoMethod SyntheticMonitorTarget 4879 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4880 } 4881 4882 // TcpCheck: Information required for a TCP Uptime check request. 4883 type TcpCheck struct { 4884 // PingConfig: Contains information needed to add pings to a TCP check. 4885 PingConfig *PingConfig `json:"pingConfig,omitempty"` 4886 // Port: The TCP port on the server against which to run the check. Will be 4887 // combined with host (specified within the monitored_resource) to construct 4888 // the full URL. Required. 4889 Port int64 `json:"port,omitempty"` 4890 // ForceSendFields is a list of field names (e.g. "PingConfig") to 4891 // unconditionally include in API requests. By default, fields with empty or 4892 // default values are omitted from API requests. See 4893 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4894 // details. 4895 ForceSendFields []string `json:"-"` 4896 // NullFields is a list of field names (e.g. "PingConfig") to include in API 4897 // requests with the JSON null value. By default, fields with empty values are 4898 // omitted from API requests. See 4899 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4900 NullFields []string `json:"-"` 4901 } 4902 4903 func (s *TcpCheck) MarshalJSON() ([]byte, error) { 4904 type NoMethod TcpCheck 4905 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4906 } 4907 4908 // Telemetry: Configuration for how to query telemetry on a Service. 4909 type Telemetry struct { 4910 // ResourceName: The full name of the resource that defines this service. 4911 // Formatted as described in 4912 // https://cloud.google.com/apis/design/resource_names. 4913 ResourceName string `json:"resourceName,omitempty"` 4914 // ForceSendFields is a list of field names (e.g. "ResourceName") to 4915 // unconditionally include in API requests. By default, fields with empty or 4916 // default values are omitted from API requests. See 4917 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4918 // details. 4919 ForceSendFields []string `json:"-"` 4920 // NullFields is a list of field names (e.g. "ResourceName") to include in API 4921 // requests with the JSON null value. By default, fields with empty values are 4922 // omitted from API requests. See 4923 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4924 NullFields []string `json:"-"` 4925 } 4926 4927 func (s *Telemetry) MarshalJSON() ([]byte, error) { 4928 type NoMethod Telemetry 4929 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4930 } 4931 4932 // TimeInterval: Describes a time interval: Reads: A half-open time interval. 4933 // It includes the end time but excludes the start time: (startTime, endTime]. 4934 // The start time must be specified, must be earlier than the end time, and 4935 // should be no older than the data retention period for the metric. Writes: A 4936 // closed time interval. It extends from the start time to the end time, and 4937 // includes both: [startTime, endTime]. Valid time intervals depend on the 4938 // MetricKind 4939 // (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind) 4940 // of the metric value. The end time must not be earlier than the start time, 4941 // and the end time must not be more than 25 hours in the past or more than 4942 // five minutes in the future. For GAUGE metrics, the startTime value is 4943 // technically optional; if no value is specified, the start time defaults to 4944 // the value of the end time, and the interval represents a single point in 4945 // time. If both start and end times are specified, they must be identical. 4946 // Such an interval is valid only for GAUGE metrics, which are point-in-time 4947 // measurements. The end time of a new interval must be at least a millisecond 4948 // after the end time of the previous interval. For DELTA metrics, the start 4949 // time and end time must specify a non-zero interval, with subsequent points 4950 // specifying contiguous and non-overlapping intervals. For DELTA metrics, the 4951 // start time of the next interval must be at least a millisecond after the end 4952 // time of the previous interval. For CUMULATIVE metrics, the start time and 4953 // end time must specify a non-zero interval, with subsequent points specifying 4954 // the same start time and increasing end times, until an event resets the 4955 // cumulative value to zero and sets a new start time for the following points. 4956 // The new start time must be at least a millisecond after the end time of the 4957 // previous interval. The start time of a new interval must be at least a 4958 // millisecond after the end time of the previous interval because intervals 4959 // are closed. If the start time of a new interval is the same as the end time 4960 // of the previous interval, then data written at the new start time could 4961 // overwrite data written at the previous end time. 4962 type TimeInterval struct { 4963 // EndTime: Required. The end of the time interval. 4964 EndTime string `json:"endTime,omitempty"` 4965 // StartTime: Optional. The beginning of the time interval. The default value 4966 // for the start time is the end time. The start time must not be later than 4967 // the end time. 4968 StartTime string `json:"startTime,omitempty"` 4969 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 4970 // include in API requests. By default, fields with empty or default values are 4971 // omitted from API requests. See 4972 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4973 // details. 4974 ForceSendFields []string `json:"-"` 4975 // NullFields is a list of field names (e.g. "EndTime") to include in API 4976 // requests with the JSON null value. By default, fields with empty values are 4977 // omitted from API requests. See 4978 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4979 NullFields []string `json:"-"` 4980 } 4981 4982 func (s *TimeInterval) MarshalJSON() ([]byte, error) { 4983 type NoMethod TimeInterval 4984 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4985 } 4986 4987 // TimeSeries: A collection of data points that describes the time-varying 4988 // values of a metric. A time series is identified by a combination of a 4989 // fully-specified monitored resource and a fully-specified metric. This type 4990 // is used for both listing and creating time series. 4991 type TimeSeries struct { 4992 // Metadata: Output only. The associated monitored resource metadata. When 4993 // reading a time series, this field will include metadata labels that are 4994 // explicitly named in the reduction. When creating a time series, this field 4995 // is ignored. 4996 Metadata *MonitoredResourceMetadata `json:"metadata,omitempty"` 4997 // Metric: The associated metric. A fully-specified metric used to identify the 4998 // time series. 4999 Metric *Metric `json:"metric,omitempty"` 5000 // MetricKind: The metric kind of the time series. When listing time series, 5001 // this metric kind might be different from the metric kind of the associated 5002 // metric if this time series is an alignment or reduction of other time 5003 // series.When creating a time series, this field is optional. If present, it 5004 // must be the same as the metric kind of the associated metric. If the 5005 // associated metric's descriptor must be auto-created, then this field 5006 // specifies the metric kind of the new descriptor and must be either GAUGE 5007 // (the default) or CUMULATIVE. 5008 // 5009 // Possible values: 5010 // "METRIC_KIND_UNSPECIFIED" - Do not use this default value. 5011 // "GAUGE" - An instantaneous measurement of a value. 5012 // "DELTA" - The change in a value during a time interval. 5013 // "CUMULATIVE" - A value accumulated over a time interval. Cumulative 5014 // measurements in a time series should have the same start time and increasing 5015 // end times, until an event resets the cumulative value to zero and sets a new 5016 // start time for the following points. 5017 MetricKind string `json:"metricKind,omitempty"` 5018 // Points: The data points of this time series. When listing time series, 5019 // points are returned in reverse time order.When creating a time series, this 5020 // field must contain exactly one point and the point's type must be the same 5021 // as the value type of the associated metric. If the associated metric's 5022 // descriptor must be auto-created, then the value type of the descriptor is 5023 // determined by the point's type, which must be BOOL, INT64, DOUBLE, or 5024 // DISTRIBUTION. 5025 Points []*Point `json:"points,omitempty"` 5026 // Resource: The associated monitored resource. Custom metrics can use only 5027 // certain monitored resource types in their time series data. For more 5028 // information, see Monitored resources for custom metrics 5029 // (https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom-metric-resources). 5030 Resource *MonitoredResource `json:"resource,omitempty"` 5031 // Unit: The units in which the metric value is reported. It is only applicable 5032 // if the value_type is INT64, DOUBLE, or DISTRIBUTION. The unit defines the 5033 // representation of the stored metric values. 5034 Unit string `json:"unit,omitempty"` 5035 // ValueType: The value type of the time series. When listing time series, this 5036 // value type might be different from the value type of the associated metric 5037 // if this time series is an alignment or reduction of other time series.When 5038 // creating a time series, this field is optional. If present, it must be the 5039 // same as the type of the data in the points field. 5040 // 5041 // Possible values: 5042 // "VALUE_TYPE_UNSPECIFIED" - Do not use this default value. 5043 // "BOOL" - The value is a boolean. This value type can be used only if the 5044 // metric kind is GAUGE. 5045 // "INT64" - The value is a signed 64-bit integer. 5046 // "DOUBLE" - The value is a double precision floating point number. 5047 // "STRING" - The value is a text string. This value type can be used only if 5048 // the metric kind is GAUGE. 5049 // "DISTRIBUTION" - The value is a Distribution. 5050 // "MONEY" - The value is money. 5051 ValueType string `json:"valueType,omitempty"` 5052 // ForceSendFields is a list of field names (e.g. "Metadata") to 5053 // unconditionally include in API requests. By default, fields with empty or 5054 // default values are omitted from API requests. See 5055 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5056 // details. 5057 ForceSendFields []string `json:"-"` 5058 // NullFields is a list of field names (e.g. "Metadata") to include in API 5059 // requests with the JSON null value. By default, fields with empty values are 5060 // omitted from API requests. See 5061 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5062 NullFields []string `json:"-"` 5063 } 5064 5065 func (s *TimeSeries) MarshalJSON() ([]byte, error) { 5066 type NoMethod TimeSeries 5067 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5068 } 5069 5070 // TimeSeriesData: Represents the values of a time series associated with a 5071 // TimeSeriesDescriptor. 5072 type TimeSeriesData struct { 5073 // LabelValues: The values of the labels in the time series identifier, given 5074 // in the same order as the label_descriptors field of the TimeSeriesDescriptor 5075 // associated with this object. Each value must have a value of the type given 5076 // in the corresponding entry of label_descriptors. 5077 LabelValues []*LabelValue `json:"labelValues,omitempty"` 5078 // PointData: The points in the time series. 5079 PointData []*PointData `json:"pointData,omitempty"` 5080 // ForceSendFields is a list of field names (e.g. "LabelValues") to 5081 // unconditionally include in API requests. By default, fields with empty or 5082 // default values are omitted from API requests. See 5083 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5084 // details. 5085 ForceSendFields []string `json:"-"` 5086 // NullFields is a list of field names (e.g. "LabelValues") to include in API 5087 // requests with the JSON null value. By default, fields with empty values are 5088 // omitted from API requests. See 5089 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5090 NullFields []string `json:"-"` 5091 } 5092 5093 func (s *TimeSeriesData) MarshalJSON() ([]byte, error) { 5094 type NoMethod TimeSeriesData 5095 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5096 } 5097 5098 // TimeSeriesDescriptor: A descriptor for the labels and points in a time 5099 // series. 5100 type TimeSeriesDescriptor struct { 5101 // LabelDescriptors: Descriptors for the labels. 5102 LabelDescriptors []*LabelDescriptor `json:"labelDescriptors,omitempty"` 5103 // PointDescriptors: Descriptors for the point data value columns. 5104 PointDescriptors []*ValueDescriptor `json:"pointDescriptors,omitempty"` 5105 // ForceSendFields is a list of field names (e.g. "LabelDescriptors") to 5106 // unconditionally include in API requests. By default, fields with empty or 5107 // default values are omitted from API requests. See 5108 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5109 // details. 5110 ForceSendFields []string `json:"-"` 5111 // NullFields is a list of field names (e.g. "LabelDescriptors") to include in 5112 // API requests with the JSON null value. By default, fields with empty values 5113 // are omitted from API requests. See 5114 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5115 NullFields []string `json:"-"` 5116 } 5117 5118 func (s *TimeSeriesDescriptor) MarshalJSON() ([]byte, error) { 5119 type NoMethod TimeSeriesDescriptor 5120 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5121 } 5122 5123 // TimeSeriesRatio: A TimeSeriesRatio specifies two TimeSeries to use for 5124 // computing the good_service / total_service ratio. The specified TimeSeries 5125 // must have ValueType = DOUBLE or ValueType = INT64 and must have MetricKind = 5126 // DELTA or MetricKind = CUMULATIVE. The TimeSeriesRatio must specify exactly 5127 // two of good, bad, and total, and the relationship good_service + bad_service 5128 // = total_service will be assumed. 5129 type TimeSeriesRatio struct { 5130 // BadServiceFilter: A monitoring filter 5131 // (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries 5132 // quantifying bad service, either demanded service that was not provided or 5133 // demanded service that was of inadequate quality. Must have ValueType = 5134 // DOUBLE or ValueType = INT64 and must have MetricKind = DELTA or MetricKind = 5135 // CUMULATIVE. 5136 BadServiceFilter string `json:"badServiceFilter,omitempty"` 5137 // GoodServiceFilter: A monitoring filter 5138 // (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries 5139 // quantifying good service provided. Must have ValueType = DOUBLE or ValueType 5140 // = INT64 and must have MetricKind = DELTA or MetricKind = CUMULATIVE. 5141 GoodServiceFilter string `json:"goodServiceFilter,omitempty"` 5142 // TotalServiceFilter: A monitoring filter 5143 // (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries 5144 // quantifying total demanded service. Must have ValueType = DOUBLE or 5145 // ValueType = INT64 and must have MetricKind = DELTA or MetricKind = 5146 // CUMULATIVE. 5147 TotalServiceFilter string `json:"totalServiceFilter,omitempty"` 5148 // ForceSendFields is a list of field names (e.g. "BadServiceFilter") to 5149 // unconditionally include in API requests. By default, fields with empty or 5150 // default values are omitted from API requests. See 5151 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5152 // details. 5153 ForceSendFields []string `json:"-"` 5154 // NullFields is a list of field names (e.g. "BadServiceFilter") to include in 5155 // API requests with the JSON null value. By default, fields with empty values 5156 // are omitted from API requests. See 5157 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5158 NullFields []string `json:"-"` 5159 } 5160 5161 func (s *TimeSeriesRatio) MarshalJSON() ([]byte, error) { 5162 type NoMethod TimeSeriesRatio 5163 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5164 } 5165 5166 // Trigger: Specifies how many time series must fail a predicate to trigger a 5167 // condition. If not specified, then a {count: 1} trigger is used. 5168 type Trigger struct { 5169 // Count: The absolute number of time series that must fail the predicate for 5170 // the condition to be triggered. 5171 Count int64 `json:"count,omitempty"` 5172 // Percent: The percentage of time series that must fail the predicate for the 5173 // condition to be triggered. 5174 Percent float64 `json:"percent,omitempty"` 5175 // ForceSendFields is a list of field names (e.g. "Count") to unconditionally 5176 // include in API requests. By default, fields with empty or default values are 5177 // omitted from API requests. See 5178 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5179 // details. 5180 ForceSendFields []string `json:"-"` 5181 // NullFields is a list of field names (e.g. "Count") to include in API 5182 // requests with the JSON null value. By default, fields with empty values are 5183 // omitted from API requests. See 5184 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5185 NullFields []string `json:"-"` 5186 } 5187 5188 func (s *Trigger) MarshalJSON() ([]byte, error) { 5189 type NoMethod Trigger 5190 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5191 } 5192 5193 func (s *Trigger) UnmarshalJSON(data []byte) error { 5194 type NoMethod Trigger 5195 var s1 struct { 5196 Percent gensupport.JSONFloat64 `json:"percent"` 5197 *NoMethod 5198 } 5199 s1.NoMethod = (*NoMethod)(s) 5200 if err := json.Unmarshal(data, &s1); err != nil { 5201 return err 5202 } 5203 s.Percent = float64(s1.Percent) 5204 return nil 5205 } 5206 5207 // Type: A protocol buffer message type. 5208 type Type struct { 5209 // Edition: The source edition string, only valid when syntax is 5210 // SYNTAX_EDITIONS. 5211 Edition string `json:"edition,omitempty"` 5212 // Fields: The list of fields. 5213 Fields []*Field `json:"fields,omitempty"` 5214 // Name: The fully qualified message name. 5215 Name string `json:"name,omitempty"` 5216 // Oneofs: The list of types appearing in oneof definitions in this type. 5217 Oneofs []string `json:"oneofs,omitempty"` 5218 // Options: The protocol buffer options. 5219 Options []*Option `json:"options,omitempty"` 5220 // SourceContext: The source context. 5221 SourceContext *SourceContext `json:"sourceContext,omitempty"` 5222 // Syntax: The source syntax. 5223 // 5224 // Possible values: 5225 // "SYNTAX_PROTO2" - Syntax proto2. 5226 // "SYNTAX_PROTO3" - Syntax proto3. 5227 // "SYNTAX_EDITIONS" - Syntax editions. 5228 Syntax string `json:"syntax,omitempty"` 5229 // ForceSendFields is a list of field names (e.g. "Edition") to unconditionally 5230 // include in API requests. By default, fields with empty or default values are 5231 // omitted from API requests. See 5232 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5233 // details. 5234 ForceSendFields []string `json:"-"` 5235 // NullFields is a list of field names (e.g. "Edition") to include in API 5236 // requests with the JSON null value. By default, fields with empty values are 5237 // omitted from API requests. See 5238 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5239 NullFields []string `json:"-"` 5240 } 5241 5242 func (s *Type) MarshalJSON() ([]byte, error) { 5243 type NoMethod Type 5244 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5245 } 5246 5247 // TypedValue: A single strongly-typed value. 5248 type TypedValue struct { 5249 // BoolValue: A Boolean value: true or false. 5250 BoolValue *bool `json:"boolValue,omitempty"` 5251 // DistributionValue: A distribution value. 5252 DistributionValue *Distribution `json:"distributionValue,omitempty"` 5253 // DoubleValue: A 64-bit double-precision floating-point number. Its magnitude 5254 // is approximately ±10±300 and it has 16 significant digits of precision. 5255 DoubleValue *float64 `json:"doubleValue,omitempty"` 5256 // Int64Value: A 64-bit integer. Its range is approximately ±9.2x1018. 5257 Int64Value *int64 `json:"int64Value,omitempty,string"` 5258 // StringValue: A variable-length string value. 5259 StringValue *string `json:"stringValue,omitempty"` 5260 // ForceSendFields is a list of field names (e.g. "BoolValue") to 5261 // unconditionally include in API requests. By default, fields with empty or 5262 // default values are omitted from API requests. See 5263 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5264 // details. 5265 ForceSendFields []string `json:"-"` 5266 // NullFields is a list of field names (e.g. "BoolValue") to include in API 5267 // requests with the JSON null value. By default, fields with empty values are 5268 // omitted from API requests. See 5269 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5270 NullFields []string `json:"-"` 5271 } 5272 5273 func (s *TypedValue) MarshalJSON() ([]byte, error) { 5274 type NoMethod TypedValue 5275 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5276 } 5277 5278 func (s *TypedValue) UnmarshalJSON(data []byte) error { 5279 type NoMethod TypedValue 5280 var s1 struct { 5281 DoubleValue *gensupport.JSONFloat64 `json:"doubleValue"` 5282 *NoMethod 5283 } 5284 s1.NoMethod = (*NoMethod)(s) 5285 if err := json.Unmarshal(data, &s1); err != nil { 5286 return err 5287 } 5288 if s1.DoubleValue != nil { 5289 s.DoubleValue = (*float64)(s1.DoubleValue) 5290 } 5291 return nil 5292 } 5293 5294 // UptimeCheckConfig: This message configures which resources and services to 5295 // monitor for availability. 5296 type UptimeCheckConfig struct { 5297 // CheckerType: The type of checkers to use to execute the Uptime check. 5298 // 5299 // Possible values: 5300 // "CHECKER_TYPE_UNSPECIFIED" - The default checker type. Currently converted 5301 // to STATIC_IP_CHECKERS on creation, the default conversion behavior may 5302 // change in the future. 5303 // "STATIC_IP_CHECKERS" - STATIC_IP_CHECKERS are used for uptime checks that 5304 // perform egress across the public internet. STATIC_IP_CHECKERS use the static 5305 // IP addresses returned by ListUptimeCheckIps. 5306 // "VPC_CHECKERS" - VPC_CHECKERS are used for uptime checks that perform 5307 // egress using Service Directory and private network access. When using 5308 // VPC_CHECKERS, the monitored resource type must be servicedirectory_service. 5309 CheckerType string `json:"checkerType,omitempty"` 5310 // ContentMatchers: The content that is expected to appear in the data returned 5311 // by the target server against which the check is run. Currently, only the 5312 // first entry in the content_matchers list is supported, and additional 5313 // entries will be ignored. This field is optional and should only be specified 5314 // if a content match is required as part of the/ Uptime check. 5315 ContentMatchers []*ContentMatcher `json:"contentMatchers,omitempty"` 5316 // DisplayName: A human-friendly name for the Uptime check configuration. The 5317 // display name should be unique within a Cloud Monitoring Workspace in order 5318 // to make it easier to identify; however, uniqueness is not enforced. 5319 // Required. 5320 DisplayName string `json:"displayName,omitempty"` 5321 // HttpCheck: Contains information needed to make an HTTP or HTTPS check. 5322 HttpCheck *HttpCheck `json:"httpCheck,omitempty"` 5323 // InternalCheckers: The internal checkers that this check will egress from. If 5324 // is_internal is true and this list is empty, the check will egress from all 5325 // the InternalCheckers configured for the project that owns this 5326 // UptimeCheckConfig. 5327 InternalCheckers []*InternalChecker `json:"internalCheckers,omitempty"` 5328 // IsInternal: If this is true, then checks are made only from the 5329 // 'internal_checkers'. If it is false, then checks are made only from the 5330 // 'selected_regions'. It is an error to provide 'selected_regions' when 5331 // is_internal is true, or to provide 'internal_checkers' when is_internal is 5332 // false. 5333 IsInternal bool `json:"isInternal,omitempty"` 5334 // MonitoredResource: The monitored resource 5335 // (https://cloud.google.com/monitoring/api/resources) associated with the 5336 // configuration. The following monitored resource types are valid for this 5337 // field: uptime_url, gce_instance, gae_app, aws_ec2_instance, 5338 // aws_elb_load_balancer k8s_service servicedirectory_service 5339 // cloud_run_revision 5340 MonitoredResource *MonitoredResource `json:"monitoredResource,omitempty"` 5341 // Name: Identifier. A unique resource name for this Uptime check 5342 // configuration. The format is: 5343 // projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] 5344 // [PROJECT_ID_OR_NUMBER] is the Workspace host project associated with the 5345 // Uptime check.This field should be omitted when creating the Uptime check 5346 // configuration; on create, the resource name is assigned by the server and 5347 // included in the response. 5348 Name string `json:"name,omitempty"` 5349 // Period: How often, in seconds, the Uptime check is performed. Currently, the 5350 // only supported values are 60s (1 minute), 300s (5 minutes), 600s (10 5351 // minutes), and 900s (15 minutes). Optional, defaults to 60s. 5352 Period string `json:"period,omitempty"` 5353 // ResourceGroup: The group resource associated with the configuration. 5354 ResourceGroup *ResourceGroup `json:"resourceGroup,omitempty"` 5355 // SelectedRegions: The list of regions from which the check will be run. Some 5356 // regions contain one location, and others contain more than one. If this 5357 // field is specified, enough regions must be provided to include a minimum of 5358 // 3 locations. Not specifying this field will result in Uptime checks running 5359 // from all available regions. 5360 // 5361 // Possible values: 5362 // "REGION_UNSPECIFIED" - Default value if no region is specified. Will 5363 // result in Uptime checks running from all regions. 5364 // "USA" - Allows checks to run from locations within the United States of 5365 // America. 5366 // "EUROPE" - Allows checks to run from locations within the continent of 5367 // Europe. 5368 // "SOUTH_AMERICA" - Allows checks to run from locations within the continent 5369 // of South America. 5370 // "ASIA_PACIFIC" - Allows checks to run from locations within the Asia 5371 // Pacific area (ex: Singapore). 5372 // "USA_OREGON" - Allows checks to run from locations within the western 5373 // United States of America 5374 // "USA_IOWA" - Allows checks to run from locations within the central United 5375 // States of America 5376 // "USA_VIRGINIA" - Allows checks to run from locations within the eastern 5377 // United States of America 5378 SelectedRegions []string `json:"selectedRegions,omitempty"` 5379 // SyntheticMonitor: Specifies a Synthetic Monitor to invoke. 5380 SyntheticMonitor *SyntheticMonitorTarget `json:"syntheticMonitor,omitempty"` 5381 // TcpCheck: Contains information needed to make a TCP check. 5382 TcpCheck *TcpCheck `json:"tcpCheck,omitempty"` 5383 // Timeout: The maximum amount of time to wait for the request to complete 5384 // (must be between 1 and 60 seconds). Required. 5385 Timeout string `json:"timeout,omitempty"` 5386 // UserLabels: User-supplied key/value data to be used for organizing and 5387 // identifying the UptimeCheckConfig objects.The field can contain up to 64 5388 // entries. Each key and value is limited to 63 Unicode characters or 128 5389 // bytes, whichever is smaller. Labels and values can contain only lowercase 5390 // letters, numerals, underscores, and dashes. Keys must begin with a letter. 5391 UserLabels map[string]string `json:"userLabels,omitempty"` 5392 5393 // ServerResponse contains the HTTP response code and headers from the server. 5394 googleapi.ServerResponse `json:"-"` 5395 // ForceSendFields is a list of field names (e.g. "CheckerType") to 5396 // unconditionally include in API requests. By default, fields with empty or 5397 // default values are omitted from API requests. See 5398 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5399 // details. 5400 ForceSendFields []string `json:"-"` 5401 // NullFields is a list of field names (e.g. "CheckerType") to include in API 5402 // requests with the JSON null value. By default, fields with empty values are 5403 // omitted from API requests. See 5404 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5405 NullFields []string `json:"-"` 5406 } 5407 5408 func (s *UptimeCheckConfig) MarshalJSON() ([]byte, error) { 5409 type NoMethod UptimeCheckConfig 5410 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5411 } 5412 5413 // UptimeCheckIp: Contains the region, location, and list of IP addresses where 5414 // checkers in the location run from. 5415 type UptimeCheckIp struct { 5416 // IpAddress: The IP address from which the Uptime check originates. This is a 5417 // fully specified IP address (not an IP address range). Most IP addresses, as 5418 // of this publication, are in IPv4 format; however, one should not rely on the 5419 // IP addresses being in IPv4 format indefinitely, and should support 5420 // interpreting this field in either IPv4 or IPv6 format. 5421 IpAddress string `json:"ipAddress,omitempty"` 5422 // Location: A more specific location within the region that typically encodes 5423 // a particular city/town/metro (and its containing state/province or country) 5424 // within the broader umbrella region category. 5425 Location string `json:"location,omitempty"` 5426 // Region: A broad region category in which the IP address is located. 5427 // 5428 // Possible values: 5429 // "REGION_UNSPECIFIED" - Default value if no region is specified. Will 5430 // result in Uptime checks running from all regions. 5431 // "USA" - Allows checks to run from locations within the United States of 5432 // America. 5433 // "EUROPE" - Allows checks to run from locations within the continent of 5434 // Europe. 5435 // "SOUTH_AMERICA" - Allows checks to run from locations within the continent 5436 // of South America. 5437 // "ASIA_PACIFIC" - Allows checks to run from locations within the Asia 5438 // Pacific area (ex: Singapore). 5439 // "USA_OREGON" - Allows checks to run from locations within the western 5440 // United States of America 5441 // "USA_IOWA" - Allows checks to run from locations within the central United 5442 // States of America 5443 // "USA_VIRGINIA" - Allows checks to run from locations within the eastern 5444 // United States of America 5445 Region string `json:"region,omitempty"` 5446 // ForceSendFields is a list of field names (e.g. "IpAddress") to 5447 // unconditionally include in API requests. By default, fields with empty or 5448 // default values are omitted from API requests. See 5449 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5450 // details. 5451 ForceSendFields []string `json:"-"` 5452 // NullFields is a list of field names (e.g. "IpAddress") to include in API 5453 // requests with the JSON null value. By default, fields with empty values are 5454 // omitted from API requests. See 5455 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5456 NullFields []string `json:"-"` 5457 } 5458 5459 func (s *UptimeCheckIp) MarshalJSON() ([]byte, error) { 5460 type NoMethod UptimeCheckIp 5461 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5462 } 5463 5464 // ValueDescriptor: A descriptor for the value columns in a data point. 5465 type ValueDescriptor struct { 5466 // Key: The value key. 5467 Key string `json:"key,omitempty"` 5468 // MetricKind: The value stream kind. 5469 // 5470 // Possible values: 5471 // "METRIC_KIND_UNSPECIFIED" - Do not use this default value. 5472 // "GAUGE" - An instantaneous measurement of a value. 5473 // "DELTA" - The change in a value during a time interval. 5474 // "CUMULATIVE" - A value accumulated over a time interval. Cumulative 5475 // measurements in a time series should have the same start time and increasing 5476 // end times, until an event resets the cumulative value to zero and sets a new 5477 // start time for the following points. 5478 MetricKind string `json:"metricKind,omitempty"` 5479 // Unit: The unit in which time_series point values are reported. unit follows 5480 // the UCUM format for units as seen in https://unitsofmeasure.org/ucum.html. 5481 // unit is only valid if value_type is INTEGER, DOUBLE, DISTRIBUTION. 5482 Unit string `json:"unit,omitempty"` 5483 // ValueType: The value type. 5484 // 5485 // Possible values: 5486 // "VALUE_TYPE_UNSPECIFIED" - Do not use this default value. 5487 // "BOOL" - The value is a boolean. This value type can be used only if the 5488 // metric kind is GAUGE. 5489 // "INT64" - The value is a signed 64-bit integer. 5490 // "DOUBLE" - The value is a double precision floating point number. 5491 // "STRING" - The value is a text string. This value type can be used only if 5492 // the metric kind is GAUGE. 5493 // "DISTRIBUTION" - The value is a Distribution. 5494 // "MONEY" - The value is money. 5495 ValueType string `json:"valueType,omitempty"` 5496 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 5497 // include in API requests. By default, fields with empty or default values are 5498 // omitted from API requests. See 5499 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5500 // details. 5501 ForceSendFields []string `json:"-"` 5502 // NullFields is a list of field names (e.g. "Key") to include in API requests 5503 // with the JSON null value. By default, fields with empty values are omitted 5504 // from API requests. See 5505 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5506 NullFields []string `json:"-"` 5507 } 5508 5509 func (s *ValueDescriptor) MarshalJSON() ([]byte, error) { 5510 type NoMethod ValueDescriptor 5511 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5512 } 5513 5514 // VerifyNotificationChannelRequest: The VerifyNotificationChannel request. 5515 type VerifyNotificationChannelRequest struct { 5516 // Code: Required. The verification code that was delivered to the channel as a 5517 // result of invoking the SendNotificationChannelVerificationCode API method or 5518 // that was retrieved from a verified channel via 5519 // GetNotificationChannelVerificationCode. For example, one might have 5520 // "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only guaranteed 5521 // that the code is valid UTF-8; one should not make any assumptions regarding 5522 // the structure or format of the code). 5523 Code string `json:"code,omitempty"` 5524 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 5525 // include in API requests. By default, fields with empty or default values are 5526 // omitted from API requests. See 5527 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5528 // details. 5529 ForceSendFields []string `json:"-"` 5530 // NullFields is a list of field names (e.g. "Code") to include in API requests 5531 // with the JSON null value. By default, fields with empty values are omitted 5532 // from API requests. See 5533 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5534 NullFields []string `json:"-"` 5535 } 5536 5537 func (s *VerifyNotificationChannelRequest) MarshalJSON() ([]byte, error) { 5538 type NoMethod VerifyNotificationChannelRequest 5539 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5540 } 5541 5542 // WindowsBasedSli: A WindowsBasedSli defines good_service as the count of time 5543 // windows for which the provided service was of good quality. Criteria for 5544 // determining if service was good are embedded in the window_criterion. 5545 type WindowsBasedSli struct { 5546 // GoodBadMetricFilter: A monitoring filter 5547 // (https://cloud.google.com/monitoring/api/v3/filters) specifying a TimeSeries 5548 // with ValueType = BOOL. The window is good if any true values appear in the 5549 // window. 5550 GoodBadMetricFilter string `json:"goodBadMetricFilter,omitempty"` 5551 // GoodTotalRatioThreshold: A window is good if its performance is high enough. 5552 GoodTotalRatioThreshold *PerformanceThreshold `json:"goodTotalRatioThreshold,omitempty"` 5553 // MetricMeanInRange: A window is good if the metric's value is in a good 5554 // range, averaged across returned streams. 5555 MetricMeanInRange *MetricRange `json:"metricMeanInRange,omitempty"` 5556 // MetricSumInRange: A window is good if the metric's value is in a good range, 5557 // summed across returned streams. 5558 MetricSumInRange *MetricRange `json:"metricSumInRange,omitempty"` 5559 // WindowPeriod: Duration over which window quality is evaluated. Must be an 5560 // integer fraction of a day and at least 60s. 5561 WindowPeriod string `json:"windowPeriod,omitempty"` 5562 // ForceSendFields is a list of field names (e.g. "GoodBadMetricFilter") to 5563 // unconditionally include in API requests. By default, fields with empty or 5564 // default values are omitted from API requests. See 5565 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5566 // details. 5567 ForceSendFields []string `json:"-"` 5568 // NullFields is a list of field names (e.g. "GoodBadMetricFilter") to include 5569 // in API requests with the JSON null value. By default, fields with empty 5570 // values are omitted from API requests. See 5571 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5572 NullFields []string `json:"-"` 5573 } 5574 5575 func (s *WindowsBasedSli) MarshalJSON() ([]byte, error) { 5576 type NoMethod WindowsBasedSli 5577 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5578 } 5579 5580 type FoldersTimeSeriesListCall struct { 5581 s *Service 5582 name string 5583 urlParams_ gensupport.URLParams 5584 ifNoneMatch_ string 5585 ctx_ context.Context 5586 header_ http.Header 5587 } 5588 5589 // List: Lists time series that match a filter. 5590 // 5591 // - name: The project 5592 // (https://cloud.google.com/monitoring/api/v3#project_name), organization or 5593 // folder on which to execute the request. The format is: 5594 // projects/[PROJECT_ID_OR_NUMBER] organizations/[ORGANIZATION_ID] 5595 // folders/[FOLDER_ID]. 5596 func (r *FoldersTimeSeriesService) List(name string) *FoldersTimeSeriesListCall { 5597 c := &FoldersTimeSeriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5598 c.name = name 5599 return c 5600 } 5601 5602 // AggregationAlignmentPeriod sets the optional parameter 5603 // "aggregation.alignmentPeriod": The alignment_period specifies a time 5604 // interval, in seconds, that is used to divide the data in all the time series 5605 // into consistent blocks of time. This will be done before the per-series 5606 // aligner can be applied to the data.The value must be at least 60 seconds. If 5607 // a per-series aligner other than ALIGN_NONE is specified, this field is 5608 // required or an error is returned. If no per-series aligner is specified, or 5609 // the aligner ALIGN_NONE is specified, then this field is ignored.The maximum 5610 // value of the alignment_period is 104 weeks (2 years) for charts, and 90,000 5611 // seconds (25 hours) for alerting policies. 5612 func (c *FoldersTimeSeriesListCall) AggregationAlignmentPeriod(aggregationAlignmentPeriod string) *FoldersTimeSeriesListCall { 5613 c.urlParams_.Set("aggregation.alignmentPeriod", aggregationAlignmentPeriod) 5614 return c 5615 } 5616 5617 // AggregationCrossSeriesReducer sets the optional parameter 5618 // "aggregation.crossSeriesReducer": The reduction operation to be used to 5619 // combine time series into a single time series, where the value of each data 5620 // point in the resulting series is a function of all the already aligned 5621 // values in the input time series.Not all reducer operations can be applied to 5622 // all time series. The valid choices depend on the metric_kind and the 5623 // value_type of the original time series. Reduction can yield a time series 5624 // with a different metric_kind or value_type than the input time series.Time 5625 // series data must first be aligned (see per_series_aligner) in order to 5626 // perform cross-time series reduction. If cross_series_reducer is specified, 5627 // then per_series_aligner must be specified, and must not be ALIGN_NONE. An 5628 // alignment_period must also be specified; otherwise, an error is returned. 5629 // 5630 // Possible values: 5631 // 5632 // "REDUCE_NONE" - No cross-time series reduction. The output of the Aligner 5633 // 5634 // is returned. 5635 // 5636 // "REDUCE_MEAN" - Reduce by computing the mean value across time series for 5637 // 5638 // each alignment period. This reducer is valid for DELTA and GAUGE metrics 5639 // with numeric or distribution values. The value_type of the output is DOUBLE. 5640 // 5641 // "REDUCE_MIN" - Reduce by computing the minimum value across time series 5642 // 5643 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 5644 // with numeric values. The value_type of the output is the same as the 5645 // value_type of the input. 5646 // 5647 // "REDUCE_MAX" - Reduce by computing the maximum value across time series 5648 // 5649 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 5650 // with numeric values. The value_type of the output is the same as the 5651 // value_type of the input. 5652 // 5653 // "REDUCE_SUM" - Reduce by computing the sum across time series for each 5654 // 5655 // alignment period. This reducer is valid for DELTA and GAUGE metrics with 5656 // numeric and distribution values. The value_type of the output is the same as 5657 // the value_type of the input. 5658 // 5659 // "REDUCE_STDDEV" - Reduce by computing the standard deviation across time 5660 // 5661 // series for each alignment period. This reducer is valid for DELTA and GAUGE 5662 // metrics with numeric or distribution values. The value_type of the output is 5663 // DOUBLE. 5664 // 5665 // "REDUCE_COUNT" - Reduce by computing the number of data points across time 5666 // 5667 // series for each alignment period. This reducer is valid for DELTA and GAUGE 5668 // metrics of numeric, Boolean, distribution, and string value_type. The 5669 // value_type of the output is INT64. 5670 // 5671 // "REDUCE_COUNT_TRUE" - Reduce by computing the number of True-valued data 5672 // 5673 // points across time series for each alignment period. This reducer is valid 5674 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 5675 // output is INT64. 5676 // 5677 // "REDUCE_COUNT_FALSE" - Reduce by computing the number of False-valued data 5678 // 5679 // points across time series for each alignment period. This reducer is valid 5680 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 5681 // output is INT64. 5682 // 5683 // "REDUCE_FRACTION_TRUE" - Reduce by computing the ratio of the number of 5684 // 5685 // True-valued data points to the total number of data points for each 5686 // alignment period. This reducer is valid for DELTA and GAUGE metrics of 5687 // Boolean value_type. The output value is in the range 0.0, 1.0 and has 5688 // value_type DOUBLE. 5689 // 5690 // "REDUCE_PERCENTILE_99" - Reduce by computing the 99th percentile 5691 // 5692 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 5693 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 5694 // of numeric and distribution type. The value of the output is DOUBLE. 5695 // 5696 // "REDUCE_PERCENTILE_95" - Reduce by computing the 95th percentile 5697 // 5698 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 5699 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 5700 // of numeric and distribution type. The value of the output is DOUBLE. 5701 // 5702 // "REDUCE_PERCENTILE_50" - Reduce by computing the 50th percentile 5703 // 5704 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 5705 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 5706 // of numeric and distribution type. The value of the output is DOUBLE. 5707 // 5708 // "REDUCE_PERCENTILE_05" - Reduce by computing the 5th percentile 5709 // 5710 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 5711 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 5712 // of numeric and distribution type. The value of the output is DOUBLE. 5713 func (c *FoldersTimeSeriesListCall) AggregationCrossSeriesReducer(aggregationCrossSeriesReducer string) *FoldersTimeSeriesListCall { 5714 c.urlParams_.Set("aggregation.crossSeriesReducer", aggregationCrossSeriesReducer) 5715 return c 5716 } 5717 5718 // AggregationGroupByFields sets the optional parameter 5719 // "aggregation.groupByFields": The set of fields to preserve when 5720 // cross_series_reducer is specified. The group_by_fields determine how the 5721 // time series are partitioned into subsets prior to applying the aggregation 5722 // operation. Each subset contains time series that have the same value for 5723 // each of the grouping fields. Each individual time series is a member of 5724 // exactly one subset. The cross_series_reducer is applied to each subset of 5725 // time series. It is not possible to reduce across different resource types, 5726 // so this field implicitly contains resource.type. Fields not specified in 5727 // group_by_fields are aggregated away. If group_by_fields is not specified and 5728 // all the time series have the same resource type, then the time series are 5729 // aggregated into a single output time series. If cross_series_reducer is not 5730 // defined, this field is ignored. 5731 func (c *FoldersTimeSeriesListCall) AggregationGroupByFields(aggregationGroupByFields ...string) *FoldersTimeSeriesListCall { 5732 c.urlParams_.SetMulti("aggregation.groupByFields", append([]string{}, aggregationGroupByFields...)) 5733 return c 5734 } 5735 5736 // AggregationPerSeriesAligner sets the optional parameter 5737 // "aggregation.perSeriesAligner": An Aligner describes how to bring the data 5738 // points in a single time series into temporal alignment. Except for 5739 // ALIGN_NONE, all alignments cause all the data points in an alignment_period 5740 // to be mathematically grouped together, resulting in a single data point for 5741 // each alignment_period with end timestamp at the end of the period.Not all 5742 // alignment operations may be applied to all time series. The valid choices 5743 // depend on the metric_kind and value_type of the original time series. 5744 // Alignment can change the metric_kind or the value_type of the time 5745 // series.Time series data must be aligned in order to perform cross-time 5746 // series reduction. If cross_series_reducer is specified, then 5747 // per_series_aligner must be specified and not equal to ALIGN_NONE and 5748 // alignment_period must be specified; otherwise, an error is returned. 5749 // 5750 // Possible values: 5751 // 5752 // "ALIGN_NONE" - No alignment. Raw data is returned. Not valid if 5753 // 5754 // cross-series reduction is requested. The value_type of the result is the 5755 // same as the value_type of the input. 5756 // 5757 // "ALIGN_DELTA" - Align and convert to DELTA. The output is delta = y1 - 5758 // 5759 // y0.This alignment is valid for CUMULATIVE and DELTA metrics. If the selected 5760 // alignment period results in periods with no data, then the aligned value for 5761 // such a period is created by interpolation. The value_type of the aligned 5762 // result is the same as the value_type of the input. 5763 // 5764 // "ALIGN_RATE" - Align and convert to a rate. The result is computed as rate 5765 // 5766 // = (y1 - y0)/(t1 - t0), or "delta over time". Think of this aligner as 5767 // providing the slope of the line that passes through the value at the start 5768 // and at the end of the alignment_period.This aligner is valid for CUMULATIVE 5769 // and DELTA metrics with numeric values. If the selected alignment period 5770 // results in periods with no data, then the aligned value for such a period is 5771 // created by interpolation. The output is a GAUGE metric with value_type 5772 // DOUBLE.If, by "rate", you mean "percentage change", see the 5773 // ALIGN_PERCENT_CHANGE aligner instead. 5774 // 5775 // "ALIGN_INTERPOLATE" - Align by interpolating between adjacent points 5776 // 5777 // around the alignment period boundary. This aligner is valid for GAUGE 5778 // metrics with numeric values. The value_type of the aligned result is the 5779 // same as the value_type of the input. 5780 // 5781 // "ALIGN_NEXT_OLDER" - Align by moving the most recent data point before the 5782 // 5783 // end of the alignment period to the boundary at the end of the alignment 5784 // period. This aligner is valid for GAUGE metrics. The value_type of the 5785 // aligned result is the same as the value_type of the input. 5786 // 5787 // "ALIGN_MIN" - Align the time series by returning the minimum value in each 5788 // 5789 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 5790 // numeric values. The value_type of the aligned result is the same as the 5791 // value_type of the input. 5792 // 5793 // "ALIGN_MAX" - Align the time series by returning the maximum value in each 5794 // 5795 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 5796 // numeric values. The value_type of the aligned result is the same as the 5797 // value_type of the input. 5798 // 5799 // "ALIGN_MEAN" - Align the time series by returning the mean value in each 5800 // 5801 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 5802 // numeric values. The value_type of the aligned result is DOUBLE. 5803 // 5804 // "ALIGN_COUNT" - Align the time series by returning the number of values in 5805 // 5806 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 5807 // with numeric or Boolean values. The value_type of the aligned result is 5808 // INT64. 5809 // 5810 // "ALIGN_SUM" - Align the time series by returning the sum of the values in 5811 // 5812 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 5813 // with numeric and distribution values. The value_type of the aligned result 5814 // is the same as the value_type of the input. 5815 // 5816 // "ALIGN_STDDEV" - Align the time series by returning the standard deviation 5817 // 5818 // of the values in each alignment period. This aligner is valid for GAUGE and 5819 // DELTA metrics with numeric values. The value_type of the output is DOUBLE. 5820 // 5821 // "ALIGN_COUNT_TRUE" - Align the time series by returning the number of True 5822 // 5823 // values in each alignment period. This aligner is valid for GAUGE metrics 5824 // with Boolean values. The value_type of the output is INT64. 5825 // 5826 // "ALIGN_COUNT_FALSE" - Align the time series by returning the number of 5827 // 5828 // False values in each alignment period. This aligner is valid for GAUGE 5829 // metrics with Boolean values. The value_type of the output is INT64. 5830 // 5831 // "ALIGN_FRACTION_TRUE" - Align the time series by returning the ratio of 5832 // 5833 // the number of True values to the total number of values in each alignment 5834 // period. This aligner is valid for GAUGE metrics with Boolean values. The 5835 // output value is in the range 0.0, 1.0 and has value_type DOUBLE. 5836 // 5837 // "ALIGN_PERCENTILE_99" - Align the time series by using percentile 5838 // 5839 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 5840 // point in each alignment period is the 99th percentile of all data points in 5841 // the period. This aligner is valid for GAUGE and DELTA metrics with 5842 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 5843 // 5844 // "ALIGN_PERCENTILE_95" - Align the time series by using percentile 5845 // 5846 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 5847 // point in each alignment period is the 95th percentile of all data points in 5848 // the period. This aligner is valid for GAUGE and DELTA metrics with 5849 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 5850 // 5851 // "ALIGN_PERCENTILE_50" - Align the time series by using percentile 5852 // 5853 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 5854 // point in each alignment period is the 50th percentile of all data points in 5855 // the period. This aligner is valid for GAUGE and DELTA metrics with 5856 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 5857 // 5858 // "ALIGN_PERCENTILE_05" - Align the time series by using percentile 5859 // 5860 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 5861 // point in each alignment period is the 5th percentile of all data points in 5862 // the period. This aligner is valid for GAUGE and DELTA metrics with 5863 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 5864 // 5865 // "ALIGN_PERCENT_CHANGE" - Align and convert to a percentage change. This 5866 // 5867 // aligner is valid for GAUGE and DELTA metrics with numeric values. This 5868 // alignment returns ((current - previous)/previous) * 100, where the value of 5869 // previous is determined based on the alignment_period.If the values of 5870 // current and previous are both 0, then the returned value is 0. If only 5871 // previous is 0, the returned value is infinity.A 10-minute moving mean is 5872 // computed at each point of the alignment period prior to the above 5873 // calculation to smooth the metric and prevent false positives from very 5874 // short-lived spikes. The moving mean is only applicable for data whose values 5875 // are >= 0. Any values < 0 are treated as a missing datapoint, and are 5876 // ignored. While DELTA metrics are accepted by this alignment, special care 5877 // should be taken that the values for the metric will always be positive. The 5878 // output is a GAUGE metric with value_type DOUBLE. 5879 func (c *FoldersTimeSeriesListCall) AggregationPerSeriesAligner(aggregationPerSeriesAligner string) *FoldersTimeSeriesListCall { 5880 c.urlParams_.Set("aggregation.perSeriesAligner", aggregationPerSeriesAligner) 5881 return c 5882 } 5883 5884 // Filter sets the optional parameter "filter": Required. A monitoring filter 5885 // (https://cloud.google.com/monitoring/api/v3/filters) that specifies which 5886 // time series should be returned. The filter must specify a single metric 5887 // type, and can additionally specify metric labels and other information. For 5888 // example: metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND 5889 // metric.labels.instance_name = "my-instance-name" 5890 func (c *FoldersTimeSeriesListCall) Filter(filter string) *FoldersTimeSeriesListCall { 5891 c.urlParams_.Set("filter", filter) 5892 return c 5893 } 5894 5895 // IntervalEndTime sets the optional parameter "interval.endTime": Required. 5896 // The end of the time interval. 5897 func (c *FoldersTimeSeriesListCall) IntervalEndTime(intervalEndTime string) *FoldersTimeSeriesListCall { 5898 c.urlParams_.Set("interval.endTime", intervalEndTime) 5899 return c 5900 } 5901 5902 // IntervalStartTime sets the optional parameter "interval.startTime": The 5903 // beginning of the time interval. The default value for the start time is the 5904 // end time. The start time must not be later than the end time. 5905 func (c *FoldersTimeSeriesListCall) IntervalStartTime(intervalStartTime string) *FoldersTimeSeriesListCall { 5906 c.urlParams_.Set("interval.startTime", intervalStartTime) 5907 return c 5908 } 5909 5910 // OrderBy sets the optional parameter "orderBy": Unsupported: must be left 5911 // blank. The points in each time series are currently returned in reverse time 5912 // order (most recent to oldest). 5913 func (c *FoldersTimeSeriesListCall) OrderBy(orderBy string) *FoldersTimeSeriesListCall { 5914 c.urlParams_.Set("orderBy", orderBy) 5915 return c 5916 } 5917 5918 // PageSize sets the optional parameter "pageSize": A positive number that is 5919 // the maximum number of results to return. If page_size is empty or more than 5920 // 100,000 results, the effective page_size is 100,000 results. If view is set 5921 // to FULL, this is the maximum number of Points returned. If view is set to 5922 // HEADERS, this is the maximum number of TimeSeries returned. 5923 func (c *FoldersTimeSeriesListCall) PageSize(pageSize int64) *FoldersTimeSeriesListCall { 5924 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5925 return c 5926 } 5927 5928 // PageToken sets the optional parameter "pageToken": If this field is not 5929 // empty then it must contain the nextPageToken value returned by a previous 5930 // call to this method. Using this field causes the method to return additional 5931 // results from the previous method call. 5932 func (c *FoldersTimeSeriesListCall) PageToken(pageToken string) *FoldersTimeSeriesListCall { 5933 c.urlParams_.Set("pageToken", pageToken) 5934 return c 5935 } 5936 5937 // SecondaryAggregationAlignmentPeriod sets the optional parameter 5938 // "secondaryAggregation.alignmentPeriod": The alignment_period specifies a 5939 // time interval, in seconds, that is used to divide the data in all the time 5940 // series into consistent blocks of time. This will be done before the 5941 // per-series aligner can be applied to the data.The value must be at least 60 5942 // seconds. If a per-series aligner other than ALIGN_NONE is specified, this 5943 // field is required or an error is returned. If no per-series aligner is 5944 // specified, or the aligner ALIGN_NONE is specified, then this field is 5945 // ignored.The maximum value of the alignment_period is 104 weeks (2 years) for 5946 // charts, and 90,000 seconds (25 hours) for alerting policies. 5947 func (c *FoldersTimeSeriesListCall) SecondaryAggregationAlignmentPeriod(secondaryAggregationAlignmentPeriod string) *FoldersTimeSeriesListCall { 5948 c.urlParams_.Set("secondaryAggregation.alignmentPeriod", secondaryAggregationAlignmentPeriod) 5949 return c 5950 } 5951 5952 // SecondaryAggregationCrossSeriesReducer sets the optional parameter 5953 // "secondaryAggregation.crossSeriesReducer": The reduction operation to be 5954 // used to combine time series into a single time series, where the value of 5955 // each data point in the resulting series is a function of all the already 5956 // aligned values in the input time series.Not all reducer operations can be 5957 // applied to all time series. The valid choices depend on the metric_kind and 5958 // the value_type of the original time series. Reduction can yield a time 5959 // series with a different metric_kind or value_type than the input time 5960 // series.Time series data must first be aligned (see per_series_aligner) in 5961 // order to perform cross-time series reduction. If cross_series_reducer is 5962 // specified, then per_series_aligner must be specified, and must not be 5963 // ALIGN_NONE. An alignment_period must also be specified; otherwise, an error 5964 // is returned. 5965 // 5966 // Possible values: 5967 // 5968 // "REDUCE_NONE" - No cross-time series reduction. The output of the Aligner 5969 // 5970 // is returned. 5971 // 5972 // "REDUCE_MEAN" - Reduce by computing the mean value across time series for 5973 // 5974 // each alignment period. This reducer is valid for DELTA and GAUGE metrics 5975 // with numeric or distribution values. The value_type of the output is DOUBLE. 5976 // 5977 // "REDUCE_MIN" - Reduce by computing the minimum value across time series 5978 // 5979 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 5980 // with numeric values. The value_type of the output is the same as the 5981 // value_type of the input. 5982 // 5983 // "REDUCE_MAX" - Reduce by computing the maximum value across time series 5984 // 5985 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 5986 // with numeric values. The value_type of the output is the same as the 5987 // value_type of the input. 5988 // 5989 // "REDUCE_SUM" - Reduce by computing the sum across time series for each 5990 // 5991 // alignment period. This reducer is valid for DELTA and GAUGE metrics with 5992 // numeric and distribution values. The value_type of the output is the same as 5993 // the value_type of the input. 5994 // 5995 // "REDUCE_STDDEV" - Reduce by computing the standard deviation across time 5996 // 5997 // series for each alignment period. This reducer is valid for DELTA and GAUGE 5998 // metrics with numeric or distribution values. The value_type of the output is 5999 // DOUBLE. 6000 // 6001 // "REDUCE_COUNT" - Reduce by computing the number of data points across time 6002 // 6003 // series for each alignment period. This reducer is valid for DELTA and GAUGE 6004 // metrics of numeric, Boolean, distribution, and string value_type. The 6005 // value_type of the output is INT64. 6006 // 6007 // "REDUCE_COUNT_TRUE" - Reduce by computing the number of True-valued data 6008 // 6009 // points across time series for each alignment period. This reducer is valid 6010 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 6011 // output is INT64. 6012 // 6013 // "REDUCE_COUNT_FALSE" - Reduce by computing the number of False-valued data 6014 // 6015 // points across time series for each alignment period. This reducer is valid 6016 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 6017 // output is INT64. 6018 // 6019 // "REDUCE_FRACTION_TRUE" - Reduce by computing the ratio of the number of 6020 // 6021 // True-valued data points to the total number of data points for each 6022 // alignment period. This reducer is valid for DELTA and GAUGE metrics of 6023 // Boolean value_type. The output value is in the range 0.0, 1.0 and has 6024 // value_type DOUBLE. 6025 // 6026 // "REDUCE_PERCENTILE_99" - Reduce by computing the 99th percentile 6027 // 6028 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 6029 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 6030 // of numeric and distribution type. The value of the output is DOUBLE. 6031 // 6032 // "REDUCE_PERCENTILE_95" - Reduce by computing the 95th percentile 6033 // 6034 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 6035 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 6036 // of numeric and distribution type. The value of the output is DOUBLE. 6037 // 6038 // "REDUCE_PERCENTILE_50" - Reduce by computing the 50th percentile 6039 // 6040 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 6041 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 6042 // of numeric and distribution type. The value of the output is DOUBLE. 6043 // 6044 // "REDUCE_PERCENTILE_05" - Reduce by computing the 5th percentile 6045 // 6046 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 6047 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 6048 // of numeric and distribution type. The value of the output is DOUBLE. 6049 func (c *FoldersTimeSeriesListCall) SecondaryAggregationCrossSeriesReducer(secondaryAggregationCrossSeriesReducer string) *FoldersTimeSeriesListCall { 6050 c.urlParams_.Set("secondaryAggregation.crossSeriesReducer", secondaryAggregationCrossSeriesReducer) 6051 return c 6052 } 6053 6054 // SecondaryAggregationGroupByFields sets the optional parameter 6055 // "secondaryAggregation.groupByFields": The set of fields to preserve when 6056 // cross_series_reducer is specified. The group_by_fields determine how the 6057 // time series are partitioned into subsets prior to applying the aggregation 6058 // operation. Each subset contains time series that have the same value for 6059 // each of the grouping fields. Each individual time series is a member of 6060 // exactly one subset. The cross_series_reducer is applied to each subset of 6061 // time series. It is not possible to reduce across different resource types, 6062 // so this field implicitly contains resource.type. Fields not specified in 6063 // group_by_fields are aggregated away. If group_by_fields is not specified and 6064 // all the time series have the same resource type, then the time series are 6065 // aggregated into a single output time series. If cross_series_reducer is not 6066 // defined, this field is ignored. 6067 func (c *FoldersTimeSeriesListCall) SecondaryAggregationGroupByFields(secondaryAggregationGroupByFields ...string) *FoldersTimeSeriesListCall { 6068 c.urlParams_.SetMulti("secondaryAggregation.groupByFields", append([]string{}, secondaryAggregationGroupByFields...)) 6069 return c 6070 } 6071 6072 // SecondaryAggregationPerSeriesAligner sets the optional parameter 6073 // "secondaryAggregation.perSeriesAligner": An Aligner describes how to bring 6074 // the data points in a single time series into temporal alignment. Except for 6075 // ALIGN_NONE, all alignments cause all the data points in an alignment_period 6076 // to be mathematically grouped together, resulting in a single data point for 6077 // each alignment_period with end timestamp at the end of the period.Not all 6078 // alignment operations may be applied to all time series. The valid choices 6079 // depend on the metric_kind and value_type of the original time series. 6080 // Alignment can change the metric_kind or the value_type of the time 6081 // series.Time series data must be aligned in order to perform cross-time 6082 // series reduction. If cross_series_reducer is specified, then 6083 // per_series_aligner must be specified and not equal to ALIGN_NONE and 6084 // alignment_period must be specified; otherwise, an error is returned. 6085 // 6086 // Possible values: 6087 // 6088 // "ALIGN_NONE" - No alignment. Raw data is returned. Not valid if 6089 // 6090 // cross-series reduction is requested. The value_type of the result is the 6091 // same as the value_type of the input. 6092 // 6093 // "ALIGN_DELTA" - Align and convert to DELTA. The output is delta = y1 - 6094 // 6095 // y0.This alignment is valid for CUMULATIVE and DELTA metrics. If the selected 6096 // alignment period results in periods with no data, then the aligned value for 6097 // such a period is created by interpolation. The value_type of the aligned 6098 // result is the same as the value_type of the input. 6099 // 6100 // "ALIGN_RATE" - Align and convert to a rate. The result is computed as rate 6101 // 6102 // = (y1 - y0)/(t1 - t0), or "delta over time". Think of this aligner as 6103 // providing the slope of the line that passes through the value at the start 6104 // and at the end of the alignment_period.This aligner is valid for CUMULATIVE 6105 // and DELTA metrics with numeric values. If the selected alignment period 6106 // results in periods with no data, then the aligned value for such a period is 6107 // created by interpolation. The output is a GAUGE metric with value_type 6108 // DOUBLE.If, by "rate", you mean "percentage change", see the 6109 // ALIGN_PERCENT_CHANGE aligner instead. 6110 // 6111 // "ALIGN_INTERPOLATE" - Align by interpolating between adjacent points 6112 // 6113 // around the alignment period boundary. This aligner is valid for GAUGE 6114 // metrics with numeric values. The value_type of the aligned result is the 6115 // same as the value_type of the input. 6116 // 6117 // "ALIGN_NEXT_OLDER" - Align by moving the most recent data point before the 6118 // 6119 // end of the alignment period to the boundary at the end of the alignment 6120 // period. This aligner is valid for GAUGE metrics. The value_type of the 6121 // aligned result is the same as the value_type of the input. 6122 // 6123 // "ALIGN_MIN" - Align the time series by returning the minimum value in each 6124 // 6125 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 6126 // numeric values. The value_type of the aligned result is the same as the 6127 // value_type of the input. 6128 // 6129 // "ALIGN_MAX" - Align the time series by returning the maximum value in each 6130 // 6131 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 6132 // numeric values. The value_type of the aligned result is the same as the 6133 // value_type of the input. 6134 // 6135 // "ALIGN_MEAN" - Align the time series by returning the mean value in each 6136 // 6137 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 6138 // numeric values. The value_type of the aligned result is DOUBLE. 6139 // 6140 // "ALIGN_COUNT" - Align the time series by returning the number of values in 6141 // 6142 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 6143 // with numeric or Boolean values. The value_type of the aligned result is 6144 // INT64. 6145 // 6146 // "ALIGN_SUM" - Align the time series by returning the sum of the values in 6147 // 6148 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 6149 // with numeric and distribution values. The value_type of the aligned result 6150 // is the same as the value_type of the input. 6151 // 6152 // "ALIGN_STDDEV" - Align the time series by returning the standard deviation 6153 // 6154 // of the values in each alignment period. This aligner is valid for GAUGE and 6155 // DELTA metrics with numeric values. The value_type of the output is DOUBLE. 6156 // 6157 // "ALIGN_COUNT_TRUE" - Align the time series by returning the number of True 6158 // 6159 // values in each alignment period. This aligner is valid for GAUGE metrics 6160 // with Boolean values. The value_type of the output is INT64. 6161 // 6162 // "ALIGN_COUNT_FALSE" - Align the time series by returning the number of 6163 // 6164 // False values in each alignment period. This aligner is valid for GAUGE 6165 // metrics with Boolean values. The value_type of the output is INT64. 6166 // 6167 // "ALIGN_FRACTION_TRUE" - Align the time series by returning the ratio of 6168 // 6169 // the number of True values to the total number of values in each alignment 6170 // period. This aligner is valid for GAUGE metrics with Boolean values. The 6171 // output value is in the range 0.0, 1.0 and has value_type DOUBLE. 6172 // 6173 // "ALIGN_PERCENTILE_99" - Align the time series by using percentile 6174 // 6175 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 6176 // point in each alignment period is the 99th percentile of all data points in 6177 // the period. This aligner is valid for GAUGE and DELTA metrics with 6178 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 6179 // 6180 // "ALIGN_PERCENTILE_95" - Align the time series by using percentile 6181 // 6182 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 6183 // point in each alignment period is the 95th percentile of all data points in 6184 // the period. This aligner is valid for GAUGE and DELTA metrics with 6185 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 6186 // 6187 // "ALIGN_PERCENTILE_50" - Align the time series by using percentile 6188 // 6189 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 6190 // point in each alignment period is the 50th percentile of all data points in 6191 // the period. This aligner is valid for GAUGE and DELTA metrics with 6192 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 6193 // 6194 // "ALIGN_PERCENTILE_05" - Align the time series by using percentile 6195 // 6196 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 6197 // point in each alignment period is the 5th percentile of all data points in 6198 // the period. This aligner is valid for GAUGE and DELTA metrics with 6199 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 6200 // 6201 // "ALIGN_PERCENT_CHANGE" - Align and convert to a percentage change. This 6202 // 6203 // aligner is valid for GAUGE and DELTA metrics with numeric values. This 6204 // alignment returns ((current - previous)/previous) * 100, where the value of 6205 // previous is determined based on the alignment_period.If the values of 6206 // current and previous are both 0, then the returned value is 0. If only 6207 // previous is 0, the returned value is infinity.A 10-minute moving mean is 6208 // computed at each point of the alignment period prior to the above 6209 // calculation to smooth the metric and prevent false positives from very 6210 // short-lived spikes. The moving mean is only applicable for data whose values 6211 // are >= 0. Any values < 0 are treated as a missing datapoint, and are 6212 // ignored. While DELTA metrics are accepted by this alignment, special care 6213 // should be taken that the values for the metric will always be positive. The 6214 // output is a GAUGE metric with value_type DOUBLE. 6215 func (c *FoldersTimeSeriesListCall) SecondaryAggregationPerSeriesAligner(secondaryAggregationPerSeriesAligner string) *FoldersTimeSeriesListCall { 6216 c.urlParams_.Set("secondaryAggregation.perSeriesAligner", secondaryAggregationPerSeriesAligner) 6217 return c 6218 } 6219 6220 // View sets the optional parameter "view": Required. Specifies which 6221 // information is returned about the time series. 6222 // 6223 // Possible values: 6224 // 6225 // "FULL" - Returns the identity of the metric(s), the time series, and the 6226 // 6227 // time series data. 6228 // 6229 // "HEADERS" - Returns the identity of the metric and the time series 6230 // 6231 // resource, but not the time series data. 6232 func (c *FoldersTimeSeriesListCall) View(view string) *FoldersTimeSeriesListCall { 6233 c.urlParams_.Set("view", view) 6234 return c 6235 } 6236 6237 // Fields allows partial responses to be retrieved. See 6238 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6239 // details. 6240 func (c *FoldersTimeSeriesListCall) Fields(s ...googleapi.Field) *FoldersTimeSeriesListCall { 6241 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6242 return c 6243 } 6244 6245 // IfNoneMatch sets an optional parameter which makes the operation fail if the 6246 // object's ETag matches the given value. This is useful for getting updates 6247 // only after the object has changed since the last request. 6248 func (c *FoldersTimeSeriesListCall) IfNoneMatch(entityTag string) *FoldersTimeSeriesListCall { 6249 c.ifNoneMatch_ = entityTag 6250 return c 6251 } 6252 6253 // Context sets the context to be used in this call's Do method. 6254 func (c *FoldersTimeSeriesListCall) Context(ctx context.Context) *FoldersTimeSeriesListCall { 6255 c.ctx_ = ctx 6256 return c 6257 } 6258 6259 // Header returns a http.Header that can be modified by the caller to add 6260 // headers to the request. 6261 func (c *FoldersTimeSeriesListCall) Header() http.Header { 6262 if c.header_ == nil { 6263 c.header_ = make(http.Header) 6264 } 6265 return c.header_ 6266 } 6267 6268 func (c *FoldersTimeSeriesListCall) doRequest(alt string) (*http.Response, error) { 6269 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 6270 if c.ifNoneMatch_ != "" { 6271 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6272 } 6273 var body io.Reader = nil 6274 c.urlParams_.Set("alt", alt) 6275 c.urlParams_.Set("prettyPrint", "false") 6276 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/timeSeries") 6277 urls += "?" + c.urlParams_.Encode() 6278 req, err := http.NewRequest("GET", urls, body) 6279 if err != nil { 6280 return nil, err 6281 } 6282 req.Header = reqHeaders 6283 googleapi.Expand(req.URL, map[string]string{ 6284 "name": c.name, 6285 }) 6286 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6287 } 6288 6289 // Do executes the "monitoring.folders.timeSeries.list" call. 6290 // Any non-2xx status code is an error. Response headers are in either 6291 // *ListTimeSeriesResponse.ServerResponse.Header or (if a response was returned 6292 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6293 // check whether the returned error was because http.StatusNotModified was 6294 // returned. 6295 func (c *FoldersTimeSeriesListCall) Do(opts ...googleapi.CallOption) (*ListTimeSeriesResponse, error) { 6296 gensupport.SetOptions(c.urlParams_, opts...) 6297 res, err := c.doRequest("json") 6298 if res != nil && res.StatusCode == http.StatusNotModified { 6299 if res.Body != nil { 6300 res.Body.Close() 6301 } 6302 return nil, gensupport.WrapError(&googleapi.Error{ 6303 Code: res.StatusCode, 6304 Header: res.Header, 6305 }) 6306 } 6307 if err != nil { 6308 return nil, err 6309 } 6310 defer googleapi.CloseBody(res) 6311 if err := googleapi.CheckResponse(res); err != nil { 6312 return nil, gensupport.WrapError(err) 6313 } 6314 ret := &ListTimeSeriesResponse{ 6315 ServerResponse: googleapi.ServerResponse{ 6316 Header: res.Header, 6317 HTTPStatusCode: res.StatusCode, 6318 }, 6319 } 6320 target := &ret 6321 if err := gensupport.DecodeResponse(target, res); err != nil { 6322 return nil, err 6323 } 6324 return ret, nil 6325 } 6326 6327 // Pages invokes f for each page of results. 6328 // A non-nil error returned from f will halt the iteration. 6329 // The provided context supersedes any context provided to the Context method. 6330 func (c *FoldersTimeSeriesListCall) Pages(ctx context.Context, f func(*ListTimeSeriesResponse) error) error { 6331 c.ctx_ = ctx 6332 defer c.PageToken(c.urlParams_.Get("pageToken")) 6333 for { 6334 x, err := c.Do() 6335 if err != nil { 6336 return err 6337 } 6338 if err := f(x); err != nil { 6339 return err 6340 } 6341 if x.NextPageToken == "" { 6342 return nil 6343 } 6344 c.PageToken(x.NextPageToken) 6345 } 6346 } 6347 6348 type OrganizationsTimeSeriesListCall struct { 6349 s *Service 6350 name string 6351 urlParams_ gensupport.URLParams 6352 ifNoneMatch_ string 6353 ctx_ context.Context 6354 header_ http.Header 6355 } 6356 6357 // List: Lists time series that match a filter. 6358 // 6359 // - name: The project 6360 // (https://cloud.google.com/monitoring/api/v3#project_name), organization or 6361 // folder on which to execute the request. The format is: 6362 // projects/[PROJECT_ID_OR_NUMBER] organizations/[ORGANIZATION_ID] 6363 // folders/[FOLDER_ID]. 6364 func (r *OrganizationsTimeSeriesService) List(name string) *OrganizationsTimeSeriesListCall { 6365 c := &OrganizationsTimeSeriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6366 c.name = name 6367 return c 6368 } 6369 6370 // AggregationAlignmentPeriod sets the optional parameter 6371 // "aggregation.alignmentPeriod": The alignment_period specifies a time 6372 // interval, in seconds, that is used to divide the data in all the time series 6373 // into consistent blocks of time. This will be done before the per-series 6374 // aligner can be applied to the data.The value must be at least 60 seconds. If 6375 // a per-series aligner other than ALIGN_NONE is specified, this field is 6376 // required or an error is returned. If no per-series aligner is specified, or 6377 // the aligner ALIGN_NONE is specified, then this field is ignored.The maximum 6378 // value of the alignment_period is 104 weeks (2 years) for charts, and 90,000 6379 // seconds (25 hours) for alerting policies. 6380 func (c *OrganizationsTimeSeriesListCall) AggregationAlignmentPeriod(aggregationAlignmentPeriod string) *OrganizationsTimeSeriesListCall { 6381 c.urlParams_.Set("aggregation.alignmentPeriod", aggregationAlignmentPeriod) 6382 return c 6383 } 6384 6385 // AggregationCrossSeriesReducer sets the optional parameter 6386 // "aggregation.crossSeriesReducer": The reduction operation to be used to 6387 // combine time series into a single time series, where the value of each data 6388 // point in the resulting series is a function of all the already aligned 6389 // values in the input time series.Not all reducer operations can be applied to 6390 // all time series. The valid choices depend on the metric_kind and the 6391 // value_type of the original time series. Reduction can yield a time series 6392 // with a different metric_kind or value_type than the input time series.Time 6393 // series data must first be aligned (see per_series_aligner) in order to 6394 // perform cross-time series reduction. If cross_series_reducer is specified, 6395 // then per_series_aligner must be specified, and must not be ALIGN_NONE. An 6396 // alignment_period must also be specified; otherwise, an error is returned. 6397 // 6398 // Possible values: 6399 // 6400 // "REDUCE_NONE" - No cross-time series reduction. The output of the Aligner 6401 // 6402 // is returned. 6403 // 6404 // "REDUCE_MEAN" - Reduce by computing the mean value across time series for 6405 // 6406 // each alignment period. This reducer is valid for DELTA and GAUGE metrics 6407 // with numeric or distribution values. The value_type of the output is DOUBLE. 6408 // 6409 // "REDUCE_MIN" - Reduce by computing the minimum value across time series 6410 // 6411 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 6412 // with numeric values. The value_type of the output is the same as the 6413 // value_type of the input. 6414 // 6415 // "REDUCE_MAX" - Reduce by computing the maximum value across time series 6416 // 6417 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 6418 // with numeric values. The value_type of the output is the same as the 6419 // value_type of the input. 6420 // 6421 // "REDUCE_SUM" - Reduce by computing the sum across time series for each 6422 // 6423 // alignment period. This reducer is valid for DELTA and GAUGE metrics with 6424 // numeric and distribution values. The value_type of the output is the same as 6425 // the value_type of the input. 6426 // 6427 // "REDUCE_STDDEV" - Reduce by computing the standard deviation across time 6428 // 6429 // series for each alignment period. This reducer is valid for DELTA and GAUGE 6430 // metrics with numeric or distribution values. The value_type of the output is 6431 // DOUBLE. 6432 // 6433 // "REDUCE_COUNT" - Reduce by computing the number of data points across time 6434 // 6435 // series for each alignment period. This reducer is valid for DELTA and GAUGE 6436 // metrics of numeric, Boolean, distribution, and string value_type. The 6437 // value_type of the output is INT64. 6438 // 6439 // "REDUCE_COUNT_TRUE" - Reduce by computing the number of True-valued data 6440 // 6441 // points across time series for each alignment period. This reducer is valid 6442 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 6443 // output is INT64. 6444 // 6445 // "REDUCE_COUNT_FALSE" - Reduce by computing the number of False-valued data 6446 // 6447 // points across time series for each alignment period. This reducer is valid 6448 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 6449 // output is INT64. 6450 // 6451 // "REDUCE_FRACTION_TRUE" - Reduce by computing the ratio of the number of 6452 // 6453 // True-valued data points to the total number of data points for each 6454 // alignment period. This reducer is valid for DELTA and GAUGE metrics of 6455 // Boolean value_type. The output value is in the range 0.0, 1.0 and has 6456 // value_type DOUBLE. 6457 // 6458 // "REDUCE_PERCENTILE_99" - Reduce by computing the 99th percentile 6459 // 6460 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 6461 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 6462 // of numeric and distribution type. The value of the output is DOUBLE. 6463 // 6464 // "REDUCE_PERCENTILE_95" - Reduce by computing the 95th percentile 6465 // 6466 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 6467 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 6468 // of numeric and distribution type. The value of the output is DOUBLE. 6469 // 6470 // "REDUCE_PERCENTILE_50" - Reduce by computing the 50th percentile 6471 // 6472 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 6473 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 6474 // of numeric and distribution type. The value of the output is DOUBLE. 6475 // 6476 // "REDUCE_PERCENTILE_05" - Reduce by computing the 5th percentile 6477 // 6478 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 6479 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 6480 // of numeric and distribution type. The value of the output is DOUBLE. 6481 func (c *OrganizationsTimeSeriesListCall) AggregationCrossSeriesReducer(aggregationCrossSeriesReducer string) *OrganizationsTimeSeriesListCall { 6482 c.urlParams_.Set("aggregation.crossSeriesReducer", aggregationCrossSeriesReducer) 6483 return c 6484 } 6485 6486 // AggregationGroupByFields sets the optional parameter 6487 // "aggregation.groupByFields": The set of fields to preserve when 6488 // cross_series_reducer is specified. The group_by_fields determine how the 6489 // time series are partitioned into subsets prior to applying the aggregation 6490 // operation. Each subset contains time series that have the same value for 6491 // each of the grouping fields. Each individual time series is a member of 6492 // exactly one subset. The cross_series_reducer is applied to each subset of 6493 // time series. It is not possible to reduce across different resource types, 6494 // so this field implicitly contains resource.type. Fields not specified in 6495 // group_by_fields are aggregated away. If group_by_fields is not specified and 6496 // all the time series have the same resource type, then the time series are 6497 // aggregated into a single output time series. If cross_series_reducer is not 6498 // defined, this field is ignored. 6499 func (c *OrganizationsTimeSeriesListCall) AggregationGroupByFields(aggregationGroupByFields ...string) *OrganizationsTimeSeriesListCall { 6500 c.urlParams_.SetMulti("aggregation.groupByFields", append([]string{}, aggregationGroupByFields...)) 6501 return c 6502 } 6503 6504 // AggregationPerSeriesAligner sets the optional parameter 6505 // "aggregation.perSeriesAligner": An Aligner describes how to bring the data 6506 // points in a single time series into temporal alignment. Except for 6507 // ALIGN_NONE, all alignments cause all the data points in an alignment_period 6508 // to be mathematically grouped together, resulting in a single data point for 6509 // each alignment_period with end timestamp at the end of the period.Not all 6510 // alignment operations may be applied to all time series. The valid choices 6511 // depend on the metric_kind and value_type of the original time series. 6512 // Alignment can change the metric_kind or the value_type of the time 6513 // series.Time series data must be aligned in order to perform cross-time 6514 // series reduction. If cross_series_reducer is specified, then 6515 // per_series_aligner must be specified and not equal to ALIGN_NONE and 6516 // alignment_period must be specified; otherwise, an error is returned. 6517 // 6518 // Possible values: 6519 // 6520 // "ALIGN_NONE" - No alignment. Raw data is returned. Not valid if 6521 // 6522 // cross-series reduction is requested. The value_type of the result is the 6523 // same as the value_type of the input. 6524 // 6525 // "ALIGN_DELTA" - Align and convert to DELTA. The output is delta = y1 - 6526 // 6527 // y0.This alignment is valid for CUMULATIVE and DELTA metrics. If the selected 6528 // alignment period results in periods with no data, then the aligned value for 6529 // such a period is created by interpolation. The value_type of the aligned 6530 // result is the same as the value_type of the input. 6531 // 6532 // "ALIGN_RATE" - Align and convert to a rate. The result is computed as rate 6533 // 6534 // = (y1 - y0)/(t1 - t0), or "delta over time". Think of this aligner as 6535 // providing the slope of the line that passes through the value at the start 6536 // and at the end of the alignment_period.This aligner is valid for CUMULATIVE 6537 // and DELTA metrics with numeric values. If the selected alignment period 6538 // results in periods with no data, then the aligned value for such a period is 6539 // created by interpolation. The output is a GAUGE metric with value_type 6540 // DOUBLE.If, by "rate", you mean "percentage change", see the 6541 // ALIGN_PERCENT_CHANGE aligner instead. 6542 // 6543 // "ALIGN_INTERPOLATE" - Align by interpolating between adjacent points 6544 // 6545 // around the alignment period boundary. This aligner is valid for GAUGE 6546 // metrics with numeric values. The value_type of the aligned result is the 6547 // same as the value_type of the input. 6548 // 6549 // "ALIGN_NEXT_OLDER" - Align by moving the most recent data point before the 6550 // 6551 // end of the alignment period to the boundary at the end of the alignment 6552 // period. This aligner is valid for GAUGE metrics. The value_type of the 6553 // aligned result is the same as the value_type of the input. 6554 // 6555 // "ALIGN_MIN" - Align the time series by returning the minimum value in each 6556 // 6557 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 6558 // numeric values. The value_type of the aligned result is the same as the 6559 // value_type of the input. 6560 // 6561 // "ALIGN_MAX" - Align the time series by returning the maximum value in each 6562 // 6563 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 6564 // numeric values. The value_type of the aligned result is the same as the 6565 // value_type of the input. 6566 // 6567 // "ALIGN_MEAN" - Align the time series by returning the mean value in each 6568 // 6569 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 6570 // numeric values. The value_type of the aligned result is DOUBLE. 6571 // 6572 // "ALIGN_COUNT" - Align the time series by returning the number of values in 6573 // 6574 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 6575 // with numeric or Boolean values. The value_type of the aligned result is 6576 // INT64. 6577 // 6578 // "ALIGN_SUM" - Align the time series by returning the sum of the values in 6579 // 6580 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 6581 // with numeric and distribution values. The value_type of the aligned result 6582 // is the same as the value_type of the input. 6583 // 6584 // "ALIGN_STDDEV" - Align the time series by returning the standard deviation 6585 // 6586 // of the values in each alignment period. This aligner is valid for GAUGE and 6587 // DELTA metrics with numeric values. The value_type of the output is DOUBLE. 6588 // 6589 // "ALIGN_COUNT_TRUE" - Align the time series by returning the number of True 6590 // 6591 // values in each alignment period. This aligner is valid for GAUGE metrics 6592 // with Boolean values. The value_type of the output is INT64. 6593 // 6594 // "ALIGN_COUNT_FALSE" - Align the time series by returning the number of 6595 // 6596 // False values in each alignment period. This aligner is valid for GAUGE 6597 // metrics with Boolean values. The value_type of the output is INT64. 6598 // 6599 // "ALIGN_FRACTION_TRUE" - Align the time series by returning the ratio of 6600 // 6601 // the number of True values to the total number of values in each alignment 6602 // period. This aligner is valid for GAUGE metrics with Boolean values. The 6603 // output value is in the range 0.0, 1.0 and has value_type DOUBLE. 6604 // 6605 // "ALIGN_PERCENTILE_99" - Align the time series by using percentile 6606 // 6607 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 6608 // point in each alignment period is the 99th percentile of all data points in 6609 // the period. This aligner is valid for GAUGE and DELTA metrics with 6610 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 6611 // 6612 // "ALIGN_PERCENTILE_95" - Align the time series by using percentile 6613 // 6614 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 6615 // point in each alignment period is the 95th percentile of all data points in 6616 // the period. This aligner is valid for GAUGE and DELTA metrics with 6617 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 6618 // 6619 // "ALIGN_PERCENTILE_50" - Align the time series by using percentile 6620 // 6621 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 6622 // point in each alignment period is the 50th percentile of all data points in 6623 // the period. This aligner is valid for GAUGE and DELTA metrics with 6624 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 6625 // 6626 // "ALIGN_PERCENTILE_05" - Align the time series by using percentile 6627 // 6628 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 6629 // point in each alignment period is the 5th percentile of all data points in 6630 // the period. This aligner is valid for GAUGE and DELTA metrics with 6631 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 6632 // 6633 // "ALIGN_PERCENT_CHANGE" - Align and convert to a percentage change. This 6634 // 6635 // aligner is valid for GAUGE and DELTA metrics with numeric values. This 6636 // alignment returns ((current - previous)/previous) * 100, where the value of 6637 // previous is determined based on the alignment_period.If the values of 6638 // current and previous are both 0, then the returned value is 0. If only 6639 // previous is 0, the returned value is infinity.A 10-minute moving mean is 6640 // computed at each point of the alignment period prior to the above 6641 // calculation to smooth the metric and prevent false positives from very 6642 // short-lived spikes. The moving mean is only applicable for data whose values 6643 // are >= 0. Any values < 0 are treated as a missing datapoint, and are 6644 // ignored. While DELTA metrics are accepted by this alignment, special care 6645 // should be taken that the values for the metric will always be positive. The 6646 // output is a GAUGE metric with value_type DOUBLE. 6647 func (c *OrganizationsTimeSeriesListCall) AggregationPerSeriesAligner(aggregationPerSeriesAligner string) *OrganizationsTimeSeriesListCall { 6648 c.urlParams_.Set("aggregation.perSeriesAligner", aggregationPerSeriesAligner) 6649 return c 6650 } 6651 6652 // Filter sets the optional parameter "filter": Required. A monitoring filter 6653 // (https://cloud.google.com/monitoring/api/v3/filters) that specifies which 6654 // time series should be returned. The filter must specify a single metric 6655 // type, and can additionally specify metric labels and other information. For 6656 // example: metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND 6657 // metric.labels.instance_name = "my-instance-name" 6658 func (c *OrganizationsTimeSeriesListCall) Filter(filter string) *OrganizationsTimeSeriesListCall { 6659 c.urlParams_.Set("filter", filter) 6660 return c 6661 } 6662 6663 // IntervalEndTime sets the optional parameter "interval.endTime": Required. 6664 // The end of the time interval. 6665 func (c *OrganizationsTimeSeriesListCall) IntervalEndTime(intervalEndTime string) *OrganizationsTimeSeriesListCall { 6666 c.urlParams_.Set("interval.endTime", intervalEndTime) 6667 return c 6668 } 6669 6670 // IntervalStartTime sets the optional parameter "interval.startTime": The 6671 // beginning of the time interval. The default value for the start time is the 6672 // end time. The start time must not be later than the end time. 6673 func (c *OrganizationsTimeSeriesListCall) IntervalStartTime(intervalStartTime string) *OrganizationsTimeSeriesListCall { 6674 c.urlParams_.Set("interval.startTime", intervalStartTime) 6675 return c 6676 } 6677 6678 // OrderBy sets the optional parameter "orderBy": Unsupported: must be left 6679 // blank. The points in each time series are currently returned in reverse time 6680 // order (most recent to oldest). 6681 func (c *OrganizationsTimeSeriesListCall) OrderBy(orderBy string) *OrganizationsTimeSeriesListCall { 6682 c.urlParams_.Set("orderBy", orderBy) 6683 return c 6684 } 6685 6686 // PageSize sets the optional parameter "pageSize": A positive number that is 6687 // the maximum number of results to return. If page_size is empty or more than 6688 // 100,000 results, the effective page_size is 100,000 results. If view is set 6689 // to FULL, this is the maximum number of Points returned. If view is set to 6690 // HEADERS, this is the maximum number of TimeSeries returned. 6691 func (c *OrganizationsTimeSeriesListCall) PageSize(pageSize int64) *OrganizationsTimeSeriesListCall { 6692 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6693 return c 6694 } 6695 6696 // PageToken sets the optional parameter "pageToken": If this field is not 6697 // empty then it must contain the nextPageToken value returned by a previous 6698 // call to this method. Using this field causes the method to return additional 6699 // results from the previous method call. 6700 func (c *OrganizationsTimeSeriesListCall) PageToken(pageToken string) *OrganizationsTimeSeriesListCall { 6701 c.urlParams_.Set("pageToken", pageToken) 6702 return c 6703 } 6704 6705 // SecondaryAggregationAlignmentPeriod sets the optional parameter 6706 // "secondaryAggregation.alignmentPeriod": The alignment_period specifies a 6707 // time interval, in seconds, that is used to divide the data in all the time 6708 // series into consistent blocks of time. This will be done before the 6709 // per-series aligner can be applied to the data.The value must be at least 60 6710 // seconds. If a per-series aligner other than ALIGN_NONE is specified, this 6711 // field is required or an error is returned. If no per-series aligner is 6712 // specified, or the aligner ALIGN_NONE is specified, then this field is 6713 // ignored.The maximum value of the alignment_period is 104 weeks (2 years) for 6714 // charts, and 90,000 seconds (25 hours) for alerting policies. 6715 func (c *OrganizationsTimeSeriesListCall) SecondaryAggregationAlignmentPeriod(secondaryAggregationAlignmentPeriod string) *OrganizationsTimeSeriesListCall { 6716 c.urlParams_.Set("secondaryAggregation.alignmentPeriod", secondaryAggregationAlignmentPeriod) 6717 return c 6718 } 6719 6720 // SecondaryAggregationCrossSeriesReducer sets the optional parameter 6721 // "secondaryAggregation.crossSeriesReducer": The reduction operation to be 6722 // used to combine time series into a single time series, where the value of 6723 // each data point in the resulting series is a function of all the already 6724 // aligned values in the input time series.Not all reducer operations can be 6725 // applied to all time series. The valid choices depend on the metric_kind and 6726 // the value_type of the original time series. Reduction can yield a time 6727 // series with a different metric_kind or value_type than the input time 6728 // series.Time series data must first be aligned (see per_series_aligner) in 6729 // order to perform cross-time series reduction. If cross_series_reducer is 6730 // specified, then per_series_aligner must be specified, and must not be 6731 // ALIGN_NONE. An alignment_period must also be specified; otherwise, an error 6732 // is returned. 6733 // 6734 // Possible values: 6735 // 6736 // "REDUCE_NONE" - No cross-time series reduction. The output of the Aligner 6737 // 6738 // is returned. 6739 // 6740 // "REDUCE_MEAN" - Reduce by computing the mean value across time series for 6741 // 6742 // each alignment period. This reducer is valid for DELTA and GAUGE metrics 6743 // with numeric or distribution values. The value_type of the output is DOUBLE. 6744 // 6745 // "REDUCE_MIN" - Reduce by computing the minimum value across time series 6746 // 6747 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 6748 // with numeric values. The value_type of the output is the same as the 6749 // value_type of the input. 6750 // 6751 // "REDUCE_MAX" - Reduce by computing the maximum value across time series 6752 // 6753 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 6754 // with numeric values. The value_type of the output is the same as the 6755 // value_type of the input. 6756 // 6757 // "REDUCE_SUM" - Reduce by computing the sum across time series for each 6758 // 6759 // alignment period. This reducer is valid for DELTA and GAUGE metrics with 6760 // numeric and distribution values. The value_type of the output is the same as 6761 // the value_type of the input. 6762 // 6763 // "REDUCE_STDDEV" - Reduce by computing the standard deviation across time 6764 // 6765 // series for each alignment period. This reducer is valid for DELTA and GAUGE 6766 // metrics with numeric or distribution values. The value_type of the output is 6767 // DOUBLE. 6768 // 6769 // "REDUCE_COUNT" - Reduce by computing the number of data points across time 6770 // 6771 // series for each alignment period. This reducer is valid for DELTA and GAUGE 6772 // metrics of numeric, Boolean, distribution, and string value_type. The 6773 // value_type of the output is INT64. 6774 // 6775 // "REDUCE_COUNT_TRUE" - Reduce by computing the number of True-valued data 6776 // 6777 // points across time series for each alignment period. This reducer is valid 6778 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 6779 // output is INT64. 6780 // 6781 // "REDUCE_COUNT_FALSE" - Reduce by computing the number of False-valued data 6782 // 6783 // points across time series for each alignment period. This reducer is valid 6784 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 6785 // output is INT64. 6786 // 6787 // "REDUCE_FRACTION_TRUE" - Reduce by computing the ratio of the number of 6788 // 6789 // True-valued data points to the total number of data points for each 6790 // alignment period. This reducer is valid for DELTA and GAUGE metrics of 6791 // Boolean value_type. The output value is in the range 0.0, 1.0 and has 6792 // value_type DOUBLE. 6793 // 6794 // "REDUCE_PERCENTILE_99" - Reduce by computing the 99th percentile 6795 // 6796 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 6797 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 6798 // of numeric and distribution type. The value of the output is DOUBLE. 6799 // 6800 // "REDUCE_PERCENTILE_95" - Reduce by computing the 95th percentile 6801 // 6802 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 6803 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 6804 // of numeric and distribution type. The value of the output is DOUBLE. 6805 // 6806 // "REDUCE_PERCENTILE_50" - Reduce by computing the 50th percentile 6807 // 6808 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 6809 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 6810 // of numeric and distribution type. The value of the output is DOUBLE. 6811 // 6812 // "REDUCE_PERCENTILE_05" - Reduce by computing the 5th percentile 6813 // 6814 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 6815 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 6816 // of numeric and distribution type. The value of the output is DOUBLE. 6817 func (c *OrganizationsTimeSeriesListCall) SecondaryAggregationCrossSeriesReducer(secondaryAggregationCrossSeriesReducer string) *OrganizationsTimeSeriesListCall { 6818 c.urlParams_.Set("secondaryAggregation.crossSeriesReducer", secondaryAggregationCrossSeriesReducer) 6819 return c 6820 } 6821 6822 // SecondaryAggregationGroupByFields sets the optional parameter 6823 // "secondaryAggregation.groupByFields": The set of fields to preserve when 6824 // cross_series_reducer is specified. The group_by_fields determine how the 6825 // time series are partitioned into subsets prior to applying the aggregation 6826 // operation. Each subset contains time series that have the same value for 6827 // each of the grouping fields. Each individual time series is a member of 6828 // exactly one subset. The cross_series_reducer is applied to each subset of 6829 // time series. It is not possible to reduce across different resource types, 6830 // so this field implicitly contains resource.type. Fields not specified in 6831 // group_by_fields are aggregated away. If group_by_fields is not specified and 6832 // all the time series have the same resource type, then the time series are 6833 // aggregated into a single output time series. If cross_series_reducer is not 6834 // defined, this field is ignored. 6835 func (c *OrganizationsTimeSeriesListCall) SecondaryAggregationGroupByFields(secondaryAggregationGroupByFields ...string) *OrganizationsTimeSeriesListCall { 6836 c.urlParams_.SetMulti("secondaryAggregation.groupByFields", append([]string{}, secondaryAggregationGroupByFields...)) 6837 return c 6838 } 6839 6840 // SecondaryAggregationPerSeriesAligner sets the optional parameter 6841 // "secondaryAggregation.perSeriesAligner": An Aligner describes how to bring 6842 // the data points in a single time series into temporal alignment. Except for 6843 // ALIGN_NONE, all alignments cause all the data points in an alignment_period 6844 // to be mathematically grouped together, resulting in a single data point for 6845 // each alignment_period with end timestamp at the end of the period.Not all 6846 // alignment operations may be applied to all time series. The valid choices 6847 // depend on the metric_kind and value_type of the original time series. 6848 // Alignment can change the metric_kind or the value_type of the time 6849 // series.Time series data must be aligned in order to perform cross-time 6850 // series reduction. If cross_series_reducer is specified, then 6851 // per_series_aligner must be specified and not equal to ALIGN_NONE and 6852 // alignment_period must be specified; otherwise, an error is returned. 6853 // 6854 // Possible values: 6855 // 6856 // "ALIGN_NONE" - No alignment. Raw data is returned. Not valid if 6857 // 6858 // cross-series reduction is requested. The value_type of the result is the 6859 // same as the value_type of the input. 6860 // 6861 // "ALIGN_DELTA" - Align and convert to DELTA. The output is delta = y1 - 6862 // 6863 // y0.This alignment is valid for CUMULATIVE and DELTA metrics. If the selected 6864 // alignment period results in periods with no data, then the aligned value for 6865 // such a period is created by interpolation. The value_type of the aligned 6866 // result is the same as the value_type of the input. 6867 // 6868 // "ALIGN_RATE" - Align and convert to a rate. The result is computed as rate 6869 // 6870 // = (y1 - y0)/(t1 - t0), or "delta over time". Think of this aligner as 6871 // providing the slope of the line that passes through the value at the start 6872 // and at the end of the alignment_period.This aligner is valid for CUMULATIVE 6873 // and DELTA metrics with numeric values. If the selected alignment period 6874 // results in periods with no data, then the aligned value for such a period is 6875 // created by interpolation. The output is a GAUGE metric with value_type 6876 // DOUBLE.If, by "rate", you mean "percentage change", see the 6877 // ALIGN_PERCENT_CHANGE aligner instead. 6878 // 6879 // "ALIGN_INTERPOLATE" - Align by interpolating between adjacent points 6880 // 6881 // around the alignment period boundary. This aligner is valid for GAUGE 6882 // metrics with numeric values. The value_type of the aligned result is the 6883 // same as the value_type of the input. 6884 // 6885 // "ALIGN_NEXT_OLDER" - Align by moving the most recent data point before the 6886 // 6887 // end of the alignment period to the boundary at the end of the alignment 6888 // period. This aligner is valid for GAUGE metrics. The value_type of the 6889 // aligned result is the same as the value_type of the input. 6890 // 6891 // "ALIGN_MIN" - Align the time series by returning the minimum value in each 6892 // 6893 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 6894 // numeric values. The value_type of the aligned result is the same as the 6895 // value_type of the input. 6896 // 6897 // "ALIGN_MAX" - Align the time series by returning the maximum value in each 6898 // 6899 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 6900 // numeric values. The value_type of the aligned result is the same as the 6901 // value_type of the input. 6902 // 6903 // "ALIGN_MEAN" - Align the time series by returning the mean value in each 6904 // 6905 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 6906 // numeric values. The value_type of the aligned result is DOUBLE. 6907 // 6908 // "ALIGN_COUNT" - Align the time series by returning the number of values in 6909 // 6910 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 6911 // with numeric or Boolean values. The value_type of the aligned result is 6912 // INT64. 6913 // 6914 // "ALIGN_SUM" - Align the time series by returning the sum of the values in 6915 // 6916 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 6917 // with numeric and distribution values. The value_type of the aligned result 6918 // is the same as the value_type of the input. 6919 // 6920 // "ALIGN_STDDEV" - Align the time series by returning the standard deviation 6921 // 6922 // of the values in each alignment period. This aligner is valid for GAUGE and 6923 // DELTA metrics with numeric values. The value_type of the output is DOUBLE. 6924 // 6925 // "ALIGN_COUNT_TRUE" - Align the time series by returning the number of True 6926 // 6927 // values in each alignment period. This aligner is valid for GAUGE metrics 6928 // with Boolean values. The value_type of the output is INT64. 6929 // 6930 // "ALIGN_COUNT_FALSE" - Align the time series by returning the number of 6931 // 6932 // False values in each alignment period. This aligner is valid for GAUGE 6933 // metrics with Boolean values. The value_type of the output is INT64. 6934 // 6935 // "ALIGN_FRACTION_TRUE" - Align the time series by returning the ratio of 6936 // 6937 // the number of True values to the total number of values in each alignment 6938 // period. This aligner is valid for GAUGE metrics with Boolean values. The 6939 // output value is in the range 0.0, 1.0 and has value_type DOUBLE. 6940 // 6941 // "ALIGN_PERCENTILE_99" - Align the time series by using percentile 6942 // 6943 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 6944 // point in each alignment period is the 99th percentile of all data points in 6945 // the period. This aligner is valid for GAUGE and DELTA metrics with 6946 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 6947 // 6948 // "ALIGN_PERCENTILE_95" - Align the time series by using percentile 6949 // 6950 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 6951 // point in each alignment period is the 95th percentile of all data points in 6952 // the period. This aligner is valid for GAUGE and DELTA metrics with 6953 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 6954 // 6955 // "ALIGN_PERCENTILE_50" - Align the time series by using percentile 6956 // 6957 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 6958 // point in each alignment period is the 50th percentile of all data points in 6959 // the period. This aligner is valid for GAUGE and DELTA metrics with 6960 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 6961 // 6962 // "ALIGN_PERCENTILE_05" - Align the time series by using percentile 6963 // 6964 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 6965 // point in each alignment period is the 5th percentile of all data points in 6966 // the period. This aligner is valid for GAUGE and DELTA metrics with 6967 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 6968 // 6969 // "ALIGN_PERCENT_CHANGE" - Align and convert to a percentage change. This 6970 // 6971 // aligner is valid for GAUGE and DELTA metrics with numeric values. This 6972 // alignment returns ((current - previous)/previous) * 100, where the value of 6973 // previous is determined based on the alignment_period.If the values of 6974 // current and previous are both 0, then the returned value is 0. If only 6975 // previous is 0, the returned value is infinity.A 10-minute moving mean is 6976 // computed at each point of the alignment period prior to the above 6977 // calculation to smooth the metric and prevent false positives from very 6978 // short-lived spikes. The moving mean is only applicable for data whose values 6979 // are >= 0. Any values < 0 are treated as a missing datapoint, and are 6980 // ignored. While DELTA metrics are accepted by this alignment, special care 6981 // should be taken that the values for the metric will always be positive. The 6982 // output is a GAUGE metric with value_type DOUBLE. 6983 func (c *OrganizationsTimeSeriesListCall) SecondaryAggregationPerSeriesAligner(secondaryAggregationPerSeriesAligner string) *OrganizationsTimeSeriesListCall { 6984 c.urlParams_.Set("secondaryAggregation.perSeriesAligner", secondaryAggregationPerSeriesAligner) 6985 return c 6986 } 6987 6988 // View sets the optional parameter "view": Required. Specifies which 6989 // information is returned about the time series. 6990 // 6991 // Possible values: 6992 // 6993 // "FULL" - Returns the identity of the metric(s), the time series, and the 6994 // 6995 // time series data. 6996 // 6997 // "HEADERS" - Returns the identity of the metric and the time series 6998 // 6999 // resource, but not the time series data. 7000 func (c *OrganizationsTimeSeriesListCall) View(view string) *OrganizationsTimeSeriesListCall { 7001 c.urlParams_.Set("view", view) 7002 return c 7003 } 7004 7005 // Fields allows partial responses to be retrieved. See 7006 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7007 // details. 7008 func (c *OrganizationsTimeSeriesListCall) Fields(s ...googleapi.Field) *OrganizationsTimeSeriesListCall { 7009 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7010 return c 7011 } 7012 7013 // IfNoneMatch sets an optional parameter which makes the operation fail if the 7014 // object's ETag matches the given value. This is useful for getting updates 7015 // only after the object has changed since the last request. 7016 func (c *OrganizationsTimeSeriesListCall) IfNoneMatch(entityTag string) *OrganizationsTimeSeriesListCall { 7017 c.ifNoneMatch_ = entityTag 7018 return c 7019 } 7020 7021 // Context sets the context to be used in this call's Do method. 7022 func (c *OrganizationsTimeSeriesListCall) Context(ctx context.Context) *OrganizationsTimeSeriesListCall { 7023 c.ctx_ = ctx 7024 return c 7025 } 7026 7027 // Header returns a http.Header that can be modified by the caller to add 7028 // headers to the request. 7029 func (c *OrganizationsTimeSeriesListCall) Header() http.Header { 7030 if c.header_ == nil { 7031 c.header_ = make(http.Header) 7032 } 7033 return c.header_ 7034 } 7035 7036 func (c *OrganizationsTimeSeriesListCall) doRequest(alt string) (*http.Response, error) { 7037 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 7038 if c.ifNoneMatch_ != "" { 7039 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7040 } 7041 var body io.Reader = nil 7042 c.urlParams_.Set("alt", alt) 7043 c.urlParams_.Set("prettyPrint", "false") 7044 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/timeSeries") 7045 urls += "?" + c.urlParams_.Encode() 7046 req, err := http.NewRequest("GET", urls, body) 7047 if err != nil { 7048 return nil, err 7049 } 7050 req.Header = reqHeaders 7051 googleapi.Expand(req.URL, map[string]string{ 7052 "name": c.name, 7053 }) 7054 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7055 } 7056 7057 // Do executes the "monitoring.organizations.timeSeries.list" call. 7058 // Any non-2xx status code is an error. Response headers are in either 7059 // *ListTimeSeriesResponse.ServerResponse.Header or (if a response was returned 7060 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7061 // check whether the returned error was because http.StatusNotModified was 7062 // returned. 7063 func (c *OrganizationsTimeSeriesListCall) Do(opts ...googleapi.CallOption) (*ListTimeSeriesResponse, error) { 7064 gensupport.SetOptions(c.urlParams_, opts...) 7065 res, err := c.doRequest("json") 7066 if res != nil && res.StatusCode == http.StatusNotModified { 7067 if res.Body != nil { 7068 res.Body.Close() 7069 } 7070 return nil, gensupport.WrapError(&googleapi.Error{ 7071 Code: res.StatusCode, 7072 Header: res.Header, 7073 }) 7074 } 7075 if err != nil { 7076 return nil, err 7077 } 7078 defer googleapi.CloseBody(res) 7079 if err := googleapi.CheckResponse(res); err != nil { 7080 return nil, gensupport.WrapError(err) 7081 } 7082 ret := &ListTimeSeriesResponse{ 7083 ServerResponse: googleapi.ServerResponse{ 7084 Header: res.Header, 7085 HTTPStatusCode: res.StatusCode, 7086 }, 7087 } 7088 target := &ret 7089 if err := gensupport.DecodeResponse(target, res); err != nil { 7090 return nil, err 7091 } 7092 return ret, nil 7093 } 7094 7095 // Pages invokes f for each page of results. 7096 // A non-nil error returned from f will halt the iteration. 7097 // The provided context supersedes any context provided to the Context method. 7098 func (c *OrganizationsTimeSeriesListCall) Pages(ctx context.Context, f func(*ListTimeSeriesResponse) error) error { 7099 c.ctx_ = ctx 7100 defer c.PageToken(c.urlParams_.Get("pageToken")) 7101 for { 7102 x, err := c.Do() 7103 if err != nil { 7104 return err 7105 } 7106 if err := f(x); err != nil { 7107 return err 7108 } 7109 if x.NextPageToken == "" { 7110 return nil 7111 } 7112 c.PageToken(x.NextPageToken) 7113 } 7114 } 7115 7116 type ProjectsAlertPoliciesCreateCall struct { 7117 s *Service 7118 name string 7119 alertpolicy *AlertPolicy 7120 urlParams_ gensupport.URLParams 7121 ctx_ context.Context 7122 header_ http.Header 7123 } 7124 7125 // Create: Creates a new alerting policy.Design your application to 7126 // single-thread API calls that modify the state of alerting policies in a 7127 // single project. This includes calls to CreateAlertPolicy, DeleteAlertPolicy 7128 // and UpdateAlertPolicy. 7129 // 7130 // - name: The project 7131 // (https://cloud.google.com/monitoring/api/v3#project_name) in which to 7132 // create the alerting policy. The format is: projects/[PROJECT_ID_OR_NUMBER] 7133 // Note that this field names the parent container in which the alerting 7134 // policy will be written, not the name of the created policy. |name| must be 7135 // a host project of a Metrics Scope, otherwise INVALID_ARGUMENT error will 7136 // return. The alerting policy that is returned will have a name that 7137 // contains a normalized representation of this name as a prefix but adds a 7138 // suffix of the form /alertPolicies/[ALERT_POLICY_ID], identifying the 7139 // policy in the container. 7140 func (r *ProjectsAlertPoliciesService) Create(name string, alertpolicy *AlertPolicy) *ProjectsAlertPoliciesCreateCall { 7141 c := &ProjectsAlertPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7142 c.name = name 7143 c.alertpolicy = alertpolicy 7144 return c 7145 } 7146 7147 // Fields allows partial responses to be retrieved. See 7148 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7149 // details. 7150 func (c *ProjectsAlertPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsAlertPoliciesCreateCall { 7151 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7152 return c 7153 } 7154 7155 // Context sets the context to be used in this call's Do method. 7156 func (c *ProjectsAlertPoliciesCreateCall) Context(ctx context.Context) *ProjectsAlertPoliciesCreateCall { 7157 c.ctx_ = ctx 7158 return c 7159 } 7160 7161 // Header returns a http.Header that can be modified by the caller to add 7162 // headers to the request. 7163 func (c *ProjectsAlertPoliciesCreateCall) Header() http.Header { 7164 if c.header_ == nil { 7165 c.header_ = make(http.Header) 7166 } 7167 return c.header_ 7168 } 7169 7170 func (c *ProjectsAlertPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { 7171 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 7172 var body io.Reader = nil 7173 body, err := googleapi.WithoutDataWrapper.JSONReader(c.alertpolicy) 7174 if err != nil { 7175 return nil, err 7176 } 7177 c.urlParams_.Set("alt", alt) 7178 c.urlParams_.Set("prettyPrint", "false") 7179 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/alertPolicies") 7180 urls += "?" + c.urlParams_.Encode() 7181 req, err := http.NewRequest("POST", urls, body) 7182 if err != nil { 7183 return nil, err 7184 } 7185 req.Header = reqHeaders 7186 googleapi.Expand(req.URL, map[string]string{ 7187 "name": c.name, 7188 }) 7189 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7190 } 7191 7192 // Do executes the "monitoring.projects.alertPolicies.create" call. 7193 // Any non-2xx status code is an error. Response headers are in either 7194 // *AlertPolicy.ServerResponse.Header or (if a response was returned at all) in 7195 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7196 // whether the returned error was because http.StatusNotModified was returned. 7197 func (c *ProjectsAlertPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*AlertPolicy, error) { 7198 gensupport.SetOptions(c.urlParams_, opts...) 7199 res, err := c.doRequest("json") 7200 if res != nil && res.StatusCode == http.StatusNotModified { 7201 if res.Body != nil { 7202 res.Body.Close() 7203 } 7204 return nil, gensupport.WrapError(&googleapi.Error{ 7205 Code: res.StatusCode, 7206 Header: res.Header, 7207 }) 7208 } 7209 if err != nil { 7210 return nil, err 7211 } 7212 defer googleapi.CloseBody(res) 7213 if err := googleapi.CheckResponse(res); err != nil { 7214 return nil, gensupport.WrapError(err) 7215 } 7216 ret := &AlertPolicy{ 7217 ServerResponse: googleapi.ServerResponse{ 7218 Header: res.Header, 7219 HTTPStatusCode: res.StatusCode, 7220 }, 7221 } 7222 target := &ret 7223 if err := gensupport.DecodeResponse(target, res); err != nil { 7224 return nil, err 7225 } 7226 return ret, nil 7227 } 7228 7229 type ProjectsAlertPoliciesDeleteCall struct { 7230 s *Service 7231 name string 7232 urlParams_ gensupport.URLParams 7233 ctx_ context.Context 7234 header_ http.Header 7235 } 7236 7237 // Delete: Deletes an alerting policy.Design your application to single-thread 7238 // API calls that modify the state of alerting policies in a single project. 7239 // This includes calls to CreateAlertPolicy, DeleteAlertPolicy and 7240 // UpdateAlertPolicy. 7241 // 7242 // - name: The alerting policy to delete. The format is: 7243 // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] For more 7244 // information, see AlertPolicy. 7245 func (r *ProjectsAlertPoliciesService) Delete(name string) *ProjectsAlertPoliciesDeleteCall { 7246 c := &ProjectsAlertPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7247 c.name = name 7248 return c 7249 } 7250 7251 // Fields allows partial responses to be retrieved. See 7252 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7253 // details. 7254 func (c *ProjectsAlertPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsAlertPoliciesDeleteCall { 7255 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7256 return c 7257 } 7258 7259 // Context sets the context to be used in this call's Do method. 7260 func (c *ProjectsAlertPoliciesDeleteCall) Context(ctx context.Context) *ProjectsAlertPoliciesDeleteCall { 7261 c.ctx_ = ctx 7262 return c 7263 } 7264 7265 // Header returns a http.Header that can be modified by the caller to add 7266 // headers to the request. 7267 func (c *ProjectsAlertPoliciesDeleteCall) Header() http.Header { 7268 if c.header_ == nil { 7269 c.header_ = make(http.Header) 7270 } 7271 return c.header_ 7272 } 7273 7274 func (c *ProjectsAlertPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { 7275 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 7276 var body io.Reader = nil 7277 c.urlParams_.Set("alt", alt) 7278 c.urlParams_.Set("prettyPrint", "false") 7279 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 7280 urls += "?" + c.urlParams_.Encode() 7281 req, err := http.NewRequest("DELETE", urls, body) 7282 if err != nil { 7283 return nil, err 7284 } 7285 req.Header = reqHeaders 7286 googleapi.Expand(req.URL, map[string]string{ 7287 "name": c.name, 7288 }) 7289 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7290 } 7291 7292 // Do executes the "monitoring.projects.alertPolicies.delete" call. 7293 // Any non-2xx status code is an error. Response headers are in either 7294 // *Empty.ServerResponse.Header or (if a response was returned at all) in 7295 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7296 // whether the returned error was because http.StatusNotModified was returned. 7297 func (c *ProjectsAlertPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 7298 gensupport.SetOptions(c.urlParams_, opts...) 7299 res, err := c.doRequest("json") 7300 if res != nil && res.StatusCode == http.StatusNotModified { 7301 if res.Body != nil { 7302 res.Body.Close() 7303 } 7304 return nil, gensupport.WrapError(&googleapi.Error{ 7305 Code: res.StatusCode, 7306 Header: res.Header, 7307 }) 7308 } 7309 if err != nil { 7310 return nil, err 7311 } 7312 defer googleapi.CloseBody(res) 7313 if err := googleapi.CheckResponse(res); err != nil { 7314 return nil, gensupport.WrapError(err) 7315 } 7316 ret := &Empty{ 7317 ServerResponse: googleapi.ServerResponse{ 7318 Header: res.Header, 7319 HTTPStatusCode: res.StatusCode, 7320 }, 7321 } 7322 target := &ret 7323 if err := gensupport.DecodeResponse(target, res); err != nil { 7324 return nil, err 7325 } 7326 return ret, nil 7327 } 7328 7329 type ProjectsAlertPoliciesGetCall struct { 7330 s *Service 7331 name string 7332 urlParams_ gensupport.URLParams 7333 ifNoneMatch_ string 7334 ctx_ context.Context 7335 header_ http.Header 7336 } 7337 7338 // Get: Gets a single alerting policy. 7339 // 7340 // - name: The alerting policy to retrieve. The format is: 7341 // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID]. 7342 func (r *ProjectsAlertPoliciesService) Get(name string) *ProjectsAlertPoliciesGetCall { 7343 c := &ProjectsAlertPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7344 c.name = name 7345 return c 7346 } 7347 7348 // Fields allows partial responses to be retrieved. See 7349 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7350 // details. 7351 func (c *ProjectsAlertPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsAlertPoliciesGetCall { 7352 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7353 return c 7354 } 7355 7356 // IfNoneMatch sets an optional parameter which makes the operation fail if the 7357 // object's ETag matches the given value. This is useful for getting updates 7358 // only after the object has changed since the last request. 7359 func (c *ProjectsAlertPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsAlertPoliciesGetCall { 7360 c.ifNoneMatch_ = entityTag 7361 return c 7362 } 7363 7364 // Context sets the context to be used in this call's Do method. 7365 func (c *ProjectsAlertPoliciesGetCall) Context(ctx context.Context) *ProjectsAlertPoliciesGetCall { 7366 c.ctx_ = ctx 7367 return c 7368 } 7369 7370 // Header returns a http.Header that can be modified by the caller to add 7371 // headers to the request. 7372 func (c *ProjectsAlertPoliciesGetCall) Header() http.Header { 7373 if c.header_ == nil { 7374 c.header_ = make(http.Header) 7375 } 7376 return c.header_ 7377 } 7378 7379 func (c *ProjectsAlertPoliciesGetCall) doRequest(alt string) (*http.Response, error) { 7380 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 7381 if c.ifNoneMatch_ != "" { 7382 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7383 } 7384 var body io.Reader = nil 7385 c.urlParams_.Set("alt", alt) 7386 c.urlParams_.Set("prettyPrint", "false") 7387 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 7388 urls += "?" + c.urlParams_.Encode() 7389 req, err := http.NewRequest("GET", urls, body) 7390 if err != nil { 7391 return nil, err 7392 } 7393 req.Header = reqHeaders 7394 googleapi.Expand(req.URL, map[string]string{ 7395 "name": c.name, 7396 }) 7397 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7398 } 7399 7400 // Do executes the "monitoring.projects.alertPolicies.get" call. 7401 // Any non-2xx status code is an error. Response headers are in either 7402 // *AlertPolicy.ServerResponse.Header or (if a response was returned at all) in 7403 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7404 // whether the returned error was because http.StatusNotModified was returned. 7405 func (c *ProjectsAlertPoliciesGetCall) Do(opts ...googleapi.CallOption) (*AlertPolicy, error) { 7406 gensupport.SetOptions(c.urlParams_, opts...) 7407 res, err := c.doRequest("json") 7408 if res != nil && res.StatusCode == http.StatusNotModified { 7409 if res.Body != nil { 7410 res.Body.Close() 7411 } 7412 return nil, gensupport.WrapError(&googleapi.Error{ 7413 Code: res.StatusCode, 7414 Header: res.Header, 7415 }) 7416 } 7417 if err != nil { 7418 return nil, err 7419 } 7420 defer googleapi.CloseBody(res) 7421 if err := googleapi.CheckResponse(res); err != nil { 7422 return nil, gensupport.WrapError(err) 7423 } 7424 ret := &AlertPolicy{ 7425 ServerResponse: googleapi.ServerResponse{ 7426 Header: res.Header, 7427 HTTPStatusCode: res.StatusCode, 7428 }, 7429 } 7430 target := &ret 7431 if err := gensupport.DecodeResponse(target, res); err != nil { 7432 return nil, err 7433 } 7434 return ret, nil 7435 } 7436 7437 type ProjectsAlertPoliciesListCall struct { 7438 s *Service 7439 name string 7440 urlParams_ gensupport.URLParams 7441 ifNoneMatch_ string 7442 ctx_ context.Context 7443 header_ http.Header 7444 } 7445 7446 // List: Lists the existing alerting policies for the workspace. 7447 // 7448 // - name: The project 7449 // (https://cloud.google.com/monitoring/api/v3#project_name) whose alert 7450 // policies are to be listed. The format is: projects/[PROJECT_ID_OR_NUMBER] 7451 // Note that this field names the parent container in which the alerting 7452 // policies to be listed are stored. To retrieve a single alerting policy by 7453 // name, use the GetAlertPolicy operation, instead. 7454 func (r *ProjectsAlertPoliciesService) List(name string) *ProjectsAlertPoliciesListCall { 7455 c := &ProjectsAlertPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7456 c.name = name 7457 return c 7458 } 7459 7460 // Filter sets the optional parameter "filter": If provided, this field 7461 // specifies the criteria that must be met by alert policies to be included in 7462 // the response.For more details, see sorting and filtering 7463 // (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). 7464 func (c *ProjectsAlertPoliciesListCall) Filter(filter string) *ProjectsAlertPoliciesListCall { 7465 c.urlParams_.Set("filter", filter) 7466 return c 7467 } 7468 7469 // OrderBy sets the optional parameter "orderBy": A comma-separated list of 7470 // fields by which to sort the result. Supports the same set of field 7471 // references as the filter field. Entries can be prefixed with a minus sign to 7472 // sort by the field in descending order.For more details, see sorting and 7473 // filtering 7474 // (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). 7475 func (c *ProjectsAlertPoliciesListCall) OrderBy(orderBy string) *ProjectsAlertPoliciesListCall { 7476 c.urlParams_.Set("orderBy", orderBy) 7477 return c 7478 } 7479 7480 // PageSize sets the optional parameter "pageSize": The maximum number of 7481 // results to return in a single response. 7482 func (c *ProjectsAlertPoliciesListCall) PageSize(pageSize int64) *ProjectsAlertPoliciesListCall { 7483 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7484 return c 7485 } 7486 7487 // PageToken sets the optional parameter "pageToken": If this field is not 7488 // empty then it must contain the nextPageToken value returned by a previous 7489 // call to this method. Using this field causes the method to return more 7490 // results from the previous method call. 7491 func (c *ProjectsAlertPoliciesListCall) PageToken(pageToken string) *ProjectsAlertPoliciesListCall { 7492 c.urlParams_.Set("pageToken", pageToken) 7493 return c 7494 } 7495 7496 // Fields allows partial responses to be retrieved. See 7497 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7498 // details. 7499 func (c *ProjectsAlertPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsAlertPoliciesListCall { 7500 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7501 return c 7502 } 7503 7504 // IfNoneMatch sets an optional parameter which makes the operation fail if the 7505 // object's ETag matches the given value. This is useful for getting updates 7506 // only after the object has changed since the last request. 7507 func (c *ProjectsAlertPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsAlertPoliciesListCall { 7508 c.ifNoneMatch_ = entityTag 7509 return c 7510 } 7511 7512 // Context sets the context to be used in this call's Do method. 7513 func (c *ProjectsAlertPoliciesListCall) Context(ctx context.Context) *ProjectsAlertPoliciesListCall { 7514 c.ctx_ = ctx 7515 return c 7516 } 7517 7518 // Header returns a http.Header that can be modified by the caller to add 7519 // headers to the request. 7520 func (c *ProjectsAlertPoliciesListCall) Header() http.Header { 7521 if c.header_ == nil { 7522 c.header_ = make(http.Header) 7523 } 7524 return c.header_ 7525 } 7526 7527 func (c *ProjectsAlertPoliciesListCall) doRequest(alt string) (*http.Response, error) { 7528 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 7529 if c.ifNoneMatch_ != "" { 7530 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7531 } 7532 var body io.Reader = nil 7533 c.urlParams_.Set("alt", alt) 7534 c.urlParams_.Set("prettyPrint", "false") 7535 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/alertPolicies") 7536 urls += "?" + c.urlParams_.Encode() 7537 req, err := http.NewRequest("GET", urls, body) 7538 if err != nil { 7539 return nil, err 7540 } 7541 req.Header = reqHeaders 7542 googleapi.Expand(req.URL, map[string]string{ 7543 "name": c.name, 7544 }) 7545 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7546 } 7547 7548 // Do executes the "monitoring.projects.alertPolicies.list" call. 7549 // Any non-2xx status code is an error. Response headers are in either 7550 // *ListAlertPoliciesResponse.ServerResponse.Header or (if a response was 7551 // returned at all) in error.(*googleapi.Error).Header. Use 7552 // googleapi.IsNotModified to check whether the returned error was because 7553 // http.StatusNotModified was returned. 7554 func (c *ProjectsAlertPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListAlertPoliciesResponse, error) { 7555 gensupport.SetOptions(c.urlParams_, opts...) 7556 res, err := c.doRequest("json") 7557 if res != nil && res.StatusCode == http.StatusNotModified { 7558 if res.Body != nil { 7559 res.Body.Close() 7560 } 7561 return nil, gensupport.WrapError(&googleapi.Error{ 7562 Code: res.StatusCode, 7563 Header: res.Header, 7564 }) 7565 } 7566 if err != nil { 7567 return nil, err 7568 } 7569 defer googleapi.CloseBody(res) 7570 if err := googleapi.CheckResponse(res); err != nil { 7571 return nil, gensupport.WrapError(err) 7572 } 7573 ret := &ListAlertPoliciesResponse{ 7574 ServerResponse: googleapi.ServerResponse{ 7575 Header: res.Header, 7576 HTTPStatusCode: res.StatusCode, 7577 }, 7578 } 7579 target := &ret 7580 if err := gensupport.DecodeResponse(target, res); err != nil { 7581 return nil, err 7582 } 7583 return ret, nil 7584 } 7585 7586 // Pages invokes f for each page of results. 7587 // A non-nil error returned from f will halt the iteration. 7588 // The provided context supersedes any context provided to the Context method. 7589 func (c *ProjectsAlertPoliciesListCall) Pages(ctx context.Context, f func(*ListAlertPoliciesResponse) error) error { 7590 c.ctx_ = ctx 7591 defer c.PageToken(c.urlParams_.Get("pageToken")) 7592 for { 7593 x, err := c.Do() 7594 if err != nil { 7595 return err 7596 } 7597 if err := f(x); err != nil { 7598 return err 7599 } 7600 if x.NextPageToken == "" { 7601 return nil 7602 } 7603 c.PageToken(x.NextPageToken) 7604 } 7605 } 7606 7607 type ProjectsAlertPoliciesPatchCall struct { 7608 s *Service 7609 name string 7610 alertpolicy *AlertPolicy 7611 urlParams_ gensupport.URLParams 7612 ctx_ context.Context 7613 header_ http.Header 7614 } 7615 7616 // Patch: Updates an alerting policy. You can either replace the entire policy 7617 // with a new one or replace only certain fields in the current alerting policy 7618 // by specifying the fields to be updated via updateMask. Returns the updated 7619 // alerting policy.Design your application to single-thread API calls that 7620 // modify the state of alerting policies in a single project. This includes 7621 // calls to CreateAlertPolicy, DeleteAlertPolicy and UpdateAlertPolicy. 7622 // 7623 // - name: Required if the policy exists. The resource name for this policy. 7624 // The format is: 7625 // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] 7626 // [ALERT_POLICY_ID] is assigned by Cloud Monitoring when the policy is 7627 // created. When calling the alertPolicies.create method, do not include the 7628 // name field in the alerting policy passed as part of the request. 7629 func (r *ProjectsAlertPoliciesService) Patch(name string, alertpolicy *AlertPolicy) *ProjectsAlertPoliciesPatchCall { 7630 c := &ProjectsAlertPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7631 c.name = name 7632 c.alertpolicy = alertpolicy 7633 return c 7634 } 7635 7636 // UpdateMask sets the optional parameter "updateMask": A list of alerting 7637 // policy field names. If this field is not empty, each listed field in the 7638 // existing alerting policy is set to the value of the corresponding field in 7639 // the supplied policy (alert_policy), or to the field's default value if the 7640 // field is not in the supplied alerting policy. Fields not listed retain their 7641 // previous value.Examples of valid field masks include display_name, 7642 // documentation, documentation.content, documentation.mime_type, user_labels, 7643 // user_label.nameofkey, enabled, conditions, combiner, etc.If this field is 7644 // empty, then the supplied alerting policy replaces the existing policy. It is 7645 // the same as deleting the existing policy and adding the supplied policy, 7646 // except for the following: The new policy will have the same 7647 // [ALERT_POLICY_ID] as the former policy. This gives you continuity with the 7648 // former policy in your notifications and incidents. Conditions in the new 7649 // policy will keep their former [CONDITION_ID] if the supplied condition 7650 // includes the name field with that [CONDITION_ID]. If the supplied condition 7651 // omits the name field, then a new [CONDITION_ID] is created. 7652 func (c *ProjectsAlertPoliciesPatchCall) UpdateMask(updateMask string) *ProjectsAlertPoliciesPatchCall { 7653 c.urlParams_.Set("updateMask", updateMask) 7654 return c 7655 } 7656 7657 // Fields allows partial responses to be retrieved. See 7658 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7659 // details. 7660 func (c *ProjectsAlertPoliciesPatchCall) Fields(s ...googleapi.Field) *ProjectsAlertPoliciesPatchCall { 7661 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7662 return c 7663 } 7664 7665 // Context sets the context to be used in this call's Do method. 7666 func (c *ProjectsAlertPoliciesPatchCall) Context(ctx context.Context) *ProjectsAlertPoliciesPatchCall { 7667 c.ctx_ = ctx 7668 return c 7669 } 7670 7671 // Header returns a http.Header that can be modified by the caller to add 7672 // headers to the request. 7673 func (c *ProjectsAlertPoliciesPatchCall) Header() http.Header { 7674 if c.header_ == nil { 7675 c.header_ = make(http.Header) 7676 } 7677 return c.header_ 7678 } 7679 7680 func (c *ProjectsAlertPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { 7681 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 7682 var body io.Reader = nil 7683 body, err := googleapi.WithoutDataWrapper.JSONReader(c.alertpolicy) 7684 if err != nil { 7685 return nil, err 7686 } 7687 c.urlParams_.Set("alt", alt) 7688 c.urlParams_.Set("prettyPrint", "false") 7689 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 7690 urls += "?" + c.urlParams_.Encode() 7691 req, err := http.NewRequest("PATCH", urls, body) 7692 if err != nil { 7693 return nil, err 7694 } 7695 req.Header = reqHeaders 7696 googleapi.Expand(req.URL, map[string]string{ 7697 "name": c.name, 7698 }) 7699 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7700 } 7701 7702 // Do executes the "monitoring.projects.alertPolicies.patch" call. 7703 // Any non-2xx status code is an error. Response headers are in either 7704 // *AlertPolicy.ServerResponse.Header or (if a response was returned at all) in 7705 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7706 // whether the returned error was because http.StatusNotModified was returned. 7707 func (c *ProjectsAlertPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*AlertPolicy, error) { 7708 gensupport.SetOptions(c.urlParams_, opts...) 7709 res, err := c.doRequest("json") 7710 if res != nil && res.StatusCode == http.StatusNotModified { 7711 if res.Body != nil { 7712 res.Body.Close() 7713 } 7714 return nil, gensupport.WrapError(&googleapi.Error{ 7715 Code: res.StatusCode, 7716 Header: res.Header, 7717 }) 7718 } 7719 if err != nil { 7720 return nil, err 7721 } 7722 defer googleapi.CloseBody(res) 7723 if err := googleapi.CheckResponse(res); err != nil { 7724 return nil, gensupport.WrapError(err) 7725 } 7726 ret := &AlertPolicy{ 7727 ServerResponse: googleapi.ServerResponse{ 7728 Header: res.Header, 7729 HTTPStatusCode: res.StatusCode, 7730 }, 7731 } 7732 target := &ret 7733 if err := gensupport.DecodeResponse(target, res); err != nil { 7734 return nil, err 7735 } 7736 return ret, nil 7737 } 7738 7739 type ProjectsCollectdTimeSeriesCreateCall struct { 7740 s *Service 7741 name string 7742 createcollectdtimeseriesrequest *CreateCollectdTimeSeriesRequest 7743 urlParams_ gensupport.URLParams 7744 ctx_ context.Context 7745 header_ http.Header 7746 } 7747 7748 // Create: Cloud Monitoring Agent only: Creates a new time series.This method 7749 // is only for use by the Cloud Monitoring Agent. Use 7750 // projects.timeSeries.create instead. 7751 // 7752 // - name: The project 7753 // (https://cloud.google.com/monitoring/api/v3#project_name) in which to 7754 // create the time series. The format is: projects/[PROJECT_ID_OR_NUMBER]. 7755 func (r *ProjectsCollectdTimeSeriesService) Create(name string, createcollectdtimeseriesrequest *CreateCollectdTimeSeriesRequest) *ProjectsCollectdTimeSeriesCreateCall { 7756 c := &ProjectsCollectdTimeSeriesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7757 c.name = name 7758 c.createcollectdtimeseriesrequest = createcollectdtimeseriesrequest 7759 return c 7760 } 7761 7762 // Fields allows partial responses to be retrieved. See 7763 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7764 // details. 7765 func (c *ProjectsCollectdTimeSeriesCreateCall) Fields(s ...googleapi.Field) *ProjectsCollectdTimeSeriesCreateCall { 7766 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7767 return c 7768 } 7769 7770 // Context sets the context to be used in this call's Do method. 7771 func (c *ProjectsCollectdTimeSeriesCreateCall) Context(ctx context.Context) *ProjectsCollectdTimeSeriesCreateCall { 7772 c.ctx_ = ctx 7773 return c 7774 } 7775 7776 // Header returns a http.Header that can be modified by the caller to add 7777 // headers to the request. 7778 func (c *ProjectsCollectdTimeSeriesCreateCall) Header() http.Header { 7779 if c.header_ == nil { 7780 c.header_ = make(http.Header) 7781 } 7782 return c.header_ 7783 } 7784 7785 func (c *ProjectsCollectdTimeSeriesCreateCall) doRequest(alt string) (*http.Response, error) { 7786 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 7787 var body io.Reader = nil 7788 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcollectdtimeseriesrequest) 7789 if err != nil { 7790 return nil, err 7791 } 7792 c.urlParams_.Set("alt", alt) 7793 c.urlParams_.Set("prettyPrint", "false") 7794 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/collectdTimeSeries") 7795 urls += "?" + c.urlParams_.Encode() 7796 req, err := http.NewRequest("POST", urls, body) 7797 if err != nil { 7798 return nil, err 7799 } 7800 req.Header = reqHeaders 7801 googleapi.Expand(req.URL, map[string]string{ 7802 "name": c.name, 7803 }) 7804 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7805 } 7806 7807 // Do executes the "monitoring.projects.collectdTimeSeries.create" call. 7808 // Any non-2xx status code is an error. Response headers are in either 7809 // *CreateCollectdTimeSeriesResponse.ServerResponse.Header or (if a response 7810 // was returned at all) in error.(*googleapi.Error).Header. Use 7811 // googleapi.IsNotModified to check whether the returned error was because 7812 // http.StatusNotModified was returned. 7813 func (c *ProjectsCollectdTimeSeriesCreateCall) Do(opts ...googleapi.CallOption) (*CreateCollectdTimeSeriesResponse, error) { 7814 gensupport.SetOptions(c.urlParams_, opts...) 7815 res, err := c.doRequest("json") 7816 if res != nil && res.StatusCode == http.StatusNotModified { 7817 if res.Body != nil { 7818 res.Body.Close() 7819 } 7820 return nil, gensupport.WrapError(&googleapi.Error{ 7821 Code: res.StatusCode, 7822 Header: res.Header, 7823 }) 7824 } 7825 if err != nil { 7826 return nil, err 7827 } 7828 defer googleapi.CloseBody(res) 7829 if err := googleapi.CheckResponse(res); err != nil { 7830 return nil, gensupport.WrapError(err) 7831 } 7832 ret := &CreateCollectdTimeSeriesResponse{ 7833 ServerResponse: googleapi.ServerResponse{ 7834 Header: res.Header, 7835 HTTPStatusCode: res.StatusCode, 7836 }, 7837 } 7838 target := &ret 7839 if err := gensupport.DecodeResponse(target, res); err != nil { 7840 return nil, err 7841 } 7842 return ret, nil 7843 } 7844 7845 type ProjectsGroupsCreateCall struct { 7846 s *Service 7847 name string 7848 group *Group 7849 urlParams_ gensupport.URLParams 7850 ctx_ context.Context 7851 header_ http.Header 7852 } 7853 7854 // Create: Creates a new group. 7855 // 7856 // - name: The project 7857 // (https://cloud.google.com/monitoring/api/v3#project_name) in which to 7858 // create the group. The format is: projects/[PROJECT_ID_OR_NUMBER]. 7859 func (r *ProjectsGroupsService) Create(name string, group *Group) *ProjectsGroupsCreateCall { 7860 c := &ProjectsGroupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7861 c.name = name 7862 c.group = group 7863 return c 7864 } 7865 7866 // ValidateOnly sets the optional parameter "validateOnly": If true, validate 7867 // this request but do not create the group. 7868 func (c *ProjectsGroupsCreateCall) ValidateOnly(validateOnly bool) *ProjectsGroupsCreateCall { 7869 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 7870 return c 7871 } 7872 7873 // Fields allows partial responses to be retrieved. See 7874 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7875 // details. 7876 func (c *ProjectsGroupsCreateCall) Fields(s ...googleapi.Field) *ProjectsGroupsCreateCall { 7877 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7878 return c 7879 } 7880 7881 // Context sets the context to be used in this call's Do method. 7882 func (c *ProjectsGroupsCreateCall) Context(ctx context.Context) *ProjectsGroupsCreateCall { 7883 c.ctx_ = ctx 7884 return c 7885 } 7886 7887 // Header returns a http.Header that can be modified by the caller to add 7888 // headers to the request. 7889 func (c *ProjectsGroupsCreateCall) Header() http.Header { 7890 if c.header_ == nil { 7891 c.header_ = make(http.Header) 7892 } 7893 return c.header_ 7894 } 7895 7896 func (c *ProjectsGroupsCreateCall) doRequest(alt string) (*http.Response, error) { 7897 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 7898 var body io.Reader = nil 7899 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 7900 if err != nil { 7901 return nil, err 7902 } 7903 c.urlParams_.Set("alt", alt) 7904 c.urlParams_.Set("prettyPrint", "false") 7905 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/groups") 7906 urls += "?" + c.urlParams_.Encode() 7907 req, err := http.NewRequest("POST", urls, body) 7908 if err != nil { 7909 return nil, err 7910 } 7911 req.Header = reqHeaders 7912 googleapi.Expand(req.URL, map[string]string{ 7913 "name": c.name, 7914 }) 7915 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7916 } 7917 7918 // Do executes the "monitoring.projects.groups.create" call. 7919 // Any non-2xx status code is an error. Response headers are in either 7920 // *Group.ServerResponse.Header or (if a response was returned at all) in 7921 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7922 // whether the returned error was because http.StatusNotModified was returned. 7923 func (c *ProjectsGroupsCreateCall) Do(opts ...googleapi.CallOption) (*Group, error) { 7924 gensupport.SetOptions(c.urlParams_, opts...) 7925 res, err := c.doRequest("json") 7926 if res != nil && res.StatusCode == http.StatusNotModified { 7927 if res.Body != nil { 7928 res.Body.Close() 7929 } 7930 return nil, gensupport.WrapError(&googleapi.Error{ 7931 Code: res.StatusCode, 7932 Header: res.Header, 7933 }) 7934 } 7935 if err != nil { 7936 return nil, err 7937 } 7938 defer googleapi.CloseBody(res) 7939 if err := googleapi.CheckResponse(res); err != nil { 7940 return nil, gensupport.WrapError(err) 7941 } 7942 ret := &Group{ 7943 ServerResponse: googleapi.ServerResponse{ 7944 Header: res.Header, 7945 HTTPStatusCode: res.StatusCode, 7946 }, 7947 } 7948 target := &ret 7949 if err := gensupport.DecodeResponse(target, res); err != nil { 7950 return nil, err 7951 } 7952 return ret, nil 7953 } 7954 7955 type ProjectsGroupsDeleteCall struct { 7956 s *Service 7957 name string 7958 urlParams_ gensupport.URLParams 7959 ctx_ context.Context 7960 header_ http.Header 7961 } 7962 7963 // Delete: Deletes an existing group. 7964 // 7965 // - name: The group to delete. The format is: 7966 // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]. 7967 func (r *ProjectsGroupsService) Delete(name string) *ProjectsGroupsDeleteCall { 7968 c := &ProjectsGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7969 c.name = name 7970 return c 7971 } 7972 7973 // Recursive sets the optional parameter "recursive": If this field is true, 7974 // then the request means to delete a group with all its descendants. 7975 // Otherwise, the request means to delete a group only when it has no 7976 // descendants. The default value is false. 7977 func (c *ProjectsGroupsDeleteCall) Recursive(recursive bool) *ProjectsGroupsDeleteCall { 7978 c.urlParams_.Set("recursive", fmt.Sprint(recursive)) 7979 return c 7980 } 7981 7982 // Fields allows partial responses to be retrieved. See 7983 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 7984 // details. 7985 func (c *ProjectsGroupsDeleteCall) Fields(s ...googleapi.Field) *ProjectsGroupsDeleteCall { 7986 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7987 return c 7988 } 7989 7990 // Context sets the context to be used in this call's Do method. 7991 func (c *ProjectsGroupsDeleteCall) Context(ctx context.Context) *ProjectsGroupsDeleteCall { 7992 c.ctx_ = ctx 7993 return c 7994 } 7995 7996 // Header returns a http.Header that can be modified by the caller to add 7997 // headers to the request. 7998 func (c *ProjectsGroupsDeleteCall) Header() http.Header { 7999 if c.header_ == nil { 8000 c.header_ = make(http.Header) 8001 } 8002 return c.header_ 8003 } 8004 8005 func (c *ProjectsGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { 8006 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 8007 var body io.Reader = nil 8008 c.urlParams_.Set("alt", alt) 8009 c.urlParams_.Set("prettyPrint", "false") 8010 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 8011 urls += "?" + c.urlParams_.Encode() 8012 req, err := http.NewRequest("DELETE", urls, body) 8013 if err != nil { 8014 return nil, err 8015 } 8016 req.Header = reqHeaders 8017 googleapi.Expand(req.URL, map[string]string{ 8018 "name": c.name, 8019 }) 8020 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8021 } 8022 8023 // Do executes the "monitoring.projects.groups.delete" call. 8024 // Any non-2xx status code is an error. Response headers are in either 8025 // *Empty.ServerResponse.Header or (if a response was returned at all) in 8026 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8027 // whether the returned error was because http.StatusNotModified was returned. 8028 func (c *ProjectsGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 8029 gensupport.SetOptions(c.urlParams_, opts...) 8030 res, err := c.doRequest("json") 8031 if res != nil && res.StatusCode == http.StatusNotModified { 8032 if res.Body != nil { 8033 res.Body.Close() 8034 } 8035 return nil, gensupport.WrapError(&googleapi.Error{ 8036 Code: res.StatusCode, 8037 Header: res.Header, 8038 }) 8039 } 8040 if err != nil { 8041 return nil, err 8042 } 8043 defer googleapi.CloseBody(res) 8044 if err := googleapi.CheckResponse(res); err != nil { 8045 return nil, gensupport.WrapError(err) 8046 } 8047 ret := &Empty{ 8048 ServerResponse: googleapi.ServerResponse{ 8049 Header: res.Header, 8050 HTTPStatusCode: res.StatusCode, 8051 }, 8052 } 8053 target := &ret 8054 if err := gensupport.DecodeResponse(target, res); err != nil { 8055 return nil, err 8056 } 8057 return ret, nil 8058 } 8059 8060 type ProjectsGroupsGetCall struct { 8061 s *Service 8062 name string 8063 urlParams_ gensupport.URLParams 8064 ifNoneMatch_ string 8065 ctx_ context.Context 8066 header_ http.Header 8067 } 8068 8069 // Get: Gets a single group. 8070 // 8071 // - name: The group to retrieve. The format is: 8072 // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]. 8073 func (r *ProjectsGroupsService) Get(name string) *ProjectsGroupsGetCall { 8074 c := &ProjectsGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8075 c.name = name 8076 return c 8077 } 8078 8079 // Fields allows partial responses to be retrieved. See 8080 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8081 // details. 8082 func (c *ProjectsGroupsGetCall) Fields(s ...googleapi.Field) *ProjectsGroupsGetCall { 8083 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8084 return c 8085 } 8086 8087 // IfNoneMatch sets an optional parameter which makes the operation fail if the 8088 // object's ETag matches the given value. This is useful for getting updates 8089 // only after the object has changed since the last request. 8090 func (c *ProjectsGroupsGetCall) IfNoneMatch(entityTag string) *ProjectsGroupsGetCall { 8091 c.ifNoneMatch_ = entityTag 8092 return c 8093 } 8094 8095 // Context sets the context to be used in this call's Do method. 8096 func (c *ProjectsGroupsGetCall) Context(ctx context.Context) *ProjectsGroupsGetCall { 8097 c.ctx_ = ctx 8098 return c 8099 } 8100 8101 // Header returns a http.Header that can be modified by the caller to add 8102 // headers to the request. 8103 func (c *ProjectsGroupsGetCall) Header() http.Header { 8104 if c.header_ == nil { 8105 c.header_ = make(http.Header) 8106 } 8107 return c.header_ 8108 } 8109 8110 func (c *ProjectsGroupsGetCall) doRequest(alt string) (*http.Response, error) { 8111 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 8112 if c.ifNoneMatch_ != "" { 8113 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8114 } 8115 var body io.Reader = nil 8116 c.urlParams_.Set("alt", alt) 8117 c.urlParams_.Set("prettyPrint", "false") 8118 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 8119 urls += "?" + c.urlParams_.Encode() 8120 req, err := http.NewRequest("GET", urls, body) 8121 if err != nil { 8122 return nil, err 8123 } 8124 req.Header = reqHeaders 8125 googleapi.Expand(req.URL, map[string]string{ 8126 "name": c.name, 8127 }) 8128 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8129 } 8130 8131 // Do executes the "monitoring.projects.groups.get" call. 8132 // Any non-2xx status code is an error. Response headers are in either 8133 // *Group.ServerResponse.Header or (if a response was returned at all) in 8134 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8135 // whether the returned error was because http.StatusNotModified was returned. 8136 func (c *ProjectsGroupsGetCall) Do(opts ...googleapi.CallOption) (*Group, error) { 8137 gensupport.SetOptions(c.urlParams_, opts...) 8138 res, err := c.doRequest("json") 8139 if res != nil && res.StatusCode == http.StatusNotModified { 8140 if res.Body != nil { 8141 res.Body.Close() 8142 } 8143 return nil, gensupport.WrapError(&googleapi.Error{ 8144 Code: res.StatusCode, 8145 Header: res.Header, 8146 }) 8147 } 8148 if err != nil { 8149 return nil, err 8150 } 8151 defer googleapi.CloseBody(res) 8152 if err := googleapi.CheckResponse(res); err != nil { 8153 return nil, gensupport.WrapError(err) 8154 } 8155 ret := &Group{ 8156 ServerResponse: googleapi.ServerResponse{ 8157 Header: res.Header, 8158 HTTPStatusCode: res.StatusCode, 8159 }, 8160 } 8161 target := &ret 8162 if err := gensupport.DecodeResponse(target, res); err != nil { 8163 return nil, err 8164 } 8165 return ret, nil 8166 } 8167 8168 type ProjectsGroupsListCall struct { 8169 s *Service 8170 name string 8171 urlParams_ gensupport.URLParams 8172 ifNoneMatch_ string 8173 ctx_ context.Context 8174 header_ http.Header 8175 } 8176 8177 // List: Lists the existing groups. 8178 // 8179 // - name: The project 8180 // (https://cloud.google.com/monitoring/api/v3#project_name) whose groups are 8181 // to be listed. The format is: projects/[PROJECT_ID_OR_NUMBER]. 8182 func (r *ProjectsGroupsService) List(name string) *ProjectsGroupsListCall { 8183 c := &ProjectsGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8184 c.name = name 8185 return c 8186 } 8187 8188 // AncestorsOfGroup sets the optional parameter "ancestorsOfGroup": A group 8189 // name. The format is: projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] 8190 // Returns groups that are ancestors of the specified group. The groups are 8191 // returned in order, starting with the immediate parent and ending with the 8192 // most distant ancestor. If the specified group has no immediate parent, the 8193 // results are empty. 8194 func (c *ProjectsGroupsListCall) AncestorsOfGroup(ancestorsOfGroup string) *ProjectsGroupsListCall { 8195 c.urlParams_.Set("ancestorsOfGroup", ancestorsOfGroup) 8196 return c 8197 } 8198 8199 // ChildrenOfGroup sets the optional parameter "childrenOfGroup": A group name. 8200 // The format is: projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] Returns 8201 // groups whose parent_name field contains the group name. If no groups have 8202 // this parent, the results are empty. 8203 func (c *ProjectsGroupsListCall) ChildrenOfGroup(childrenOfGroup string) *ProjectsGroupsListCall { 8204 c.urlParams_.Set("childrenOfGroup", childrenOfGroup) 8205 return c 8206 } 8207 8208 // DescendantsOfGroup sets the optional parameter "descendantsOfGroup": A group 8209 // name. The format is: projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] 8210 // Returns the descendants of the specified group. This is a superset of the 8211 // results returned by the children_of_group filter, and includes 8212 // children-of-children, and so forth. 8213 func (c *ProjectsGroupsListCall) DescendantsOfGroup(descendantsOfGroup string) *ProjectsGroupsListCall { 8214 c.urlParams_.Set("descendantsOfGroup", descendantsOfGroup) 8215 return c 8216 } 8217 8218 // PageSize sets the optional parameter "pageSize": A positive number that is 8219 // the maximum number of results to return. 8220 func (c *ProjectsGroupsListCall) PageSize(pageSize int64) *ProjectsGroupsListCall { 8221 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8222 return c 8223 } 8224 8225 // PageToken sets the optional parameter "pageToken": If this field is not 8226 // empty then it must contain the next_page_token value returned by a previous 8227 // call to this method. Using this field causes the method to return additional 8228 // results from the previous method call. 8229 func (c *ProjectsGroupsListCall) PageToken(pageToken string) *ProjectsGroupsListCall { 8230 c.urlParams_.Set("pageToken", pageToken) 8231 return c 8232 } 8233 8234 // Fields allows partial responses to be retrieved. See 8235 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8236 // details. 8237 func (c *ProjectsGroupsListCall) Fields(s ...googleapi.Field) *ProjectsGroupsListCall { 8238 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8239 return c 8240 } 8241 8242 // IfNoneMatch sets an optional parameter which makes the operation fail if the 8243 // object's ETag matches the given value. This is useful for getting updates 8244 // only after the object has changed since the last request. 8245 func (c *ProjectsGroupsListCall) IfNoneMatch(entityTag string) *ProjectsGroupsListCall { 8246 c.ifNoneMatch_ = entityTag 8247 return c 8248 } 8249 8250 // Context sets the context to be used in this call's Do method. 8251 func (c *ProjectsGroupsListCall) Context(ctx context.Context) *ProjectsGroupsListCall { 8252 c.ctx_ = ctx 8253 return c 8254 } 8255 8256 // Header returns a http.Header that can be modified by the caller to add 8257 // headers to the request. 8258 func (c *ProjectsGroupsListCall) Header() http.Header { 8259 if c.header_ == nil { 8260 c.header_ = make(http.Header) 8261 } 8262 return c.header_ 8263 } 8264 8265 func (c *ProjectsGroupsListCall) doRequest(alt string) (*http.Response, error) { 8266 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 8267 if c.ifNoneMatch_ != "" { 8268 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8269 } 8270 var body io.Reader = nil 8271 c.urlParams_.Set("alt", alt) 8272 c.urlParams_.Set("prettyPrint", "false") 8273 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/groups") 8274 urls += "?" + c.urlParams_.Encode() 8275 req, err := http.NewRequest("GET", urls, body) 8276 if err != nil { 8277 return nil, err 8278 } 8279 req.Header = reqHeaders 8280 googleapi.Expand(req.URL, map[string]string{ 8281 "name": c.name, 8282 }) 8283 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8284 } 8285 8286 // Do executes the "monitoring.projects.groups.list" call. 8287 // Any non-2xx status code is an error. Response headers are in either 8288 // *ListGroupsResponse.ServerResponse.Header or (if a response was returned at 8289 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8290 // check whether the returned error was because http.StatusNotModified was 8291 // returned. 8292 func (c *ProjectsGroupsListCall) Do(opts ...googleapi.CallOption) (*ListGroupsResponse, error) { 8293 gensupport.SetOptions(c.urlParams_, opts...) 8294 res, err := c.doRequest("json") 8295 if res != nil && res.StatusCode == http.StatusNotModified { 8296 if res.Body != nil { 8297 res.Body.Close() 8298 } 8299 return nil, gensupport.WrapError(&googleapi.Error{ 8300 Code: res.StatusCode, 8301 Header: res.Header, 8302 }) 8303 } 8304 if err != nil { 8305 return nil, err 8306 } 8307 defer googleapi.CloseBody(res) 8308 if err := googleapi.CheckResponse(res); err != nil { 8309 return nil, gensupport.WrapError(err) 8310 } 8311 ret := &ListGroupsResponse{ 8312 ServerResponse: googleapi.ServerResponse{ 8313 Header: res.Header, 8314 HTTPStatusCode: res.StatusCode, 8315 }, 8316 } 8317 target := &ret 8318 if err := gensupport.DecodeResponse(target, res); err != nil { 8319 return nil, err 8320 } 8321 return ret, nil 8322 } 8323 8324 // Pages invokes f for each page of results. 8325 // A non-nil error returned from f will halt the iteration. 8326 // The provided context supersedes any context provided to the Context method. 8327 func (c *ProjectsGroupsListCall) Pages(ctx context.Context, f func(*ListGroupsResponse) error) error { 8328 c.ctx_ = ctx 8329 defer c.PageToken(c.urlParams_.Get("pageToken")) 8330 for { 8331 x, err := c.Do() 8332 if err != nil { 8333 return err 8334 } 8335 if err := f(x); err != nil { 8336 return err 8337 } 8338 if x.NextPageToken == "" { 8339 return nil 8340 } 8341 c.PageToken(x.NextPageToken) 8342 } 8343 } 8344 8345 type ProjectsGroupsUpdateCall struct { 8346 s *Service 8347 name string 8348 group *Group 8349 urlParams_ gensupport.URLParams 8350 ctx_ context.Context 8351 header_ http.Header 8352 } 8353 8354 // Update: Updates an existing group. You can change any group attributes 8355 // except name. 8356 // 8357 // - name: Output only. The name of this group. The format is: 8358 // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID] When creating a group, 8359 // this field is ignored and a new name is created consisting of the project 8360 // specified in the call to CreateGroup and a unique [GROUP_ID] that is 8361 // generated automatically. 8362 func (r *ProjectsGroupsService) Update(name string, group *Group) *ProjectsGroupsUpdateCall { 8363 c := &ProjectsGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8364 c.name = name 8365 c.group = group 8366 return c 8367 } 8368 8369 // ValidateOnly sets the optional parameter "validateOnly": If true, validate 8370 // this request but do not update the existing group. 8371 func (c *ProjectsGroupsUpdateCall) ValidateOnly(validateOnly bool) *ProjectsGroupsUpdateCall { 8372 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 8373 return c 8374 } 8375 8376 // Fields allows partial responses to be retrieved. See 8377 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8378 // details. 8379 func (c *ProjectsGroupsUpdateCall) Fields(s ...googleapi.Field) *ProjectsGroupsUpdateCall { 8380 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8381 return c 8382 } 8383 8384 // Context sets the context to be used in this call's Do method. 8385 func (c *ProjectsGroupsUpdateCall) Context(ctx context.Context) *ProjectsGroupsUpdateCall { 8386 c.ctx_ = ctx 8387 return c 8388 } 8389 8390 // Header returns a http.Header that can be modified by the caller to add 8391 // headers to the request. 8392 func (c *ProjectsGroupsUpdateCall) Header() http.Header { 8393 if c.header_ == nil { 8394 c.header_ = make(http.Header) 8395 } 8396 return c.header_ 8397 } 8398 8399 func (c *ProjectsGroupsUpdateCall) doRequest(alt string) (*http.Response, error) { 8400 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 8401 var body io.Reader = nil 8402 body, err := googleapi.WithoutDataWrapper.JSONReader(c.group) 8403 if err != nil { 8404 return nil, err 8405 } 8406 c.urlParams_.Set("alt", alt) 8407 c.urlParams_.Set("prettyPrint", "false") 8408 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 8409 urls += "?" + c.urlParams_.Encode() 8410 req, err := http.NewRequest("PUT", urls, body) 8411 if err != nil { 8412 return nil, err 8413 } 8414 req.Header = reqHeaders 8415 googleapi.Expand(req.URL, map[string]string{ 8416 "name": c.name, 8417 }) 8418 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8419 } 8420 8421 // Do executes the "monitoring.projects.groups.update" call. 8422 // Any non-2xx status code is an error. Response headers are in either 8423 // *Group.ServerResponse.Header or (if a response was returned at all) in 8424 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8425 // whether the returned error was because http.StatusNotModified was returned. 8426 func (c *ProjectsGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*Group, error) { 8427 gensupport.SetOptions(c.urlParams_, opts...) 8428 res, err := c.doRequest("json") 8429 if res != nil && res.StatusCode == http.StatusNotModified { 8430 if res.Body != nil { 8431 res.Body.Close() 8432 } 8433 return nil, gensupport.WrapError(&googleapi.Error{ 8434 Code: res.StatusCode, 8435 Header: res.Header, 8436 }) 8437 } 8438 if err != nil { 8439 return nil, err 8440 } 8441 defer googleapi.CloseBody(res) 8442 if err := googleapi.CheckResponse(res); err != nil { 8443 return nil, gensupport.WrapError(err) 8444 } 8445 ret := &Group{ 8446 ServerResponse: googleapi.ServerResponse{ 8447 Header: res.Header, 8448 HTTPStatusCode: res.StatusCode, 8449 }, 8450 } 8451 target := &ret 8452 if err := gensupport.DecodeResponse(target, res); err != nil { 8453 return nil, err 8454 } 8455 return ret, nil 8456 } 8457 8458 type ProjectsGroupsMembersListCall struct { 8459 s *Service 8460 name string 8461 urlParams_ gensupport.URLParams 8462 ifNoneMatch_ string 8463 ctx_ context.Context 8464 header_ http.Header 8465 } 8466 8467 // List: Lists the monitored resources that are members of a group. 8468 // 8469 // - name: The group whose members are listed. The format is: 8470 // projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]. 8471 func (r *ProjectsGroupsMembersService) List(name string) *ProjectsGroupsMembersListCall { 8472 c := &ProjectsGroupsMembersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8473 c.name = name 8474 return c 8475 } 8476 8477 // Filter sets the optional parameter "filter": An optional list filter 8478 // (https://cloud.google.com/monitoring/api/learn_more#filtering) describing 8479 // the members to be returned. The filter may reference the type, labels, and 8480 // metadata of monitored resources that comprise the group. For example, to 8481 // return only resources representing Compute Engine VM instances, use this 8482 // filter: `resource.type = "gce_instance" 8483 func (c *ProjectsGroupsMembersListCall) Filter(filter string) *ProjectsGroupsMembersListCall { 8484 c.urlParams_.Set("filter", filter) 8485 return c 8486 } 8487 8488 // IntervalEndTime sets the optional parameter "interval.endTime": Required. 8489 // The end of the time interval. 8490 func (c *ProjectsGroupsMembersListCall) IntervalEndTime(intervalEndTime string) *ProjectsGroupsMembersListCall { 8491 c.urlParams_.Set("interval.endTime", intervalEndTime) 8492 return c 8493 } 8494 8495 // IntervalStartTime sets the optional parameter "interval.startTime": The 8496 // beginning of the time interval. The default value for the start time is the 8497 // end time. The start time must not be later than the end time. 8498 func (c *ProjectsGroupsMembersListCall) IntervalStartTime(intervalStartTime string) *ProjectsGroupsMembersListCall { 8499 c.urlParams_.Set("interval.startTime", intervalStartTime) 8500 return c 8501 } 8502 8503 // PageSize sets the optional parameter "pageSize": A positive number that is 8504 // the maximum number of results to return. 8505 func (c *ProjectsGroupsMembersListCall) PageSize(pageSize int64) *ProjectsGroupsMembersListCall { 8506 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8507 return c 8508 } 8509 8510 // PageToken sets the optional parameter "pageToken": If this field is not 8511 // empty then it must contain the next_page_token value returned by a previous 8512 // call to this method. Using this field causes the method to return additional 8513 // results from the previous method call. 8514 func (c *ProjectsGroupsMembersListCall) PageToken(pageToken string) *ProjectsGroupsMembersListCall { 8515 c.urlParams_.Set("pageToken", pageToken) 8516 return c 8517 } 8518 8519 // Fields allows partial responses to be retrieved. See 8520 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8521 // details. 8522 func (c *ProjectsGroupsMembersListCall) Fields(s ...googleapi.Field) *ProjectsGroupsMembersListCall { 8523 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8524 return c 8525 } 8526 8527 // IfNoneMatch sets an optional parameter which makes the operation fail if the 8528 // object's ETag matches the given value. This is useful for getting updates 8529 // only after the object has changed since the last request. 8530 func (c *ProjectsGroupsMembersListCall) IfNoneMatch(entityTag string) *ProjectsGroupsMembersListCall { 8531 c.ifNoneMatch_ = entityTag 8532 return c 8533 } 8534 8535 // Context sets the context to be used in this call's Do method. 8536 func (c *ProjectsGroupsMembersListCall) Context(ctx context.Context) *ProjectsGroupsMembersListCall { 8537 c.ctx_ = ctx 8538 return c 8539 } 8540 8541 // Header returns a http.Header that can be modified by the caller to add 8542 // headers to the request. 8543 func (c *ProjectsGroupsMembersListCall) Header() http.Header { 8544 if c.header_ == nil { 8545 c.header_ = make(http.Header) 8546 } 8547 return c.header_ 8548 } 8549 8550 func (c *ProjectsGroupsMembersListCall) doRequest(alt string) (*http.Response, error) { 8551 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 8552 if c.ifNoneMatch_ != "" { 8553 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8554 } 8555 var body io.Reader = nil 8556 c.urlParams_.Set("alt", alt) 8557 c.urlParams_.Set("prettyPrint", "false") 8558 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/members") 8559 urls += "?" + c.urlParams_.Encode() 8560 req, err := http.NewRequest("GET", urls, body) 8561 if err != nil { 8562 return nil, err 8563 } 8564 req.Header = reqHeaders 8565 googleapi.Expand(req.URL, map[string]string{ 8566 "name": c.name, 8567 }) 8568 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8569 } 8570 8571 // Do executes the "monitoring.projects.groups.members.list" call. 8572 // Any non-2xx status code is an error. Response headers are in either 8573 // *ListGroupMembersResponse.ServerResponse.Header or (if a response was 8574 // returned at all) in error.(*googleapi.Error).Header. Use 8575 // googleapi.IsNotModified to check whether the returned error was because 8576 // http.StatusNotModified was returned. 8577 func (c *ProjectsGroupsMembersListCall) Do(opts ...googleapi.CallOption) (*ListGroupMembersResponse, error) { 8578 gensupport.SetOptions(c.urlParams_, opts...) 8579 res, err := c.doRequest("json") 8580 if res != nil && res.StatusCode == http.StatusNotModified { 8581 if res.Body != nil { 8582 res.Body.Close() 8583 } 8584 return nil, gensupport.WrapError(&googleapi.Error{ 8585 Code: res.StatusCode, 8586 Header: res.Header, 8587 }) 8588 } 8589 if err != nil { 8590 return nil, err 8591 } 8592 defer googleapi.CloseBody(res) 8593 if err := googleapi.CheckResponse(res); err != nil { 8594 return nil, gensupport.WrapError(err) 8595 } 8596 ret := &ListGroupMembersResponse{ 8597 ServerResponse: googleapi.ServerResponse{ 8598 Header: res.Header, 8599 HTTPStatusCode: res.StatusCode, 8600 }, 8601 } 8602 target := &ret 8603 if err := gensupport.DecodeResponse(target, res); err != nil { 8604 return nil, err 8605 } 8606 return ret, nil 8607 } 8608 8609 // Pages invokes f for each page of results. 8610 // A non-nil error returned from f will halt the iteration. 8611 // The provided context supersedes any context provided to the Context method. 8612 func (c *ProjectsGroupsMembersListCall) Pages(ctx context.Context, f func(*ListGroupMembersResponse) error) error { 8613 c.ctx_ = ctx 8614 defer c.PageToken(c.urlParams_.Get("pageToken")) 8615 for { 8616 x, err := c.Do() 8617 if err != nil { 8618 return err 8619 } 8620 if err := f(x); err != nil { 8621 return err 8622 } 8623 if x.NextPageToken == "" { 8624 return nil 8625 } 8626 c.PageToken(x.NextPageToken) 8627 } 8628 } 8629 8630 type ProjectsMetricDescriptorsCreateCall struct { 8631 s *Service 8632 name string 8633 metricdescriptor *MetricDescriptor 8634 urlParams_ gensupport.URLParams 8635 ctx_ context.Context 8636 header_ http.Header 8637 } 8638 8639 // Create: Creates a new metric descriptor. The creation is executed 8640 // asynchronously. User-created metric descriptors define custom metrics 8641 // (https://cloud.google.com/monitoring/custom-metrics). The metric descriptor 8642 // is updated if it already exists, except that metric labels are never 8643 // removed. 8644 // 8645 // - name: The project 8646 // (https://cloud.google.com/monitoring/api/v3#project_name) on which to 8647 // execute the request. The format is: 4 projects/PROJECT_ID_OR_NUMBER. 8648 func (r *ProjectsMetricDescriptorsService) Create(name string, metricdescriptor *MetricDescriptor) *ProjectsMetricDescriptorsCreateCall { 8649 c := &ProjectsMetricDescriptorsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8650 c.name = name 8651 c.metricdescriptor = metricdescriptor 8652 return c 8653 } 8654 8655 // Fields allows partial responses to be retrieved. See 8656 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8657 // details. 8658 func (c *ProjectsMetricDescriptorsCreateCall) Fields(s ...googleapi.Field) *ProjectsMetricDescriptorsCreateCall { 8659 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8660 return c 8661 } 8662 8663 // Context sets the context to be used in this call's Do method. 8664 func (c *ProjectsMetricDescriptorsCreateCall) Context(ctx context.Context) *ProjectsMetricDescriptorsCreateCall { 8665 c.ctx_ = ctx 8666 return c 8667 } 8668 8669 // Header returns a http.Header that can be modified by the caller to add 8670 // headers to the request. 8671 func (c *ProjectsMetricDescriptorsCreateCall) Header() http.Header { 8672 if c.header_ == nil { 8673 c.header_ = make(http.Header) 8674 } 8675 return c.header_ 8676 } 8677 8678 func (c *ProjectsMetricDescriptorsCreateCall) doRequest(alt string) (*http.Response, error) { 8679 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 8680 var body io.Reader = nil 8681 body, err := googleapi.WithoutDataWrapper.JSONReader(c.metricdescriptor) 8682 if err != nil { 8683 return nil, err 8684 } 8685 c.urlParams_.Set("alt", alt) 8686 c.urlParams_.Set("prettyPrint", "false") 8687 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/metricDescriptors") 8688 urls += "?" + c.urlParams_.Encode() 8689 req, err := http.NewRequest("POST", urls, body) 8690 if err != nil { 8691 return nil, err 8692 } 8693 req.Header = reqHeaders 8694 googleapi.Expand(req.URL, map[string]string{ 8695 "name": c.name, 8696 }) 8697 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8698 } 8699 8700 // Do executes the "monitoring.projects.metricDescriptors.create" call. 8701 // Any non-2xx status code is an error. Response headers are in either 8702 // *MetricDescriptor.ServerResponse.Header or (if a response was returned at 8703 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8704 // check whether the returned error was because http.StatusNotModified was 8705 // returned. 8706 func (c *ProjectsMetricDescriptorsCreateCall) Do(opts ...googleapi.CallOption) (*MetricDescriptor, error) { 8707 gensupport.SetOptions(c.urlParams_, opts...) 8708 res, err := c.doRequest("json") 8709 if res != nil && res.StatusCode == http.StatusNotModified { 8710 if res.Body != nil { 8711 res.Body.Close() 8712 } 8713 return nil, gensupport.WrapError(&googleapi.Error{ 8714 Code: res.StatusCode, 8715 Header: res.Header, 8716 }) 8717 } 8718 if err != nil { 8719 return nil, err 8720 } 8721 defer googleapi.CloseBody(res) 8722 if err := googleapi.CheckResponse(res); err != nil { 8723 return nil, gensupport.WrapError(err) 8724 } 8725 ret := &MetricDescriptor{ 8726 ServerResponse: googleapi.ServerResponse{ 8727 Header: res.Header, 8728 HTTPStatusCode: res.StatusCode, 8729 }, 8730 } 8731 target := &ret 8732 if err := gensupport.DecodeResponse(target, res); err != nil { 8733 return nil, err 8734 } 8735 return ret, nil 8736 } 8737 8738 type ProjectsMetricDescriptorsDeleteCall struct { 8739 s *Service 8740 name string 8741 urlParams_ gensupport.URLParams 8742 ctx_ context.Context 8743 header_ http.Header 8744 } 8745 8746 // Delete: Deletes a metric descriptor. Only user-created custom metrics 8747 // (https://cloud.google.com/monitoring/custom-metrics) can be deleted. 8748 // 8749 // - name: The metric descriptor on which to execute the request. The format 8750 // is: projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] An 8751 // example of [METRIC_ID] is: "custom.googleapis.com/my_test_metric". 8752 func (r *ProjectsMetricDescriptorsService) Delete(name string) *ProjectsMetricDescriptorsDeleteCall { 8753 c := &ProjectsMetricDescriptorsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8754 c.name = name 8755 return c 8756 } 8757 8758 // Fields allows partial responses to be retrieved. See 8759 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8760 // details. 8761 func (c *ProjectsMetricDescriptorsDeleteCall) Fields(s ...googleapi.Field) *ProjectsMetricDescriptorsDeleteCall { 8762 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8763 return c 8764 } 8765 8766 // Context sets the context to be used in this call's Do method. 8767 func (c *ProjectsMetricDescriptorsDeleteCall) Context(ctx context.Context) *ProjectsMetricDescriptorsDeleteCall { 8768 c.ctx_ = ctx 8769 return c 8770 } 8771 8772 // Header returns a http.Header that can be modified by the caller to add 8773 // headers to the request. 8774 func (c *ProjectsMetricDescriptorsDeleteCall) Header() http.Header { 8775 if c.header_ == nil { 8776 c.header_ = make(http.Header) 8777 } 8778 return c.header_ 8779 } 8780 8781 func (c *ProjectsMetricDescriptorsDeleteCall) doRequest(alt string) (*http.Response, error) { 8782 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 8783 var body io.Reader = nil 8784 c.urlParams_.Set("alt", alt) 8785 c.urlParams_.Set("prettyPrint", "false") 8786 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 8787 urls += "?" + c.urlParams_.Encode() 8788 req, err := http.NewRequest("DELETE", urls, body) 8789 if err != nil { 8790 return nil, err 8791 } 8792 req.Header = reqHeaders 8793 googleapi.Expand(req.URL, map[string]string{ 8794 "name": c.name, 8795 }) 8796 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8797 } 8798 8799 // Do executes the "monitoring.projects.metricDescriptors.delete" call. 8800 // Any non-2xx status code is an error. Response headers are in either 8801 // *Empty.ServerResponse.Header or (if a response was returned at all) in 8802 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8803 // whether the returned error was because http.StatusNotModified was returned. 8804 func (c *ProjectsMetricDescriptorsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 8805 gensupport.SetOptions(c.urlParams_, opts...) 8806 res, err := c.doRequest("json") 8807 if res != nil && res.StatusCode == http.StatusNotModified { 8808 if res.Body != nil { 8809 res.Body.Close() 8810 } 8811 return nil, gensupport.WrapError(&googleapi.Error{ 8812 Code: res.StatusCode, 8813 Header: res.Header, 8814 }) 8815 } 8816 if err != nil { 8817 return nil, err 8818 } 8819 defer googleapi.CloseBody(res) 8820 if err := googleapi.CheckResponse(res); err != nil { 8821 return nil, gensupport.WrapError(err) 8822 } 8823 ret := &Empty{ 8824 ServerResponse: googleapi.ServerResponse{ 8825 Header: res.Header, 8826 HTTPStatusCode: res.StatusCode, 8827 }, 8828 } 8829 target := &ret 8830 if err := gensupport.DecodeResponse(target, res); err != nil { 8831 return nil, err 8832 } 8833 return ret, nil 8834 } 8835 8836 type ProjectsMetricDescriptorsGetCall struct { 8837 s *Service 8838 name string 8839 urlParams_ gensupport.URLParams 8840 ifNoneMatch_ string 8841 ctx_ context.Context 8842 header_ http.Header 8843 } 8844 8845 // Get: Gets a single metric descriptor. 8846 // 8847 // - name: The metric descriptor on which to execute the request. The format 8848 // is: projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID] An 8849 // example value of [METRIC_ID] is 8850 // "compute.googleapis.com/instance/disk/read_bytes_count". 8851 func (r *ProjectsMetricDescriptorsService) Get(name string) *ProjectsMetricDescriptorsGetCall { 8852 c := &ProjectsMetricDescriptorsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8853 c.name = name 8854 return c 8855 } 8856 8857 // Fields allows partial responses to be retrieved. See 8858 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8859 // details. 8860 func (c *ProjectsMetricDescriptorsGetCall) Fields(s ...googleapi.Field) *ProjectsMetricDescriptorsGetCall { 8861 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8862 return c 8863 } 8864 8865 // IfNoneMatch sets an optional parameter which makes the operation fail if the 8866 // object's ETag matches the given value. This is useful for getting updates 8867 // only after the object has changed since the last request. 8868 func (c *ProjectsMetricDescriptorsGetCall) IfNoneMatch(entityTag string) *ProjectsMetricDescriptorsGetCall { 8869 c.ifNoneMatch_ = entityTag 8870 return c 8871 } 8872 8873 // Context sets the context to be used in this call's Do method. 8874 func (c *ProjectsMetricDescriptorsGetCall) Context(ctx context.Context) *ProjectsMetricDescriptorsGetCall { 8875 c.ctx_ = ctx 8876 return c 8877 } 8878 8879 // Header returns a http.Header that can be modified by the caller to add 8880 // headers to the request. 8881 func (c *ProjectsMetricDescriptorsGetCall) Header() http.Header { 8882 if c.header_ == nil { 8883 c.header_ = make(http.Header) 8884 } 8885 return c.header_ 8886 } 8887 8888 func (c *ProjectsMetricDescriptorsGetCall) doRequest(alt string) (*http.Response, error) { 8889 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 8890 if c.ifNoneMatch_ != "" { 8891 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8892 } 8893 var body io.Reader = nil 8894 c.urlParams_.Set("alt", alt) 8895 c.urlParams_.Set("prettyPrint", "false") 8896 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 8897 urls += "?" + c.urlParams_.Encode() 8898 req, err := http.NewRequest("GET", urls, body) 8899 if err != nil { 8900 return nil, err 8901 } 8902 req.Header = reqHeaders 8903 googleapi.Expand(req.URL, map[string]string{ 8904 "name": c.name, 8905 }) 8906 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8907 } 8908 8909 // Do executes the "monitoring.projects.metricDescriptors.get" call. 8910 // Any non-2xx status code is an error. Response headers are in either 8911 // *MetricDescriptor.ServerResponse.Header or (if a response was returned at 8912 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8913 // check whether the returned error was because http.StatusNotModified was 8914 // returned. 8915 func (c *ProjectsMetricDescriptorsGetCall) Do(opts ...googleapi.CallOption) (*MetricDescriptor, error) { 8916 gensupport.SetOptions(c.urlParams_, opts...) 8917 res, err := c.doRequest("json") 8918 if res != nil && res.StatusCode == http.StatusNotModified { 8919 if res.Body != nil { 8920 res.Body.Close() 8921 } 8922 return nil, gensupport.WrapError(&googleapi.Error{ 8923 Code: res.StatusCode, 8924 Header: res.Header, 8925 }) 8926 } 8927 if err != nil { 8928 return nil, err 8929 } 8930 defer googleapi.CloseBody(res) 8931 if err := googleapi.CheckResponse(res); err != nil { 8932 return nil, gensupport.WrapError(err) 8933 } 8934 ret := &MetricDescriptor{ 8935 ServerResponse: googleapi.ServerResponse{ 8936 Header: res.Header, 8937 HTTPStatusCode: res.StatusCode, 8938 }, 8939 } 8940 target := &ret 8941 if err := gensupport.DecodeResponse(target, res); err != nil { 8942 return nil, err 8943 } 8944 return ret, nil 8945 } 8946 8947 type ProjectsMetricDescriptorsListCall struct { 8948 s *Service 8949 name string 8950 urlParams_ gensupport.URLParams 8951 ifNoneMatch_ string 8952 ctx_ context.Context 8953 header_ http.Header 8954 } 8955 8956 // List: Lists metric descriptors that match a filter. 8957 // 8958 // - name: The project 8959 // (https://cloud.google.com/monitoring/api/v3#project_name) on which to 8960 // execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER]. 8961 func (r *ProjectsMetricDescriptorsService) List(name string) *ProjectsMetricDescriptorsListCall { 8962 c := &ProjectsMetricDescriptorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8963 c.name = name 8964 return c 8965 } 8966 8967 // Filter sets the optional parameter "filter": If this field is empty, all 8968 // custom and system-defined metric descriptors are returned. Otherwise, the 8969 // filter (https://cloud.google.com/monitoring/api/v3/filters) specifies which 8970 // metric descriptors are to be returned. For example, the following filter 8971 // matches all custom metrics 8972 // (https://cloud.google.com/monitoring/custom-metrics): metric.type = 8973 // starts_with("custom.googleapis.com/") 8974 func (c *ProjectsMetricDescriptorsListCall) Filter(filter string) *ProjectsMetricDescriptorsListCall { 8975 c.urlParams_.Set("filter", filter) 8976 return c 8977 } 8978 8979 // PageSize sets the optional parameter "pageSize": A positive number that is 8980 // the maximum number of results to return. The default and maximum value is 8981 // 10,000. If a page_size <= 0 or > 10,000 is submitted, will instead return a 8982 // maximum of 10,000 results. 8983 func (c *ProjectsMetricDescriptorsListCall) PageSize(pageSize int64) *ProjectsMetricDescriptorsListCall { 8984 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8985 return c 8986 } 8987 8988 // PageToken sets the optional parameter "pageToken": If this field is not 8989 // empty then it must contain the nextPageToken value returned by a previous 8990 // call to this method. Using this field causes the method to return additional 8991 // results from the previous method call. 8992 func (c *ProjectsMetricDescriptorsListCall) PageToken(pageToken string) *ProjectsMetricDescriptorsListCall { 8993 c.urlParams_.Set("pageToken", pageToken) 8994 return c 8995 } 8996 8997 // Fields allows partial responses to be retrieved. See 8998 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 8999 // details. 9000 func (c *ProjectsMetricDescriptorsListCall) Fields(s ...googleapi.Field) *ProjectsMetricDescriptorsListCall { 9001 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9002 return c 9003 } 9004 9005 // IfNoneMatch sets an optional parameter which makes the operation fail if the 9006 // object's ETag matches the given value. This is useful for getting updates 9007 // only after the object has changed since the last request. 9008 func (c *ProjectsMetricDescriptorsListCall) IfNoneMatch(entityTag string) *ProjectsMetricDescriptorsListCall { 9009 c.ifNoneMatch_ = entityTag 9010 return c 9011 } 9012 9013 // Context sets the context to be used in this call's Do method. 9014 func (c *ProjectsMetricDescriptorsListCall) Context(ctx context.Context) *ProjectsMetricDescriptorsListCall { 9015 c.ctx_ = ctx 9016 return c 9017 } 9018 9019 // Header returns a http.Header that can be modified by the caller to add 9020 // headers to the request. 9021 func (c *ProjectsMetricDescriptorsListCall) Header() http.Header { 9022 if c.header_ == nil { 9023 c.header_ = make(http.Header) 9024 } 9025 return c.header_ 9026 } 9027 9028 func (c *ProjectsMetricDescriptorsListCall) doRequest(alt string) (*http.Response, error) { 9029 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9030 if c.ifNoneMatch_ != "" { 9031 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9032 } 9033 var body io.Reader = nil 9034 c.urlParams_.Set("alt", alt) 9035 c.urlParams_.Set("prettyPrint", "false") 9036 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/metricDescriptors") 9037 urls += "?" + c.urlParams_.Encode() 9038 req, err := http.NewRequest("GET", urls, body) 9039 if err != nil { 9040 return nil, err 9041 } 9042 req.Header = reqHeaders 9043 googleapi.Expand(req.URL, map[string]string{ 9044 "name": c.name, 9045 }) 9046 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9047 } 9048 9049 // Do executes the "monitoring.projects.metricDescriptors.list" call. 9050 // Any non-2xx status code is an error. Response headers are in either 9051 // *ListMetricDescriptorsResponse.ServerResponse.Header or (if a response was 9052 // returned at all) in error.(*googleapi.Error).Header. Use 9053 // googleapi.IsNotModified to check whether the returned error was because 9054 // http.StatusNotModified was returned. 9055 func (c *ProjectsMetricDescriptorsListCall) Do(opts ...googleapi.CallOption) (*ListMetricDescriptorsResponse, error) { 9056 gensupport.SetOptions(c.urlParams_, opts...) 9057 res, err := c.doRequest("json") 9058 if res != nil && res.StatusCode == http.StatusNotModified { 9059 if res.Body != nil { 9060 res.Body.Close() 9061 } 9062 return nil, gensupport.WrapError(&googleapi.Error{ 9063 Code: res.StatusCode, 9064 Header: res.Header, 9065 }) 9066 } 9067 if err != nil { 9068 return nil, err 9069 } 9070 defer googleapi.CloseBody(res) 9071 if err := googleapi.CheckResponse(res); err != nil { 9072 return nil, gensupport.WrapError(err) 9073 } 9074 ret := &ListMetricDescriptorsResponse{ 9075 ServerResponse: googleapi.ServerResponse{ 9076 Header: res.Header, 9077 HTTPStatusCode: res.StatusCode, 9078 }, 9079 } 9080 target := &ret 9081 if err := gensupport.DecodeResponse(target, res); err != nil { 9082 return nil, err 9083 } 9084 return ret, nil 9085 } 9086 9087 // Pages invokes f for each page of results. 9088 // A non-nil error returned from f will halt the iteration. 9089 // The provided context supersedes any context provided to the Context method. 9090 func (c *ProjectsMetricDescriptorsListCall) Pages(ctx context.Context, f func(*ListMetricDescriptorsResponse) error) error { 9091 c.ctx_ = ctx 9092 defer c.PageToken(c.urlParams_.Get("pageToken")) 9093 for { 9094 x, err := c.Do() 9095 if err != nil { 9096 return err 9097 } 9098 if err := f(x); err != nil { 9099 return err 9100 } 9101 if x.NextPageToken == "" { 9102 return nil 9103 } 9104 c.PageToken(x.NextPageToken) 9105 } 9106 } 9107 9108 type ProjectsMonitoredResourceDescriptorsGetCall struct { 9109 s *Service 9110 name string 9111 urlParams_ gensupport.URLParams 9112 ifNoneMatch_ string 9113 ctx_ context.Context 9114 header_ http.Header 9115 } 9116 9117 // Get: Gets a single monitored resource descriptor. 9118 // 9119 // - name: The monitored resource descriptor to get. The format is: 9120 // projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE 9121 // ] The [RESOURCE_TYPE] is a predefined type, such as cloudsql_database. 9122 func (r *ProjectsMonitoredResourceDescriptorsService) Get(name string) *ProjectsMonitoredResourceDescriptorsGetCall { 9123 c := &ProjectsMonitoredResourceDescriptorsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9124 c.name = name 9125 return c 9126 } 9127 9128 // Fields allows partial responses to be retrieved. See 9129 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9130 // details. 9131 func (c *ProjectsMonitoredResourceDescriptorsGetCall) Fields(s ...googleapi.Field) *ProjectsMonitoredResourceDescriptorsGetCall { 9132 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9133 return c 9134 } 9135 9136 // IfNoneMatch sets an optional parameter which makes the operation fail if the 9137 // object's ETag matches the given value. This is useful for getting updates 9138 // only after the object has changed since the last request. 9139 func (c *ProjectsMonitoredResourceDescriptorsGetCall) IfNoneMatch(entityTag string) *ProjectsMonitoredResourceDescriptorsGetCall { 9140 c.ifNoneMatch_ = entityTag 9141 return c 9142 } 9143 9144 // Context sets the context to be used in this call's Do method. 9145 func (c *ProjectsMonitoredResourceDescriptorsGetCall) Context(ctx context.Context) *ProjectsMonitoredResourceDescriptorsGetCall { 9146 c.ctx_ = ctx 9147 return c 9148 } 9149 9150 // Header returns a http.Header that can be modified by the caller to add 9151 // headers to the request. 9152 func (c *ProjectsMonitoredResourceDescriptorsGetCall) Header() http.Header { 9153 if c.header_ == nil { 9154 c.header_ = make(http.Header) 9155 } 9156 return c.header_ 9157 } 9158 9159 func (c *ProjectsMonitoredResourceDescriptorsGetCall) doRequest(alt string) (*http.Response, error) { 9160 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9161 if c.ifNoneMatch_ != "" { 9162 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9163 } 9164 var body io.Reader = nil 9165 c.urlParams_.Set("alt", alt) 9166 c.urlParams_.Set("prettyPrint", "false") 9167 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 9168 urls += "?" + c.urlParams_.Encode() 9169 req, err := http.NewRequest("GET", urls, body) 9170 if err != nil { 9171 return nil, err 9172 } 9173 req.Header = reqHeaders 9174 googleapi.Expand(req.URL, map[string]string{ 9175 "name": c.name, 9176 }) 9177 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9178 } 9179 9180 // Do executes the "monitoring.projects.monitoredResourceDescriptors.get" call. 9181 // Any non-2xx status code is an error. Response headers are in either 9182 // *MonitoredResourceDescriptor.ServerResponse.Header or (if a response was 9183 // returned at all) in error.(*googleapi.Error).Header. Use 9184 // googleapi.IsNotModified to check whether the returned error was because 9185 // http.StatusNotModified was returned. 9186 func (c *ProjectsMonitoredResourceDescriptorsGetCall) Do(opts ...googleapi.CallOption) (*MonitoredResourceDescriptor, error) { 9187 gensupport.SetOptions(c.urlParams_, opts...) 9188 res, err := c.doRequest("json") 9189 if res != nil && res.StatusCode == http.StatusNotModified { 9190 if res.Body != nil { 9191 res.Body.Close() 9192 } 9193 return nil, gensupport.WrapError(&googleapi.Error{ 9194 Code: res.StatusCode, 9195 Header: res.Header, 9196 }) 9197 } 9198 if err != nil { 9199 return nil, err 9200 } 9201 defer googleapi.CloseBody(res) 9202 if err := googleapi.CheckResponse(res); err != nil { 9203 return nil, gensupport.WrapError(err) 9204 } 9205 ret := &MonitoredResourceDescriptor{ 9206 ServerResponse: googleapi.ServerResponse{ 9207 Header: res.Header, 9208 HTTPStatusCode: res.StatusCode, 9209 }, 9210 } 9211 target := &ret 9212 if err := gensupport.DecodeResponse(target, res); err != nil { 9213 return nil, err 9214 } 9215 return ret, nil 9216 } 9217 9218 type ProjectsMonitoredResourceDescriptorsListCall struct { 9219 s *Service 9220 name string 9221 urlParams_ gensupport.URLParams 9222 ifNoneMatch_ string 9223 ctx_ context.Context 9224 header_ http.Header 9225 } 9226 9227 // List: Lists monitored resource descriptors that match a filter. 9228 // 9229 // - name: The project 9230 // (https://cloud.google.com/monitoring/api/v3#project_name) on which to 9231 // execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER]. 9232 func (r *ProjectsMonitoredResourceDescriptorsService) List(name string) *ProjectsMonitoredResourceDescriptorsListCall { 9233 c := &ProjectsMonitoredResourceDescriptorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9234 c.name = name 9235 return c 9236 } 9237 9238 // Filter sets the optional parameter "filter": An optional filter 9239 // (https://cloud.google.com/monitoring/api/v3/filters) describing the 9240 // descriptors to be returned. The filter can reference the descriptor's type 9241 // and labels. For example, the following filter returns only Google Compute 9242 // Engine descriptors that have an id label: resource.type = 9243 // starts_with("gce_") AND resource.label:id 9244 func (c *ProjectsMonitoredResourceDescriptorsListCall) Filter(filter string) *ProjectsMonitoredResourceDescriptorsListCall { 9245 c.urlParams_.Set("filter", filter) 9246 return c 9247 } 9248 9249 // PageSize sets the optional parameter "pageSize": A positive number that is 9250 // the maximum number of results to return. 9251 func (c *ProjectsMonitoredResourceDescriptorsListCall) PageSize(pageSize int64) *ProjectsMonitoredResourceDescriptorsListCall { 9252 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9253 return c 9254 } 9255 9256 // PageToken sets the optional parameter "pageToken": If this field is not 9257 // empty then it must contain the nextPageToken value returned by a previous 9258 // call to this method. Using this field causes the method to return additional 9259 // results from the previous method call. 9260 func (c *ProjectsMonitoredResourceDescriptorsListCall) PageToken(pageToken string) *ProjectsMonitoredResourceDescriptorsListCall { 9261 c.urlParams_.Set("pageToken", pageToken) 9262 return c 9263 } 9264 9265 // Fields allows partial responses to be retrieved. See 9266 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9267 // details. 9268 func (c *ProjectsMonitoredResourceDescriptorsListCall) Fields(s ...googleapi.Field) *ProjectsMonitoredResourceDescriptorsListCall { 9269 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9270 return c 9271 } 9272 9273 // IfNoneMatch sets an optional parameter which makes the operation fail if the 9274 // object's ETag matches the given value. This is useful for getting updates 9275 // only after the object has changed since the last request. 9276 func (c *ProjectsMonitoredResourceDescriptorsListCall) IfNoneMatch(entityTag string) *ProjectsMonitoredResourceDescriptorsListCall { 9277 c.ifNoneMatch_ = entityTag 9278 return c 9279 } 9280 9281 // Context sets the context to be used in this call's Do method. 9282 func (c *ProjectsMonitoredResourceDescriptorsListCall) Context(ctx context.Context) *ProjectsMonitoredResourceDescriptorsListCall { 9283 c.ctx_ = ctx 9284 return c 9285 } 9286 9287 // Header returns a http.Header that can be modified by the caller to add 9288 // headers to the request. 9289 func (c *ProjectsMonitoredResourceDescriptorsListCall) Header() http.Header { 9290 if c.header_ == nil { 9291 c.header_ = make(http.Header) 9292 } 9293 return c.header_ 9294 } 9295 9296 func (c *ProjectsMonitoredResourceDescriptorsListCall) doRequest(alt string) (*http.Response, error) { 9297 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9298 if c.ifNoneMatch_ != "" { 9299 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9300 } 9301 var body io.Reader = nil 9302 c.urlParams_.Set("alt", alt) 9303 c.urlParams_.Set("prettyPrint", "false") 9304 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/monitoredResourceDescriptors") 9305 urls += "?" + c.urlParams_.Encode() 9306 req, err := http.NewRequest("GET", urls, body) 9307 if err != nil { 9308 return nil, err 9309 } 9310 req.Header = reqHeaders 9311 googleapi.Expand(req.URL, map[string]string{ 9312 "name": c.name, 9313 }) 9314 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9315 } 9316 9317 // Do executes the "monitoring.projects.monitoredResourceDescriptors.list" call. 9318 // Any non-2xx status code is an error. Response headers are in either 9319 // *ListMonitoredResourceDescriptorsResponse.ServerResponse.Header or (if a 9320 // response was returned at all) in error.(*googleapi.Error).Header. Use 9321 // googleapi.IsNotModified to check whether the returned error was because 9322 // http.StatusNotModified was returned. 9323 func (c *ProjectsMonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) { 9324 gensupport.SetOptions(c.urlParams_, opts...) 9325 res, err := c.doRequest("json") 9326 if res != nil && res.StatusCode == http.StatusNotModified { 9327 if res.Body != nil { 9328 res.Body.Close() 9329 } 9330 return nil, gensupport.WrapError(&googleapi.Error{ 9331 Code: res.StatusCode, 9332 Header: res.Header, 9333 }) 9334 } 9335 if err != nil { 9336 return nil, err 9337 } 9338 defer googleapi.CloseBody(res) 9339 if err := googleapi.CheckResponse(res); err != nil { 9340 return nil, gensupport.WrapError(err) 9341 } 9342 ret := &ListMonitoredResourceDescriptorsResponse{ 9343 ServerResponse: googleapi.ServerResponse{ 9344 Header: res.Header, 9345 HTTPStatusCode: res.StatusCode, 9346 }, 9347 } 9348 target := &ret 9349 if err := gensupport.DecodeResponse(target, res); err != nil { 9350 return nil, err 9351 } 9352 return ret, nil 9353 } 9354 9355 // Pages invokes f for each page of results. 9356 // A non-nil error returned from f will halt the iteration. 9357 // The provided context supersedes any context provided to the Context method. 9358 func (c *ProjectsMonitoredResourceDescriptorsListCall) Pages(ctx context.Context, f func(*ListMonitoredResourceDescriptorsResponse) error) error { 9359 c.ctx_ = ctx 9360 defer c.PageToken(c.urlParams_.Get("pageToken")) 9361 for { 9362 x, err := c.Do() 9363 if err != nil { 9364 return err 9365 } 9366 if err := f(x); err != nil { 9367 return err 9368 } 9369 if x.NextPageToken == "" { 9370 return nil 9371 } 9372 c.PageToken(x.NextPageToken) 9373 } 9374 } 9375 9376 type ProjectsNotificationChannelDescriptorsGetCall struct { 9377 s *Service 9378 name string 9379 urlParams_ gensupport.URLParams 9380 ifNoneMatch_ string 9381 ctx_ context.Context 9382 header_ http.Header 9383 } 9384 9385 // Get: Gets a single channel descriptor. The descriptor indicates which fields 9386 // are expected / permitted for a notification channel of the given type. 9387 // 9388 // - name: The channel type for which to execute the request. The format is: 9389 // projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYP 9390 // E]. 9391 func (r *ProjectsNotificationChannelDescriptorsService) Get(name string) *ProjectsNotificationChannelDescriptorsGetCall { 9392 c := &ProjectsNotificationChannelDescriptorsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9393 c.name = name 9394 return c 9395 } 9396 9397 // Fields allows partial responses to be retrieved. See 9398 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9399 // details. 9400 func (c *ProjectsNotificationChannelDescriptorsGetCall) Fields(s ...googleapi.Field) *ProjectsNotificationChannelDescriptorsGetCall { 9401 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9402 return c 9403 } 9404 9405 // IfNoneMatch sets an optional parameter which makes the operation fail if the 9406 // object's ETag matches the given value. This is useful for getting updates 9407 // only after the object has changed since the last request. 9408 func (c *ProjectsNotificationChannelDescriptorsGetCall) IfNoneMatch(entityTag string) *ProjectsNotificationChannelDescriptorsGetCall { 9409 c.ifNoneMatch_ = entityTag 9410 return c 9411 } 9412 9413 // Context sets the context to be used in this call's Do method. 9414 func (c *ProjectsNotificationChannelDescriptorsGetCall) Context(ctx context.Context) *ProjectsNotificationChannelDescriptorsGetCall { 9415 c.ctx_ = ctx 9416 return c 9417 } 9418 9419 // Header returns a http.Header that can be modified by the caller to add 9420 // headers to the request. 9421 func (c *ProjectsNotificationChannelDescriptorsGetCall) Header() http.Header { 9422 if c.header_ == nil { 9423 c.header_ = make(http.Header) 9424 } 9425 return c.header_ 9426 } 9427 9428 func (c *ProjectsNotificationChannelDescriptorsGetCall) doRequest(alt string) (*http.Response, error) { 9429 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9430 if c.ifNoneMatch_ != "" { 9431 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9432 } 9433 var body io.Reader = nil 9434 c.urlParams_.Set("alt", alt) 9435 c.urlParams_.Set("prettyPrint", "false") 9436 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 9437 urls += "?" + c.urlParams_.Encode() 9438 req, err := http.NewRequest("GET", urls, body) 9439 if err != nil { 9440 return nil, err 9441 } 9442 req.Header = reqHeaders 9443 googleapi.Expand(req.URL, map[string]string{ 9444 "name": c.name, 9445 }) 9446 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9447 } 9448 9449 // Do executes the "monitoring.projects.notificationChannelDescriptors.get" call. 9450 // Any non-2xx status code is an error. Response headers are in either 9451 // *NotificationChannelDescriptor.ServerResponse.Header or (if a response was 9452 // returned at all) in error.(*googleapi.Error).Header. Use 9453 // googleapi.IsNotModified to check whether the returned error was because 9454 // http.StatusNotModified was returned. 9455 func (c *ProjectsNotificationChannelDescriptorsGetCall) Do(opts ...googleapi.CallOption) (*NotificationChannelDescriptor, error) { 9456 gensupport.SetOptions(c.urlParams_, opts...) 9457 res, err := c.doRequest("json") 9458 if res != nil && res.StatusCode == http.StatusNotModified { 9459 if res.Body != nil { 9460 res.Body.Close() 9461 } 9462 return nil, gensupport.WrapError(&googleapi.Error{ 9463 Code: res.StatusCode, 9464 Header: res.Header, 9465 }) 9466 } 9467 if err != nil { 9468 return nil, err 9469 } 9470 defer googleapi.CloseBody(res) 9471 if err := googleapi.CheckResponse(res); err != nil { 9472 return nil, gensupport.WrapError(err) 9473 } 9474 ret := &NotificationChannelDescriptor{ 9475 ServerResponse: googleapi.ServerResponse{ 9476 Header: res.Header, 9477 HTTPStatusCode: res.StatusCode, 9478 }, 9479 } 9480 target := &ret 9481 if err := gensupport.DecodeResponse(target, res); err != nil { 9482 return nil, err 9483 } 9484 return ret, nil 9485 } 9486 9487 type ProjectsNotificationChannelDescriptorsListCall struct { 9488 s *Service 9489 name string 9490 urlParams_ gensupport.URLParams 9491 ifNoneMatch_ string 9492 ctx_ context.Context 9493 header_ http.Header 9494 } 9495 9496 // List: Lists the descriptors for supported channel types. The use of 9497 // descriptors makes it possible for new channel types to be dynamically added. 9498 // 9499 // - name: The REST resource name of the parent from which to retrieve the 9500 // notification channel descriptors. The expected syntax is: 9501 // projects/[PROJECT_ID_OR_NUMBER] Note that this names 9502 // (https://cloud.google.com/monitoring/api/v3#project_name) the parent 9503 // container in which to look for the descriptors; to retrieve a single 9504 // descriptor by name, use the GetNotificationChannelDescriptor operation, 9505 // instead. 9506 func (r *ProjectsNotificationChannelDescriptorsService) List(name string) *ProjectsNotificationChannelDescriptorsListCall { 9507 c := &ProjectsNotificationChannelDescriptorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9508 c.name = name 9509 return c 9510 } 9511 9512 // PageSize sets the optional parameter "pageSize": The maximum number of 9513 // results to return in a single response. If not set to a positive number, a 9514 // reasonable value will be chosen by the service. 9515 func (c *ProjectsNotificationChannelDescriptorsListCall) PageSize(pageSize int64) *ProjectsNotificationChannelDescriptorsListCall { 9516 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9517 return c 9518 } 9519 9520 // PageToken sets the optional parameter "pageToken": If non-empty, page_token 9521 // must contain a value returned as the next_page_token in a previous response 9522 // to request the next set of results. 9523 func (c *ProjectsNotificationChannelDescriptorsListCall) PageToken(pageToken string) *ProjectsNotificationChannelDescriptorsListCall { 9524 c.urlParams_.Set("pageToken", pageToken) 9525 return c 9526 } 9527 9528 // Fields allows partial responses to be retrieved. See 9529 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9530 // details. 9531 func (c *ProjectsNotificationChannelDescriptorsListCall) Fields(s ...googleapi.Field) *ProjectsNotificationChannelDescriptorsListCall { 9532 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9533 return c 9534 } 9535 9536 // IfNoneMatch sets an optional parameter which makes the operation fail if the 9537 // object's ETag matches the given value. This is useful for getting updates 9538 // only after the object has changed since the last request. 9539 func (c *ProjectsNotificationChannelDescriptorsListCall) IfNoneMatch(entityTag string) *ProjectsNotificationChannelDescriptorsListCall { 9540 c.ifNoneMatch_ = entityTag 9541 return c 9542 } 9543 9544 // Context sets the context to be used in this call's Do method. 9545 func (c *ProjectsNotificationChannelDescriptorsListCall) Context(ctx context.Context) *ProjectsNotificationChannelDescriptorsListCall { 9546 c.ctx_ = ctx 9547 return c 9548 } 9549 9550 // Header returns a http.Header that can be modified by the caller to add 9551 // headers to the request. 9552 func (c *ProjectsNotificationChannelDescriptorsListCall) Header() http.Header { 9553 if c.header_ == nil { 9554 c.header_ = make(http.Header) 9555 } 9556 return c.header_ 9557 } 9558 9559 func (c *ProjectsNotificationChannelDescriptorsListCall) doRequest(alt string) (*http.Response, error) { 9560 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9561 if c.ifNoneMatch_ != "" { 9562 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9563 } 9564 var body io.Reader = nil 9565 c.urlParams_.Set("alt", alt) 9566 c.urlParams_.Set("prettyPrint", "false") 9567 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/notificationChannelDescriptors") 9568 urls += "?" + c.urlParams_.Encode() 9569 req, err := http.NewRequest("GET", urls, body) 9570 if err != nil { 9571 return nil, err 9572 } 9573 req.Header = reqHeaders 9574 googleapi.Expand(req.URL, map[string]string{ 9575 "name": c.name, 9576 }) 9577 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9578 } 9579 9580 // Do executes the "monitoring.projects.notificationChannelDescriptors.list" call. 9581 // Any non-2xx status code is an error. Response headers are in either 9582 // *ListNotificationChannelDescriptorsResponse.ServerResponse.Header or (if a 9583 // response was returned at all) in error.(*googleapi.Error).Header. Use 9584 // googleapi.IsNotModified to check whether the returned error was because 9585 // http.StatusNotModified was returned. 9586 func (c *ProjectsNotificationChannelDescriptorsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationChannelDescriptorsResponse, error) { 9587 gensupport.SetOptions(c.urlParams_, opts...) 9588 res, err := c.doRequest("json") 9589 if res != nil && res.StatusCode == http.StatusNotModified { 9590 if res.Body != nil { 9591 res.Body.Close() 9592 } 9593 return nil, gensupport.WrapError(&googleapi.Error{ 9594 Code: res.StatusCode, 9595 Header: res.Header, 9596 }) 9597 } 9598 if err != nil { 9599 return nil, err 9600 } 9601 defer googleapi.CloseBody(res) 9602 if err := googleapi.CheckResponse(res); err != nil { 9603 return nil, gensupport.WrapError(err) 9604 } 9605 ret := &ListNotificationChannelDescriptorsResponse{ 9606 ServerResponse: googleapi.ServerResponse{ 9607 Header: res.Header, 9608 HTTPStatusCode: res.StatusCode, 9609 }, 9610 } 9611 target := &ret 9612 if err := gensupport.DecodeResponse(target, res); err != nil { 9613 return nil, err 9614 } 9615 return ret, nil 9616 } 9617 9618 // Pages invokes f for each page of results. 9619 // A non-nil error returned from f will halt the iteration. 9620 // The provided context supersedes any context provided to the Context method. 9621 func (c *ProjectsNotificationChannelDescriptorsListCall) Pages(ctx context.Context, f func(*ListNotificationChannelDescriptorsResponse) error) error { 9622 c.ctx_ = ctx 9623 defer c.PageToken(c.urlParams_.Get("pageToken")) 9624 for { 9625 x, err := c.Do() 9626 if err != nil { 9627 return err 9628 } 9629 if err := f(x); err != nil { 9630 return err 9631 } 9632 if x.NextPageToken == "" { 9633 return nil 9634 } 9635 c.PageToken(x.NextPageToken) 9636 } 9637 } 9638 9639 type ProjectsNotificationChannelsCreateCall struct { 9640 s *Service 9641 name string 9642 notificationchannel *NotificationChannel 9643 urlParams_ gensupport.URLParams 9644 ctx_ context.Context 9645 header_ http.Header 9646 } 9647 9648 // Create: Creates a new notification channel, representing a single 9649 // notification endpoint such as an email address, SMS number, or PagerDuty 9650 // service.Design your application to single-thread API calls that modify the 9651 // state of notification channels in a single project. This includes calls to 9652 // CreateNotificationChannel, DeleteNotificationChannel and 9653 // UpdateNotificationChannel. 9654 // 9655 // - name: The project 9656 // (https://cloud.google.com/monitoring/api/v3#project_name) on which to 9657 // execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER] This 9658 // names the container into which the channel will be written, this does not 9659 // name the newly created channel. The resulting channel's name will have a 9660 // normalized version of this field as a prefix, but will add 9661 // /notificationChannels/[CHANNEL_ID] to identify the channel. 9662 func (r *ProjectsNotificationChannelsService) Create(name string, notificationchannel *NotificationChannel) *ProjectsNotificationChannelsCreateCall { 9663 c := &ProjectsNotificationChannelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9664 c.name = name 9665 c.notificationchannel = notificationchannel 9666 return c 9667 } 9668 9669 // Fields allows partial responses to be retrieved. See 9670 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9671 // details. 9672 func (c *ProjectsNotificationChannelsCreateCall) Fields(s ...googleapi.Field) *ProjectsNotificationChannelsCreateCall { 9673 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9674 return c 9675 } 9676 9677 // Context sets the context to be used in this call's Do method. 9678 func (c *ProjectsNotificationChannelsCreateCall) Context(ctx context.Context) *ProjectsNotificationChannelsCreateCall { 9679 c.ctx_ = ctx 9680 return c 9681 } 9682 9683 // Header returns a http.Header that can be modified by the caller to add 9684 // headers to the request. 9685 func (c *ProjectsNotificationChannelsCreateCall) Header() http.Header { 9686 if c.header_ == nil { 9687 c.header_ = make(http.Header) 9688 } 9689 return c.header_ 9690 } 9691 9692 func (c *ProjectsNotificationChannelsCreateCall) doRequest(alt string) (*http.Response, error) { 9693 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 9694 var body io.Reader = nil 9695 body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationchannel) 9696 if err != nil { 9697 return nil, err 9698 } 9699 c.urlParams_.Set("alt", alt) 9700 c.urlParams_.Set("prettyPrint", "false") 9701 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/notificationChannels") 9702 urls += "?" + c.urlParams_.Encode() 9703 req, err := http.NewRequest("POST", urls, body) 9704 if err != nil { 9705 return nil, err 9706 } 9707 req.Header = reqHeaders 9708 googleapi.Expand(req.URL, map[string]string{ 9709 "name": c.name, 9710 }) 9711 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9712 } 9713 9714 // Do executes the "monitoring.projects.notificationChannels.create" call. 9715 // Any non-2xx status code is an error. Response headers are in either 9716 // *NotificationChannel.ServerResponse.Header or (if a response was returned at 9717 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9718 // check whether the returned error was because http.StatusNotModified was 9719 // returned. 9720 func (c *ProjectsNotificationChannelsCreateCall) Do(opts ...googleapi.CallOption) (*NotificationChannel, error) { 9721 gensupport.SetOptions(c.urlParams_, opts...) 9722 res, err := c.doRequest("json") 9723 if res != nil && res.StatusCode == http.StatusNotModified { 9724 if res.Body != nil { 9725 res.Body.Close() 9726 } 9727 return nil, gensupport.WrapError(&googleapi.Error{ 9728 Code: res.StatusCode, 9729 Header: res.Header, 9730 }) 9731 } 9732 if err != nil { 9733 return nil, err 9734 } 9735 defer googleapi.CloseBody(res) 9736 if err := googleapi.CheckResponse(res); err != nil { 9737 return nil, gensupport.WrapError(err) 9738 } 9739 ret := &NotificationChannel{ 9740 ServerResponse: googleapi.ServerResponse{ 9741 Header: res.Header, 9742 HTTPStatusCode: res.StatusCode, 9743 }, 9744 } 9745 target := &ret 9746 if err := gensupport.DecodeResponse(target, res); err != nil { 9747 return nil, err 9748 } 9749 return ret, nil 9750 } 9751 9752 type ProjectsNotificationChannelsDeleteCall struct { 9753 s *Service 9754 name string 9755 urlParams_ gensupport.URLParams 9756 ctx_ context.Context 9757 header_ http.Header 9758 } 9759 9760 // Delete: Deletes a notification channel.Design your application to 9761 // single-thread API calls that modify the state of notification channels in a 9762 // single project. This includes calls to CreateNotificationChannel, 9763 // DeleteNotificationChannel and UpdateNotificationChannel. 9764 // 9765 // - name: The channel for which to execute the request. The format is: 9766 // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]. 9767 func (r *ProjectsNotificationChannelsService) Delete(name string) *ProjectsNotificationChannelsDeleteCall { 9768 c := &ProjectsNotificationChannelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9769 c.name = name 9770 return c 9771 } 9772 9773 // Force sets the optional parameter "force": If true, the notification channel 9774 // will be deleted regardless of its use in alert policies (the policies will 9775 // be updated to remove the channel). If false, channels that are still 9776 // referenced by an existing alerting policy will fail to be deleted in a 9777 // delete operation. 9778 func (c *ProjectsNotificationChannelsDeleteCall) Force(force bool) *ProjectsNotificationChannelsDeleteCall { 9779 c.urlParams_.Set("force", fmt.Sprint(force)) 9780 return c 9781 } 9782 9783 // Fields allows partial responses to be retrieved. See 9784 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9785 // details. 9786 func (c *ProjectsNotificationChannelsDeleteCall) Fields(s ...googleapi.Field) *ProjectsNotificationChannelsDeleteCall { 9787 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9788 return c 9789 } 9790 9791 // Context sets the context to be used in this call's Do method. 9792 func (c *ProjectsNotificationChannelsDeleteCall) Context(ctx context.Context) *ProjectsNotificationChannelsDeleteCall { 9793 c.ctx_ = ctx 9794 return c 9795 } 9796 9797 // Header returns a http.Header that can be modified by the caller to add 9798 // headers to the request. 9799 func (c *ProjectsNotificationChannelsDeleteCall) Header() http.Header { 9800 if c.header_ == nil { 9801 c.header_ = make(http.Header) 9802 } 9803 return c.header_ 9804 } 9805 9806 func (c *ProjectsNotificationChannelsDeleteCall) doRequest(alt string) (*http.Response, error) { 9807 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9808 var body io.Reader = nil 9809 c.urlParams_.Set("alt", alt) 9810 c.urlParams_.Set("prettyPrint", "false") 9811 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 9812 urls += "?" + c.urlParams_.Encode() 9813 req, err := http.NewRequest("DELETE", urls, body) 9814 if err != nil { 9815 return nil, err 9816 } 9817 req.Header = reqHeaders 9818 googleapi.Expand(req.URL, map[string]string{ 9819 "name": c.name, 9820 }) 9821 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9822 } 9823 9824 // Do executes the "monitoring.projects.notificationChannels.delete" call. 9825 // Any non-2xx status code is an error. Response headers are in either 9826 // *Empty.ServerResponse.Header or (if a response was returned at all) in 9827 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9828 // whether the returned error was because http.StatusNotModified was returned. 9829 func (c *ProjectsNotificationChannelsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 9830 gensupport.SetOptions(c.urlParams_, opts...) 9831 res, err := c.doRequest("json") 9832 if res != nil && res.StatusCode == http.StatusNotModified { 9833 if res.Body != nil { 9834 res.Body.Close() 9835 } 9836 return nil, gensupport.WrapError(&googleapi.Error{ 9837 Code: res.StatusCode, 9838 Header: res.Header, 9839 }) 9840 } 9841 if err != nil { 9842 return nil, err 9843 } 9844 defer googleapi.CloseBody(res) 9845 if err := googleapi.CheckResponse(res); err != nil { 9846 return nil, gensupport.WrapError(err) 9847 } 9848 ret := &Empty{ 9849 ServerResponse: googleapi.ServerResponse{ 9850 Header: res.Header, 9851 HTTPStatusCode: res.StatusCode, 9852 }, 9853 } 9854 target := &ret 9855 if err := gensupport.DecodeResponse(target, res); err != nil { 9856 return nil, err 9857 } 9858 return ret, nil 9859 } 9860 9861 type ProjectsNotificationChannelsGetCall struct { 9862 s *Service 9863 name string 9864 urlParams_ gensupport.URLParams 9865 ifNoneMatch_ string 9866 ctx_ context.Context 9867 header_ http.Header 9868 } 9869 9870 // Get: Gets a single notification channel. The channel includes the relevant 9871 // configuration details with which the channel was created. However, the 9872 // response may truncate or omit passwords, API keys, or other private key 9873 // matter and thus the response may not be 100% identical to the information 9874 // that was supplied in the call to the create method. 9875 // 9876 // - name: The channel for which to execute the request. The format is: 9877 // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]. 9878 func (r *ProjectsNotificationChannelsService) Get(name string) *ProjectsNotificationChannelsGetCall { 9879 c := &ProjectsNotificationChannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9880 c.name = name 9881 return c 9882 } 9883 9884 // Fields allows partial responses to be retrieved. See 9885 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 9886 // details. 9887 func (c *ProjectsNotificationChannelsGetCall) Fields(s ...googleapi.Field) *ProjectsNotificationChannelsGetCall { 9888 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9889 return c 9890 } 9891 9892 // IfNoneMatch sets an optional parameter which makes the operation fail if the 9893 // object's ETag matches the given value. This is useful for getting updates 9894 // only after the object has changed since the last request. 9895 func (c *ProjectsNotificationChannelsGetCall) IfNoneMatch(entityTag string) *ProjectsNotificationChannelsGetCall { 9896 c.ifNoneMatch_ = entityTag 9897 return c 9898 } 9899 9900 // Context sets the context to be used in this call's Do method. 9901 func (c *ProjectsNotificationChannelsGetCall) Context(ctx context.Context) *ProjectsNotificationChannelsGetCall { 9902 c.ctx_ = ctx 9903 return c 9904 } 9905 9906 // Header returns a http.Header that can be modified by the caller to add 9907 // headers to the request. 9908 func (c *ProjectsNotificationChannelsGetCall) Header() http.Header { 9909 if c.header_ == nil { 9910 c.header_ = make(http.Header) 9911 } 9912 return c.header_ 9913 } 9914 9915 func (c *ProjectsNotificationChannelsGetCall) doRequest(alt string) (*http.Response, error) { 9916 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 9917 if c.ifNoneMatch_ != "" { 9918 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9919 } 9920 var body io.Reader = nil 9921 c.urlParams_.Set("alt", alt) 9922 c.urlParams_.Set("prettyPrint", "false") 9923 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 9924 urls += "?" + c.urlParams_.Encode() 9925 req, err := http.NewRequest("GET", urls, body) 9926 if err != nil { 9927 return nil, err 9928 } 9929 req.Header = reqHeaders 9930 googleapi.Expand(req.URL, map[string]string{ 9931 "name": c.name, 9932 }) 9933 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9934 } 9935 9936 // Do executes the "monitoring.projects.notificationChannels.get" call. 9937 // Any non-2xx status code is an error. Response headers are in either 9938 // *NotificationChannel.ServerResponse.Header or (if a response was returned at 9939 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9940 // check whether the returned error was because http.StatusNotModified was 9941 // returned. 9942 func (c *ProjectsNotificationChannelsGetCall) Do(opts ...googleapi.CallOption) (*NotificationChannel, error) { 9943 gensupport.SetOptions(c.urlParams_, opts...) 9944 res, err := c.doRequest("json") 9945 if res != nil && res.StatusCode == http.StatusNotModified { 9946 if res.Body != nil { 9947 res.Body.Close() 9948 } 9949 return nil, gensupport.WrapError(&googleapi.Error{ 9950 Code: res.StatusCode, 9951 Header: res.Header, 9952 }) 9953 } 9954 if err != nil { 9955 return nil, err 9956 } 9957 defer googleapi.CloseBody(res) 9958 if err := googleapi.CheckResponse(res); err != nil { 9959 return nil, gensupport.WrapError(err) 9960 } 9961 ret := &NotificationChannel{ 9962 ServerResponse: googleapi.ServerResponse{ 9963 Header: res.Header, 9964 HTTPStatusCode: res.StatusCode, 9965 }, 9966 } 9967 target := &ret 9968 if err := gensupport.DecodeResponse(target, res); err != nil { 9969 return nil, err 9970 } 9971 return ret, nil 9972 } 9973 9974 type ProjectsNotificationChannelsGetVerificationCodeCall struct { 9975 s *Service 9976 name string 9977 getnotificationchannelverificationcoderequest *GetNotificationChannelVerificationCodeRequest 9978 urlParams_ gensupport.URLParams 9979 ctx_ context.Context 9980 header_ http.Header 9981 } 9982 9983 // GetVerificationCode: Requests a verification code for an already verified 9984 // channel that can then be used in a call to VerifyNotificationChannel() on a 9985 // different channel with an equivalent identity in the same or in a different 9986 // project. This makes it possible to copy a channel between projects without 9987 // requiring manual reverification of the channel. If the channel is not in the 9988 // verified state, this method will fail (in other words, this may only be used 9989 // if the SendNotificationChannelVerificationCode and VerifyNotificationChannel 9990 // paths have already been used to put the given channel into the verified 9991 // state).There is no guarantee that the verification codes returned by this 9992 // method will be of a similar structure or form as the ones that are delivered 9993 // to the channel via SendNotificationChannelVerificationCode; while 9994 // VerifyNotificationChannel() will recognize both the codes delivered via 9995 // SendNotificationChannelVerificationCode() and returned from 9996 // GetNotificationChannelVerificationCode(), it is typically the case that the 9997 // verification codes delivered via SendNotificationChannelVerificationCode() 9998 // will be shorter and also have a shorter expiration (e.g. codes such as 9999 // "G-123456") whereas GetVerificationCode() will typically return a much 10000 // longer, websafe base 64 encoded string that has a longer expiration time. 10001 // 10002 // - name: The notification channel for which a verification code is to be 10003 // generated and retrieved. This must name a channel that is already 10004 // verified; if the specified channel is not verified, the request will fail. 10005 func (r *ProjectsNotificationChannelsService) GetVerificationCode(name string, getnotificationchannelverificationcoderequest *GetNotificationChannelVerificationCodeRequest) *ProjectsNotificationChannelsGetVerificationCodeCall { 10006 c := &ProjectsNotificationChannelsGetVerificationCodeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10007 c.name = name 10008 c.getnotificationchannelverificationcoderequest = getnotificationchannelverificationcoderequest 10009 return c 10010 } 10011 10012 // Fields allows partial responses to be retrieved. See 10013 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10014 // details. 10015 func (c *ProjectsNotificationChannelsGetVerificationCodeCall) Fields(s ...googleapi.Field) *ProjectsNotificationChannelsGetVerificationCodeCall { 10016 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10017 return c 10018 } 10019 10020 // Context sets the context to be used in this call's Do method. 10021 func (c *ProjectsNotificationChannelsGetVerificationCodeCall) Context(ctx context.Context) *ProjectsNotificationChannelsGetVerificationCodeCall { 10022 c.ctx_ = ctx 10023 return c 10024 } 10025 10026 // Header returns a http.Header that can be modified by the caller to add 10027 // headers to the request. 10028 func (c *ProjectsNotificationChannelsGetVerificationCodeCall) Header() http.Header { 10029 if c.header_ == nil { 10030 c.header_ = make(http.Header) 10031 } 10032 return c.header_ 10033 } 10034 10035 func (c *ProjectsNotificationChannelsGetVerificationCodeCall) doRequest(alt string) (*http.Response, error) { 10036 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10037 var body io.Reader = nil 10038 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getnotificationchannelverificationcoderequest) 10039 if err != nil { 10040 return nil, err 10041 } 10042 c.urlParams_.Set("alt", alt) 10043 c.urlParams_.Set("prettyPrint", "false") 10044 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}:getVerificationCode") 10045 urls += "?" + c.urlParams_.Encode() 10046 req, err := http.NewRequest("POST", urls, body) 10047 if err != nil { 10048 return nil, err 10049 } 10050 req.Header = reqHeaders 10051 googleapi.Expand(req.URL, map[string]string{ 10052 "name": c.name, 10053 }) 10054 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10055 } 10056 10057 // Do executes the "monitoring.projects.notificationChannels.getVerificationCode" call. 10058 // Any non-2xx status code is an error. Response headers are in either 10059 // *GetNotificationChannelVerificationCodeResponse.ServerResponse.Header or (if 10060 // a response was returned at all) in error.(*googleapi.Error).Header. Use 10061 // googleapi.IsNotModified to check whether the returned error was because 10062 // http.StatusNotModified was returned. 10063 func (c *ProjectsNotificationChannelsGetVerificationCodeCall) Do(opts ...googleapi.CallOption) (*GetNotificationChannelVerificationCodeResponse, error) { 10064 gensupport.SetOptions(c.urlParams_, opts...) 10065 res, err := c.doRequest("json") 10066 if res != nil && res.StatusCode == http.StatusNotModified { 10067 if res.Body != nil { 10068 res.Body.Close() 10069 } 10070 return nil, gensupport.WrapError(&googleapi.Error{ 10071 Code: res.StatusCode, 10072 Header: res.Header, 10073 }) 10074 } 10075 if err != nil { 10076 return nil, err 10077 } 10078 defer googleapi.CloseBody(res) 10079 if err := googleapi.CheckResponse(res); err != nil { 10080 return nil, gensupport.WrapError(err) 10081 } 10082 ret := &GetNotificationChannelVerificationCodeResponse{ 10083 ServerResponse: googleapi.ServerResponse{ 10084 Header: res.Header, 10085 HTTPStatusCode: res.StatusCode, 10086 }, 10087 } 10088 target := &ret 10089 if err := gensupport.DecodeResponse(target, res); err != nil { 10090 return nil, err 10091 } 10092 return ret, nil 10093 } 10094 10095 type ProjectsNotificationChannelsListCall struct { 10096 s *Service 10097 name string 10098 urlParams_ gensupport.URLParams 10099 ifNoneMatch_ string 10100 ctx_ context.Context 10101 header_ http.Header 10102 } 10103 10104 // List: Lists the notification channels that have been created for the 10105 // project. To list the types of notification channels that are supported, use 10106 // the ListNotificationChannelDescriptors method. 10107 // 10108 // - name: The project 10109 // (https://cloud.google.com/monitoring/api/v3#project_name) on which to 10110 // execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER] This 10111 // names the container in which to look for the notification channels; it 10112 // does not name a specific channel. To query a specific channel by REST 10113 // resource name, use the GetNotificationChannel operation. 10114 func (r *ProjectsNotificationChannelsService) List(name string) *ProjectsNotificationChannelsListCall { 10115 c := &ProjectsNotificationChannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10116 c.name = name 10117 return c 10118 } 10119 10120 // Filter sets the optional parameter "filter": If provided, this field 10121 // specifies the criteria that must be met by notification channels to be 10122 // included in the response.For more details, see sorting and filtering 10123 // (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). 10124 func (c *ProjectsNotificationChannelsListCall) Filter(filter string) *ProjectsNotificationChannelsListCall { 10125 c.urlParams_.Set("filter", filter) 10126 return c 10127 } 10128 10129 // OrderBy sets the optional parameter "orderBy": A comma-separated list of 10130 // fields by which to sort the result. Supports the same set of fields as in 10131 // filter. Entries can be prefixed with a minus sign to sort in descending 10132 // rather than ascending order.For more details, see sorting and filtering 10133 // (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering). 10134 func (c *ProjectsNotificationChannelsListCall) OrderBy(orderBy string) *ProjectsNotificationChannelsListCall { 10135 c.urlParams_.Set("orderBy", orderBy) 10136 return c 10137 } 10138 10139 // PageSize sets the optional parameter "pageSize": The maximum number of 10140 // results to return in a single response. If not set to a positive number, a 10141 // reasonable value will be chosen by the service. 10142 func (c *ProjectsNotificationChannelsListCall) PageSize(pageSize int64) *ProjectsNotificationChannelsListCall { 10143 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 10144 return c 10145 } 10146 10147 // PageToken sets the optional parameter "pageToken": If non-empty, page_token 10148 // must contain a value returned as the next_page_token in a previous response 10149 // to request the next set of results. 10150 func (c *ProjectsNotificationChannelsListCall) PageToken(pageToken string) *ProjectsNotificationChannelsListCall { 10151 c.urlParams_.Set("pageToken", pageToken) 10152 return c 10153 } 10154 10155 // Fields allows partial responses to be retrieved. See 10156 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10157 // details. 10158 func (c *ProjectsNotificationChannelsListCall) Fields(s ...googleapi.Field) *ProjectsNotificationChannelsListCall { 10159 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10160 return c 10161 } 10162 10163 // IfNoneMatch sets an optional parameter which makes the operation fail if the 10164 // object's ETag matches the given value. This is useful for getting updates 10165 // only after the object has changed since the last request. 10166 func (c *ProjectsNotificationChannelsListCall) IfNoneMatch(entityTag string) *ProjectsNotificationChannelsListCall { 10167 c.ifNoneMatch_ = entityTag 10168 return c 10169 } 10170 10171 // Context sets the context to be used in this call's Do method. 10172 func (c *ProjectsNotificationChannelsListCall) Context(ctx context.Context) *ProjectsNotificationChannelsListCall { 10173 c.ctx_ = ctx 10174 return c 10175 } 10176 10177 // Header returns a http.Header that can be modified by the caller to add 10178 // headers to the request. 10179 func (c *ProjectsNotificationChannelsListCall) Header() http.Header { 10180 if c.header_ == nil { 10181 c.header_ = make(http.Header) 10182 } 10183 return c.header_ 10184 } 10185 10186 func (c *ProjectsNotificationChannelsListCall) doRequest(alt string) (*http.Response, error) { 10187 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 10188 if c.ifNoneMatch_ != "" { 10189 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10190 } 10191 var body io.Reader = nil 10192 c.urlParams_.Set("alt", alt) 10193 c.urlParams_.Set("prettyPrint", "false") 10194 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/notificationChannels") 10195 urls += "?" + c.urlParams_.Encode() 10196 req, err := http.NewRequest("GET", urls, body) 10197 if err != nil { 10198 return nil, err 10199 } 10200 req.Header = reqHeaders 10201 googleapi.Expand(req.URL, map[string]string{ 10202 "name": c.name, 10203 }) 10204 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10205 } 10206 10207 // Do executes the "monitoring.projects.notificationChannels.list" call. 10208 // Any non-2xx status code is an error. Response headers are in either 10209 // *ListNotificationChannelsResponse.ServerResponse.Header or (if a response 10210 // was returned at all) in error.(*googleapi.Error).Header. Use 10211 // googleapi.IsNotModified to check whether the returned error was because 10212 // http.StatusNotModified was returned. 10213 func (c *ProjectsNotificationChannelsListCall) Do(opts ...googleapi.CallOption) (*ListNotificationChannelsResponse, error) { 10214 gensupport.SetOptions(c.urlParams_, opts...) 10215 res, err := c.doRequest("json") 10216 if res != nil && res.StatusCode == http.StatusNotModified { 10217 if res.Body != nil { 10218 res.Body.Close() 10219 } 10220 return nil, gensupport.WrapError(&googleapi.Error{ 10221 Code: res.StatusCode, 10222 Header: res.Header, 10223 }) 10224 } 10225 if err != nil { 10226 return nil, err 10227 } 10228 defer googleapi.CloseBody(res) 10229 if err := googleapi.CheckResponse(res); err != nil { 10230 return nil, gensupport.WrapError(err) 10231 } 10232 ret := &ListNotificationChannelsResponse{ 10233 ServerResponse: googleapi.ServerResponse{ 10234 Header: res.Header, 10235 HTTPStatusCode: res.StatusCode, 10236 }, 10237 } 10238 target := &ret 10239 if err := gensupport.DecodeResponse(target, res); err != nil { 10240 return nil, err 10241 } 10242 return ret, nil 10243 } 10244 10245 // Pages invokes f for each page of results. 10246 // A non-nil error returned from f will halt the iteration. 10247 // The provided context supersedes any context provided to the Context method. 10248 func (c *ProjectsNotificationChannelsListCall) Pages(ctx context.Context, f func(*ListNotificationChannelsResponse) error) error { 10249 c.ctx_ = ctx 10250 defer c.PageToken(c.urlParams_.Get("pageToken")) 10251 for { 10252 x, err := c.Do() 10253 if err != nil { 10254 return err 10255 } 10256 if err := f(x); err != nil { 10257 return err 10258 } 10259 if x.NextPageToken == "" { 10260 return nil 10261 } 10262 c.PageToken(x.NextPageToken) 10263 } 10264 } 10265 10266 type ProjectsNotificationChannelsPatchCall struct { 10267 s *Service 10268 name string 10269 notificationchannel *NotificationChannel 10270 urlParams_ gensupport.URLParams 10271 ctx_ context.Context 10272 header_ http.Header 10273 } 10274 10275 // Patch: Updates a notification channel. Fields not specified in the field 10276 // mask remain unchanged.Design your application to single-thread API calls 10277 // that modify the state of notification channels in a single project. This 10278 // includes calls to CreateNotificationChannel, DeleteNotificationChannel and 10279 // UpdateNotificationChannel. 10280 // 10281 // - name: The full REST resource name for this channel. The format is: 10282 // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] The 10283 // [CHANNEL_ID] is automatically assigned by the server on creation. 10284 func (r *ProjectsNotificationChannelsService) Patch(name string, notificationchannel *NotificationChannel) *ProjectsNotificationChannelsPatchCall { 10285 c := &ProjectsNotificationChannelsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10286 c.name = name 10287 c.notificationchannel = notificationchannel 10288 return c 10289 } 10290 10291 // UpdateMask sets the optional parameter "updateMask": The fields to update. 10292 func (c *ProjectsNotificationChannelsPatchCall) UpdateMask(updateMask string) *ProjectsNotificationChannelsPatchCall { 10293 c.urlParams_.Set("updateMask", updateMask) 10294 return c 10295 } 10296 10297 // Fields allows partial responses to be retrieved. See 10298 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10299 // details. 10300 func (c *ProjectsNotificationChannelsPatchCall) Fields(s ...googleapi.Field) *ProjectsNotificationChannelsPatchCall { 10301 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10302 return c 10303 } 10304 10305 // Context sets the context to be used in this call's Do method. 10306 func (c *ProjectsNotificationChannelsPatchCall) Context(ctx context.Context) *ProjectsNotificationChannelsPatchCall { 10307 c.ctx_ = ctx 10308 return c 10309 } 10310 10311 // Header returns a http.Header that can be modified by the caller to add 10312 // headers to the request. 10313 func (c *ProjectsNotificationChannelsPatchCall) Header() http.Header { 10314 if c.header_ == nil { 10315 c.header_ = make(http.Header) 10316 } 10317 return c.header_ 10318 } 10319 10320 func (c *ProjectsNotificationChannelsPatchCall) doRequest(alt string) (*http.Response, error) { 10321 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10322 var body io.Reader = nil 10323 body, err := googleapi.WithoutDataWrapper.JSONReader(c.notificationchannel) 10324 if err != nil { 10325 return nil, err 10326 } 10327 c.urlParams_.Set("alt", alt) 10328 c.urlParams_.Set("prettyPrint", "false") 10329 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 10330 urls += "?" + c.urlParams_.Encode() 10331 req, err := http.NewRequest("PATCH", urls, body) 10332 if err != nil { 10333 return nil, err 10334 } 10335 req.Header = reqHeaders 10336 googleapi.Expand(req.URL, map[string]string{ 10337 "name": c.name, 10338 }) 10339 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10340 } 10341 10342 // Do executes the "monitoring.projects.notificationChannels.patch" call. 10343 // Any non-2xx status code is an error. Response headers are in either 10344 // *NotificationChannel.ServerResponse.Header or (if a response was returned at 10345 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10346 // check whether the returned error was because http.StatusNotModified was 10347 // returned. 10348 func (c *ProjectsNotificationChannelsPatchCall) Do(opts ...googleapi.CallOption) (*NotificationChannel, error) { 10349 gensupport.SetOptions(c.urlParams_, opts...) 10350 res, err := c.doRequest("json") 10351 if res != nil && res.StatusCode == http.StatusNotModified { 10352 if res.Body != nil { 10353 res.Body.Close() 10354 } 10355 return nil, gensupport.WrapError(&googleapi.Error{ 10356 Code: res.StatusCode, 10357 Header: res.Header, 10358 }) 10359 } 10360 if err != nil { 10361 return nil, err 10362 } 10363 defer googleapi.CloseBody(res) 10364 if err := googleapi.CheckResponse(res); err != nil { 10365 return nil, gensupport.WrapError(err) 10366 } 10367 ret := &NotificationChannel{ 10368 ServerResponse: googleapi.ServerResponse{ 10369 Header: res.Header, 10370 HTTPStatusCode: res.StatusCode, 10371 }, 10372 } 10373 target := &ret 10374 if err := gensupport.DecodeResponse(target, res); err != nil { 10375 return nil, err 10376 } 10377 return ret, nil 10378 } 10379 10380 type ProjectsNotificationChannelsSendVerificationCodeCall struct { 10381 s *Service 10382 name string 10383 sendnotificationchannelverificationcoderequest *SendNotificationChannelVerificationCodeRequest 10384 urlParams_ gensupport.URLParams 10385 ctx_ context.Context 10386 header_ http.Header 10387 } 10388 10389 // SendVerificationCode: Causes a verification code to be delivered to the 10390 // channel. The code can then be supplied in VerifyNotificationChannel to 10391 // verify the channel. 10392 // 10393 // - name: The notification channel to which to send a verification code. 10394 func (r *ProjectsNotificationChannelsService) SendVerificationCode(name string, sendnotificationchannelverificationcoderequest *SendNotificationChannelVerificationCodeRequest) *ProjectsNotificationChannelsSendVerificationCodeCall { 10395 c := &ProjectsNotificationChannelsSendVerificationCodeCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10396 c.name = name 10397 c.sendnotificationchannelverificationcoderequest = sendnotificationchannelverificationcoderequest 10398 return c 10399 } 10400 10401 // Fields allows partial responses to be retrieved. See 10402 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10403 // details. 10404 func (c *ProjectsNotificationChannelsSendVerificationCodeCall) Fields(s ...googleapi.Field) *ProjectsNotificationChannelsSendVerificationCodeCall { 10405 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10406 return c 10407 } 10408 10409 // Context sets the context to be used in this call's Do method. 10410 func (c *ProjectsNotificationChannelsSendVerificationCodeCall) Context(ctx context.Context) *ProjectsNotificationChannelsSendVerificationCodeCall { 10411 c.ctx_ = ctx 10412 return c 10413 } 10414 10415 // Header returns a http.Header that can be modified by the caller to add 10416 // headers to the request. 10417 func (c *ProjectsNotificationChannelsSendVerificationCodeCall) Header() http.Header { 10418 if c.header_ == nil { 10419 c.header_ = make(http.Header) 10420 } 10421 return c.header_ 10422 } 10423 10424 func (c *ProjectsNotificationChannelsSendVerificationCodeCall) doRequest(alt string) (*http.Response, error) { 10425 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10426 var body io.Reader = nil 10427 body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendnotificationchannelverificationcoderequest) 10428 if err != nil { 10429 return nil, err 10430 } 10431 c.urlParams_.Set("alt", alt) 10432 c.urlParams_.Set("prettyPrint", "false") 10433 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}:sendVerificationCode") 10434 urls += "?" + c.urlParams_.Encode() 10435 req, err := http.NewRequest("POST", urls, body) 10436 if err != nil { 10437 return nil, err 10438 } 10439 req.Header = reqHeaders 10440 googleapi.Expand(req.URL, map[string]string{ 10441 "name": c.name, 10442 }) 10443 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10444 } 10445 10446 // Do executes the "monitoring.projects.notificationChannels.sendVerificationCode" call. 10447 // Any non-2xx status code is an error. Response headers are in either 10448 // *Empty.ServerResponse.Header or (if a response was returned at all) in 10449 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10450 // whether the returned error was because http.StatusNotModified was returned. 10451 func (c *ProjectsNotificationChannelsSendVerificationCodeCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 10452 gensupport.SetOptions(c.urlParams_, opts...) 10453 res, err := c.doRequest("json") 10454 if res != nil && res.StatusCode == http.StatusNotModified { 10455 if res.Body != nil { 10456 res.Body.Close() 10457 } 10458 return nil, gensupport.WrapError(&googleapi.Error{ 10459 Code: res.StatusCode, 10460 Header: res.Header, 10461 }) 10462 } 10463 if err != nil { 10464 return nil, err 10465 } 10466 defer googleapi.CloseBody(res) 10467 if err := googleapi.CheckResponse(res); err != nil { 10468 return nil, gensupport.WrapError(err) 10469 } 10470 ret := &Empty{ 10471 ServerResponse: googleapi.ServerResponse{ 10472 Header: res.Header, 10473 HTTPStatusCode: res.StatusCode, 10474 }, 10475 } 10476 target := &ret 10477 if err := gensupport.DecodeResponse(target, res); err != nil { 10478 return nil, err 10479 } 10480 return ret, nil 10481 } 10482 10483 type ProjectsNotificationChannelsVerifyCall struct { 10484 s *Service 10485 name string 10486 verifynotificationchannelrequest *VerifyNotificationChannelRequest 10487 urlParams_ gensupport.URLParams 10488 ctx_ context.Context 10489 header_ http.Header 10490 } 10491 10492 // Verify: Verifies a NotificationChannel by proving receipt of the code 10493 // delivered to the channel as a result of calling 10494 // SendNotificationChannelVerificationCode. 10495 // 10496 // - name: The notification channel to verify. 10497 func (r *ProjectsNotificationChannelsService) Verify(name string, verifynotificationchannelrequest *VerifyNotificationChannelRequest) *ProjectsNotificationChannelsVerifyCall { 10498 c := &ProjectsNotificationChannelsVerifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10499 c.name = name 10500 c.verifynotificationchannelrequest = verifynotificationchannelrequest 10501 return c 10502 } 10503 10504 // Fields allows partial responses to be retrieved. See 10505 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10506 // details. 10507 func (c *ProjectsNotificationChannelsVerifyCall) Fields(s ...googleapi.Field) *ProjectsNotificationChannelsVerifyCall { 10508 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10509 return c 10510 } 10511 10512 // Context sets the context to be used in this call's Do method. 10513 func (c *ProjectsNotificationChannelsVerifyCall) Context(ctx context.Context) *ProjectsNotificationChannelsVerifyCall { 10514 c.ctx_ = ctx 10515 return c 10516 } 10517 10518 // Header returns a http.Header that can be modified by the caller to add 10519 // headers to the request. 10520 func (c *ProjectsNotificationChannelsVerifyCall) Header() http.Header { 10521 if c.header_ == nil { 10522 c.header_ = make(http.Header) 10523 } 10524 return c.header_ 10525 } 10526 10527 func (c *ProjectsNotificationChannelsVerifyCall) doRequest(alt string) (*http.Response, error) { 10528 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10529 var body io.Reader = nil 10530 body, err := googleapi.WithoutDataWrapper.JSONReader(c.verifynotificationchannelrequest) 10531 if err != nil { 10532 return nil, err 10533 } 10534 c.urlParams_.Set("alt", alt) 10535 c.urlParams_.Set("prettyPrint", "false") 10536 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}:verify") 10537 urls += "?" + c.urlParams_.Encode() 10538 req, err := http.NewRequest("POST", urls, body) 10539 if err != nil { 10540 return nil, err 10541 } 10542 req.Header = reqHeaders 10543 googleapi.Expand(req.URL, map[string]string{ 10544 "name": c.name, 10545 }) 10546 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10547 } 10548 10549 // Do executes the "monitoring.projects.notificationChannels.verify" call. 10550 // Any non-2xx status code is an error. Response headers are in either 10551 // *NotificationChannel.ServerResponse.Header or (if a response was returned at 10552 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10553 // check whether the returned error was because http.StatusNotModified was 10554 // returned. 10555 func (c *ProjectsNotificationChannelsVerifyCall) Do(opts ...googleapi.CallOption) (*NotificationChannel, error) { 10556 gensupport.SetOptions(c.urlParams_, opts...) 10557 res, err := c.doRequest("json") 10558 if res != nil && res.StatusCode == http.StatusNotModified { 10559 if res.Body != nil { 10560 res.Body.Close() 10561 } 10562 return nil, gensupport.WrapError(&googleapi.Error{ 10563 Code: res.StatusCode, 10564 Header: res.Header, 10565 }) 10566 } 10567 if err != nil { 10568 return nil, err 10569 } 10570 defer googleapi.CloseBody(res) 10571 if err := googleapi.CheckResponse(res); err != nil { 10572 return nil, gensupport.WrapError(err) 10573 } 10574 ret := &NotificationChannel{ 10575 ServerResponse: googleapi.ServerResponse{ 10576 Header: res.Header, 10577 HTTPStatusCode: res.StatusCode, 10578 }, 10579 } 10580 target := &ret 10581 if err := gensupport.DecodeResponse(target, res); err != nil { 10582 return nil, err 10583 } 10584 return ret, nil 10585 } 10586 10587 type ProjectsSnoozesCreateCall struct { 10588 s *Service 10589 parent string 10590 snooze *Snooze 10591 urlParams_ gensupport.URLParams 10592 ctx_ context.Context 10593 header_ http.Header 10594 } 10595 10596 // Create: Creates a Snooze that will prevent alerts, which match the provided 10597 // criteria, from being opened. The Snooze applies for a specific time 10598 // interval. 10599 // 10600 // - parent: The project 10601 // (https://cloud.google.com/monitoring/api/v3#project_name) in which a 10602 // Snooze should be created. The format is: projects/[PROJECT_ID_OR_NUMBER]. 10603 func (r *ProjectsSnoozesService) Create(parent string, snooze *Snooze) *ProjectsSnoozesCreateCall { 10604 c := &ProjectsSnoozesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10605 c.parent = parent 10606 c.snooze = snooze 10607 return c 10608 } 10609 10610 // Fields allows partial responses to be retrieved. See 10611 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10612 // details. 10613 func (c *ProjectsSnoozesCreateCall) Fields(s ...googleapi.Field) *ProjectsSnoozesCreateCall { 10614 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10615 return c 10616 } 10617 10618 // Context sets the context to be used in this call's Do method. 10619 func (c *ProjectsSnoozesCreateCall) Context(ctx context.Context) *ProjectsSnoozesCreateCall { 10620 c.ctx_ = ctx 10621 return c 10622 } 10623 10624 // Header returns a http.Header that can be modified by the caller to add 10625 // headers to the request. 10626 func (c *ProjectsSnoozesCreateCall) Header() http.Header { 10627 if c.header_ == nil { 10628 c.header_ = make(http.Header) 10629 } 10630 return c.header_ 10631 } 10632 10633 func (c *ProjectsSnoozesCreateCall) doRequest(alt string) (*http.Response, error) { 10634 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 10635 var body io.Reader = nil 10636 body, err := googleapi.WithoutDataWrapper.JSONReader(c.snooze) 10637 if err != nil { 10638 return nil, err 10639 } 10640 c.urlParams_.Set("alt", alt) 10641 c.urlParams_.Set("prettyPrint", "false") 10642 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/snoozes") 10643 urls += "?" + c.urlParams_.Encode() 10644 req, err := http.NewRequest("POST", urls, body) 10645 if err != nil { 10646 return nil, err 10647 } 10648 req.Header = reqHeaders 10649 googleapi.Expand(req.URL, map[string]string{ 10650 "parent": c.parent, 10651 }) 10652 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10653 } 10654 10655 // Do executes the "monitoring.projects.snoozes.create" call. 10656 // Any non-2xx status code is an error. Response headers are in either 10657 // *Snooze.ServerResponse.Header or (if a response was returned at all) in 10658 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10659 // whether the returned error was because http.StatusNotModified was returned. 10660 func (c *ProjectsSnoozesCreateCall) Do(opts ...googleapi.CallOption) (*Snooze, error) { 10661 gensupport.SetOptions(c.urlParams_, opts...) 10662 res, err := c.doRequest("json") 10663 if res != nil && res.StatusCode == http.StatusNotModified { 10664 if res.Body != nil { 10665 res.Body.Close() 10666 } 10667 return nil, gensupport.WrapError(&googleapi.Error{ 10668 Code: res.StatusCode, 10669 Header: res.Header, 10670 }) 10671 } 10672 if err != nil { 10673 return nil, err 10674 } 10675 defer googleapi.CloseBody(res) 10676 if err := googleapi.CheckResponse(res); err != nil { 10677 return nil, gensupport.WrapError(err) 10678 } 10679 ret := &Snooze{ 10680 ServerResponse: googleapi.ServerResponse{ 10681 Header: res.Header, 10682 HTTPStatusCode: res.StatusCode, 10683 }, 10684 } 10685 target := &ret 10686 if err := gensupport.DecodeResponse(target, res); err != nil { 10687 return nil, err 10688 } 10689 return ret, nil 10690 } 10691 10692 type ProjectsSnoozesGetCall struct { 10693 s *Service 10694 name string 10695 urlParams_ gensupport.URLParams 10696 ifNoneMatch_ string 10697 ctx_ context.Context 10698 header_ http.Header 10699 } 10700 10701 // Get: Retrieves a Snooze by name. 10702 // 10703 // - name: The ID of the Snooze to retrieve. The format is: 10704 // projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID]. 10705 func (r *ProjectsSnoozesService) Get(name string) *ProjectsSnoozesGetCall { 10706 c := &ProjectsSnoozesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10707 c.name = name 10708 return c 10709 } 10710 10711 // Fields allows partial responses to be retrieved. See 10712 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10713 // details. 10714 func (c *ProjectsSnoozesGetCall) Fields(s ...googleapi.Field) *ProjectsSnoozesGetCall { 10715 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10716 return c 10717 } 10718 10719 // IfNoneMatch sets an optional parameter which makes the operation fail if the 10720 // object's ETag matches the given value. This is useful for getting updates 10721 // only after the object has changed since the last request. 10722 func (c *ProjectsSnoozesGetCall) IfNoneMatch(entityTag string) *ProjectsSnoozesGetCall { 10723 c.ifNoneMatch_ = entityTag 10724 return c 10725 } 10726 10727 // Context sets the context to be used in this call's Do method. 10728 func (c *ProjectsSnoozesGetCall) Context(ctx context.Context) *ProjectsSnoozesGetCall { 10729 c.ctx_ = ctx 10730 return c 10731 } 10732 10733 // Header returns a http.Header that can be modified by the caller to add 10734 // headers to the request. 10735 func (c *ProjectsSnoozesGetCall) Header() http.Header { 10736 if c.header_ == nil { 10737 c.header_ = make(http.Header) 10738 } 10739 return c.header_ 10740 } 10741 10742 func (c *ProjectsSnoozesGetCall) doRequest(alt string) (*http.Response, error) { 10743 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 10744 if c.ifNoneMatch_ != "" { 10745 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10746 } 10747 var body io.Reader = nil 10748 c.urlParams_.Set("alt", alt) 10749 c.urlParams_.Set("prettyPrint", "false") 10750 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 10751 urls += "?" + c.urlParams_.Encode() 10752 req, err := http.NewRequest("GET", urls, body) 10753 if err != nil { 10754 return nil, err 10755 } 10756 req.Header = reqHeaders 10757 googleapi.Expand(req.URL, map[string]string{ 10758 "name": c.name, 10759 }) 10760 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10761 } 10762 10763 // Do executes the "monitoring.projects.snoozes.get" call. 10764 // Any non-2xx status code is an error. Response headers are in either 10765 // *Snooze.ServerResponse.Header or (if a response was returned at all) in 10766 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10767 // whether the returned error was because http.StatusNotModified was returned. 10768 func (c *ProjectsSnoozesGetCall) Do(opts ...googleapi.CallOption) (*Snooze, error) { 10769 gensupport.SetOptions(c.urlParams_, opts...) 10770 res, err := c.doRequest("json") 10771 if res != nil && res.StatusCode == http.StatusNotModified { 10772 if res.Body != nil { 10773 res.Body.Close() 10774 } 10775 return nil, gensupport.WrapError(&googleapi.Error{ 10776 Code: res.StatusCode, 10777 Header: res.Header, 10778 }) 10779 } 10780 if err != nil { 10781 return nil, err 10782 } 10783 defer googleapi.CloseBody(res) 10784 if err := googleapi.CheckResponse(res); err != nil { 10785 return nil, gensupport.WrapError(err) 10786 } 10787 ret := &Snooze{ 10788 ServerResponse: googleapi.ServerResponse{ 10789 Header: res.Header, 10790 HTTPStatusCode: res.StatusCode, 10791 }, 10792 } 10793 target := &ret 10794 if err := gensupport.DecodeResponse(target, res); err != nil { 10795 return nil, err 10796 } 10797 return ret, nil 10798 } 10799 10800 type ProjectsSnoozesListCall struct { 10801 s *Service 10802 parent string 10803 urlParams_ gensupport.URLParams 10804 ifNoneMatch_ string 10805 ctx_ context.Context 10806 header_ http.Header 10807 } 10808 10809 // List: Lists the Snoozes associated with a project. Can optionally pass in 10810 // filter, which specifies predicates to match Snoozes. 10811 // 10812 // - parent: The project 10813 // (https://cloud.google.com/monitoring/api/v3#project_name) whose Snoozes 10814 // should be listed. The format is: projects/[PROJECT_ID_OR_NUMBER]. 10815 func (r *ProjectsSnoozesService) List(parent string) *ProjectsSnoozesListCall { 10816 c := &ProjectsSnoozesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10817 c.parent = parent 10818 return c 10819 } 10820 10821 // Filter sets the optional parameter "filter": Optional filter to restrict 10822 // results to the given criteria. The following fields are supported. 10823 // interval.start_time interval.end_timeFor example: ``` interval.start_time > 10824 // "2022-03-11T00:00:00-08:00" AND interval.end_time < 10825 // "2022-03-12T00:00:00-08:00" ``` 10826 func (c *ProjectsSnoozesListCall) Filter(filter string) *ProjectsSnoozesListCall { 10827 c.urlParams_.Set("filter", filter) 10828 return c 10829 } 10830 10831 // PageSize sets the optional parameter "pageSize": The maximum number of 10832 // results to return for a single query. The server may further constrain the 10833 // maximum number of results returned in a single page. The value should be in 10834 // the range 1, 1000. If the value given is outside this range, the server will 10835 // decide the number of results to be returned. 10836 func (c *ProjectsSnoozesListCall) PageSize(pageSize int64) *ProjectsSnoozesListCall { 10837 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 10838 return c 10839 } 10840 10841 // PageToken sets the optional parameter "pageToken": The next_page_token from 10842 // a previous call to ListSnoozesRequest to get the next page of results. 10843 func (c *ProjectsSnoozesListCall) PageToken(pageToken string) *ProjectsSnoozesListCall { 10844 c.urlParams_.Set("pageToken", pageToken) 10845 return c 10846 } 10847 10848 // Fields allows partial responses to be retrieved. See 10849 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 10850 // details. 10851 func (c *ProjectsSnoozesListCall) Fields(s ...googleapi.Field) *ProjectsSnoozesListCall { 10852 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10853 return c 10854 } 10855 10856 // IfNoneMatch sets an optional parameter which makes the operation fail if the 10857 // object's ETag matches the given value. This is useful for getting updates 10858 // only after the object has changed since the last request. 10859 func (c *ProjectsSnoozesListCall) IfNoneMatch(entityTag string) *ProjectsSnoozesListCall { 10860 c.ifNoneMatch_ = entityTag 10861 return c 10862 } 10863 10864 // Context sets the context to be used in this call's Do method. 10865 func (c *ProjectsSnoozesListCall) Context(ctx context.Context) *ProjectsSnoozesListCall { 10866 c.ctx_ = ctx 10867 return c 10868 } 10869 10870 // Header returns a http.Header that can be modified by the caller to add 10871 // headers to the request. 10872 func (c *ProjectsSnoozesListCall) Header() http.Header { 10873 if c.header_ == nil { 10874 c.header_ = make(http.Header) 10875 } 10876 return c.header_ 10877 } 10878 10879 func (c *ProjectsSnoozesListCall) doRequest(alt string) (*http.Response, error) { 10880 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 10881 if c.ifNoneMatch_ != "" { 10882 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10883 } 10884 var body io.Reader = nil 10885 c.urlParams_.Set("alt", alt) 10886 c.urlParams_.Set("prettyPrint", "false") 10887 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/snoozes") 10888 urls += "?" + c.urlParams_.Encode() 10889 req, err := http.NewRequest("GET", urls, body) 10890 if err != nil { 10891 return nil, err 10892 } 10893 req.Header = reqHeaders 10894 googleapi.Expand(req.URL, map[string]string{ 10895 "parent": c.parent, 10896 }) 10897 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10898 } 10899 10900 // Do executes the "monitoring.projects.snoozes.list" call. 10901 // Any non-2xx status code is an error. Response headers are in either 10902 // *ListSnoozesResponse.ServerResponse.Header or (if a response was returned at 10903 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10904 // check whether the returned error was because http.StatusNotModified was 10905 // returned. 10906 func (c *ProjectsSnoozesListCall) Do(opts ...googleapi.CallOption) (*ListSnoozesResponse, error) { 10907 gensupport.SetOptions(c.urlParams_, opts...) 10908 res, err := c.doRequest("json") 10909 if res != nil && res.StatusCode == http.StatusNotModified { 10910 if res.Body != nil { 10911 res.Body.Close() 10912 } 10913 return nil, gensupport.WrapError(&googleapi.Error{ 10914 Code: res.StatusCode, 10915 Header: res.Header, 10916 }) 10917 } 10918 if err != nil { 10919 return nil, err 10920 } 10921 defer googleapi.CloseBody(res) 10922 if err := googleapi.CheckResponse(res); err != nil { 10923 return nil, gensupport.WrapError(err) 10924 } 10925 ret := &ListSnoozesResponse{ 10926 ServerResponse: googleapi.ServerResponse{ 10927 Header: res.Header, 10928 HTTPStatusCode: res.StatusCode, 10929 }, 10930 } 10931 target := &ret 10932 if err := gensupport.DecodeResponse(target, res); err != nil { 10933 return nil, err 10934 } 10935 return ret, nil 10936 } 10937 10938 // Pages invokes f for each page of results. 10939 // A non-nil error returned from f will halt the iteration. 10940 // The provided context supersedes any context provided to the Context method. 10941 func (c *ProjectsSnoozesListCall) Pages(ctx context.Context, f func(*ListSnoozesResponse) error) error { 10942 c.ctx_ = ctx 10943 defer c.PageToken(c.urlParams_.Get("pageToken")) 10944 for { 10945 x, err := c.Do() 10946 if err != nil { 10947 return err 10948 } 10949 if err := f(x); err != nil { 10950 return err 10951 } 10952 if x.NextPageToken == "" { 10953 return nil 10954 } 10955 c.PageToken(x.NextPageToken) 10956 } 10957 } 10958 10959 type ProjectsSnoozesPatchCall struct { 10960 s *Service 10961 name string 10962 snooze *Snooze 10963 urlParams_ gensupport.URLParams 10964 ctx_ context.Context 10965 header_ http.Header 10966 } 10967 10968 // Patch: Updates a Snooze, identified by its name, with the parameters in the 10969 // given Snooze object. 10970 // 10971 // - name: The name of the Snooze. The format is: 10972 // projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] The ID of the Snooze 10973 // will be generated by the system. 10974 func (r *ProjectsSnoozesService) Patch(name string, snooze *Snooze) *ProjectsSnoozesPatchCall { 10975 c := &ProjectsSnoozesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10976 c.name = name 10977 c.snooze = snooze 10978 return c 10979 } 10980 10981 // UpdateMask sets the optional parameter "updateMask": Required. The fields to 10982 // update.For each field listed in update_mask: If the Snooze object supplied 10983 // in the UpdateSnoozeRequest has a value for that field, the value of the 10984 // field in the existing Snooze will be set to the value of the field in the 10985 // supplied Snooze. If the field does not have a value in the supplied Snooze, 10986 // the field in the existing Snooze is set to its default value.Fields not 10987 // listed retain their existing value.The following are the field names that 10988 // are accepted in update_mask: display_name interval.start_time 10989 // interval.end_timeThat said, the start time and end time of the Snooze 10990 // determines which fields can legally be updated. Before attempting an update, 10991 // users should consult the documentation for UpdateSnoozeRequest, which talks 10992 // about which fields can be updated. 10993 func (c *ProjectsSnoozesPatchCall) UpdateMask(updateMask string) *ProjectsSnoozesPatchCall { 10994 c.urlParams_.Set("updateMask", updateMask) 10995 return c 10996 } 10997 10998 // Fields allows partial responses to be retrieved. See 10999 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11000 // details. 11001 func (c *ProjectsSnoozesPatchCall) Fields(s ...googleapi.Field) *ProjectsSnoozesPatchCall { 11002 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11003 return c 11004 } 11005 11006 // Context sets the context to be used in this call's Do method. 11007 func (c *ProjectsSnoozesPatchCall) Context(ctx context.Context) *ProjectsSnoozesPatchCall { 11008 c.ctx_ = ctx 11009 return c 11010 } 11011 11012 // Header returns a http.Header that can be modified by the caller to add 11013 // headers to the request. 11014 func (c *ProjectsSnoozesPatchCall) Header() http.Header { 11015 if c.header_ == nil { 11016 c.header_ = make(http.Header) 11017 } 11018 return c.header_ 11019 } 11020 11021 func (c *ProjectsSnoozesPatchCall) doRequest(alt string) (*http.Response, error) { 11022 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11023 var body io.Reader = nil 11024 body, err := googleapi.WithoutDataWrapper.JSONReader(c.snooze) 11025 if err != nil { 11026 return nil, err 11027 } 11028 c.urlParams_.Set("alt", alt) 11029 c.urlParams_.Set("prettyPrint", "false") 11030 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 11031 urls += "?" + c.urlParams_.Encode() 11032 req, err := http.NewRequest("PATCH", urls, body) 11033 if err != nil { 11034 return nil, err 11035 } 11036 req.Header = reqHeaders 11037 googleapi.Expand(req.URL, map[string]string{ 11038 "name": c.name, 11039 }) 11040 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11041 } 11042 11043 // Do executes the "monitoring.projects.snoozes.patch" call. 11044 // Any non-2xx status code is an error. Response headers are in either 11045 // *Snooze.ServerResponse.Header or (if a response was returned at all) in 11046 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11047 // whether the returned error was because http.StatusNotModified was returned. 11048 func (c *ProjectsSnoozesPatchCall) Do(opts ...googleapi.CallOption) (*Snooze, error) { 11049 gensupport.SetOptions(c.urlParams_, opts...) 11050 res, err := c.doRequest("json") 11051 if res != nil && res.StatusCode == http.StatusNotModified { 11052 if res.Body != nil { 11053 res.Body.Close() 11054 } 11055 return nil, gensupport.WrapError(&googleapi.Error{ 11056 Code: res.StatusCode, 11057 Header: res.Header, 11058 }) 11059 } 11060 if err != nil { 11061 return nil, err 11062 } 11063 defer googleapi.CloseBody(res) 11064 if err := googleapi.CheckResponse(res); err != nil { 11065 return nil, gensupport.WrapError(err) 11066 } 11067 ret := &Snooze{ 11068 ServerResponse: googleapi.ServerResponse{ 11069 Header: res.Header, 11070 HTTPStatusCode: res.StatusCode, 11071 }, 11072 } 11073 target := &ret 11074 if err := gensupport.DecodeResponse(target, res); err != nil { 11075 return nil, err 11076 } 11077 return ret, nil 11078 } 11079 11080 type ProjectsTimeSeriesCreateCall struct { 11081 s *Service 11082 name string 11083 createtimeseriesrequest *CreateTimeSeriesRequest 11084 urlParams_ gensupport.URLParams 11085 ctx_ context.Context 11086 header_ http.Header 11087 } 11088 11089 // Create: Creates or adds data to one or more time series. The response is 11090 // empty if all time series in the request were written. If any time series 11091 // could not be written, a corresponding failure message is included in the 11092 // error response. This method does not support resource locations constraint 11093 // of an organization policy 11094 // (https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy). 11095 // 11096 // - name: The project 11097 // (https://cloud.google.com/monitoring/api/v3#project_name) on which to 11098 // execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER]. 11099 func (r *ProjectsTimeSeriesService) Create(name string, createtimeseriesrequest *CreateTimeSeriesRequest) *ProjectsTimeSeriesCreateCall { 11100 c := &ProjectsTimeSeriesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11101 c.name = name 11102 c.createtimeseriesrequest = createtimeseriesrequest 11103 return c 11104 } 11105 11106 // Fields allows partial responses to be retrieved. See 11107 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11108 // details. 11109 func (c *ProjectsTimeSeriesCreateCall) Fields(s ...googleapi.Field) *ProjectsTimeSeriesCreateCall { 11110 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11111 return c 11112 } 11113 11114 // Context sets the context to be used in this call's Do method. 11115 func (c *ProjectsTimeSeriesCreateCall) Context(ctx context.Context) *ProjectsTimeSeriesCreateCall { 11116 c.ctx_ = ctx 11117 return c 11118 } 11119 11120 // Header returns a http.Header that can be modified by the caller to add 11121 // headers to the request. 11122 func (c *ProjectsTimeSeriesCreateCall) Header() http.Header { 11123 if c.header_ == nil { 11124 c.header_ = make(http.Header) 11125 } 11126 return c.header_ 11127 } 11128 11129 func (c *ProjectsTimeSeriesCreateCall) doRequest(alt string) (*http.Response, error) { 11130 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11131 var body io.Reader = nil 11132 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createtimeseriesrequest) 11133 if err != nil { 11134 return nil, err 11135 } 11136 c.urlParams_.Set("alt", alt) 11137 c.urlParams_.Set("prettyPrint", "false") 11138 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/timeSeries") 11139 urls += "?" + c.urlParams_.Encode() 11140 req, err := http.NewRequest("POST", urls, body) 11141 if err != nil { 11142 return nil, err 11143 } 11144 req.Header = reqHeaders 11145 googleapi.Expand(req.URL, map[string]string{ 11146 "name": c.name, 11147 }) 11148 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11149 } 11150 11151 // Do executes the "monitoring.projects.timeSeries.create" call. 11152 // Any non-2xx status code is an error. Response headers are in either 11153 // *Empty.ServerResponse.Header or (if a response was returned at all) in 11154 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11155 // whether the returned error was because http.StatusNotModified was returned. 11156 func (c *ProjectsTimeSeriesCreateCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 11157 gensupport.SetOptions(c.urlParams_, opts...) 11158 res, err := c.doRequest("json") 11159 if res != nil && res.StatusCode == http.StatusNotModified { 11160 if res.Body != nil { 11161 res.Body.Close() 11162 } 11163 return nil, gensupport.WrapError(&googleapi.Error{ 11164 Code: res.StatusCode, 11165 Header: res.Header, 11166 }) 11167 } 11168 if err != nil { 11169 return nil, err 11170 } 11171 defer googleapi.CloseBody(res) 11172 if err := googleapi.CheckResponse(res); err != nil { 11173 return nil, gensupport.WrapError(err) 11174 } 11175 ret := &Empty{ 11176 ServerResponse: googleapi.ServerResponse{ 11177 Header: res.Header, 11178 HTTPStatusCode: res.StatusCode, 11179 }, 11180 } 11181 target := &ret 11182 if err := gensupport.DecodeResponse(target, res); err != nil { 11183 return nil, err 11184 } 11185 return ret, nil 11186 } 11187 11188 type ProjectsTimeSeriesCreateServiceCall struct { 11189 s *Service 11190 name string 11191 createtimeseriesrequest *CreateTimeSeriesRequest 11192 urlParams_ gensupport.URLParams 11193 ctx_ context.Context 11194 header_ http.Header 11195 } 11196 11197 // CreateService: Creates or adds data to one or more service time series. A 11198 // service time series is a time series for a metric from a Google Cloud 11199 // service. The response is empty if all time series in the request were 11200 // written. If any time series could not be written, a corresponding failure 11201 // message is included in the error response. This endpoint rejects writes to 11202 // user-defined metrics. This method is only for use by Google Cloud services. 11203 // Use projects.timeSeries.create instead. 11204 // 11205 // - name: The project 11206 // (https://cloud.google.com/monitoring/api/v3#project_name) on which to 11207 // execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER]. 11208 func (r *ProjectsTimeSeriesService) CreateService(name string, createtimeseriesrequest *CreateTimeSeriesRequest) *ProjectsTimeSeriesCreateServiceCall { 11209 c := &ProjectsTimeSeriesCreateServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11210 c.name = name 11211 c.createtimeseriesrequest = createtimeseriesrequest 11212 return c 11213 } 11214 11215 // Fields allows partial responses to be retrieved. See 11216 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11217 // details. 11218 func (c *ProjectsTimeSeriesCreateServiceCall) Fields(s ...googleapi.Field) *ProjectsTimeSeriesCreateServiceCall { 11219 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11220 return c 11221 } 11222 11223 // Context sets the context to be used in this call's Do method. 11224 func (c *ProjectsTimeSeriesCreateServiceCall) Context(ctx context.Context) *ProjectsTimeSeriesCreateServiceCall { 11225 c.ctx_ = ctx 11226 return c 11227 } 11228 11229 // Header returns a http.Header that can be modified by the caller to add 11230 // headers to the request. 11231 func (c *ProjectsTimeSeriesCreateServiceCall) Header() http.Header { 11232 if c.header_ == nil { 11233 c.header_ = make(http.Header) 11234 } 11235 return c.header_ 11236 } 11237 11238 func (c *ProjectsTimeSeriesCreateServiceCall) doRequest(alt string) (*http.Response, error) { 11239 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 11240 var body io.Reader = nil 11241 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createtimeseriesrequest) 11242 if err != nil { 11243 return nil, err 11244 } 11245 c.urlParams_.Set("alt", alt) 11246 c.urlParams_.Set("prettyPrint", "false") 11247 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/timeSeries:createService") 11248 urls += "?" + c.urlParams_.Encode() 11249 req, err := http.NewRequest("POST", urls, body) 11250 if err != nil { 11251 return nil, err 11252 } 11253 req.Header = reqHeaders 11254 googleapi.Expand(req.URL, map[string]string{ 11255 "name": c.name, 11256 }) 11257 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11258 } 11259 11260 // Do executes the "monitoring.projects.timeSeries.createService" call. 11261 // Any non-2xx status code is an error. Response headers are in either 11262 // *Empty.ServerResponse.Header or (if a response was returned at all) in 11263 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11264 // whether the returned error was because http.StatusNotModified was returned. 11265 func (c *ProjectsTimeSeriesCreateServiceCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 11266 gensupport.SetOptions(c.urlParams_, opts...) 11267 res, err := c.doRequest("json") 11268 if res != nil && res.StatusCode == http.StatusNotModified { 11269 if res.Body != nil { 11270 res.Body.Close() 11271 } 11272 return nil, gensupport.WrapError(&googleapi.Error{ 11273 Code: res.StatusCode, 11274 Header: res.Header, 11275 }) 11276 } 11277 if err != nil { 11278 return nil, err 11279 } 11280 defer googleapi.CloseBody(res) 11281 if err := googleapi.CheckResponse(res); err != nil { 11282 return nil, gensupport.WrapError(err) 11283 } 11284 ret := &Empty{ 11285 ServerResponse: googleapi.ServerResponse{ 11286 Header: res.Header, 11287 HTTPStatusCode: res.StatusCode, 11288 }, 11289 } 11290 target := &ret 11291 if err := gensupport.DecodeResponse(target, res); err != nil { 11292 return nil, err 11293 } 11294 return ret, nil 11295 } 11296 11297 type ProjectsTimeSeriesListCall struct { 11298 s *Service 11299 name string 11300 urlParams_ gensupport.URLParams 11301 ifNoneMatch_ string 11302 ctx_ context.Context 11303 header_ http.Header 11304 } 11305 11306 // List: Lists time series that match a filter. 11307 // 11308 // - name: The project 11309 // (https://cloud.google.com/monitoring/api/v3#project_name), organization or 11310 // folder on which to execute the request. The format is: 11311 // projects/[PROJECT_ID_OR_NUMBER] organizations/[ORGANIZATION_ID] 11312 // folders/[FOLDER_ID]. 11313 func (r *ProjectsTimeSeriesService) List(name string) *ProjectsTimeSeriesListCall { 11314 c := &ProjectsTimeSeriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11315 c.name = name 11316 return c 11317 } 11318 11319 // AggregationAlignmentPeriod sets the optional parameter 11320 // "aggregation.alignmentPeriod": The alignment_period specifies a time 11321 // interval, in seconds, that is used to divide the data in all the time series 11322 // into consistent blocks of time. This will be done before the per-series 11323 // aligner can be applied to the data.The value must be at least 60 seconds. If 11324 // a per-series aligner other than ALIGN_NONE is specified, this field is 11325 // required or an error is returned. If no per-series aligner is specified, or 11326 // the aligner ALIGN_NONE is specified, then this field is ignored.The maximum 11327 // value of the alignment_period is 104 weeks (2 years) for charts, and 90,000 11328 // seconds (25 hours) for alerting policies. 11329 func (c *ProjectsTimeSeriesListCall) AggregationAlignmentPeriod(aggregationAlignmentPeriod string) *ProjectsTimeSeriesListCall { 11330 c.urlParams_.Set("aggregation.alignmentPeriod", aggregationAlignmentPeriod) 11331 return c 11332 } 11333 11334 // AggregationCrossSeriesReducer sets the optional parameter 11335 // "aggregation.crossSeriesReducer": The reduction operation to be used to 11336 // combine time series into a single time series, where the value of each data 11337 // point in the resulting series is a function of all the already aligned 11338 // values in the input time series.Not all reducer operations can be applied to 11339 // all time series. The valid choices depend on the metric_kind and the 11340 // value_type of the original time series. Reduction can yield a time series 11341 // with a different metric_kind or value_type than the input time series.Time 11342 // series data must first be aligned (see per_series_aligner) in order to 11343 // perform cross-time series reduction. If cross_series_reducer is specified, 11344 // then per_series_aligner must be specified, and must not be ALIGN_NONE. An 11345 // alignment_period must also be specified; otherwise, an error is returned. 11346 // 11347 // Possible values: 11348 // 11349 // "REDUCE_NONE" - No cross-time series reduction. The output of the Aligner 11350 // 11351 // is returned. 11352 // 11353 // "REDUCE_MEAN" - Reduce by computing the mean value across time series for 11354 // 11355 // each alignment period. This reducer is valid for DELTA and GAUGE metrics 11356 // with numeric or distribution values. The value_type of the output is DOUBLE. 11357 // 11358 // "REDUCE_MIN" - Reduce by computing the minimum value across time series 11359 // 11360 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 11361 // with numeric values. The value_type of the output is the same as the 11362 // value_type of the input. 11363 // 11364 // "REDUCE_MAX" - Reduce by computing the maximum value across time series 11365 // 11366 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 11367 // with numeric values. The value_type of the output is the same as the 11368 // value_type of the input. 11369 // 11370 // "REDUCE_SUM" - Reduce by computing the sum across time series for each 11371 // 11372 // alignment period. This reducer is valid for DELTA and GAUGE metrics with 11373 // numeric and distribution values. The value_type of the output is the same as 11374 // the value_type of the input. 11375 // 11376 // "REDUCE_STDDEV" - Reduce by computing the standard deviation across time 11377 // 11378 // series for each alignment period. This reducer is valid for DELTA and GAUGE 11379 // metrics with numeric or distribution values. The value_type of the output is 11380 // DOUBLE. 11381 // 11382 // "REDUCE_COUNT" - Reduce by computing the number of data points across time 11383 // 11384 // series for each alignment period. This reducer is valid for DELTA and GAUGE 11385 // metrics of numeric, Boolean, distribution, and string value_type. The 11386 // value_type of the output is INT64. 11387 // 11388 // "REDUCE_COUNT_TRUE" - Reduce by computing the number of True-valued data 11389 // 11390 // points across time series for each alignment period. This reducer is valid 11391 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 11392 // output is INT64. 11393 // 11394 // "REDUCE_COUNT_FALSE" - Reduce by computing the number of False-valued data 11395 // 11396 // points across time series for each alignment period. This reducer is valid 11397 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 11398 // output is INT64. 11399 // 11400 // "REDUCE_FRACTION_TRUE" - Reduce by computing the ratio of the number of 11401 // 11402 // True-valued data points to the total number of data points for each 11403 // alignment period. This reducer is valid for DELTA and GAUGE metrics of 11404 // Boolean value_type. The output value is in the range 0.0, 1.0 and has 11405 // value_type DOUBLE. 11406 // 11407 // "REDUCE_PERCENTILE_99" - Reduce by computing the 99th percentile 11408 // 11409 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 11410 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 11411 // of numeric and distribution type. The value of the output is DOUBLE. 11412 // 11413 // "REDUCE_PERCENTILE_95" - Reduce by computing the 95th percentile 11414 // 11415 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 11416 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 11417 // of numeric and distribution type. The value of the output is DOUBLE. 11418 // 11419 // "REDUCE_PERCENTILE_50" - Reduce by computing the 50th percentile 11420 // 11421 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 11422 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 11423 // of numeric and distribution type. The value of the output is DOUBLE. 11424 // 11425 // "REDUCE_PERCENTILE_05" - Reduce by computing the 5th percentile 11426 // 11427 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 11428 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 11429 // of numeric and distribution type. The value of the output is DOUBLE. 11430 func (c *ProjectsTimeSeriesListCall) AggregationCrossSeriesReducer(aggregationCrossSeriesReducer string) *ProjectsTimeSeriesListCall { 11431 c.urlParams_.Set("aggregation.crossSeriesReducer", aggregationCrossSeriesReducer) 11432 return c 11433 } 11434 11435 // AggregationGroupByFields sets the optional parameter 11436 // "aggregation.groupByFields": The set of fields to preserve when 11437 // cross_series_reducer is specified. The group_by_fields determine how the 11438 // time series are partitioned into subsets prior to applying the aggregation 11439 // operation. Each subset contains time series that have the same value for 11440 // each of the grouping fields. Each individual time series is a member of 11441 // exactly one subset. The cross_series_reducer is applied to each subset of 11442 // time series. It is not possible to reduce across different resource types, 11443 // so this field implicitly contains resource.type. Fields not specified in 11444 // group_by_fields are aggregated away. If group_by_fields is not specified and 11445 // all the time series have the same resource type, then the time series are 11446 // aggregated into a single output time series. If cross_series_reducer is not 11447 // defined, this field is ignored. 11448 func (c *ProjectsTimeSeriesListCall) AggregationGroupByFields(aggregationGroupByFields ...string) *ProjectsTimeSeriesListCall { 11449 c.urlParams_.SetMulti("aggregation.groupByFields", append([]string{}, aggregationGroupByFields...)) 11450 return c 11451 } 11452 11453 // AggregationPerSeriesAligner sets the optional parameter 11454 // "aggregation.perSeriesAligner": An Aligner describes how to bring the data 11455 // points in a single time series into temporal alignment. Except for 11456 // ALIGN_NONE, all alignments cause all the data points in an alignment_period 11457 // to be mathematically grouped together, resulting in a single data point for 11458 // each alignment_period with end timestamp at the end of the period.Not all 11459 // alignment operations may be applied to all time series. The valid choices 11460 // depend on the metric_kind and value_type of the original time series. 11461 // Alignment can change the metric_kind or the value_type of the time 11462 // series.Time series data must be aligned in order to perform cross-time 11463 // series reduction. If cross_series_reducer is specified, then 11464 // per_series_aligner must be specified and not equal to ALIGN_NONE and 11465 // alignment_period must be specified; otherwise, an error is returned. 11466 // 11467 // Possible values: 11468 // 11469 // "ALIGN_NONE" - No alignment. Raw data is returned. Not valid if 11470 // 11471 // cross-series reduction is requested. The value_type of the result is the 11472 // same as the value_type of the input. 11473 // 11474 // "ALIGN_DELTA" - Align and convert to DELTA. The output is delta = y1 - 11475 // 11476 // y0.This alignment is valid for CUMULATIVE and DELTA metrics. If the selected 11477 // alignment period results in periods with no data, then the aligned value for 11478 // such a period is created by interpolation. The value_type of the aligned 11479 // result is the same as the value_type of the input. 11480 // 11481 // "ALIGN_RATE" - Align and convert to a rate. The result is computed as rate 11482 // 11483 // = (y1 - y0)/(t1 - t0), or "delta over time". Think of this aligner as 11484 // providing the slope of the line that passes through the value at the start 11485 // and at the end of the alignment_period.This aligner is valid for CUMULATIVE 11486 // and DELTA metrics with numeric values. If the selected alignment period 11487 // results in periods with no data, then the aligned value for such a period is 11488 // created by interpolation. The output is a GAUGE metric with value_type 11489 // DOUBLE.If, by "rate", you mean "percentage change", see the 11490 // ALIGN_PERCENT_CHANGE aligner instead. 11491 // 11492 // "ALIGN_INTERPOLATE" - Align by interpolating between adjacent points 11493 // 11494 // around the alignment period boundary. This aligner is valid for GAUGE 11495 // metrics with numeric values. The value_type of the aligned result is the 11496 // same as the value_type of the input. 11497 // 11498 // "ALIGN_NEXT_OLDER" - Align by moving the most recent data point before the 11499 // 11500 // end of the alignment period to the boundary at the end of the alignment 11501 // period. This aligner is valid for GAUGE metrics. The value_type of the 11502 // aligned result is the same as the value_type of the input. 11503 // 11504 // "ALIGN_MIN" - Align the time series by returning the minimum value in each 11505 // 11506 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 11507 // numeric values. The value_type of the aligned result is the same as the 11508 // value_type of the input. 11509 // 11510 // "ALIGN_MAX" - Align the time series by returning the maximum value in each 11511 // 11512 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 11513 // numeric values. The value_type of the aligned result is the same as the 11514 // value_type of the input. 11515 // 11516 // "ALIGN_MEAN" - Align the time series by returning the mean value in each 11517 // 11518 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 11519 // numeric values. The value_type of the aligned result is DOUBLE. 11520 // 11521 // "ALIGN_COUNT" - Align the time series by returning the number of values in 11522 // 11523 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 11524 // with numeric or Boolean values. The value_type of the aligned result is 11525 // INT64. 11526 // 11527 // "ALIGN_SUM" - Align the time series by returning the sum of the values in 11528 // 11529 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 11530 // with numeric and distribution values. The value_type of the aligned result 11531 // is the same as the value_type of the input. 11532 // 11533 // "ALIGN_STDDEV" - Align the time series by returning the standard deviation 11534 // 11535 // of the values in each alignment period. This aligner is valid for GAUGE and 11536 // DELTA metrics with numeric values. The value_type of the output is DOUBLE. 11537 // 11538 // "ALIGN_COUNT_TRUE" - Align the time series by returning the number of True 11539 // 11540 // values in each alignment period. This aligner is valid for GAUGE metrics 11541 // with Boolean values. The value_type of the output is INT64. 11542 // 11543 // "ALIGN_COUNT_FALSE" - Align the time series by returning the number of 11544 // 11545 // False values in each alignment period. This aligner is valid for GAUGE 11546 // metrics with Boolean values. The value_type of the output is INT64. 11547 // 11548 // "ALIGN_FRACTION_TRUE" - Align the time series by returning the ratio of 11549 // 11550 // the number of True values to the total number of values in each alignment 11551 // period. This aligner is valid for GAUGE metrics with Boolean values. The 11552 // output value is in the range 0.0, 1.0 and has value_type DOUBLE. 11553 // 11554 // "ALIGN_PERCENTILE_99" - Align the time series by using percentile 11555 // 11556 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 11557 // point in each alignment period is the 99th percentile of all data points in 11558 // the period. This aligner is valid for GAUGE and DELTA metrics with 11559 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 11560 // 11561 // "ALIGN_PERCENTILE_95" - Align the time series by using percentile 11562 // 11563 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 11564 // point in each alignment period is the 95th percentile of all data points in 11565 // the period. This aligner is valid for GAUGE and DELTA metrics with 11566 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 11567 // 11568 // "ALIGN_PERCENTILE_50" - Align the time series by using percentile 11569 // 11570 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 11571 // point in each alignment period is the 50th percentile of all data points in 11572 // the period. This aligner is valid for GAUGE and DELTA metrics with 11573 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 11574 // 11575 // "ALIGN_PERCENTILE_05" - Align the time series by using percentile 11576 // 11577 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 11578 // point in each alignment period is the 5th percentile of all data points in 11579 // the period. This aligner is valid for GAUGE and DELTA metrics with 11580 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 11581 // 11582 // "ALIGN_PERCENT_CHANGE" - Align and convert to a percentage change. This 11583 // 11584 // aligner is valid for GAUGE and DELTA metrics with numeric values. This 11585 // alignment returns ((current - previous)/previous) * 100, where the value of 11586 // previous is determined based on the alignment_period.If the values of 11587 // current and previous are both 0, then the returned value is 0. If only 11588 // previous is 0, the returned value is infinity.A 10-minute moving mean is 11589 // computed at each point of the alignment period prior to the above 11590 // calculation to smooth the metric and prevent false positives from very 11591 // short-lived spikes. The moving mean is only applicable for data whose values 11592 // are >= 0. Any values < 0 are treated as a missing datapoint, and are 11593 // ignored. While DELTA metrics are accepted by this alignment, special care 11594 // should be taken that the values for the metric will always be positive. The 11595 // output is a GAUGE metric with value_type DOUBLE. 11596 func (c *ProjectsTimeSeriesListCall) AggregationPerSeriesAligner(aggregationPerSeriesAligner string) *ProjectsTimeSeriesListCall { 11597 c.urlParams_.Set("aggregation.perSeriesAligner", aggregationPerSeriesAligner) 11598 return c 11599 } 11600 11601 // Filter sets the optional parameter "filter": Required. A monitoring filter 11602 // (https://cloud.google.com/monitoring/api/v3/filters) that specifies which 11603 // time series should be returned. The filter must specify a single metric 11604 // type, and can additionally specify metric labels and other information. For 11605 // example: metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND 11606 // metric.labels.instance_name = "my-instance-name" 11607 func (c *ProjectsTimeSeriesListCall) Filter(filter string) *ProjectsTimeSeriesListCall { 11608 c.urlParams_.Set("filter", filter) 11609 return c 11610 } 11611 11612 // IntervalEndTime sets the optional parameter "interval.endTime": Required. 11613 // The end of the time interval. 11614 func (c *ProjectsTimeSeriesListCall) IntervalEndTime(intervalEndTime string) *ProjectsTimeSeriesListCall { 11615 c.urlParams_.Set("interval.endTime", intervalEndTime) 11616 return c 11617 } 11618 11619 // IntervalStartTime sets the optional parameter "interval.startTime": The 11620 // beginning of the time interval. The default value for the start time is the 11621 // end time. The start time must not be later than the end time. 11622 func (c *ProjectsTimeSeriesListCall) IntervalStartTime(intervalStartTime string) *ProjectsTimeSeriesListCall { 11623 c.urlParams_.Set("interval.startTime", intervalStartTime) 11624 return c 11625 } 11626 11627 // OrderBy sets the optional parameter "orderBy": Unsupported: must be left 11628 // blank. The points in each time series are currently returned in reverse time 11629 // order (most recent to oldest). 11630 func (c *ProjectsTimeSeriesListCall) OrderBy(orderBy string) *ProjectsTimeSeriesListCall { 11631 c.urlParams_.Set("orderBy", orderBy) 11632 return c 11633 } 11634 11635 // PageSize sets the optional parameter "pageSize": A positive number that is 11636 // the maximum number of results to return. If page_size is empty or more than 11637 // 100,000 results, the effective page_size is 100,000 results. If view is set 11638 // to FULL, this is the maximum number of Points returned. If view is set to 11639 // HEADERS, this is the maximum number of TimeSeries returned. 11640 func (c *ProjectsTimeSeriesListCall) PageSize(pageSize int64) *ProjectsTimeSeriesListCall { 11641 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 11642 return c 11643 } 11644 11645 // PageToken sets the optional parameter "pageToken": If this field is not 11646 // empty then it must contain the nextPageToken value returned by a previous 11647 // call to this method. Using this field causes the method to return additional 11648 // results from the previous method call. 11649 func (c *ProjectsTimeSeriesListCall) PageToken(pageToken string) *ProjectsTimeSeriesListCall { 11650 c.urlParams_.Set("pageToken", pageToken) 11651 return c 11652 } 11653 11654 // SecondaryAggregationAlignmentPeriod sets the optional parameter 11655 // "secondaryAggregation.alignmentPeriod": The alignment_period specifies a 11656 // time interval, in seconds, that is used to divide the data in all the time 11657 // series into consistent blocks of time. This will be done before the 11658 // per-series aligner can be applied to the data.The value must be at least 60 11659 // seconds. If a per-series aligner other than ALIGN_NONE is specified, this 11660 // field is required or an error is returned. If no per-series aligner is 11661 // specified, or the aligner ALIGN_NONE is specified, then this field is 11662 // ignored.The maximum value of the alignment_period is 104 weeks (2 years) for 11663 // charts, and 90,000 seconds (25 hours) for alerting policies. 11664 func (c *ProjectsTimeSeriesListCall) SecondaryAggregationAlignmentPeriod(secondaryAggregationAlignmentPeriod string) *ProjectsTimeSeriesListCall { 11665 c.urlParams_.Set("secondaryAggregation.alignmentPeriod", secondaryAggregationAlignmentPeriod) 11666 return c 11667 } 11668 11669 // SecondaryAggregationCrossSeriesReducer sets the optional parameter 11670 // "secondaryAggregation.crossSeriesReducer": The reduction operation to be 11671 // used to combine time series into a single time series, where the value of 11672 // each data point in the resulting series is a function of all the already 11673 // aligned values in the input time series.Not all reducer operations can be 11674 // applied to all time series. The valid choices depend on the metric_kind and 11675 // the value_type of the original time series. Reduction can yield a time 11676 // series with a different metric_kind or value_type than the input time 11677 // series.Time series data must first be aligned (see per_series_aligner) in 11678 // order to perform cross-time series reduction. If cross_series_reducer is 11679 // specified, then per_series_aligner must be specified, and must not be 11680 // ALIGN_NONE. An alignment_period must also be specified; otherwise, an error 11681 // is returned. 11682 // 11683 // Possible values: 11684 // 11685 // "REDUCE_NONE" - No cross-time series reduction. The output of the Aligner 11686 // 11687 // is returned. 11688 // 11689 // "REDUCE_MEAN" - Reduce by computing the mean value across time series for 11690 // 11691 // each alignment period. This reducer is valid for DELTA and GAUGE metrics 11692 // with numeric or distribution values. The value_type of the output is DOUBLE. 11693 // 11694 // "REDUCE_MIN" - Reduce by computing the minimum value across time series 11695 // 11696 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 11697 // with numeric values. The value_type of the output is the same as the 11698 // value_type of the input. 11699 // 11700 // "REDUCE_MAX" - Reduce by computing the maximum value across time series 11701 // 11702 // for each alignment period. This reducer is valid for DELTA and GAUGE metrics 11703 // with numeric values. The value_type of the output is the same as the 11704 // value_type of the input. 11705 // 11706 // "REDUCE_SUM" - Reduce by computing the sum across time series for each 11707 // 11708 // alignment period. This reducer is valid for DELTA and GAUGE metrics with 11709 // numeric and distribution values. The value_type of the output is the same as 11710 // the value_type of the input. 11711 // 11712 // "REDUCE_STDDEV" - Reduce by computing the standard deviation across time 11713 // 11714 // series for each alignment period. This reducer is valid for DELTA and GAUGE 11715 // metrics with numeric or distribution values. The value_type of the output is 11716 // DOUBLE. 11717 // 11718 // "REDUCE_COUNT" - Reduce by computing the number of data points across time 11719 // 11720 // series for each alignment period. This reducer is valid for DELTA and GAUGE 11721 // metrics of numeric, Boolean, distribution, and string value_type. The 11722 // value_type of the output is INT64. 11723 // 11724 // "REDUCE_COUNT_TRUE" - Reduce by computing the number of True-valued data 11725 // 11726 // points across time series for each alignment period. This reducer is valid 11727 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 11728 // output is INT64. 11729 // 11730 // "REDUCE_COUNT_FALSE" - Reduce by computing the number of False-valued data 11731 // 11732 // points across time series for each alignment period. This reducer is valid 11733 // for DELTA and GAUGE metrics of Boolean value_type. The value_type of the 11734 // output is INT64. 11735 // 11736 // "REDUCE_FRACTION_TRUE" - Reduce by computing the ratio of the number of 11737 // 11738 // True-valued data points to the total number of data points for each 11739 // alignment period. This reducer is valid for DELTA and GAUGE metrics of 11740 // Boolean value_type. The output value is in the range 0.0, 1.0 and has 11741 // value_type DOUBLE. 11742 // 11743 // "REDUCE_PERCENTILE_99" - Reduce by computing the 99th percentile 11744 // 11745 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 11746 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 11747 // of numeric and distribution type. The value of the output is DOUBLE. 11748 // 11749 // "REDUCE_PERCENTILE_95" - Reduce by computing the 95th percentile 11750 // 11751 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 11752 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 11753 // of numeric and distribution type. The value of the output is DOUBLE. 11754 // 11755 // "REDUCE_PERCENTILE_50" - Reduce by computing the 50th percentile 11756 // 11757 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 11758 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 11759 // of numeric and distribution type. The value of the output is DOUBLE. 11760 // 11761 // "REDUCE_PERCENTILE_05" - Reduce by computing the 5th percentile 11762 // 11763 // (https://en.wikipedia.org/wiki/Percentile) of data points across time series 11764 // for each alignment period. This reducer is valid for GAUGE and DELTA metrics 11765 // of numeric and distribution type. The value of the output is DOUBLE. 11766 func (c *ProjectsTimeSeriesListCall) SecondaryAggregationCrossSeriesReducer(secondaryAggregationCrossSeriesReducer string) *ProjectsTimeSeriesListCall { 11767 c.urlParams_.Set("secondaryAggregation.crossSeriesReducer", secondaryAggregationCrossSeriesReducer) 11768 return c 11769 } 11770 11771 // SecondaryAggregationGroupByFields sets the optional parameter 11772 // "secondaryAggregation.groupByFields": The set of fields to preserve when 11773 // cross_series_reducer is specified. The group_by_fields determine how the 11774 // time series are partitioned into subsets prior to applying the aggregation 11775 // operation. Each subset contains time series that have the same value for 11776 // each of the grouping fields. Each individual time series is a member of 11777 // exactly one subset. The cross_series_reducer is applied to each subset of 11778 // time series. It is not possible to reduce across different resource types, 11779 // so this field implicitly contains resource.type. Fields not specified in 11780 // group_by_fields are aggregated away. If group_by_fields is not specified and 11781 // all the time series have the same resource type, then the time series are 11782 // aggregated into a single output time series. If cross_series_reducer is not 11783 // defined, this field is ignored. 11784 func (c *ProjectsTimeSeriesListCall) SecondaryAggregationGroupByFields(secondaryAggregationGroupByFields ...string) *ProjectsTimeSeriesListCall { 11785 c.urlParams_.SetMulti("secondaryAggregation.groupByFields", append([]string{}, secondaryAggregationGroupByFields...)) 11786 return c 11787 } 11788 11789 // SecondaryAggregationPerSeriesAligner sets the optional parameter 11790 // "secondaryAggregation.perSeriesAligner": An Aligner describes how to bring 11791 // the data points in a single time series into temporal alignment. Except for 11792 // ALIGN_NONE, all alignments cause all the data points in an alignment_period 11793 // to be mathematically grouped together, resulting in a single data point for 11794 // each alignment_period with end timestamp at the end of the period.Not all 11795 // alignment operations may be applied to all time series. The valid choices 11796 // depend on the metric_kind and value_type of the original time series. 11797 // Alignment can change the metric_kind or the value_type of the time 11798 // series.Time series data must be aligned in order to perform cross-time 11799 // series reduction. If cross_series_reducer is specified, then 11800 // per_series_aligner must be specified and not equal to ALIGN_NONE and 11801 // alignment_period must be specified; otherwise, an error is returned. 11802 // 11803 // Possible values: 11804 // 11805 // "ALIGN_NONE" - No alignment. Raw data is returned. Not valid if 11806 // 11807 // cross-series reduction is requested. The value_type of the result is the 11808 // same as the value_type of the input. 11809 // 11810 // "ALIGN_DELTA" - Align and convert to DELTA. The output is delta = y1 - 11811 // 11812 // y0.This alignment is valid for CUMULATIVE and DELTA metrics. If the selected 11813 // alignment period results in periods with no data, then the aligned value for 11814 // such a period is created by interpolation. The value_type of the aligned 11815 // result is the same as the value_type of the input. 11816 // 11817 // "ALIGN_RATE" - Align and convert to a rate. The result is computed as rate 11818 // 11819 // = (y1 - y0)/(t1 - t0), or "delta over time". Think of this aligner as 11820 // providing the slope of the line that passes through the value at the start 11821 // and at the end of the alignment_period.This aligner is valid for CUMULATIVE 11822 // and DELTA metrics with numeric values. If the selected alignment period 11823 // results in periods with no data, then the aligned value for such a period is 11824 // created by interpolation. The output is a GAUGE metric with value_type 11825 // DOUBLE.If, by "rate", you mean "percentage change", see the 11826 // ALIGN_PERCENT_CHANGE aligner instead. 11827 // 11828 // "ALIGN_INTERPOLATE" - Align by interpolating between adjacent points 11829 // 11830 // around the alignment period boundary. This aligner is valid for GAUGE 11831 // metrics with numeric values. The value_type of the aligned result is the 11832 // same as the value_type of the input. 11833 // 11834 // "ALIGN_NEXT_OLDER" - Align by moving the most recent data point before the 11835 // 11836 // end of the alignment period to the boundary at the end of the alignment 11837 // period. This aligner is valid for GAUGE metrics. The value_type of the 11838 // aligned result is the same as the value_type of the input. 11839 // 11840 // "ALIGN_MIN" - Align the time series by returning the minimum value in each 11841 // 11842 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 11843 // numeric values. The value_type of the aligned result is the same as the 11844 // value_type of the input. 11845 // 11846 // "ALIGN_MAX" - Align the time series by returning the maximum value in each 11847 // 11848 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 11849 // numeric values. The value_type of the aligned result is the same as the 11850 // value_type of the input. 11851 // 11852 // "ALIGN_MEAN" - Align the time series by returning the mean value in each 11853 // 11854 // alignment period. This aligner is valid for GAUGE and DELTA metrics with 11855 // numeric values. The value_type of the aligned result is DOUBLE. 11856 // 11857 // "ALIGN_COUNT" - Align the time series by returning the number of values in 11858 // 11859 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 11860 // with numeric or Boolean values. The value_type of the aligned result is 11861 // INT64. 11862 // 11863 // "ALIGN_SUM" - Align the time series by returning the sum of the values in 11864 // 11865 // each alignment period. This aligner is valid for GAUGE and DELTA metrics 11866 // with numeric and distribution values. The value_type of the aligned result 11867 // is the same as the value_type of the input. 11868 // 11869 // "ALIGN_STDDEV" - Align the time series by returning the standard deviation 11870 // 11871 // of the values in each alignment period. This aligner is valid for GAUGE and 11872 // DELTA metrics with numeric values. The value_type of the output is DOUBLE. 11873 // 11874 // "ALIGN_COUNT_TRUE" - Align the time series by returning the number of True 11875 // 11876 // values in each alignment period. This aligner is valid for GAUGE metrics 11877 // with Boolean values. The value_type of the output is INT64. 11878 // 11879 // "ALIGN_COUNT_FALSE" - Align the time series by returning the number of 11880 // 11881 // False values in each alignment period. This aligner is valid for GAUGE 11882 // metrics with Boolean values. The value_type of the output is INT64. 11883 // 11884 // "ALIGN_FRACTION_TRUE" - Align the time series by returning the ratio of 11885 // 11886 // the number of True values to the total number of values in each alignment 11887 // period. This aligner is valid for GAUGE metrics with Boolean values. The 11888 // output value is in the range 0.0, 1.0 and has value_type DOUBLE. 11889 // 11890 // "ALIGN_PERCENTILE_99" - Align the time series by using percentile 11891 // 11892 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 11893 // point in each alignment period is the 99th percentile of all data points in 11894 // the period. This aligner is valid for GAUGE and DELTA metrics with 11895 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 11896 // 11897 // "ALIGN_PERCENTILE_95" - Align the time series by using percentile 11898 // 11899 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 11900 // point in each alignment period is the 95th percentile of all data points in 11901 // the period. This aligner is valid for GAUGE and DELTA metrics with 11902 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 11903 // 11904 // "ALIGN_PERCENTILE_50" - Align the time series by using percentile 11905 // 11906 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 11907 // point in each alignment period is the 50th percentile of all data points in 11908 // the period. This aligner is valid for GAUGE and DELTA metrics with 11909 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 11910 // 11911 // "ALIGN_PERCENTILE_05" - Align the time series by using percentile 11912 // 11913 // aggregation (https://en.wikipedia.org/wiki/Percentile). The resulting data 11914 // point in each alignment period is the 5th percentile of all data points in 11915 // the period. This aligner is valid for GAUGE and DELTA metrics with 11916 // distribution values. The output is a GAUGE metric with value_type DOUBLE. 11917 // 11918 // "ALIGN_PERCENT_CHANGE" - Align and convert to a percentage change. This 11919 // 11920 // aligner is valid for GAUGE and DELTA metrics with numeric values. This 11921 // alignment returns ((current - previous)/previous) * 100, where the value of 11922 // previous is determined based on the alignment_period.If the values of 11923 // current and previous are both 0, then the returned value is 0. If only 11924 // previous is 0, the returned value is infinity.A 10-minute moving mean is 11925 // computed at each point of the alignment period prior to the above 11926 // calculation to smooth the metric and prevent false positives from very 11927 // short-lived spikes. The moving mean is only applicable for data whose values 11928 // are >= 0. Any values < 0 are treated as a missing datapoint, and are 11929 // ignored. While DELTA metrics are accepted by this alignment, special care 11930 // should be taken that the values for the metric will always be positive. The 11931 // output is a GAUGE metric with value_type DOUBLE. 11932 func (c *ProjectsTimeSeriesListCall) SecondaryAggregationPerSeriesAligner(secondaryAggregationPerSeriesAligner string) *ProjectsTimeSeriesListCall { 11933 c.urlParams_.Set("secondaryAggregation.perSeriesAligner", secondaryAggregationPerSeriesAligner) 11934 return c 11935 } 11936 11937 // View sets the optional parameter "view": Required. Specifies which 11938 // information is returned about the time series. 11939 // 11940 // Possible values: 11941 // 11942 // "FULL" - Returns the identity of the metric(s), the time series, and the 11943 // 11944 // time series data. 11945 // 11946 // "HEADERS" - Returns the identity of the metric and the time series 11947 // 11948 // resource, but not the time series data. 11949 func (c *ProjectsTimeSeriesListCall) View(view string) *ProjectsTimeSeriesListCall { 11950 c.urlParams_.Set("view", view) 11951 return c 11952 } 11953 11954 // Fields allows partial responses to be retrieved. See 11955 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 11956 // details. 11957 func (c *ProjectsTimeSeriesListCall) Fields(s ...googleapi.Field) *ProjectsTimeSeriesListCall { 11958 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11959 return c 11960 } 11961 11962 // IfNoneMatch sets an optional parameter which makes the operation fail if the 11963 // object's ETag matches the given value. This is useful for getting updates 11964 // only after the object has changed since the last request. 11965 func (c *ProjectsTimeSeriesListCall) IfNoneMatch(entityTag string) *ProjectsTimeSeriesListCall { 11966 c.ifNoneMatch_ = entityTag 11967 return c 11968 } 11969 11970 // Context sets the context to be used in this call's Do method. 11971 func (c *ProjectsTimeSeriesListCall) Context(ctx context.Context) *ProjectsTimeSeriesListCall { 11972 c.ctx_ = ctx 11973 return c 11974 } 11975 11976 // Header returns a http.Header that can be modified by the caller to add 11977 // headers to the request. 11978 func (c *ProjectsTimeSeriesListCall) Header() http.Header { 11979 if c.header_ == nil { 11980 c.header_ = make(http.Header) 11981 } 11982 return c.header_ 11983 } 11984 11985 func (c *ProjectsTimeSeriesListCall) doRequest(alt string) (*http.Response, error) { 11986 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 11987 if c.ifNoneMatch_ != "" { 11988 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11989 } 11990 var body io.Reader = nil 11991 c.urlParams_.Set("alt", alt) 11992 c.urlParams_.Set("prettyPrint", "false") 11993 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/timeSeries") 11994 urls += "?" + c.urlParams_.Encode() 11995 req, err := http.NewRequest("GET", urls, body) 11996 if err != nil { 11997 return nil, err 11998 } 11999 req.Header = reqHeaders 12000 googleapi.Expand(req.URL, map[string]string{ 12001 "name": c.name, 12002 }) 12003 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12004 } 12005 12006 // Do executes the "monitoring.projects.timeSeries.list" call. 12007 // Any non-2xx status code is an error. Response headers are in either 12008 // *ListTimeSeriesResponse.ServerResponse.Header or (if a response was returned 12009 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12010 // check whether the returned error was because http.StatusNotModified was 12011 // returned. 12012 func (c *ProjectsTimeSeriesListCall) Do(opts ...googleapi.CallOption) (*ListTimeSeriesResponse, error) { 12013 gensupport.SetOptions(c.urlParams_, opts...) 12014 res, err := c.doRequest("json") 12015 if res != nil && res.StatusCode == http.StatusNotModified { 12016 if res.Body != nil { 12017 res.Body.Close() 12018 } 12019 return nil, gensupport.WrapError(&googleapi.Error{ 12020 Code: res.StatusCode, 12021 Header: res.Header, 12022 }) 12023 } 12024 if err != nil { 12025 return nil, err 12026 } 12027 defer googleapi.CloseBody(res) 12028 if err := googleapi.CheckResponse(res); err != nil { 12029 return nil, gensupport.WrapError(err) 12030 } 12031 ret := &ListTimeSeriesResponse{ 12032 ServerResponse: googleapi.ServerResponse{ 12033 Header: res.Header, 12034 HTTPStatusCode: res.StatusCode, 12035 }, 12036 } 12037 target := &ret 12038 if err := gensupport.DecodeResponse(target, res); err != nil { 12039 return nil, err 12040 } 12041 return ret, nil 12042 } 12043 12044 // Pages invokes f for each page of results. 12045 // A non-nil error returned from f will halt the iteration. 12046 // The provided context supersedes any context provided to the Context method. 12047 func (c *ProjectsTimeSeriesListCall) Pages(ctx context.Context, f func(*ListTimeSeriesResponse) error) error { 12048 c.ctx_ = ctx 12049 defer c.PageToken(c.urlParams_.Get("pageToken")) 12050 for { 12051 x, err := c.Do() 12052 if err != nil { 12053 return err 12054 } 12055 if err := f(x); err != nil { 12056 return err 12057 } 12058 if x.NextPageToken == "" { 12059 return nil 12060 } 12061 c.PageToken(x.NextPageToken) 12062 } 12063 } 12064 12065 type ProjectsTimeSeriesQueryCall struct { 12066 s *Service 12067 name string 12068 querytimeseriesrequest *QueryTimeSeriesRequest 12069 urlParams_ gensupport.URLParams 12070 ctx_ context.Context 12071 header_ http.Header 12072 } 12073 12074 // Query: Queries time series using Monitoring Query Language. 12075 // 12076 // - name: The project 12077 // (https://cloud.google.com/monitoring/api/v3#project_name) on which to 12078 // execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER]. 12079 func (r *ProjectsTimeSeriesService) Query(name string, querytimeseriesrequest *QueryTimeSeriesRequest) *ProjectsTimeSeriesQueryCall { 12080 c := &ProjectsTimeSeriesQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12081 c.name = name 12082 c.querytimeseriesrequest = querytimeseriesrequest 12083 return c 12084 } 12085 12086 // Fields allows partial responses to be retrieved. See 12087 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12088 // details. 12089 func (c *ProjectsTimeSeriesQueryCall) Fields(s ...googleapi.Field) *ProjectsTimeSeriesQueryCall { 12090 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12091 return c 12092 } 12093 12094 // Context sets the context to be used in this call's Do method. 12095 func (c *ProjectsTimeSeriesQueryCall) Context(ctx context.Context) *ProjectsTimeSeriesQueryCall { 12096 c.ctx_ = ctx 12097 return c 12098 } 12099 12100 // Header returns a http.Header that can be modified by the caller to add 12101 // headers to the request. 12102 func (c *ProjectsTimeSeriesQueryCall) Header() http.Header { 12103 if c.header_ == nil { 12104 c.header_ = make(http.Header) 12105 } 12106 return c.header_ 12107 } 12108 12109 func (c *ProjectsTimeSeriesQueryCall) doRequest(alt string) (*http.Response, error) { 12110 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12111 var body io.Reader = nil 12112 body, err := googleapi.WithoutDataWrapper.JSONReader(c.querytimeseriesrequest) 12113 if err != nil { 12114 return nil, err 12115 } 12116 c.urlParams_.Set("alt", alt) 12117 c.urlParams_.Set("prettyPrint", "false") 12118 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}/timeSeries:query") 12119 urls += "?" + c.urlParams_.Encode() 12120 req, err := http.NewRequest("POST", urls, body) 12121 if err != nil { 12122 return nil, err 12123 } 12124 req.Header = reqHeaders 12125 googleapi.Expand(req.URL, map[string]string{ 12126 "name": c.name, 12127 }) 12128 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12129 } 12130 12131 // Do executes the "monitoring.projects.timeSeries.query" call. 12132 // Any non-2xx status code is an error. Response headers are in either 12133 // *QueryTimeSeriesResponse.ServerResponse.Header or (if a response was 12134 // returned at all) in error.(*googleapi.Error).Header. Use 12135 // googleapi.IsNotModified to check whether the returned error was because 12136 // http.StatusNotModified was returned. 12137 func (c *ProjectsTimeSeriesQueryCall) Do(opts ...googleapi.CallOption) (*QueryTimeSeriesResponse, error) { 12138 gensupport.SetOptions(c.urlParams_, opts...) 12139 res, err := c.doRequest("json") 12140 if res != nil && res.StatusCode == http.StatusNotModified { 12141 if res.Body != nil { 12142 res.Body.Close() 12143 } 12144 return nil, gensupport.WrapError(&googleapi.Error{ 12145 Code: res.StatusCode, 12146 Header: res.Header, 12147 }) 12148 } 12149 if err != nil { 12150 return nil, err 12151 } 12152 defer googleapi.CloseBody(res) 12153 if err := googleapi.CheckResponse(res); err != nil { 12154 return nil, gensupport.WrapError(err) 12155 } 12156 ret := &QueryTimeSeriesResponse{ 12157 ServerResponse: googleapi.ServerResponse{ 12158 Header: res.Header, 12159 HTTPStatusCode: res.StatusCode, 12160 }, 12161 } 12162 target := &ret 12163 if err := gensupport.DecodeResponse(target, res); err != nil { 12164 return nil, err 12165 } 12166 return ret, nil 12167 } 12168 12169 // Pages invokes f for each page of results. 12170 // A non-nil error returned from f will halt the iteration. 12171 // The provided context supersedes any context provided to the Context method. 12172 func (c *ProjectsTimeSeriesQueryCall) Pages(ctx context.Context, f func(*QueryTimeSeriesResponse) error) error { 12173 c.ctx_ = ctx 12174 defer func(pt string) { c.querytimeseriesrequest.PageToken = pt }(c.querytimeseriesrequest.PageToken) 12175 for { 12176 x, err := c.Do() 12177 if err != nil { 12178 return err 12179 } 12180 if err := f(x); err != nil { 12181 return err 12182 } 12183 if x.NextPageToken == "" { 12184 return nil 12185 } 12186 c.querytimeseriesrequest.PageToken = x.NextPageToken 12187 } 12188 } 12189 12190 type ProjectsUptimeCheckConfigsCreateCall struct { 12191 s *Service 12192 parent string 12193 uptimecheckconfig *UptimeCheckConfig 12194 urlParams_ gensupport.URLParams 12195 ctx_ context.Context 12196 header_ http.Header 12197 } 12198 12199 // Create: Creates a new Uptime check configuration. 12200 // 12201 // - parent: The project 12202 // (https://cloud.google.com/monitoring/api/v3#project_name) in which to 12203 // create the Uptime check. The format is: projects/[PROJECT_ID_OR_NUMBER]. 12204 func (r *ProjectsUptimeCheckConfigsService) Create(parent string, uptimecheckconfig *UptimeCheckConfig) *ProjectsUptimeCheckConfigsCreateCall { 12205 c := &ProjectsUptimeCheckConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12206 c.parent = parent 12207 c.uptimecheckconfig = uptimecheckconfig 12208 return c 12209 } 12210 12211 // Fields allows partial responses to be retrieved. See 12212 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12213 // details. 12214 func (c *ProjectsUptimeCheckConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsUptimeCheckConfigsCreateCall { 12215 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12216 return c 12217 } 12218 12219 // Context sets the context to be used in this call's Do method. 12220 func (c *ProjectsUptimeCheckConfigsCreateCall) Context(ctx context.Context) *ProjectsUptimeCheckConfigsCreateCall { 12221 c.ctx_ = ctx 12222 return c 12223 } 12224 12225 // Header returns a http.Header that can be modified by the caller to add 12226 // headers to the request. 12227 func (c *ProjectsUptimeCheckConfigsCreateCall) Header() http.Header { 12228 if c.header_ == nil { 12229 c.header_ = make(http.Header) 12230 } 12231 return c.header_ 12232 } 12233 12234 func (c *ProjectsUptimeCheckConfigsCreateCall) doRequest(alt string) (*http.Response, error) { 12235 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12236 var body io.Reader = nil 12237 body, err := googleapi.WithoutDataWrapper.JSONReader(c.uptimecheckconfig) 12238 if err != nil { 12239 return nil, err 12240 } 12241 c.urlParams_.Set("alt", alt) 12242 c.urlParams_.Set("prettyPrint", "false") 12243 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/uptimeCheckConfigs") 12244 urls += "?" + c.urlParams_.Encode() 12245 req, err := http.NewRequest("POST", urls, body) 12246 if err != nil { 12247 return nil, err 12248 } 12249 req.Header = reqHeaders 12250 googleapi.Expand(req.URL, map[string]string{ 12251 "parent": c.parent, 12252 }) 12253 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12254 } 12255 12256 // Do executes the "monitoring.projects.uptimeCheckConfigs.create" call. 12257 // Any non-2xx status code is an error. Response headers are in either 12258 // *UptimeCheckConfig.ServerResponse.Header or (if a response was returned at 12259 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12260 // check whether the returned error was because http.StatusNotModified was 12261 // returned. 12262 func (c *ProjectsUptimeCheckConfigsCreateCall) Do(opts ...googleapi.CallOption) (*UptimeCheckConfig, error) { 12263 gensupport.SetOptions(c.urlParams_, opts...) 12264 res, err := c.doRequest("json") 12265 if res != nil && res.StatusCode == http.StatusNotModified { 12266 if res.Body != nil { 12267 res.Body.Close() 12268 } 12269 return nil, gensupport.WrapError(&googleapi.Error{ 12270 Code: res.StatusCode, 12271 Header: res.Header, 12272 }) 12273 } 12274 if err != nil { 12275 return nil, err 12276 } 12277 defer googleapi.CloseBody(res) 12278 if err := googleapi.CheckResponse(res); err != nil { 12279 return nil, gensupport.WrapError(err) 12280 } 12281 ret := &UptimeCheckConfig{ 12282 ServerResponse: googleapi.ServerResponse{ 12283 Header: res.Header, 12284 HTTPStatusCode: res.StatusCode, 12285 }, 12286 } 12287 target := &ret 12288 if err := gensupport.DecodeResponse(target, res); err != nil { 12289 return nil, err 12290 } 12291 return ret, nil 12292 } 12293 12294 type ProjectsUptimeCheckConfigsDeleteCall struct { 12295 s *Service 12296 name string 12297 urlParams_ gensupport.URLParams 12298 ctx_ context.Context 12299 header_ http.Header 12300 } 12301 12302 // Delete: Deletes an Uptime check configuration. Note that this method will 12303 // fail if the Uptime check configuration is referenced by an alert policy or 12304 // other dependent configs that would be rendered invalid by the deletion. 12305 // 12306 // - name: The Uptime check configuration to delete. The format is: 12307 // projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]. 12308 func (r *ProjectsUptimeCheckConfigsService) Delete(name string) *ProjectsUptimeCheckConfigsDeleteCall { 12309 c := &ProjectsUptimeCheckConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12310 c.name = name 12311 return c 12312 } 12313 12314 // Fields allows partial responses to be retrieved. See 12315 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12316 // details. 12317 func (c *ProjectsUptimeCheckConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsUptimeCheckConfigsDeleteCall { 12318 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12319 return c 12320 } 12321 12322 // Context sets the context to be used in this call's Do method. 12323 func (c *ProjectsUptimeCheckConfigsDeleteCall) Context(ctx context.Context) *ProjectsUptimeCheckConfigsDeleteCall { 12324 c.ctx_ = ctx 12325 return c 12326 } 12327 12328 // Header returns a http.Header that can be modified by the caller to add 12329 // headers to the request. 12330 func (c *ProjectsUptimeCheckConfigsDeleteCall) Header() http.Header { 12331 if c.header_ == nil { 12332 c.header_ = make(http.Header) 12333 } 12334 return c.header_ 12335 } 12336 12337 func (c *ProjectsUptimeCheckConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { 12338 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12339 var body io.Reader = nil 12340 c.urlParams_.Set("alt", alt) 12341 c.urlParams_.Set("prettyPrint", "false") 12342 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 12343 urls += "?" + c.urlParams_.Encode() 12344 req, err := http.NewRequest("DELETE", urls, body) 12345 if err != nil { 12346 return nil, err 12347 } 12348 req.Header = reqHeaders 12349 googleapi.Expand(req.URL, map[string]string{ 12350 "name": c.name, 12351 }) 12352 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12353 } 12354 12355 // Do executes the "monitoring.projects.uptimeCheckConfigs.delete" call. 12356 // Any non-2xx status code is an error. Response headers are in either 12357 // *Empty.ServerResponse.Header or (if a response was returned at all) in 12358 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 12359 // whether the returned error was because http.StatusNotModified was returned. 12360 func (c *ProjectsUptimeCheckConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 12361 gensupport.SetOptions(c.urlParams_, opts...) 12362 res, err := c.doRequest("json") 12363 if res != nil && res.StatusCode == http.StatusNotModified { 12364 if res.Body != nil { 12365 res.Body.Close() 12366 } 12367 return nil, gensupport.WrapError(&googleapi.Error{ 12368 Code: res.StatusCode, 12369 Header: res.Header, 12370 }) 12371 } 12372 if err != nil { 12373 return nil, err 12374 } 12375 defer googleapi.CloseBody(res) 12376 if err := googleapi.CheckResponse(res); err != nil { 12377 return nil, gensupport.WrapError(err) 12378 } 12379 ret := &Empty{ 12380 ServerResponse: googleapi.ServerResponse{ 12381 Header: res.Header, 12382 HTTPStatusCode: res.StatusCode, 12383 }, 12384 } 12385 target := &ret 12386 if err := gensupport.DecodeResponse(target, res); err != nil { 12387 return nil, err 12388 } 12389 return ret, nil 12390 } 12391 12392 type ProjectsUptimeCheckConfigsGetCall struct { 12393 s *Service 12394 name string 12395 urlParams_ gensupport.URLParams 12396 ifNoneMatch_ string 12397 ctx_ context.Context 12398 header_ http.Header 12399 } 12400 12401 // Get: Gets a single Uptime check configuration. 12402 // 12403 // - name: The Uptime check configuration to retrieve. The format is: 12404 // projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID]. 12405 func (r *ProjectsUptimeCheckConfigsService) Get(name string) *ProjectsUptimeCheckConfigsGetCall { 12406 c := &ProjectsUptimeCheckConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12407 c.name = name 12408 return c 12409 } 12410 12411 // Fields allows partial responses to be retrieved. See 12412 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12413 // details. 12414 func (c *ProjectsUptimeCheckConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsUptimeCheckConfigsGetCall { 12415 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12416 return c 12417 } 12418 12419 // IfNoneMatch sets an optional parameter which makes the operation fail if the 12420 // object's ETag matches the given value. This is useful for getting updates 12421 // only after the object has changed since the last request. 12422 func (c *ProjectsUptimeCheckConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsUptimeCheckConfigsGetCall { 12423 c.ifNoneMatch_ = entityTag 12424 return c 12425 } 12426 12427 // Context sets the context to be used in this call's Do method. 12428 func (c *ProjectsUptimeCheckConfigsGetCall) Context(ctx context.Context) *ProjectsUptimeCheckConfigsGetCall { 12429 c.ctx_ = ctx 12430 return c 12431 } 12432 12433 // Header returns a http.Header that can be modified by the caller to add 12434 // headers to the request. 12435 func (c *ProjectsUptimeCheckConfigsGetCall) Header() http.Header { 12436 if c.header_ == nil { 12437 c.header_ = make(http.Header) 12438 } 12439 return c.header_ 12440 } 12441 12442 func (c *ProjectsUptimeCheckConfigsGetCall) doRequest(alt string) (*http.Response, error) { 12443 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12444 if c.ifNoneMatch_ != "" { 12445 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12446 } 12447 var body io.Reader = nil 12448 c.urlParams_.Set("alt", alt) 12449 c.urlParams_.Set("prettyPrint", "false") 12450 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 12451 urls += "?" + c.urlParams_.Encode() 12452 req, err := http.NewRequest("GET", urls, body) 12453 if err != nil { 12454 return nil, err 12455 } 12456 req.Header = reqHeaders 12457 googleapi.Expand(req.URL, map[string]string{ 12458 "name": c.name, 12459 }) 12460 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12461 } 12462 12463 // Do executes the "monitoring.projects.uptimeCheckConfigs.get" call. 12464 // Any non-2xx status code is an error. Response headers are in either 12465 // *UptimeCheckConfig.ServerResponse.Header or (if a response was returned at 12466 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12467 // check whether the returned error was because http.StatusNotModified was 12468 // returned. 12469 func (c *ProjectsUptimeCheckConfigsGetCall) Do(opts ...googleapi.CallOption) (*UptimeCheckConfig, error) { 12470 gensupport.SetOptions(c.urlParams_, opts...) 12471 res, err := c.doRequest("json") 12472 if res != nil && res.StatusCode == http.StatusNotModified { 12473 if res.Body != nil { 12474 res.Body.Close() 12475 } 12476 return nil, gensupport.WrapError(&googleapi.Error{ 12477 Code: res.StatusCode, 12478 Header: res.Header, 12479 }) 12480 } 12481 if err != nil { 12482 return nil, err 12483 } 12484 defer googleapi.CloseBody(res) 12485 if err := googleapi.CheckResponse(res); err != nil { 12486 return nil, gensupport.WrapError(err) 12487 } 12488 ret := &UptimeCheckConfig{ 12489 ServerResponse: googleapi.ServerResponse{ 12490 Header: res.Header, 12491 HTTPStatusCode: res.StatusCode, 12492 }, 12493 } 12494 target := &ret 12495 if err := gensupport.DecodeResponse(target, res); err != nil { 12496 return nil, err 12497 } 12498 return ret, nil 12499 } 12500 12501 type ProjectsUptimeCheckConfigsListCall struct { 12502 s *Service 12503 parent string 12504 urlParams_ gensupport.URLParams 12505 ifNoneMatch_ string 12506 ctx_ context.Context 12507 header_ http.Header 12508 } 12509 12510 // List: Lists the existing valid Uptime check configurations for the project 12511 // (leaving out any invalid configurations). 12512 // 12513 // - parent: The project 12514 // (https://cloud.google.com/monitoring/api/v3#project_name) whose Uptime 12515 // check configurations are listed. The format is: 12516 // projects/[PROJECT_ID_OR_NUMBER]. 12517 func (r *ProjectsUptimeCheckConfigsService) List(parent string) *ProjectsUptimeCheckConfigsListCall { 12518 c := &ProjectsUptimeCheckConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12519 c.parent = parent 12520 return c 12521 } 12522 12523 // Filter sets the optional parameter "filter": If provided, this field 12524 // specifies the criteria that must be met by uptime checks to be included in 12525 // the response.For more details, see Filtering syntax 12526 // (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). 12527 func (c *ProjectsUptimeCheckConfigsListCall) Filter(filter string) *ProjectsUptimeCheckConfigsListCall { 12528 c.urlParams_.Set("filter", filter) 12529 return c 12530 } 12531 12532 // PageSize sets the optional parameter "pageSize": The maximum number of 12533 // results to return in a single response. The server may further constrain the 12534 // maximum number of results returned in a single page. If the page_size is 12535 // <=0, the server will decide the number of results to be returned. 12536 func (c *ProjectsUptimeCheckConfigsListCall) PageSize(pageSize int64) *ProjectsUptimeCheckConfigsListCall { 12537 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 12538 return c 12539 } 12540 12541 // PageToken sets the optional parameter "pageToken": If this field is not 12542 // empty then it must contain the nextPageToken value returned by a previous 12543 // call to this method. Using this field causes the method to return more 12544 // results from the previous method call. 12545 func (c *ProjectsUptimeCheckConfigsListCall) PageToken(pageToken string) *ProjectsUptimeCheckConfigsListCall { 12546 c.urlParams_.Set("pageToken", pageToken) 12547 return c 12548 } 12549 12550 // Fields allows partial responses to be retrieved. See 12551 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12552 // details. 12553 func (c *ProjectsUptimeCheckConfigsListCall) Fields(s ...googleapi.Field) *ProjectsUptimeCheckConfigsListCall { 12554 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12555 return c 12556 } 12557 12558 // IfNoneMatch sets an optional parameter which makes the operation fail if the 12559 // object's ETag matches the given value. This is useful for getting updates 12560 // only after the object has changed since the last request. 12561 func (c *ProjectsUptimeCheckConfigsListCall) IfNoneMatch(entityTag string) *ProjectsUptimeCheckConfigsListCall { 12562 c.ifNoneMatch_ = entityTag 12563 return c 12564 } 12565 12566 // Context sets the context to be used in this call's Do method. 12567 func (c *ProjectsUptimeCheckConfigsListCall) Context(ctx context.Context) *ProjectsUptimeCheckConfigsListCall { 12568 c.ctx_ = ctx 12569 return c 12570 } 12571 12572 // Header returns a http.Header that can be modified by the caller to add 12573 // headers to the request. 12574 func (c *ProjectsUptimeCheckConfigsListCall) Header() http.Header { 12575 if c.header_ == nil { 12576 c.header_ = make(http.Header) 12577 } 12578 return c.header_ 12579 } 12580 12581 func (c *ProjectsUptimeCheckConfigsListCall) doRequest(alt string) (*http.Response, error) { 12582 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12583 if c.ifNoneMatch_ != "" { 12584 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12585 } 12586 var body io.Reader = nil 12587 c.urlParams_.Set("alt", alt) 12588 c.urlParams_.Set("prettyPrint", "false") 12589 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/uptimeCheckConfigs") 12590 urls += "?" + c.urlParams_.Encode() 12591 req, err := http.NewRequest("GET", urls, body) 12592 if err != nil { 12593 return nil, err 12594 } 12595 req.Header = reqHeaders 12596 googleapi.Expand(req.URL, map[string]string{ 12597 "parent": c.parent, 12598 }) 12599 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12600 } 12601 12602 // Do executes the "monitoring.projects.uptimeCheckConfigs.list" call. 12603 // Any non-2xx status code is an error. Response headers are in either 12604 // *ListUptimeCheckConfigsResponse.ServerResponse.Header or (if a response was 12605 // returned at all) in error.(*googleapi.Error).Header. Use 12606 // googleapi.IsNotModified to check whether the returned error was because 12607 // http.StatusNotModified was returned. 12608 func (c *ProjectsUptimeCheckConfigsListCall) Do(opts ...googleapi.CallOption) (*ListUptimeCheckConfigsResponse, error) { 12609 gensupport.SetOptions(c.urlParams_, opts...) 12610 res, err := c.doRequest("json") 12611 if res != nil && res.StatusCode == http.StatusNotModified { 12612 if res.Body != nil { 12613 res.Body.Close() 12614 } 12615 return nil, gensupport.WrapError(&googleapi.Error{ 12616 Code: res.StatusCode, 12617 Header: res.Header, 12618 }) 12619 } 12620 if err != nil { 12621 return nil, err 12622 } 12623 defer googleapi.CloseBody(res) 12624 if err := googleapi.CheckResponse(res); err != nil { 12625 return nil, gensupport.WrapError(err) 12626 } 12627 ret := &ListUptimeCheckConfigsResponse{ 12628 ServerResponse: googleapi.ServerResponse{ 12629 Header: res.Header, 12630 HTTPStatusCode: res.StatusCode, 12631 }, 12632 } 12633 target := &ret 12634 if err := gensupport.DecodeResponse(target, res); err != nil { 12635 return nil, err 12636 } 12637 return ret, nil 12638 } 12639 12640 // Pages invokes f for each page of results. 12641 // A non-nil error returned from f will halt the iteration. 12642 // The provided context supersedes any context provided to the Context method. 12643 func (c *ProjectsUptimeCheckConfigsListCall) Pages(ctx context.Context, f func(*ListUptimeCheckConfigsResponse) error) error { 12644 c.ctx_ = ctx 12645 defer c.PageToken(c.urlParams_.Get("pageToken")) 12646 for { 12647 x, err := c.Do() 12648 if err != nil { 12649 return err 12650 } 12651 if err := f(x); err != nil { 12652 return err 12653 } 12654 if x.NextPageToken == "" { 12655 return nil 12656 } 12657 c.PageToken(x.NextPageToken) 12658 } 12659 } 12660 12661 type ProjectsUptimeCheckConfigsPatchCall struct { 12662 s *Service 12663 name string 12664 uptimecheckconfig *UptimeCheckConfig 12665 urlParams_ gensupport.URLParams 12666 ctx_ context.Context 12667 header_ http.Header 12668 } 12669 12670 // Patch: Updates an Uptime check configuration. You can either replace the 12671 // entire configuration with a new one or replace only certain fields in the 12672 // current configuration by specifying the fields to be updated via updateMask. 12673 // Returns the updated configuration. 12674 // 12675 // - name: Identifier. A unique resource name for this Uptime check 12676 // configuration. The format is: 12677 // projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] 12678 // [PROJECT_ID_OR_NUMBER] is the Workspace host project associated with the 12679 // Uptime check.This field should be omitted when creating the Uptime check 12680 // configuration; on create, the resource name is assigned by the server and 12681 // included in the response. 12682 func (r *ProjectsUptimeCheckConfigsService) Patch(name string, uptimecheckconfig *UptimeCheckConfig) *ProjectsUptimeCheckConfigsPatchCall { 12683 c := &ProjectsUptimeCheckConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12684 c.name = name 12685 c.uptimecheckconfig = uptimecheckconfig 12686 return c 12687 } 12688 12689 // UpdateMask sets the optional parameter "updateMask": If present, only the 12690 // listed fields in the current Uptime check configuration are updated with 12691 // values from the new configuration. If this field is empty, then the current 12692 // configuration is completely replaced with the new configuration. 12693 func (c *ProjectsUptimeCheckConfigsPatchCall) UpdateMask(updateMask string) *ProjectsUptimeCheckConfigsPatchCall { 12694 c.urlParams_.Set("updateMask", updateMask) 12695 return c 12696 } 12697 12698 // Fields allows partial responses to be retrieved. See 12699 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12700 // details. 12701 func (c *ProjectsUptimeCheckConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsUptimeCheckConfigsPatchCall { 12702 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12703 return c 12704 } 12705 12706 // Context sets the context to be used in this call's Do method. 12707 func (c *ProjectsUptimeCheckConfigsPatchCall) Context(ctx context.Context) *ProjectsUptimeCheckConfigsPatchCall { 12708 c.ctx_ = ctx 12709 return c 12710 } 12711 12712 // Header returns a http.Header that can be modified by the caller to add 12713 // headers to the request. 12714 func (c *ProjectsUptimeCheckConfigsPatchCall) Header() http.Header { 12715 if c.header_ == nil { 12716 c.header_ = make(http.Header) 12717 } 12718 return c.header_ 12719 } 12720 12721 func (c *ProjectsUptimeCheckConfigsPatchCall) doRequest(alt string) (*http.Response, error) { 12722 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12723 var body io.Reader = nil 12724 body, err := googleapi.WithoutDataWrapper.JSONReader(c.uptimecheckconfig) 12725 if err != nil { 12726 return nil, err 12727 } 12728 c.urlParams_.Set("alt", alt) 12729 c.urlParams_.Set("prettyPrint", "false") 12730 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 12731 urls += "?" + c.urlParams_.Encode() 12732 req, err := http.NewRequest("PATCH", urls, body) 12733 if err != nil { 12734 return nil, err 12735 } 12736 req.Header = reqHeaders 12737 googleapi.Expand(req.URL, map[string]string{ 12738 "name": c.name, 12739 }) 12740 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12741 } 12742 12743 // Do executes the "monitoring.projects.uptimeCheckConfigs.patch" call. 12744 // Any non-2xx status code is an error. Response headers are in either 12745 // *UptimeCheckConfig.ServerResponse.Header or (if a response was returned at 12746 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12747 // check whether the returned error was because http.StatusNotModified was 12748 // returned. 12749 func (c *ProjectsUptimeCheckConfigsPatchCall) Do(opts ...googleapi.CallOption) (*UptimeCheckConfig, error) { 12750 gensupport.SetOptions(c.urlParams_, opts...) 12751 res, err := c.doRequest("json") 12752 if res != nil && res.StatusCode == http.StatusNotModified { 12753 if res.Body != nil { 12754 res.Body.Close() 12755 } 12756 return nil, gensupport.WrapError(&googleapi.Error{ 12757 Code: res.StatusCode, 12758 Header: res.Header, 12759 }) 12760 } 12761 if err != nil { 12762 return nil, err 12763 } 12764 defer googleapi.CloseBody(res) 12765 if err := googleapi.CheckResponse(res); err != nil { 12766 return nil, gensupport.WrapError(err) 12767 } 12768 ret := &UptimeCheckConfig{ 12769 ServerResponse: googleapi.ServerResponse{ 12770 Header: res.Header, 12771 HTTPStatusCode: res.StatusCode, 12772 }, 12773 } 12774 target := &ret 12775 if err := gensupport.DecodeResponse(target, res); err != nil { 12776 return nil, err 12777 } 12778 return ret, nil 12779 } 12780 12781 type ServicesCreateCall struct { 12782 s *Service 12783 parent string 12784 service *MService 12785 urlParams_ gensupport.URLParams 12786 ctx_ context.Context 12787 header_ http.Header 12788 } 12789 12790 // Create: Create a Service. 12791 // 12792 // - parent: Resource name 12793 // (https://cloud.google.com/monitoring/api/v3#project_name) of the parent 12794 // Metrics Scope. The format is: projects/[PROJECT_ID_OR_NUMBER]. 12795 func (r *ServicesService) Create(parent string, service *MService) *ServicesCreateCall { 12796 c := &ServicesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12797 c.parent = parent 12798 c.service = service 12799 return c 12800 } 12801 12802 // ServiceId sets the optional parameter "serviceId": The Service id to use for 12803 // this Service. If omitted, an id will be generated instead. Must match the 12804 // pattern [a-z0-9\-]+ 12805 func (c *ServicesCreateCall) ServiceId(serviceId string) *ServicesCreateCall { 12806 c.urlParams_.Set("serviceId", serviceId) 12807 return c 12808 } 12809 12810 // Fields allows partial responses to be retrieved. See 12811 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12812 // details. 12813 func (c *ServicesCreateCall) Fields(s ...googleapi.Field) *ServicesCreateCall { 12814 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12815 return c 12816 } 12817 12818 // Context sets the context to be used in this call's Do method. 12819 func (c *ServicesCreateCall) Context(ctx context.Context) *ServicesCreateCall { 12820 c.ctx_ = ctx 12821 return c 12822 } 12823 12824 // Header returns a http.Header that can be modified by the caller to add 12825 // headers to the request. 12826 func (c *ServicesCreateCall) Header() http.Header { 12827 if c.header_ == nil { 12828 c.header_ = make(http.Header) 12829 } 12830 return c.header_ 12831 } 12832 12833 func (c *ServicesCreateCall) doRequest(alt string) (*http.Response, error) { 12834 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 12835 var body io.Reader = nil 12836 body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) 12837 if err != nil { 12838 return nil, err 12839 } 12840 c.urlParams_.Set("alt", alt) 12841 c.urlParams_.Set("prettyPrint", "false") 12842 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/services") 12843 urls += "?" + c.urlParams_.Encode() 12844 req, err := http.NewRequest("POST", urls, body) 12845 if err != nil { 12846 return nil, err 12847 } 12848 req.Header = reqHeaders 12849 googleapi.Expand(req.URL, map[string]string{ 12850 "parent": c.parent, 12851 }) 12852 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12853 } 12854 12855 // Do executes the "monitoring.services.create" call. 12856 // Any non-2xx status code is an error. Response headers are in either 12857 // *MService.ServerResponse.Header or (if a response was returned at all) in 12858 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 12859 // whether the returned error was because http.StatusNotModified was returned. 12860 func (c *ServicesCreateCall) Do(opts ...googleapi.CallOption) (*MService, error) { 12861 gensupport.SetOptions(c.urlParams_, opts...) 12862 res, err := c.doRequest("json") 12863 if res != nil && res.StatusCode == http.StatusNotModified { 12864 if res.Body != nil { 12865 res.Body.Close() 12866 } 12867 return nil, gensupport.WrapError(&googleapi.Error{ 12868 Code: res.StatusCode, 12869 Header: res.Header, 12870 }) 12871 } 12872 if err != nil { 12873 return nil, err 12874 } 12875 defer googleapi.CloseBody(res) 12876 if err := googleapi.CheckResponse(res); err != nil { 12877 return nil, gensupport.WrapError(err) 12878 } 12879 ret := &MService{ 12880 ServerResponse: googleapi.ServerResponse{ 12881 Header: res.Header, 12882 HTTPStatusCode: res.StatusCode, 12883 }, 12884 } 12885 target := &ret 12886 if err := gensupport.DecodeResponse(target, res); err != nil { 12887 return nil, err 12888 } 12889 return ret, nil 12890 } 12891 12892 type ServicesDeleteCall struct { 12893 s *Service 12894 name string 12895 urlParams_ gensupport.URLParams 12896 ctx_ context.Context 12897 header_ http.Header 12898 } 12899 12900 // Delete: Soft delete this Service. 12901 // 12902 // - name: Resource name of the Service to delete. The format is: 12903 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]. 12904 func (r *ServicesService) Delete(name string) *ServicesDeleteCall { 12905 c := &ServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12906 c.name = name 12907 return c 12908 } 12909 12910 // Fields allows partial responses to be retrieved. See 12911 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 12912 // details. 12913 func (c *ServicesDeleteCall) Fields(s ...googleapi.Field) *ServicesDeleteCall { 12914 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12915 return c 12916 } 12917 12918 // Context sets the context to be used in this call's Do method. 12919 func (c *ServicesDeleteCall) Context(ctx context.Context) *ServicesDeleteCall { 12920 c.ctx_ = ctx 12921 return c 12922 } 12923 12924 // Header returns a http.Header that can be modified by the caller to add 12925 // headers to the request. 12926 func (c *ServicesDeleteCall) Header() http.Header { 12927 if c.header_ == nil { 12928 c.header_ = make(http.Header) 12929 } 12930 return c.header_ 12931 } 12932 12933 func (c *ServicesDeleteCall) doRequest(alt string) (*http.Response, error) { 12934 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 12935 var body io.Reader = nil 12936 c.urlParams_.Set("alt", alt) 12937 c.urlParams_.Set("prettyPrint", "false") 12938 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 12939 urls += "?" + c.urlParams_.Encode() 12940 req, err := http.NewRequest("DELETE", urls, body) 12941 if err != nil { 12942 return nil, err 12943 } 12944 req.Header = reqHeaders 12945 googleapi.Expand(req.URL, map[string]string{ 12946 "name": c.name, 12947 }) 12948 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12949 } 12950 12951 // Do executes the "monitoring.services.delete" call. 12952 // Any non-2xx status code is an error. Response headers are in either 12953 // *Empty.ServerResponse.Header or (if a response was returned at all) in 12954 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 12955 // whether the returned error was because http.StatusNotModified was returned. 12956 func (c *ServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 12957 gensupport.SetOptions(c.urlParams_, opts...) 12958 res, err := c.doRequest("json") 12959 if res != nil && res.StatusCode == http.StatusNotModified { 12960 if res.Body != nil { 12961 res.Body.Close() 12962 } 12963 return nil, gensupport.WrapError(&googleapi.Error{ 12964 Code: res.StatusCode, 12965 Header: res.Header, 12966 }) 12967 } 12968 if err != nil { 12969 return nil, err 12970 } 12971 defer googleapi.CloseBody(res) 12972 if err := googleapi.CheckResponse(res); err != nil { 12973 return nil, gensupport.WrapError(err) 12974 } 12975 ret := &Empty{ 12976 ServerResponse: googleapi.ServerResponse{ 12977 Header: res.Header, 12978 HTTPStatusCode: res.StatusCode, 12979 }, 12980 } 12981 target := &ret 12982 if err := gensupport.DecodeResponse(target, res); err != nil { 12983 return nil, err 12984 } 12985 return ret, nil 12986 } 12987 12988 type ServicesGetCall struct { 12989 s *Service 12990 name string 12991 urlParams_ gensupport.URLParams 12992 ifNoneMatch_ string 12993 ctx_ context.Context 12994 header_ http.Header 12995 } 12996 12997 // Get: Get the named Service. 12998 // 12999 // - name: Resource name of the Service. The format is: 13000 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]. 13001 func (r *ServicesService) Get(name string) *ServicesGetCall { 13002 c := &ServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13003 c.name = name 13004 return c 13005 } 13006 13007 // Fields allows partial responses to be retrieved. See 13008 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13009 // details. 13010 func (c *ServicesGetCall) Fields(s ...googleapi.Field) *ServicesGetCall { 13011 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13012 return c 13013 } 13014 13015 // IfNoneMatch sets an optional parameter which makes the operation fail if the 13016 // object's ETag matches the given value. This is useful for getting updates 13017 // only after the object has changed since the last request. 13018 func (c *ServicesGetCall) IfNoneMatch(entityTag string) *ServicesGetCall { 13019 c.ifNoneMatch_ = entityTag 13020 return c 13021 } 13022 13023 // Context sets the context to be used in this call's Do method. 13024 func (c *ServicesGetCall) Context(ctx context.Context) *ServicesGetCall { 13025 c.ctx_ = ctx 13026 return c 13027 } 13028 13029 // Header returns a http.Header that can be modified by the caller to add 13030 // headers to the request. 13031 func (c *ServicesGetCall) Header() http.Header { 13032 if c.header_ == nil { 13033 c.header_ = make(http.Header) 13034 } 13035 return c.header_ 13036 } 13037 13038 func (c *ServicesGetCall) doRequest(alt string) (*http.Response, error) { 13039 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13040 if c.ifNoneMatch_ != "" { 13041 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13042 } 13043 var body io.Reader = nil 13044 c.urlParams_.Set("alt", alt) 13045 c.urlParams_.Set("prettyPrint", "false") 13046 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 13047 urls += "?" + c.urlParams_.Encode() 13048 req, err := http.NewRequest("GET", urls, body) 13049 if err != nil { 13050 return nil, err 13051 } 13052 req.Header = reqHeaders 13053 googleapi.Expand(req.URL, map[string]string{ 13054 "name": c.name, 13055 }) 13056 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13057 } 13058 13059 // Do executes the "monitoring.services.get" call. 13060 // Any non-2xx status code is an error. Response headers are in either 13061 // *MService.ServerResponse.Header or (if a response was returned at all) in 13062 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13063 // whether the returned error was because http.StatusNotModified was returned. 13064 func (c *ServicesGetCall) Do(opts ...googleapi.CallOption) (*MService, error) { 13065 gensupport.SetOptions(c.urlParams_, opts...) 13066 res, err := c.doRequest("json") 13067 if res != nil && res.StatusCode == http.StatusNotModified { 13068 if res.Body != nil { 13069 res.Body.Close() 13070 } 13071 return nil, gensupport.WrapError(&googleapi.Error{ 13072 Code: res.StatusCode, 13073 Header: res.Header, 13074 }) 13075 } 13076 if err != nil { 13077 return nil, err 13078 } 13079 defer googleapi.CloseBody(res) 13080 if err := googleapi.CheckResponse(res); err != nil { 13081 return nil, gensupport.WrapError(err) 13082 } 13083 ret := &MService{ 13084 ServerResponse: googleapi.ServerResponse{ 13085 Header: res.Header, 13086 HTTPStatusCode: res.StatusCode, 13087 }, 13088 } 13089 target := &ret 13090 if err := gensupport.DecodeResponse(target, res); err != nil { 13091 return nil, err 13092 } 13093 return ret, nil 13094 } 13095 13096 type ServicesListCall struct { 13097 s *Service 13098 parent string 13099 urlParams_ gensupport.URLParams 13100 ifNoneMatch_ string 13101 ctx_ context.Context 13102 header_ http.Header 13103 } 13104 13105 // List: List Services for this Metrics Scope. 13106 // 13107 // - parent: Resource name of the parent containing the listed services, either 13108 // a project (https://cloud.google.com/monitoring/api/v3#project_name) or a 13109 // Monitoring Metrics Scope. The formats are: projects/[PROJECT_ID_OR_NUMBER] 13110 // workspaces/[HOST_PROJECT_ID_OR_NUMBER]. 13111 func (r *ServicesService) List(parent string) *ServicesListCall { 13112 c := &ServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13113 c.parent = parent 13114 return c 13115 } 13116 13117 // Filter sets the optional parameter "filter": A filter specifying what 13118 // Services to return. The filter supports filtering on a particular 13119 // service-identifier type or one of its attributes.To filter on a particular 13120 // service-identifier type, the identifier_case refers to which option in the 13121 // identifier field is populated. For example, the filter identifier_case = 13122 // "CUSTOM" would match all services with a value for the custom field. Valid 13123 // options include "CUSTOM", "APP_ENGINE", "MESH_ISTIO", and the other options 13124 // listed at 13125 // https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#ServiceTo 13126 // filter on an attribute of a service-identifier type, apply the filter name 13127 // by using the snake case of the service-identifier type and the attribute of 13128 // that service-identifier type, and join the two with a period. For example, 13129 // to filter by the meshUid field of the MeshIstio service-identifier type, you 13130 // must filter on mesh_istio.mesh_uid = "123" to match all services with mesh 13131 // UID "123". Service-identifier types and their attributes are described at 13132 // https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service 13133 func (c *ServicesListCall) Filter(filter string) *ServicesListCall { 13134 c.urlParams_.Set("filter", filter) 13135 return c 13136 } 13137 13138 // PageSize sets the optional parameter "pageSize": A non-negative number that 13139 // is the maximum number of results to return. When 0, use default page size. 13140 func (c *ServicesListCall) PageSize(pageSize int64) *ServicesListCall { 13141 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 13142 return c 13143 } 13144 13145 // PageToken sets the optional parameter "pageToken": If this field is not 13146 // empty then it must contain the nextPageToken value returned by a previous 13147 // call to this method. Using this field causes the method to return additional 13148 // results from the previous method call. 13149 func (c *ServicesListCall) PageToken(pageToken string) *ServicesListCall { 13150 c.urlParams_.Set("pageToken", pageToken) 13151 return c 13152 } 13153 13154 // Fields allows partial responses to be retrieved. See 13155 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13156 // details. 13157 func (c *ServicesListCall) Fields(s ...googleapi.Field) *ServicesListCall { 13158 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13159 return c 13160 } 13161 13162 // IfNoneMatch sets an optional parameter which makes the operation fail if the 13163 // object's ETag matches the given value. This is useful for getting updates 13164 // only after the object has changed since the last request. 13165 func (c *ServicesListCall) IfNoneMatch(entityTag string) *ServicesListCall { 13166 c.ifNoneMatch_ = entityTag 13167 return c 13168 } 13169 13170 // Context sets the context to be used in this call's Do method. 13171 func (c *ServicesListCall) Context(ctx context.Context) *ServicesListCall { 13172 c.ctx_ = ctx 13173 return c 13174 } 13175 13176 // Header returns a http.Header that can be modified by the caller to add 13177 // headers to the request. 13178 func (c *ServicesListCall) Header() http.Header { 13179 if c.header_ == nil { 13180 c.header_ = make(http.Header) 13181 } 13182 return c.header_ 13183 } 13184 13185 func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) { 13186 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13187 if c.ifNoneMatch_ != "" { 13188 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13189 } 13190 var body io.Reader = nil 13191 c.urlParams_.Set("alt", alt) 13192 c.urlParams_.Set("prettyPrint", "false") 13193 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/services") 13194 urls += "?" + c.urlParams_.Encode() 13195 req, err := http.NewRequest("GET", urls, body) 13196 if err != nil { 13197 return nil, err 13198 } 13199 req.Header = reqHeaders 13200 googleapi.Expand(req.URL, map[string]string{ 13201 "parent": c.parent, 13202 }) 13203 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13204 } 13205 13206 // Do executes the "monitoring.services.list" call. 13207 // Any non-2xx status code is an error. Response headers are in either 13208 // *ListServicesResponse.ServerResponse.Header or (if a response was returned 13209 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13210 // check whether the returned error was because http.StatusNotModified was 13211 // returned. 13212 func (c *ServicesListCall) Do(opts ...googleapi.CallOption) (*ListServicesResponse, error) { 13213 gensupport.SetOptions(c.urlParams_, opts...) 13214 res, err := c.doRequest("json") 13215 if res != nil && res.StatusCode == http.StatusNotModified { 13216 if res.Body != nil { 13217 res.Body.Close() 13218 } 13219 return nil, gensupport.WrapError(&googleapi.Error{ 13220 Code: res.StatusCode, 13221 Header: res.Header, 13222 }) 13223 } 13224 if err != nil { 13225 return nil, err 13226 } 13227 defer googleapi.CloseBody(res) 13228 if err := googleapi.CheckResponse(res); err != nil { 13229 return nil, gensupport.WrapError(err) 13230 } 13231 ret := &ListServicesResponse{ 13232 ServerResponse: googleapi.ServerResponse{ 13233 Header: res.Header, 13234 HTTPStatusCode: res.StatusCode, 13235 }, 13236 } 13237 target := &ret 13238 if err := gensupport.DecodeResponse(target, res); err != nil { 13239 return nil, err 13240 } 13241 return ret, nil 13242 } 13243 13244 // Pages invokes f for each page of results. 13245 // A non-nil error returned from f will halt the iteration. 13246 // The provided context supersedes any context provided to the Context method. 13247 func (c *ServicesListCall) Pages(ctx context.Context, f func(*ListServicesResponse) error) error { 13248 c.ctx_ = ctx 13249 defer c.PageToken(c.urlParams_.Get("pageToken")) 13250 for { 13251 x, err := c.Do() 13252 if err != nil { 13253 return err 13254 } 13255 if err := f(x); err != nil { 13256 return err 13257 } 13258 if x.NextPageToken == "" { 13259 return nil 13260 } 13261 c.PageToken(x.NextPageToken) 13262 } 13263 } 13264 13265 type ServicesPatchCall struct { 13266 s *Service 13267 name string 13268 service *MService 13269 urlParams_ gensupport.URLParams 13270 ctx_ context.Context 13271 header_ http.Header 13272 } 13273 13274 // Patch: Update this Service. 13275 // 13276 // - name: Identifier. Resource name for this Service. The format is: 13277 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]. 13278 func (r *ServicesService) Patch(name string, service *MService) *ServicesPatchCall { 13279 c := &ServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13280 c.name = name 13281 c.service = service 13282 return c 13283 } 13284 13285 // UpdateMask sets the optional parameter "updateMask": A set of field paths 13286 // defining which fields to use for the update. 13287 func (c *ServicesPatchCall) UpdateMask(updateMask string) *ServicesPatchCall { 13288 c.urlParams_.Set("updateMask", updateMask) 13289 return c 13290 } 13291 13292 // Fields allows partial responses to be retrieved. See 13293 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13294 // details. 13295 func (c *ServicesPatchCall) Fields(s ...googleapi.Field) *ServicesPatchCall { 13296 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13297 return c 13298 } 13299 13300 // Context sets the context to be used in this call's Do method. 13301 func (c *ServicesPatchCall) Context(ctx context.Context) *ServicesPatchCall { 13302 c.ctx_ = ctx 13303 return c 13304 } 13305 13306 // Header returns a http.Header that can be modified by the caller to add 13307 // headers to the request. 13308 func (c *ServicesPatchCall) Header() http.Header { 13309 if c.header_ == nil { 13310 c.header_ = make(http.Header) 13311 } 13312 return c.header_ 13313 } 13314 13315 func (c *ServicesPatchCall) doRequest(alt string) (*http.Response, error) { 13316 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13317 var body io.Reader = nil 13318 body, err := googleapi.WithoutDataWrapper.JSONReader(c.service) 13319 if err != nil { 13320 return nil, err 13321 } 13322 c.urlParams_.Set("alt", alt) 13323 c.urlParams_.Set("prettyPrint", "false") 13324 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 13325 urls += "?" + c.urlParams_.Encode() 13326 req, err := http.NewRequest("PATCH", urls, body) 13327 if err != nil { 13328 return nil, err 13329 } 13330 req.Header = reqHeaders 13331 googleapi.Expand(req.URL, map[string]string{ 13332 "name": c.name, 13333 }) 13334 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13335 } 13336 13337 // Do executes the "monitoring.services.patch" call. 13338 // Any non-2xx status code is an error. Response headers are in either 13339 // *MService.ServerResponse.Header or (if a response was returned at all) in 13340 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13341 // whether the returned error was because http.StatusNotModified was returned. 13342 func (c *ServicesPatchCall) Do(opts ...googleapi.CallOption) (*MService, error) { 13343 gensupport.SetOptions(c.urlParams_, opts...) 13344 res, err := c.doRequest("json") 13345 if res != nil && res.StatusCode == http.StatusNotModified { 13346 if res.Body != nil { 13347 res.Body.Close() 13348 } 13349 return nil, gensupport.WrapError(&googleapi.Error{ 13350 Code: res.StatusCode, 13351 Header: res.Header, 13352 }) 13353 } 13354 if err != nil { 13355 return nil, err 13356 } 13357 defer googleapi.CloseBody(res) 13358 if err := googleapi.CheckResponse(res); err != nil { 13359 return nil, gensupport.WrapError(err) 13360 } 13361 ret := &MService{ 13362 ServerResponse: googleapi.ServerResponse{ 13363 Header: res.Header, 13364 HTTPStatusCode: res.StatusCode, 13365 }, 13366 } 13367 target := &ret 13368 if err := gensupport.DecodeResponse(target, res); err != nil { 13369 return nil, err 13370 } 13371 return ret, nil 13372 } 13373 13374 type ServicesServiceLevelObjectivesCreateCall struct { 13375 s *Service 13376 parent string 13377 servicelevelobjective *ServiceLevelObjective 13378 urlParams_ gensupport.URLParams 13379 ctx_ context.Context 13380 header_ http.Header 13381 } 13382 13383 // Create: Create a ServiceLevelObjective for the given Service. 13384 // 13385 // - parent: Resource name of the parent Service. The format is: 13386 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]. 13387 func (r *ServicesServiceLevelObjectivesService) Create(parent string, servicelevelobjective *ServiceLevelObjective) *ServicesServiceLevelObjectivesCreateCall { 13388 c := &ServicesServiceLevelObjectivesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13389 c.parent = parent 13390 c.servicelevelobjective = servicelevelobjective 13391 return c 13392 } 13393 13394 // ServiceLevelObjectiveId sets the optional parameter 13395 // "serviceLevelObjectiveId": The ServiceLevelObjective id to use for this 13396 // ServiceLevelObjective. If omitted, an id will be generated instead. Must 13397 // match the pattern ^[a-zA-Z0-9-_:.]+$ 13398 func (c *ServicesServiceLevelObjectivesCreateCall) ServiceLevelObjectiveId(serviceLevelObjectiveId string) *ServicesServiceLevelObjectivesCreateCall { 13399 c.urlParams_.Set("serviceLevelObjectiveId", serviceLevelObjectiveId) 13400 return c 13401 } 13402 13403 // Fields allows partial responses to be retrieved. See 13404 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13405 // details. 13406 func (c *ServicesServiceLevelObjectivesCreateCall) Fields(s ...googleapi.Field) *ServicesServiceLevelObjectivesCreateCall { 13407 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13408 return c 13409 } 13410 13411 // Context sets the context to be used in this call's Do method. 13412 func (c *ServicesServiceLevelObjectivesCreateCall) Context(ctx context.Context) *ServicesServiceLevelObjectivesCreateCall { 13413 c.ctx_ = ctx 13414 return c 13415 } 13416 13417 // Header returns a http.Header that can be modified by the caller to add 13418 // headers to the request. 13419 func (c *ServicesServiceLevelObjectivesCreateCall) Header() http.Header { 13420 if c.header_ == nil { 13421 c.header_ = make(http.Header) 13422 } 13423 return c.header_ 13424 } 13425 13426 func (c *ServicesServiceLevelObjectivesCreateCall) doRequest(alt string) (*http.Response, error) { 13427 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13428 var body io.Reader = nil 13429 body, err := googleapi.WithoutDataWrapper.JSONReader(c.servicelevelobjective) 13430 if err != nil { 13431 return nil, err 13432 } 13433 c.urlParams_.Set("alt", alt) 13434 c.urlParams_.Set("prettyPrint", "false") 13435 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/serviceLevelObjectives") 13436 urls += "?" + c.urlParams_.Encode() 13437 req, err := http.NewRequest("POST", urls, body) 13438 if err != nil { 13439 return nil, err 13440 } 13441 req.Header = reqHeaders 13442 googleapi.Expand(req.URL, map[string]string{ 13443 "parent": c.parent, 13444 }) 13445 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13446 } 13447 13448 // Do executes the "monitoring.services.serviceLevelObjectives.create" call. 13449 // Any non-2xx status code is an error. Response headers are in either 13450 // *ServiceLevelObjective.ServerResponse.Header or (if a response was returned 13451 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13452 // check whether the returned error was because http.StatusNotModified was 13453 // returned. 13454 func (c *ServicesServiceLevelObjectivesCreateCall) Do(opts ...googleapi.CallOption) (*ServiceLevelObjective, error) { 13455 gensupport.SetOptions(c.urlParams_, opts...) 13456 res, err := c.doRequest("json") 13457 if res != nil && res.StatusCode == http.StatusNotModified { 13458 if res.Body != nil { 13459 res.Body.Close() 13460 } 13461 return nil, gensupport.WrapError(&googleapi.Error{ 13462 Code: res.StatusCode, 13463 Header: res.Header, 13464 }) 13465 } 13466 if err != nil { 13467 return nil, err 13468 } 13469 defer googleapi.CloseBody(res) 13470 if err := googleapi.CheckResponse(res); err != nil { 13471 return nil, gensupport.WrapError(err) 13472 } 13473 ret := &ServiceLevelObjective{ 13474 ServerResponse: googleapi.ServerResponse{ 13475 Header: res.Header, 13476 HTTPStatusCode: res.StatusCode, 13477 }, 13478 } 13479 target := &ret 13480 if err := gensupport.DecodeResponse(target, res); err != nil { 13481 return nil, err 13482 } 13483 return ret, nil 13484 } 13485 13486 type ServicesServiceLevelObjectivesDeleteCall struct { 13487 s *Service 13488 name string 13489 urlParams_ gensupport.URLParams 13490 ctx_ context.Context 13491 header_ http.Header 13492 } 13493 13494 // Delete: Delete the given ServiceLevelObjective. 13495 // 13496 // - name: Resource name of the ServiceLevelObjective to delete. The format is: 13497 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjective 13498 // s/[SLO_NAME]. 13499 func (r *ServicesServiceLevelObjectivesService) Delete(name string) *ServicesServiceLevelObjectivesDeleteCall { 13500 c := &ServicesServiceLevelObjectivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13501 c.name = name 13502 return c 13503 } 13504 13505 // Fields allows partial responses to be retrieved. See 13506 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13507 // details. 13508 func (c *ServicesServiceLevelObjectivesDeleteCall) Fields(s ...googleapi.Field) *ServicesServiceLevelObjectivesDeleteCall { 13509 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13510 return c 13511 } 13512 13513 // Context sets the context to be used in this call's Do method. 13514 func (c *ServicesServiceLevelObjectivesDeleteCall) Context(ctx context.Context) *ServicesServiceLevelObjectivesDeleteCall { 13515 c.ctx_ = ctx 13516 return c 13517 } 13518 13519 // Header returns a http.Header that can be modified by the caller to add 13520 // headers to the request. 13521 func (c *ServicesServiceLevelObjectivesDeleteCall) Header() http.Header { 13522 if c.header_ == nil { 13523 c.header_ = make(http.Header) 13524 } 13525 return c.header_ 13526 } 13527 13528 func (c *ServicesServiceLevelObjectivesDeleteCall) doRequest(alt string) (*http.Response, error) { 13529 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13530 var body io.Reader = nil 13531 c.urlParams_.Set("alt", alt) 13532 c.urlParams_.Set("prettyPrint", "false") 13533 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 13534 urls += "?" + c.urlParams_.Encode() 13535 req, err := http.NewRequest("DELETE", urls, body) 13536 if err != nil { 13537 return nil, err 13538 } 13539 req.Header = reqHeaders 13540 googleapi.Expand(req.URL, map[string]string{ 13541 "name": c.name, 13542 }) 13543 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13544 } 13545 13546 // Do executes the "monitoring.services.serviceLevelObjectives.delete" call. 13547 // Any non-2xx status code is an error. Response headers are in either 13548 // *Empty.ServerResponse.Header or (if a response was returned at all) in 13549 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 13550 // whether the returned error was because http.StatusNotModified was returned. 13551 func (c *ServicesServiceLevelObjectivesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 13552 gensupport.SetOptions(c.urlParams_, opts...) 13553 res, err := c.doRequest("json") 13554 if res != nil && res.StatusCode == http.StatusNotModified { 13555 if res.Body != nil { 13556 res.Body.Close() 13557 } 13558 return nil, gensupport.WrapError(&googleapi.Error{ 13559 Code: res.StatusCode, 13560 Header: res.Header, 13561 }) 13562 } 13563 if err != nil { 13564 return nil, err 13565 } 13566 defer googleapi.CloseBody(res) 13567 if err := googleapi.CheckResponse(res); err != nil { 13568 return nil, gensupport.WrapError(err) 13569 } 13570 ret := &Empty{ 13571 ServerResponse: googleapi.ServerResponse{ 13572 Header: res.Header, 13573 HTTPStatusCode: res.StatusCode, 13574 }, 13575 } 13576 target := &ret 13577 if err := gensupport.DecodeResponse(target, res); err != nil { 13578 return nil, err 13579 } 13580 return ret, nil 13581 } 13582 13583 type ServicesServiceLevelObjectivesGetCall struct { 13584 s *Service 13585 name string 13586 urlParams_ gensupport.URLParams 13587 ifNoneMatch_ string 13588 ctx_ context.Context 13589 header_ http.Header 13590 } 13591 13592 // Get: Get a ServiceLevelObjective by name. 13593 // 13594 // - name: Resource name of the ServiceLevelObjective to get. The format is: 13595 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjective 13596 // s/[SLO_NAME]. 13597 func (r *ServicesServiceLevelObjectivesService) Get(name string) *ServicesServiceLevelObjectivesGetCall { 13598 c := &ServicesServiceLevelObjectivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13599 c.name = name 13600 return c 13601 } 13602 13603 // View sets the optional parameter "view": View of the ServiceLevelObjective 13604 // to return. If DEFAULT, return the ServiceLevelObjective as originally 13605 // defined. If EXPLICIT and the ServiceLevelObjective is defined in terms of a 13606 // BasicSli, replace the BasicSli with a RequestBasedSli spelling out how the 13607 // SLI is computed. 13608 // 13609 // Possible values: 13610 // 13611 // "VIEW_UNSPECIFIED" - Same as FULL. 13612 // "FULL" - Return the embedded ServiceLevelIndicator in the form in which it 13613 // 13614 // was defined. If it was defined using a BasicSli, return that BasicSli. 13615 // 13616 // "EXPLICIT" - For ServiceLevelIndicators using BasicSli articulation, 13617 // 13618 // instead return the ServiceLevelIndicator with its mode of computation fully 13619 // spelled out as a RequestBasedSli. For ServiceLevelIndicators using 13620 // RequestBasedSli or WindowsBasedSli, return the ServiceLevelIndicator as it 13621 // was provided. 13622 func (c *ServicesServiceLevelObjectivesGetCall) View(view string) *ServicesServiceLevelObjectivesGetCall { 13623 c.urlParams_.Set("view", view) 13624 return c 13625 } 13626 13627 // Fields allows partial responses to be retrieved. See 13628 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13629 // details. 13630 func (c *ServicesServiceLevelObjectivesGetCall) Fields(s ...googleapi.Field) *ServicesServiceLevelObjectivesGetCall { 13631 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13632 return c 13633 } 13634 13635 // IfNoneMatch sets an optional parameter which makes the operation fail if the 13636 // object's ETag matches the given value. This is useful for getting updates 13637 // only after the object has changed since the last request. 13638 func (c *ServicesServiceLevelObjectivesGetCall) IfNoneMatch(entityTag string) *ServicesServiceLevelObjectivesGetCall { 13639 c.ifNoneMatch_ = entityTag 13640 return c 13641 } 13642 13643 // Context sets the context to be used in this call's Do method. 13644 func (c *ServicesServiceLevelObjectivesGetCall) Context(ctx context.Context) *ServicesServiceLevelObjectivesGetCall { 13645 c.ctx_ = ctx 13646 return c 13647 } 13648 13649 // Header returns a http.Header that can be modified by the caller to add 13650 // headers to the request. 13651 func (c *ServicesServiceLevelObjectivesGetCall) Header() http.Header { 13652 if c.header_ == nil { 13653 c.header_ = make(http.Header) 13654 } 13655 return c.header_ 13656 } 13657 13658 func (c *ServicesServiceLevelObjectivesGetCall) doRequest(alt string) (*http.Response, error) { 13659 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13660 if c.ifNoneMatch_ != "" { 13661 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13662 } 13663 var body io.Reader = nil 13664 c.urlParams_.Set("alt", alt) 13665 c.urlParams_.Set("prettyPrint", "false") 13666 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 13667 urls += "?" + c.urlParams_.Encode() 13668 req, err := http.NewRequest("GET", urls, body) 13669 if err != nil { 13670 return nil, err 13671 } 13672 req.Header = reqHeaders 13673 googleapi.Expand(req.URL, map[string]string{ 13674 "name": c.name, 13675 }) 13676 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13677 } 13678 13679 // Do executes the "monitoring.services.serviceLevelObjectives.get" call. 13680 // Any non-2xx status code is an error. Response headers are in either 13681 // *ServiceLevelObjective.ServerResponse.Header or (if a response was returned 13682 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13683 // check whether the returned error was because http.StatusNotModified was 13684 // returned. 13685 func (c *ServicesServiceLevelObjectivesGetCall) Do(opts ...googleapi.CallOption) (*ServiceLevelObjective, error) { 13686 gensupport.SetOptions(c.urlParams_, opts...) 13687 res, err := c.doRequest("json") 13688 if res != nil && res.StatusCode == http.StatusNotModified { 13689 if res.Body != nil { 13690 res.Body.Close() 13691 } 13692 return nil, gensupport.WrapError(&googleapi.Error{ 13693 Code: res.StatusCode, 13694 Header: res.Header, 13695 }) 13696 } 13697 if err != nil { 13698 return nil, err 13699 } 13700 defer googleapi.CloseBody(res) 13701 if err := googleapi.CheckResponse(res); err != nil { 13702 return nil, gensupport.WrapError(err) 13703 } 13704 ret := &ServiceLevelObjective{ 13705 ServerResponse: googleapi.ServerResponse{ 13706 Header: res.Header, 13707 HTTPStatusCode: res.StatusCode, 13708 }, 13709 } 13710 target := &ret 13711 if err := gensupport.DecodeResponse(target, res); err != nil { 13712 return nil, err 13713 } 13714 return ret, nil 13715 } 13716 13717 type ServicesServiceLevelObjectivesListCall struct { 13718 s *Service 13719 parent string 13720 urlParams_ gensupport.URLParams 13721 ifNoneMatch_ string 13722 ctx_ context.Context 13723 header_ http.Header 13724 } 13725 13726 // List: List the ServiceLevelObjectives for the given Service. 13727 // 13728 // - parent: Resource name of the parent containing the listed SLOs, either a 13729 // project or a Monitoring Metrics Scope. The formats are: 13730 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] 13731 // workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/-. 13732 func (r *ServicesServiceLevelObjectivesService) List(parent string) *ServicesServiceLevelObjectivesListCall { 13733 c := &ServicesServiceLevelObjectivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13734 c.parent = parent 13735 return c 13736 } 13737 13738 // Filter sets the optional parameter "filter": A filter specifying what 13739 // ServiceLevelObjectives to return. 13740 func (c *ServicesServiceLevelObjectivesListCall) Filter(filter string) *ServicesServiceLevelObjectivesListCall { 13741 c.urlParams_.Set("filter", filter) 13742 return c 13743 } 13744 13745 // PageSize sets the optional parameter "pageSize": A non-negative number that 13746 // is the maximum number of results to return. When 0, use default page size. 13747 func (c *ServicesServiceLevelObjectivesListCall) PageSize(pageSize int64) *ServicesServiceLevelObjectivesListCall { 13748 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 13749 return c 13750 } 13751 13752 // PageToken sets the optional parameter "pageToken": If this field is not 13753 // empty then it must contain the nextPageToken value returned by a previous 13754 // call to this method. Using this field causes the method to return additional 13755 // results from the previous method call. 13756 func (c *ServicesServiceLevelObjectivesListCall) PageToken(pageToken string) *ServicesServiceLevelObjectivesListCall { 13757 c.urlParams_.Set("pageToken", pageToken) 13758 return c 13759 } 13760 13761 // View sets the optional parameter "view": View of the ServiceLevelObjectives 13762 // to return. If DEFAULT, return each ServiceLevelObjective as originally 13763 // defined. If EXPLICIT and the ServiceLevelObjective is defined in terms of a 13764 // BasicSli, replace the BasicSli with a RequestBasedSli spelling out how the 13765 // SLI is computed. 13766 // 13767 // Possible values: 13768 // 13769 // "VIEW_UNSPECIFIED" - Same as FULL. 13770 // "FULL" - Return the embedded ServiceLevelIndicator in the form in which it 13771 // 13772 // was defined. If it was defined using a BasicSli, return that BasicSli. 13773 // 13774 // "EXPLICIT" - For ServiceLevelIndicators using BasicSli articulation, 13775 // 13776 // instead return the ServiceLevelIndicator with its mode of computation fully 13777 // spelled out as a RequestBasedSli. For ServiceLevelIndicators using 13778 // RequestBasedSli or WindowsBasedSli, return the ServiceLevelIndicator as it 13779 // was provided. 13780 func (c *ServicesServiceLevelObjectivesListCall) View(view string) *ServicesServiceLevelObjectivesListCall { 13781 c.urlParams_.Set("view", view) 13782 return c 13783 } 13784 13785 // Fields allows partial responses to be retrieved. See 13786 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13787 // details. 13788 func (c *ServicesServiceLevelObjectivesListCall) Fields(s ...googleapi.Field) *ServicesServiceLevelObjectivesListCall { 13789 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13790 return c 13791 } 13792 13793 // IfNoneMatch sets an optional parameter which makes the operation fail if the 13794 // object's ETag matches the given value. This is useful for getting updates 13795 // only after the object has changed since the last request. 13796 func (c *ServicesServiceLevelObjectivesListCall) IfNoneMatch(entityTag string) *ServicesServiceLevelObjectivesListCall { 13797 c.ifNoneMatch_ = entityTag 13798 return c 13799 } 13800 13801 // Context sets the context to be used in this call's Do method. 13802 func (c *ServicesServiceLevelObjectivesListCall) Context(ctx context.Context) *ServicesServiceLevelObjectivesListCall { 13803 c.ctx_ = ctx 13804 return c 13805 } 13806 13807 // Header returns a http.Header that can be modified by the caller to add 13808 // headers to the request. 13809 func (c *ServicesServiceLevelObjectivesListCall) Header() http.Header { 13810 if c.header_ == nil { 13811 c.header_ = make(http.Header) 13812 } 13813 return c.header_ 13814 } 13815 13816 func (c *ServicesServiceLevelObjectivesListCall) doRequest(alt string) (*http.Response, error) { 13817 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 13818 if c.ifNoneMatch_ != "" { 13819 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13820 } 13821 var body io.Reader = nil 13822 c.urlParams_.Set("alt", alt) 13823 c.urlParams_.Set("prettyPrint", "false") 13824 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+parent}/serviceLevelObjectives") 13825 urls += "?" + c.urlParams_.Encode() 13826 req, err := http.NewRequest("GET", urls, body) 13827 if err != nil { 13828 return nil, err 13829 } 13830 req.Header = reqHeaders 13831 googleapi.Expand(req.URL, map[string]string{ 13832 "parent": c.parent, 13833 }) 13834 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13835 } 13836 13837 // Do executes the "monitoring.services.serviceLevelObjectives.list" call. 13838 // Any non-2xx status code is an error. Response headers are in either 13839 // *ListServiceLevelObjectivesResponse.ServerResponse.Header or (if a response 13840 // was returned at all) in error.(*googleapi.Error).Header. Use 13841 // googleapi.IsNotModified to check whether the returned error was because 13842 // http.StatusNotModified was returned. 13843 func (c *ServicesServiceLevelObjectivesListCall) Do(opts ...googleapi.CallOption) (*ListServiceLevelObjectivesResponse, error) { 13844 gensupport.SetOptions(c.urlParams_, opts...) 13845 res, err := c.doRequest("json") 13846 if res != nil && res.StatusCode == http.StatusNotModified { 13847 if res.Body != nil { 13848 res.Body.Close() 13849 } 13850 return nil, gensupport.WrapError(&googleapi.Error{ 13851 Code: res.StatusCode, 13852 Header: res.Header, 13853 }) 13854 } 13855 if err != nil { 13856 return nil, err 13857 } 13858 defer googleapi.CloseBody(res) 13859 if err := googleapi.CheckResponse(res); err != nil { 13860 return nil, gensupport.WrapError(err) 13861 } 13862 ret := &ListServiceLevelObjectivesResponse{ 13863 ServerResponse: googleapi.ServerResponse{ 13864 Header: res.Header, 13865 HTTPStatusCode: res.StatusCode, 13866 }, 13867 } 13868 target := &ret 13869 if err := gensupport.DecodeResponse(target, res); err != nil { 13870 return nil, err 13871 } 13872 return ret, nil 13873 } 13874 13875 // Pages invokes f for each page of results. 13876 // A non-nil error returned from f will halt the iteration. 13877 // The provided context supersedes any context provided to the Context method. 13878 func (c *ServicesServiceLevelObjectivesListCall) Pages(ctx context.Context, f func(*ListServiceLevelObjectivesResponse) error) error { 13879 c.ctx_ = ctx 13880 defer c.PageToken(c.urlParams_.Get("pageToken")) 13881 for { 13882 x, err := c.Do() 13883 if err != nil { 13884 return err 13885 } 13886 if err := f(x); err != nil { 13887 return err 13888 } 13889 if x.NextPageToken == "" { 13890 return nil 13891 } 13892 c.PageToken(x.NextPageToken) 13893 } 13894 } 13895 13896 type ServicesServiceLevelObjectivesPatchCall struct { 13897 s *Service 13898 name string 13899 servicelevelobjective *ServiceLevelObjective 13900 urlParams_ gensupport.URLParams 13901 ctx_ context.Context 13902 header_ http.Header 13903 } 13904 13905 // Patch: Update the given ServiceLevelObjective. 13906 // 13907 // - name: Identifier. Resource name for this ServiceLevelObjective. The format 13908 // is: 13909 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjective 13910 // s/[SLO_NAME]. 13911 func (r *ServicesServiceLevelObjectivesService) Patch(name string, servicelevelobjective *ServiceLevelObjective) *ServicesServiceLevelObjectivesPatchCall { 13912 c := &ServicesServiceLevelObjectivesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13913 c.name = name 13914 c.servicelevelobjective = servicelevelobjective 13915 return c 13916 } 13917 13918 // UpdateMask sets the optional parameter "updateMask": A set of field paths 13919 // defining which fields to use for the update. 13920 func (c *ServicesServiceLevelObjectivesPatchCall) UpdateMask(updateMask string) *ServicesServiceLevelObjectivesPatchCall { 13921 c.urlParams_.Set("updateMask", updateMask) 13922 return c 13923 } 13924 13925 // Fields allows partial responses to be retrieved. See 13926 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 13927 // details. 13928 func (c *ServicesServiceLevelObjectivesPatchCall) Fields(s ...googleapi.Field) *ServicesServiceLevelObjectivesPatchCall { 13929 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13930 return c 13931 } 13932 13933 // Context sets the context to be used in this call's Do method. 13934 func (c *ServicesServiceLevelObjectivesPatchCall) Context(ctx context.Context) *ServicesServiceLevelObjectivesPatchCall { 13935 c.ctx_ = ctx 13936 return c 13937 } 13938 13939 // Header returns a http.Header that can be modified by the caller to add 13940 // headers to the request. 13941 func (c *ServicesServiceLevelObjectivesPatchCall) Header() http.Header { 13942 if c.header_ == nil { 13943 c.header_ = make(http.Header) 13944 } 13945 return c.header_ 13946 } 13947 13948 func (c *ServicesServiceLevelObjectivesPatchCall) doRequest(alt string) (*http.Response, error) { 13949 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 13950 var body io.Reader = nil 13951 body, err := googleapi.WithoutDataWrapper.JSONReader(c.servicelevelobjective) 13952 if err != nil { 13953 return nil, err 13954 } 13955 c.urlParams_.Set("alt", alt) 13956 c.urlParams_.Set("prettyPrint", "false") 13957 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/{+name}") 13958 urls += "?" + c.urlParams_.Encode() 13959 req, err := http.NewRequest("PATCH", urls, body) 13960 if err != nil { 13961 return nil, err 13962 } 13963 req.Header = reqHeaders 13964 googleapi.Expand(req.URL, map[string]string{ 13965 "name": c.name, 13966 }) 13967 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13968 } 13969 13970 // Do executes the "monitoring.services.serviceLevelObjectives.patch" call. 13971 // Any non-2xx status code is an error. Response headers are in either 13972 // *ServiceLevelObjective.ServerResponse.Header or (if a response was returned 13973 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13974 // check whether the returned error was because http.StatusNotModified was 13975 // returned. 13976 func (c *ServicesServiceLevelObjectivesPatchCall) Do(opts ...googleapi.CallOption) (*ServiceLevelObjective, error) { 13977 gensupport.SetOptions(c.urlParams_, opts...) 13978 res, err := c.doRequest("json") 13979 if res != nil && res.StatusCode == http.StatusNotModified { 13980 if res.Body != nil { 13981 res.Body.Close() 13982 } 13983 return nil, gensupport.WrapError(&googleapi.Error{ 13984 Code: res.StatusCode, 13985 Header: res.Header, 13986 }) 13987 } 13988 if err != nil { 13989 return nil, err 13990 } 13991 defer googleapi.CloseBody(res) 13992 if err := googleapi.CheckResponse(res); err != nil { 13993 return nil, gensupport.WrapError(err) 13994 } 13995 ret := &ServiceLevelObjective{ 13996 ServerResponse: googleapi.ServerResponse{ 13997 Header: res.Header, 13998 HTTPStatusCode: res.StatusCode, 13999 }, 14000 } 14001 target := &ret 14002 if err := gensupport.DecodeResponse(target, res); err != nil { 14003 return nil, err 14004 } 14005 return ret, nil 14006 } 14007 14008 type UptimeCheckIpsListCall struct { 14009 s *Service 14010 urlParams_ gensupport.URLParams 14011 ifNoneMatch_ string 14012 ctx_ context.Context 14013 header_ http.Header 14014 } 14015 14016 // List: Returns the list of IP addresses that checkers run from 14017 func (r *UptimeCheckIpsService) List() *UptimeCheckIpsListCall { 14018 c := &UptimeCheckIpsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14019 return c 14020 } 14021 14022 // PageSize sets the optional parameter "pageSize": The maximum number of 14023 // results to return in a single response. The server may further constrain the 14024 // maximum number of results returned in a single page. If the page_size is 14025 // <=0, the server will decide the number of results to be returned. NOTE: this 14026 // field is not yet implemented 14027 func (c *UptimeCheckIpsListCall) PageSize(pageSize int64) *UptimeCheckIpsListCall { 14028 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 14029 return c 14030 } 14031 14032 // PageToken sets the optional parameter "pageToken": If this field is not 14033 // empty then it must contain the nextPageToken value returned by a previous 14034 // call to this method. Using this field causes the method to return more 14035 // results from the previous method call. NOTE: this field is not yet 14036 // implemented 14037 func (c *UptimeCheckIpsListCall) PageToken(pageToken string) *UptimeCheckIpsListCall { 14038 c.urlParams_.Set("pageToken", pageToken) 14039 return c 14040 } 14041 14042 // Fields allows partial responses to be retrieved. See 14043 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 14044 // details. 14045 func (c *UptimeCheckIpsListCall) Fields(s ...googleapi.Field) *UptimeCheckIpsListCall { 14046 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14047 return c 14048 } 14049 14050 // IfNoneMatch sets an optional parameter which makes the operation fail if the 14051 // object's ETag matches the given value. This is useful for getting updates 14052 // only after the object has changed since the last request. 14053 func (c *UptimeCheckIpsListCall) IfNoneMatch(entityTag string) *UptimeCheckIpsListCall { 14054 c.ifNoneMatch_ = entityTag 14055 return c 14056 } 14057 14058 // Context sets the context to be used in this call's Do method. 14059 func (c *UptimeCheckIpsListCall) Context(ctx context.Context) *UptimeCheckIpsListCall { 14060 c.ctx_ = ctx 14061 return c 14062 } 14063 14064 // Header returns a http.Header that can be modified by the caller to add 14065 // headers to the request. 14066 func (c *UptimeCheckIpsListCall) Header() http.Header { 14067 if c.header_ == nil { 14068 c.header_ = make(http.Header) 14069 } 14070 return c.header_ 14071 } 14072 14073 func (c *UptimeCheckIpsListCall) doRequest(alt string) (*http.Response, error) { 14074 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 14075 if c.ifNoneMatch_ != "" { 14076 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14077 } 14078 var body io.Reader = nil 14079 c.urlParams_.Set("alt", alt) 14080 c.urlParams_.Set("prettyPrint", "false") 14081 urls := googleapi.ResolveRelative(c.s.BasePath, "v3/uptimeCheckIps") 14082 urls += "?" + c.urlParams_.Encode() 14083 req, err := http.NewRequest("GET", urls, body) 14084 if err != nil { 14085 return nil, err 14086 } 14087 req.Header = reqHeaders 14088 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14089 } 14090 14091 // Do executes the "monitoring.uptimeCheckIps.list" call. 14092 // Any non-2xx status code is an error. Response headers are in either 14093 // *ListUptimeCheckIpsResponse.ServerResponse.Header or (if a response was 14094 // returned at all) in error.(*googleapi.Error).Header. Use 14095 // googleapi.IsNotModified to check whether the returned error was because 14096 // http.StatusNotModified was returned. 14097 func (c *UptimeCheckIpsListCall) Do(opts ...googleapi.CallOption) (*ListUptimeCheckIpsResponse, error) { 14098 gensupport.SetOptions(c.urlParams_, opts...) 14099 res, err := c.doRequest("json") 14100 if res != nil && res.StatusCode == http.StatusNotModified { 14101 if res.Body != nil { 14102 res.Body.Close() 14103 } 14104 return nil, gensupport.WrapError(&googleapi.Error{ 14105 Code: res.StatusCode, 14106 Header: res.Header, 14107 }) 14108 } 14109 if err != nil { 14110 return nil, err 14111 } 14112 defer googleapi.CloseBody(res) 14113 if err := googleapi.CheckResponse(res); err != nil { 14114 return nil, gensupport.WrapError(err) 14115 } 14116 ret := &ListUptimeCheckIpsResponse{ 14117 ServerResponse: googleapi.ServerResponse{ 14118 Header: res.Header, 14119 HTTPStatusCode: res.StatusCode, 14120 }, 14121 } 14122 target := &ret 14123 if err := gensupport.DecodeResponse(target, res); err != nil { 14124 return nil, err 14125 } 14126 return ret, nil 14127 } 14128 14129 // Pages invokes f for each page of results. 14130 // A non-nil error returned from f will halt the iteration. 14131 // The provided context supersedes any context provided to the Context method. 14132 func (c *UptimeCheckIpsListCall) Pages(ctx context.Context, f func(*ListUptimeCheckIpsResponse) error) error { 14133 c.ctx_ = ctx 14134 defer c.PageToken(c.urlParams_.Get("pageToken")) 14135 for { 14136 x, err := c.Do() 14137 if err != nil { 14138 return err 14139 } 14140 if err := f(x); err != nil { 14141 return err 14142 } 14143 if x.NextPageToken == "" { 14144 return nil 14145 } 14146 c.PageToken(x.NextPageToken) 14147 } 14148 } 14149