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 language provides access to the Cloud Natural Language API. 8 // 9 // This package is DEPRECATED. Use package cloud.google.com/go/language/apiv1 instead. 10 // 11 // For product documentation, see: https://cloud.google.com/natural-language/ 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/language/v1beta2" 29 // ... 30 // ctx := context.Background() 31 // languageService, err := language.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 // languageService, err := language.NewService(ctx, option.WithScopes(language.CloudPlatformScope)) 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 // languageService, err := language.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 // languageService, err := language.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 56 // 57 // See [google.golang.org/api/option.ClientOption] for details on options. 58 package language // import "google.golang.org/api/language/v1beta2" 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 = "language:v1beta2" 97 const apiName = "language" 98 const apiVersion = "v1beta2" 99 const basePath = "https://language.googleapis.com/" 100 const basePathTemplate = "https://language.UNIVERSE_DOMAIN/" 101 const mtlsBasePath = "https://language.mtls.googleapis.com/" 102 103 // OAuth2 scopes used by this API. 104 const ( 105 // Apply machine learning models to reveal the structure and meaning of text 106 CloudLanguageScope = "https://www.googleapis.com/auth/cloud-language" 107 108 // See, edit, configure, and delete your Google Cloud data and see the email 109 // address for your Google Account. 110 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 111 ) 112 113 // NewService creates a new Service. 114 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 115 scopesOption := internaloption.WithDefaultScopes( 116 "https://www.googleapis.com/auth/cloud-language", 117 "https://www.googleapis.com/auth/cloud-platform", 118 ) 119 // NOTE: prepend, so we don't override user-specified scopes. 120 opts = append([]option.ClientOption{scopesOption}, opts...) 121 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 122 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 123 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 124 opts = append(opts, internaloption.EnableNewAuthLibrary()) 125 client, endpoint, err := htransport.NewClient(ctx, opts...) 126 if err != nil { 127 return nil, err 128 } 129 s, err := New(client) 130 if err != nil { 131 return nil, err 132 } 133 if endpoint != "" { 134 s.BasePath = endpoint 135 } 136 return s, nil 137 } 138 139 // New creates a new Service. It uses the provided http.Client for requests. 140 // 141 // Deprecated: please use NewService instead. 142 // To provide a custom HTTP client, use option.WithHTTPClient. 143 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 144 func New(client *http.Client) (*Service, error) { 145 if client == nil { 146 return nil, errors.New("client is nil") 147 } 148 s := &Service{client: client, BasePath: basePath} 149 s.Documents = NewDocumentsService(s) 150 return s, nil 151 } 152 153 type Service struct { 154 client *http.Client 155 BasePath string // API endpoint base URL 156 UserAgent string // optional additional User-Agent fragment 157 158 Documents *DocumentsService 159 } 160 161 func (s *Service) userAgent() string { 162 if s.UserAgent == "" { 163 return googleapi.UserAgent 164 } 165 return googleapi.UserAgent + " " + s.UserAgent 166 } 167 168 func NewDocumentsService(s *Service) *DocumentsService { 169 rs := &DocumentsService{s: s} 170 return rs 171 } 172 173 type DocumentsService struct { 174 s *Service 175 } 176 177 // AnalyzeEntitiesRequest: The entity analysis request message. 178 type AnalyzeEntitiesRequest struct { 179 // Document: Required. Input document. 180 Document *Document `json:"document,omitempty"` 181 // EncodingType: The encoding type used by the API to calculate offsets. 182 // 183 // Possible values: 184 // "NONE" - If `EncodingType` is not specified, encoding-dependent 185 // information (such as `begin_offset`) will be set at `-1`. 186 // "UTF8" - Encoding-dependent information (such as `begin_offset`) is 187 // calculated based on the UTF-8 encoding of the input. C++ and Go are examples 188 // of languages that use this encoding natively. 189 // "UTF16" - Encoding-dependent information (such as `begin_offset`) is 190 // calculated based on the UTF-16 encoding of the input. Java and JavaScript 191 // are examples of languages that use this encoding natively. 192 // "UTF32" - Encoding-dependent information (such as `begin_offset`) is 193 // calculated based on the UTF-32 encoding of the input. Python is an example 194 // of a language that uses this encoding natively. 195 EncodingType string `json:"encodingType,omitempty"` 196 // ForceSendFields is a list of field names (e.g. "Document") to 197 // unconditionally include in API requests. By default, fields with empty or 198 // default values are omitted from API requests. See 199 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 200 // details. 201 ForceSendFields []string `json:"-"` 202 // NullFields is a list of field names (e.g. "Document") to include in API 203 // requests with the JSON null value. By default, fields with empty values are 204 // omitted from API requests. See 205 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 206 NullFields []string `json:"-"` 207 } 208 209 func (s *AnalyzeEntitiesRequest) MarshalJSON() ([]byte, error) { 210 type NoMethod AnalyzeEntitiesRequest 211 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 212 } 213 214 // AnalyzeEntitiesResponse: The entity analysis response message. 215 type AnalyzeEntitiesResponse struct { 216 // Entities: The recognized entities in the input document. 217 Entities []*Entity `json:"entities,omitempty"` 218 // Language: The language of the text, which will be the same as the language 219 // specified in the request or, if not specified, the automatically-detected 220 // language. See Document.language field for more details. 221 Language string `json:"language,omitempty"` 222 223 // ServerResponse contains the HTTP response code and headers from the server. 224 googleapi.ServerResponse `json:"-"` 225 // ForceSendFields is a list of field names (e.g. "Entities") to 226 // unconditionally include in API requests. By default, fields with empty or 227 // default values are omitted from API requests. See 228 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 229 // details. 230 ForceSendFields []string `json:"-"` 231 // NullFields is a list of field names (e.g. "Entities") to include in API 232 // requests with the JSON null value. By default, fields with empty values are 233 // omitted from API requests. See 234 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 235 NullFields []string `json:"-"` 236 } 237 238 func (s *AnalyzeEntitiesResponse) MarshalJSON() ([]byte, error) { 239 type NoMethod AnalyzeEntitiesResponse 240 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 241 } 242 243 // AnalyzeEntitySentimentRequest: The entity-level sentiment analysis request 244 // message. 245 type AnalyzeEntitySentimentRequest struct { 246 // Document: Required. Input document. 247 Document *Document `json:"document,omitempty"` 248 // EncodingType: The encoding type used by the API to calculate offsets. 249 // 250 // Possible values: 251 // "NONE" - If `EncodingType` is not specified, encoding-dependent 252 // information (such as `begin_offset`) will be set at `-1`. 253 // "UTF8" - Encoding-dependent information (such as `begin_offset`) is 254 // calculated based on the UTF-8 encoding of the input. C++ and Go are examples 255 // of languages that use this encoding natively. 256 // "UTF16" - Encoding-dependent information (such as `begin_offset`) is 257 // calculated based on the UTF-16 encoding of the input. Java and JavaScript 258 // are examples of languages that use this encoding natively. 259 // "UTF32" - Encoding-dependent information (such as `begin_offset`) is 260 // calculated based on the UTF-32 encoding of the input. Python is an example 261 // of a language that uses this encoding natively. 262 EncodingType string `json:"encodingType,omitempty"` 263 // ForceSendFields is a list of field names (e.g. "Document") to 264 // unconditionally include in API requests. By default, fields with empty or 265 // default values are omitted from API requests. See 266 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 267 // details. 268 ForceSendFields []string `json:"-"` 269 // NullFields is a list of field names (e.g. "Document") to include in API 270 // requests with the JSON null value. By default, fields with empty values are 271 // omitted from API requests. See 272 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 273 NullFields []string `json:"-"` 274 } 275 276 func (s *AnalyzeEntitySentimentRequest) MarshalJSON() ([]byte, error) { 277 type NoMethod AnalyzeEntitySentimentRequest 278 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 279 } 280 281 // AnalyzeEntitySentimentResponse: The entity-level sentiment analysis response 282 // message. 283 type AnalyzeEntitySentimentResponse struct { 284 // Entities: The recognized entities in the input document with associated 285 // sentiments. 286 Entities []*Entity `json:"entities,omitempty"` 287 // Language: The language of the text, which will be the same as the language 288 // specified in the request or, if not specified, the automatically-detected 289 // language. See Document.language field for more details. 290 Language string `json:"language,omitempty"` 291 292 // ServerResponse contains the HTTP response code and headers from the server. 293 googleapi.ServerResponse `json:"-"` 294 // ForceSendFields is a list of field names (e.g. "Entities") to 295 // unconditionally include in API requests. By default, fields with empty or 296 // default values are omitted from API requests. See 297 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 298 // details. 299 ForceSendFields []string `json:"-"` 300 // NullFields is a list of field names (e.g. "Entities") to include in API 301 // requests with the JSON null value. By default, fields with empty values are 302 // omitted from API requests. See 303 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 304 NullFields []string `json:"-"` 305 } 306 307 func (s *AnalyzeEntitySentimentResponse) MarshalJSON() ([]byte, error) { 308 type NoMethod AnalyzeEntitySentimentResponse 309 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 310 } 311 312 // AnalyzeSentimentRequest: The sentiment analysis request message. 313 type AnalyzeSentimentRequest struct { 314 // Document: Required. Input document. 315 Document *Document `json:"document,omitempty"` 316 // EncodingType: The encoding type used by the API to calculate sentence 317 // offsets for the sentence sentiment. 318 // 319 // Possible values: 320 // "NONE" - If `EncodingType` is not specified, encoding-dependent 321 // information (such as `begin_offset`) will be set at `-1`. 322 // "UTF8" - Encoding-dependent information (such as `begin_offset`) is 323 // calculated based on the UTF-8 encoding of the input. C++ and Go are examples 324 // of languages that use this encoding natively. 325 // "UTF16" - Encoding-dependent information (such as `begin_offset`) is 326 // calculated based on the UTF-16 encoding of the input. Java and JavaScript 327 // are examples of languages that use this encoding natively. 328 // "UTF32" - Encoding-dependent information (such as `begin_offset`) is 329 // calculated based on the UTF-32 encoding of the input. Python is an example 330 // of a language that uses this encoding natively. 331 EncodingType string `json:"encodingType,omitempty"` 332 // ForceSendFields is a list of field names (e.g. "Document") to 333 // unconditionally include in API requests. By default, fields with empty or 334 // default values are omitted from API requests. See 335 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 336 // details. 337 ForceSendFields []string `json:"-"` 338 // NullFields is a list of field names (e.g. "Document") to include in API 339 // requests with the JSON null value. By default, fields with empty values are 340 // omitted from API requests. See 341 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 342 NullFields []string `json:"-"` 343 } 344 345 func (s *AnalyzeSentimentRequest) MarshalJSON() ([]byte, error) { 346 type NoMethod AnalyzeSentimentRequest 347 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 348 } 349 350 // AnalyzeSentimentResponse: The sentiment analysis response message. 351 type AnalyzeSentimentResponse struct { 352 // DocumentSentiment: The overall sentiment of the input document. 353 DocumentSentiment *Sentiment `json:"documentSentiment,omitempty"` 354 // Language: The language of the text, which will be the same as the language 355 // specified in the request or, if not specified, the automatically-detected 356 // language. See Document.language field for more details. 357 Language string `json:"language,omitempty"` 358 // Sentences: The sentiment for all the sentences in the document. 359 Sentences []*Sentence `json:"sentences,omitempty"` 360 361 // ServerResponse contains the HTTP response code and headers from the server. 362 googleapi.ServerResponse `json:"-"` 363 // ForceSendFields is a list of field names (e.g. "DocumentSentiment") to 364 // unconditionally include in API requests. By default, fields with empty or 365 // default values are omitted from API requests. See 366 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 367 // details. 368 ForceSendFields []string `json:"-"` 369 // NullFields is a list of field names (e.g. "DocumentSentiment") to include in 370 // API requests with the JSON null value. By default, fields with empty values 371 // are omitted from API requests. See 372 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 373 NullFields []string `json:"-"` 374 } 375 376 func (s *AnalyzeSentimentResponse) MarshalJSON() ([]byte, error) { 377 type NoMethod AnalyzeSentimentResponse 378 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 379 } 380 381 // AnalyzeSyntaxRequest: The syntax analysis request message. 382 type AnalyzeSyntaxRequest struct { 383 // Document: Required. Input document. 384 Document *Document `json:"document,omitempty"` 385 // EncodingType: The encoding type used by the API to calculate offsets. 386 // 387 // Possible values: 388 // "NONE" - If `EncodingType` is not specified, encoding-dependent 389 // information (such as `begin_offset`) will be set at `-1`. 390 // "UTF8" - Encoding-dependent information (such as `begin_offset`) is 391 // calculated based on the UTF-8 encoding of the input. C++ and Go are examples 392 // of languages that use this encoding natively. 393 // "UTF16" - Encoding-dependent information (such as `begin_offset`) is 394 // calculated based on the UTF-16 encoding of the input. Java and JavaScript 395 // are examples of languages that use this encoding natively. 396 // "UTF32" - Encoding-dependent information (such as `begin_offset`) is 397 // calculated based on the UTF-32 encoding of the input. Python is an example 398 // of a language that uses this encoding natively. 399 EncodingType string `json:"encodingType,omitempty"` 400 // ForceSendFields is a list of field names (e.g. "Document") to 401 // unconditionally include in API requests. By default, fields with empty or 402 // default values are omitted from API requests. See 403 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 404 // details. 405 ForceSendFields []string `json:"-"` 406 // NullFields is a list of field names (e.g. "Document") to include in API 407 // requests with the JSON null value. By default, fields with empty values are 408 // omitted from API requests. See 409 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 410 NullFields []string `json:"-"` 411 } 412 413 func (s *AnalyzeSyntaxRequest) MarshalJSON() ([]byte, error) { 414 type NoMethod AnalyzeSyntaxRequest 415 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 416 } 417 418 // AnalyzeSyntaxResponse: The syntax analysis response message. 419 type AnalyzeSyntaxResponse struct { 420 // Language: The language of the text, which will be the same as the language 421 // specified in the request or, if not specified, the automatically-detected 422 // language. See Document.language field for more details. 423 Language string `json:"language,omitempty"` 424 // Sentences: Sentences in the input document. 425 Sentences []*Sentence `json:"sentences,omitempty"` 426 // Tokens: Tokens, along with their syntactic information, in the input 427 // document. 428 Tokens []*Token `json:"tokens,omitempty"` 429 430 // ServerResponse contains the HTTP response code and headers from the server. 431 googleapi.ServerResponse `json:"-"` 432 // ForceSendFields is a list of field names (e.g. "Language") to 433 // unconditionally include in API requests. By default, fields with empty or 434 // default values are omitted from API requests. See 435 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 436 // details. 437 ForceSendFields []string `json:"-"` 438 // NullFields is a list of field names (e.g. "Language") to include in API 439 // requests with the JSON null value. By default, fields with empty values are 440 // omitted from API requests. See 441 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 442 NullFields []string `json:"-"` 443 } 444 445 func (s *AnalyzeSyntaxResponse) MarshalJSON() ([]byte, error) { 446 type NoMethod AnalyzeSyntaxResponse 447 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 448 } 449 450 // AnnotateTextRequest: The request message for the text annotation API, which 451 // can perform multiple analysis types (sentiment, entities, and syntax) in one 452 // call. 453 type AnnotateTextRequest struct { 454 // Document: Required. Input document. 455 Document *Document `json:"document,omitempty"` 456 // EncodingType: The encoding type used by the API to calculate offsets. 457 // 458 // Possible values: 459 // "NONE" - If `EncodingType` is not specified, encoding-dependent 460 // information (such as `begin_offset`) will be set at `-1`. 461 // "UTF8" - Encoding-dependent information (such as `begin_offset`) is 462 // calculated based on the UTF-8 encoding of the input. C++ and Go are examples 463 // of languages that use this encoding natively. 464 // "UTF16" - Encoding-dependent information (such as `begin_offset`) is 465 // calculated based on the UTF-16 encoding of the input. Java and JavaScript 466 // are examples of languages that use this encoding natively. 467 // "UTF32" - Encoding-dependent information (such as `begin_offset`) is 468 // calculated based on the UTF-32 encoding of the input. Python is an example 469 // of a language that uses this encoding natively. 470 EncodingType string `json:"encodingType,omitempty"` 471 // Features: Required. The enabled features. 472 Features *AnnotateTextRequestFeatures `json:"features,omitempty"` 473 // ForceSendFields is a list of field names (e.g. "Document") to 474 // unconditionally include in API requests. By default, fields with empty or 475 // default values are omitted from API requests. See 476 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 477 // details. 478 ForceSendFields []string `json:"-"` 479 // NullFields is a list of field names (e.g. "Document") to include in API 480 // requests with the JSON null value. By default, fields with empty values are 481 // omitted from API requests. See 482 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 483 NullFields []string `json:"-"` 484 } 485 486 func (s *AnnotateTextRequest) MarshalJSON() ([]byte, error) { 487 type NoMethod AnnotateTextRequest 488 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 489 } 490 491 // AnnotateTextRequestFeatures: All available features for sentiment, syntax, 492 // and semantic analysis. Setting each one to true will enable that specific 493 // analysis for the input. Next ID: 12 494 type AnnotateTextRequestFeatures struct { 495 // ClassificationModelOptions: Optional. The model options to use for 496 // classification. Defaults to v1 options if not specified. Only used if 497 // `classify_text` is set to true. 498 ClassificationModelOptions *ClassificationModelOptions `json:"classificationModelOptions,omitempty"` 499 // ClassifyText: Classify the full document into categories. If this is true, 500 // the API will use the default model which classifies into a predefined 501 // taxonomy (https://cloud.google.com/natural-language/docs/categories). 502 ClassifyText bool `json:"classifyText,omitempty"` 503 // ExtractDocumentSentiment: Extract document-level sentiment. 504 ExtractDocumentSentiment bool `json:"extractDocumentSentiment,omitempty"` 505 // ExtractEntities: Extract entities. 506 ExtractEntities bool `json:"extractEntities,omitempty"` 507 // ExtractEntitySentiment: Extract entities and their associated sentiment. 508 ExtractEntitySentiment bool `json:"extractEntitySentiment,omitempty"` 509 // ExtractSyntax: Extract syntax information. 510 ExtractSyntax bool `json:"extractSyntax,omitempty"` 511 // ModerateText: Moderate the document for harmful and sensitive categories. 512 ModerateText bool `json:"moderateText,omitempty"` 513 // ForceSendFields is a list of field names (e.g. "ClassificationModelOptions") 514 // to unconditionally include in API requests. By default, fields with empty or 515 // default values are omitted from API requests. See 516 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 517 // details. 518 ForceSendFields []string `json:"-"` 519 // NullFields is a list of field names (e.g. "ClassificationModelOptions") to 520 // include in API requests with the JSON null value. By default, fields with 521 // empty values are omitted from API requests. See 522 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 523 NullFields []string `json:"-"` 524 } 525 526 func (s *AnnotateTextRequestFeatures) MarshalJSON() ([]byte, error) { 527 type NoMethod AnnotateTextRequestFeatures 528 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 529 } 530 531 // AnnotateTextResponse: The text annotations response message. 532 type AnnotateTextResponse struct { 533 // Categories: Categories identified in the input document. 534 Categories []*ClassificationCategory `json:"categories,omitempty"` 535 // DocumentSentiment: The overall sentiment for the document. Populated if the 536 // user enables AnnotateTextRequest.Features.extract_document_sentiment. 537 DocumentSentiment *Sentiment `json:"documentSentiment,omitempty"` 538 // Entities: Entities, along with their semantic information, in the input 539 // document. Populated if the user enables 540 // AnnotateTextRequest.Features.extract_entities. 541 Entities []*Entity `json:"entities,omitempty"` 542 // Language: The language of the text, which will be the same as the language 543 // specified in the request or, if not specified, the automatically-detected 544 // language. See Document.language field for more details. 545 Language string `json:"language,omitempty"` 546 // ModerationCategories: Harmful and sensitive categories identified in the 547 // input document. 548 ModerationCategories []*ClassificationCategory `json:"moderationCategories,omitempty"` 549 // Sentences: Sentences in the input document. Populated if the user enables 550 // AnnotateTextRequest.Features.extract_syntax. 551 Sentences []*Sentence `json:"sentences,omitempty"` 552 // Tokens: Tokens, along with their syntactic information, in the input 553 // document. Populated if the user enables 554 // AnnotateTextRequest.Features.extract_syntax. 555 Tokens []*Token `json:"tokens,omitempty"` 556 557 // ServerResponse contains the HTTP response code and headers from the server. 558 googleapi.ServerResponse `json:"-"` 559 // ForceSendFields is a list of field names (e.g. "Categories") to 560 // unconditionally include in API requests. By default, fields with empty or 561 // default values are omitted from API requests. See 562 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 563 // details. 564 ForceSendFields []string `json:"-"` 565 // NullFields is a list of field names (e.g. "Categories") to include in API 566 // requests with the JSON null value. By default, fields with empty values are 567 // omitted from API requests. See 568 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 569 NullFields []string `json:"-"` 570 } 571 572 func (s *AnnotateTextResponse) MarshalJSON() ([]byte, error) { 573 type NoMethod AnnotateTextResponse 574 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 575 } 576 577 // ClassificationCategory: Represents a category returned from the text 578 // classifier. 579 type ClassificationCategory struct { 580 // Confidence: The classifier's confidence of the category. Number represents 581 // how certain the classifier is that this category represents the given text. 582 Confidence float64 `json:"confidence,omitempty"` 583 // Name: The name of the category representing the document. 584 Name string `json:"name,omitempty"` 585 // ForceSendFields is a list of field names (e.g. "Confidence") to 586 // unconditionally include in API requests. By default, fields with empty or 587 // default values are omitted from API requests. See 588 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 589 // details. 590 ForceSendFields []string `json:"-"` 591 // NullFields is a list of field names (e.g. "Confidence") to include in API 592 // requests with the JSON null value. By default, fields with empty values are 593 // omitted from API requests. See 594 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 595 NullFields []string `json:"-"` 596 } 597 598 func (s *ClassificationCategory) MarshalJSON() ([]byte, error) { 599 type NoMethod ClassificationCategory 600 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 601 } 602 603 func (s *ClassificationCategory) UnmarshalJSON(data []byte) error { 604 type NoMethod ClassificationCategory 605 var s1 struct { 606 Confidence gensupport.JSONFloat64 `json:"confidence"` 607 *NoMethod 608 } 609 s1.NoMethod = (*NoMethod)(s) 610 if err := json.Unmarshal(data, &s1); err != nil { 611 return err 612 } 613 s.Confidence = float64(s1.Confidence) 614 return nil 615 } 616 617 // ClassificationModelOptions: Model options available for classification 618 // requests. 619 type ClassificationModelOptions struct { 620 // V1Model: Setting this field will use the V1 model and V1 content categories 621 // version. The V1 model is a legacy model; support for this will be 622 // discontinued in the future. 623 V1Model *ClassificationModelOptionsV1Model `json:"v1Model,omitempty"` 624 // V2Model: Setting this field will use the V2 model with the appropriate 625 // content categories version. The V2 model is a better performing model. 626 V2Model *ClassificationModelOptionsV2Model `json:"v2Model,omitempty"` 627 // ForceSendFields is a list of field names (e.g. "V1Model") to unconditionally 628 // include in API requests. By default, fields with empty or default values are 629 // omitted from API requests. See 630 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 631 // details. 632 ForceSendFields []string `json:"-"` 633 // NullFields is a list of field names (e.g. "V1Model") to include in API 634 // requests with the JSON null value. By default, fields with empty values are 635 // omitted from API requests. See 636 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 637 NullFields []string `json:"-"` 638 } 639 640 func (s *ClassificationModelOptions) MarshalJSON() ([]byte, error) { 641 type NoMethod ClassificationModelOptions 642 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 643 } 644 645 // ClassificationModelOptionsV1Model: Options for the V1 model. 646 type ClassificationModelOptionsV1Model struct { 647 } 648 649 // ClassificationModelOptionsV2Model: Options for the V2 model. 650 type ClassificationModelOptionsV2Model struct { 651 // ContentCategoriesVersion: The content categories used for classification. 652 // 653 // Possible values: 654 // "CONTENT_CATEGORIES_VERSION_UNSPECIFIED" - If `ContentCategoriesVersion` 655 // is not specified, this option will default to `V1`. 656 // "V1" - Legacy content categories of our initial launch in 2017. 657 // "V2" - Updated content categories in 2022. 658 ContentCategoriesVersion string `json:"contentCategoriesVersion,omitempty"` 659 // ForceSendFields is a list of field names (e.g. "ContentCategoriesVersion") 660 // to unconditionally include in API requests. By default, fields with empty or 661 // default values are omitted from API requests. See 662 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 663 // details. 664 ForceSendFields []string `json:"-"` 665 // NullFields is a list of field names (e.g. "ContentCategoriesVersion") to 666 // include in API requests with the JSON null value. By default, fields with 667 // empty values are omitted from API requests. See 668 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 669 NullFields []string `json:"-"` 670 } 671 672 func (s *ClassificationModelOptionsV2Model) MarshalJSON() ([]byte, error) { 673 type NoMethod ClassificationModelOptionsV2Model 674 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 675 } 676 677 // ClassifyTextRequest: The document classification request message. 678 type ClassifyTextRequest struct { 679 // ClassificationModelOptions: Optional. Model options to use for 680 // classification. Defaults to v1 options if not specified. 681 ClassificationModelOptions *ClassificationModelOptions `json:"classificationModelOptions,omitempty"` 682 // Document: Required. Input document. 683 Document *Document `json:"document,omitempty"` 684 // ForceSendFields is a list of field names (e.g. "ClassificationModelOptions") 685 // to unconditionally include in API requests. By default, fields with empty or 686 // default values are omitted from API requests. See 687 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 688 // details. 689 ForceSendFields []string `json:"-"` 690 // NullFields is a list of field names (e.g. "ClassificationModelOptions") to 691 // include in API requests with the JSON null value. By default, fields with 692 // empty values are omitted from API requests. See 693 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 694 NullFields []string `json:"-"` 695 } 696 697 func (s *ClassifyTextRequest) MarshalJSON() ([]byte, error) { 698 type NoMethod ClassifyTextRequest 699 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 700 } 701 702 // ClassifyTextResponse: The document classification response message. 703 type ClassifyTextResponse struct { 704 // Categories: Categories representing the input document. 705 Categories []*ClassificationCategory `json:"categories,omitempty"` 706 707 // ServerResponse contains the HTTP response code and headers from the server. 708 googleapi.ServerResponse `json:"-"` 709 // ForceSendFields is a list of field names (e.g. "Categories") to 710 // unconditionally include in API requests. By default, fields with empty or 711 // default values are omitted from API requests. See 712 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 713 // details. 714 ForceSendFields []string `json:"-"` 715 // NullFields is a list of field names (e.g. "Categories") to include in API 716 // requests with the JSON null value. By default, fields with empty values are 717 // omitted from API requests. See 718 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 719 NullFields []string `json:"-"` 720 } 721 722 func (s *ClassifyTextResponse) MarshalJSON() ([]byte, error) { 723 type NoMethod ClassifyTextResponse 724 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 725 } 726 727 // Color: Represents a color in the RGBA color space. This representation is 728 // designed for simplicity of conversion to and from color representations in 729 // various languages over compactness. For example, the fields of this 730 // representation can be trivially provided to the constructor of 731 // `java.awt.Color` in Java; it can also be trivially provided to UIColor's 732 // `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little 733 // work, it can be easily formatted into a CSS `rgba()` string in JavaScript. 734 // This reference page doesn't have information about the absolute color space 735 // that should be used to interpret the RGB value—for example, sRGB, Adobe 736 // RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB 737 // color space. When color equality needs to be decided, implementations, 738 // unless documented otherwise, treat two colors as equal if all their red, 739 // green, blue, and alpha values each differ by at most `1e-5`. Example (Java): 740 // import com.google.type.Color; // ... public static java.awt.Color 741 // fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? 742 // protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( 743 // protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } 744 // public static Color toProto(java.awt.Color color) { float red = (float) 745 // color.getRed(); float green = (float) color.getGreen(); float blue = (float) 746 // color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = 747 // Color .newBuilder() .setRed(red / denominator) .setGreen(green / 748 // denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if 749 // (alpha != 255) { result.setAlpha( FloatValue .newBuilder() 750 // .setValue(((float) alpha) / denominator) .build()); } return 751 // resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static 752 // UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float 753 // green = [protocolor green]; float blue = [protocolor blue]; FloatValue* 754 // alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != 755 // nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red 756 // green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) 757 // { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green 758 // blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] 759 // init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; 760 // if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } 761 // [result autorelease]; return result; } // ... Example (JavaScript): // ... 762 // var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 763 // 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue 764 // || 0.0; var red = Math.floor(redFrac * 255); var green = 765 // Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if 766 // (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var 767 // alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, 768 // blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(”); 769 // }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new 770 // Number((red << 16) | (green << 8) | blue); var hexString = 771 // rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var 772 // resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { 773 // resultBuilder.push('0'); } resultBuilder.push(hexString); return 774 // resultBuilder.join(”); }; // ... 775 type Color struct { 776 // Alpha: The fraction of this color that should be applied to the pixel. That 777 // is, the final pixel color is defined by the equation: `pixel color = alpha * 778 // (this color) + (1.0 - alpha) * (background color)` This means that a value 779 // of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a 780 // completely transparent color. This uses a wrapper message rather than a 781 // simple float scalar so that it is possible to distinguish between a default 782 // value and the value being unset. If omitted, this color object is rendered 783 // as a solid color (as if the alpha value had been explicitly given a value of 784 // 1.0). 785 Alpha float64 `json:"alpha,omitempty"` 786 // Blue: The amount of blue in the color as a value in the interval [0, 1]. 787 Blue float64 `json:"blue,omitempty"` 788 // Green: The amount of green in the color as a value in the interval [0, 1]. 789 Green float64 `json:"green,omitempty"` 790 // Red: The amount of red in the color as a value in the interval [0, 1]. 791 Red float64 `json:"red,omitempty"` 792 // ForceSendFields is a list of field names (e.g. "Alpha") to unconditionally 793 // include in API requests. By default, fields with empty or default values are 794 // omitted from API requests. See 795 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 796 // details. 797 ForceSendFields []string `json:"-"` 798 // NullFields is a list of field names (e.g. "Alpha") to include in API 799 // requests with the JSON null value. By default, fields with empty values are 800 // omitted from API requests. See 801 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 802 NullFields []string `json:"-"` 803 } 804 805 func (s *Color) MarshalJSON() ([]byte, error) { 806 type NoMethod Color 807 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 808 } 809 810 func (s *Color) UnmarshalJSON(data []byte) error { 811 type NoMethod Color 812 var s1 struct { 813 Alpha gensupport.JSONFloat64 `json:"alpha"` 814 Blue gensupport.JSONFloat64 `json:"blue"` 815 Green gensupport.JSONFloat64 `json:"green"` 816 Red gensupport.JSONFloat64 `json:"red"` 817 *NoMethod 818 } 819 s1.NoMethod = (*NoMethod)(s) 820 if err := json.Unmarshal(data, &s1); err != nil { 821 return err 822 } 823 s.Alpha = float64(s1.Alpha) 824 s.Blue = float64(s1.Blue) 825 s.Green = float64(s1.Green) 826 s.Red = float64(s1.Red) 827 return nil 828 } 829 830 // CpuMetric: Metric for billing reports. 831 type CpuMetric struct { 832 // CoreNumber: Required. Number of CPU cores. 833 CoreNumber int64 `json:"coreNumber,omitempty,string"` 834 // CoreSec: Required. Total seconds of core usage, e.g. 4. 835 CoreSec int64 `json:"coreSec,omitempty,string"` 836 // CpuType: Required. Type of cpu, e.g. N2. 837 // 838 // Possible values: 839 // "UNKNOWN_CPU_TYPE" 840 // "A2" - GPU-based machine, skip quota reporting. 841 // "A3" - GPU-based machine, skip quota reporting. 842 // "C2" - COMPUTE_OPTIMIZED 843 // "C2D" 844 // "CUSTOM" 845 // "E2" 846 // "G2" - GPU-based machine, skip quota reporting. 847 // "C3" 848 // "M2" - MEMORY_OPTIMIZED_UPGRADE_PREMIUM 849 // "M1" - MEMORY_OPTIMIZED 850 // "N1" 851 // "N2_CUSTOM" 852 // "N2" 853 // "N2D" 854 CpuType string `json:"cpuType,omitempty"` 855 // MachineSpec: Required. Machine spec, e.g. N1_STANDARD_4. 856 // 857 // Possible values: 858 // "UNKNOWN_MACHINE_SPEC" 859 // "N1_STANDARD_2" 860 // "N1_STANDARD_4" 861 // "N1_STANDARD_8" 862 // "N1_STANDARD_16" 863 // "N1_STANDARD_32" 864 // "N1_STANDARD_64" 865 // "N1_STANDARD_96" 866 // "N1_HIGHMEM_2" 867 // "N1_HIGHMEM_4" 868 // "N1_HIGHMEM_8" 869 // "N1_HIGHMEM_16" 870 // "N1_HIGHMEM_32" 871 // "N1_HIGHMEM_64" 872 // "N1_HIGHMEM_96" 873 // "N1_HIGHCPU_2" 874 // "N1_HIGHCPU_4" 875 // "N1_HIGHCPU_8" 876 // "N1_HIGHCPU_16" 877 // "N1_HIGHCPU_32" 878 // "N1_HIGHCPU_64" 879 // "N1_HIGHCPU_96" 880 // "A2_HIGHGPU_1G" 881 // "A2_HIGHGPU_2G" 882 // "A2_HIGHGPU_4G" 883 // "A2_HIGHGPU_8G" 884 // "A2_MEGAGPU_16G" 885 // "A2_ULTRAGPU_1G" 886 // "A2_ULTRAGPU_2G" 887 // "A2_ULTRAGPU_4G" 888 // "A2_ULTRAGPU_8G" 889 // "A3_HIGHGPU_8G" 890 // "E2_STANDARD_2" 891 // "E2_STANDARD_4" 892 // "E2_STANDARD_8" 893 // "E2_STANDARD_16" 894 // "E2_STANDARD_32" 895 // "E2_HIGHMEM_2" 896 // "E2_HIGHMEM_4" 897 // "E2_HIGHMEM_8" 898 // "E2_HIGHMEM_16" 899 // "E2_HIGHCPU_2" 900 // "E2_HIGHCPU_4" 901 // "E2_HIGHCPU_8" 902 // "E2_HIGHCPU_16" 903 // "E2_HIGHCPU_32" 904 // "N2_STANDARD_2" 905 // "N2_STANDARD_4" 906 // "N2_STANDARD_8" 907 // "N2_STANDARD_16" 908 // "N2_STANDARD_32" 909 // "N2_STANDARD_48" 910 // "N2_STANDARD_64" 911 // "N2_STANDARD_80" 912 // "N2_STANDARD_96" 913 // "N2_STANDARD_128" 914 // "N2_HIGHMEM_2" 915 // "N2_HIGHMEM_4" 916 // "N2_HIGHMEM_8" 917 // "N2_HIGHMEM_16" 918 // "N2_HIGHMEM_32" 919 // "N2_HIGHMEM_48" 920 // "N2_HIGHMEM_64" 921 // "N2_HIGHMEM_80" 922 // "N2_HIGHMEM_96" 923 // "N2_HIGHMEM_128" 924 // "N2_HIGHCPU_2" 925 // "N2_HIGHCPU_4" 926 // "N2_HIGHCPU_8" 927 // "N2_HIGHCPU_16" 928 // "N2_HIGHCPU_32" 929 // "N2_HIGHCPU_48" 930 // "N2_HIGHCPU_64" 931 // "N2_HIGHCPU_80" 932 // "N2_HIGHCPU_96" 933 // "N2D_STANDARD_2" 934 // "N2D_STANDARD_4" 935 // "N2D_STANDARD_8" 936 // "N2D_STANDARD_16" 937 // "N2D_STANDARD_32" 938 // "N2D_STANDARD_48" 939 // "N2D_STANDARD_64" 940 // "N2D_STANDARD_80" 941 // "N2D_STANDARD_96" 942 // "N2D_STANDARD_128" 943 // "N2D_STANDARD_224" 944 // "N2D_HIGHMEM_2" 945 // "N2D_HIGHMEM_4" 946 // "N2D_HIGHMEM_8" 947 // "N2D_HIGHMEM_16" 948 // "N2D_HIGHMEM_32" 949 // "N2D_HIGHMEM_48" 950 // "N2D_HIGHMEM_64" 951 // "N2D_HIGHMEM_80" 952 // "N2D_HIGHMEM_96" 953 // "N2D_HIGHCPU_2" 954 // "N2D_HIGHCPU_4" 955 // "N2D_HIGHCPU_8" 956 // "N2D_HIGHCPU_16" 957 // "N2D_HIGHCPU_32" 958 // "N2D_HIGHCPU_48" 959 // "N2D_HIGHCPU_64" 960 // "N2D_HIGHCPU_80" 961 // "N2D_HIGHCPU_96" 962 // "N2D_HIGHCPU_128" 963 // "N2D_HIGHCPU_224" 964 // "C2_STANDARD_4" 965 // "C2_STANDARD_8" 966 // "C2_STANDARD_16" 967 // "C2_STANDARD_30" 968 // "C2_STANDARD_60" 969 // "C2D_STANDARD_2" 970 // "C2D_STANDARD_4" 971 // "C2D_STANDARD_8" 972 // "C2D_STANDARD_16" 973 // "C2D_STANDARD_32" 974 // "C2D_STANDARD_56" 975 // "C2D_STANDARD_112" 976 // "C2D_HIGHCPU_2" 977 // "C2D_HIGHCPU_4" 978 // "C2D_HIGHCPU_8" 979 // "C2D_HIGHCPU_16" 980 // "C2D_HIGHCPU_32" 981 // "C2D_HIGHCPU_56" 982 // "C2D_HIGHCPU_112" 983 // "C2D_HIGHMEM_2" 984 // "C2D_HIGHMEM_4" 985 // "C2D_HIGHMEM_8" 986 // "C2D_HIGHMEM_16" 987 // "C2D_HIGHMEM_32" 988 // "C2D_HIGHMEM_56" 989 // "C2D_HIGHMEM_112" 990 // "G2_STANDARD_4" 991 // "G2_STANDARD_8" 992 // "G2_STANDARD_12" 993 // "G2_STANDARD_16" 994 // "G2_STANDARD_24" 995 // "G2_STANDARD_32" 996 // "G2_STANDARD_48" 997 // "G2_STANDARD_96" 998 // "C3_STANDARD_4" 999 // "C3_STANDARD_8" 1000 // "C3_STANDARD_22" 1001 // "C3_STANDARD_44" 1002 // "C3_STANDARD_88" 1003 // "C3_STANDARD_176" 1004 // "C3_HIGHCPU_4" 1005 // "C3_HIGHCPU_8" 1006 // "C3_HIGHCPU_22" 1007 // "C3_HIGHCPU_44" 1008 // "C3_HIGHCPU_88" 1009 // "C3_HIGHCPU_176" 1010 // "C3_HIGHMEM_4" 1011 // "C3_HIGHMEM_8" 1012 // "C3_HIGHMEM_22" 1013 // "C3_HIGHMEM_44" 1014 // "C3_HIGHMEM_88" 1015 // "C3_HIGHMEM_176" 1016 MachineSpec string `json:"machineSpec,omitempty"` 1017 // TrackingLabels: Billing tracking labels. They do not contain any user data 1018 // but only the labels set by Vertex Core Infra itself. Tracking labels' keys 1019 // are defined with special format: goog-[\p{Ll}\p{N}]+ E.g. "key": 1020 // "goog-k8s-cluster-name","value": "us-east1-b4rk" 1021 TrackingLabels map[string]string `json:"trackingLabels,omitempty"` 1022 // ForceSendFields is a list of field names (e.g. "CoreNumber") to 1023 // unconditionally include in API requests. By default, fields with empty or 1024 // default values are omitted from API requests. See 1025 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1026 // details. 1027 ForceSendFields []string `json:"-"` 1028 // NullFields is a list of field names (e.g. "CoreNumber") to include in API 1029 // requests with the JSON null value. By default, fields with empty values are 1030 // omitted from API requests. See 1031 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1032 NullFields []string `json:"-"` 1033 } 1034 1035 func (s *CpuMetric) MarshalJSON() ([]byte, error) { 1036 type NoMethod CpuMetric 1037 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1038 } 1039 1040 // DependencyEdge: Represents dependency parse tree information for a token. 1041 type DependencyEdge struct { 1042 // HeadTokenIndex: Represents the head of this token in the dependency tree. 1043 // This is the index of the token which has an arc going to this token. The 1044 // index is the position of the token in the array of tokens returned by the 1045 // API method. If this token is a root token, then the `head_token_index` is 1046 // its own index. 1047 HeadTokenIndex int64 `json:"headTokenIndex,omitempty"` 1048 // Label: The parse label for the token. 1049 // 1050 // Possible values: 1051 // "UNKNOWN" - Unknown 1052 // "ABBREV" - Abbreviation modifier 1053 // "ACOMP" - Adjectival complement 1054 // "ADVCL" - Adverbial clause modifier 1055 // "ADVMOD" - Adverbial modifier 1056 // "AMOD" - Adjectival modifier of an NP 1057 // "APPOS" - Appositional modifier of an NP 1058 // "ATTR" - Attribute dependent of a copular verb 1059 // "AUX" - Auxiliary (non-main) verb 1060 // "AUXPASS" - Passive auxiliary 1061 // "CC" - Coordinating conjunction 1062 // "CCOMP" - Clausal complement of a verb or adjective 1063 // "CONJ" - Conjunct 1064 // "CSUBJ" - Clausal subject 1065 // "CSUBJPASS" - Clausal passive subject 1066 // "DEP" - Dependency (unable to determine) 1067 // "DET" - Determiner 1068 // "DISCOURSE" - Discourse 1069 // "DOBJ" - Direct object 1070 // "EXPL" - Expletive 1071 // "GOESWITH" - Goes with (part of a word in a text not well edited) 1072 // "IOBJ" - Indirect object 1073 // "MARK" - Marker (word introducing a subordinate clause) 1074 // "MWE" - Multi-word expression 1075 // "MWV" - Multi-word verbal expression 1076 // "NEG" - Negation modifier 1077 // "NN" - Noun compound modifier 1078 // "NPADVMOD" - Noun phrase used as an adverbial modifier 1079 // "NSUBJ" - Nominal subject 1080 // "NSUBJPASS" - Passive nominal subject 1081 // "NUM" - Numeric modifier of a noun 1082 // "NUMBER" - Element of compound number 1083 // "P" - Punctuation mark 1084 // "PARATAXIS" - Parataxis relation 1085 // "PARTMOD" - Participial modifier 1086 // "PCOMP" - The complement of a preposition is a clause 1087 // "POBJ" - Object of a preposition 1088 // "POSS" - Possession modifier 1089 // "POSTNEG" - Postverbal negative particle 1090 // "PRECOMP" - Predicate complement 1091 // "PRECONJ" - Preconjunt 1092 // "PREDET" - Predeterminer 1093 // "PREF" - Prefix 1094 // "PREP" - Prepositional modifier 1095 // "PRONL" - The relationship between a verb and verbal morpheme 1096 // "PRT" - Particle 1097 // "PS" - Associative or possessive marker 1098 // "QUANTMOD" - Quantifier phrase modifier 1099 // "RCMOD" - Relative clause modifier 1100 // "RCMODREL" - Complementizer in relative clause 1101 // "RDROP" - Ellipsis without a preceding predicate 1102 // "REF" - Referent 1103 // "REMNANT" - Remnant 1104 // "REPARANDUM" - Reparandum 1105 // "ROOT" - Root 1106 // "SNUM" - Suffix specifying a unit of number 1107 // "SUFF" - Suffix 1108 // "TMOD" - Temporal modifier 1109 // "TOPIC" - Topic marker 1110 // "VMOD" - Clause headed by an infinite form of the verb that modifies a 1111 // noun 1112 // "VOCATIVE" - Vocative 1113 // "XCOMP" - Open clausal complement 1114 // "SUFFIX" - Name suffix 1115 // "TITLE" - Name title 1116 // "ADVPHMOD" - Adverbial phrase modifier 1117 // "AUXCAUS" - Causative auxiliary 1118 // "AUXVV" - Helper auxiliary 1119 // "DTMOD" - Rentaishi (Prenominal modifier) 1120 // "FOREIGN" - Foreign words 1121 // "KW" - Keyword 1122 // "LIST" - List for chains of comparable items 1123 // "NOMC" - Nominalized clause 1124 // "NOMCSUBJ" - Nominalized clausal subject 1125 // "NOMCSUBJPASS" - Nominalized clausal passive 1126 // "NUMC" - Compound of numeric modifier 1127 // "COP" - Copula 1128 // "DISLOCATED" - Dislocated relation (for fronted/topicalized elements) 1129 // "ASP" - Aspect marker 1130 // "GMOD" - Genitive modifier 1131 // "GOBJ" - Genitive object 1132 // "INFMOD" - Infinitival modifier 1133 // "MES" - Measure 1134 // "NCOMP" - Nominal complement of a noun 1135 Label string `json:"label,omitempty"` 1136 // ForceSendFields is a list of field names (e.g. "HeadTokenIndex") to 1137 // unconditionally include in API requests. By default, fields with empty or 1138 // default values are omitted from API requests. See 1139 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1140 // details. 1141 ForceSendFields []string `json:"-"` 1142 // NullFields is a list of field names (e.g. "HeadTokenIndex") to include in 1143 // API requests with the JSON null value. By default, fields with empty values 1144 // are omitted from API requests. See 1145 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1146 NullFields []string `json:"-"` 1147 } 1148 1149 func (s *DependencyEdge) MarshalJSON() ([]byte, error) { 1150 type NoMethod DependencyEdge 1151 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1152 } 1153 1154 type DiskMetric struct { 1155 // DiskType: Required. Type of Disk, e.g. REGIONAL_SSD. 1156 // 1157 // Possible values: 1158 // "UNKNOWN_DISK_TYPE" 1159 // "REGIONAL_SSD" 1160 // "REGIONAL_STORAGE" 1161 // "PD_SSD" 1162 // "PD_STANDARD" 1163 // "STORAGE_SNAPSHOT" 1164 DiskType string `json:"diskType,omitempty"` 1165 // GibSec: Required. Seconds of physical disk usage, e.g. 3600. 1166 GibSec int64 `json:"gibSec,omitempty,string"` 1167 // ForceSendFields is a list of field names (e.g. "DiskType") to 1168 // unconditionally include in API requests. By default, fields with empty or 1169 // default values are omitted from API requests. See 1170 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1171 // details. 1172 ForceSendFields []string `json:"-"` 1173 // NullFields is a list of field names (e.g. "DiskType") to include in API 1174 // requests with the JSON null value. By default, fields with empty values are 1175 // omitted from API requests. See 1176 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1177 NullFields []string `json:"-"` 1178 } 1179 1180 func (s *DiskMetric) MarshalJSON() ([]byte, error) { 1181 type NoMethod DiskMetric 1182 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1183 } 1184 1185 // Document: Represents the input to API methods. 1186 type Document struct { 1187 // BoilerplateHandling: Indicates how detected boilerplate(e.g. advertisements, 1188 // copyright declarations, banners) should be handled for this document. If not 1189 // specified, boilerplate will be treated the same as content. 1190 // 1191 // Possible values: 1192 // "BOILERPLATE_HANDLING_UNSPECIFIED" - The boilerplate handling is not 1193 // specified. 1194 // "SKIP_BOILERPLATE" - Do not analyze detected boilerplate. Reference web 1195 // URI is required for detecting boilerplate. 1196 // "KEEP_BOILERPLATE" - Treat boilerplate the same as content. 1197 BoilerplateHandling string `json:"boilerplateHandling,omitempty"` 1198 // Content: The content of the input in string format. Cloud audit logging 1199 // exempt since it is based on user data. 1200 Content string `json:"content,omitempty"` 1201 // GcsContentUri: The Google Cloud Storage URI where the file content is 1202 // located. This URI must be of the form: gs://bucket_name/object_name. For 1203 // more details, see https://cloud.google.com/storage/docs/reference-uris. 1204 // NOTE: Cloud Storage object versioning is not supported. 1205 GcsContentUri string `json:"gcsContentUri,omitempty"` 1206 // Language: The language of the document (if not specified, the language is 1207 // automatically detected). Both ISO and BCP-47 language codes are accepted. 1208 // Language Support (https://cloud.google.com/natural-language/docs/languages) 1209 // lists currently supported languages for each API method. If the language 1210 // (either specified by the caller or automatically detected) is not supported 1211 // by the called API method, an `INVALID_ARGUMENT` error is returned. 1212 Language string `json:"language,omitempty"` 1213 // ReferenceWebUri: The web URI where the document comes from. This URI is not 1214 // used for fetching the content, but as a hint for analyzing the document. 1215 ReferenceWebUri string `json:"referenceWebUri,omitempty"` 1216 // Type: Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an 1217 // `INVALID_ARGUMENT` error. 1218 // 1219 // Possible values: 1220 // "TYPE_UNSPECIFIED" - The content type is not specified. 1221 // "PLAIN_TEXT" - Plain text 1222 // "HTML" - HTML 1223 Type string `json:"type,omitempty"` 1224 // ForceSendFields is a list of field names (e.g. "BoilerplateHandling") to 1225 // unconditionally include in API requests. By default, fields with empty or 1226 // default values are omitted from API requests. See 1227 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1228 // details. 1229 ForceSendFields []string `json:"-"` 1230 // NullFields is a list of field names (e.g. "BoilerplateHandling") to include 1231 // in API requests with the JSON null value. By default, fields with empty 1232 // values are omitted from API requests. See 1233 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1234 NullFields []string `json:"-"` 1235 } 1236 1237 func (s *Document) MarshalJSON() ([]byte, error) { 1238 type NoMethod Document 1239 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1240 } 1241 1242 // Entity: Represents a phrase in the text that is a known entity, such as a 1243 // person, an organization, or location. The API associates information, such 1244 // as salience and mentions, with entities. 1245 type Entity struct { 1246 // Mentions: The mentions of this entity in the input document. The API 1247 // currently supports proper noun mentions. 1248 Mentions []*EntityMention `json:"mentions,omitempty"` 1249 // Metadata: Metadata associated with the entity. For most entity types, the 1250 // metadata is a Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID 1251 // (`mid`), if they are available. For the metadata associated with other 1252 // entity types, see the Type table below. 1253 Metadata map[string]string `json:"metadata,omitempty"` 1254 // Name: The representative name for the entity. 1255 Name string `json:"name,omitempty"` 1256 // Salience: The salience score associated with the entity in the [0, 1.0] 1257 // range. The salience score for an entity provides information about the 1258 // importance or centrality of that entity to the entire document text. Scores 1259 // closer to 0 are less salient, while scores closer to 1.0 are highly salient. 1260 Salience float64 `json:"salience,omitempty"` 1261 // Sentiment: For calls to AnalyzeEntitySentiment or if 1262 // AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this 1263 // field will contain the aggregate sentiment expressed for this entity in the 1264 // provided document. 1265 Sentiment *Sentiment `json:"sentiment,omitempty"` 1266 // Type: The entity type. 1267 // 1268 // Possible values: 1269 // "UNKNOWN" - Unknown 1270 // "PERSON" - Person 1271 // "LOCATION" - Location 1272 // "ORGANIZATION" - Organization 1273 // "EVENT" - Event 1274 // "WORK_OF_ART" - Artwork 1275 // "CONSUMER_GOOD" - Consumer product 1276 // "OTHER" - Other types of entities 1277 // "PHONE_NUMBER" - Phone number The metadata lists the phone number, 1278 // formatted according to local convention, plus whichever additional elements 1279 // appear in the text: * `number` - the actual number, broken down into 1280 // sections as per local convention * `national_prefix` - country code, if 1281 // detected * `area_code` - region or area code, if detected * `extension` - 1282 // phone extension (to be dialed after connection), if detected 1283 // "ADDRESS" - Address The metadata identifies the street number and locality 1284 // plus whichever additional elements appear in the text: * `street_number` - 1285 // street number * `locality` - city or town * `street_name` - street/route 1286 // name, if detected * `postal_code` - postal code, if detected * `country` - 1287 // country, if detected< * `broad_region` - administrative area, such as the 1288 // state, if detected * `narrow_region` - smaller administrative area, such as 1289 // county, if detected * `sublocality` - used in Asian addresses to demark a 1290 // district within a city, if detected 1291 // "DATE" - Date The metadata identifies the components of the date: * `year` 1292 // - four digit year, if detected * `month` - two digit month number, if 1293 // detected * `day` - two digit day number, if detected 1294 // "NUMBER" - Number The metadata is the number itself. 1295 // "PRICE" - Price The metadata identifies the `value` and `currency`. 1296 Type string `json:"type,omitempty"` 1297 // ForceSendFields is a list of field names (e.g. "Mentions") to 1298 // unconditionally include in API requests. By default, fields with empty or 1299 // default values are omitted from API requests. See 1300 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1301 // details. 1302 ForceSendFields []string `json:"-"` 1303 // NullFields is a list of field names (e.g. "Mentions") to include in API 1304 // requests with the JSON null value. By default, fields with empty values are 1305 // omitted from API requests. See 1306 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1307 NullFields []string `json:"-"` 1308 } 1309 1310 func (s *Entity) MarshalJSON() ([]byte, error) { 1311 type NoMethod Entity 1312 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1313 } 1314 1315 func (s *Entity) UnmarshalJSON(data []byte) error { 1316 type NoMethod Entity 1317 var s1 struct { 1318 Salience gensupport.JSONFloat64 `json:"salience"` 1319 *NoMethod 1320 } 1321 s1.NoMethod = (*NoMethod)(s) 1322 if err := json.Unmarshal(data, &s1); err != nil { 1323 return err 1324 } 1325 s.Salience = float64(s1.Salience) 1326 return nil 1327 } 1328 1329 // EntityMention: Represents a mention for an entity in the text. Currently, 1330 // proper noun mentions are supported. 1331 type EntityMention struct { 1332 // Sentiment: For calls to AnalyzeEntitySentiment or if 1333 // AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this 1334 // field will contain the sentiment expressed for this mention of the entity in 1335 // the provided document. 1336 Sentiment *Sentiment `json:"sentiment,omitempty"` 1337 // Text: The mention text. 1338 Text *TextSpan `json:"text,omitempty"` 1339 // Type: The type of the entity mention. 1340 // 1341 // Possible values: 1342 // "TYPE_UNKNOWN" - Unknown 1343 // "PROPER" - Proper name 1344 // "COMMON" - Common noun (or noun compound) 1345 Type string `json:"type,omitempty"` 1346 // ForceSendFields is a list of field names (e.g. "Sentiment") to 1347 // unconditionally include in API requests. By default, fields with empty or 1348 // default values are omitted from API requests. See 1349 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1350 // details. 1351 ForceSendFields []string `json:"-"` 1352 // NullFields is a list of field names (e.g. "Sentiment") to include in API 1353 // requests with the JSON null value. By default, fields with empty values are 1354 // omitted from API requests. See 1355 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1356 NullFields []string `json:"-"` 1357 } 1358 1359 func (s *EntityMention) MarshalJSON() ([]byte, error) { 1360 type NoMethod EntityMention 1361 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1362 } 1363 1364 type GpuMetric struct { 1365 // GpuSec: Required. Seconds of GPU usage, e.g. 3600. 1366 GpuSec int64 `json:"gpuSec,omitempty,string"` 1367 // GpuType: Required. Type of GPU, e.g. NVIDIA_TESLA_V100. 1368 // 1369 // Possible values: 1370 // "UNKNOWN_GPU_TYPE" 1371 // "NVIDIA_TESLA_A100" 1372 // "NVIDIA_A100_80GB" 1373 // "NVIDIA_TESLA_K80" 1374 // "NVIDIA_L4" 1375 // "NVIDIA_TESLA_P100" 1376 // "NVIDIA_TESLA_P4" 1377 // "NVIDIA_TESLA_T4" 1378 // "NVIDIA_TESLA_V100" 1379 // "NVIDIA_H100_80GB" 1380 GpuType string `json:"gpuType,omitempty"` 1381 // MachineSpec: Required. Machine spec, e.g. N1_STANDARD_4. 1382 // 1383 // Possible values: 1384 // "UNKNOWN_MACHINE_SPEC" 1385 // "N1_STANDARD_2" 1386 // "N1_STANDARD_4" 1387 // "N1_STANDARD_8" 1388 // "N1_STANDARD_16" 1389 // "N1_STANDARD_32" 1390 // "N1_STANDARD_64" 1391 // "N1_STANDARD_96" 1392 // "N1_HIGHMEM_2" 1393 // "N1_HIGHMEM_4" 1394 // "N1_HIGHMEM_8" 1395 // "N1_HIGHMEM_16" 1396 // "N1_HIGHMEM_32" 1397 // "N1_HIGHMEM_64" 1398 // "N1_HIGHMEM_96" 1399 // "N1_HIGHCPU_2" 1400 // "N1_HIGHCPU_4" 1401 // "N1_HIGHCPU_8" 1402 // "N1_HIGHCPU_16" 1403 // "N1_HIGHCPU_32" 1404 // "N1_HIGHCPU_64" 1405 // "N1_HIGHCPU_96" 1406 // "A2_HIGHGPU_1G" 1407 // "A2_HIGHGPU_2G" 1408 // "A2_HIGHGPU_4G" 1409 // "A2_HIGHGPU_8G" 1410 // "A2_MEGAGPU_16G" 1411 // "A2_ULTRAGPU_1G" 1412 // "A2_ULTRAGPU_2G" 1413 // "A2_ULTRAGPU_4G" 1414 // "A2_ULTRAGPU_8G" 1415 // "A3_HIGHGPU_8G" 1416 // "E2_STANDARD_2" 1417 // "E2_STANDARD_4" 1418 // "E2_STANDARD_8" 1419 // "E2_STANDARD_16" 1420 // "E2_STANDARD_32" 1421 // "E2_HIGHMEM_2" 1422 // "E2_HIGHMEM_4" 1423 // "E2_HIGHMEM_8" 1424 // "E2_HIGHMEM_16" 1425 // "E2_HIGHCPU_2" 1426 // "E2_HIGHCPU_4" 1427 // "E2_HIGHCPU_8" 1428 // "E2_HIGHCPU_16" 1429 // "E2_HIGHCPU_32" 1430 // "N2_STANDARD_2" 1431 // "N2_STANDARD_4" 1432 // "N2_STANDARD_8" 1433 // "N2_STANDARD_16" 1434 // "N2_STANDARD_32" 1435 // "N2_STANDARD_48" 1436 // "N2_STANDARD_64" 1437 // "N2_STANDARD_80" 1438 // "N2_STANDARD_96" 1439 // "N2_STANDARD_128" 1440 // "N2_HIGHMEM_2" 1441 // "N2_HIGHMEM_4" 1442 // "N2_HIGHMEM_8" 1443 // "N2_HIGHMEM_16" 1444 // "N2_HIGHMEM_32" 1445 // "N2_HIGHMEM_48" 1446 // "N2_HIGHMEM_64" 1447 // "N2_HIGHMEM_80" 1448 // "N2_HIGHMEM_96" 1449 // "N2_HIGHMEM_128" 1450 // "N2_HIGHCPU_2" 1451 // "N2_HIGHCPU_4" 1452 // "N2_HIGHCPU_8" 1453 // "N2_HIGHCPU_16" 1454 // "N2_HIGHCPU_32" 1455 // "N2_HIGHCPU_48" 1456 // "N2_HIGHCPU_64" 1457 // "N2_HIGHCPU_80" 1458 // "N2_HIGHCPU_96" 1459 // "N2D_STANDARD_2" 1460 // "N2D_STANDARD_4" 1461 // "N2D_STANDARD_8" 1462 // "N2D_STANDARD_16" 1463 // "N2D_STANDARD_32" 1464 // "N2D_STANDARD_48" 1465 // "N2D_STANDARD_64" 1466 // "N2D_STANDARD_80" 1467 // "N2D_STANDARD_96" 1468 // "N2D_STANDARD_128" 1469 // "N2D_STANDARD_224" 1470 // "N2D_HIGHMEM_2" 1471 // "N2D_HIGHMEM_4" 1472 // "N2D_HIGHMEM_8" 1473 // "N2D_HIGHMEM_16" 1474 // "N2D_HIGHMEM_32" 1475 // "N2D_HIGHMEM_48" 1476 // "N2D_HIGHMEM_64" 1477 // "N2D_HIGHMEM_80" 1478 // "N2D_HIGHMEM_96" 1479 // "N2D_HIGHCPU_2" 1480 // "N2D_HIGHCPU_4" 1481 // "N2D_HIGHCPU_8" 1482 // "N2D_HIGHCPU_16" 1483 // "N2D_HIGHCPU_32" 1484 // "N2D_HIGHCPU_48" 1485 // "N2D_HIGHCPU_64" 1486 // "N2D_HIGHCPU_80" 1487 // "N2D_HIGHCPU_96" 1488 // "N2D_HIGHCPU_128" 1489 // "N2D_HIGHCPU_224" 1490 // "C2_STANDARD_4" 1491 // "C2_STANDARD_8" 1492 // "C2_STANDARD_16" 1493 // "C2_STANDARD_30" 1494 // "C2_STANDARD_60" 1495 // "C2D_STANDARD_2" 1496 // "C2D_STANDARD_4" 1497 // "C2D_STANDARD_8" 1498 // "C2D_STANDARD_16" 1499 // "C2D_STANDARD_32" 1500 // "C2D_STANDARD_56" 1501 // "C2D_STANDARD_112" 1502 // "C2D_HIGHCPU_2" 1503 // "C2D_HIGHCPU_4" 1504 // "C2D_HIGHCPU_8" 1505 // "C2D_HIGHCPU_16" 1506 // "C2D_HIGHCPU_32" 1507 // "C2D_HIGHCPU_56" 1508 // "C2D_HIGHCPU_112" 1509 // "C2D_HIGHMEM_2" 1510 // "C2D_HIGHMEM_4" 1511 // "C2D_HIGHMEM_8" 1512 // "C2D_HIGHMEM_16" 1513 // "C2D_HIGHMEM_32" 1514 // "C2D_HIGHMEM_56" 1515 // "C2D_HIGHMEM_112" 1516 // "G2_STANDARD_4" 1517 // "G2_STANDARD_8" 1518 // "G2_STANDARD_12" 1519 // "G2_STANDARD_16" 1520 // "G2_STANDARD_24" 1521 // "G2_STANDARD_32" 1522 // "G2_STANDARD_48" 1523 // "G2_STANDARD_96" 1524 // "C3_STANDARD_4" 1525 // "C3_STANDARD_8" 1526 // "C3_STANDARD_22" 1527 // "C3_STANDARD_44" 1528 // "C3_STANDARD_88" 1529 // "C3_STANDARD_176" 1530 // "C3_HIGHCPU_4" 1531 // "C3_HIGHCPU_8" 1532 // "C3_HIGHCPU_22" 1533 // "C3_HIGHCPU_44" 1534 // "C3_HIGHCPU_88" 1535 // "C3_HIGHCPU_176" 1536 // "C3_HIGHMEM_4" 1537 // "C3_HIGHMEM_8" 1538 // "C3_HIGHMEM_22" 1539 // "C3_HIGHMEM_44" 1540 // "C3_HIGHMEM_88" 1541 // "C3_HIGHMEM_176" 1542 MachineSpec string `json:"machineSpec,omitempty"` 1543 // TrackingLabels: Billing tracking labels. They do not contain any user data 1544 // but only the labels set by Vertex Core Infra itself. Tracking labels' keys 1545 // are defined with special format: goog-[\p{Ll}\p{N}]+ E.g. "key": 1546 // "goog-k8s-cluster-name","value": "us-east1-b4rk" 1547 TrackingLabels map[string]string `json:"trackingLabels,omitempty"` 1548 // ForceSendFields is a list of field names (e.g. "GpuSec") to unconditionally 1549 // include in API requests. By default, fields with empty or default values are 1550 // omitted from API requests. See 1551 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1552 // details. 1553 ForceSendFields []string `json:"-"` 1554 // NullFields is a list of field names (e.g. "GpuSec") to include in API 1555 // requests with the JSON null value. By default, fields with empty values are 1556 // omitted from API requests. See 1557 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1558 NullFields []string `json:"-"` 1559 } 1560 1561 func (s *GpuMetric) MarshalJSON() ([]byte, error) { 1562 type NoMethod GpuMetric 1563 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1564 } 1565 1566 // InfraUsage: Infra Usage of billing metrics. Next ID: 6 1567 type InfraUsage struct { 1568 // CpuMetrics: Aggregated core metrics since requested start_time. 1569 CpuMetrics []*CpuMetric `json:"cpuMetrics,omitempty"` 1570 // DiskMetrics: Aggregated persistent disk metrics since requested start_time. 1571 DiskMetrics []*DiskMetric `json:"diskMetrics,omitempty"` 1572 // GpuMetrics: Aggregated gpu metrics since requested start_time. 1573 GpuMetrics []*GpuMetric `json:"gpuMetrics,omitempty"` 1574 // RamMetrics: Aggregated ram metrics since requested start_time. 1575 RamMetrics []*RamMetric `json:"ramMetrics,omitempty"` 1576 // TpuMetrics: Aggregated tpu metrics since requested start_time. 1577 TpuMetrics []*TpuMetric `json:"tpuMetrics,omitempty"` 1578 // ForceSendFields is a list of field names (e.g. "CpuMetrics") to 1579 // unconditionally include in API requests. By default, fields with empty or 1580 // default values are omitted from API requests. See 1581 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1582 // details. 1583 ForceSendFields []string `json:"-"` 1584 // NullFields is a list of field names (e.g. "CpuMetrics") to include in API 1585 // requests with the JSON null value. By default, fields with empty values are 1586 // omitted from API requests. See 1587 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1588 NullFields []string `json:"-"` 1589 } 1590 1591 func (s *InfraUsage) MarshalJSON() ([]byte, error) { 1592 type NoMethod InfraUsage 1593 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1594 } 1595 1596 // ModerateTextRequest: The document moderation request message. 1597 type ModerateTextRequest struct { 1598 // Document: Required. Input document. 1599 Document *Document `json:"document,omitempty"` 1600 // ForceSendFields is a list of field names (e.g. "Document") to 1601 // unconditionally include in API requests. By default, fields with empty or 1602 // default values are omitted from API requests. See 1603 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1604 // details. 1605 ForceSendFields []string `json:"-"` 1606 // NullFields is a list of field names (e.g. "Document") to include in API 1607 // requests with the JSON null value. By default, fields with empty values are 1608 // omitted from API requests. See 1609 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1610 NullFields []string `json:"-"` 1611 } 1612 1613 func (s *ModerateTextRequest) MarshalJSON() ([]byte, error) { 1614 type NoMethod ModerateTextRequest 1615 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1616 } 1617 1618 // ModerateTextResponse: The document moderation response message. 1619 type ModerateTextResponse struct { 1620 // ModerationCategories: Harmful and sensitive categories representing the 1621 // input document. 1622 ModerationCategories []*ClassificationCategory `json:"moderationCategories,omitempty"` 1623 1624 // ServerResponse contains the HTTP response code and headers from the server. 1625 googleapi.ServerResponse `json:"-"` 1626 // ForceSendFields is a list of field names (e.g. "ModerationCategories") to 1627 // unconditionally include in API requests. By default, fields with empty or 1628 // default values are omitted from API requests. See 1629 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1630 // details. 1631 ForceSendFields []string `json:"-"` 1632 // NullFields is a list of field names (e.g. "ModerationCategories") to include 1633 // in API requests with the JSON null value. By default, fields with empty 1634 // values are omitted from API requests. See 1635 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1636 NullFields []string `json:"-"` 1637 } 1638 1639 func (s *ModerateTextResponse) MarshalJSON() ([]byte, error) { 1640 type NoMethod ModerateTextResponse 1641 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1642 } 1643 1644 // PartOfSpeech: Represents part of speech information for a token. 1645 type PartOfSpeech struct { 1646 // Aspect: The grammatical aspect. 1647 // 1648 // Possible values: 1649 // "ASPECT_UNKNOWN" - Aspect is not applicable in the analyzed language or is 1650 // not predicted. 1651 // "PERFECTIVE" - Perfective 1652 // "IMPERFECTIVE" - Imperfective 1653 // "PROGRESSIVE" - Progressive 1654 Aspect string `json:"aspect,omitempty"` 1655 // Case: The grammatical case. 1656 // 1657 // Possible values: 1658 // "CASE_UNKNOWN" - Case is not applicable in the analyzed language or is not 1659 // predicted. 1660 // "ACCUSATIVE" - Accusative 1661 // "ADVERBIAL" - Adverbial 1662 // "COMPLEMENTIVE" - Complementive 1663 // "DATIVE" - Dative 1664 // "GENITIVE" - Genitive 1665 // "INSTRUMENTAL" - Instrumental 1666 // "LOCATIVE" - Locative 1667 // "NOMINATIVE" - Nominative 1668 // "OBLIQUE" - Oblique 1669 // "PARTITIVE" - Partitive 1670 // "PREPOSITIONAL" - Prepositional 1671 // "REFLEXIVE_CASE" - Reflexive 1672 // "RELATIVE_CASE" - Relative 1673 // "VOCATIVE" - Vocative 1674 Case string `json:"case,omitempty"` 1675 // Form: The grammatical form. 1676 // 1677 // Possible values: 1678 // "FORM_UNKNOWN" - Form is not applicable in the analyzed language or is not 1679 // predicted. 1680 // "ADNOMIAL" - Adnomial 1681 // "AUXILIARY" - Auxiliary 1682 // "COMPLEMENTIZER" - Complementizer 1683 // "FINAL_ENDING" - Final ending 1684 // "GERUND" - Gerund 1685 // "REALIS" - Realis 1686 // "IRREALIS" - Irrealis 1687 // "SHORT" - Short form 1688 // "LONG" - Long form 1689 // "ORDER" - Order form 1690 // "SPECIFIC" - Specific form 1691 Form string `json:"form,omitempty"` 1692 // Gender: The grammatical gender. 1693 // 1694 // Possible values: 1695 // "GENDER_UNKNOWN" - Gender is not applicable in the analyzed language or is 1696 // not predicted. 1697 // "FEMININE" - Feminine 1698 // "MASCULINE" - Masculine 1699 // "NEUTER" - Neuter 1700 Gender string `json:"gender,omitempty"` 1701 // Mood: The grammatical mood. 1702 // 1703 // Possible values: 1704 // "MOOD_UNKNOWN" - Mood is not applicable in the analyzed language or is not 1705 // predicted. 1706 // "CONDITIONAL_MOOD" - Conditional 1707 // "IMPERATIVE" - Imperative 1708 // "INDICATIVE" - Indicative 1709 // "INTERROGATIVE" - Interrogative 1710 // "JUSSIVE" - Jussive 1711 // "SUBJUNCTIVE" - Subjunctive 1712 Mood string `json:"mood,omitempty"` 1713 // Number: The grammatical number. 1714 // 1715 // Possible values: 1716 // "NUMBER_UNKNOWN" - Number is not applicable in the analyzed language or is 1717 // not predicted. 1718 // "SINGULAR" - Singular 1719 // "PLURAL" - Plural 1720 // "DUAL" - Dual 1721 Number string `json:"number,omitempty"` 1722 // Person: The grammatical person. 1723 // 1724 // Possible values: 1725 // "PERSON_UNKNOWN" - Person is not applicable in the analyzed language or is 1726 // not predicted. 1727 // "FIRST" - First 1728 // "SECOND" - Second 1729 // "THIRD" - Third 1730 // "REFLEXIVE_PERSON" - Reflexive 1731 Person string `json:"person,omitempty"` 1732 // Proper: The grammatical properness. 1733 // 1734 // Possible values: 1735 // "PROPER_UNKNOWN" - Proper is not applicable in the analyzed language or is 1736 // not predicted. 1737 // "PROPER" - Proper 1738 // "NOT_PROPER" - Not proper 1739 Proper string `json:"proper,omitempty"` 1740 // Reciprocity: The grammatical reciprocity. 1741 // 1742 // Possible values: 1743 // "RECIPROCITY_UNKNOWN" - Reciprocity is not applicable in the analyzed 1744 // language or is not predicted. 1745 // "RECIPROCAL" - Reciprocal 1746 // "NON_RECIPROCAL" - Non-reciprocal 1747 Reciprocity string `json:"reciprocity,omitempty"` 1748 // Tag: The part of speech tag. 1749 // 1750 // Possible values: 1751 // "UNKNOWN" - Unknown 1752 // "ADJ" - Adjective 1753 // "ADP" - Adposition (preposition and postposition) 1754 // "ADV" - Adverb 1755 // "CONJ" - Conjunction 1756 // "DET" - Determiner 1757 // "NOUN" - Noun (common and proper) 1758 // "NUM" - Cardinal number 1759 // "PRON" - Pronoun 1760 // "PRT" - Particle or other function word 1761 // "PUNCT" - Punctuation 1762 // "VERB" - Verb (all tenses and modes) 1763 // "X" - Other: foreign words, typos, abbreviations 1764 // "AFFIX" - Affix 1765 Tag string `json:"tag,omitempty"` 1766 // Tense: The grammatical tense. 1767 // 1768 // Possible values: 1769 // "TENSE_UNKNOWN" - Tense is not applicable in the analyzed language or is 1770 // not predicted. 1771 // "CONDITIONAL_TENSE" - Conditional 1772 // "FUTURE" - Future 1773 // "PAST" - Past 1774 // "PRESENT" - Present 1775 // "IMPERFECT" - Imperfect 1776 // "PLUPERFECT" - Pluperfect 1777 Tense string `json:"tense,omitempty"` 1778 // Voice: The grammatical voice. 1779 // 1780 // Possible values: 1781 // "VOICE_UNKNOWN" - Voice is not applicable in the analyzed language or is 1782 // not predicted. 1783 // "ACTIVE" - Active 1784 // "CAUSATIVE" - Causative 1785 // "PASSIVE" - Passive 1786 Voice string `json:"voice,omitempty"` 1787 // ForceSendFields is a list of field names (e.g. "Aspect") to unconditionally 1788 // include in API requests. By default, fields with empty or default values are 1789 // omitted from API requests. See 1790 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1791 // details. 1792 ForceSendFields []string `json:"-"` 1793 // NullFields is a list of field names (e.g. "Aspect") to include in API 1794 // requests with the JSON null value. By default, fields with empty values are 1795 // omitted from API requests. See 1796 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1797 NullFields []string `json:"-"` 1798 } 1799 1800 func (s *PartOfSpeech) MarshalJSON() ([]byte, error) { 1801 type NoMethod PartOfSpeech 1802 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1803 } 1804 1805 type RamMetric struct { 1806 // GibSec: Required. VM memory in Gigabyte second, e.g. 3600. Using int64 type 1807 // to match billing metrics definition. 1808 GibSec int64 `json:"gibSec,omitempty,string"` 1809 // MachineSpec: Required. Machine spec, e.g. N1_STANDARD_4. 1810 // 1811 // Possible values: 1812 // "UNKNOWN_MACHINE_SPEC" 1813 // "N1_STANDARD_2" 1814 // "N1_STANDARD_4" 1815 // "N1_STANDARD_8" 1816 // "N1_STANDARD_16" 1817 // "N1_STANDARD_32" 1818 // "N1_STANDARD_64" 1819 // "N1_STANDARD_96" 1820 // "N1_HIGHMEM_2" 1821 // "N1_HIGHMEM_4" 1822 // "N1_HIGHMEM_8" 1823 // "N1_HIGHMEM_16" 1824 // "N1_HIGHMEM_32" 1825 // "N1_HIGHMEM_64" 1826 // "N1_HIGHMEM_96" 1827 // "N1_HIGHCPU_2" 1828 // "N1_HIGHCPU_4" 1829 // "N1_HIGHCPU_8" 1830 // "N1_HIGHCPU_16" 1831 // "N1_HIGHCPU_32" 1832 // "N1_HIGHCPU_64" 1833 // "N1_HIGHCPU_96" 1834 // "A2_HIGHGPU_1G" 1835 // "A2_HIGHGPU_2G" 1836 // "A2_HIGHGPU_4G" 1837 // "A2_HIGHGPU_8G" 1838 // "A2_MEGAGPU_16G" 1839 // "A2_ULTRAGPU_1G" 1840 // "A2_ULTRAGPU_2G" 1841 // "A2_ULTRAGPU_4G" 1842 // "A2_ULTRAGPU_8G" 1843 // "A3_HIGHGPU_8G" 1844 // "E2_STANDARD_2" 1845 // "E2_STANDARD_4" 1846 // "E2_STANDARD_8" 1847 // "E2_STANDARD_16" 1848 // "E2_STANDARD_32" 1849 // "E2_HIGHMEM_2" 1850 // "E2_HIGHMEM_4" 1851 // "E2_HIGHMEM_8" 1852 // "E2_HIGHMEM_16" 1853 // "E2_HIGHCPU_2" 1854 // "E2_HIGHCPU_4" 1855 // "E2_HIGHCPU_8" 1856 // "E2_HIGHCPU_16" 1857 // "E2_HIGHCPU_32" 1858 // "N2_STANDARD_2" 1859 // "N2_STANDARD_4" 1860 // "N2_STANDARD_8" 1861 // "N2_STANDARD_16" 1862 // "N2_STANDARD_32" 1863 // "N2_STANDARD_48" 1864 // "N2_STANDARD_64" 1865 // "N2_STANDARD_80" 1866 // "N2_STANDARD_96" 1867 // "N2_STANDARD_128" 1868 // "N2_HIGHMEM_2" 1869 // "N2_HIGHMEM_4" 1870 // "N2_HIGHMEM_8" 1871 // "N2_HIGHMEM_16" 1872 // "N2_HIGHMEM_32" 1873 // "N2_HIGHMEM_48" 1874 // "N2_HIGHMEM_64" 1875 // "N2_HIGHMEM_80" 1876 // "N2_HIGHMEM_96" 1877 // "N2_HIGHMEM_128" 1878 // "N2_HIGHCPU_2" 1879 // "N2_HIGHCPU_4" 1880 // "N2_HIGHCPU_8" 1881 // "N2_HIGHCPU_16" 1882 // "N2_HIGHCPU_32" 1883 // "N2_HIGHCPU_48" 1884 // "N2_HIGHCPU_64" 1885 // "N2_HIGHCPU_80" 1886 // "N2_HIGHCPU_96" 1887 // "N2D_STANDARD_2" 1888 // "N2D_STANDARD_4" 1889 // "N2D_STANDARD_8" 1890 // "N2D_STANDARD_16" 1891 // "N2D_STANDARD_32" 1892 // "N2D_STANDARD_48" 1893 // "N2D_STANDARD_64" 1894 // "N2D_STANDARD_80" 1895 // "N2D_STANDARD_96" 1896 // "N2D_STANDARD_128" 1897 // "N2D_STANDARD_224" 1898 // "N2D_HIGHMEM_2" 1899 // "N2D_HIGHMEM_4" 1900 // "N2D_HIGHMEM_8" 1901 // "N2D_HIGHMEM_16" 1902 // "N2D_HIGHMEM_32" 1903 // "N2D_HIGHMEM_48" 1904 // "N2D_HIGHMEM_64" 1905 // "N2D_HIGHMEM_80" 1906 // "N2D_HIGHMEM_96" 1907 // "N2D_HIGHCPU_2" 1908 // "N2D_HIGHCPU_4" 1909 // "N2D_HIGHCPU_8" 1910 // "N2D_HIGHCPU_16" 1911 // "N2D_HIGHCPU_32" 1912 // "N2D_HIGHCPU_48" 1913 // "N2D_HIGHCPU_64" 1914 // "N2D_HIGHCPU_80" 1915 // "N2D_HIGHCPU_96" 1916 // "N2D_HIGHCPU_128" 1917 // "N2D_HIGHCPU_224" 1918 // "C2_STANDARD_4" 1919 // "C2_STANDARD_8" 1920 // "C2_STANDARD_16" 1921 // "C2_STANDARD_30" 1922 // "C2_STANDARD_60" 1923 // "C2D_STANDARD_2" 1924 // "C2D_STANDARD_4" 1925 // "C2D_STANDARD_8" 1926 // "C2D_STANDARD_16" 1927 // "C2D_STANDARD_32" 1928 // "C2D_STANDARD_56" 1929 // "C2D_STANDARD_112" 1930 // "C2D_HIGHCPU_2" 1931 // "C2D_HIGHCPU_4" 1932 // "C2D_HIGHCPU_8" 1933 // "C2D_HIGHCPU_16" 1934 // "C2D_HIGHCPU_32" 1935 // "C2D_HIGHCPU_56" 1936 // "C2D_HIGHCPU_112" 1937 // "C2D_HIGHMEM_2" 1938 // "C2D_HIGHMEM_4" 1939 // "C2D_HIGHMEM_8" 1940 // "C2D_HIGHMEM_16" 1941 // "C2D_HIGHMEM_32" 1942 // "C2D_HIGHMEM_56" 1943 // "C2D_HIGHMEM_112" 1944 // "G2_STANDARD_4" 1945 // "G2_STANDARD_8" 1946 // "G2_STANDARD_12" 1947 // "G2_STANDARD_16" 1948 // "G2_STANDARD_24" 1949 // "G2_STANDARD_32" 1950 // "G2_STANDARD_48" 1951 // "G2_STANDARD_96" 1952 // "C3_STANDARD_4" 1953 // "C3_STANDARD_8" 1954 // "C3_STANDARD_22" 1955 // "C3_STANDARD_44" 1956 // "C3_STANDARD_88" 1957 // "C3_STANDARD_176" 1958 // "C3_HIGHCPU_4" 1959 // "C3_HIGHCPU_8" 1960 // "C3_HIGHCPU_22" 1961 // "C3_HIGHCPU_44" 1962 // "C3_HIGHCPU_88" 1963 // "C3_HIGHCPU_176" 1964 // "C3_HIGHMEM_4" 1965 // "C3_HIGHMEM_8" 1966 // "C3_HIGHMEM_22" 1967 // "C3_HIGHMEM_44" 1968 // "C3_HIGHMEM_88" 1969 // "C3_HIGHMEM_176" 1970 MachineSpec string `json:"machineSpec,omitempty"` 1971 // Memories: Required. VM memory in gb. 1972 Memories float64 `json:"memories,omitempty"` 1973 // RamType: Required. Type of ram. 1974 // 1975 // Possible values: 1976 // "UNKNOWN_RAM_TYPE" 1977 // "A2" 1978 // "A3" 1979 // "C2" - COMPUTE_OPTIMIZED 1980 // "C2D" 1981 // "CUSTOM" 1982 // "E2" 1983 // "G2" 1984 // "C3" 1985 // "M2" - MEMORY_OPTIMIZED_UPGRADE_PREMIUM 1986 // "M1" - MEMORY_OPTIMIZED 1987 // "N1" 1988 // "N2_CUSTOM" 1989 // "N2" 1990 // "N2D" 1991 RamType string `json:"ramType,omitempty"` 1992 // TrackingLabels: Billing tracking labels. They do not contain any user data 1993 // but only the labels set by Vertex Core Infra itself. Tracking labels' keys 1994 // are defined with special format: goog-[\p{Ll}\p{N}]+ E.g. "key": 1995 // "goog-k8s-cluster-name","value": "us-east1-b4rk" 1996 TrackingLabels map[string]string `json:"trackingLabels,omitempty"` 1997 // ForceSendFields is a list of field names (e.g. "GibSec") to unconditionally 1998 // include in API requests. By default, fields with empty or default values are 1999 // omitted from API requests. See 2000 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2001 // details. 2002 ForceSendFields []string `json:"-"` 2003 // NullFields is a list of field names (e.g. "GibSec") to include in API 2004 // requests with the JSON null value. By default, fields with empty values are 2005 // omitted from API requests. See 2006 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2007 NullFields []string `json:"-"` 2008 } 2009 2010 func (s *RamMetric) MarshalJSON() ([]byte, error) { 2011 type NoMethod RamMetric 2012 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2013 } 2014 2015 func (s *RamMetric) UnmarshalJSON(data []byte) error { 2016 type NoMethod RamMetric 2017 var s1 struct { 2018 Memories gensupport.JSONFloat64 `json:"memories"` 2019 *NoMethod 2020 } 2021 s1.NoMethod = (*NoMethod)(s) 2022 if err := json.Unmarshal(data, &s1); err != nil { 2023 return err 2024 } 2025 s.Memories = float64(s1.Memories) 2026 return nil 2027 } 2028 2029 // Sentence: Represents a sentence in the input document. 2030 type Sentence struct { 2031 // Sentiment: For calls to AnalyzeSentiment or if 2032 // AnnotateTextRequest.Features.extract_document_sentiment is set to true, this 2033 // field will contain the sentiment for the sentence. 2034 Sentiment *Sentiment `json:"sentiment,omitempty"` 2035 // Text: The sentence text. 2036 Text *TextSpan `json:"text,omitempty"` 2037 // ForceSendFields is a list of field names (e.g. "Sentiment") to 2038 // unconditionally include in API requests. By default, fields with empty or 2039 // default values are omitted from API requests. See 2040 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2041 // details. 2042 ForceSendFields []string `json:"-"` 2043 // NullFields is a list of field names (e.g. "Sentiment") to include in API 2044 // requests with the JSON null value. By default, fields with empty values are 2045 // omitted from API requests. See 2046 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2047 NullFields []string `json:"-"` 2048 } 2049 2050 func (s *Sentence) MarshalJSON() ([]byte, error) { 2051 type NoMethod Sentence 2052 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2053 } 2054 2055 // Sentiment: Represents the feeling associated with the entire text or 2056 // entities in the text. Next ID: 6 2057 type Sentiment struct { 2058 // Magnitude: A non-negative number in the [0, +inf) range, which represents 2059 // the absolute magnitude of sentiment regardless of score (positive or 2060 // negative). 2061 Magnitude float64 `json:"magnitude,omitempty"` 2062 // Score: Sentiment score between -1.0 (negative sentiment) and 1.0 (positive 2063 // sentiment). 2064 Score float64 `json:"score,omitempty"` 2065 // ForceSendFields is a list of field names (e.g. "Magnitude") to 2066 // unconditionally include in API requests. By default, fields with empty or 2067 // default values are omitted from API requests. See 2068 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2069 // details. 2070 ForceSendFields []string `json:"-"` 2071 // NullFields is a list of field names (e.g. "Magnitude") to include in API 2072 // requests with the JSON null value. By default, fields with empty values are 2073 // omitted from API requests. See 2074 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2075 NullFields []string `json:"-"` 2076 } 2077 2078 func (s *Sentiment) MarshalJSON() ([]byte, error) { 2079 type NoMethod Sentiment 2080 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2081 } 2082 2083 func (s *Sentiment) UnmarshalJSON(data []byte) error { 2084 type NoMethod Sentiment 2085 var s1 struct { 2086 Magnitude gensupport.JSONFloat64 `json:"magnitude"` 2087 Score gensupport.JSONFloat64 `json:"score"` 2088 *NoMethod 2089 } 2090 s1.NoMethod = (*NoMethod)(s) 2091 if err := json.Unmarshal(data, &s1); err != nil { 2092 return err 2093 } 2094 s.Magnitude = float64(s1.Magnitude) 2095 s.Score = float64(s1.Score) 2096 return nil 2097 } 2098 2099 // Status: The `Status` type defines a logical error model that is suitable for 2100 // different programming environments, including REST APIs and RPC APIs. It is 2101 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 2102 // pieces of data: error code, error message, and error details. You can find 2103 // out more about this error model and how to work with it in the API Design 2104 // Guide (https://cloud.google.com/apis/design/errors). 2105 type Status struct { 2106 // Code: The status code, which should be an enum value of google.rpc.Code. 2107 Code int64 `json:"code,omitempty"` 2108 // Details: A list of messages that carry the error details. There is a common 2109 // set of message types for APIs to use. 2110 Details []googleapi.RawMessage `json:"details,omitempty"` 2111 // Message: A developer-facing error message, which should be in English. Any 2112 // user-facing error message should be localized and sent in the 2113 // google.rpc.Status.details field, or localized by the client. 2114 Message string `json:"message,omitempty"` 2115 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 2116 // include in API requests. By default, fields with empty or default values are 2117 // omitted from API requests. See 2118 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2119 // details. 2120 ForceSendFields []string `json:"-"` 2121 // NullFields is a list of field names (e.g. "Code") to include in API requests 2122 // with the JSON null value. By default, fields with empty values are omitted 2123 // from API requests. See 2124 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2125 NullFields []string `json:"-"` 2126 } 2127 2128 func (s *Status) MarshalJSON() ([]byte, error) { 2129 type NoMethod Status 2130 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2131 } 2132 2133 // TextSpan: Represents a text span in the input document. 2134 type TextSpan struct { 2135 // BeginOffset: The API calculates the beginning offset of the content in the 2136 // original document according to the EncodingType specified in the API 2137 // request. 2138 BeginOffset int64 `json:"beginOffset,omitempty"` 2139 // Content: The content of the text span, which is a substring of the document. 2140 Content string `json:"content,omitempty"` 2141 // ForceSendFields is a list of field names (e.g. "BeginOffset") to 2142 // unconditionally include in API requests. By default, fields with empty or 2143 // default values are omitted from API requests. See 2144 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2145 // details. 2146 ForceSendFields []string `json:"-"` 2147 // NullFields is a list of field names (e.g. "BeginOffset") to include in API 2148 // requests with the JSON null value. By default, fields with empty values are 2149 // omitted from API requests. See 2150 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2151 NullFields []string `json:"-"` 2152 } 2153 2154 func (s *TextSpan) MarshalJSON() ([]byte, error) { 2155 type NoMethod TextSpan 2156 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2157 } 2158 2159 // Token: Represents the smallest syntactic building block of the text. 2160 type Token struct { 2161 // DependencyEdge: Dependency tree parse for this token. 2162 DependencyEdge *DependencyEdge `json:"dependencyEdge,omitempty"` 2163 // Lemma: Lemma (https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the 2164 // token. 2165 Lemma string `json:"lemma,omitempty"` 2166 // PartOfSpeech: Parts of speech tag for this token. 2167 PartOfSpeech *PartOfSpeech `json:"partOfSpeech,omitempty"` 2168 // Text: The token text. 2169 Text *TextSpan `json:"text,omitempty"` 2170 // ForceSendFields is a list of field names (e.g. "DependencyEdge") to 2171 // unconditionally include in API requests. By default, fields with empty or 2172 // default values are omitted from API requests. See 2173 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2174 // details. 2175 ForceSendFields []string `json:"-"` 2176 // NullFields is a list of field names (e.g. "DependencyEdge") to include in 2177 // API requests with the JSON null value. By default, fields with empty values 2178 // are omitted from API requests. See 2179 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2180 NullFields []string `json:"-"` 2181 } 2182 2183 func (s *Token) MarshalJSON() ([]byte, error) { 2184 type NoMethod Token 2185 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2186 } 2187 2188 type TpuMetric struct { 2189 // TpuSec: Required. Seconds of TPU usage, e.g. 3600. 2190 TpuSec int64 `json:"tpuSec,omitempty,string"` 2191 // TpuType: Required. Type of TPU, e.g. TPU_V2, TPU_V3_POD. 2192 // 2193 // Possible values: 2194 // "UNKNOWN_TPU_TYPE" 2195 // "TPU_V2_POD" 2196 // "TPU_V2" 2197 // "TPU_V3_POD" 2198 // "TPU_V3" 2199 // "TPU_V5_LITEPOD" 2200 TpuType string `json:"tpuType,omitempty"` 2201 // ForceSendFields is a list of field names (e.g. "TpuSec") to unconditionally 2202 // include in API requests. By default, fields with empty or default values are 2203 // 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. "TpuSec") 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 *TpuMetric) MarshalJSON() ([]byte, error) { 2215 type NoMethod TpuMetric 2216 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2217 } 2218 2219 // XPSArrayStats: The data statistics of a series of ARRAY values. 2220 type XPSArrayStats struct { 2221 CommonStats *XPSCommonStats `json:"commonStats,omitempty"` 2222 // MemberStats: Stats of all the values of all arrays, as if they were a single 2223 // long series of data. The type depends on the element type of the array. 2224 MemberStats *XPSDataStats `json:"memberStats,omitempty"` 2225 // ForceSendFields is a list of field names (e.g. "CommonStats") to 2226 // unconditionally include in API requests. By default, fields with empty or 2227 // default values are omitted from API requests. See 2228 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2229 // details. 2230 ForceSendFields []string `json:"-"` 2231 // NullFields is a list of field names (e.g. "CommonStats") to include in API 2232 // requests with the JSON null value. By default, fields with empty values are 2233 // omitted from API requests. See 2234 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2235 NullFields []string `json:"-"` 2236 } 2237 2238 func (s *XPSArrayStats) MarshalJSON() ([]byte, error) { 2239 type NoMethod XPSArrayStats 2240 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2241 } 2242 2243 type XPSBatchPredictResponse struct { 2244 // ExampleSet: Examples for batch prediction result. Under full API 2245 // implementation, results are stored in shared RecordIO of AnnotatedExample 2246 // protobufs, the annotations field of which is populated by XPS backend. 2247 ExampleSet *XPSExampleSet `json:"exampleSet,omitempty"` 2248 // ForceSendFields is a list of field names (e.g. "ExampleSet") to 2249 // unconditionally include in API requests. By default, fields with empty or 2250 // default values are omitted from API requests. See 2251 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2252 // details. 2253 ForceSendFields []string `json:"-"` 2254 // NullFields is a list of field names (e.g. "ExampleSet") to include in API 2255 // requests with the JSON null value. By default, fields with empty values are 2256 // omitted from API requests. See 2257 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2258 NullFields []string `json:"-"` 2259 } 2260 2261 func (s *XPSBatchPredictResponse) MarshalJSON() ([]byte, error) { 2262 type NoMethod XPSBatchPredictResponse 2263 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2264 } 2265 2266 // XPSBoundingBoxMetricsEntry: Bounding box matching model metrics for a single 2267 // intersection-over-union threshold and multiple label match confidence 2268 // thresholds. 2269 type XPSBoundingBoxMetricsEntry struct { 2270 // ConfidenceMetricsEntries: Metrics for each label-match confidence_threshold 2271 // from 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. 2272 ConfidenceMetricsEntries []*XPSBoundingBoxMetricsEntryConfidenceMetricsEntry `json:"confidenceMetricsEntries,omitempty"` 2273 // IouThreshold: The intersection-over-union threshold value used to compute 2274 // this metrics entry. 2275 IouThreshold float64 `json:"iouThreshold,omitempty"` 2276 // MeanAveragePrecision: The mean average precision. 2277 MeanAveragePrecision float64 `json:"meanAveragePrecision,omitempty"` 2278 // ForceSendFields is a list of field names (e.g. "ConfidenceMetricsEntries") 2279 // to unconditionally include in API requests. By default, fields with empty or 2280 // default values are omitted from API requests. See 2281 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2282 // details. 2283 ForceSendFields []string `json:"-"` 2284 // NullFields is a list of field names (e.g. "ConfidenceMetricsEntries") to 2285 // include in API requests with the JSON null value. By default, fields with 2286 // empty values are omitted from API requests. See 2287 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2288 NullFields []string `json:"-"` 2289 } 2290 2291 func (s *XPSBoundingBoxMetricsEntry) MarshalJSON() ([]byte, error) { 2292 type NoMethod XPSBoundingBoxMetricsEntry 2293 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2294 } 2295 2296 func (s *XPSBoundingBoxMetricsEntry) UnmarshalJSON(data []byte) error { 2297 type NoMethod XPSBoundingBoxMetricsEntry 2298 var s1 struct { 2299 IouThreshold gensupport.JSONFloat64 `json:"iouThreshold"` 2300 MeanAveragePrecision gensupport.JSONFloat64 `json:"meanAveragePrecision"` 2301 *NoMethod 2302 } 2303 s1.NoMethod = (*NoMethod)(s) 2304 if err := json.Unmarshal(data, &s1); err != nil { 2305 return err 2306 } 2307 s.IouThreshold = float64(s1.IouThreshold) 2308 s.MeanAveragePrecision = float64(s1.MeanAveragePrecision) 2309 return nil 2310 } 2311 2312 // XPSBoundingBoxMetricsEntryConfidenceMetricsEntry: Metrics for a single 2313 // confidence threshold. 2314 type XPSBoundingBoxMetricsEntryConfidenceMetricsEntry struct { 2315 // ConfidenceThreshold: The confidence threshold value used to compute the 2316 // metrics. 2317 ConfidenceThreshold float64 `json:"confidenceThreshold,omitempty"` 2318 // F1Score: The harmonic mean of recall and precision. 2319 F1Score float64 `json:"f1Score,omitempty"` 2320 // Precision: Precision for the given confidence threshold. 2321 Precision float64 `json:"precision,omitempty"` 2322 // Recall: Recall for the given confidence threshold. 2323 Recall float64 `json:"recall,omitempty"` 2324 // ForceSendFields is a list of field names (e.g. "ConfidenceThreshold") to 2325 // unconditionally include in API requests. By default, fields with empty or 2326 // default values are omitted from API requests. See 2327 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2328 // details. 2329 ForceSendFields []string `json:"-"` 2330 // NullFields is a list of field names (e.g. "ConfidenceThreshold") to include 2331 // in API requests with the JSON null value. By default, fields with empty 2332 // values are omitted from API requests. See 2333 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2334 NullFields []string `json:"-"` 2335 } 2336 2337 func (s *XPSBoundingBoxMetricsEntryConfidenceMetricsEntry) MarshalJSON() ([]byte, error) { 2338 type NoMethod XPSBoundingBoxMetricsEntryConfidenceMetricsEntry 2339 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2340 } 2341 2342 func (s *XPSBoundingBoxMetricsEntryConfidenceMetricsEntry) UnmarshalJSON(data []byte) error { 2343 type NoMethod XPSBoundingBoxMetricsEntryConfidenceMetricsEntry 2344 var s1 struct { 2345 ConfidenceThreshold gensupport.JSONFloat64 `json:"confidenceThreshold"` 2346 F1Score gensupport.JSONFloat64 `json:"f1Score"` 2347 Precision gensupport.JSONFloat64 `json:"precision"` 2348 Recall gensupport.JSONFloat64 `json:"recall"` 2349 *NoMethod 2350 } 2351 s1.NoMethod = (*NoMethod)(s) 2352 if err := json.Unmarshal(data, &s1); err != nil { 2353 return err 2354 } 2355 s.ConfidenceThreshold = float64(s1.ConfidenceThreshold) 2356 s.F1Score = float64(s1.F1Score) 2357 s.Precision = float64(s1.Precision) 2358 s.Recall = float64(s1.Recall) 2359 return nil 2360 } 2361 2362 // XPSCategoryStats: The data statistics of a series of CATEGORY values. 2363 type XPSCategoryStats struct { 2364 CommonStats *XPSCommonStats `json:"commonStats,omitempty"` 2365 // TopCategoryStats: The statistics of the top 20 CATEGORY values, ordered by 2366 // CategoryStats.SingleCategoryStats.count. 2367 TopCategoryStats []*XPSCategoryStatsSingleCategoryStats `json:"topCategoryStats,omitempty"` 2368 // ForceSendFields is a list of field names (e.g. "CommonStats") to 2369 // unconditionally include in API requests. By default, fields with empty or 2370 // default values are omitted from API requests. See 2371 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2372 // details. 2373 ForceSendFields []string `json:"-"` 2374 // NullFields is a list of field names (e.g. "CommonStats") to include in API 2375 // requests with the JSON null value. By default, fields with empty values are 2376 // omitted from API requests. See 2377 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2378 NullFields []string `json:"-"` 2379 } 2380 2381 func (s *XPSCategoryStats) MarshalJSON() ([]byte, error) { 2382 type NoMethod XPSCategoryStats 2383 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2384 } 2385 2386 // XPSCategoryStatsSingleCategoryStats: The statistics of a single CATEGORY 2387 // value. 2388 type XPSCategoryStatsSingleCategoryStats struct { 2389 // Count: The number of occurrences of this value in the series. 2390 Count int64 `json:"count,omitempty,string"` 2391 // Value: The CATEGORY value. 2392 Value string `json:"value,omitempty"` 2393 // ForceSendFields is a list of field names (e.g. "Count") to unconditionally 2394 // include in API requests. By default, fields with empty or default values are 2395 // omitted from API requests. See 2396 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2397 // details. 2398 ForceSendFields []string `json:"-"` 2399 // NullFields is a list of field names (e.g. "Count") to include in API 2400 // requests with the JSON null value. By default, fields with empty values are 2401 // omitted from API requests. See 2402 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2403 NullFields []string `json:"-"` 2404 } 2405 2406 func (s *XPSCategoryStatsSingleCategoryStats) MarshalJSON() ([]byte, error) { 2407 type NoMethod XPSCategoryStatsSingleCategoryStats 2408 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2409 } 2410 2411 // XPSClassificationEvaluationMetrics: Model evaluation metrics for 2412 // classification problems. It can be used for image and video classification. 2413 // Next tag: 9. 2414 type XPSClassificationEvaluationMetrics struct { 2415 // AuPrc: The Area under precision recall curve metric. 2416 AuPrc float64 `json:"auPrc,omitempty"` 2417 // AuRoc: The Area Under Receiver Operating Characteristic curve metric. 2418 // Micro-averaged for the overall evaluation. 2419 AuRoc float64 `json:"auRoc,omitempty"` 2420 // BaseAuPrc: The Area under precision recall curve metric based on priors. 2421 BaseAuPrc float64 `json:"baseAuPrc,omitempty"` 2422 // ConfidenceMetricsEntries: Metrics that have confidence thresholds. 2423 // Precision-recall curve can be derived from it. 2424 ConfidenceMetricsEntries []*XPSConfidenceMetricsEntry `json:"confidenceMetricsEntries,omitempty"` 2425 // ConfusionMatrix: Confusion matrix of the evaluation. Only set for MULTICLASS 2426 // classification problems where number of annotation specs is no more than 10. 2427 // Only set for model level evaluation, not for evaluation per label. 2428 ConfusionMatrix *XPSConfusionMatrix `json:"confusionMatrix,omitempty"` 2429 // EvaluatedExamplesCount: The number of examples used for model evaluation. 2430 EvaluatedExamplesCount int64 `json:"evaluatedExamplesCount,omitempty"` 2431 // LogLoss: The Log Loss metric. 2432 LogLoss float64 `json:"logLoss,omitempty"` 2433 // ForceSendFields is a list of field names (e.g. "AuPrc") to unconditionally 2434 // include in API requests. By default, fields with empty or default values are 2435 // omitted from API requests. See 2436 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2437 // details. 2438 ForceSendFields []string `json:"-"` 2439 // NullFields is a list of field names (e.g. "AuPrc") to include in API 2440 // requests with the JSON null value. By default, fields with empty values are 2441 // omitted from API requests. See 2442 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2443 NullFields []string `json:"-"` 2444 } 2445 2446 func (s *XPSClassificationEvaluationMetrics) MarshalJSON() ([]byte, error) { 2447 type NoMethod XPSClassificationEvaluationMetrics 2448 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2449 } 2450 2451 func (s *XPSClassificationEvaluationMetrics) UnmarshalJSON(data []byte) error { 2452 type NoMethod XPSClassificationEvaluationMetrics 2453 var s1 struct { 2454 AuPrc gensupport.JSONFloat64 `json:"auPrc"` 2455 AuRoc gensupport.JSONFloat64 `json:"auRoc"` 2456 BaseAuPrc gensupport.JSONFloat64 `json:"baseAuPrc"` 2457 LogLoss gensupport.JSONFloat64 `json:"logLoss"` 2458 *NoMethod 2459 } 2460 s1.NoMethod = (*NoMethod)(s) 2461 if err := json.Unmarshal(data, &s1); err != nil { 2462 return err 2463 } 2464 s.AuPrc = float64(s1.AuPrc) 2465 s.AuRoc = float64(s1.AuRoc) 2466 s.BaseAuPrc = float64(s1.BaseAuPrc) 2467 s.LogLoss = float64(s1.LogLoss) 2468 return nil 2469 } 2470 2471 // XPSColorMap: Map from color to display name. Will only be used by Image 2472 // Segmentation for uCAIP. 2473 type XPSColorMap struct { 2474 // AnnotationSpecIdToken: Should be used during training. 2475 AnnotationSpecIdToken string `json:"annotationSpecIdToken,omitempty"` 2476 // Color: This type is deprecated in favor of the IntColor below. This is 2477 // because google.type.Color represent color has a float which semantically 2478 // does not reflect discrete classes/categories concept. Moreover, to handle it 2479 // well we need to have some tolerance when converting to a discretized color. 2480 // As such, the recommendation is to have API surface still use 2481 // google.type.Color while internally IntColor is used. 2482 Color *Color `json:"color,omitempty"` 2483 // DisplayName: Should be used during preprocessing. 2484 DisplayName string `json:"displayName,omitempty"` 2485 IntColor *XPSColorMapIntColor `json:"intColor,omitempty"` 2486 // ForceSendFields is a list of field names (e.g. "AnnotationSpecIdToken") to 2487 // unconditionally include in API requests. By default, fields with empty or 2488 // default values are omitted from API requests. See 2489 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2490 // details. 2491 ForceSendFields []string `json:"-"` 2492 // NullFields is a list of field names (e.g. "AnnotationSpecIdToken") to 2493 // include in API requests with the JSON null value. By default, fields with 2494 // empty values are omitted from API requests. See 2495 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2496 NullFields []string `json:"-"` 2497 } 2498 2499 func (s *XPSColorMap) MarshalJSON() ([]byte, error) { 2500 type NoMethod XPSColorMap 2501 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2502 } 2503 2504 // XPSColorMapIntColor: RGB color and each channel is represented by an 2505 // integer. 2506 type XPSColorMapIntColor struct { 2507 // Blue: The value should be in range of [0, 255]. 2508 Blue int64 `json:"blue,omitempty"` 2509 // Green: The value should be in range of [0, 255]. 2510 Green int64 `json:"green,omitempty"` 2511 // Red: The value should be in range of [0, 255]. 2512 Red int64 `json:"red,omitempty"` 2513 // ForceSendFields is a list of field names (e.g. "Blue") to unconditionally 2514 // include in API requests. By default, fields with empty or default values are 2515 // omitted from API requests. See 2516 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2517 // details. 2518 ForceSendFields []string `json:"-"` 2519 // NullFields is a list of field names (e.g. "Blue") to include in API requests 2520 // with the JSON null value. By default, fields with empty values are omitted 2521 // from API requests. See 2522 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2523 NullFields []string `json:"-"` 2524 } 2525 2526 func (s *XPSColorMapIntColor) MarshalJSON() ([]byte, error) { 2527 type NoMethod XPSColorMapIntColor 2528 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2529 } 2530 2531 type XPSColumnSpec struct { 2532 // ColumnId: The unique id of the column. When Preprocess, the Tables BE will 2533 // popuate the order id of the column, which reflects the order of the column 2534 // inside the table, i.e. 0 means the first column in the table, N-1 means the 2535 // last column. AutoML BE will persist this order id in Spanner and set the 2536 // order id here when calling RefreshTablesStats and Train. Note: it's 2537 // different than the column_spec_id that is generated in AutoML BE. 2538 ColumnId int64 `json:"columnId,omitempty"` 2539 // DataStats: The data stats of the column. It's outputed in RefreshTablesStats 2540 // and a required input for Train. 2541 DataStats *XPSDataStats `json:"dataStats,omitempty"` 2542 // DataType: The data type of the column. It's outputed in Preprocess rpc and a 2543 // required input for RefreshTablesStats and Train. 2544 DataType *XPSDataType `json:"dataType,omitempty"` 2545 // DisplayName: The display name of the column. It's outputed in Preprocess and 2546 // a required input for RefreshTablesStats and Train. 2547 DisplayName string `json:"displayName,omitempty"` 2548 ForecastingMetadata *XPSColumnSpecForecastingMetadata `json:"forecastingMetadata,omitempty"` 2549 // TopCorrelatedColumns: It's outputed in RefreshTablesStats, and a required 2550 // input in Train. 2551 TopCorrelatedColumns []*XPSColumnSpecCorrelatedColumn `json:"topCorrelatedColumns,omitempty"` 2552 // ForceSendFields is a list of field names (e.g. "ColumnId") to 2553 // unconditionally include in API requests. By default, fields with empty or 2554 // default values are omitted from API requests. See 2555 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2556 // details. 2557 ForceSendFields []string `json:"-"` 2558 // NullFields is a list of field names (e.g. "ColumnId") to include in API 2559 // requests with the JSON null value. By default, fields with empty values are 2560 // omitted from API requests. See 2561 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2562 NullFields []string `json:"-"` 2563 } 2564 2565 func (s *XPSColumnSpec) MarshalJSON() ([]byte, error) { 2566 type NoMethod XPSColumnSpec 2567 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2568 } 2569 2570 // XPSColumnSpecCorrelatedColumn: Identifies a table's column, and its 2571 // correlation with the column this ColumnSpec describes. 2572 type XPSColumnSpecCorrelatedColumn struct { 2573 ColumnId int64 `json:"columnId,omitempty"` 2574 CorrelationStats *XPSCorrelationStats `json:"correlationStats,omitempty"` 2575 // ForceSendFields is a list of field names (e.g. "ColumnId") to 2576 // unconditionally include in API requests. By default, fields with empty or 2577 // default values are omitted from API requests. See 2578 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2579 // details. 2580 ForceSendFields []string `json:"-"` 2581 // NullFields is a list of field names (e.g. "ColumnId") to include in API 2582 // requests with the JSON null value. By default, fields with empty values are 2583 // omitted from API requests. See 2584 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2585 NullFields []string `json:"-"` 2586 } 2587 2588 func (s *XPSColumnSpecCorrelatedColumn) MarshalJSON() ([]byte, error) { 2589 type NoMethod XPSColumnSpecCorrelatedColumn 2590 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2591 } 2592 2593 // XPSColumnSpecForecastingMetadata: 2594 // =========================================================================== 2595 // # The fields below are used exclusively for Forecasting. 2596 type XPSColumnSpecForecastingMetadata struct { 2597 // ColumnType: The type of the column for FORECASTING model training purposes. 2598 // 2599 // Possible values: 2600 // "COLUMN_TYPE_UNSPECIFIED" - An un-set value of this enum. 2601 // "KEY" - Key columns are used to identify timeseries. 2602 // "KEY_METADATA" - This column contains information describing static 2603 // properties of the entities identified by the key column(s) (e.g. city's ZIP 2604 // code). 2605 // "TIME_SERIES_AVAILABLE_PAST_ONLY" - This column contains information for 2606 // the given entity, at any time poinrt, they are only available in the time 2607 // series before. 2608 // "TIME_SERIES_AVAILABLE_PAST_AND_FUTURE" - This column contains information 2609 // for the given entity is known both for the past and the sufficiently far 2610 // future. 2611 ColumnType string `json:"columnType,omitempty"` 2612 // ForceSendFields is a list of field names (e.g. "ColumnType") to 2613 // unconditionally include in API requests. By default, fields with empty or 2614 // default values are omitted from API requests. See 2615 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2616 // details. 2617 ForceSendFields []string `json:"-"` 2618 // NullFields is a list of field names (e.g. "ColumnType") to include in API 2619 // requests with the JSON null value. By default, fields with empty values are 2620 // omitted from API requests. See 2621 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2622 NullFields []string `json:"-"` 2623 } 2624 2625 func (s *XPSColumnSpecForecastingMetadata) MarshalJSON() ([]byte, error) { 2626 type NoMethod XPSColumnSpecForecastingMetadata 2627 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2628 } 2629 2630 // XPSCommonStats: Common statistics for a column with a specified data type. 2631 type XPSCommonStats struct { 2632 DistinctValueCount int64 `json:"distinctValueCount,omitempty,string"` 2633 NullValueCount int64 `json:"nullValueCount,omitempty,string"` 2634 ValidValueCount int64 `json:"validValueCount,omitempty,string"` 2635 // ForceSendFields is a list of field names (e.g. "DistinctValueCount") to 2636 // unconditionally include in API requests. By default, fields with empty or 2637 // default values are omitted from API requests. See 2638 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2639 // details. 2640 ForceSendFields []string `json:"-"` 2641 // NullFields is a list of field names (e.g. "DistinctValueCount") to include 2642 // in API requests with the JSON null value. By default, fields with empty 2643 // values are omitted from API requests. See 2644 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2645 NullFields []string `json:"-"` 2646 } 2647 2648 func (s *XPSCommonStats) MarshalJSON() ([]byte, error) { 2649 type NoMethod XPSCommonStats 2650 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2651 } 2652 2653 // XPSConfidenceMetricsEntry: ConfidenceMetricsEntry includes generic 2654 // precision, recall, f1 score etc. Next tag: 16. 2655 type XPSConfidenceMetricsEntry struct { 2656 // ConfidenceThreshold: Metrics are computed with an assumption that the model 2657 // never return predictions with score lower than this value. 2658 ConfidenceThreshold float64 `json:"confidenceThreshold,omitempty"` 2659 // F1Score: The harmonic mean of recall and precision. 2660 F1Score float64 `json:"f1Score,omitempty"` 2661 // F1ScoreAt1: The harmonic mean of recall_at1 and precision_at1. 2662 F1ScoreAt1 float64 `json:"f1ScoreAt1,omitempty"` 2663 // FalseNegativeCount: The number of ground truth labels that are not matched 2664 // by a model created label. 2665 FalseNegativeCount int64 `json:"falseNegativeCount,omitempty,string"` 2666 // FalsePositiveCount: The number of model created labels that do not match a 2667 // ground truth label. 2668 FalsePositiveCount int64 `json:"falsePositiveCount,omitempty,string"` 2669 // FalsePositiveRate: False Positive Rate for the given confidence threshold. 2670 FalsePositiveRate float64 `json:"falsePositiveRate,omitempty"` 2671 // FalsePositiveRateAt1: The False Positive Rate when only considering the 2672 // label that has the highest prediction score and not below the confidence 2673 // threshold for each example. 2674 FalsePositiveRateAt1 float64 `json:"falsePositiveRateAt1,omitempty"` 2675 // PositionThreshold: Metrics are computed with an assumption that the model 2676 // always returns at most this many predictions (ordered by their score, 2677 // descendingly), but they all still need to meet the confidence_threshold. 2678 PositionThreshold int64 `json:"positionThreshold,omitempty"` 2679 // Precision: Precision for the given confidence threshold. 2680 Precision float64 `json:"precision,omitempty"` 2681 // PrecisionAt1: The precision when only considering the label that has the 2682 // highest prediction score and not below the confidence threshold for each 2683 // example. 2684 PrecisionAt1 float64 `json:"precisionAt1,omitempty"` 2685 // Recall: Recall (true positive rate) for the given confidence threshold. 2686 Recall float64 `json:"recall,omitempty"` 2687 // RecallAt1: The recall (true positive rate) when only considering the label 2688 // that has the highest prediction score and not below the confidence threshold 2689 // for each example. 2690 RecallAt1 float64 `json:"recallAt1,omitempty"` 2691 // TrueNegativeCount: The number of labels that were not created by the model, 2692 // but if they would, they would not match a ground truth label. 2693 TrueNegativeCount int64 `json:"trueNegativeCount,omitempty,string"` 2694 // TruePositiveCount: The number of model created labels that match a ground 2695 // truth label. 2696 TruePositiveCount int64 `json:"truePositiveCount,omitempty,string"` 2697 // ForceSendFields is a list of field names (e.g. "ConfidenceThreshold") to 2698 // unconditionally include in API requests. By default, fields with empty or 2699 // default values are omitted from API requests. See 2700 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2701 // details. 2702 ForceSendFields []string `json:"-"` 2703 // NullFields is a list of field names (e.g. "ConfidenceThreshold") to include 2704 // in API requests with the JSON null value. By default, fields with empty 2705 // values are omitted from API requests. See 2706 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2707 NullFields []string `json:"-"` 2708 } 2709 2710 func (s *XPSConfidenceMetricsEntry) MarshalJSON() ([]byte, error) { 2711 type NoMethod XPSConfidenceMetricsEntry 2712 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2713 } 2714 2715 func (s *XPSConfidenceMetricsEntry) UnmarshalJSON(data []byte) error { 2716 type NoMethod XPSConfidenceMetricsEntry 2717 var s1 struct { 2718 ConfidenceThreshold gensupport.JSONFloat64 `json:"confidenceThreshold"` 2719 F1Score gensupport.JSONFloat64 `json:"f1Score"` 2720 F1ScoreAt1 gensupport.JSONFloat64 `json:"f1ScoreAt1"` 2721 FalsePositiveRate gensupport.JSONFloat64 `json:"falsePositiveRate"` 2722 FalsePositiveRateAt1 gensupport.JSONFloat64 `json:"falsePositiveRateAt1"` 2723 Precision gensupport.JSONFloat64 `json:"precision"` 2724 PrecisionAt1 gensupport.JSONFloat64 `json:"precisionAt1"` 2725 Recall gensupport.JSONFloat64 `json:"recall"` 2726 RecallAt1 gensupport.JSONFloat64 `json:"recallAt1"` 2727 *NoMethod 2728 } 2729 s1.NoMethod = (*NoMethod)(s) 2730 if err := json.Unmarshal(data, &s1); err != nil { 2731 return err 2732 } 2733 s.ConfidenceThreshold = float64(s1.ConfidenceThreshold) 2734 s.F1Score = float64(s1.F1Score) 2735 s.F1ScoreAt1 = float64(s1.F1ScoreAt1) 2736 s.FalsePositiveRate = float64(s1.FalsePositiveRate) 2737 s.FalsePositiveRateAt1 = float64(s1.FalsePositiveRateAt1) 2738 s.Precision = float64(s1.Precision) 2739 s.PrecisionAt1 = float64(s1.PrecisionAt1) 2740 s.Recall = float64(s1.Recall) 2741 s.RecallAt1 = float64(s1.RecallAt1) 2742 return nil 2743 } 2744 2745 // XPSConfusionMatrix: Confusion matrix of the model running the 2746 // classification. 2747 type XPSConfusionMatrix struct { 2748 // AnnotationSpecIdToken: For the following three repeated fields, only one is 2749 // intended to be set. annotation_spec_id_token is preferable to be set. ID 2750 // tokens of the annotation specs used in the confusion matrix. 2751 AnnotationSpecIdToken []string `json:"annotationSpecIdToken,omitempty"` 2752 // Category: Category (mainly for segmentation). Set only for image 2753 // segmentation models. Note: uCAIP Image Segmentation should use 2754 // annotation_spec_id_token. 2755 Category []int64 `json:"category,omitempty"` 2756 // Row: Rows in the confusion matrix. The number of rows is equal to the size 2757 // of `annotation_spec_id_token`. `row[i].value[j]` is the number of examples 2758 // that have ground truth of the `annotation_spec_id_token[i]` and are 2759 // predicted as `annotation_spec_id_token[j]` by the model being evaluated. 2760 Row []*XPSConfusionMatrixRow `json:"row,omitempty"` 2761 // SentimentLabel: Sentiment labels used in the confusion matrix. Set only for 2762 // text sentiment models. For AutoML Text Revamp, use 2763 // `annotation_spec_id_token` instead and leave this field empty. 2764 SentimentLabel []int64 `json:"sentimentLabel,omitempty"` 2765 // ForceSendFields is a list of field names (e.g. "AnnotationSpecIdToken") to 2766 // unconditionally include in API requests. By default, fields with empty or 2767 // default values are omitted from API requests. See 2768 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2769 // details. 2770 ForceSendFields []string `json:"-"` 2771 // NullFields is a list of field names (e.g. "AnnotationSpecIdToken") to 2772 // include in API requests with the JSON null value. By default, fields with 2773 // empty values are omitted from API requests. See 2774 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2775 NullFields []string `json:"-"` 2776 } 2777 2778 func (s *XPSConfusionMatrix) MarshalJSON() ([]byte, error) { 2779 type NoMethod XPSConfusionMatrix 2780 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2781 } 2782 2783 // XPSConfusionMatrixRow: A row in the confusion matrix. 2784 type XPSConfusionMatrixRow struct { 2785 // Count: Same as above except intended to represent other counts (for e.g. for 2786 // segmentation this is pixel count). NOTE(params): Only example_count or count 2787 // is set (oneoff does not support repeated fields unless they are embedded 2788 // inside another message). 2789 Count googleapi.Int64s `json:"count,omitempty"` 2790 // ExampleCount: Value of the specific cell in the confusion matrix. The number 2791 // of values each row has (i.e. the length of the row) is equal to the length 2792 // of the annotation_spec_id_token field. 2793 ExampleCount []int64 `json:"exampleCount,omitempty"` 2794 // ForceSendFields is a list of field names (e.g. "Count") to unconditionally 2795 // include in API requests. By default, fields with empty or default values are 2796 // omitted from API requests. See 2797 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2798 // details. 2799 ForceSendFields []string `json:"-"` 2800 // NullFields is a list of field names (e.g. "Count") to include in API 2801 // requests with the JSON null value. By default, fields with empty values are 2802 // omitted from API requests. See 2803 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2804 NullFields []string `json:"-"` 2805 } 2806 2807 func (s *XPSConfusionMatrixRow) MarshalJSON() ([]byte, error) { 2808 type NoMethod XPSConfusionMatrixRow 2809 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2810 } 2811 2812 // XPSCoreMlFormat: A model format used for iOS mobile devices. 2813 type XPSCoreMlFormat struct { 2814 } 2815 2816 // XPSCorrelationStats: A correlation statistics between two series of DataType 2817 // values. The series may have differing DataType-s, but within a single series 2818 // the DataType must be the same. 2819 type XPSCorrelationStats struct { 2820 // CramersV: The correlation value using the Cramer's V measure. 2821 CramersV float64 `json:"cramersV,omitempty"` 2822 // ForceSendFields is a list of field names (e.g. "CramersV") to 2823 // unconditionally include in API requests. By default, fields with empty or 2824 // default values are omitted from API requests. See 2825 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2826 // details. 2827 ForceSendFields []string `json:"-"` 2828 // NullFields is a list of field names (e.g. "CramersV") to include in API 2829 // requests with the JSON null value. By default, fields with empty values are 2830 // omitted from API requests. See 2831 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2832 NullFields []string `json:"-"` 2833 } 2834 2835 func (s *XPSCorrelationStats) MarshalJSON() ([]byte, error) { 2836 type NoMethod XPSCorrelationStats 2837 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2838 } 2839 2840 func (s *XPSCorrelationStats) UnmarshalJSON(data []byte) error { 2841 type NoMethod XPSCorrelationStats 2842 var s1 struct { 2843 CramersV gensupport.JSONFloat64 `json:"cramersV"` 2844 *NoMethod 2845 } 2846 s1.NoMethod = (*NoMethod)(s) 2847 if err := json.Unmarshal(data, &s1); err != nil { 2848 return err 2849 } 2850 s.CramersV = float64(s1.CramersV) 2851 return nil 2852 } 2853 2854 // XPSDataErrors: Different types of errors and the stats associatesd with each 2855 // error. 2856 type XPSDataErrors struct { 2857 // Count: Number of records having errors associated with the enum. 2858 Count int64 `json:"count,omitempty"` 2859 // ErrorType: Type of the error. 2860 // 2861 // Possible values: 2862 // "ERROR_TYPE_UNSPECIFIED" - Not specified. 2863 // "UNSUPPORTED_AUDIO_FORMAT" - Audio format not in the formats by 2864 // cloud-speech AutoML. Currently only wav and flac file formats are supported. 2865 // "FILE_EXTENSION_MISMATCH_WITH_AUDIO_FORMAT" - File format differnt from 2866 // what is specified in the file name extension. 2867 // "FILE_TOO_LARGE" - File too large. Maximum allowed size is 50 MB. 2868 // "MISSING_TRANSCRIPTION" - Transcript is missing. 2869 ErrorType string `json:"errorType,omitempty"` 2870 // ForceSendFields is a list of field names (e.g. "Count") to unconditionally 2871 // include in API requests. By default, fields with empty or default values are 2872 // omitted from API requests. See 2873 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2874 // details. 2875 ForceSendFields []string `json:"-"` 2876 // NullFields is a list of field names (e.g. "Count") to include in API 2877 // requests with the JSON null value. By default, fields with empty values are 2878 // omitted from API requests. See 2879 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2880 NullFields []string `json:"-"` 2881 } 2882 2883 func (s *XPSDataErrors) MarshalJSON() ([]byte, error) { 2884 type NoMethod XPSDataErrors 2885 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2886 } 2887 2888 // XPSDataStats: The data statistics of a series of values that share the same 2889 // DataType. 2890 type XPSDataStats struct { 2891 // ArrayStats: The statistics for ARRAY DataType. 2892 ArrayStats *XPSArrayStats `json:"arrayStats,omitempty"` 2893 // CategoryStats: The statistics for CATEGORY DataType. 2894 CategoryStats *XPSCategoryStats `json:"categoryStats,omitempty"` 2895 // DistinctValueCount: The number of distinct values. 2896 DistinctValueCount int64 `json:"distinctValueCount,omitempty,string"` 2897 // Float64Stats: The statistics for FLOAT64 DataType. 2898 Float64Stats *XPSFloat64Stats `json:"float64Stats,omitempty"` 2899 // NullValueCount: The number of values that are null. 2900 NullValueCount int64 `json:"nullValueCount,omitempty,string"` 2901 // StringStats: The statistics for STRING DataType. 2902 StringStats *XPSStringStats `json:"stringStats,omitempty"` 2903 // StructStats: The statistics for STRUCT DataType. 2904 StructStats *XPSStructStats `json:"structStats,omitempty"` 2905 // TimestampStats: The statistics for TIMESTAMP DataType. 2906 TimestampStats *XPSTimestampStats `json:"timestampStats,omitempty"` 2907 // ValidValueCount: The number of values that are valid. 2908 ValidValueCount int64 `json:"validValueCount,omitempty,string"` 2909 // ForceSendFields is a list of field names (e.g. "ArrayStats") to 2910 // unconditionally include in API requests. By default, fields with empty or 2911 // default values are omitted from API requests. See 2912 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2913 // details. 2914 ForceSendFields []string `json:"-"` 2915 // NullFields is a list of field names (e.g. "ArrayStats") to include in API 2916 // requests with the JSON null value. By default, fields with empty values are 2917 // omitted from API requests. See 2918 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2919 NullFields []string `json:"-"` 2920 } 2921 2922 func (s *XPSDataStats) MarshalJSON() ([]byte, error) { 2923 type NoMethod XPSDataStats 2924 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2925 } 2926 2927 // XPSDataType: Indicated the type of data that can be stored in a structured 2928 // data entity (e.g. a table). 2929 type XPSDataType struct { 2930 // CompatibleDataTypes: The highly compatible data types to this data type. 2931 CompatibleDataTypes []*XPSDataType `json:"compatibleDataTypes,omitempty"` 2932 // ListElementType: If type_code == ARRAY, then `list_element_type` is the type 2933 // of the elements. 2934 ListElementType *XPSDataType `json:"listElementType,omitempty"` 2935 // Nullable: If true, this DataType can also be `null`. 2936 Nullable bool `json:"nullable,omitempty"` 2937 // StructType: If type_code == STRUCT, then `struct_type` provides type 2938 // information for the struct's fields. 2939 StructType *XPSStructType `json:"structType,omitempty"` 2940 // TimeFormat: If type_code == TIMESTAMP then `time_format` provides the format 2941 // in which that time field is expressed. The time_format must be written in 2942 // `strftime` syntax. If time_format is not set, then the default format as 2943 // described on the field is used. 2944 TimeFormat string `json:"timeFormat,omitempty"` 2945 // TypeCode: Required. The TypeCode for this type. 2946 // 2947 // Possible values: 2948 // "TYPE_CODE_UNSPECIFIED" - Not specified. Should not be used. 2949 // "FLOAT64" - Encoded as `number`, or the strings "NaN", "Infinity", or 2950 // "-Infinity". 2951 // "TIMESTAMP" - Must be between 0AD and 9999AD. Encoded as `string` 2952 // according to time_format, or, if that format is not set, then in RFC 3339 2953 // `date-time` format, where `time-offset` = "Z" (e.g. 2954 // 1985-04-12T23:20:50.52Z). 2955 // "STRING" - Encoded as `string`. 2956 // "ARRAY" - Encoded as `list`, where the list elements are represented 2957 // according to list_element_type. 2958 // "STRUCT" - Encoded as `struct`, where field values are represented 2959 // according to struct_type. 2960 // "CATEGORY" - Values of this type are not further understood by AutoML, 2961 // e.g. AutoML is unable to tell the order of values (as it could with 2962 // FLOAT64), or is unable to say if one value contains another (as it could 2963 // with STRING). Encoded as `string` (bytes should be base64-encoded, as 2964 // described in RFC 4648, section 4). 2965 TypeCode string `json:"typeCode,omitempty"` 2966 // ForceSendFields is a list of field names (e.g. "CompatibleDataTypes") to 2967 // unconditionally include in API requests. By default, fields with empty or 2968 // default values are omitted from API requests. See 2969 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2970 // details. 2971 ForceSendFields []string `json:"-"` 2972 // NullFields is a list of field names (e.g. "CompatibleDataTypes") to include 2973 // in API requests with the JSON null value. By default, fields with empty 2974 // values are omitted from API requests. See 2975 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2976 NullFields []string `json:"-"` 2977 } 2978 2979 func (s *XPSDataType) MarshalJSON() ([]byte, error) { 2980 type NoMethod XPSDataType 2981 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2982 } 2983 2984 // XPSDockerFormat: A model format used for Docker containers. Use the params 2985 // field to customize the container. The container is verified to work 2986 // correctly on ubuntu 16.04 operating system. 2987 type XPSDockerFormat struct { 2988 // CpuArchitecture: Optional. Additional cpu information describing the 2989 // requirements for the to be exported model files. 2990 // 2991 // Possible values: 2992 // "CPU_ARCHITECTURE_UNSPECIFIED" 2993 // "CPU_ARCHITECTURE_X86_64" 2994 CpuArchitecture string `json:"cpuArchitecture,omitempty"` 2995 // GpuArchitecture: Optional. Additional gpu information describing the 2996 // requirements for the to be exported model files. 2997 // 2998 // Possible values: 2999 // "GPU_ARCHITECTURE_UNSPECIFIED" 3000 // "GPU_ARCHITECTURE_NVIDIA" 3001 GpuArchitecture string `json:"gpuArchitecture,omitempty"` 3002 // ForceSendFields is a list of field names (e.g. "CpuArchitecture") to 3003 // unconditionally include in API requests. By default, fields with empty or 3004 // default values are omitted from API requests. See 3005 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3006 // details. 3007 ForceSendFields []string `json:"-"` 3008 // NullFields is a list of field names (e.g. "CpuArchitecture") to include in 3009 // API requests with the JSON null value. By default, fields with empty values 3010 // are omitted from API requests. See 3011 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3012 NullFields []string `json:"-"` 3013 } 3014 3015 func (s *XPSDockerFormat) MarshalJSON() ([]byte, error) { 3016 type NoMethod XPSDockerFormat 3017 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3018 } 3019 3020 // XPSEdgeTpuTfLiteFormat: A model format used for Edge TPU 3021 // (https://cloud.google.com/edge-tpu/) devices. 3022 type XPSEdgeTpuTfLiteFormat struct { 3023 } 3024 3025 // XPSEvaluationMetrics: Contains xPS-specific model evaluation metrics either 3026 // for a single annotation spec (label), or for the model overall. Next tag: 3027 // 18. 3028 type XPSEvaluationMetrics struct { 3029 // AnnotationSpecIdToken: The annotation_spec for which this evaluation metrics 3030 // instance had been created. Empty iff this is an overall model evaluation 3031 // (like Tables evaluation metrics), i.e. aggregated across all labels. The 3032 // value comes from the input annotations in AnnotatedExample. For MVP product 3033 // or for text sentiment models where annotation_spec_id_token is not 3034 // available, set label instead. 3035 AnnotationSpecIdToken string `json:"annotationSpecIdToken,omitempty"` 3036 // Category: The integer category label for which this evaluation metric 3037 // instance had been created. Valid categories are 0 or higher. Overall model 3038 // evaluation should set this to negative values (rather than implicit zero). 3039 // Only used for Image Segmentation (prefer to set annotation_spec_id_token 3040 // instead). Note: uCAIP Image Segmentation should use 3041 // annotation_spec_id_token. 3042 Category int64 `json:"category,omitempty"` 3043 // EvaluatedExampleCount: The number of examples used to create this evaluation 3044 // metrics instance. 3045 EvaluatedExampleCount int64 `json:"evaluatedExampleCount,omitempty"` 3046 ImageClassificationEvalMetrics *XPSClassificationEvaluationMetrics `json:"imageClassificationEvalMetrics,omitempty"` 3047 ImageObjectDetectionEvalMetrics *XPSImageObjectDetectionEvaluationMetrics `json:"imageObjectDetectionEvalMetrics,omitempty"` 3048 ImageSegmentationEvalMetrics *XPSImageSegmentationEvaluationMetrics `json:"imageSegmentationEvalMetrics,omitempty"` 3049 // Label: The label for which this evaluation metrics instance had been 3050 // created. Empty iff this is an overall model evaluation (like Tables 3051 // evaluation metrics), i.e. aggregated across all labels. The label maps to 3052 // AnnotationSpec.display_name in Public API protos. Only used by MVP 3053 // implementation and text sentiment FULL implementation. 3054 Label string `json:"label,omitempty"` 3055 RegressionEvalMetrics *XPSRegressionEvaluationMetrics `json:"regressionEvalMetrics,omitempty"` 3056 TablesClassificationEvalMetrics *XPSClassificationEvaluationMetrics `json:"tablesClassificationEvalMetrics,omitempty"` 3057 TablesEvalMetrics *XPSTablesEvaluationMetrics `json:"tablesEvalMetrics,omitempty"` 3058 TextClassificationEvalMetrics *XPSClassificationEvaluationMetrics `json:"textClassificationEvalMetrics,omitempty"` 3059 TextExtractionEvalMetrics *XPSTextExtractionEvaluationMetrics `json:"textExtractionEvalMetrics,omitempty"` 3060 TextSentimentEvalMetrics *XPSTextSentimentEvaluationMetrics `json:"textSentimentEvalMetrics,omitempty"` 3061 TranslationEvalMetrics *XPSTranslationEvaluationMetrics `json:"translationEvalMetrics,omitempty"` 3062 VideoActionRecognitionEvalMetrics *XPSVideoActionRecognitionEvaluationMetrics `json:"videoActionRecognitionEvalMetrics,omitempty"` 3063 VideoClassificationEvalMetrics *XPSClassificationEvaluationMetrics `json:"videoClassificationEvalMetrics,omitempty"` 3064 VideoObjectTrackingEvalMetrics *XPSVideoObjectTrackingEvaluationMetrics `json:"videoObjectTrackingEvalMetrics,omitempty"` 3065 // ForceSendFields is a list of field names (e.g. "AnnotationSpecIdToken") to 3066 // unconditionally include in API requests. By default, fields with empty or 3067 // default values are omitted from API requests. See 3068 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3069 // details. 3070 ForceSendFields []string `json:"-"` 3071 // NullFields is a list of field names (e.g. "AnnotationSpecIdToken") to 3072 // include in API requests with the JSON null value. By default, fields with 3073 // empty values are omitted from API requests. See 3074 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3075 NullFields []string `json:"-"` 3076 } 3077 3078 func (s *XPSEvaluationMetrics) MarshalJSON() ([]byte, error) { 3079 type NoMethod XPSEvaluationMetrics 3080 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3081 } 3082 3083 // XPSEvaluationMetricsSet: Specifies location of model evaluation metrics. 3084 type XPSEvaluationMetricsSet struct { 3085 // EvaluationMetrics: Inline EvaluationMetrics - should be relatively small. 3086 // For passing large quantities of exhaustive metrics, use file_spec. 3087 EvaluationMetrics []*XPSEvaluationMetrics `json:"evaluationMetrics,omitempty"` 3088 // FileSpec: File spec containing evaluation metrics of a model, must point to 3089 // RecordIO file(s) of intelligence.cloud.automl.xps.EvaluationMetrics 3090 // messages. 3091 FileSpec *XPSFileSpec `json:"fileSpec,omitempty"` 3092 // NumEvaluationMetrics: Number of the evaluation metrics (usually one per 3093 // label plus overall). 3094 NumEvaluationMetrics int64 `json:"numEvaluationMetrics,omitempty,string"` 3095 // ForceSendFields is a list of field names (e.g. "EvaluationMetrics") to 3096 // unconditionally include in API requests. By default, fields with empty or 3097 // default values are omitted from API requests. See 3098 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3099 // details. 3100 ForceSendFields []string `json:"-"` 3101 // NullFields is a list of field names (e.g. "EvaluationMetrics") to include in 3102 // API requests with the JSON null value. By default, fields with empty values 3103 // are omitted from API requests. See 3104 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3105 NullFields []string `json:"-"` 3106 } 3107 3108 func (s *XPSEvaluationMetricsSet) MarshalJSON() ([]byte, error) { 3109 type NoMethod XPSEvaluationMetricsSet 3110 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3111 } 3112 3113 // XPSExampleSet: Set of examples or input sources. 3114 type XPSExampleSet struct { 3115 // FileSpec: File spec of the examples or input sources. 3116 FileSpec *XPSFileSpec `json:"fileSpec,omitempty"` 3117 // Fingerprint: Fingerprint of the example set. 3118 Fingerprint int64 `json:"fingerprint,omitempty,string"` 3119 // NumExamples: Number of examples. 3120 NumExamples int64 `json:"numExamples,omitempty,string"` 3121 // NumInputSources: Number of input sources. 3122 NumInputSources int64 `json:"numInputSources,omitempty,string"` 3123 // ForceSendFields is a list of field names (e.g. "FileSpec") to 3124 // unconditionally include in API requests. By default, fields with empty or 3125 // default values are omitted from API requests. See 3126 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3127 // details. 3128 ForceSendFields []string `json:"-"` 3129 // NullFields is a list of field names (e.g. "FileSpec") to include in API 3130 // requests with the JSON null value. By default, fields with empty values are 3131 // omitted from API requests. See 3132 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3133 NullFields []string `json:"-"` 3134 } 3135 3136 func (s *XPSExampleSet) MarshalJSON() ([]byte, error) { 3137 type NoMethod XPSExampleSet 3138 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3139 } 3140 3141 type XPSExportModelOutputConfig struct { 3142 CoreMlFormat *XPSCoreMlFormat `json:"coreMlFormat,omitempty"` 3143 DockerFormat *XPSDockerFormat `json:"dockerFormat,omitempty"` 3144 EdgeTpuTfLiteFormat *XPSEdgeTpuTfLiteFormat `json:"edgeTpuTfLiteFormat,omitempty"` 3145 // ExportFirebaseAuxiliaryInfo: For any model and format: If true, will 3146 // additionally export FirebaseExportedModelInfo in a firebase.txt file. 3147 ExportFirebaseAuxiliaryInfo bool `json:"exportFirebaseAuxiliaryInfo,omitempty"` 3148 // OutputGcrUri: The Google Contained Registry (GCR) path the exported files to 3149 // be pushed to. This location is set if the exported format is DOCKDER. 3150 OutputGcrUri string `json:"outputGcrUri,omitempty"` 3151 // OutputGcsUri: The Google Cloud Storage (GCS) directory where XPS will output 3152 // the exported models and related files. Format: gs://bucket/directory 3153 OutputGcsUri string `json:"outputGcsUri,omitempty"` 3154 TfJsFormat *XPSTfJsFormat `json:"tfJsFormat,omitempty"` 3155 TfLiteFormat *XPSTfLiteFormat `json:"tfLiteFormat,omitempty"` 3156 TfSavedModelFormat *XPSTfSavedModelFormat `json:"tfSavedModelFormat,omitempty"` 3157 // ForceSendFields is a list of field names (e.g. "CoreMlFormat") to 3158 // unconditionally include in API requests. By default, fields with empty or 3159 // default values are omitted from API requests. See 3160 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3161 // details. 3162 ForceSendFields []string `json:"-"` 3163 // NullFields is a list of field names (e.g. "CoreMlFormat") to include in API 3164 // requests with the JSON null value. By default, fields with empty values are 3165 // omitted from API requests. See 3166 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3167 NullFields []string `json:"-"` 3168 } 3169 3170 func (s *XPSExportModelOutputConfig) MarshalJSON() ([]byte, error) { 3171 type NoMethod XPSExportModelOutputConfig 3172 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3173 } 3174 3175 // XPSFileSpec: Spec of input and output files, on external file systems (CNS, 3176 // GCS, etc). 3177 type XPSFileSpec struct { 3178 // DirectoryPath: Deprecated. Use file_spec. 3179 DirectoryPath string `json:"directoryPath,omitempty"` 3180 // Possible values: 3181 // "FILE_FORMAT_UNKNOWN" 3182 // "FILE_FORMAT_SSTABLE" 3183 // "FILE_FORMAT_TRANSLATION_RKV" - Internal format for parallel text data 3184 // used by Google Translate. go/rkvtools 3185 // "FILE_FORMAT_RECORDIO" 3186 // "FILE_FORMAT_RAW_CSV" - Only the lexicographically first file described by 3187 // the file_spec contains the header line. 3188 // "FILE_FORMAT_RAW_CAPACITOR" 3189 FileFormat string `json:"fileFormat,omitempty"` 3190 // FileSpec: Single file path, or file pattern of format 3191 // "/path/to/file@shard_count". E.g. /cns/cell-d/somewhere/file@2 is expanded 3192 // to two files: /cns/cell-d/somewhere/file-00000-of-00002 and 3193 // /cns/cell-d/somewhere/file-00001-of-00002. 3194 FileSpec string `json:"fileSpec,omitempty"` 3195 // SingleFilePath: Deprecated. Use file_spec. 3196 SingleFilePath string `json:"singleFilePath,omitempty"` 3197 // ForceSendFields is a list of field names (e.g. "DirectoryPath") to 3198 // unconditionally include in API requests. By default, fields with empty or 3199 // default values are omitted from API requests. See 3200 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3201 // details. 3202 ForceSendFields []string `json:"-"` 3203 // NullFields is a list of field names (e.g. "DirectoryPath") to include in API 3204 // requests with the JSON null value. By default, fields with empty values are 3205 // omitted from API requests. See 3206 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3207 NullFields []string `json:"-"` 3208 } 3209 3210 func (s *XPSFileSpec) MarshalJSON() ([]byte, error) { 3211 type NoMethod XPSFileSpec 3212 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3213 } 3214 3215 // XPSFloat64Stats: The data statistics of a series of FLOAT64 values. 3216 type XPSFloat64Stats struct { 3217 CommonStats *XPSCommonStats `json:"commonStats,omitempty"` 3218 // HistogramBuckets: Histogram buckets of the data series. Sorted by the min 3219 // value of the bucket, ascendingly, and the number of the buckets is 3220 // dynamically generated. The buckets are non-overlapping and completely cover 3221 // whole FLOAT64 range with min of first bucket being "-Infinity", and max of 3222 // the last one being "Infinity". 3223 HistogramBuckets []*XPSFloat64StatsHistogramBucket `json:"histogramBuckets,omitempty"` 3224 // Mean: The mean of the series. 3225 Mean float64 `json:"mean,omitempty"` 3226 // Quantiles: Ordered from 0 to k k-quantile values of the data series of n 3227 // values. The value at index i is, approximately, the i*n/k-th smallest value 3228 // in the series; for i = 0 and i = k these are, respectively, the min and max 3229 // values. 3230 Quantiles []float64 `json:"quantiles,omitempty"` 3231 // StandardDeviation: The standard deviation of the series. 3232 StandardDeviation float64 `json:"standardDeviation,omitempty"` 3233 // ForceSendFields is a list of field names (e.g. "CommonStats") to 3234 // unconditionally include in API requests. By default, fields with empty or 3235 // default values are omitted from API requests. See 3236 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3237 // details. 3238 ForceSendFields []string `json:"-"` 3239 // NullFields is a list of field names (e.g. "CommonStats") to include in API 3240 // requests with the JSON null value. By default, fields with empty values are 3241 // omitted from API requests. See 3242 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3243 NullFields []string `json:"-"` 3244 } 3245 3246 func (s *XPSFloat64Stats) MarshalJSON() ([]byte, error) { 3247 type NoMethod XPSFloat64Stats 3248 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3249 } 3250 3251 func (s *XPSFloat64Stats) UnmarshalJSON(data []byte) error { 3252 type NoMethod XPSFloat64Stats 3253 var s1 struct { 3254 Mean gensupport.JSONFloat64 `json:"mean"` 3255 Quantiles []gensupport.JSONFloat64 `json:"quantiles"` 3256 StandardDeviation gensupport.JSONFloat64 `json:"standardDeviation"` 3257 *NoMethod 3258 } 3259 s1.NoMethod = (*NoMethod)(s) 3260 if err := json.Unmarshal(data, &s1); err != nil { 3261 return err 3262 } 3263 s.Mean = float64(s1.Mean) 3264 s.Quantiles = make([]float64, len(s1.Quantiles)) 3265 for i := range s1.Quantiles { 3266 s.Quantiles[i] = float64(s1.Quantiles[i]) 3267 } 3268 s.StandardDeviation = float64(s1.StandardDeviation) 3269 return nil 3270 } 3271 3272 // XPSFloat64StatsHistogramBucket: A bucket of a histogram. 3273 type XPSFloat64StatsHistogramBucket struct { 3274 // Count: The number of data values that are in the bucket, i.e. are between 3275 // min and max values. 3276 Count int64 `json:"count,omitempty,string"` 3277 // Max: The maximum value of the bucket, exclusive unless max = "Infinity", 3278 // in which case it's inclusive. 3279 Max float64 `json:"max,omitempty"` 3280 // Min: The minimum value of the bucket, inclusive. 3281 Min float64 `json:"min,omitempty"` 3282 // ForceSendFields is a list of field names (e.g. "Count") to unconditionally 3283 // include in API requests. By default, fields with empty or default values are 3284 // omitted from API requests. See 3285 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3286 // details. 3287 ForceSendFields []string `json:"-"` 3288 // NullFields is a list of field names (e.g. "Count") to include in API 3289 // requests with the JSON null value. By default, fields with empty values are 3290 // omitted from API requests. See 3291 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3292 NullFields []string `json:"-"` 3293 } 3294 3295 func (s *XPSFloat64StatsHistogramBucket) MarshalJSON() ([]byte, error) { 3296 type NoMethod XPSFloat64StatsHistogramBucket 3297 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3298 } 3299 3300 func (s *XPSFloat64StatsHistogramBucket) UnmarshalJSON(data []byte) error { 3301 type NoMethod XPSFloat64StatsHistogramBucket 3302 var s1 struct { 3303 Max gensupport.JSONFloat64 `json:"max"` 3304 Min gensupport.JSONFloat64 `json:"min"` 3305 *NoMethod 3306 } 3307 s1.NoMethod = (*NoMethod)(s) 3308 if err := json.Unmarshal(data, &s1); err != nil { 3309 return err 3310 } 3311 s.Max = float64(s1.Max) 3312 s.Min = float64(s1.Min) 3313 return nil 3314 } 3315 3316 type XPSImageClassificationTrainResponse struct { 3317 // ClassCount: Total number of classes. 3318 ClassCount int64 `json:"classCount,omitempty,string"` 3319 // ExportModelSpec: Information of downloadable models that are pre-generated 3320 // as part of training flow and will be persisted in AutoMl backend. Populated 3321 // for AutoMl requests. 3322 ExportModelSpec *XPSImageExportModelSpec `json:"exportModelSpec,omitempty"` 3323 // ModelArtifactSpec: ## The fields below are only populated under uCAIP 3324 // request scope. 3325 ModelArtifactSpec *XPSImageModelArtifactSpec `json:"modelArtifactSpec,omitempty"` 3326 ModelServingSpec *XPSImageModelServingSpec `json:"modelServingSpec,omitempty"` 3327 // StopReason: Stop reason for training job, e.g. 'TRAIN_BUDGET_REACHED', 3328 // 'MODEL_CONVERGED', 'MODEL_EARLY_STOPPED'. 3329 // 3330 // Possible values: 3331 // "TRAIN_STOP_REASON_UNSPECIFIED" 3332 // "TRAIN_STOP_REASON_BUDGET_REACHED" 3333 // "TRAIN_STOP_REASON_MODEL_CONVERGED" - Model fully converged, can not be 3334 // resumbed training. 3335 // "TRAIN_STOP_REASON_MODEL_EARLY_STOPPED" - Model early converged, can be 3336 // further trained till full convergency. 3337 StopReason string `json:"stopReason,omitempty"` 3338 // TrainCostInNodeTime: The actual cost to create this model. - For edge type 3339 // model, the cost is expressed in node hour. - For cloud type model,the cost 3340 // is expressed in compute hour. - Populated for models created before GA. To 3341 // be deprecated after GA. 3342 TrainCostInNodeTime string `json:"trainCostInNodeTime,omitempty"` 3343 // TrainCostNodeSeconds: The actual training cost, expressed in node seconds. 3344 // Populated for models trained in node time. 3345 TrainCostNodeSeconds int64 `json:"trainCostNodeSeconds,omitempty,string"` 3346 // ForceSendFields is a list of field names (e.g. "ClassCount") to 3347 // unconditionally include in API requests. By default, fields with empty or 3348 // default values are omitted from API requests. See 3349 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3350 // details. 3351 ForceSendFields []string `json:"-"` 3352 // NullFields is a list of field names (e.g. "ClassCount") to include in API 3353 // requests with the JSON null value. By default, fields with empty values are 3354 // omitted from API requests. See 3355 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3356 NullFields []string `json:"-"` 3357 } 3358 3359 func (s *XPSImageClassificationTrainResponse) MarshalJSON() ([]byte, error) { 3360 type NoMethod XPSImageClassificationTrainResponse 3361 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3362 } 3363 3364 // XPSImageExportModelSpec: Information of downloadable models that are 3365 // pre-generated as part of training flow and will be persisted in AutoMl 3366 // backend. Upon receiving ExportModel request from user, AutoMl backend can 3367 // serve the pre-generated models to user if exists (by copying the files from 3368 // internal path to user provided location), otherwise, AutoMl backend will 3369 // call xPS ExportModel API to generate the model on the fly with the 3370 // requesting format. 3371 type XPSImageExportModelSpec struct { 3372 // ExportModelOutputConfig: Contains the model format and internal location of 3373 // the model files to be exported/downloaded. Use the GCS bucket name which is 3374 // provided via TrainRequest.gcs_bucket_name to store the model files. 3375 ExportModelOutputConfig []*XPSExportModelOutputConfig `json:"exportModelOutputConfig,omitempty"` 3376 // ForceSendFields is a list of field names (e.g. "ExportModelOutputConfig") to 3377 // unconditionally include in API requests. By default, fields with empty or 3378 // default values are omitted from API requests. See 3379 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3380 // details. 3381 ForceSendFields []string `json:"-"` 3382 // NullFields is a list of field names (e.g. "ExportModelOutputConfig") to 3383 // include in API requests with the JSON null value. By default, fields with 3384 // empty values are omitted from API requests. See 3385 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3386 NullFields []string `json:"-"` 3387 } 3388 3389 func (s *XPSImageExportModelSpec) MarshalJSON() ([]byte, error) { 3390 type NoMethod XPSImageExportModelSpec 3391 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3392 } 3393 3394 // XPSImageModelArtifactSpec: Stores the locations and related metadata of the 3395 // model artifacts. Populated for uCAIP requests only. 3396 type XPSImageModelArtifactSpec struct { 3397 // CheckpointArtifact: The Tensorflow checkpoint files. e.g. Used for resumable 3398 // training. 3399 CheckpointArtifact *XPSModelArtifactItem `json:"checkpointArtifact,omitempty"` 3400 // ExportArtifact: The model binary files in different formats for model 3401 // export. 3402 ExportArtifact []*XPSModelArtifactItem `json:"exportArtifact,omitempty"` 3403 // LabelGcsUri: GCS uri of decoded labels file for model export 'dict.txt'. 3404 LabelGcsUri string `json:"labelGcsUri,omitempty"` 3405 // ServingArtifact: The default model binary file used for serving (e.g. online 3406 // predict, batch predict) via public Cloud AI Platform API. 3407 ServingArtifact *XPSModelArtifactItem `json:"servingArtifact,omitempty"` 3408 // TfJsBinaryGcsPrefix: GCS uri prefix of Tensorflow JavaScript binary files 3409 // 'groupX-shardXofX.bin' Deprecated. 3410 TfJsBinaryGcsPrefix string `json:"tfJsBinaryGcsPrefix,omitempty"` 3411 // TfLiteMetadataGcsUri: GCS uri of Tensorflow Lite metadata 3412 // 'tflite_metadata.json'. 3413 TfLiteMetadataGcsUri string `json:"tfLiteMetadataGcsUri,omitempty"` 3414 // ForceSendFields is a list of field names (e.g. "CheckpointArtifact") to 3415 // unconditionally include in API requests. By default, fields with empty or 3416 // default values are omitted from API requests. See 3417 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3418 // details. 3419 ForceSendFields []string `json:"-"` 3420 // NullFields is a list of field names (e.g. "CheckpointArtifact") to include 3421 // in API requests with the JSON null value. By default, fields with empty 3422 // values are omitted from API requests. See 3423 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3424 NullFields []string `json:"-"` 3425 } 3426 3427 func (s *XPSImageModelArtifactSpec) MarshalJSON() ([]byte, error) { 3428 type NoMethod XPSImageModelArtifactSpec 3429 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3430 } 3431 3432 // XPSImageModelServingSpec: Serving specification for image models. 3433 type XPSImageModelServingSpec struct { 3434 // ModelThroughputEstimation: Populate under uCAIP request scope. 3435 ModelThroughputEstimation []*XPSImageModelServingSpecModelThroughputEstimation `json:"modelThroughputEstimation,omitempty"` 3436 // NodeQps: An estimated value of how much traffic a node can serve. Populated 3437 // for AutoMl request only. 3438 NodeQps float64 `json:"nodeQps,omitempty"` 3439 // TfRuntimeVersion: ## The fields below are only populated under uCAIP request 3440 // scope. https://cloud.google.com/ml-engine/docs/runtime-version-list 3441 TfRuntimeVersion string `json:"tfRuntimeVersion,omitempty"` 3442 // ForceSendFields is a list of field names (e.g. "ModelThroughputEstimation") 3443 // to unconditionally include in API requests. By default, fields with empty or 3444 // default values are omitted from API requests. See 3445 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3446 // details. 3447 ForceSendFields []string `json:"-"` 3448 // NullFields is a list of field names (e.g. "ModelThroughputEstimation") to 3449 // include in API requests with the JSON null value. By default, fields with 3450 // empty values are omitted from API requests. See 3451 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3452 NullFields []string `json:"-"` 3453 } 3454 3455 func (s *XPSImageModelServingSpec) MarshalJSON() ([]byte, error) { 3456 type NoMethod XPSImageModelServingSpec 3457 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3458 } 3459 3460 func (s *XPSImageModelServingSpec) UnmarshalJSON(data []byte) error { 3461 type NoMethod XPSImageModelServingSpec 3462 var s1 struct { 3463 NodeQps gensupport.JSONFloat64 `json:"nodeQps"` 3464 *NoMethod 3465 } 3466 s1.NoMethod = (*NoMethod)(s) 3467 if err := json.Unmarshal(data, &s1); err != nil { 3468 return err 3469 } 3470 s.NodeQps = float64(s1.NodeQps) 3471 return nil 3472 } 3473 3474 type XPSImageModelServingSpecModelThroughputEstimation struct { 3475 // Possible values: 3476 // "UNSPECIFIED" 3477 // "NVIDIA_TESLA_K80" - Nvidia Tesla K80 GPU. 3478 // "NVIDIA_TESLA_P100" - Nvidia Tesla P100 GPU. 3479 // "NVIDIA_TESLA_V100" - Nvidia Tesla V100 GPU. 3480 // "NVIDIA_TESLA_P4" - Nvidia Tesla P4 GPU. 3481 // "NVIDIA_TESLA_T4" - Nvidia Tesla T4 GPU. 3482 // "NVIDIA_TESLA_A100" - Nvidia Tesla A100 GPU. 3483 // "NVIDIA_A100_80GB" - Nvidia A100 80GB GPU. 3484 // "NVIDIA_L4" - Nvidia L4 GPU. 3485 // "NVIDIA_H100_80GB" - Nvidia H100 80Gb GPU. 3486 // "TPU_V2" - TPU v2 (JellyFish). 3487 // "TPU_V3" - TPU v3 (DragonFish). 3488 // "TPU_V4_POD" - TPU_v4 (PufferFish). 3489 // "TPU_V5_LITEPOD" - TPU v5 Lite Pods. 3490 ComputeEngineAcceleratorType string `json:"computeEngineAcceleratorType,omitempty"` 3491 // LatencyInMilliseconds: Estimated latency. 3492 LatencyInMilliseconds float64 `json:"latencyInMilliseconds,omitempty"` 3493 // NodeQps: The approximate qps a deployed node can serve. 3494 NodeQps float64 `json:"nodeQps,omitempty"` 3495 // Possible values: 3496 // "PARTITION_TYPE_UNSPECIFIED" 3497 // "PARTITION_ZERO" - The default partition. 3498 // "PARTITION_REDUCED_HOMING" - It has significantly lower replication than 3499 // partition-0 and is located in the US only. It also has a larger model size 3500 // limit and higher default RAM quota than partition-0. Customers with batch 3501 // traffic, US-based traffic, or very large models should use this partition. 3502 // Capacity in this partition is significantly cheaper than partition-0. 3503 // "PARTITION_JELLYFISH" - To be used by customers with Jellyfish-accelerated 3504 // ops. See go/servomatic-jellyfish for details. 3505 // "PARTITION_CPU" - The partition used by regionalized servomatic cloud 3506 // regions. 3507 // "PARTITION_CUSTOM_STORAGE_CPU" - The partition used for loading models 3508 // from custom storage. 3509 ServomaticPartitionType string `json:"servomaticPartitionType,omitempty"` 3510 // ForceSendFields is a list of field names (e.g. 3511 // "ComputeEngineAcceleratorType") to unconditionally include in API requests. 3512 // By default, fields with empty or default values are omitted from API 3513 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields 3514 // for more details. 3515 ForceSendFields []string `json:"-"` 3516 // NullFields is a list of field names (e.g. "ComputeEngineAcceleratorType") to 3517 // include in API requests with the JSON null value. By default, fields with 3518 // empty values are omitted from API requests. See 3519 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3520 NullFields []string `json:"-"` 3521 } 3522 3523 func (s *XPSImageModelServingSpecModelThroughputEstimation) MarshalJSON() ([]byte, error) { 3524 type NoMethod XPSImageModelServingSpecModelThroughputEstimation 3525 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3526 } 3527 3528 func (s *XPSImageModelServingSpecModelThroughputEstimation) UnmarshalJSON(data []byte) error { 3529 type NoMethod XPSImageModelServingSpecModelThroughputEstimation 3530 var s1 struct { 3531 LatencyInMilliseconds gensupport.JSONFloat64 `json:"latencyInMilliseconds"` 3532 NodeQps gensupport.JSONFloat64 `json:"nodeQps"` 3533 *NoMethod 3534 } 3535 s1.NoMethod = (*NoMethod)(s) 3536 if err := json.Unmarshal(data, &s1); err != nil { 3537 return err 3538 } 3539 s.LatencyInMilliseconds = float64(s1.LatencyInMilliseconds) 3540 s.NodeQps = float64(s1.NodeQps) 3541 return nil 3542 } 3543 3544 // XPSImageObjectDetectionEvaluationMetrics: Model evaluation metrics for image 3545 // object detection problems. Evaluates prediction quality of labeled bounding 3546 // boxes. 3547 type XPSImageObjectDetectionEvaluationMetrics struct { 3548 // BoundingBoxMeanAveragePrecision: The single metric for bounding boxes 3549 // evaluation: the mean_average_precision averaged over all 3550 // bounding_box_metrics_entries. 3551 BoundingBoxMeanAveragePrecision float64 `json:"boundingBoxMeanAveragePrecision,omitempty"` 3552 // BoundingBoxMetricsEntries: The bounding boxes match metrics for each 3553 // Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and 3554 // each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 pair. 3555 BoundingBoxMetricsEntries []*XPSBoundingBoxMetricsEntry `json:"boundingBoxMetricsEntries,omitempty"` 3556 // EvaluatedBoundingBoxCount: The total number of bounding boxes (i.e. summed 3557 // over all images) the ground truth used to create this evaluation had. 3558 EvaluatedBoundingBoxCount int64 `json:"evaluatedBoundingBoxCount,omitempty"` 3559 // ForceSendFields is a list of field names (e.g. 3560 // "BoundingBoxMeanAveragePrecision") to unconditionally include in API 3561 // requests. By default, fields with empty or default values are omitted from 3562 // 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. "BoundingBoxMeanAveragePrecision") 3567 // to include in API requests with the JSON null value. By default, fields with 3568 // empty values are 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 *XPSImageObjectDetectionEvaluationMetrics) MarshalJSON() ([]byte, error) { 3574 type NoMethod XPSImageObjectDetectionEvaluationMetrics 3575 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3576 } 3577 3578 func (s *XPSImageObjectDetectionEvaluationMetrics) UnmarshalJSON(data []byte) error { 3579 type NoMethod XPSImageObjectDetectionEvaluationMetrics 3580 var s1 struct { 3581 BoundingBoxMeanAveragePrecision gensupport.JSONFloat64 `json:"boundingBoxMeanAveragePrecision"` 3582 *NoMethod 3583 } 3584 s1.NoMethod = (*NoMethod)(s) 3585 if err := json.Unmarshal(data, &s1); err != nil { 3586 return err 3587 } 3588 s.BoundingBoxMeanAveragePrecision = float64(s1.BoundingBoxMeanAveragePrecision) 3589 return nil 3590 } 3591 3592 type XPSImageObjectDetectionModelSpec struct { 3593 // ClassCount: Total number of classes. 3594 ClassCount int64 `json:"classCount,omitempty,string"` 3595 ExportModelSpec *XPSImageExportModelSpec `json:"exportModelSpec,omitempty"` 3596 // MaxBoundingBoxCount: Max number of bounding box. 3597 MaxBoundingBoxCount int64 `json:"maxBoundingBoxCount,omitempty,string"` 3598 // ModelArtifactSpec: ## The fields below are only populated under uCAIP 3599 // request scope. 3600 ModelArtifactSpec *XPSImageModelArtifactSpec `json:"modelArtifactSpec,omitempty"` 3601 ModelServingSpec *XPSImageModelServingSpec `json:"modelServingSpec,omitempty"` 3602 // StopReason: Stop reason for training job, e.g. 'TRAIN_BUDGET_REACHED', 3603 // 'MODEL_CONVERGED'. 3604 // 3605 // Possible values: 3606 // "TRAIN_STOP_REASON_UNSPECIFIED" 3607 // "TRAIN_STOP_REASON_BUDGET_REACHED" 3608 // "TRAIN_STOP_REASON_MODEL_CONVERGED" - Model fully converged, can not be 3609 // resumbed training. 3610 // "TRAIN_STOP_REASON_MODEL_EARLY_STOPPED" - Model early converged, can be 3611 // further trained till full convergency. 3612 StopReason string `json:"stopReason,omitempty"` 3613 // TrainCostNodeSeconds: The actual train cost of creating this model, 3614 // expressed in node seconds, i.e. 3,600 value in this field means 1 node hour. 3615 TrainCostNodeSeconds int64 `json:"trainCostNodeSeconds,omitempty,string"` 3616 // ForceSendFields is a list of field names (e.g. "ClassCount") to 3617 // unconditionally include in API requests. By default, fields with empty or 3618 // default values are omitted from API requests. See 3619 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3620 // details. 3621 ForceSendFields []string `json:"-"` 3622 // NullFields is a list of field names (e.g. "ClassCount") to include in API 3623 // requests with the JSON null value. By default, fields with empty values are 3624 // omitted from API requests. See 3625 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3626 NullFields []string `json:"-"` 3627 } 3628 3629 func (s *XPSImageObjectDetectionModelSpec) MarshalJSON() ([]byte, error) { 3630 type NoMethod XPSImageObjectDetectionModelSpec 3631 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3632 } 3633 3634 // XPSImageSegmentationEvaluationMetrics: Model evaluation metrics for image 3635 // segmentation problems. Next tag: 4. 3636 type XPSImageSegmentationEvaluationMetrics struct { 3637 // ConfidenceMetricsEntries: Metrics that have confidence thresholds. 3638 // Precision-recall curve can be derived from it. 3639 ConfidenceMetricsEntries []*XPSImageSegmentationEvaluationMetricsConfidenceMetricsEntry `json:"confidenceMetricsEntries,omitempty"` 3640 // ForceSendFields is a list of field names (e.g. "ConfidenceMetricsEntries") 3641 // to unconditionally include in API requests. By default, fields with empty or 3642 // default values are omitted from API requests. See 3643 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3644 // details. 3645 ForceSendFields []string `json:"-"` 3646 // NullFields is a list of field names (e.g. "ConfidenceMetricsEntries") to 3647 // include in API requests with the JSON null value. By default, fields with 3648 // empty values are omitted from API requests. See 3649 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3650 NullFields []string `json:"-"` 3651 } 3652 3653 func (s *XPSImageSegmentationEvaluationMetrics) MarshalJSON() ([]byte, error) { 3654 type NoMethod XPSImageSegmentationEvaluationMetrics 3655 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3656 } 3657 3658 // XPSImageSegmentationEvaluationMetricsConfidenceMetricsEntry: Metrics for a 3659 // single confidence threshold. 3660 type XPSImageSegmentationEvaluationMetricsConfidenceMetricsEntry struct { 3661 // ConfidenceThreshold: The confidence threshold value used to compute the 3662 // metrics. 3663 ConfidenceThreshold float64 `json:"confidenceThreshold,omitempty"` 3664 // ConfusionMatrix: Confusion matrix of the per confidence_threshold 3665 // evaluation. Pixel counts are set here. Only set for model level evaluation, 3666 // not for evaluation per label. 3667 ConfusionMatrix *XPSConfusionMatrix `json:"confusionMatrix,omitempty"` 3668 // DiceScoreCoefficient: DSC or the F1 score: The harmonic mean of recall and 3669 // precision. 3670 DiceScoreCoefficient float64 `json:"diceScoreCoefficient,omitempty"` 3671 // IouScore: IOU score. 3672 IouScore float64 `json:"iouScore,omitempty"` 3673 // Precision: Precision for the given confidence threshold. 3674 Precision float64 `json:"precision,omitempty"` 3675 // Recall: Recall for the given confidence threshold. 3676 Recall float64 `json:"recall,omitempty"` 3677 // ForceSendFields is a list of field names (e.g. "ConfidenceThreshold") to 3678 // unconditionally include in API requests. By default, fields with empty or 3679 // default values are omitted from API requests. See 3680 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3681 // details. 3682 ForceSendFields []string `json:"-"` 3683 // NullFields is a list of field names (e.g. "ConfidenceThreshold") to include 3684 // in API requests with the JSON null value. By default, fields with empty 3685 // values are omitted from API requests. See 3686 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3687 NullFields []string `json:"-"` 3688 } 3689 3690 func (s *XPSImageSegmentationEvaluationMetricsConfidenceMetricsEntry) MarshalJSON() ([]byte, error) { 3691 type NoMethod XPSImageSegmentationEvaluationMetricsConfidenceMetricsEntry 3692 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3693 } 3694 3695 func (s *XPSImageSegmentationEvaluationMetricsConfidenceMetricsEntry) UnmarshalJSON(data []byte) error { 3696 type NoMethod XPSImageSegmentationEvaluationMetricsConfidenceMetricsEntry 3697 var s1 struct { 3698 ConfidenceThreshold gensupport.JSONFloat64 `json:"confidenceThreshold"` 3699 DiceScoreCoefficient gensupport.JSONFloat64 `json:"diceScoreCoefficient"` 3700 IouScore gensupport.JSONFloat64 `json:"iouScore"` 3701 Precision gensupport.JSONFloat64 `json:"precision"` 3702 Recall gensupport.JSONFloat64 `json:"recall"` 3703 *NoMethod 3704 } 3705 s1.NoMethod = (*NoMethod)(s) 3706 if err := json.Unmarshal(data, &s1); err != nil { 3707 return err 3708 } 3709 s.ConfidenceThreshold = float64(s1.ConfidenceThreshold) 3710 s.DiceScoreCoefficient = float64(s1.DiceScoreCoefficient) 3711 s.IouScore = float64(s1.IouScore) 3712 s.Precision = float64(s1.Precision) 3713 s.Recall = float64(s1.Recall) 3714 return nil 3715 } 3716 3717 type XPSImageSegmentationTrainResponse struct { 3718 // ColorMaps: Color map of the model. 3719 ColorMaps []*XPSColorMap `json:"colorMaps,omitempty"` 3720 // ExportModelSpec: NOTE: These fields are not used/needed in EAP but will be 3721 // set later. 3722 ExportModelSpec *XPSImageExportModelSpec `json:"exportModelSpec,omitempty"` 3723 // ModelArtifactSpec: ## The fields below are only populated under uCAIP 3724 // request scope. Model artifact spec stores and model gcs pathes and related 3725 // metadata 3726 ModelArtifactSpec *XPSImageModelArtifactSpec `json:"modelArtifactSpec,omitempty"` 3727 ModelServingSpec *XPSImageModelServingSpec `json:"modelServingSpec,omitempty"` 3728 // StopReason: Stop reason for training job, e.g. 'TRAIN_BUDGET_REACHED', 3729 // 'MODEL_CONVERGED'. 3730 // 3731 // Possible values: 3732 // "TRAIN_STOP_REASON_UNSPECIFIED" 3733 // "TRAIN_STOP_REASON_BUDGET_REACHED" 3734 // "TRAIN_STOP_REASON_MODEL_CONVERGED" - Model fully converged, can not be 3735 // resumbed training. 3736 // "TRAIN_STOP_REASON_MODEL_EARLY_STOPPED" - Model early converged, can be 3737 // further trained till full convergency. 3738 StopReason string `json:"stopReason,omitempty"` 3739 // TrainCostNodeSeconds: The actual train cost of creating this model, 3740 // expressed in node seconds, i.e. 3,600 value in this field means 1 node hour. 3741 TrainCostNodeSeconds int64 `json:"trainCostNodeSeconds,omitempty,string"` 3742 // ForceSendFields is a list of field names (e.g. "ColorMaps") to 3743 // unconditionally include in API requests. By default, fields with empty or 3744 // default values are omitted from API requests. See 3745 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3746 // details. 3747 ForceSendFields []string `json:"-"` 3748 // NullFields is a list of field names (e.g. "ColorMaps") to include in API 3749 // requests with the JSON null value. By default, fields with empty values are 3750 // omitted from API requests. See 3751 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3752 NullFields []string `json:"-"` 3753 } 3754 3755 func (s *XPSImageSegmentationTrainResponse) MarshalJSON() ([]byte, error) { 3756 type NoMethod XPSImageSegmentationTrainResponse 3757 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3758 } 3759 3760 // XPSIntegratedGradientsAttribution: An attribution method that computes the 3761 // Aumann-Shapley value taking advantage of the model's fully differentiable 3762 // structure. Refer to this paper for more details: 3763 // https://arxiv.org/abs/1703.01365 3764 type XPSIntegratedGradientsAttribution struct { 3765 // StepCount: The number of steps for approximating the path integral. A good 3766 // value to start is 50 and gradually increase until the sum to diff property 3767 // is within the desired error range. Valid range of its value is [1, 100], 3768 // inclusively. 3769 StepCount int64 `json:"stepCount,omitempty"` 3770 // ForceSendFields is a list of field names (e.g. "StepCount") to 3771 // unconditionally include in API requests. By default, fields with empty or 3772 // default values are omitted from API requests. See 3773 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3774 // details. 3775 ForceSendFields []string `json:"-"` 3776 // NullFields is a list of field names (e.g. "StepCount") to include in API 3777 // requests with the JSON null value. By default, fields with empty values are 3778 // omitted from API requests. See 3779 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3780 NullFields []string `json:"-"` 3781 } 3782 3783 func (s *XPSIntegratedGradientsAttribution) MarshalJSON() ([]byte, error) { 3784 type NoMethod XPSIntegratedGradientsAttribution 3785 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3786 } 3787 3788 type XPSMetricEntry struct { 3789 // ArgentumMetricId: For billing metrics that are using legacy sku's, set the 3790 // legacy billing metric id here. This will be sent to Chemist as the 3791 // "cloudbilling.googleapis.com/argentum_metric_id" label. Otherwise leave 3792 // empty. 3793 ArgentumMetricId string `json:"argentumMetricId,omitempty"` 3794 // DoubleValue: A double value. 3795 DoubleValue float64 `json:"doubleValue,omitempty"` 3796 // Int64Value: A signed 64-bit integer value. 3797 Int64Value int64 `json:"int64Value,omitempty,string"` 3798 // MetricName: The metric name defined in the service configuration. 3799 MetricName string `json:"metricName,omitempty"` 3800 // SystemLabels: Billing system labels for this (metric, value) pair. 3801 SystemLabels []*XPSMetricEntryLabel `json:"systemLabels,omitempty"` 3802 // ForceSendFields is a list of field names (e.g. "ArgentumMetricId") to 3803 // unconditionally include in API requests. By default, fields with empty or 3804 // default values are omitted from API requests. See 3805 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3806 // details. 3807 ForceSendFields []string `json:"-"` 3808 // NullFields is a list of field names (e.g. "ArgentumMetricId") to include in 3809 // API requests with the JSON null value. By default, fields with empty values 3810 // are omitted from API requests. See 3811 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3812 NullFields []string `json:"-"` 3813 } 3814 3815 func (s *XPSMetricEntry) MarshalJSON() ([]byte, error) { 3816 type NoMethod XPSMetricEntry 3817 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3818 } 3819 3820 func (s *XPSMetricEntry) UnmarshalJSON(data []byte) error { 3821 type NoMethod XPSMetricEntry 3822 var s1 struct { 3823 DoubleValue gensupport.JSONFloat64 `json:"doubleValue"` 3824 *NoMethod 3825 } 3826 s1.NoMethod = (*NoMethod)(s) 3827 if err := json.Unmarshal(data, &s1); err != nil { 3828 return err 3829 } 3830 s.DoubleValue = float64(s1.DoubleValue) 3831 return nil 3832 } 3833 3834 type XPSMetricEntryLabel struct { 3835 // LabelName: The name of the label. 3836 LabelName string `json:"labelName,omitempty"` 3837 // LabelValue: The value of the label. 3838 LabelValue string `json:"labelValue,omitempty"` 3839 // ForceSendFields is a list of field names (e.g. "LabelName") to 3840 // unconditionally include in API requests. By default, fields with empty or 3841 // default values are omitted from API requests. See 3842 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3843 // details. 3844 ForceSendFields []string `json:"-"` 3845 // NullFields is a list of field names (e.g. "LabelName") to include in API 3846 // requests with the JSON null value. By default, fields with empty values are 3847 // omitted from API requests. See 3848 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3849 NullFields []string `json:"-"` 3850 } 3851 3852 func (s *XPSMetricEntryLabel) MarshalJSON() ([]byte, error) { 3853 type NoMethod XPSMetricEntryLabel 3854 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3855 } 3856 3857 // XPSModelArtifactItem: A single model artifact item. 3858 type XPSModelArtifactItem struct { 3859 // ArtifactFormat: The model artifact format. 3860 // 3861 // Possible values: 3862 // "ARTIFACT_FORMAT_UNSPECIFIED" - Should not be used. 3863 // "TF_CHECKPOINT" - The Tensorflow checkpoints. See 3864 // https://www.tensorflow.org/guide/checkpoint. 3865 // "TF_SAVED_MODEL" - The Tensorflow SavedModel binary. 3866 // "TF_LITE" - Model artifact in generic TensorFlow Lite (.tflite) format. 3867 // See https://www.tensorflow.org/lite. 3868 // "EDGE_TPU_TF_LITE" - Used for [Edge 3869 // TPU](https://cloud.google.com/edge-tpu/) devices. 3870 // "TF_JS" - A [TensorFlow.js](https://www.tensorflow.org/js) model that can 3871 // be used in the browser and in Node.js using JavaScript. 3872 // "CORE_ML" - Used for iOS mobile devices in (.mlmodel) format. See 3873 // https://developer.apple.com/documentation/coreml 3874 ArtifactFormat string `json:"artifactFormat,omitempty"` 3875 // GcsUri: The Google Cloud Storage (GCS) uri that stores the model binary 3876 // files. 3877 GcsUri string `json:"gcsUri,omitempty"` 3878 // ForceSendFields is a list of field names (e.g. "ArtifactFormat") to 3879 // unconditionally include in API requests. By default, fields with empty or 3880 // default values are omitted from API requests. See 3881 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3882 // details. 3883 ForceSendFields []string `json:"-"` 3884 // NullFields is a list of field names (e.g. "ArtifactFormat") to include in 3885 // API requests with the JSON null value. By default, fields with empty values 3886 // are omitted from API requests. See 3887 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3888 NullFields []string `json:"-"` 3889 } 3890 3891 func (s *XPSModelArtifactItem) MarshalJSON() ([]byte, error) { 3892 type NoMethod XPSModelArtifactItem 3893 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3894 } 3895 3896 // XPSPreprocessResponse: Next ID: 8 3897 type XPSPreprocessResponse struct { 3898 // OutputExampleSet: Preprocessed examples, that are to be imported into AutoML 3899 // storage. This should point to RecordIO file(s) of PreprocessedExample 3900 // messages. The PreprocessedExample.mvp_training_data-s returned here are 3901 // later verbatim passed to Train() call in TrainExample.mvp_training_data. 3902 OutputExampleSet *XPSExampleSet `json:"outputExampleSet,omitempty"` 3903 SpeechPreprocessResp *XPSSpeechPreprocessResponse `json:"speechPreprocessResp,omitempty"` 3904 TablesPreprocessResponse *XPSTablesPreprocessResponse `json:"tablesPreprocessResponse,omitempty"` 3905 TranslationPreprocessResp *XPSTranslationPreprocessResponse `json:"translationPreprocessResp,omitempty"` 3906 // ForceSendFields is a list of field names (e.g. "OutputExampleSet") to 3907 // unconditionally include in API requests. By default, fields with empty or 3908 // default values are omitted from API requests. See 3909 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3910 // details. 3911 ForceSendFields []string `json:"-"` 3912 // NullFields is a list of field names (e.g. "OutputExampleSet") to include in 3913 // API requests with the JSON null value. By default, fields with empty values 3914 // are omitted from API requests. See 3915 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3916 NullFields []string `json:"-"` 3917 } 3918 3919 func (s *XPSPreprocessResponse) MarshalJSON() ([]byte, error) { 3920 type NoMethod XPSPreprocessResponse 3921 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3922 } 3923 3924 // XPSRegressionEvaluationMetrics: Model evaluation metrics for regression 3925 // problems. It can be used for Tables. 3926 type XPSRegressionEvaluationMetrics struct { 3927 // MeanAbsoluteError: Mean Absolute Error (MAE). 3928 MeanAbsoluteError float64 `json:"meanAbsoluteError,omitempty"` 3929 // MeanAbsolutePercentageError: Mean absolute percentage error. Only set if all 3930 // ground truth values are positive. 3931 MeanAbsolutePercentageError float64 `json:"meanAbsolutePercentageError,omitempty"` 3932 // RSquared: R squared. 3933 RSquared float64 `json:"rSquared,omitempty"` 3934 // RegressionMetricsEntries: A list of actual versus predicted points for the 3935 // model being evaluated. 3936 RegressionMetricsEntries []*XPSRegressionMetricsEntry `json:"regressionMetricsEntries,omitempty"` 3937 // RootMeanSquaredError: Root Mean Squared Error (RMSE). 3938 RootMeanSquaredError float64 `json:"rootMeanSquaredError,omitempty"` 3939 // RootMeanSquaredLogError: Root mean squared log error. 3940 RootMeanSquaredLogError float64 `json:"rootMeanSquaredLogError,omitempty"` 3941 // ForceSendFields is a list of field names (e.g. "MeanAbsoluteError") to 3942 // unconditionally include in API requests. By default, fields with empty or 3943 // default values are omitted from API requests. See 3944 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3945 // details. 3946 ForceSendFields []string `json:"-"` 3947 // NullFields is a list of field names (e.g. "MeanAbsoluteError") to include in 3948 // API requests with the JSON null value. By default, fields with empty values 3949 // are omitted from API requests. See 3950 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3951 NullFields []string `json:"-"` 3952 } 3953 3954 func (s *XPSRegressionEvaluationMetrics) MarshalJSON() ([]byte, error) { 3955 type NoMethod XPSRegressionEvaluationMetrics 3956 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3957 } 3958 3959 func (s *XPSRegressionEvaluationMetrics) UnmarshalJSON(data []byte) error { 3960 type NoMethod XPSRegressionEvaluationMetrics 3961 var s1 struct { 3962 MeanAbsoluteError gensupport.JSONFloat64 `json:"meanAbsoluteError"` 3963 MeanAbsolutePercentageError gensupport.JSONFloat64 `json:"meanAbsolutePercentageError"` 3964 RSquared gensupport.JSONFloat64 `json:"rSquared"` 3965 RootMeanSquaredError gensupport.JSONFloat64 `json:"rootMeanSquaredError"` 3966 RootMeanSquaredLogError gensupport.JSONFloat64 `json:"rootMeanSquaredLogError"` 3967 *NoMethod 3968 } 3969 s1.NoMethod = (*NoMethod)(s) 3970 if err := json.Unmarshal(data, &s1); err != nil { 3971 return err 3972 } 3973 s.MeanAbsoluteError = float64(s1.MeanAbsoluteError) 3974 s.MeanAbsolutePercentageError = float64(s1.MeanAbsolutePercentageError) 3975 s.RSquared = float64(s1.RSquared) 3976 s.RootMeanSquaredError = float64(s1.RootMeanSquaredError) 3977 s.RootMeanSquaredLogError = float64(s1.RootMeanSquaredLogError) 3978 return nil 3979 } 3980 3981 // XPSRegressionMetricsEntry: A pair of actual & observed values for the model 3982 // being evaluated. 3983 type XPSRegressionMetricsEntry struct { 3984 // PredictedValue: The observed value for a row in the dataset. 3985 PredictedValue float64 `json:"predictedValue,omitempty"` 3986 // TrueValue: The actual target value for a row in the dataset. 3987 TrueValue float64 `json:"trueValue,omitempty"` 3988 // ForceSendFields is a list of field names (e.g. "PredictedValue") to 3989 // unconditionally include in API requests. By default, fields with empty or 3990 // default values are omitted from API requests. See 3991 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3992 // details. 3993 ForceSendFields []string `json:"-"` 3994 // NullFields is a list of field names (e.g. "PredictedValue") to include in 3995 // API requests with the JSON null value. By default, fields with empty values 3996 // are omitted from API requests. See 3997 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3998 NullFields []string `json:"-"` 3999 } 4000 4001 func (s *XPSRegressionMetricsEntry) MarshalJSON() ([]byte, error) { 4002 type NoMethod XPSRegressionMetricsEntry 4003 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4004 } 4005 4006 func (s *XPSRegressionMetricsEntry) UnmarshalJSON(data []byte) error { 4007 type NoMethod XPSRegressionMetricsEntry 4008 var s1 struct { 4009 PredictedValue gensupport.JSONFloat64 `json:"predictedValue"` 4010 TrueValue gensupport.JSONFloat64 `json:"trueValue"` 4011 *NoMethod 4012 } 4013 s1.NoMethod = (*NoMethod)(s) 4014 if err := json.Unmarshal(data, &s1); err != nil { 4015 return err 4016 } 4017 s.PredictedValue = float64(s1.PredictedValue) 4018 s.TrueValue = float64(s1.TrueValue) 4019 return nil 4020 } 4021 4022 type XPSReportingMetrics struct { 4023 // EffectiveTrainingDuration: The effective time training used. If set, this is 4024 // used for quota management and billing. Deprecated. AutoML BE doesn't use 4025 // this. Don't set. 4026 EffectiveTrainingDuration string `json:"effectiveTrainingDuration,omitempty"` 4027 // MetricEntries: One entry per metric name. The values must be aggregated per 4028 // metric name. 4029 MetricEntries []*XPSMetricEntry `json:"metricEntries,omitempty"` 4030 // ForceSendFields is a list of field names (e.g. "EffectiveTrainingDuration") 4031 // to unconditionally include in API requests. By default, fields with empty or 4032 // default values are omitted from API requests. See 4033 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4034 // details. 4035 ForceSendFields []string `json:"-"` 4036 // NullFields is a list of field names (e.g. "EffectiveTrainingDuration") to 4037 // include in API requests with the JSON null value. By default, fields with 4038 // empty values are omitted from API requests. See 4039 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4040 NullFields []string `json:"-"` 4041 } 4042 4043 func (s *XPSReportingMetrics) MarshalJSON() ([]byte, error) { 4044 type NoMethod XPSReportingMetrics 4045 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4046 } 4047 4048 type XPSResponseExplanationMetadata struct { 4049 // Inputs: Metadata of the input. 4050 Inputs map[string]XPSResponseExplanationMetadataInputMetadata `json:"inputs,omitempty"` 4051 // Outputs: Metadata of the output. 4052 Outputs map[string]XPSResponseExplanationMetadataOutputMetadata `json:"outputs,omitempty"` 4053 // ForceSendFields is a list of field names (e.g. "Inputs") to unconditionally 4054 // include in API requests. By default, fields with empty or default values are 4055 // omitted from API requests. See 4056 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4057 // details. 4058 ForceSendFields []string `json:"-"` 4059 // NullFields is a list of field names (e.g. "Inputs") to include in API 4060 // requests with the JSON null value. By default, fields with empty values are 4061 // omitted from API requests. See 4062 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4063 NullFields []string `json:"-"` 4064 } 4065 4066 func (s *XPSResponseExplanationMetadata) MarshalJSON() ([]byte, error) { 4067 type NoMethod XPSResponseExplanationMetadata 4068 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4069 } 4070 4071 // XPSResponseExplanationMetadataInputMetadata: Metadata of the input of a 4072 // feature. 4073 type XPSResponseExplanationMetadataInputMetadata struct { 4074 // InputTensorName: Name of the input tensor for this model. Only needed in 4075 // train response. 4076 InputTensorName string `json:"inputTensorName,omitempty"` 4077 // Modality: Modality of the feature. Valid values are: numeric, image. 4078 // Defaults to numeric. 4079 // 4080 // Possible values: 4081 // "MODALITY_UNSPECIFIED" 4082 // "NUMERIC" 4083 // "IMAGE" 4084 // "CATEGORICAL" 4085 Modality string `json:"modality,omitempty"` 4086 // VisualizationConfig: Visualization configurations for image explanation. 4087 VisualizationConfig *XPSVisualization `json:"visualizationConfig,omitempty"` 4088 // ForceSendFields is a list of field names (e.g. "InputTensorName") to 4089 // unconditionally include in API requests. By default, fields with empty or 4090 // default values are omitted from API requests. See 4091 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4092 // details. 4093 ForceSendFields []string `json:"-"` 4094 // NullFields is a list of field names (e.g. "InputTensorName") to include in 4095 // API requests with the JSON null value. By default, fields with empty values 4096 // are omitted from API requests. See 4097 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4098 NullFields []string `json:"-"` 4099 } 4100 4101 func (s *XPSResponseExplanationMetadataInputMetadata) MarshalJSON() ([]byte, error) { 4102 type NoMethod XPSResponseExplanationMetadataInputMetadata 4103 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4104 } 4105 4106 // XPSResponseExplanationMetadataOutputMetadata: Metadata of the prediction 4107 // output to be explained. 4108 type XPSResponseExplanationMetadataOutputMetadata struct { 4109 // OutputTensorName: Name of the output tensor. Only needed in train response. 4110 OutputTensorName string `json:"outputTensorName,omitempty"` 4111 // ForceSendFields is a list of field names (e.g. "OutputTensorName") to 4112 // unconditionally include in API requests. By default, fields with empty or 4113 // default values are omitted from API requests. See 4114 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4115 // details. 4116 ForceSendFields []string `json:"-"` 4117 // NullFields is a list of field names (e.g. "OutputTensorName") to include in 4118 // API requests with the JSON null value. By default, fields with empty values 4119 // are omitted from API requests. See 4120 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4121 NullFields []string `json:"-"` 4122 } 4123 4124 func (s *XPSResponseExplanationMetadataOutputMetadata) MarshalJSON() ([]byte, error) { 4125 type NoMethod XPSResponseExplanationMetadataOutputMetadata 4126 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4127 } 4128 4129 type XPSResponseExplanationParameters struct { 4130 // IntegratedGradientsAttribution: An attribution method that computes 4131 // Aumann-Shapley values taking advantage of the model's fully differentiable 4132 // structure. Refer to this paper for more details: 4133 // https://arxiv.org/abs/1703.01365 4134 IntegratedGradientsAttribution *XPSIntegratedGradientsAttribution `json:"integratedGradientsAttribution,omitempty"` 4135 // XraiAttribution: An attribution method that redistributes Integrated 4136 // Gradients attribution to segmented regions, taking advantage of the model's 4137 // fully differentiable structure. Refer to this paper for more details: 4138 // https://arxiv.org/abs/1906.02825 XRAI currently performs better on natural 4139 // images, like a picture of a house or an animal. If the images are taken in 4140 // artificial environments, like a lab or manufacturing line, or from 4141 // diagnostic equipment, like x-rays or quality-control cameras, use Integrated 4142 // Gradients instead. 4143 XraiAttribution *XPSXraiAttribution `json:"xraiAttribution,omitempty"` 4144 // ForceSendFields is a list of field names (e.g. 4145 // "IntegratedGradientsAttribution") to unconditionally include in API 4146 // requests. By default, fields with empty or default values are omitted from 4147 // API requests. See 4148 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4149 // details. 4150 ForceSendFields []string `json:"-"` 4151 // NullFields is a list of field names (e.g. "IntegratedGradientsAttribution") 4152 // to include in API requests with the JSON null value. By default, fields with 4153 // empty values are omitted from API requests. See 4154 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4155 NullFields []string `json:"-"` 4156 } 4157 4158 func (s *XPSResponseExplanationParameters) MarshalJSON() ([]byte, error) { 4159 type NoMethod XPSResponseExplanationParameters 4160 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4161 } 4162 4163 // XPSResponseExplanationSpec: Specification of Model explanation. 4164 // Feature-based XAI in AutoML Vision ICN is deprecated, see b/288407203 for 4165 // context. 4166 type XPSResponseExplanationSpec struct { 4167 // ExplanationType: Explanation type. For AutoML Image Classification models, 4168 // possible values are: * `image-integrated-gradients` * `image-xrai` 4169 ExplanationType string `json:"explanationType,omitempty"` 4170 // Metadata: Metadata describing the Model's input and output for explanation. 4171 Metadata *XPSResponseExplanationMetadata `json:"metadata,omitempty"` 4172 // Parameters: Parameters that configure explaining of the Model's predictions. 4173 Parameters *XPSResponseExplanationParameters `json:"parameters,omitempty"` 4174 // ForceSendFields is a list of field names (e.g. "ExplanationType") to 4175 // unconditionally include in API requests. By default, fields with empty or 4176 // default values are omitted from API requests. See 4177 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4178 // details. 4179 ForceSendFields []string `json:"-"` 4180 // NullFields is a list of field names (e.g. "ExplanationType") to include in 4181 // API requests with the JSON null value. By default, fields with empty values 4182 // are omitted from API requests. See 4183 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4184 NullFields []string `json:"-"` 4185 } 4186 4187 func (s *XPSResponseExplanationSpec) MarshalJSON() ([]byte, error) { 4188 type NoMethod XPSResponseExplanationSpec 4189 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4190 } 4191 4192 type XPSRow struct { 4193 // ColumnIds: The ids of the columns. Note: The below `values` field must match 4194 // order of this field, if this field is set. 4195 ColumnIds []int64 `json:"columnIds,omitempty"` 4196 // Values: The values of the row cells, given in the same order as the 4197 // column_ids. If column_ids is not set, then in the same order as the 4198 // input_feature_column_ids in TablesModelMetadata. 4199 Values []interface{} `json:"values,omitempty"` 4200 // ForceSendFields is a list of field names (e.g. "ColumnIds") to 4201 // unconditionally include in API requests. By default, fields with empty or 4202 // default values are omitted from API requests. See 4203 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4204 // details. 4205 ForceSendFields []string `json:"-"` 4206 // NullFields is a list of field names (e.g. "ColumnIds") to include in API 4207 // requests with the JSON null value. By default, fields with empty values are 4208 // omitted from API requests. See 4209 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4210 NullFields []string `json:"-"` 4211 } 4212 4213 func (s *XPSRow) MarshalJSON() ([]byte, error) { 4214 type NoMethod XPSRow 4215 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4216 } 4217 4218 type XPSSpeechEvaluationMetrics struct { 4219 // SubModelEvaluationMetrics: Evaluation metrics for all submodels contained in 4220 // this model. 4221 SubModelEvaluationMetrics []*XPSSpeechEvaluationMetricsSubModelEvaluationMetric `json:"subModelEvaluationMetrics,omitempty"` 4222 // ForceSendFields is a list of field names (e.g. "SubModelEvaluationMetrics") 4223 // to unconditionally include in API requests. By default, fields with empty or 4224 // default values are omitted from API requests. See 4225 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4226 // details. 4227 ForceSendFields []string `json:"-"` 4228 // NullFields is a list of field names (e.g. "SubModelEvaluationMetrics") to 4229 // include in API requests with the JSON null value. By default, fields with 4230 // empty values are omitted from API requests. See 4231 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4232 NullFields []string `json:"-"` 4233 } 4234 4235 func (s *XPSSpeechEvaluationMetrics) MarshalJSON() ([]byte, error) { 4236 type NoMethod XPSSpeechEvaluationMetrics 4237 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4238 } 4239 4240 type XPSSpeechEvaluationMetricsSubModelEvaluationMetric struct { 4241 // BiasingModelType: Type of the biasing model. 4242 // 4243 // Possible values: 4244 // "BIASING_MODEL_TYPE_UNSPECIFIED" 4245 // "COMMAND_AND_SEARCH" - Build biasing model on top of COMMAND_AND_SEARCH 4246 // model 4247 // "PHONE_CALL" - Build biasing model on top of PHONE_CALL model 4248 // "VIDEO" - Build biasing model on top of VIDEO model 4249 // "DEFAULT" - Build biasing model on top of DEFAULT model 4250 BiasingModelType string `json:"biasingModelType,omitempty"` 4251 // IsEnhancedModel: If true then it means we have an enhanced version of the 4252 // biasing models. 4253 IsEnhancedModel bool `json:"isEnhancedModel,omitempty"` 4254 NumDeletions int64 `json:"numDeletions,omitempty"` 4255 NumInsertions int64 `json:"numInsertions,omitempty"` 4256 NumSubstitutions int64 `json:"numSubstitutions,omitempty"` 4257 // NumUtterances: Number of utterances used in the wer computation. 4258 NumUtterances int64 `json:"numUtterances,omitempty"` 4259 // NumWords: Number of words over which the word error rate was computed. 4260 NumWords int64 `json:"numWords,omitempty"` 4261 // SentenceAccuracy: Below fields are used for debugging purposes 4262 SentenceAccuracy float64 `json:"sentenceAccuracy,omitempty"` 4263 // Wer: Word error rate (standard error metric used for speech recognition). 4264 Wer float64 `json:"wer,omitempty"` 4265 // ForceSendFields is a list of field names (e.g. "BiasingModelType") to 4266 // unconditionally include in API requests. By default, fields with empty or 4267 // default values are omitted from API requests. See 4268 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4269 // details. 4270 ForceSendFields []string `json:"-"` 4271 // NullFields is a list of field names (e.g. "BiasingModelType") to include in 4272 // API requests with the JSON null value. By default, fields with empty values 4273 // are omitted from API requests. See 4274 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4275 NullFields []string `json:"-"` 4276 } 4277 4278 func (s *XPSSpeechEvaluationMetricsSubModelEvaluationMetric) MarshalJSON() ([]byte, error) { 4279 type NoMethod XPSSpeechEvaluationMetricsSubModelEvaluationMetric 4280 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4281 } 4282 4283 func (s *XPSSpeechEvaluationMetricsSubModelEvaluationMetric) UnmarshalJSON(data []byte) error { 4284 type NoMethod XPSSpeechEvaluationMetricsSubModelEvaluationMetric 4285 var s1 struct { 4286 SentenceAccuracy gensupport.JSONFloat64 `json:"sentenceAccuracy"` 4287 Wer gensupport.JSONFloat64 `json:"wer"` 4288 *NoMethod 4289 } 4290 s1.NoMethod = (*NoMethod)(s) 4291 if err := json.Unmarshal(data, &s1); err != nil { 4292 return err 4293 } 4294 s.SentenceAccuracy = float64(s1.SentenceAccuracy) 4295 s.Wer = float64(s1.Wer) 4296 return nil 4297 } 4298 4299 type XPSSpeechModelSpec struct { 4300 // DatasetId: Required for speech xps backend. Speech xps has to use dataset_id 4301 // and model_id as the primary key in db so that speech API can query the db 4302 // directly. 4303 DatasetId int64 `json:"datasetId,omitempty,string"` 4304 Language string `json:"language,omitempty"` 4305 // SubModelSpecs: Model specs for all submodels contained in this model. 4306 SubModelSpecs []*XPSSpeechModelSpecSubModelSpec `json:"subModelSpecs,omitempty"` 4307 // ForceSendFields is a list of field names (e.g. "DatasetId") to 4308 // unconditionally include in API requests. By default, fields with empty or 4309 // default values are omitted from API requests. See 4310 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4311 // details. 4312 ForceSendFields []string `json:"-"` 4313 // NullFields is a list of field names (e.g. "DatasetId") to include in API 4314 // requests with the JSON null value. By default, fields with empty values are 4315 // omitted from API requests. See 4316 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4317 NullFields []string `json:"-"` 4318 } 4319 4320 func (s *XPSSpeechModelSpec) MarshalJSON() ([]byte, error) { 4321 type NoMethod XPSSpeechModelSpec 4322 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4323 } 4324 4325 type XPSSpeechModelSpecSubModelSpec struct { 4326 // BiasingModelType: Type of the biasing model. 4327 // 4328 // Possible values: 4329 // "BIASING_MODEL_TYPE_UNSPECIFIED" 4330 // "COMMAND_AND_SEARCH" - Build biasing model on top of COMMAND_AND_SEARCH 4331 // model 4332 // "PHONE_CALL" - Build biasing model on top of PHONE_CALL model 4333 // "VIDEO" - Build biasing model on top of VIDEO model 4334 // "DEFAULT" - Build biasing model on top of DEFAULT model 4335 BiasingModelType string `json:"biasingModelType,omitempty"` 4336 // ClientId: In S3, Recognition ClientContextId.client_id 4337 ClientId string `json:"clientId,omitempty"` 4338 // ContextId: In S3, Recognition ClientContextId.context_id 4339 ContextId string `json:"contextId,omitempty"` 4340 // IsEnhancedModel: If true then it means we have an enhanced version of the 4341 // biasing models. 4342 IsEnhancedModel bool `json:"isEnhancedModel,omitempty"` 4343 // ForceSendFields is a list of field names (e.g. "BiasingModelType") to 4344 // unconditionally include in API requests. By default, fields with empty or 4345 // default values are omitted from API requests. See 4346 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4347 // details. 4348 ForceSendFields []string `json:"-"` 4349 // NullFields is a list of field names (e.g. "BiasingModelType") to include in 4350 // API requests with the JSON null value. By default, fields with empty values 4351 // are omitted from API requests. See 4352 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4353 NullFields []string `json:"-"` 4354 } 4355 4356 func (s *XPSSpeechModelSpecSubModelSpec) MarshalJSON() ([]byte, error) { 4357 type NoMethod XPSSpeechModelSpecSubModelSpec 4358 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4359 } 4360 4361 type XPSSpeechPreprocessResponse struct { 4362 // CnsTestDataPath: Location od shards of sstables (test data) of DataUtterance 4363 // protos. 4364 CnsTestDataPath string `json:"cnsTestDataPath,omitempty"` 4365 // CnsTrainDataPath: Location of shards of sstables (training data) of 4366 // DataUtterance protos. 4367 CnsTrainDataPath string `json:"cnsTrainDataPath,omitempty"` 4368 // PrebuiltModelEvaluationMetrics: The metrics for prebuilt speech models. They 4369 // are included here because there is no prebuilt speech models stored in the 4370 // AutoML. 4371 PrebuiltModelEvaluationMetrics *XPSSpeechEvaluationMetrics `json:"prebuiltModelEvaluationMetrics,omitempty"` 4372 // SpeechPreprocessStats: Stats associated with the data. 4373 SpeechPreprocessStats *XPSSpeechPreprocessStats `json:"speechPreprocessStats,omitempty"` 4374 // ForceSendFields is a list of field names (e.g. "CnsTestDataPath") to 4375 // unconditionally include in API requests. By default, fields with empty or 4376 // default values are omitted from API requests. See 4377 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4378 // details. 4379 ForceSendFields []string `json:"-"` 4380 // NullFields is a list of field names (e.g. "CnsTestDataPath") to include in 4381 // API requests with the JSON null value. By default, fields with empty values 4382 // are omitted from API requests. See 4383 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4384 NullFields []string `json:"-"` 4385 } 4386 4387 func (s *XPSSpeechPreprocessResponse) MarshalJSON() ([]byte, error) { 4388 type NoMethod XPSSpeechPreprocessResponse 4389 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4390 } 4391 4392 type XPSSpeechPreprocessStats struct { 4393 // DataErrors: Different types of data errors and the counts associated with 4394 // them. 4395 DataErrors []*XPSDataErrors `json:"dataErrors,omitempty"` 4396 // NumHumanLabeledExamples: The number of rows marked HUMAN_LABELLED 4397 NumHumanLabeledExamples int64 `json:"numHumanLabeledExamples,omitempty"` 4398 // NumLogsExamples: The number of samples found in the previously recorded logs 4399 // data. 4400 NumLogsExamples int64 `json:"numLogsExamples,omitempty"` 4401 // NumMachineTranscribedExamples: The number of rows marked as 4402 // MACHINE_TRANSCRIBED 4403 NumMachineTranscribedExamples int64 `json:"numMachineTranscribedExamples,omitempty"` 4404 // TestExamplesCount: The number of examples labelled as TEST by Speech xps 4405 // server. 4406 TestExamplesCount int64 `json:"testExamplesCount,omitempty"` 4407 // TestSentencesCount: The number of sentences in the test data set. 4408 TestSentencesCount int64 `json:"testSentencesCount,omitempty"` 4409 // TestWordsCount: The number of words in the test data set. 4410 TestWordsCount int64 `json:"testWordsCount,omitempty"` 4411 // TrainExamplesCount: The number of examples labeled as TRAIN by Speech xps 4412 // server. 4413 TrainExamplesCount int64 `json:"trainExamplesCount,omitempty"` 4414 // TrainSentencesCount: The number of sentences in the training data set. 4415 TrainSentencesCount int64 `json:"trainSentencesCount,omitempty"` 4416 // TrainWordsCount: The number of words in the training data set. 4417 TrainWordsCount int64 `json:"trainWordsCount,omitempty"` 4418 // ForceSendFields is a list of field names (e.g. "DataErrors") to 4419 // unconditionally include in API requests. By default, fields with empty or 4420 // default values are omitted from API requests. See 4421 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4422 // details. 4423 ForceSendFields []string `json:"-"` 4424 // NullFields is a list of field names (e.g. "DataErrors") to include in API 4425 // requests with the JSON null value. By default, fields with empty values are 4426 // omitted from API requests. See 4427 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4428 NullFields []string `json:"-"` 4429 } 4430 4431 func (s *XPSSpeechPreprocessStats) MarshalJSON() ([]byte, error) { 4432 type NoMethod XPSSpeechPreprocessStats 4433 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4434 } 4435 4436 // XPSStringStats: The data statistics of a series of STRING values. 4437 type XPSStringStats struct { 4438 CommonStats *XPSCommonStats `json:"commonStats,omitempty"` 4439 // TopUnigramStats: The statistics of the top 20 unigrams, ordered by 4440 // StringStats.UnigramStats.count. 4441 TopUnigramStats []*XPSStringStatsUnigramStats `json:"topUnigramStats,omitempty"` 4442 // ForceSendFields is a list of field names (e.g. "CommonStats") to 4443 // unconditionally include in API requests. By default, fields with empty or 4444 // default values are omitted from API requests. See 4445 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4446 // details. 4447 ForceSendFields []string `json:"-"` 4448 // NullFields is a list of field names (e.g. "CommonStats") to include in API 4449 // requests with the JSON null value. By default, fields with empty values are 4450 // omitted from API requests. See 4451 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4452 NullFields []string `json:"-"` 4453 } 4454 4455 func (s *XPSStringStats) MarshalJSON() ([]byte, error) { 4456 type NoMethod XPSStringStats 4457 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4458 } 4459 4460 // XPSStringStatsUnigramStats: The statistics of a unigram. 4461 type XPSStringStatsUnigramStats struct { 4462 // Count: The number of occurrences of this unigram in the series. 4463 Count int64 `json:"count,omitempty,string"` 4464 // Value: The unigram. 4465 Value string `json:"value,omitempty"` 4466 // ForceSendFields is a list of field names (e.g. "Count") to unconditionally 4467 // include in API requests. By default, fields with empty or default values are 4468 // omitted from API requests. See 4469 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4470 // details. 4471 ForceSendFields []string `json:"-"` 4472 // NullFields is a list of field names (e.g. "Count") to include in API 4473 // requests with the JSON null value. By default, fields with empty values are 4474 // omitted from API requests. See 4475 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4476 NullFields []string `json:"-"` 4477 } 4478 4479 func (s *XPSStringStatsUnigramStats) MarshalJSON() ([]byte, error) { 4480 type NoMethod XPSStringStatsUnigramStats 4481 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4482 } 4483 4484 // XPSStructStats: The data statistics of a series of STRUCT values. 4485 type XPSStructStats struct { 4486 CommonStats *XPSCommonStats `json:"commonStats,omitempty"` 4487 // FieldStats: Map from a field name of the struct to data stats aggregated 4488 // over series of all data in that field across all the structs. 4489 FieldStats map[string]XPSDataStats `json:"fieldStats,omitempty"` 4490 // ForceSendFields is a list of field names (e.g. "CommonStats") to 4491 // unconditionally include in API requests. By default, fields with empty or 4492 // default values are omitted from API requests. See 4493 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4494 // details. 4495 ForceSendFields []string `json:"-"` 4496 // NullFields is a list of field names (e.g. "CommonStats") to include in API 4497 // requests with the JSON null value. By default, fields with empty values are 4498 // omitted from API requests. See 4499 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4500 NullFields []string `json:"-"` 4501 } 4502 4503 func (s *XPSStructStats) MarshalJSON() ([]byte, error) { 4504 type NoMethod XPSStructStats 4505 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4506 } 4507 4508 // XPSStructType: `StructType` defines the DataType-s of a STRUCT type. 4509 type XPSStructType struct { 4510 // Fields: Unordered map of struct field names to their data types. 4511 Fields map[string]XPSDataType `json:"fields,omitempty"` 4512 // ForceSendFields is a list of field names (e.g. "Fields") to unconditionally 4513 // include in API requests. By default, fields with empty or default values are 4514 // omitted from API requests. See 4515 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4516 // details. 4517 ForceSendFields []string `json:"-"` 4518 // NullFields is a list of field names (e.g. "Fields") to include in API 4519 // requests with the JSON null value. By default, fields with empty values are 4520 // omitted from API requests. See 4521 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4522 NullFields []string `json:"-"` 4523 } 4524 4525 func (s *XPSStructType) MarshalJSON() ([]byte, error) { 4526 type NoMethod XPSStructType 4527 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4528 } 4529 4530 type XPSTableSpec struct { 4531 // ColumnSpecs: Mapping from column id to column spec. 4532 ColumnSpecs map[string]XPSColumnSpec `json:"columnSpecs,omitempty"` 4533 // ImportedDataSizeInBytes: The total size of imported data of the table. 4534 ImportedDataSizeInBytes int64 `json:"importedDataSizeInBytes,omitempty,string"` 4535 // RowCount: The number of rows in the table. 4536 RowCount int64 `json:"rowCount,omitempty,string"` 4537 // TimeColumnId: The id of the time column. 4538 TimeColumnId int64 `json:"timeColumnId,omitempty"` 4539 // ValidRowCount: The number of valid rows. 4540 ValidRowCount int64 `json:"validRowCount,omitempty,string"` 4541 // ForceSendFields is a list of field names (e.g. "ColumnSpecs") to 4542 // unconditionally include in API requests. By default, fields with empty or 4543 // default values are omitted from API requests. See 4544 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4545 // details. 4546 ForceSendFields []string `json:"-"` 4547 // NullFields is a list of field names (e.g. "ColumnSpecs") to include in API 4548 // requests with the JSON null value. By default, fields with empty values are 4549 // omitted from API requests. See 4550 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4551 NullFields []string `json:"-"` 4552 } 4553 4554 func (s *XPSTableSpec) MarshalJSON() ([]byte, error) { 4555 type NoMethod XPSTableSpec 4556 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4557 } 4558 4559 // XPSTablesClassificationMetrics: Metrics for Tables classification problems. 4560 type XPSTablesClassificationMetrics struct { 4561 // CurveMetrics: Metrics building a curve. 4562 CurveMetrics []*XPSTablesClassificationMetricsCurveMetrics `json:"curveMetrics,omitempty"` 4563 // ForceSendFields is a list of field names (e.g. "CurveMetrics") to 4564 // unconditionally include in API requests. By default, fields with empty or 4565 // default values are omitted from API requests. See 4566 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4567 // details. 4568 ForceSendFields []string `json:"-"` 4569 // NullFields is a list of field names (e.g. "CurveMetrics") to include in API 4570 // requests with the JSON null value. By default, fields with empty values are 4571 // omitted from API requests. See 4572 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4573 NullFields []string `json:"-"` 4574 } 4575 4576 func (s *XPSTablesClassificationMetrics) MarshalJSON() ([]byte, error) { 4577 type NoMethod XPSTablesClassificationMetrics 4578 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4579 } 4580 4581 // XPSTablesClassificationMetricsCurveMetrics: Metrics curve data point for a 4582 // single value. 4583 type XPSTablesClassificationMetricsCurveMetrics struct { 4584 // AucPr: The area under the precision-recall curve. 4585 AucPr float64 `json:"aucPr,omitempty"` 4586 // AucRoc: The area under receiver operating characteristic curve. 4587 AucRoc float64 `json:"aucRoc,omitempty"` 4588 // ConfidenceMetricsEntries: Metrics that have confidence thresholds. 4589 // Precision-recall curve and ROC curve can be derived from them. 4590 ConfidenceMetricsEntries []*XPSTablesConfidenceMetricsEntry `json:"confidenceMetricsEntries,omitempty"` 4591 // LogLoss: The Log loss metric. 4592 LogLoss float64 `json:"logLoss,omitempty"` 4593 // PositionThreshold: The position threshold value used to compute the metrics. 4594 PositionThreshold int64 `json:"positionThreshold,omitempty"` 4595 // Value: The CATEGORY row value (for ARRAY unnested) the curve metrics are 4596 // for. 4597 Value string `json:"value,omitempty"` 4598 // ForceSendFields is a list of field names (e.g. "AucPr") to unconditionally 4599 // include in API requests. By default, fields with empty or default values are 4600 // omitted from API requests. See 4601 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4602 // details. 4603 ForceSendFields []string `json:"-"` 4604 // NullFields is a list of field names (e.g. "AucPr") to include in API 4605 // requests with the JSON null value. By default, fields with empty values are 4606 // omitted from API requests. See 4607 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4608 NullFields []string `json:"-"` 4609 } 4610 4611 func (s *XPSTablesClassificationMetricsCurveMetrics) MarshalJSON() ([]byte, error) { 4612 type NoMethod XPSTablesClassificationMetricsCurveMetrics 4613 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4614 } 4615 4616 func (s *XPSTablesClassificationMetricsCurveMetrics) UnmarshalJSON(data []byte) error { 4617 type NoMethod XPSTablesClassificationMetricsCurveMetrics 4618 var s1 struct { 4619 AucPr gensupport.JSONFloat64 `json:"aucPr"` 4620 AucRoc gensupport.JSONFloat64 `json:"aucRoc"` 4621 LogLoss gensupport.JSONFloat64 `json:"logLoss"` 4622 *NoMethod 4623 } 4624 s1.NoMethod = (*NoMethod)(s) 4625 if err := json.Unmarshal(data, &s1); err != nil { 4626 return err 4627 } 4628 s.AucPr = float64(s1.AucPr) 4629 s.AucRoc = float64(s1.AucRoc) 4630 s.LogLoss = float64(s1.LogLoss) 4631 return nil 4632 } 4633 4634 // XPSTablesConfidenceMetricsEntry: Metrics for a single confidence threshold. 4635 type XPSTablesConfidenceMetricsEntry struct { 4636 // ConfidenceThreshold: The confidence threshold value used to compute the 4637 // metrics. 4638 ConfidenceThreshold float64 `json:"confidenceThreshold,omitempty"` 4639 // F1Score: The harmonic mean of recall and precision. (2 * precision * recall) 4640 // / (precision + recall) 4641 F1Score float64 `json:"f1Score,omitempty"` 4642 // FalseNegativeCount: False negative count. 4643 FalseNegativeCount int64 `json:"falseNegativeCount,omitempty,string"` 4644 // FalsePositiveCount: False positive count. 4645 FalsePositiveCount int64 `json:"falsePositiveCount,omitempty,string"` 4646 // FalsePositiveRate: FPR = #false positives / (#false positives + #true 4647 // negatives) 4648 FalsePositiveRate float64 `json:"falsePositiveRate,omitempty"` 4649 // Precision: Precision = #true positives / (#true positives + #false 4650 // positives). 4651 Precision float64 `json:"precision,omitempty"` 4652 // Recall: Recall = #true positives / (#true positives + #false negatives). 4653 Recall float64 `json:"recall,omitempty"` 4654 // TrueNegativeCount: True negative count. 4655 TrueNegativeCount int64 `json:"trueNegativeCount,omitempty,string"` 4656 // TruePositiveCount: True positive count. 4657 TruePositiveCount int64 `json:"truePositiveCount,omitempty,string"` 4658 // TruePositiveRate: TPR = #true positives / (#true positives + #false 4659 // negatvies) 4660 TruePositiveRate float64 `json:"truePositiveRate,omitempty"` 4661 // ForceSendFields is a list of field names (e.g. "ConfidenceThreshold") to 4662 // unconditionally include in API requests. By default, fields with empty or 4663 // default values are omitted from API requests. See 4664 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4665 // details. 4666 ForceSendFields []string `json:"-"` 4667 // NullFields is a list of field names (e.g. "ConfidenceThreshold") to include 4668 // in API requests with the JSON null value. By default, fields with empty 4669 // values are omitted from API requests. See 4670 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4671 NullFields []string `json:"-"` 4672 } 4673 4674 func (s *XPSTablesConfidenceMetricsEntry) MarshalJSON() ([]byte, error) { 4675 type NoMethod XPSTablesConfidenceMetricsEntry 4676 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4677 } 4678 4679 func (s *XPSTablesConfidenceMetricsEntry) UnmarshalJSON(data []byte) error { 4680 type NoMethod XPSTablesConfidenceMetricsEntry 4681 var s1 struct { 4682 ConfidenceThreshold gensupport.JSONFloat64 `json:"confidenceThreshold"` 4683 F1Score gensupport.JSONFloat64 `json:"f1Score"` 4684 FalsePositiveRate gensupport.JSONFloat64 `json:"falsePositiveRate"` 4685 Precision gensupport.JSONFloat64 `json:"precision"` 4686 Recall gensupport.JSONFloat64 `json:"recall"` 4687 TruePositiveRate gensupport.JSONFloat64 `json:"truePositiveRate"` 4688 *NoMethod 4689 } 4690 s1.NoMethod = (*NoMethod)(s) 4691 if err := json.Unmarshal(data, &s1); err != nil { 4692 return err 4693 } 4694 s.ConfidenceThreshold = float64(s1.ConfidenceThreshold) 4695 s.F1Score = float64(s1.F1Score) 4696 s.FalsePositiveRate = float64(s1.FalsePositiveRate) 4697 s.Precision = float64(s1.Precision) 4698 s.Recall = float64(s1.Recall) 4699 s.TruePositiveRate = float64(s1.TruePositiveRate) 4700 return nil 4701 } 4702 4703 // XPSTablesDatasetMetadata: Metadata for a dataset used for AutoML Tables. 4704 // Next ID: 6 4705 type XPSTablesDatasetMetadata struct { 4706 // MlUseColumnId: Id the column to split the table. 4707 MlUseColumnId int64 `json:"mlUseColumnId,omitempty"` 4708 // PrimaryTableSpec: Primary table. 4709 PrimaryTableSpec *XPSTableSpec `json:"primaryTableSpec,omitempty"` 4710 // TargetColumnCorrelations: (the column id : its CorrelationStats with target 4711 // column). 4712 TargetColumnCorrelations map[string]XPSCorrelationStats `json:"targetColumnCorrelations,omitempty"` 4713 // TargetColumnId: Id of the primary table column that should be used as the 4714 // training label. 4715 TargetColumnId int64 `json:"targetColumnId,omitempty"` 4716 // WeightColumnId: Id of the primary table column that should be used as the 4717 // weight column. 4718 WeightColumnId int64 `json:"weightColumnId,omitempty"` 4719 // ForceSendFields is a list of field names (e.g. "MlUseColumnId") to 4720 // unconditionally include in API requests. By default, fields with empty or 4721 // default values are omitted from API requests. See 4722 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4723 // details. 4724 ForceSendFields []string `json:"-"` 4725 // NullFields is a list of field names (e.g. "MlUseColumnId") to include in API 4726 // requests with the JSON null value. By default, fields with empty values are 4727 // omitted from API requests. See 4728 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4729 NullFields []string `json:"-"` 4730 } 4731 4732 func (s *XPSTablesDatasetMetadata) MarshalJSON() ([]byte, error) { 4733 type NoMethod XPSTablesDatasetMetadata 4734 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4735 } 4736 4737 type XPSTablesEvaluationMetrics struct { 4738 // ClassificationMetrics: Classification metrics. 4739 ClassificationMetrics *XPSTablesClassificationMetrics `json:"classificationMetrics,omitempty"` 4740 // RegressionMetrics: Regression metrics. 4741 RegressionMetrics *XPSTablesRegressionMetrics `json:"regressionMetrics,omitempty"` 4742 // ForceSendFields is a list of field names (e.g. "ClassificationMetrics") to 4743 // unconditionally include in API requests. By default, fields with empty or 4744 // default values are omitted from API requests. See 4745 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4746 // details. 4747 ForceSendFields []string `json:"-"` 4748 // NullFields is a list of field names (e.g. "ClassificationMetrics") to 4749 // include in API requests with the JSON null value. By default, fields with 4750 // empty values are omitted from API requests. See 4751 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4752 NullFields []string `json:"-"` 4753 } 4754 4755 func (s *XPSTablesEvaluationMetrics) MarshalJSON() ([]byte, error) { 4756 type NoMethod XPSTablesEvaluationMetrics 4757 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4758 } 4759 4760 // XPSTablesModelColumnInfo: An information specific to given column and Tables 4761 // Model, in context of the Model and the predictions created by it. 4762 type XPSTablesModelColumnInfo struct { 4763 // ColumnId: The ID of the column. 4764 ColumnId int64 `json:"columnId,omitempty"` 4765 // FeatureImportance: When given as part of a Model: Measurement of how much 4766 // model predictions correctness on the TEST data depend on values in this 4767 // column. A value between 0 and 1, higher means higher influence. These values 4768 // are normalized - for all input feature columns of a given model they add to 4769 // 1. When given back by Predict or Batch Predict: Measurement of how impactful 4770 // for the prediction returned for the given row the value in this column was. 4771 // Specifically, the feature importance specifies the marginal contribution 4772 // that the feature made to the prediction score compared to the baseline 4773 // score. These values are computed using the Sampled Shapley method. 4774 FeatureImportance float64 `json:"featureImportance,omitempty"` 4775 // ForceSendFields is a list of field names (e.g. "ColumnId") to 4776 // unconditionally include in API requests. By default, fields with empty or 4777 // default values are omitted from API requests. See 4778 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4779 // details. 4780 ForceSendFields []string `json:"-"` 4781 // NullFields is a list of field names (e.g. "ColumnId") to include in API 4782 // requests with the JSON null value. By default, fields with empty values are 4783 // omitted from API requests. See 4784 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4785 NullFields []string `json:"-"` 4786 } 4787 4788 func (s *XPSTablesModelColumnInfo) MarshalJSON() ([]byte, error) { 4789 type NoMethod XPSTablesModelColumnInfo 4790 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4791 } 4792 4793 func (s *XPSTablesModelColumnInfo) UnmarshalJSON(data []byte) error { 4794 type NoMethod XPSTablesModelColumnInfo 4795 var s1 struct { 4796 FeatureImportance gensupport.JSONFloat64 `json:"featureImportance"` 4797 *NoMethod 4798 } 4799 s1.NoMethod = (*NoMethod)(s) 4800 if err := json.Unmarshal(data, &s1); err != nil { 4801 return err 4802 } 4803 s.FeatureImportance = float64(s1.FeatureImportance) 4804 return nil 4805 } 4806 4807 // XPSTablesModelStructure: A description of Tables model structure. 4808 type XPSTablesModelStructure struct { 4809 // ModelParameters: A list of models. 4810 ModelParameters []*XPSTablesModelStructureModelParameters `json:"modelParameters,omitempty"` 4811 // ForceSendFields is a list of field names (e.g. "ModelParameters") to 4812 // unconditionally include in API requests. By default, fields with empty or 4813 // default values are omitted from API requests. See 4814 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4815 // details. 4816 ForceSendFields []string `json:"-"` 4817 // NullFields is a list of field names (e.g. "ModelParameters") to include in 4818 // API requests with the JSON null value. By default, fields with empty values 4819 // are omitted from API requests. See 4820 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4821 NullFields []string `json:"-"` 4822 } 4823 4824 func (s *XPSTablesModelStructure) MarshalJSON() ([]byte, error) { 4825 type NoMethod XPSTablesModelStructure 4826 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4827 } 4828 4829 // XPSTablesModelStructureModelParameters: Model hyper-parameters for a model. 4830 type XPSTablesModelStructureModelParameters struct { 4831 Hyperparameters []*XPSTablesModelStructureModelParametersParameter `json:"hyperparameters,omitempty"` 4832 // ForceSendFields is a list of field names (e.g. "Hyperparameters") to 4833 // unconditionally include in API requests. By default, fields with empty or 4834 // default values are omitted from API requests. See 4835 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4836 // details. 4837 ForceSendFields []string `json:"-"` 4838 // NullFields is a list of field names (e.g. "Hyperparameters") to include in 4839 // API requests with the JSON null value. By default, fields with empty values 4840 // are omitted from API requests. See 4841 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4842 NullFields []string `json:"-"` 4843 } 4844 4845 func (s *XPSTablesModelStructureModelParameters) MarshalJSON() ([]byte, error) { 4846 type NoMethod XPSTablesModelStructureModelParameters 4847 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4848 } 4849 4850 type XPSTablesModelStructureModelParametersParameter struct { 4851 // FloatValue: Float type parameter value. 4852 FloatValue float64 `json:"floatValue,omitempty"` 4853 // IntValue: Integer type parameter value. 4854 IntValue int64 `json:"intValue,omitempty,string"` 4855 // Name: Parameter name. 4856 Name string `json:"name,omitempty"` 4857 // StringValue: String type parameter value. 4858 StringValue string `json:"stringValue,omitempty"` 4859 // ForceSendFields is a list of field names (e.g. "FloatValue") to 4860 // unconditionally include in API requests. By default, fields with empty or 4861 // default values are omitted from API requests. See 4862 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4863 // details. 4864 ForceSendFields []string `json:"-"` 4865 // NullFields is a list of field names (e.g. "FloatValue") to include in API 4866 // requests with the JSON null value. By default, fields with empty values are 4867 // omitted from API requests. See 4868 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4869 NullFields []string `json:"-"` 4870 } 4871 4872 func (s *XPSTablesModelStructureModelParametersParameter) MarshalJSON() ([]byte, error) { 4873 type NoMethod XPSTablesModelStructureModelParametersParameter 4874 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4875 } 4876 4877 func (s *XPSTablesModelStructureModelParametersParameter) UnmarshalJSON(data []byte) error { 4878 type NoMethod XPSTablesModelStructureModelParametersParameter 4879 var s1 struct { 4880 FloatValue gensupport.JSONFloat64 `json:"floatValue"` 4881 *NoMethod 4882 } 4883 s1.NoMethod = (*NoMethod)(s) 4884 if err := json.Unmarshal(data, &s1); err != nil { 4885 return err 4886 } 4887 s.FloatValue = float64(s1.FloatValue) 4888 return nil 4889 } 4890 4891 type XPSTablesPreprocessResponse struct { 4892 // TablesDatasetMetadata: The table/column id, column_name and the DataTypes of 4893 // the columns will be populated. 4894 TablesDatasetMetadata *XPSTablesDatasetMetadata `json:"tablesDatasetMetadata,omitempty"` 4895 // ForceSendFields is a list of field names (e.g. "TablesDatasetMetadata") to 4896 // unconditionally include in API requests. By default, fields with empty or 4897 // default values are omitted from API requests. See 4898 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4899 // details. 4900 ForceSendFields []string `json:"-"` 4901 // NullFields is a list of field names (e.g. "TablesDatasetMetadata") to 4902 // include in API requests with the JSON null value. By default, fields with 4903 // empty values are omitted from API requests. See 4904 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4905 NullFields []string `json:"-"` 4906 } 4907 4908 func (s *XPSTablesPreprocessResponse) MarshalJSON() ([]byte, error) { 4909 type NoMethod XPSTablesPreprocessResponse 4910 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4911 } 4912 4913 // XPSTablesRegressionMetrics: Metrics for Tables regression problems. 4914 type XPSTablesRegressionMetrics struct { 4915 // MeanAbsoluteError: Mean absolute error. 4916 MeanAbsoluteError float64 `json:"meanAbsoluteError,omitempty"` 4917 // MeanAbsolutePercentageError: Mean absolute percentage error, only set if all 4918 // of the target column's values are positive. 4919 MeanAbsolutePercentageError float64 `json:"meanAbsolutePercentageError,omitempty"` 4920 // RSquared: R squared. 4921 RSquared float64 `json:"rSquared,omitempty"` 4922 // RegressionMetricsEntries: A list of actual versus predicted points for the 4923 // model being evaluated. 4924 RegressionMetricsEntries []*XPSRegressionMetricsEntry `json:"regressionMetricsEntries,omitempty"` 4925 // RootMeanSquaredError: Root mean squared error. 4926 RootMeanSquaredError float64 `json:"rootMeanSquaredError,omitempty"` 4927 // RootMeanSquaredLogError: Root mean squared log error. 4928 RootMeanSquaredLogError float64 `json:"rootMeanSquaredLogError,omitempty"` 4929 // ForceSendFields is a list of field names (e.g. "MeanAbsoluteError") to 4930 // unconditionally include in API requests. By default, fields with empty or 4931 // default values are omitted from API requests. See 4932 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4933 // details. 4934 ForceSendFields []string `json:"-"` 4935 // NullFields is a list of field names (e.g. "MeanAbsoluteError") to include in 4936 // API requests with the JSON null value. By default, fields with empty values 4937 // are omitted from API requests. See 4938 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4939 NullFields []string `json:"-"` 4940 } 4941 4942 func (s *XPSTablesRegressionMetrics) MarshalJSON() ([]byte, error) { 4943 type NoMethod XPSTablesRegressionMetrics 4944 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4945 } 4946 4947 func (s *XPSTablesRegressionMetrics) UnmarshalJSON(data []byte) error { 4948 type NoMethod XPSTablesRegressionMetrics 4949 var s1 struct { 4950 MeanAbsoluteError gensupport.JSONFloat64 `json:"meanAbsoluteError"` 4951 MeanAbsolutePercentageError gensupport.JSONFloat64 `json:"meanAbsolutePercentageError"` 4952 RSquared gensupport.JSONFloat64 `json:"rSquared"` 4953 RootMeanSquaredError gensupport.JSONFloat64 `json:"rootMeanSquaredError"` 4954 RootMeanSquaredLogError gensupport.JSONFloat64 `json:"rootMeanSquaredLogError"` 4955 *NoMethod 4956 } 4957 s1.NoMethod = (*NoMethod)(s) 4958 if err := json.Unmarshal(data, &s1); err != nil { 4959 return err 4960 } 4961 s.MeanAbsoluteError = float64(s1.MeanAbsoluteError) 4962 s.MeanAbsolutePercentageError = float64(s1.MeanAbsolutePercentageError) 4963 s.RSquared = float64(s1.RSquared) 4964 s.RootMeanSquaredError = float64(s1.RootMeanSquaredError) 4965 s.RootMeanSquaredLogError = float64(s1.RootMeanSquaredLogError) 4966 return nil 4967 } 4968 4969 type XPSTablesTrainResponse struct { 4970 ModelStructure *XPSTablesModelStructure `json:"modelStructure,omitempty"` 4971 // PredictionSampleRows: Sample rows from the dataset this model was trained. 4972 PredictionSampleRows []*XPSRow `json:"predictionSampleRows,omitempty"` 4973 // TablesModelColumnInfo: Output only. Auxiliary information for each of the 4974 // input_feature_column_specs, with respect to this particular model. 4975 TablesModelColumnInfo []*XPSTablesModelColumnInfo `json:"tablesModelColumnInfo,omitempty"` 4976 // TrainCostMilliNodeHours: The actual training cost of the model, expressed in 4977 // milli node hours, i.e. 1,000 value in this field means 1 node hour. 4978 // Guaranteed to not exceed the train budget. 4979 TrainCostMilliNodeHours int64 `json:"trainCostMilliNodeHours,omitempty,string"` 4980 // ForceSendFields is a list of field names (e.g. "ModelStructure") to 4981 // unconditionally include in API requests. By default, fields with empty or 4982 // default values are omitted from API requests. See 4983 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 4984 // details. 4985 ForceSendFields []string `json:"-"` 4986 // NullFields is a list of field names (e.g. "ModelStructure") to include in 4987 // API requests with the JSON null value. By default, fields with empty values 4988 // are omitted from API requests. See 4989 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 4990 NullFields []string `json:"-"` 4991 } 4992 4993 func (s *XPSTablesTrainResponse) MarshalJSON() ([]byte, error) { 4994 type NoMethod XPSTablesTrainResponse 4995 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 4996 } 4997 4998 type XPSTablesTrainingOperationMetadata struct { 4999 // CreateModelStage: Current stage of creating model. 5000 // 5001 // Possible values: 5002 // "CREATE_MODEL_STAGE_UNSPECIFIED" - Unspecified stage. 5003 // "DATA_PREPROCESSING" - Prepare the model training pipeline and run data 5004 // processing. 5005 // "TRAINING" - Training model. 5006 // "EVALUATING" - Run evaluation. 5007 // "MODEL_POST_PROCESSING" - Finalizing model training pipeline. 5008 CreateModelStage string `json:"createModelStage,omitempty"` 5009 // OptimizationObjective: The optimization objective for model. 5010 OptimizationObjective string `json:"optimizationObjective,omitempty"` 5011 // TopTrials: This field is for training. When the operation is terminated 5012 // successfully, AutoML Backend post this field to operation metadata in 5013 // spanner. If the metadata has no trials returned, the training operation is 5014 // supposed to be a failure. 5015 TopTrials []*XPSTuningTrial `json:"topTrials,omitempty"` 5016 // TrainBudgetMilliNodeHours: Creating model budget. 5017 TrainBudgetMilliNodeHours int64 `json:"trainBudgetMilliNodeHours,omitempty,string"` 5018 // TrainingObjectivePoints: This field records the training objective value 5019 // with respect to time, giving insight into how the model architecture search 5020 // is performing as training time elapses. 5021 TrainingObjectivePoints []*XPSTrainingObjectivePoint `json:"trainingObjectivePoints,omitempty"` 5022 // TrainingStartTime: Timestamp when training process starts. 5023 TrainingStartTime string `json:"trainingStartTime,omitempty"` 5024 // ForceSendFields is a list of field names (e.g. "CreateModelStage") to 5025 // unconditionally include in API requests. By default, fields with empty or 5026 // default values are omitted from API requests. See 5027 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5028 // details. 5029 ForceSendFields []string `json:"-"` 5030 // NullFields is a list of field names (e.g. "CreateModelStage") to include in 5031 // API requests with the JSON null value. By default, fields with empty values 5032 // are omitted from API requests. See 5033 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5034 NullFields []string `json:"-"` 5035 } 5036 5037 func (s *XPSTablesTrainingOperationMetadata) MarshalJSON() ([]byte, error) { 5038 type NoMethod XPSTablesTrainingOperationMetadata 5039 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5040 } 5041 5042 // XPSTextComponentModel: Component model. Next ID: 10 5043 type XPSTextComponentModel struct { 5044 // BatchPredictionModelGcsUri: The Cloud Storage resource path to hold batch 5045 // prediction model. 5046 BatchPredictionModelGcsUri string `json:"batchPredictionModelGcsUri,omitempty"` 5047 // OnlinePredictionModelGcsUri: The Cloud Storage resource path to hold online 5048 // prediction model. 5049 OnlinePredictionModelGcsUri string `json:"onlinePredictionModelGcsUri,omitempty"` 5050 // Partition: The partition where the model is deployed. Populated by uCAIP BE 5051 // as part of online PredictRequest. 5052 // 5053 // Possible values: 5054 // "PARTITION_TYPE_UNSPECIFIED" 5055 // "PARTITION_ZERO" - The default partition. 5056 // "PARTITION_REDUCED_HOMING" - It has significantly lower replication than 5057 // partition-0 and is located in the US only. It also has a larger model size 5058 // limit and higher default RAM quota than partition-0. Customers with batch 5059 // traffic, US-based traffic, or very large models should use this partition. 5060 // Capacity in this partition is significantly cheaper than partition-0. 5061 // "PARTITION_JELLYFISH" - To be used by customers with Jellyfish-accelerated 5062 // ops. See go/servomatic-jellyfish for details. 5063 // "PARTITION_CPU" - The partition used by regionalized servomatic cloud 5064 // regions. 5065 // "PARTITION_CUSTOM_STORAGE_CPU" - The partition used for loading models 5066 // from custom storage. 5067 Partition string `json:"partition,omitempty"` 5068 // ServingArtifact: The default model binary file used for serving (e.g. online 5069 // predict, batch predict) via public Cloud Ai Platform API. 5070 ServingArtifact *XPSModelArtifactItem `json:"servingArtifact,omitempty"` 5071 // ServoModelName: The name of servo model. Populated by uCAIP BE as part of 5072 // online PredictRequest. 5073 ServoModelName string `json:"servoModelName,omitempty"` 5074 // SubmodelName: The name of the trained NL submodel. 5075 SubmodelName string `json:"submodelName,omitempty"` 5076 // SubmodelType: The type of trained NL submodel 5077 // 5078 // Possible values: 5079 // "TEXT_MODEL_TYPE_UNSPECIFIED" 5080 // "TEXT_MODEL_TYPE_DEFAULT" 5081 // "TEXT_MODEL_TYPE_META_ARCHITECT" 5082 // "TEXT_MODEL_TYPE_ATC" 5083 // "TEXT_MODEL_TYPE_CLARA2" 5084 // "TEXT_MODEL_TYPE_CHATBASE" 5085 // "TEXT_MODEL_TYPE_SAFT_SPAN_LABELING" 5086 // "TEXT_MODEL_TYPE_TEXT_EXTRACTION" - Model type for entity extraction. 5087 // "TEXT_MODEL_TYPE_RELATIONSHIP_EXTRACTION" - Model type for relationship 5088 // extraction. 5089 // "TEXT_MODEL_TYPE_COMPOSITE" - A composite model represents a set of 5090 // component models that have to be used together for prediction. A composite 5091 // model appears to be a single model to the model user. It may contain only 5092 // one component model. Please refer to go/cnl-composite-models for more 5093 // information. 5094 // "TEXT_MODEL_TYPE_ALL_MODELS" - Model type used to train default, MA, and 5095 // ATC models in a single batch worker pipeline. 5096 // "TEXT_MODEL_TYPE_BERT" - BERT pipeline needs a specific model type, since 5097 // it uses a different TFX configuration compared with DEFAULT (despite sharing 5098 // most of the code). 5099 // "TEXT_MODEL_TYPE_ENC_PALM" - Model type for EncPaLM. 5100 SubmodelType string `json:"submodelType,omitempty"` 5101 // TfRuntimeVersion: ## The fields below are only populated under uCAIP request 5102 // scope. https://cloud.google.com/ml-engine/docs/runtime-version-list 5103 TfRuntimeVersion string `json:"tfRuntimeVersion,omitempty"` 5104 // VersionNumber: The servomatic model version number. Populated by uCAIP BE as 5105 // part of online PredictRequest. 5106 VersionNumber int64 `json:"versionNumber,omitempty,string"` 5107 // ForceSendFields is a list of field names (e.g. "BatchPredictionModelGcsUri") 5108 // to unconditionally include in API requests. By default, fields with empty or 5109 // default values are omitted from API requests. See 5110 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5111 // details. 5112 ForceSendFields []string `json:"-"` 5113 // NullFields is a list of field names (e.g. "BatchPredictionModelGcsUri") to 5114 // include in API requests with the JSON null value. By default, fields with 5115 // empty values are omitted from API requests. See 5116 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5117 NullFields []string `json:"-"` 5118 } 5119 5120 func (s *XPSTextComponentModel) MarshalJSON() ([]byte, error) { 5121 type NoMethod XPSTextComponentModel 5122 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5123 } 5124 5125 type XPSTextExtractionEvaluationMetrics struct { 5126 // BestF1ConfidenceMetrics: Values are at the highest F1 score on the 5127 // precision-recall curve. Only confidence_threshold, recall, precision, and 5128 // f1_score will be set. 5129 BestF1ConfidenceMetrics *XPSConfidenceMetricsEntry `json:"bestF1ConfidenceMetrics,omitempty"` 5130 // ConfidenceMetricsEntries: If the enclosing EvaluationMetrics.label is empty, 5131 // confidence_metrics_entries is an evaluation of the entire model across all 5132 // labels. If the enclosing EvaluationMetrics.label is set, 5133 // confidence_metrics_entries applies to that label. 5134 ConfidenceMetricsEntries []*XPSConfidenceMetricsEntry `json:"confidenceMetricsEntries,omitempty"` 5135 // ConfusionMatrix: Confusion matrix of the model, at the default confidence 5136 // threshold (0.0). Only set for whole-model evaluation, not for evaluation per 5137 // label. 5138 ConfusionMatrix *XPSConfusionMatrix `json:"confusionMatrix,omitempty"` 5139 // PerLabelConfidenceMetrics: Only recall, precision, and f1_score will be set. 5140 PerLabelConfidenceMetrics map[string]XPSConfidenceMetricsEntry `json:"perLabelConfidenceMetrics,omitempty"` 5141 // ForceSendFields is a list of field names (e.g. "BestF1ConfidenceMetrics") to 5142 // unconditionally include in API requests. By default, fields with empty or 5143 // default values are omitted from API requests. See 5144 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5145 // details. 5146 ForceSendFields []string `json:"-"` 5147 // NullFields is a list of field names (e.g. "BestF1ConfidenceMetrics") to 5148 // include in API requests with the JSON null value. By default, fields with 5149 // empty values are omitted from API requests. See 5150 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5151 NullFields []string `json:"-"` 5152 } 5153 5154 func (s *XPSTextExtractionEvaluationMetrics) MarshalJSON() ([]byte, error) { 5155 type NoMethod XPSTextExtractionEvaluationMetrics 5156 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5157 } 5158 5159 // XPSTextSentimentEvaluationMetrics: Model evaluation metrics for text 5160 // sentiment problems. 5161 type XPSTextSentimentEvaluationMetrics struct { 5162 // ConfusionMatrix: Output only. Confusion matrix of the evaluation. Only set 5163 // for the overall model evaluation, not for evaluation of a single annotation 5164 // spec. 5165 ConfusionMatrix *XPSConfusionMatrix `json:"confusionMatrix,omitempty"` 5166 // F1Score: Output only. The harmonic mean of recall and precision. 5167 F1Score float64 `json:"f1Score,omitempty"` 5168 // LinearKappa: Output only. Linear weighted kappa. Only set for the overall 5169 // model evaluation, not for evaluation of a single annotation spec. 5170 LinearKappa float64 `json:"linearKappa,omitempty"` 5171 // MeanAbsoluteError: Output only. Mean absolute error. Only set for the 5172 // overall model evaluation, not for evaluation of a single annotation spec. 5173 MeanAbsoluteError float64 `json:"meanAbsoluteError,omitempty"` 5174 // MeanSquaredError: Output only. Mean squared error. Only set for the overall 5175 // model evaluation, not for evaluation of a single annotation spec. 5176 MeanSquaredError float64 `json:"meanSquaredError,omitempty"` 5177 // Precision: Output only. Precision. 5178 Precision float64 `json:"precision,omitempty"` 5179 // QuadraticKappa: Output only. Quadratic weighted kappa. Only set for the 5180 // overall model evaluation, not for evaluation of a single annotation spec. 5181 QuadraticKappa float64 `json:"quadraticKappa,omitempty"` 5182 // Recall: Output only. Recall. 5183 Recall float64 `json:"recall,omitempty"` 5184 // ForceSendFields is a list of field names (e.g. "ConfusionMatrix") to 5185 // unconditionally include in API requests. By default, fields with empty or 5186 // default values are omitted from API requests. See 5187 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5188 // details. 5189 ForceSendFields []string `json:"-"` 5190 // NullFields is a list of field names (e.g. "ConfusionMatrix") to include in 5191 // API requests with the JSON null value. By default, fields with empty values 5192 // are omitted from API requests. See 5193 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5194 NullFields []string `json:"-"` 5195 } 5196 5197 func (s *XPSTextSentimentEvaluationMetrics) MarshalJSON() ([]byte, error) { 5198 type NoMethod XPSTextSentimentEvaluationMetrics 5199 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5200 } 5201 5202 func (s *XPSTextSentimentEvaluationMetrics) UnmarshalJSON(data []byte) error { 5203 type NoMethod XPSTextSentimentEvaluationMetrics 5204 var s1 struct { 5205 F1Score gensupport.JSONFloat64 `json:"f1Score"` 5206 LinearKappa gensupport.JSONFloat64 `json:"linearKappa"` 5207 MeanAbsoluteError gensupport.JSONFloat64 `json:"meanAbsoluteError"` 5208 MeanSquaredError gensupport.JSONFloat64 `json:"meanSquaredError"` 5209 Precision gensupport.JSONFloat64 `json:"precision"` 5210 QuadraticKappa gensupport.JSONFloat64 `json:"quadraticKappa"` 5211 Recall gensupport.JSONFloat64 `json:"recall"` 5212 *NoMethod 5213 } 5214 s1.NoMethod = (*NoMethod)(s) 5215 if err := json.Unmarshal(data, &s1); err != nil { 5216 return err 5217 } 5218 s.F1Score = float64(s1.F1Score) 5219 s.LinearKappa = float64(s1.LinearKappa) 5220 s.MeanAbsoluteError = float64(s1.MeanAbsoluteError) 5221 s.MeanSquaredError = float64(s1.MeanSquaredError) 5222 s.Precision = float64(s1.Precision) 5223 s.QuadraticKappa = float64(s1.QuadraticKappa) 5224 s.Recall = float64(s1.Recall) 5225 return nil 5226 } 5227 5228 // XPSTextToSpeechTrainResponse: TextToSpeech train response 5229 type XPSTextToSpeechTrainResponse struct { 5230 } 5231 5232 type XPSTextTrainResponse struct { 5233 // ComponentModel: Component submodels. 5234 ComponentModel []*XPSTextComponentModel `json:"componentModel,omitempty"` 5235 // ForceSendFields is a list of field names (e.g. "ComponentModel") to 5236 // unconditionally include in API requests. By default, fields with empty or 5237 // default values are omitted from API requests. See 5238 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5239 // details. 5240 ForceSendFields []string `json:"-"` 5241 // NullFields is a list of field names (e.g. "ComponentModel") to include in 5242 // API requests with the JSON null value. By default, fields with empty values 5243 // are omitted from API requests. See 5244 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5245 NullFields []string `json:"-"` 5246 } 5247 5248 func (s *XPSTextTrainResponse) MarshalJSON() ([]byte, error) { 5249 type NoMethod XPSTextTrainResponse 5250 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5251 } 5252 5253 // XPSTfJsFormat: A TensorFlow.js (https://www.tensorflow.org/js) model that 5254 // can be used in the browser and in Node.js using JavaScript. 5255 type XPSTfJsFormat struct { 5256 } 5257 5258 // XPSTfLiteFormat: LINT.IfChange A model format used for mobile and IoT 5259 // devices. See https://www.tensorflow.org/lite. 5260 type XPSTfLiteFormat struct { 5261 } 5262 5263 // XPSTfSavedModelFormat: A tensorflow model format in SavedModel format. 5264 type XPSTfSavedModelFormat struct { 5265 } 5266 5267 // XPSTimestampStats: The data statistics of a series of TIMESTAMP values. 5268 type XPSTimestampStats struct { 5269 CommonStats *XPSCommonStats `json:"commonStats,omitempty"` 5270 // GranularStats: The string key is the pre-defined granularity. Currently 5271 // supported: hour_of_day, day_of_week, month_of_year. Granularities finer that 5272 // the granularity of timestamp data are not populated (e.g. if timestamps are 5273 // at day granularity, then hour_of_day is not populated). 5274 GranularStats map[string]XPSTimestampStatsGranularStats `json:"granularStats,omitempty"` 5275 MedianTimestampNanos int64 `json:"medianTimestampNanos,omitempty,string"` 5276 // ForceSendFields is a list of field names (e.g. "CommonStats") to 5277 // unconditionally include in API requests. By default, fields with empty or 5278 // default values are omitted from API requests. See 5279 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5280 // details. 5281 ForceSendFields []string `json:"-"` 5282 // NullFields is a list of field names (e.g. "CommonStats") to include in API 5283 // requests with the JSON null value. By default, fields with empty values are 5284 // omitted from API requests. See 5285 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5286 NullFields []string `json:"-"` 5287 } 5288 5289 func (s *XPSTimestampStats) MarshalJSON() ([]byte, error) { 5290 type NoMethod XPSTimestampStats 5291 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5292 } 5293 5294 // XPSTimestampStatsGranularStats: Stats split by a defined in context 5295 // granularity. 5296 type XPSTimestampStatsGranularStats struct { 5297 // Buckets: A map from granularity key to example count for that key. E.g. for 5298 // hour_of_day `13` means 1pm, or for month_of_year `5` means May). 5299 Buckets map[string]string `json:"buckets,omitempty"` 5300 // ForceSendFields is a list of field names (e.g. "Buckets") to unconditionally 5301 // include in API requests. By default, fields with empty or default values are 5302 // omitted from API requests. See 5303 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5304 // details. 5305 ForceSendFields []string `json:"-"` 5306 // NullFields is a list of field names (e.g. "Buckets") to include in API 5307 // requests with the JSON null value. By default, fields with empty values are 5308 // omitted from API requests. See 5309 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5310 NullFields []string `json:"-"` 5311 } 5312 5313 func (s *XPSTimestampStatsGranularStats) MarshalJSON() ([]byte, error) { 5314 type NoMethod XPSTimestampStatsGranularStats 5315 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5316 } 5317 5318 // XPSTrackMetricsEntry: Track matching model metrics for a single track match 5319 // threshold and multiple label match confidence thresholds. Next tag: 6. 5320 type XPSTrackMetricsEntry struct { 5321 // ConfidenceMetricsEntries: Output only. Metrics for each label-match 5322 // confidence_threshold from 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. 5323 // Precision-recall curve is derived from them. 5324 ConfidenceMetricsEntries []*XPSTrackMetricsEntryConfidenceMetricsEntry `json:"confidenceMetricsEntries,omitempty"` 5325 // IouThreshold: Output only. The intersection-over-union threshold value 5326 // between bounding boxes across frames used to compute this metric entry. 5327 IouThreshold float64 `json:"iouThreshold,omitempty"` 5328 // MeanBoundingBoxIou: Output only. The mean bounding box iou over all 5329 // confidence thresholds. 5330 MeanBoundingBoxIou float64 `json:"meanBoundingBoxIou,omitempty"` 5331 // MeanMismatchRate: Output only. The mean mismatch rate over all confidence 5332 // thresholds. 5333 MeanMismatchRate float64 `json:"meanMismatchRate,omitempty"` 5334 // MeanTrackingAveragePrecision: Output only. The mean average precision over 5335 // all confidence thresholds. 5336 MeanTrackingAveragePrecision float64 `json:"meanTrackingAveragePrecision,omitempty"` 5337 // ForceSendFields is a list of field names (e.g. "ConfidenceMetricsEntries") 5338 // to unconditionally include in API requests. By default, fields with empty or 5339 // default values are omitted from API requests. See 5340 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5341 // details. 5342 ForceSendFields []string `json:"-"` 5343 // NullFields is a list of field names (e.g. "ConfidenceMetricsEntries") to 5344 // include in API requests with the JSON null value. By default, fields with 5345 // empty values are omitted from API requests. See 5346 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5347 NullFields []string `json:"-"` 5348 } 5349 5350 func (s *XPSTrackMetricsEntry) MarshalJSON() ([]byte, error) { 5351 type NoMethod XPSTrackMetricsEntry 5352 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5353 } 5354 5355 func (s *XPSTrackMetricsEntry) UnmarshalJSON(data []byte) error { 5356 type NoMethod XPSTrackMetricsEntry 5357 var s1 struct { 5358 IouThreshold gensupport.JSONFloat64 `json:"iouThreshold"` 5359 MeanBoundingBoxIou gensupport.JSONFloat64 `json:"meanBoundingBoxIou"` 5360 MeanMismatchRate gensupport.JSONFloat64 `json:"meanMismatchRate"` 5361 MeanTrackingAveragePrecision gensupport.JSONFloat64 `json:"meanTrackingAveragePrecision"` 5362 *NoMethod 5363 } 5364 s1.NoMethod = (*NoMethod)(s) 5365 if err := json.Unmarshal(data, &s1); err != nil { 5366 return err 5367 } 5368 s.IouThreshold = float64(s1.IouThreshold) 5369 s.MeanBoundingBoxIou = float64(s1.MeanBoundingBoxIou) 5370 s.MeanMismatchRate = float64(s1.MeanMismatchRate) 5371 s.MeanTrackingAveragePrecision = float64(s1.MeanTrackingAveragePrecision) 5372 return nil 5373 } 5374 5375 // XPSTrackMetricsEntryConfidenceMetricsEntry: Metrics for a single confidence 5376 // threshold. Next tag: 6. 5377 type XPSTrackMetricsEntryConfidenceMetricsEntry struct { 5378 // BoundingBoxIou: Output only. Bounding box intersection-over-union precision. 5379 // Measures how well the bounding boxes overlap between each other (e.g. 5380 // complete overlap or just barely above iou_threshold). 5381 BoundingBoxIou float64 `json:"boundingBoxIou,omitempty"` 5382 // ConfidenceThreshold: Output only. The confidence threshold value used to 5383 // compute the metrics. 5384 ConfidenceThreshold float64 `json:"confidenceThreshold,omitempty"` 5385 // MismatchRate: Output only. Mismatch rate, which measures the tracking 5386 // consistency, i.e. correctness of instance ID continuity. 5387 MismatchRate float64 `json:"mismatchRate,omitempty"` 5388 // TrackingPrecision: Output only. Tracking precision. 5389 TrackingPrecision float64 `json:"trackingPrecision,omitempty"` 5390 // TrackingRecall: Output only. Tracking recall. 5391 TrackingRecall float64 `json:"trackingRecall,omitempty"` 5392 // ForceSendFields is a list of field names (e.g. "BoundingBoxIou") to 5393 // unconditionally include in API requests. By default, fields with empty or 5394 // default values are omitted from API requests. See 5395 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5396 // details. 5397 ForceSendFields []string `json:"-"` 5398 // NullFields is a list of field names (e.g. "BoundingBoxIou") to include in 5399 // API requests with the JSON null value. By default, fields with empty values 5400 // are omitted from API requests. See 5401 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5402 NullFields []string `json:"-"` 5403 } 5404 5405 func (s *XPSTrackMetricsEntryConfidenceMetricsEntry) MarshalJSON() ([]byte, error) { 5406 type NoMethod XPSTrackMetricsEntryConfidenceMetricsEntry 5407 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5408 } 5409 5410 func (s *XPSTrackMetricsEntryConfidenceMetricsEntry) UnmarshalJSON(data []byte) error { 5411 type NoMethod XPSTrackMetricsEntryConfidenceMetricsEntry 5412 var s1 struct { 5413 BoundingBoxIou gensupport.JSONFloat64 `json:"boundingBoxIou"` 5414 ConfidenceThreshold gensupport.JSONFloat64 `json:"confidenceThreshold"` 5415 MismatchRate gensupport.JSONFloat64 `json:"mismatchRate"` 5416 TrackingPrecision gensupport.JSONFloat64 `json:"trackingPrecision"` 5417 TrackingRecall gensupport.JSONFloat64 `json:"trackingRecall"` 5418 *NoMethod 5419 } 5420 s1.NoMethod = (*NoMethod)(s) 5421 if err := json.Unmarshal(data, &s1); err != nil { 5422 return err 5423 } 5424 s.BoundingBoxIou = float64(s1.BoundingBoxIou) 5425 s.ConfidenceThreshold = float64(s1.ConfidenceThreshold) 5426 s.MismatchRate = float64(s1.MismatchRate) 5427 s.TrackingPrecision = float64(s1.TrackingPrecision) 5428 s.TrackingRecall = float64(s1.TrackingRecall) 5429 return nil 5430 } 5431 5432 // XPSTrainResponse: Next ID: 18 5433 type XPSTrainResponse struct { 5434 // DeployedModelSizeBytes: Estimated model size in bytes once deployed. 5435 DeployedModelSizeBytes int64 `json:"deployedModelSizeBytes,omitempty,string"` 5436 // ErrorAnalysisConfigs: Optional vision model error analysis configuration. 5437 // The field is set when model error analysis is enabled in the training 5438 // request. The results of error analysis will be binded together with 5439 // evaluation results (in the format of AnnotatedExample). 5440 ErrorAnalysisConfigs []*XPSVisionErrorAnalysisConfig `json:"errorAnalysisConfigs,omitempty"` 5441 // EvaluatedExampleSet: Examples used to evaluate the model (usually the test 5442 // set), with the predicted annotations. The file_spec should point to recordio 5443 // file(s) of AnnotatedExample. For each returned example, the example_id_token 5444 // and annotations predicted by the model must be set. The example payload can 5445 // and is recommended to be omitted. 5446 EvaluatedExampleSet *XPSExampleSet `json:"evaluatedExampleSet,omitempty"` 5447 // EvaluationMetricsSet: The trained model evaluation metrics. This can be 5448 // optionally returned. 5449 EvaluationMetricsSet *XPSEvaluationMetricsSet `json:"evaluationMetricsSet,omitempty"` 5450 // ExplanationConfigs: VisionExplanationConfig for XAI on test set. Optional 5451 // for when XAI is enable in training request. 5452 ExplanationConfigs []*XPSResponseExplanationSpec `json:"explanationConfigs,omitempty"` 5453 ImageClassificationTrainResp *XPSImageClassificationTrainResponse `json:"imageClassificationTrainResp,omitempty"` 5454 ImageObjectDetectionTrainResp *XPSImageObjectDetectionModelSpec `json:"imageObjectDetectionTrainResp,omitempty"` 5455 ImageSegmentationTrainResp *XPSImageSegmentationTrainResponse `json:"imageSegmentationTrainResp,omitempty"` 5456 // ModelToken: Token that represents the trained model. This is considered 5457 // immutable and is persisted in AutoML. xPS can put their own proto in the 5458 // byte string, to e.g. point to the model checkpoints. The token is passed to 5459 // other xPS APIs to refer to the model. 5460 ModelToken string `json:"modelToken,omitempty"` 5461 SpeechTrainResp *XPSSpeechModelSpec `json:"speechTrainResp,omitempty"` 5462 TablesTrainResp *XPSTablesTrainResponse `json:"tablesTrainResp,omitempty"` 5463 TextToSpeechTrainResp *XPSTextToSpeechTrainResponse `json:"textToSpeechTrainResp,omitempty"` 5464 // TextTrainResp: Will only be needed for uCAIP from Beta. 5465 TextTrainResp *XPSTextTrainResponse `json:"textTrainResp,omitempty"` 5466 TranslationTrainResp *XPSTranslationTrainResponse `json:"translationTrainResp,omitempty"` 5467 VideoActionRecognitionTrainResp *XPSVideoActionRecognitionTrainResponse `json:"videoActionRecognitionTrainResp,omitempty"` 5468 VideoClassificationTrainResp *XPSVideoClassificationTrainResponse `json:"videoClassificationTrainResp,omitempty"` 5469 VideoObjectTrackingTrainResp *XPSVideoObjectTrackingTrainResponse `json:"videoObjectTrackingTrainResp,omitempty"` 5470 // ForceSendFields is a list of field names (e.g. "DeployedModelSizeBytes") to 5471 // unconditionally include in API requests. By default, fields with empty or 5472 // default values are omitted from API requests. See 5473 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5474 // details. 5475 ForceSendFields []string `json:"-"` 5476 // NullFields is a list of field names (e.g. "DeployedModelSizeBytes") to 5477 // include in API requests with the JSON null value. By default, fields with 5478 // empty values are omitted from API requests. See 5479 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5480 NullFields []string `json:"-"` 5481 } 5482 5483 func (s *XPSTrainResponse) MarshalJSON() ([]byte, error) { 5484 type NoMethod XPSTrainResponse 5485 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5486 } 5487 5488 type XPSTrainingObjectivePoint struct { 5489 // CreateTime: The time at which this point was recorded. 5490 CreateTime string `json:"createTime,omitempty"` 5491 // Value: The objective value when this point was recorded. 5492 Value float64 `json:"value,omitempty"` 5493 // ForceSendFields is a list of field names (e.g. "CreateTime") to 5494 // unconditionally include in API requests. By default, fields with empty or 5495 // default values are omitted from API requests. See 5496 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5497 // details. 5498 ForceSendFields []string `json:"-"` 5499 // NullFields is a list of field names (e.g. "CreateTime") to include in API 5500 // requests with the JSON null value. By default, fields with empty values are 5501 // omitted from API requests. See 5502 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5503 NullFields []string `json:"-"` 5504 } 5505 5506 func (s *XPSTrainingObjectivePoint) MarshalJSON() ([]byte, error) { 5507 type NoMethod XPSTrainingObjectivePoint 5508 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5509 } 5510 5511 func (s *XPSTrainingObjectivePoint) UnmarshalJSON(data []byte) error { 5512 type NoMethod XPSTrainingObjectivePoint 5513 var s1 struct { 5514 Value gensupport.JSONFloat64 `json:"value"` 5515 *NoMethod 5516 } 5517 s1.NoMethod = (*NoMethod)(s) 5518 if err := json.Unmarshal(data, &s1); err != nil { 5519 return err 5520 } 5521 s.Value = float64(s1.Value) 5522 return nil 5523 } 5524 5525 // XPSTranslationEvaluationMetrics: Evaluation metrics for the dataset. 5526 type XPSTranslationEvaluationMetrics struct { 5527 // BaseBleuScore: BLEU score for base model. 5528 BaseBleuScore float64 `json:"baseBleuScore,omitempty"` 5529 // BleuScore: BLEU score. 5530 BleuScore float64 `json:"bleuScore,omitempty"` 5531 // ForceSendFields is a list of field names (e.g. "BaseBleuScore") to 5532 // unconditionally include in API requests. By default, fields with empty or 5533 // default values are omitted from API requests. See 5534 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5535 // details. 5536 ForceSendFields []string `json:"-"` 5537 // NullFields is a list of field names (e.g. "BaseBleuScore") to include in API 5538 // requests with the JSON null value. By default, fields with empty values are 5539 // omitted from API requests. See 5540 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5541 NullFields []string `json:"-"` 5542 } 5543 5544 func (s *XPSTranslationEvaluationMetrics) MarshalJSON() ([]byte, error) { 5545 type NoMethod XPSTranslationEvaluationMetrics 5546 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5547 } 5548 5549 func (s *XPSTranslationEvaluationMetrics) UnmarshalJSON(data []byte) error { 5550 type NoMethod XPSTranslationEvaluationMetrics 5551 var s1 struct { 5552 BaseBleuScore gensupport.JSONFloat64 `json:"baseBleuScore"` 5553 BleuScore gensupport.JSONFloat64 `json:"bleuScore"` 5554 *NoMethod 5555 } 5556 s1.NoMethod = (*NoMethod)(s) 5557 if err := json.Unmarshal(data, &s1); err != nil { 5558 return err 5559 } 5560 s.BaseBleuScore = float64(s1.BaseBleuScore) 5561 s.BleuScore = float64(s1.BleuScore) 5562 return nil 5563 } 5564 5565 // XPSTranslationPreprocessResponse: Translation preprocess response. 5566 type XPSTranslationPreprocessResponse struct { 5567 // ParsedExampleCount: Total example count parsed. 5568 ParsedExampleCount int64 `json:"parsedExampleCount,omitempty,string"` 5569 // ValidExampleCount: Total valid example count. 5570 ValidExampleCount int64 `json:"validExampleCount,omitempty,string"` 5571 // ForceSendFields is a list of field names (e.g. "ParsedExampleCount") to 5572 // unconditionally include in API requests. By default, fields with empty or 5573 // default values are omitted from API requests. See 5574 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5575 // details. 5576 ForceSendFields []string `json:"-"` 5577 // NullFields is a list of field names (e.g. "ParsedExampleCount") to include 5578 // in API requests with the JSON null value. By default, fields with empty 5579 // values are omitted from API requests. See 5580 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5581 NullFields []string `json:"-"` 5582 } 5583 5584 func (s *XPSTranslationPreprocessResponse) MarshalJSON() ([]byte, error) { 5585 type NoMethod XPSTranslationPreprocessResponse 5586 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5587 } 5588 5589 // XPSTranslationTrainResponse: Train response for translation. 5590 type XPSTranslationTrainResponse struct { 5591 // ModelType: Type of the model. 5592 // 5593 // Possible values: 5594 // "MODEL_TYPE_UNSPECIFIED" - Default 5595 // "LEGACY" - Legacy model. Will be deprecated. 5596 // "CURRENT" - Current model. 5597 ModelType string `json:"modelType,omitempty"` 5598 // ForceSendFields is a list of field names (e.g. "ModelType") to 5599 // unconditionally include in API requests. By default, fields with empty or 5600 // default values are omitted from API requests. See 5601 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5602 // details. 5603 ForceSendFields []string `json:"-"` 5604 // NullFields is a list of field names (e.g. "ModelType") to include in API 5605 // requests with the JSON null value. By default, fields with empty values are 5606 // omitted from API requests. See 5607 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5608 NullFields []string `json:"-"` 5609 } 5610 5611 func (s *XPSTranslationTrainResponse) MarshalJSON() ([]byte, error) { 5612 type NoMethod XPSTranslationTrainResponse 5613 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5614 } 5615 5616 // XPSTuningTrial: Metrics for a tuning job generated, will get forwarded to 5617 // Stackdriver as model tuning logs. Setting this as a standalone message out 5618 // of CreateModelMetadata to avoid confusion as we expose this message only to 5619 // users. 5620 type XPSTuningTrial struct { 5621 // ModelStructure: Model parameters for the trial. 5622 ModelStructure *XPSTablesModelStructure `json:"modelStructure,omitempty"` 5623 // TrainingObjectivePoint: The optimization objective evaluation of the eval 5624 // split data. 5625 TrainingObjectivePoint *XPSTrainingObjectivePoint `json:"trainingObjectivePoint,omitempty"` 5626 // ForceSendFields is a list of field names (e.g. "ModelStructure") to 5627 // unconditionally include in API requests. By default, fields with empty or 5628 // default values are omitted from API requests. See 5629 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5630 // details. 5631 ForceSendFields []string `json:"-"` 5632 // NullFields is a list of field names (e.g. "ModelStructure") to include in 5633 // API requests with the JSON null value. By default, fields with empty values 5634 // are omitted from API requests. See 5635 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5636 NullFields []string `json:"-"` 5637 } 5638 5639 func (s *XPSTuningTrial) MarshalJSON() ([]byte, error) { 5640 type NoMethod XPSTuningTrial 5641 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5642 } 5643 5644 // XPSVideoActionMetricsEntry: The Evaluation metrics entry given a specific 5645 // precision_window_length. 5646 type XPSVideoActionMetricsEntry struct { 5647 // ConfidenceMetricsEntries: Metrics for each label-match confidence_threshold 5648 // from 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. 5649 ConfidenceMetricsEntries []*XPSVideoActionMetricsEntryConfidenceMetricsEntry `json:"confidenceMetricsEntries,omitempty"` 5650 // MeanAveragePrecision: The mean average precision. 5651 MeanAveragePrecision float64 `json:"meanAveragePrecision,omitempty"` 5652 // PrecisionWindowLength: This VideoActionMetricsEntry is calculated based on 5653 // this prediction window length. If the predicted action's timestamp is inside 5654 // the time window whose center is the ground truth action's timestamp with 5655 // this specific length, the prediction result is treated as a true positive. 5656 PrecisionWindowLength string `json:"precisionWindowLength,omitempty"` 5657 // ForceSendFields is a list of field names (e.g. "ConfidenceMetricsEntries") 5658 // to unconditionally include in API requests. By default, fields with empty or 5659 // default values are omitted from API requests. See 5660 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5661 // details. 5662 ForceSendFields []string `json:"-"` 5663 // NullFields is a list of field names (e.g. "ConfidenceMetricsEntries") to 5664 // include in API requests with the JSON null value. By default, fields with 5665 // empty values are omitted from API requests. See 5666 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5667 NullFields []string `json:"-"` 5668 } 5669 5670 func (s *XPSVideoActionMetricsEntry) MarshalJSON() ([]byte, error) { 5671 type NoMethod XPSVideoActionMetricsEntry 5672 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5673 } 5674 5675 func (s *XPSVideoActionMetricsEntry) UnmarshalJSON(data []byte) error { 5676 type NoMethod XPSVideoActionMetricsEntry 5677 var s1 struct { 5678 MeanAveragePrecision gensupport.JSONFloat64 `json:"meanAveragePrecision"` 5679 *NoMethod 5680 } 5681 s1.NoMethod = (*NoMethod)(s) 5682 if err := json.Unmarshal(data, &s1); err != nil { 5683 return err 5684 } 5685 s.MeanAveragePrecision = float64(s1.MeanAveragePrecision) 5686 return nil 5687 } 5688 5689 // XPSVideoActionMetricsEntryConfidenceMetricsEntry: Metrics for a single 5690 // confidence threshold. 5691 type XPSVideoActionMetricsEntryConfidenceMetricsEntry struct { 5692 // ConfidenceThreshold: Output only. The confidence threshold value used to 5693 // compute the metrics. 5694 ConfidenceThreshold float64 `json:"confidenceThreshold,omitempty"` 5695 // F1Score: Output only. The harmonic mean of recall and precision. 5696 F1Score float64 `json:"f1Score,omitempty"` 5697 // Precision: Output only. Precision for the given confidence threshold. 5698 Precision float64 `json:"precision,omitempty"` 5699 // Recall: Output only. Recall for the given confidence threshold. 5700 Recall float64 `json:"recall,omitempty"` 5701 // ForceSendFields is a list of field names (e.g. "ConfidenceThreshold") to 5702 // unconditionally include in API requests. By default, fields with empty or 5703 // default values are omitted from API requests. See 5704 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5705 // details. 5706 ForceSendFields []string `json:"-"` 5707 // NullFields is a list of field names (e.g. "ConfidenceThreshold") to include 5708 // in API requests with the JSON null value. By default, fields with empty 5709 // values are omitted from API requests. See 5710 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5711 NullFields []string `json:"-"` 5712 } 5713 5714 func (s *XPSVideoActionMetricsEntryConfidenceMetricsEntry) MarshalJSON() ([]byte, error) { 5715 type NoMethod XPSVideoActionMetricsEntryConfidenceMetricsEntry 5716 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5717 } 5718 5719 func (s *XPSVideoActionMetricsEntryConfidenceMetricsEntry) UnmarshalJSON(data []byte) error { 5720 type NoMethod XPSVideoActionMetricsEntryConfidenceMetricsEntry 5721 var s1 struct { 5722 ConfidenceThreshold gensupport.JSONFloat64 `json:"confidenceThreshold"` 5723 F1Score gensupport.JSONFloat64 `json:"f1Score"` 5724 Precision gensupport.JSONFloat64 `json:"precision"` 5725 Recall gensupport.JSONFloat64 `json:"recall"` 5726 *NoMethod 5727 } 5728 s1.NoMethod = (*NoMethod)(s) 5729 if err := json.Unmarshal(data, &s1); err != nil { 5730 return err 5731 } 5732 s.ConfidenceThreshold = float64(s1.ConfidenceThreshold) 5733 s.F1Score = float64(s1.F1Score) 5734 s.Precision = float64(s1.Precision) 5735 s.Recall = float64(s1.Recall) 5736 return nil 5737 } 5738 5739 // XPSVideoActionRecognitionEvaluationMetrics: Model evaluation metrics for 5740 // video action recognition. 5741 type XPSVideoActionRecognitionEvaluationMetrics struct { 5742 // EvaluatedActionCount: Output only. The number of ground truth actions used 5743 // to create this evaluation. 5744 EvaluatedActionCount int64 `json:"evaluatedActionCount,omitempty"` 5745 // VideoActionMetricsEntries: Output only. The metric entries for precision 5746 // window lengths: 1s,2s,3s,4s, 5s. 5747 VideoActionMetricsEntries []*XPSVideoActionMetricsEntry `json:"videoActionMetricsEntries,omitempty"` 5748 // ForceSendFields is a list of field names (e.g. "EvaluatedActionCount") to 5749 // unconditionally include in API requests. By default, fields with empty or 5750 // default values are omitted from API requests. See 5751 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5752 // details. 5753 ForceSendFields []string `json:"-"` 5754 // NullFields is a list of field names (e.g. "EvaluatedActionCount") to include 5755 // in API requests with the JSON null value. By default, fields with empty 5756 // values are omitted from API requests. See 5757 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5758 NullFields []string `json:"-"` 5759 } 5760 5761 func (s *XPSVideoActionRecognitionEvaluationMetrics) MarshalJSON() ([]byte, error) { 5762 type NoMethod XPSVideoActionRecognitionEvaluationMetrics 5763 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5764 } 5765 5766 type XPSVideoActionRecognitionTrainResponse struct { 5767 // ModelArtifactSpec: ## The fields below are only populated under uCAIP 5768 // request scope. 5769 ModelArtifactSpec *XPSVideoModelArtifactSpec `json:"modelArtifactSpec,omitempty"` 5770 // TrainCostNodeSeconds: The actual train cost of creating this model, 5771 // expressed in node seconds, i.e. 3,600 value in this field means 1 node hour. 5772 TrainCostNodeSeconds int64 `json:"trainCostNodeSeconds,omitempty,string"` 5773 // ForceSendFields is a list of field names (e.g. "ModelArtifactSpec") to 5774 // unconditionally include in API requests. By default, fields with empty or 5775 // default values are omitted from API requests. See 5776 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5777 // details. 5778 ForceSendFields []string `json:"-"` 5779 // NullFields is a list of field names (e.g. "ModelArtifactSpec") to include in 5780 // API requests with the JSON null value. By default, fields with empty values 5781 // are omitted from API requests. See 5782 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5783 NullFields []string `json:"-"` 5784 } 5785 5786 func (s *XPSVideoActionRecognitionTrainResponse) MarshalJSON() ([]byte, error) { 5787 type NoMethod XPSVideoActionRecognitionTrainResponse 5788 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5789 } 5790 5791 type XPSVideoBatchPredictOperationMetadata struct { 5792 // OutputExamples: All the partial batch prediction results that are completed 5793 // at the moment. Output examples are sorted by completion time. The order will 5794 // not be changed. Each output example should be the path of a single RecordIO 5795 // file of AnnotatedExamples. 5796 OutputExamples []string `json:"outputExamples,omitempty"` 5797 // ForceSendFields is a list of field names (e.g. "OutputExamples") to 5798 // unconditionally include in API requests. By default, fields with empty or 5799 // default values are omitted from API requests. See 5800 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5801 // details. 5802 ForceSendFields []string `json:"-"` 5803 // NullFields is a list of field names (e.g. "OutputExamples") to include in 5804 // API requests with the JSON null value. By default, fields with empty values 5805 // are omitted from API requests. See 5806 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5807 NullFields []string `json:"-"` 5808 } 5809 5810 func (s *XPSVideoBatchPredictOperationMetadata) MarshalJSON() ([]byte, error) { 5811 type NoMethod XPSVideoBatchPredictOperationMetadata 5812 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5813 } 5814 5815 type XPSVideoClassificationTrainResponse struct { 5816 // ModelArtifactSpec: ## The fields below are only populated under uCAIP 5817 // request scope. 5818 ModelArtifactSpec *XPSVideoModelArtifactSpec `json:"modelArtifactSpec,omitempty"` 5819 // TrainCostNodeSeconds: The actual train cost of creating this model, 5820 // expressed in node seconds, i.e. 3,600 value in this field means 1 node hour. 5821 TrainCostNodeSeconds int64 `json:"trainCostNodeSeconds,omitempty,string"` 5822 // ForceSendFields is a list of field names (e.g. "ModelArtifactSpec") to 5823 // unconditionally include in API requests. By default, fields with empty or 5824 // default values are omitted from API requests. See 5825 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5826 // details. 5827 ForceSendFields []string `json:"-"` 5828 // NullFields is a list of field names (e.g. "ModelArtifactSpec") to include in 5829 // API requests with the JSON null value. By default, fields with empty values 5830 // are omitted from API requests. See 5831 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5832 NullFields []string `json:"-"` 5833 } 5834 5835 func (s *XPSVideoClassificationTrainResponse) MarshalJSON() ([]byte, error) { 5836 type NoMethod XPSVideoClassificationTrainResponse 5837 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5838 } 5839 5840 // XPSVideoExportModelSpec: Information of downloadable models that are 5841 // pre-generated as part of training flow and will be persisted in AutoMl 5842 // backend. Upon receiving ExportModel request from user, AutoMl backend can 5843 // serve the pre-generated models to user if exists (by copying the files from 5844 // internal path to user provided location), otherwise, AutoMl backend will 5845 // call xPS ExportModel API to generate the model on the fly with the 5846 // requesting format. 5847 type XPSVideoExportModelSpec struct { 5848 // ExportModelOutputConfig: Contains the model format and internal location of 5849 // the model files to be exported/downloaded. Use the GCS bucket name which is 5850 // provided via TrainRequest.gcs_bucket_name to store the model files. 5851 ExportModelOutputConfig []*XPSExportModelOutputConfig `json:"exportModelOutputConfig,omitempty"` 5852 // ForceSendFields is a list of field names (e.g. "ExportModelOutputConfig") to 5853 // unconditionally include in API requests. By default, fields with empty or 5854 // default values are omitted from API requests. See 5855 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5856 // details. 5857 ForceSendFields []string `json:"-"` 5858 // NullFields is a list of field names (e.g. "ExportModelOutputConfig") to 5859 // include in API requests with the JSON null value. By default, fields with 5860 // empty values are omitted from API requests. See 5861 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5862 NullFields []string `json:"-"` 5863 } 5864 5865 func (s *XPSVideoExportModelSpec) MarshalJSON() ([]byte, error) { 5866 type NoMethod XPSVideoExportModelSpec 5867 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5868 } 5869 5870 type XPSVideoModelArtifactSpec struct { 5871 // ExportArtifact: The model binary files in different formats for model 5872 // export. 5873 ExportArtifact []*XPSModelArtifactItem `json:"exportArtifact,omitempty"` 5874 // ServingArtifact: The default model binary file used for serving (e.g. batch 5875 // predict) via public Cloud AI Platform API. 5876 ServingArtifact *XPSModelArtifactItem `json:"servingArtifact,omitempty"` 5877 // ForceSendFields is a list of field names (e.g. "ExportArtifact") to 5878 // unconditionally include in API requests. By default, fields with empty or 5879 // default values are omitted from API requests. See 5880 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5881 // details. 5882 ForceSendFields []string `json:"-"` 5883 // NullFields is a list of field names (e.g. "ExportArtifact") to include in 5884 // API requests with the JSON null value. By default, fields with empty values 5885 // are omitted from API requests. See 5886 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5887 NullFields []string `json:"-"` 5888 } 5889 5890 func (s *XPSVideoModelArtifactSpec) MarshalJSON() ([]byte, error) { 5891 type NoMethod XPSVideoModelArtifactSpec 5892 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5893 } 5894 5895 // XPSVideoObjectTrackingEvaluationMetrics: Model evaluation metrics for 5896 // ObjectTracking problems. Next tag: 10. 5897 type XPSVideoObjectTrackingEvaluationMetrics struct { 5898 // BoundingBoxMeanAveragePrecision: Output only. The single metric for bounding 5899 // boxes evaluation: the mean_average_precision averaged over all 5900 // bounding_box_metrics_entries. 5901 BoundingBoxMeanAveragePrecision float64 `json:"boundingBoxMeanAveragePrecision,omitempty"` 5902 // BoundingBoxMetricsEntries: Output only. The bounding boxes match metrics for 5903 // each Intersection-over-union threshold 5904 // 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. 5905 BoundingBoxMetricsEntries []*XPSBoundingBoxMetricsEntry `json:"boundingBoxMetricsEntries,omitempty"` 5906 // EvaluatedBoundingboxCount: The number of bounding boxes used for model 5907 // evaluation. 5908 EvaluatedBoundingboxCount int64 `json:"evaluatedBoundingboxCount,omitempty"` 5909 // EvaluatedFrameCount: The number of video frames used for model evaluation. 5910 EvaluatedFrameCount int64 `json:"evaluatedFrameCount,omitempty"` 5911 // EvaluatedTrackCount: The number of tracks used for model evaluation. 5912 EvaluatedTrackCount int64 `json:"evaluatedTrackCount,omitempty"` 5913 // TrackMeanAveragePrecision: Output only. The single metric for tracks 5914 // accuracy evaluation: the mean_average_precision averaged over all 5915 // track_metrics_entries. 5916 TrackMeanAveragePrecision float64 `json:"trackMeanAveragePrecision,omitempty"` 5917 // TrackMeanBoundingBoxIou: Output only. The single metric for tracks bounding 5918 // box iou evaluation: the mean_bounding_box_iou averaged over all 5919 // track_metrics_entries. 5920 TrackMeanBoundingBoxIou float64 `json:"trackMeanBoundingBoxIou,omitempty"` 5921 // TrackMeanMismatchRate: Output only. The single metric for tracking 5922 // consistency evaluation: the mean_mismatch_rate averaged over all 5923 // track_metrics_entries. 5924 TrackMeanMismatchRate float64 `json:"trackMeanMismatchRate,omitempty"` 5925 // TrackMetricsEntries: Output only. The tracks match metrics for each 5926 // Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. 5927 TrackMetricsEntries []*XPSTrackMetricsEntry `json:"trackMetricsEntries,omitempty"` 5928 // ForceSendFields is a list of field names (e.g. 5929 // "BoundingBoxMeanAveragePrecision") to unconditionally include in API 5930 // requests. By default, fields with empty or default values are omitted from 5931 // API requests. See 5932 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5933 // details. 5934 ForceSendFields []string `json:"-"` 5935 // NullFields is a list of field names (e.g. "BoundingBoxMeanAveragePrecision") 5936 // to include in API requests with the JSON null value. By default, fields with 5937 // empty values are omitted from API requests. See 5938 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5939 NullFields []string `json:"-"` 5940 } 5941 5942 func (s *XPSVideoObjectTrackingEvaluationMetrics) MarshalJSON() ([]byte, error) { 5943 type NoMethod XPSVideoObjectTrackingEvaluationMetrics 5944 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5945 } 5946 5947 func (s *XPSVideoObjectTrackingEvaluationMetrics) UnmarshalJSON(data []byte) error { 5948 type NoMethod XPSVideoObjectTrackingEvaluationMetrics 5949 var s1 struct { 5950 BoundingBoxMeanAveragePrecision gensupport.JSONFloat64 `json:"boundingBoxMeanAveragePrecision"` 5951 TrackMeanAveragePrecision gensupport.JSONFloat64 `json:"trackMeanAveragePrecision"` 5952 TrackMeanBoundingBoxIou gensupport.JSONFloat64 `json:"trackMeanBoundingBoxIou"` 5953 TrackMeanMismatchRate gensupport.JSONFloat64 `json:"trackMeanMismatchRate"` 5954 *NoMethod 5955 } 5956 s1.NoMethod = (*NoMethod)(s) 5957 if err := json.Unmarshal(data, &s1); err != nil { 5958 return err 5959 } 5960 s.BoundingBoxMeanAveragePrecision = float64(s1.BoundingBoxMeanAveragePrecision) 5961 s.TrackMeanAveragePrecision = float64(s1.TrackMeanAveragePrecision) 5962 s.TrackMeanBoundingBoxIou = float64(s1.TrackMeanBoundingBoxIou) 5963 s.TrackMeanMismatchRate = float64(s1.TrackMeanMismatchRate) 5964 return nil 5965 } 5966 5967 type XPSVideoObjectTrackingTrainResponse struct { 5968 // ExportModelSpec: Populated for AutoML request only. 5969 ExportModelSpec *XPSVideoExportModelSpec `json:"exportModelSpec,omitempty"` 5970 // ModelArtifactSpec: ## The fields below are only populated under uCAIP 5971 // request scope. 5972 ModelArtifactSpec *XPSVideoModelArtifactSpec `json:"modelArtifactSpec,omitempty"` 5973 // TrainCostNodeSeconds: The actual train cost of creating this model, 5974 // expressed in node seconds, i.e. 3,600 value in this field means 1 node hour. 5975 TrainCostNodeSeconds int64 `json:"trainCostNodeSeconds,omitempty,string"` 5976 // ForceSendFields is a list of field names (e.g. "ExportModelSpec") to 5977 // unconditionally include in API requests. By default, fields with empty or 5978 // default values are omitted from API requests. See 5979 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 5980 // details. 5981 ForceSendFields []string `json:"-"` 5982 // NullFields is a list of field names (e.g. "ExportModelSpec") to include in 5983 // API requests with the JSON null value. By default, fields with empty values 5984 // are omitted from API requests. See 5985 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 5986 NullFields []string `json:"-"` 5987 } 5988 5989 func (s *XPSVideoObjectTrackingTrainResponse) MarshalJSON() ([]byte, error) { 5990 type NoMethod XPSVideoObjectTrackingTrainResponse 5991 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 5992 } 5993 5994 type XPSVideoTrainingOperationMetadata struct { 5995 // TrainCostMilliNodeHour: This is an estimation of the node hours necessary 5996 // for training a model, expressed in milli node hours (i.e. 1,000 value in 5997 // this field means 1 node hour). A node hour represents the time a virtual 5998 // machine spends running your training job. The cost of one node running for 5999 // one hour is a node hour. 6000 TrainCostMilliNodeHour int64 `json:"trainCostMilliNodeHour,omitempty,string"` 6001 // ForceSendFields is a list of field names (e.g. "TrainCostMilliNodeHour") to 6002 // unconditionally include in API requests. By default, fields with empty or 6003 // default values are omitted from API requests. See 6004 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6005 // details. 6006 ForceSendFields []string `json:"-"` 6007 // NullFields is a list of field names (e.g. "TrainCostMilliNodeHour") to 6008 // include in API requests with the JSON null value. By default, fields with 6009 // empty values are omitted from API requests. See 6010 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6011 NullFields []string `json:"-"` 6012 } 6013 6014 func (s *XPSVideoTrainingOperationMetadata) MarshalJSON() ([]byte, error) { 6015 type NoMethod XPSVideoTrainingOperationMetadata 6016 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6017 } 6018 6019 // XPSVisionErrorAnalysisConfig: The vision model error analysis configuration. 6020 // Next tag: 3 6021 type XPSVisionErrorAnalysisConfig struct { 6022 // ExampleCount: The number of query examples in error analysis. 6023 ExampleCount int64 `json:"exampleCount,omitempty"` 6024 // QueryType: The query type used in retrieval. The enum values are frozen in 6025 // the foreseeable future. 6026 // 6027 // Possible values: 6028 // "QUERY_TYPE_UNSPECIFIED" - Unspecified query type for model error 6029 // analysis. 6030 // "QUERY_TYPE_ALL_SIMILAR" - Query similar samples across all classes in the 6031 // dataset. 6032 // "QUERY_TYPE_SAME_CLASS_SIMILAR" - Query similar samples from the same 6033 // class of the input sample. 6034 // "QUERY_TYPE_SAME_CLASS_DISSIMILAR" - Query dissimilar samples from the 6035 // same class of the input sample. 6036 QueryType string `json:"queryType,omitempty"` 6037 // ForceSendFields is a list of field names (e.g. "ExampleCount") to 6038 // unconditionally include in API requests. By default, fields with empty or 6039 // default values are omitted from API requests. See 6040 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6041 // details. 6042 ForceSendFields []string `json:"-"` 6043 // NullFields is a list of field names (e.g. "ExampleCount") to include in API 6044 // requests with the JSON null value. By default, fields with empty values are 6045 // omitted from API requests. See 6046 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6047 NullFields []string `json:"-"` 6048 } 6049 6050 func (s *XPSVisionErrorAnalysisConfig) MarshalJSON() ([]byte, error) { 6051 type NoMethod XPSVisionErrorAnalysisConfig 6052 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6053 } 6054 6055 type XPSVisionTrainingOperationMetadata struct { 6056 // ExplanationUsage: Aggregated infra usage within certain time period, for 6057 // billing report purpose if XAI is enable in training request. 6058 ExplanationUsage *InfraUsage `json:"explanationUsage,omitempty"` 6059 // ForceSendFields is a list of field names (e.g. "ExplanationUsage") to 6060 // unconditionally include in API requests. By default, fields with empty or 6061 // default values are omitted from API requests. See 6062 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6063 // details. 6064 ForceSendFields []string `json:"-"` 6065 // NullFields is a list of field names (e.g. "ExplanationUsage") to include in 6066 // API requests with the JSON null value. By default, fields with empty values 6067 // are omitted from API requests. See 6068 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6069 NullFields []string `json:"-"` 6070 } 6071 6072 func (s *XPSVisionTrainingOperationMetadata) MarshalJSON() ([]byte, error) { 6073 type NoMethod XPSVisionTrainingOperationMetadata 6074 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6075 } 6076 6077 // XPSVisualization: Visualization configurations for image explanation. 6078 type XPSVisualization struct { 6079 // ClipPercentLowerbound: Excludes attributions below the specified percentile, 6080 // from the highlighted areas. Defaults to 62. 6081 ClipPercentLowerbound float64 `json:"clipPercentLowerbound,omitempty"` 6082 // ClipPercentUpperbound: Excludes attributions above the specified percentile 6083 // from the highlighted areas. Using the clip_percent_upperbound and 6084 // clip_percent_lowerbound together can be useful for filtering out noise and 6085 // making it easier to see areas of strong attribution. Defaults to 99.9. 6086 ClipPercentUpperbound float64 `json:"clipPercentUpperbound,omitempty"` 6087 // ColorMap: The color scheme used for the highlighted areas. Defaults to 6088 // PINK_GREEN for Integrated Gradients attribution, which shows positive 6089 // attributions in green and negative in pink. Defaults to VIRIDIS for XRAI 6090 // attribution, which highlights the most influential regions in yellow and the 6091 // least influential in blue. 6092 // 6093 // Possible values: 6094 // "COLOR_MAP_UNSPECIFIED" - Should not be used. 6095 // "PINK_GREEN" - Positive: green. Negative: pink. 6096 // "VIRIDIS" - Viridis color map: A perceptually uniform color mapping which 6097 // is easier to see by those with colorblindness and progresses from yellow to 6098 // green to blue. Positive: yellow. Negative: blue. 6099 // "RED" - Positive: red. Negative: red. 6100 // "GREEN" - Positive: green. Negative: green. 6101 // "RED_GREEN" - Positive: green. Negative: red. 6102 // "PINK_WHITE_GREEN" - PiYG palette. 6103 ColorMap string `json:"colorMap,omitempty"` 6104 // OverlayType: How the original image is displayed in the visualization. 6105 // Adjusting the overlay can help increase visual clarity if the original image 6106 // makes it difficult to view the visualization. Defaults to NONE. 6107 // 6108 // Possible values: 6109 // "OVERLAY_TYPE_UNSPECIFIED" - Default value. This is the same as NONE. 6110 // "NONE" - No overlay. 6111 // "ORIGINAL" - The attributions are shown on top of the original image. 6112 // "GRAYSCALE" - The attributions are shown on top of grayscaled version of 6113 // the original image. 6114 // "MASK_BLACK" - The attributions are used as a mask to reveal predictive 6115 // parts of the image and hide the un-predictive parts. 6116 OverlayType string `json:"overlayType,omitempty"` 6117 // Polarity: Whether to only highlight pixels with positive contributions, 6118 // negative or both. Defaults to POSITIVE. 6119 // 6120 // Possible values: 6121 // "POLARITY_UNSPECIFIED" - Default value. This is the same as POSITIVE. 6122 // "POSITIVE" - Highlights the pixels/outlines that were most influential to 6123 // the model's prediction. 6124 // "NEGATIVE" - Setting polarity to negative highlights areas that does not 6125 // lead to the models's current prediction. 6126 // "BOTH" - Shows both positive and negative attributions. 6127 Polarity string `json:"polarity,omitempty"` 6128 // Type: Type of the image visualization. Only applicable to Integrated 6129 // Gradients attribution. OUTLINES shows regions of attribution, while PIXELS 6130 // shows per-pixel attribution. Defaults to OUTLINES. 6131 // 6132 // Possible values: 6133 // "TYPE_UNSPECIFIED" - Should not be used. 6134 // "PIXELS" - Shows which pixel contributed to the image prediction. 6135 // "OUTLINES" - Shows which region contributed to the image prediction by 6136 // outlining the region. 6137 Type string `json:"type,omitempty"` 6138 // ForceSendFields is a list of field names (e.g. "ClipPercentLowerbound") to 6139 // unconditionally include in API requests. By default, fields with empty or 6140 // default values are omitted from API requests. See 6141 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6142 // details. 6143 ForceSendFields []string `json:"-"` 6144 // NullFields is a list of field names (e.g. "ClipPercentLowerbound") to 6145 // include in API requests with the JSON null value. By default, fields with 6146 // empty values are omitted from API requests. See 6147 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6148 NullFields []string `json:"-"` 6149 } 6150 6151 func (s *XPSVisualization) MarshalJSON() ([]byte, error) { 6152 type NoMethod XPSVisualization 6153 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6154 } 6155 6156 func (s *XPSVisualization) UnmarshalJSON(data []byte) error { 6157 type NoMethod XPSVisualization 6158 var s1 struct { 6159 ClipPercentLowerbound gensupport.JSONFloat64 `json:"clipPercentLowerbound"` 6160 ClipPercentUpperbound gensupport.JSONFloat64 `json:"clipPercentUpperbound"` 6161 *NoMethod 6162 } 6163 s1.NoMethod = (*NoMethod)(s) 6164 if err := json.Unmarshal(data, &s1); err != nil { 6165 return err 6166 } 6167 s.ClipPercentLowerbound = float64(s1.ClipPercentLowerbound) 6168 s.ClipPercentUpperbound = float64(s1.ClipPercentUpperbound) 6169 return nil 6170 } 6171 6172 type XPSXpsOperationMetadata struct { 6173 // ExampleCount: Optional. XPS server can opt to provide example count of the 6174 // long running operation (e.g. training, data importing, batch prediction). 6175 ExampleCount int64 `json:"exampleCount,omitempty,string"` 6176 // ReportingMetrics: Metrics for the operation. By the time the operation is 6177 // terminated (whether succeeded or failed) as returned from XPS, AutoML BE 6178 // assumes the metrics are finalized. AutoML BE transparently posts the metrics 6179 // to Chemist if it's not empty, regardless of the response content or error 6180 // type. If user is supposed to be charged in case of cancellation/error, this 6181 // field should be set. In the case where the type of LRO doesn't require any 6182 // billing, this field should be left unset. 6183 ReportingMetrics *XPSReportingMetrics `json:"reportingMetrics,omitempty"` 6184 TablesTrainingOperationMetadata *XPSTablesTrainingOperationMetadata `json:"tablesTrainingOperationMetadata,omitempty"` 6185 VideoBatchPredictOperationMetadata *XPSVideoBatchPredictOperationMetadata `json:"videoBatchPredictOperationMetadata,omitempty"` 6186 VideoTrainingOperationMetadata *XPSVideoTrainingOperationMetadata `json:"videoTrainingOperationMetadata,omitempty"` 6187 VisionTrainingOperationMetadata *XPSVisionTrainingOperationMetadata `json:"visionTrainingOperationMetadata,omitempty"` 6188 // ForceSendFields is a list of field names (e.g. "ExampleCount") to 6189 // unconditionally include in API requests. By default, fields with empty or 6190 // default values are omitted from API requests. See 6191 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6192 // details. 6193 ForceSendFields []string `json:"-"` 6194 // NullFields is a list of field names (e.g. "ExampleCount") to include in API 6195 // requests with the JSON null value. By default, fields with empty values are 6196 // omitted from API requests. See 6197 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6198 NullFields []string `json:"-"` 6199 } 6200 6201 func (s *XPSXpsOperationMetadata) MarshalJSON() ([]byte, error) { 6202 type NoMethod XPSXpsOperationMetadata 6203 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6204 } 6205 6206 // XPSXraiAttribution: An explanation method that redistributes Integrated 6207 // Gradients attributions to segmented regions, taking advantage of the model's 6208 // fully differentiable structure. Refer to this paper for more details: 6209 // https://arxiv.org/abs/1906.02825 Only supports image Models (modality is 6210 // IMAGE). 6211 type XPSXraiAttribution struct { 6212 // StepCount: The number of steps for approximating the path integral. A good 6213 // value to start is 50 and gradually increase until the sum to diff property 6214 // is met within the desired error range. Valid range of its value is [1, 100], 6215 // inclusively. 6216 StepCount int64 `json:"stepCount,omitempty"` 6217 // ForceSendFields is a list of field names (e.g. "StepCount") to 6218 // unconditionally include in API requests. By default, fields with empty or 6219 // default values are omitted from API requests. See 6220 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 6221 // details. 6222 ForceSendFields []string `json:"-"` 6223 // NullFields is a list of field names (e.g. "StepCount") to include in API 6224 // requests with the JSON null value. By default, fields with empty values are 6225 // omitted from API requests. See 6226 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 6227 NullFields []string `json:"-"` 6228 } 6229 6230 func (s *XPSXraiAttribution) MarshalJSON() ([]byte, error) { 6231 type NoMethod XPSXraiAttribution 6232 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 6233 } 6234 6235 type DocumentsAnalyzeEntitiesCall struct { 6236 s *Service 6237 analyzeentitiesrequest *AnalyzeEntitiesRequest 6238 urlParams_ gensupport.URLParams 6239 ctx_ context.Context 6240 header_ http.Header 6241 } 6242 6243 // AnalyzeEntities: Finds named entities (currently proper names and common 6244 // nouns) in the text along with entity types, salience, mentions for each 6245 // entity, and other properties. 6246 func (r *DocumentsService) AnalyzeEntities(analyzeentitiesrequest *AnalyzeEntitiesRequest) *DocumentsAnalyzeEntitiesCall { 6247 c := &DocumentsAnalyzeEntitiesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6248 c.analyzeentitiesrequest = analyzeentitiesrequest 6249 return c 6250 } 6251 6252 // Fields allows partial responses to be retrieved. See 6253 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6254 // details. 6255 func (c *DocumentsAnalyzeEntitiesCall) Fields(s ...googleapi.Field) *DocumentsAnalyzeEntitiesCall { 6256 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6257 return c 6258 } 6259 6260 // Context sets the context to be used in this call's Do method. 6261 func (c *DocumentsAnalyzeEntitiesCall) Context(ctx context.Context) *DocumentsAnalyzeEntitiesCall { 6262 c.ctx_ = ctx 6263 return c 6264 } 6265 6266 // Header returns a http.Header that can be modified by the caller to add 6267 // headers to the request. 6268 func (c *DocumentsAnalyzeEntitiesCall) Header() http.Header { 6269 if c.header_ == nil { 6270 c.header_ = make(http.Header) 6271 } 6272 return c.header_ 6273 } 6274 6275 func (c *DocumentsAnalyzeEntitiesCall) doRequest(alt string) (*http.Response, error) { 6276 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6277 var body io.Reader = nil 6278 body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzeentitiesrequest) 6279 if err != nil { 6280 return nil, err 6281 } 6282 c.urlParams_.Set("alt", alt) 6283 c.urlParams_.Set("prettyPrint", "false") 6284 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/documents:analyzeEntities") 6285 urls += "?" + c.urlParams_.Encode() 6286 req, err := http.NewRequest("POST", urls, body) 6287 if err != nil { 6288 return nil, err 6289 } 6290 req.Header = reqHeaders 6291 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6292 } 6293 6294 // Do executes the "language.documents.analyzeEntities" call. 6295 // Any non-2xx status code is an error. Response headers are in either 6296 // *AnalyzeEntitiesResponse.ServerResponse.Header or (if a response was 6297 // returned at all) in error.(*googleapi.Error).Header. Use 6298 // googleapi.IsNotModified to check whether the returned error was because 6299 // http.StatusNotModified was returned. 6300 func (c *DocumentsAnalyzeEntitiesCall) Do(opts ...googleapi.CallOption) (*AnalyzeEntitiesResponse, error) { 6301 gensupport.SetOptions(c.urlParams_, opts...) 6302 res, err := c.doRequest("json") 6303 if res != nil && res.StatusCode == http.StatusNotModified { 6304 if res.Body != nil { 6305 res.Body.Close() 6306 } 6307 return nil, gensupport.WrapError(&googleapi.Error{ 6308 Code: res.StatusCode, 6309 Header: res.Header, 6310 }) 6311 } 6312 if err != nil { 6313 return nil, err 6314 } 6315 defer googleapi.CloseBody(res) 6316 if err := googleapi.CheckResponse(res); err != nil { 6317 return nil, gensupport.WrapError(err) 6318 } 6319 ret := &AnalyzeEntitiesResponse{ 6320 ServerResponse: googleapi.ServerResponse{ 6321 Header: res.Header, 6322 HTTPStatusCode: res.StatusCode, 6323 }, 6324 } 6325 target := &ret 6326 if err := gensupport.DecodeResponse(target, res); err != nil { 6327 return nil, err 6328 } 6329 return ret, nil 6330 } 6331 6332 type DocumentsAnalyzeEntitySentimentCall struct { 6333 s *Service 6334 analyzeentitysentimentrequest *AnalyzeEntitySentimentRequest 6335 urlParams_ gensupport.URLParams 6336 ctx_ context.Context 6337 header_ http.Header 6338 } 6339 6340 // AnalyzeEntitySentiment: Finds entities, similar to AnalyzeEntities in the 6341 // text and analyzes sentiment associated with each entity and its mentions. 6342 func (r *DocumentsService) AnalyzeEntitySentiment(analyzeentitysentimentrequest *AnalyzeEntitySentimentRequest) *DocumentsAnalyzeEntitySentimentCall { 6343 c := &DocumentsAnalyzeEntitySentimentCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6344 c.analyzeentitysentimentrequest = analyzeentitysentimentrequest 6345 return c 6346 } 6347 6348 // Fields allows partial responses to be retrieved. See 6349 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6350 // details. 6351 func (c *DocumentsAnalyzeEntitySentimentCall) Fields(s ...googleapi.Field) *DocumentsAnalyzeEntitySentimentCall { 6352 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6353 return c 6354 } 6355 6356 // Context sets the context to be used in this call's Do method. 6357 func (c *DocumentsAnalyzeEntitySentimentCall) Context(ctx context.Context) *DocumentsAnalyzeEntitySentimentCall { 6358 c.ctx_ = ctx 6359 return c 6360 } 6361 6362 // Header returns a http.Header that can be modified by the caller to add 6363 // headers to the request. 6364 func (c *DocumentsAnalyzeEntitySentimentCall) Header() http.Header { 6365 if c.header_ == nil { 6366 c.header_ = make(http.Header) 6367 } 6368 return c.header_ 6369 } 6370 6371 func (c *DocumentsAnalyzeEntitySentimentCall) doRequest(alt string) (*http.Response, error) { 6372 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6373 var body io.Reader = nil 6374 body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzeentitysentimentrequest) 6375 if err != nil { 6376 return nil, err 6377 } 6378 c.urlParams_.Set("alt", alt) 6379 c.urlParams_.Set("prettyPrint", "false") 6380 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/documents:analyzeEntitySentiment") 6381 urls += "?" + c.urlParams_.Encode() 6382 req, err := http.NewRequest("POST", urls, body) 6383 if err != nil { 6384 return nil, err 6385 } 6386 req.Header = reqHeaders 6387 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6388 } 6389 6390 // Do executes the "language.documents.analyzeEntitySentiment" call. 6391 // Any non-2xx status code is an error. Response headers are in either 6392 // *AnalyzeEntitySentimentResponse.ServerResponse.Header or (if a response was 6393 // returned at all) in error.(*googleapi.Error).Header. Use 6394 // googleapi.IsNotModified to check whether the returned error was because 6395 // http.StatusNotModified was returned. 6396 func (c *DocumentsAnalyzeEntitySentimentCall) Do(opts ...googleapi.CallOption) (*AnalyzeEntitySentimentResponse, error) { 6397 gensupport.SetOptions(c.urlParams_, opts...) 6398 res, err := c.doRequest("json") 6399 if res != nil && res.StatusCode == http.StatusNotModified { 6400 if res.Body != nil { 6401 res.Body.Close() 6402 } 6403 return nil, gensupport.WrapError(&googleapi.Error{ 6404 Code: res.StatusCode, 6405 Header: res.Header, 6406 }) 6407 } 6408 if err != nil { 6409 return nil, err 6410 } 6411 defer googleapi.CloseBody(res) 6412 if err := googleapi.CheckResponse(res); err != nil { 6413 return nil, gensupport.WrapError(err) 6414 } 6415 ret := &AnalyzeEntitySentimentResponse{ 6416 ServerResponse: googleapi.ServerResponse{ 6417 Header: res.Header, 6418 HTTPStatusCode: res.StatusCode, 6419 }, 6420 } 6421 target := &ret 6422 if err := gensupport.DecodeResponse(target, res); err != nil { 6423 return nil, err 6424 } 6425 return ret, nil 6426 } 6427 6428 type DocumentsAnalyzeSentimentCall struct { 6429 s *Service 6430 analyzesentimentrequest *AnalyzeSentimentRequest 6431 urlParams_ gensupport.URLParams 6432 ctx_ context.Context 6433 header_ http.Header 6434 } 6435 6436 // AnalyzeSentiment: Analyzes the sentiment of the provided text. 6437 func (r *DocumentsService) AnalyzeSentiment(analyzesentimentrequest *AnalyzeSentimentRequest) *DocumentsAnalyzeSentimentCall { 6438 c := &DocumentsAnalyzeSentimentCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6439 c.analyzesentimentrequest = analyzesentimentrequest 6440 return c 6441 } 6442 6443 // Fields allows partial responses to be retrieved. See 6444 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6445 // details. 6446 func (c *DocumentsAnalyzeSentimentCall) Fields(s ...googleapi.Field) *DocumentsAnalyzeSentimentCall { 6447 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6448 return c 6449 } 6450 6451 // Context sets the context to be used in this call's Do method. 6452 func (c *DocumentsAnalyzeSentimentCall) Context(ctx context.Context) *DocumentsAnalyzeSentimentCall { 6453 c.ctx_ = ctx 6454 return c 6455 } 6456 6457 // Header returns a http.Header that can be modified by the caller to add 6458 // headers to the request. 6459 func (c *DocumentsAnalyzeSentimentCall) Header() http.Header { 6460 if c.header_ == nil { 6461 c.header_ = make(http.Header) 6462 } 6463 return c.header_ 6464 } 6465 6466 func (c *DocumentsAnalyzeSentimentCall) doRequest(alt string) (*http.Response, error) { 6467 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6468 var body io.Reader = nil 6469 body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzesentimentrequest) 6470 if err != nil { 6471 return nil, err 6472 } 6473 c.urlParams_.Set("alt", alt) 6474 c.urlParams_.Set("prettyPrint", "false") 6475 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/documents:analyzeSentiment") 6476 urls += "?" + c.urlParams_.Encode() 6477 req, err := http.NewRequest("POST", urls, body) 6478 if err != nil { 6479 return nil, err 6480 } 6481 req.Header = reqHeaders 6482 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6483 } 6484 6485 // Do executes the "language.documents.analyzeSentiment" call. 6486 // Any non-2xx status code is an error. Response headers are in either 6487 // *AnalyzeSentimentResponse.ServerResponse.Header or (if a response was 6488 // returned at all) in error.(*googleapi.Error).Header. Use 6489 // googleapi.IsNotModified to check whether the returned error was because 6490 // http.StatusNotModified was returned. 6491 func (c *DocumentsAnalyzeSentimentCall) Do(opts ...googleapi.CallOption) (*AnalyzeSentimentResponse, error) { 6492 gensupport.SetOptions(c.urlParams_, opts...) 6493 res, err := c.doRequest("json") 6494 if res != nil && res.StatusCode == http.StatusNotModified { 6495 if res.Body != nil { 6496 res.Body.Close() 6497 } 6498 return nil, gensupport.WrapError(&googleapi.Error{ 6499 Code: res.StatusCode, 6500 Header: res.Header, 6501 }) 6502 } 6503 if err != nil { 6504 return nil, err 6505 } 6506 defer googleapi.CloseBody(res) 6507 if err := googleapi.CheckResponse(res); err != nil { 6508 return nil, gensupport.WrapError(err) 6509 } 6510 ret := &AnalyzeSentimentResponse{ 6511 ServerResponse: googleapi.ServerResponse{ 6512 Header: res.Header, 6513 HTTPStatusCode: res.StatusCode, 6514 }, 6515 } 6516 target := &ret 6517 if err := gensupport.DecodeResponse(target, res); err != nil { 6518 return nil, err 6519 } 6520 return ret, nil 6521 } 6522 6523 type DocumentsAnalyzeSyntaxCall struct { 6524 s *Service 6525 analyzesyntaxrequest *AnalyzeSyntaxRequest 6526 urlParams_ gensupport.URLParams 6527 ctx_ context.Context 6528 header_ http.Header 6529 } 6530 6531 // AnalyzeSyntax: Analyzes the syntax of the text and provides sentence 6532 // boundaries and tokenization along with part of speech tags, dependency 6533 // trees, and other properties. 6534 func (r *DocumentsService) AnalyzeSyntax(analyzesyntaxrequest *AnalyzeSyntaxRequest) *DocumentsAnalyzeSyntaxCall { 6535 c := &DocumentsAnalyzeSyntaxCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6536 c.analyzesyntaxrequest = analyzesyntaxrequest 6537 return c 6538 } 6539 6540 // Fields allows partial responses to be retrieved. See 6541 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6542 // details. 6543 func (c *DocumentsAnalyzeSyntaxCall) Fields(s ...googleapi.Field) *DocumentsAnalyzeSyntaxCall { 6544 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6545 return c 6546 } 6547 6548 // Context sets the context to be used in this call's Do method. 6549 func (c *DocumentsAnalyzeSyntaxCall) Context(ctx context.Context) *DocumentsAnalyzeSyntaxCall { 6550 c.ctx_ = ctx 6551 return c 6552 } 6553 6554 // Header returns a http.Header that can be modified by the caller to add 6555 // headers to the request. 6556 func (c *DocumentsAnalyzeSyntaxCall) Header() http.Header { 6557 if c.header_ == nil { 6558 c.header_ = make(http.Header) 6559 } 6560 return c.header_ 6561 } 6562 6563 func (c *DocumentsAnalyzeSyntaxCall) doRequest(alt string) (*http.Response, error) { 6564 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6565 var body io.Reader = nil 6566 body, err := googleapi.WithoutDataWrapper.JSONReader(c.analyzesyntaxrequest) 6567 if err != nil { 6568 return nil, err 6569 } 6570 c.urlParams_.Set("alt", alt) 6571 c.urlParams_.Set("prettyPrint", "false") 6572 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/documents:analyzeSyntax") 6573 urls += "?" + c.urlParams_.Encode() 6574 req, err := http.NewRequest("POST", urls, body) 6575 if err != nil { 6576 return nil, err 6577 } 6578 req.Header = reqHeaders 6579 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6580 } 6581 6582 // Do executes the "language.documents.analyzeSyntax" call. 6583 // Any non-2xx status code is an error. Response headers are in either 6584 // *AnalyzeSyntaxResponse.ServerResponse.Header or (if a response was returned 6585 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6586 // check whether the returned error was because http.StatusNotModified was 6587 // returned. 6588 func (c *DocumentsAnalyzeSyntaxCall) Do(opts ...googleapi.CallOption) (*AnalyzeSyntaxResponse, error) { 6589 gensupport.SetOptions(c.urlParams_, opts...) 6590 res, err := c.doRequest("json") 6591 if res != nil && res.StatusCode == http.StatusNotModified { 6592 if res.Body != nil { 6593 res.Body.Close() 6594 } 6595 return nil, gensupport.WrapError(&googleapi.Error{ 6596 Code: res.StatusCode, 6597 Header: res.Header, 6598 }) 6599 } 6600 if err != nil { 6601 return nil, err 6602 } 6603 defer googleapi.CloseBody(res) 6604 if err := googleapi.CheckResponse(res); err != nil { 6605 return nil, gensupport.WrapError(err) 6606 } 6607 ret := &AnalyzeSyntaxResponse{ 6608 ServerResponse: googleapi.ServerResponse{ 6609 Header: res.Header, 6610 HTTPStatusCode: res.StatusCode, 6611 }, 6612 } 6613 target := &ret 6614 if err := gensupport.DecodeResponse(target, res); err != nil { 6615 return nil, err 6616 } 6617 return ret, nil 6618 } 6619 6620 type DocumentsAnnotateTextCall struct { 6621 s *Service 6622 annotatetextrequest *AnnotateTextRequest 6623 urlParams_ gensupport.URLParams 6624 ctx_ context.Context 6625 header_ http.Header 6626 } 6627 6628 // AnnotateText: A convenience method that provides all syntax, sentiment, 6629 // entity, and classification features in one call. 6630 func (r *DocumentsService) AnnotateText(annotatetextrequest *AnnotateTextRequest) *DocumentsAnnotateTextCall { 6631 c := &DocumentsAnnotateTextCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6632 c.annotatetextrequest = annotatetextrequest 6633 return c 6634 } 6635 6636 // Fields allows partial responses to be retrieved. See 6637 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6638 // details. 6639 func (c *DocumentsAnnotateTextCall) Fields(s ...googleapi.Field) *DocumentsAnnotateTextCall { 6640 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6641 return c 6642 } 6643 6644 // Context sets the context to be used in this call's Do method. 6645 func (c *DocumentsAnnotateTextCall) Context(ctx context.Context) *DocumentsAnnotateTextCall { 6646 c.ctx_ = ctx 6647 return c 6648 } 6649 6650 // Header returns a http.Header that can be modified by the caller to add 6651 // headers to the request. 6652 func (c *DocumentsAnnotateTextCall) Header() http.Header { 6653 if c.header_ == nil { 6654 c.header_ = make(http.Header) 6655 } 6656 return c.header_ 6657 } 6658 6659 func (c *DocumentsAnnotateTextCall) doRequest(alt string) (*http.Response, error) { 6660 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6661 var body io.Reader = nil 6662 body, err := googleapi.WithoutDataWrapper.JSONReader(c.annotatetextrequest) 6663 if err != nil { 6664 return nil, err 6665 } 6666 c.urlParams_.Set("alt", alt) 6667 c.urlParams_.Set("prettyPrint", "false") 6668 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/documents:annotateText") 6669 urls += "?" + c.urlParams_.Encode() 6670 req, err := http.NewRequest("POST", urls, body) 6671 if err != nil { 6672 return nil, err 6673 } 6674 req.Header = reqHeaders 6675 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6676 } 6677 6678 // Do executes the "language.documents.annotateText" call. 6679 // Any non-2xx status code is an error. Response headers are in either 6680 // *AnnotateTextResponse.ServerResponse.Header or (if a response was returned 6681 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6682 // check whether the returned error was because http.StatusNotModified was 6683 // returned. 6684 func (c *DocumentsAnnotateTextCall) Do(opts ...googleapi.CallOption) (*AnnotateTextResponse, error) { 6685 gensupport.SetOptions(c.urlParams_, opts...) 6686 res, err := c.doRequest("json") 6687 if res != nil && res.StatusCode == http.StatusNotModified { 6688 if res.Body != nil { 6689 res.Body.Close() 6690 } 6691 return nil, gensupport.WrapError(&googleapi.Error{ 6692 Code: res.StatusCode, 6693 Header: res.Header, 6694 }) 6695 } 6696 if err != nil { 6697 return nil, err 6698 } 6699 defer googleapi.CloseBody(res) 6700 if err := googleapi.CheckResponse(res); err != nil { 6701 return nil, gensupport.WrapError(err) 6702 } 6703 ret := &AnnotateTextResponse{ 6704 ServerResponse: googleapi.ServerResponse{ 6705 Header: res.Header, 6706 HTTPStatusCode: res.StatusCode, 6707 }, 6708 } 6709 target := &ret 6710 if err := gensupport.DecodeResponse(target, res); err != nil { 6711 return nil, err 6712 } 6713 return ret, nil 6714 } 6715 6716 type DocumentsClassifyTextCall struct { 6717 s *Service 6718 classifytextrequest *ClassifyTextRequest 6719 urlParams_ gensupport.URLParams 6720 ctx_ context.Context 6721 header_ http.Header 6722 } 6723 6724 // ClassifyText: Classifies a document into categories. 6725 func (r *DocumentsService) ClassifyText(classifytextrequest *ClassifyTextRequest) *DocumentsClassifyTextCall { 6726 c := &DocumentsClassifyTextCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6727 c.classifytextrequest = classifytextrequest 6728 return c 6729 } 6730 6731 // Fields allows partial responses to be retrieved. See 6732 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6733 // details. 6734 func (c *DocumentsClassifyTextCall) Fields(s ...googleapi.Field) *DocumentsClassifyTextCall { 6735 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6736 return c 6737 } 6738 6739 // Context sets the context to be used in this call's Do method. 6740 func (c *DocumentsClassifyTextCall) Context(ctx context.Context) *DocumentsClassifyTextCall { 6741 c.ctx_ = ctx 6742 return c 6743 } 6744 6745 // Header returns a http.Header that can be modified by the caller to add 6746 // headers to the request. 6747 func (c *DocumentsClassifyTextCall) Header() http.Header { 6748 if c.header_ == nil { 6749 c.header_ = make(http.Header) 6750 } 6751 return c.header_ 6752 } 6753 6754 func (c *DocumentsClassifyTextCall) doRequest(alt string) (*http.Response, error) { 6755 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6756 var body io.Reader = nil 6757 body, err := googleapi.WithoutDataWrapper.JSONReader(c.classifytextrequest) 6758 if err != nil { 6759 return nil, err 6760 } 6761 c.urlParams_.Set("alt", alt) 6762 c.urlParams_.Set("prettyPrint", "false") 6763 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/documents:classifyText") 6764 urls += "?" + c.urlParams_.Encode() 6765 req, err := http.NewRequest("POST", urls, body) 6766 if err != nil { 6767 return nil, err 6768 } 6769 req.Header = reqHeaders 6770 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6771 } 6772 6773 // Do executes the "language.documents.classifyText" call. 6774 // Any non-2xx status code is an error. Response headers are in either 6775 // *ClassifyTextResponse.ServerResponse.Header or (if a response was returned 6776 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6777 // check whether the returned error was because http.StatusNotModified was 6778 // returned. 6779 func (c *DocumentsClassifyTextCall) Do(opts ...googleapi.CallOption) (*ClassifyTextResponse, error) { 6780 gensupport.SetOptions(c.urlParams_, opts...) 6781 res, err := c.doRequest("json") 6782 if res != nil && res.StatusCode == http.StatusNotModified { 6783 if res.Body != nil { 6784 res.Body.Close() 6785 } 6786 return nil, gensupport.WrapError(&googleapi.Error{ 6787 Code: res.StatusCode, 6788 Header: res.Header, 6789 }) 6790 } 6791 if err != nil { 6792 return nil, err 6793 } 6794 defer googleapi.CloseBody(res) 6795 if err := googleapi.CheckResponse(res); err != nil { 6796 return nil, gensupport.WrapError(err) 6797 } 6798 ret := &ClassifyTextResponse{ 6799 ServerResponse: googleapi.ServerResponse{ 6800 Header: res.Header, 6801 HTTPStatusCode: res.StatusCode, 6802 }, 6803 } 6804 target := &ret 6805 if err := gensupport.DecodeResponse(target, res); err != nil { 6806 return nil, err 6807 } 6808 return ret, nil 6809 } 6810 6811 type DocumentsModerateTextCall struct { 6812 s *Service 6813 moderatetextrequest *ModerateTextRequest 6814 urlParams_ gensupport.URLParams 6815 ctx_ context.Context 6816 header_ http.Header 6817 } 6818 6819 // ModerateText: Moderates a document for harmful and sensitive categories. 6820 func (r *DocumentsService) ModerateText(moderatetextrequest *ModerateTextRequest) *DocumentsModerateTextCall { 6821 c := &DocumentsModerateTextCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6822 c.moderatetextrequest = moderatetextrequest 6823 return c 6824 } 6825 6826 // Fields allows partial responses to be retrieved. See 6827 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 6828 // details. 6829 func (c *DocumentsModerateTextCall) Fields(s ...googleapi.Field) *DocumentsModerateTextCall { 6830 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6831 return c 6832 } 6833 6834 // Context sets the context to be used in this call's Do method. 6835 func (c *DocumentsModerateTextCall) Context(ctx context.Context) *DocumentsModerateTextCall { 6836 c.ctx_ = ctx 6837 return c 6838 } 6839 6840 // Header returns a http.Header that can be modified by the caller to add 6841 // headers to the request. 6842 func (c *DocumentsModerateTextCall) Header() http.Header { 6843 if c.header_ == nil { 6844 c.header_ = make(http.Header) 6845 } 6846 return c.header_ 6847 } 6848 6849 func (c *DocumentsModerateTextCall) doRequest(alt string) (*http.Response, error) { 6850 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 6851 var body io.Reader = nil 6852 body, err := googleapi.WithoutDataWrapper.JSONReader(c.moderatetextrequest) 6853 if err != nil { 6854 return nil, err 6855 } 6856 c.urlParams_.Set("alt", alt) 6857 c.urlParams_.Set("prettyPrint", "false") 6858 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/documents:moderateText") 6859 urls += "?" + c.urlParams_.Encode() 6860 req, err := http.NewRequest("POST", urls, body) 6861 if err != nil { 6862 return nil, err 6863 } 6864 req.Header = reqHeaders 6865 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6866 } 6867 6868 // Do executes the "language.documents.moderateText" call. 6869 // Any non-2xx status code is an error. Response headers are in either 6870 // *ModerateTextResponse.ServerResponse.Header or (if a response was returned 6871 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6872 // check whether the returned error was because http.StatusNotModified was 6873 // returned. 6874 func (c *DocumentsModerateTextCall) Do(opts ...googleapi.CallOption) (*ModerateTextResponse, error) { 6875 gensupport.SetOptions(c.urlParams_, opts...) 6876 res, err := c.doRequest("json") 6877 if res != nil && res.StatusCode == http.StatusNotModified { 6878 if res.Body != nil { 6879 res.Body.Close() 6880 } 6881 return nil, gensupport.WrapError(&googleapi.Error{ 6882 Code: res.StatusCode, 6883 Header: res.Header, 6884 }) 6885 } 6886 if err != nil { 6887 return nil, err 6888 } 6889 defer googleapi.CloseBody(res) 6890 if err := googleapi.CheckResponse(res); err != nil { 6891 return nil, gensupport.WrapError(err) 6892 } 6893 ret := &ModerateTextResponse{ 6894 ServerResponse: googleapi.ServerResponse{ 6895 Header: res.Header, 6896 HTTPStatusCode: res.StatusCode, 6897 }, 6898 } 6899 target := &ret 6900 if err := gensupport.DecodeResponse(target, res); err != nil { 6901 return nil, err 6902 } 6903 return ret, nil 6904 } 6905