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 cloudsupport provides access to the Google Cloud Support API. 8 // 9 // For product documentation, see: https://cloud.google.com/support/docs/apis 10 // 11 // # Library status 12 // 13 // These client libraries are officially supported by Google. However, this 14 // library is considered complete and is in maintenance mode. This means 15 // that we will address critical bugs and security issues but will not add 16 // any new features. 17 // 18 // When possible, we recommend using our newer 19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 20 // that are still actively being worked and iterated on. 21 // 22 // # Creating a client 23 // 24 // Usage example: 25 // 26 // import "google.golang.org/api/cloudsupport/v2" 27 // ... 28 // ctx := context.Background() 29 // cloudsupportService, err := cloudsupport.NewService(ctx) 30 // 31 // In this example, Google Application Default Credentials are used for 32 // authentication. For information on how to create and obtain Application 33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 34 // 35 // # Other authentication options 36 // 37 // To use an API key for authentication (note: some APIs do not support API 38 // keys), use [google.golang.org/api/option.WithAPIKey]: 39 // 40 // cloudsupportService, err := cloudsupport.NewService(ctx, option.WithAPIKey("AIza...")) 41 // 42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 43 // flow, use [google.golang.org/api/option.WithTokenSource]: 44 // 45 // config := &oauth2.Config{...} 46 // // ... 47 // token, err := config.Exchange(ctx, ...) 48 // cloudsupportService, err := cloudsupport.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 49 // 50 // See [google.golang.org/api/option.ClientOption] for details on options. 51 package cloudsupport // import "google.golang.org/api/cloudsupport/v2" 52 53 import ( 54 "bytes" 55 "context" 56 "encoding/json" 57 "errors" 58 "fmt" 59 "io" 60 "net/http" 61 "net/url" 62 "strconv" 63 "strings" 64 65 googleapi "google.golang.org/api/googleapi" 66 internal "google.golang.org/api/internal" 67 gensupport "google.golang.org/api/internal/gensupport" 68 option "google.golang.org/api/option" 69 internaloption "google.golang.org/api/option/internaloption" 70 htransport "google.golang.org/api/transport/http" 71 ) 72 73 // Always reference these packages, just in case the auto-generated code 74 // below doesn't. 75 var _ = bytes.NewBuffer 76 var _ = strconv.Itoa 77 var _ = fmt.Sprintf 78 var _ = json.NewDecoder 79 var _ = io.Copy 80 var _ = url.Parse 81 var _ = gensupport.MarshalJSON 82 var _ = googleapi.Version 83 var _ = errors.New 84 var _ = strings.Replace 85 var _ = context.Canceled 86 var _ = internaloption.WithDefaultEndpoint 87 var _ = internal.Version 88 89 const apiId = "cloudsupport:v2" 90 const apiName = "cloudsupport" 91 const apiVersion = "v2" 92 const basePath = "https://cloudsupport.googleapis.com/" 93 const basePathTemplate = "https://cloudsupport.UNIVERSE_DOMAIN/" 94 const mtlsBasePath = "https://cloudsupport.mtls.googleapis.com/" 95 96 // OAuth2 scopes used by this API. 97 const ( 98 // See, edit, configure, and delete your Google Cloud data and see the email 99 // address for your Google Account. 100 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 101 ) 102 103 // NewService creates a new Service. 104 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 105 scopesOption := internaloption.WithDefaultScopes( 106 "https://www.googleapis.com/auth/cloud-platform", 107 ) 108 // NOTE: prepend, so we don't override user-specified scopes. 109 opts = append([]option.ClientOption{scopesOption}, opts...) 110 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 111 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 113 opts = append(opts, internaloption.EnableNewAuthLibrary()) 114 client, endpoint, err := htransport.NewClient(ctx, opts...) 115 if err != nil { 116 return nil, err 117 } 118 s, err := New(client) 119 if err != nil { 120 return nil, err 121 } 122 if endpoint != "" { 123 s.BasePath = endpoint 124 } 125 return s, nil 126 } 127 128 // New creates a new Service. It uses the provided http.Client for requests. 129 // 130 // Deprecated: please use NewService instead. 131 // To provide a custom HTTP client, use option.WithHTTPClient. 132 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 133 func New(client *http.Client) (*Service, error) { 134 if client == nil { 135 return nil, errors.New("client is nil") 136 } 137 s := &Service{client: client, BasePath: basePath} 138 s.CaseClassifications = NewCaseClassificationsService(s) 139 s.Cases = NewCasesService(s) 140 s.Media = NewMediaService(s) 141 return s, nil 142 } 143 144 type Service struct { 145 client *http.Client 146 BasePath string // API endpoint base URL 147 UserAgent string // optional additional User-Agent fragment 148 149 CaseClassifications *CaseClassificationsService 150 151 Cases *CasesService 152 153 Media *MediaService 154 } 155 156 func (s *Service) userAgent() string { 157 if s.UserAgent == "" { 158 return googleapi.UserAgent 159 } 160 return googleapi.UserAgent + " " + s.UserAgent 161 } 162 163 func NewCaseClassificationsService(s *Service) *CaseClassificationsService { 164 rs := &CaseClassificationsService{s: s} 165 return rs 166 } 167 168 type CaseClassificationsService struct { 169 s *Service 170 } 171 172 func NewCasesService(s *Service) *CasesService { 173 rs := &CasesService{s: s} 174 rs.Attachments = NewCasesAttachmentsService(s) 175 rs.Comments = NewCasesCommentsService(s) 176 return rs 177 } 178 179 type CasesService struct { 180 s *Service 181 182 Attachments *CasesAttachmentsService 183 184 Comments *CasesCommentsService 185 } 186 187 func NewCasesAttachmentsService(s *Service) *CasesAttachmentsService { 188 rs := &CasesAttachmentsService{s: s} 189 return rs 190 } 191 192 type CasesAttachmentsService struct { 193 s *Service 194 } 195 196 func NewCasesCommentsService(s *Service) *CasesCommentsService { 197 rs := &CasesCommentsService{s: s} 198 return rs 199 } 200 201 type CasesCommentsService struct { 202 s *Service 203 } 204 205 func NewMediaService(s *Service) *MediaService { 206 rs := &MediaService{s: s} 207 return rs 208 } 209 210 type MediaService struct { 211 s *Service 212 } 213 214 // Actor: An Actor represents an entity that performed an action. For example, 215 // an actor could be a user who posted a comment on a support case, a user who 216 // uploaded an attachment, or a service account that created a support case. 217 type Actor struct { 218 // DisplayName: The name to display for the actor. If not provided, it is 219 // inferred from credentials supplied during case creation. When an email is 220 // provided, a display name must also be provided. This will be obfuscated if 221 // the user is a Google Support agent. 222 DisplayName string `json:"displayName,omitempty"` 223 // Email: The email address of the actor. If not provided, it is inferred from 224 // the credentials supplied during case creation. When a name is provided, an 225 // email must also be provided. If the user is a Google Support agent, this is 226 // obfuscated. This field is deprecated. Use **username** field instead. 227 Email string `json:"email,omitempty"` 228 // GoogleSupport: Output only. Whether the actor is a Google support actor. 229 GoogleSupport bool `json:"googleSupport,omitempty"` 230 // Username: Output only. The username of the actor. It may look like an email 231 // or other format provided by the identity provider. If not provided, it is 232 // inferred from the credentials supplied. When a name is provided, a username 233 // must also be provided. If the user is a Google Support agent, this will not 234 // be set. 235 Username string `json:"username,omitempty"` 236 // ForceSendFields is a list of field names (e.g. "DisplayName") to 237 // unconditionally include in API requests. By default, fields with empty or 238 // default values are omitted from API requests. See 239 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 240 // details. 241 ForceSendFields []string `json:"-"` 242 // NullFields is a list of field names (e.g. "DisplayName") to include in API 243 // requests with the JSON null value. By default, fields with empty values are 244 // omitted from API requests. See 245 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 246 NullFields []string `json:"-"` 247 } 248 249 func (s *Actor) MarshalJSON() ([]byte, error) { 250 type NoMethod Actor 251 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 252 } 253 254 // Attachment: An Attachment contains metadata about a file that was uploaded 255 // to a case - it is NOT a file itself. That being said, the name of an 256 // Attachment object can be used to download its accompanying file through the 257 // `media.download` endpoint. While attachments can be uploaded in the console 258 // at the same time as a comment, they're associated on a "case" level, not a 259 // "comment" level. 260 type Attachment struct { 261 // CreateTime: Output only. The time at which the attachment was created. 262 CreateTime string `json:"createTime,omitempty"` 263 // Creator: Output only. The user who uploaded the attachment. Note, the name 264 // and email will be obfuscated if the attachment was uploaded by Google 265 // support. 266 Creator *Actor `json:"creator,omitempty"` 267 // Filename: The filename of the attachment (e.g. "graph.jpg"). 268 Filename string `json:"filename,omitempty"` 269 // MimeType: Output only. The MIME type of the attachment (e.g. text/plain). 270 MimeType string `json:"mimeType,omitempty"` 271 // Name: Output only. The resource name of the attachment. 272 Name string `json:"name,omitempty"` 273 // SizeBytes: Output only. The size of the attachment in bytes. 274 SizeBytes int64 `json:"sizeBytes,omitempty,string"` 275 276 // ServerResponse contains the HTTP response code and headers from the server. 277 googleapi.ServerResponse `json:"-"` 278 // ForceSendFields is a list of field names (e.g. "CreateTime") to 279 // unconditionally include in API requests. By default, fields with empty or 280 // default values are omitted from API requests. See 281 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 282 // details. 283 ForceSendFields []string `json:"-"` 284 // NullFields is a list of field names (e.g. "CreateTime") to include in API 285 // requests with the JSON null value. By default, fields with empty values are 286 // omitted from API requests. See 287 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 288 NullFields []string `json:"-"` 289 } 290 291 func (s *Attachment) MarshalJSON() ([]byte, error) { 292 type NoMethod Attachment 293 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 294 } 295 296 // Blobstore2Info: # gdata.* are outside protos with mising documentation 297 type Blobstore2Info struct { 298 // BlobGeneration: # gdata.* are outside protos with mising documentation 299 BlobGeneration int64 `json:"blobGeneration,omitempty,string"` 300 // BlobId: # gdata.* are outside protos with mising documentation 301 BlobId string `json:"blobId,omitempty"` 302 // DownloadReadHandle: # gdata.* are outside protos with mising documentation 303 DownloadReadHandle string `json:"downloadReadHandle,omitempty"` 304 // ReadToken: # gdata.* are outside protos with mising documentation 305 ReadToken string `json:"readToken,omitempty"` 306 // UploadMetadataContainer: # gdata.* are outside protos with mising 307 // documentation 308 UploadMetadataContainer string `json:"uploadMetadataContainer,omitempty"` 309 // ForceSendFields is a list of field names (e.g. "BlobGeneration") to 310 // unconditionally include in API requests. By default, fields with empty or 311 // default values are omitted from API requests. See 312 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 313 // details. 314 ForceSendFields []string `json:"-"` 315 // NullFields is a list of field names (e.g. "BlobGeneration") to include in 316 // API requests with the JSON null value. By default, fields with empty values 317 // are omitted from API requests. See 318 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 319 NullFields []string `json:"-"` 320 } 321 322 func (s *Blobstore2Info) MarshalJSON() ([]byte, error) { 323 type NoMethod Blobstore2Info 324 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 325 } 326 327 // Case: A Case is an object that contains the details of a support case. It 328 // contains fields for the time it was created, its priority, its 329 // classification, and more. Cases can also have comments and attachments that 330 // get added over time. A case is parented by a Google Cloud organization or 331 // project. Organizations are identified by a number, so the name of a case 332 // parented by an organization would look like this: ``` 333 // organizations/123/cases/456 ``` Projects have two unique identifiers, an ID 334 // and a number, and they look like this: ``` projects/abc/cases/456 ``` ``` 335 // projects/123/cases/456 ``` You can use either of them when calling the API. 336 // To learn more about project identifiers, see AIP-2510 337 // (https://google.aip.dev/cloud/2510). 338 type Case struct { 339 // Classification: The issue classification applicable to this case. 340 Classification *CaseClassification `json:"classification,omitempty"` 341 // ContactEmail: A user-supplied email address to send case update 342 // notifications for. This should only be used in BYOID flows, where we cannot 343 // infer the user's email address directly from their EUCs. 344 ContactEmail string `json:"contactEmail,omitempty"` 345 // CreateTime: Output only. The time this case was created. 346 CreateTime string `json:"createTime,omitempty"` 347 // Creator: The user who created the case. Note: The name and email will be 348 // obfuscated if the case was created by Google Support. 349 Creator *Actor `json:"creator,omitempty"` 350 // Description: A broad description of the issue. 351 Description string `json:"description,omitempty"` 352 // DisplayName: The short summary of the issue reported in this case. 353 DisplayName string `json:"displayName,omitempty"` 354 // Escalated: Whether the case is currently escalated. 355 Escalated bool `json:"escalated,omitempty"` 356 // LanguageCode: The language the user has requested to receive support in. 357 // This should be a BCP 47 language code (e.g., "en", "zh-CN", "zh-TW", 358 // "ja", "ko"). If no language or an unsupported language is specified, 359 // this field defaults to English (en). Language selection during case creation 360 // may affect your available support options. For a list of supported languages 361 // and their support working hours, see: 362 // https://cloud.google.com/support/docs/language-working-hours 363 LanguageCode string `json:"languageCode,omitempty"` 364 // Name: The resource name for the case. 365 Name string `json:"name,omitempty"` 366 // Priority: The priority of this case. 367 // 368 // Possible values: 369 // "PRIORITY_UNSPECIFIED" - Priority is undefined or has not been set yet. 370 // "P0" - Extreme impact on a production service. Service is hard down. 371 // "P1" - Critical impact on a production service. Service is currently 372 // unusable. 373 // "P2" - Severe impact on a production service. Service is usable but 374 // greatly impaired. 375 // "P3" - Medium impact on a production service. Service is available, but 376 // moderately impaired. 377 // "P4" - General questions or minor issues. Production service is fully 378 // available. 379 Priority string `json:"priority,omitempty"` 380 // State: Output only. The current status of the support case. 381 // 382 // Possible values: 383 // "STATE_UNSPECIFIED" - Case is in an unknown state. 384 // "NEW" - The case has been created but no one is assigned to work on it 385 // yet. 386 // "IN_PROGRESS_GOOGLE_SUPPORT" - The case is currently being handled by 387 // Google support. 388 // "ACTION_REQUIRED" - Google is waiting for a response. 389 // "SOLUTION_PROVIDED" - A solution has been offered for the case, but it 390 // isn't yet closed. 391 // "CLOSED" - The case has been resolved. 392 State string `json:"state,omitempty"` 393 // SubscriberEmailAddresses: The email addresses to receive updates on this 394 // case. 395 SubscriberEmailAddresses []string `json:"subscriberEmailAddresses,omitempty"` 396 // TestCase: Whether this case was created for internal API testing and should 397 // not be acted on by the support team. 398 TestCase bool `json:"testCase,omitempty"` 399 // TimeZone: The timezone of the user who created the support case. It should 400 // be in a format IANA recognizes: https://www.iana.org/time-zones. There is no 401 // additional validation done by the API. 402 TimeZone string `json:"timeZone,omitempty"` 403 // UpdateTime: Output only. The time this case was last updated. 404 UpdateTime string `json:"updateTime,omitempty"` 405 406 // ServerResponse contains the HTTP response code and headers from the server. 407 googleapi.ServerResponse `json:"-"` 408 // ForceSendFields is a list of field names (e.g. "Classification") to 409 // unconditionally include in API requests. By default, fields with empty or 410 // default values are omitted from API requests. See 411 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 412 // details. 413 ForceSendFields []string `json:"-"` 414 // NullFields is a list of field names (e.g. "Classification") to include in 415 // API requests with the JSON null value. By default, fields with empty values 416 // are omitted from API requests. See 417 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 418 NullFields []string `json:"-"` 419 } 420 421 func (s *Case) MarshalJSON() ([]byte, error) { 422 type NoMethod Case 423 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 424 } 425 426 // CaseClassification: A Case Classification represents the topic that a case 427 // is about. It's very important to use accurate classifications, because 428 // they're used to route your cases to specialists who can help you. A 429 // classification always has an ID that is its unique identifier. A valid ID is 430 // required when creating a case. 431 type CaseClassification struct { 432 // DisplayName: A display name for the classification. The display name is not 433 // static and can change. To uniquely and consistently identify 434 // classifications, use the `CaseClassification.id` field. 435 DisplayName string `json:"displayName,omitempty"` 436 // Id: The unique ID for a classification. Must be specified for case creation. 437 // To retrieve valid classification IDs for case creation, use 438 // `caseClassifications.search`. Classification IDs returned by 439 // `caseClassifications.search` are guaranteed to be valid for at least 6 440 // months. If a given classification is deactiveated, it will immediately stop 441 // being returned. After 6 months, `case.create` requests using the 442 // classification ID will fail. 443 Id string `json:"id,omitempty"` 444 // ForceSendFields is a list of field names (e.g. "DisplayName") to 445 // unconditionally include in API requests. By default, fields with empty or 446 // default values are omitted from API requests. See 447 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 448 // details. 449 ForceSendFields []string `json:"-"` 450 // NullFields is a list of field names (e.g. "DisplayName") to include in API 451 // requests with the JSON null value. By default, fields with empty values are 452 // omitted from API requests. See 453 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 454 NullFields []string `json:"-"` 455 } 456 457 func (s *CaseClassification) MarshalJSON() ([]byte, error) { 458 type NoMethod CaseClassification 459 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 460 } 461 462 // CloseCaseRequest: The request message for the CloseCase endpoint. 463 type CloseCaseRequest struct { 464 } 465 466 // Comment: A comment associated with a support case. Case comments are the 467 // primary way for Google Support to communicate with a user who has opened a 468 // case. When a user responds to Google Support, the user's responses also 469 // appear as comments. 470 type Comment struct { 471 // Body: The full comment body. Maximum of 12800 characters. 472 Body string `json:"body,omitempty"` 473 // CreateTime: Output only. The time when the comment was created. 474 CreateTime string `json:"createTime,omitempty"` 475 // Creator: Output only. The user or Google Support agent who created the 476 // comment. 477 Creator *Actor `json:"creator,omitempty"` 478 // Name: Output only. Identifier. The resource name of the comment. 479 Name string `json:"name,omitempty"` 480 // PlainTextBody: Output only. DEPRECATED. DO NOT USE. A duplicate of the 481 // `body` field. This field is only present for legacy reasons. 482 PlainTextBody string `json:"plainTextBody,omitempty"` 483 484 // ServerResponse contains the HTTP response code and headers from the server. 485 googleapi.ServerResponse `json:"-"` 486 // ForceSendFields is a list of field names (e.g. "Body") to unconditionally 487 // include in API requests. By default, fields with empty or default values are 488 // omitted from API requests. See 489 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 490 // details. 491 ForceSendFields []string `json:"-"` 492 // NullFields is a list of field names (e.g. "Body") to include in API requests 493 // with the JSON null value. By default, fields with empty values are omitted 494 // from API requests. See 495 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 496 NullFields []string `json:"-"` 497 } 498 499 func (s *Comment) MarshalJSON() ([]byte, error) { 500 type NoMethod Comment 501 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 502 } 503 504 // CompositeMedia: # gdata.* are outside protos with mising documentation 505 type CompositeMedia struct { 506 // BlobRef: # gdata.* are outside protos with mising documentation 507 BlobRef string `json:"blobRef,omitempty"` 508 // Blobstore2Info: # gdata.* are outside protos with mising documentation 509 Blobstore2Info *Blobstore2Info `json:"blobstore2Info,omitempty"` 510 // CosmoBinaryReference: # gdata.* are outside protos with mising documentation 511 CosmoBinaryReference string `json:"cosmoBinaryReference,omitempty"` 512 // Crc32cHash: # gdata.* are outside protos with mising documentation 513 Crc32cHash int64 `json:"crc32cHash,omitempty"` 514 // Inline: # gdata.* are outside protos with mising documentation 515 Inline string `json:"inline,omitempty"` 516 // Length: # gdata.* are outside protos with mising documentation 517 Length int64 `json:"length,omitempty,string"` 518 // Md5Hash: # gdata.* are outside protos with mising documentation 519 Md5Hash string `json:"md5Hash,omitempty"` 520 // ObjectId: # gdata.* are outside protos with mising documentation 521 ObjectId *ObjectId `json:"objectId,omitempty"` 522 // Path: # gdata.* are outside protos with mising documentation 523 Path string `json:"path,omitempty"` 524 // ReferenceType: # gdata.* are outside protos with mising documentation 525 // 526 // Possible values: 527 // "PATH" - # gdata.* are outside protos with mising documentation 528 // "BLOB_REF" - # gdata.* are outside protos with mising documentation 529 // "INLINE" - # gdata.* are outside protos with mising documentation 530 // "BIGSTORE_REF" - # gdata.* are outside protos with mising documentation 531 // "COSMO_BINARY_REFERENCE" - # gdata.* are outside protos with mising 532 // documentation 533 ReferenceType string `json:"referenceType,omitempty"` 534 // Sha1Hash: # gdata.* are outside protos with mising documentation 535 Sha1Hash string `json:"sha1Hash,omitempty"` 536 // ForceSendFields is a list of field names (e.g. "BlobRef") to unconditionally 537 // include in API requests. By default, fields with empty or default values are 538 // omitted from API requests. See 539 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 540 // details. 541 ForceSendFields []string `json:"-"` 542 // NullFields is a list of field names (e.g. "BlobRef") to include in API 543 // requests with the JSON null value. By default, fields with empty values are 544 // omitted from API requests. See 545 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 546 NullFields []string `json:"-"` 547 } 548 549 func (s *CompositeMedia) MarshalJSON() ([]byte, error) { 550 type NoMethod CompositeMedia 551 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 552 } 553 554 // ContentTypeInfo: # gdata.* are outside protos with mising documentation 555 type ContentTypeInfo struct { 556 // BestGuess: # gdata.* are outside protos with mising documentation 557 BestGuess string `json:"bestGuess,omitempty"` 558 // FromBytes: # gdata.* are outside protos with mising documentation 559 FromBytes string `json:"fromBytes,omitempty"` 560 // FromFileName: # gdata.* are outside protos with mising documentation 561 FromFileName string `json:"fromFileName,omitempty"` 562 // FromHeader: # gdata.* are outside protos with mising documentation 563 FromHeader string `json:"fromHeader,omitempty"` 564 // FromUrlPath: # gdata.* are outside protos with mising documentation 565 FromUrlPath string `json:"fromUrlPath,omitempty"` 566 // ForceSendFields is a list of field names (e.g. "BestGuess") to 567 // unconditionally include in API requests. By default, fields with empty or 568 // default values are omitted from API requests. See 569 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 570 // details. 571 ForceSendFields []string `json:"-"` 572 // NullFields is a list of field names (e.g. "BestGuess") to include in API 573 // requests with the JSON null value. By default, fields with empty values are 574 // omitted from API requests. See 575 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 576 NullFields []string `json:"-"` 577 } 578 579 func (s *ContentTypeInfo) MarshalJSON() ([]byte, error) { 580 type NoMethod ContentTypeInfo 581 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 582 } 583 584 // CreateAttachmentRequest: The request message for the CreateAttachment 585 // endpoint. 586 type CreateAttachmentRequest struct { 587 // Attachment: Required. The attachment to be created. 588 Attachment *Attachment `json:"attachment,omitempty"` 589 // ForceSendFields is a list of field names (e.g. "Attachment") to 590 // unconditionally include in API requests. By default, fields with empty or 591 // default values are omitted from API requests. See 592 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 593 // details. 594 ForceSendFields []string `json:"-"` 595 // NullFields is a list of field names (e.g. "Attachment") to include in API 596 // requests with the JSON null value. By default, fields with empty values are 597 // omitted from API requests. See 598 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 599 NullFields []string `json:"-"` 600 } 601 602 func (s *CreateAttachmentRequest) MarshalJSON() ([]byte, error) { 603 type NoMethod CreateAttachmentRequest 604 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 605 } 606 607 // DiffChecksumsResponse: # gdata.* are outside protos with mising 608 // documentation 609 type DiffChecksumsResponse struct { 610 // ChecksumsLocation: # gdata.* are outside protos with mising documentation 611 ChecksumsLocation *CompositeMedia `json:"checksumsLocation,omitempty"` 612 // ChunkSizeBytes: # gdata.* are outside protos with mising documentation 613 ChunkSizeBytes int64 `json:"chunkSizeBytes,omitempty,string"` 614 // ObjectLocation: # gdata.* are outside protos with mising documentation 615 ObjectLocation *CompositeMedia `json:"objectLocation,omitempty"` 616 // ObjectSizeBytes: # gdata.* are outside protos with mising documentation 617 ObjectSizeBytes int64 `json:"objectSizeBytes,omitempty,string"` 618 // ObjectVersion: # gdata.* are outside protos with mising documentation 619 ObjectVersion string `json:"objectVersion,omitempty"` 620 // ForceSendFields is a list of field names (e.g. "ChecksumsLocation") to 621 // unconditionally include in API requests. By default, fields with empty or 622 // default values are omitted from API requests. See 623 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 624 // details. 625 ForceSendFields []string `json:"-"` 626 // NullFields is a list of field names (e.g. "ChecksumsLocation") to include in 627 // API requests with the JSON null value. By default, fields with empty values 628 // are omitted from API requests. See 629 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 630 NullFields []string `json:"-"` 631 } 632 633 func (s *DiffChecksumsResponse) MarshalJSON() ([]byte, error) { 634 type NoMethod DiffChecksumsResponse 635 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 636 } 637 638 // DiffDownloadResponse: # gdata.* are outside protos with mising documentation 639 type DiffDownloadResponse struct { 640 // ObjectLocation: # gdata.* are outside protos with mising documentation 641 ObjectLocation *CompositeMedia `json:"objectLocation,omitempty"` 642 // ForceSendFields is a list of field names (e.g. "ObjectLocation") to 643 // unconditionally include in API requests. By default, fields with empty or 644 // default values are omitted from API requests. See 645 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 646 // details. 647 ForceSendFields []string `json:"-"` 648 // NullFields is a list of field names (e.g. "ObjectLocation") to include in 649 // API requests with the JSON null value. By default, fields with empty values 650 // are omitted from API requests. See 651 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 652 NullFields []string `json:"-"` 653 } 654 655 func (s *DiffDownloadResponse) MarshalJSON() ([]byte, error) { 656 type NoMethod DiffDownloadResponse 657 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 658 } 659 660 // DiffUploadRequest: # gdata.* are outside protos with mising documentation 661 type DiffUploadRequest struct { 662 // ChecksumsInfo: # gdata.* are outside protos with mising documentation 663 ChecksumsInfo *CompositeMedia `json:"checksumsInfo,omitempty"` 664 // ObjectInfo: # gdata.* are outside protos with mising documentation 665 ObjectInfo *CompositeMedia `json:"objectInfo,omitempty"` 666 // ObjectVersion: # gdata.* are outside protos with mising documentation 667 ObjectVersion string `json:"objectVersion,omitempty"` 668 // ForceSendFields is a list of field names (e.g. "ChecksumsInfo") to 669 // unconditionally include in API requests. By default, fields with empty or 670 // default values are omitted from API requests. See 671 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 672 // details. 673 ForceSendFields []string `json:"-"` 674 // NullFields is a list of field names (e.g. "ChecksumsInfo") to include in API 675 // requests with the JSON null value. By default, fields with empty values are 676 // omitted from API requests. See 677 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 678 NullFields []string `json:"-"` 679 } 680 681 func (s *DiffUploadRequest) MarshalJSON() ([]byte, error) { 682 type NoMethod DiffUploadRequest 683 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 684 } 685 686 // DiffUploadResponse: # gdata.* are outside protos with mising documentation 687 type DiffUploadResponse struct { 688 // ObjectVersion: # gdata.* are outside protos with mising documentation 689 ObjectVersion string `json:"objectVersion,omitempty"` 690 // OriginalObject: # gdata.* are outside protos with mising documentation 691 OriginalObject *CompositeMedia `json:"originalObject,omitempty"` 692 // ForceSendFields is a list of field names (e.g. "ObjectVersion") to 693 // unconditionally include in API requests. By default, fields with empty or 694 // default values are omitted from API requests. See 695 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 696 // details. 697 ForceSendFields []string `json:"-"` 698 // NullFields is a list of field names (e.g. "ObjectVersion") to include in API 699 // requests with the JSON null value. By default, fields with empty values are 700 // omitted from API requests. See 701 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 702 NullFields []string `json:"-"` 703 } 704 705 func (s *DiffUploadResponse) MarshalJSON() ([]byte, error) { 706 type NoMethod DiffUploadResponse 707 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 708 } 709 710 // DiffVersionResponse: # gdata.* are outside protos with mising documentation 711 type DiffVersionResponse struct { 712 // ObjectSizeBytes: # gdata.* are outside protos with mising documentation 713 ObjectSizeBytes int64 `json:"objectSizeBytes,omitempty,string"` 714 // ObjectVersion: # gdata.* are outside protos with mising documentation 715 ObjectVersion string `json:"objectVersion,omitempty"` 716 // ForceSendFields is a list of field names (e.g. "ObjectSizeBytes") to 717 // unconditionally include in API requests. By default, fields with empty or 718 // default values are omitted from API requests. See 719 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 720 // details. 721 ForceSendFields []string `json:"-"` 722 // NullFields is a list of field names (e.g. "ObjectSizeBytes") to include in 723 // API requests with the JSON null value. By default, fields with empty values 724 // are omitted from API requests. See 725 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 726 NullFields []string `json:"-"` 727 } 728 729 func (s *DiffVersionResponse) MarshalJSON() ([]byte, error) { 730 type NoMethod DiffVersionResponse 731 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 732 } 733 734 // DownloadParameters: # gdata.* are outside protos with mising documentation 735 type DownloadParameters struct { 736 // AllowGzipCompression: # gdata.* are outside protos with mising documentation 737 AllowGzipCompression bool `json:"allowGzipCompression,omitempty"` 738 // IgnoreRange: # gdata.* are outside protos with mising documentation 739 IgnoreRange bool `json:"ignoreRange,omitempty"` 740 // ForceSendFields is a list of field names (e.g. "AllowGzipCompression") to 741 // unconditionally include in API requests. By default, fields with empty or 742 // default values are omitted from API requests. See 743 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 744 // details. 745 ForceSendFields []string `json:"-"` 746 // NullFields is a list of field names (e.g. "AllowGzipCompression") to include 747 // in API requests with the JSON null value. By default, fields with empty 748 // values are omitted from API requests. See 749 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 750 NullFields []string `json:"-"` 751 } 752 753 func (s *DownloadParameters) MarshalJSON() ([]byte, error) { 754 type NoMethod DownloadParameters 755 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 756 } 757 758 // EscalateCaseRequest: The request message for the EscalateCase endpoint. 759 type EscalateCaseRequest struct { 760 // Escalation: The escalation information to be sent with the escalation 761 // request. 762 Escalation *Escalation `json:"escalation,omitempty"` 763 // ForceSendFields is a list of field names (e.g. "Escalation") to 764 // unconditionally include in API requests. By default, fields with empty or 765 // default values are omitted from API requests. See 766 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 767 // details. 768 ForceSendFields []string `json:"-"` 769 // NullFields is a list of field names (e.g. "Escalation") to include in API 770 // requests with the JSON null value. By default, fields with empty values are 771 // omitted from API requests. See 772 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 773 NullFields []string `json:"-"` 774 } 775 776 func (s *EscalateCaseRequest) MarshalJSON() ([]byte, error) { 777 type NoMethod EscalateCaseRequest 778 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 779 } 780 781 // Escalation: An escalation of a support case. 782 type Escalation struct { 783 // Justification: Required. A free text description to accompany the `reason` 784 // field above. Provides additional context on why the case is being escalated. 785 Justification string `json:"justification,omitempty"` 786 // Reason: Required. The reason why the Case is being escalated. 787 // 788 // Possible values: 789 // "REASON_UNSPECIFIED" - The escalation reason is in an unknown state or has 790 // not been specified. 791 // "RESOLUTION_TIME" - The case is taking too long to resolve. 792 // "TECHNICAL_EXPERTISE" - The support agent does not have the expertise 793 // required to successfully resolve the issue. 794 // "BUSINESS_IMPACT" - The issue is having a significant business impact. 795 Reason string `json:"reason,omitempty"` 796 // ForceSendFields is a list of field names (e.g. "Justification") to 797 // unconditionally include in API requests. By default, fields with empty or 798 // default values are omitted from API requests. See 799 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 800 // details. 801 ForceSendFields []string `json:"-"` 802 // NullFields is a list of field names (e.g. "Justification") to include in API 803 // requests with the JSON null value. By default, fields with empty values are 804 // omitted from API requests. See 805 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 806 NullFields []string `json:"-"` 807 } 808 809 func (s *Escalation) MarshalJSON() ([]byte, error) { 810 type NoMethod Escalation 811 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 812 } 813 814 // ListAttachmentsResponse: The response message for the ListAttachments 815 // endpoint. 816 type ListAttachmentsResponse struct { 817 // Attachments: The list of attachments associated with a case. 818 Attachments []*Attachment `json:"attachments,omitempty"` 819 // NextPageToken: A token to retrieve the next page of results. Set this in the 820 // `page_token` field of subsequent `cases.attachments.list` requests. If 821 // unspecified, there are no more results to retrieve. 822 NextPageToken string `json:"nextPageToken,omitempty"` 823 824 // ServerResponse contains the HTTP response code and headers from the server. 825 googleapi.ServerResponse `json:"-"` 826 // ForceSendFields is a list of field names (e.g. "Attachments") to 827 // unconditionally include in API requests. By default, fields with empty or 828 // default values are omitted from API requests. See 829 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 830 // details. 831 ForceSendFields []string `json:"-"` 832 // NullFields is a list of field names (e.g. "Attachments") to include in API 833 // requests with the JSON null value. By default, fields with empty values are 834 // omitted from API requests. See 835 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 836 NullFields []string `json:"-"` 837 } 838 839 func (s *ListAttachmentsResponse) MarshalJSON() ([]byte, error) { 840 type NoMethod ListAttachmentsResponse 841 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 842 } 843 844 // ListCasesResponse: The response message for the ListCases endpoint. 845 type ListCasesResponse struct { 846 // Cases: The list of cases associated with the parent after any filters have 847 // been applied. 848 Cases []*Case `json:"cases,omitempty"` 849 // NextPageToken: A token to retrieve the next page of results. Set this in the 850 // `page_token` field of subsequent `cases.list` requests. If unspecified, 851 // there are no more results to retrieve. 852 NextPageToken string `json:"nextPageToken,omitempty"` 853 854 // ServerResponse contains the HTTP response code and headers from the server. 855 googleapi.ServerResponse `json:"-"` 856 // ForceSendFields is a list of field names (e.g. "Cases") to unconditionally 857 // include in API requests. By default, fields with empty or default values are 858 // omitted from API requests. See 859 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 860 // details. 861 ForceSendFields []string `json:"-"` 862 // NullFields is a list of field names (e.g. "Cases") to include in API 863 // requests with the JSON null value. By default, fields with empty values are 864 // omitted from API requests. See 865 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 866 NullFields []string `json:"-"` 867 } 868 869 func (s *ListCasesResponse) MarshalJSON() ([]byte, error) { 870 type NoMethod ListCasesResponse 871 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 872 } 873 874 // ListCommentsResponse: The response message for the ListComments endpoint. 875 type ListCommentsResponse struct { 876 // Comments: List of the comments associated with the case. 877 Comments []*Comment `json:"comments,omitempty"` 878 // NextPageToken: A token to retrieve the next page of results. Set this in the 879 // `page_token` field of subsequent `cases.comments.list` requests. If 880 // unspecified, there are no more results to retrieve. 881 NextPageToken string `json:"nextPageToken,omitempty"` 882 883 // ServerResponse contains the HTTP response code and headers from the server. 884 googleapi.ServerResponse `json:"-"` 885 // ForceSendFields is a list of field names (e.g. "Comments") to 886 // unconditionally include in API requests. By default, fields with empty or 887 // default values are omitted from API requests. See 888 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 889 // details. 890 ForceSendFields []string `json:"-"` 891 // NullFields is a list of field names (e.g. "Comments") to include in API 892 // requests with the JSON null value. By default, fields with empty values are 893 // omitted from API requests. See 894 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 895 NullFields []string `json:"-"` 896 } 897 898 func (s *ListCommentsResponse) MarshalJSON() ([]byte, error) { 899 type NoMethod ListCommentsResponse 900 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 901 } 902 903 // Media: # gdata.* are outside protos with mising documentation 904 type Media struct { 905 // Algorithm: # gdata.* are outside protos with mising documentation 906 Algorithm string `json:"algorithm,omitempty"` 907 // BigstoreObjectRef: # gdata.* are outside protos with mising documentation 908 BigstoreObjectRef string `json:"bigstoreObjectRef,omitempty"` 909 // BlobRef: # gdata.* are outside protos with mising documentation 910 BlobRef string `json:"blobRef,omitempty"` 911 // Blobstore2Info: # gdata.* are outside protos with mising documentation 912 Blobstore2Info *Blobstore2Info `json:"blobstore2Info,omitempty"` 913 // CompositeMedia: # gdata.* are outside protos with mising documentation 914 CompositeMedia []*CompositeMedia `json:"compositeMedia,omitempty"` 915 // ContentType: # gdata.* are outside protos with mising documentation 916 ContentType string `json:"contentType,omitempty"` 917 // ContentTypeInfo: # gdata.* are outside protos with mising documentation 918 ContentTypeInfo *ContentTypeInfo `json:"contentTypeInfo,omitempty"` 919 // CosmoBinaryReference: # gdata.* are outside protos with mising documentation 920 CosmoBinaryReference string `json:"cosmoBinaryReference,omitempty"` 921 // Crc32cHash: # gdata.* are outside protos with mising documentation 922 Crc32cHash int64 `json:"crc32cHash,omitempty"` 923 // DiffChecksumsResponse: # gdata.* are outside protos with mising 924 // documentation 925 DiffChecksumsResponse *DiffChecksumsResponse `json:"diffChecksumsResponse,omitempty"` 926 // DiffDownloadResponse: # gdata.* are outside protos with mising documentation 927 DiffDownloadResponse *DiffDownloadResponse `json:"diffDownloadResponse,omitempty"` 928 // DiffUploadRequest: # gdata.* are outside protos with mising documentation 929 DiffUploadRequest *DiffUploadRequest `json:"diffUploadRequest,omitempty"` 930 // DiffUploadResponse: # gdata.* are outside protos with mising documentation 931 DiffUploadResponse *DiffUploadResponse `json:"diffUploadResponse,omitempty"` 932 // DiffVersionResponse: # gdata.* are outside protos with mising documentation 933 DiffVersionResponse *DiffVersionResponse `json:"diffVersionResponse,omitempty"` 934 // DownloadParameters: # gdata.* are outside protos with mising documentation 935 DownloadParameters *DownloadParameters `json:"downloadParameters,omitempty"` 936 // Filename: # gdata.* are outside protos with mising documentation 937 Filename string `json:"filename,omitempty"` 938 // Hash: # gdata.* are outside protos with mising documentation 939 Hash string `json:"hash,omitempty"` 940 // HashVerified: # gdata.* are outside protos with mising documentation 941 HashVerified bool `json:"hashVerified,omitempty"` 942 // Inline: # gdata.* are outside protos with mising documentation 943 Inline string `json:"inline,omitempty"` 944 // IsPotentialRetry: # gdata.* are outside protos with mising documentation 945 IsPotentialRetry bool `json:"isPotentialRetry,omitempty"` 946 // Length: # gdata.* are outside protos with mising documentation 947 Length int64 `json:"length,omitempty,string"` 948 // Md5Hash: # gdata.* are outside protos with mising documentation 949 Md5Hash string `json:"md5Hash,omitempty"` 950 // MediaId: # gdata.* are outside protos with mising documentation 951 MediaId string `json:"mediaId,omitempty"` 952 // ObjectId: # gdata.* are outside protos with mising documentation 953 ObjectId *ObjectId `json:"objectId,omitempty"` 954 // Path: # gdata.* are outside protos with mising documentation 955 Path string `json:"path,omitempty"` 956 // ReferenceType: # gdata.* are outside protos with mising documentation 957 // 958 // Possible values: 959 // "PATH" - # gdata.* are outside protos with mising documentation 960 // "BLOB_REF" - # gdata.* are outside protos with mising documentation 961 // "INLINE" - # gdata.* are outside protos with mising documentation 962 // "GET_MEDIA" - # gdata.* are outside protos with mising documentation 963 // "COMPOSITE_MEDIA" - # gdata.* are outside protos with mising documentation 964 // "BIGSTORE_REF" - # gdata.* are outside protos with mising documentation 965 // "DIFF_VERSION_RESPONSE" - # gdata.* are outside protos with mising 966 // documentation 967 // "DIFF_CHECKSUMS_RESPONSE" - # gdata.* are outside protos with mising 968 // documentation 969 // "DIFF_DOWNLOAD_RESPONSE" - # gdata.* are outside protos with mising 970 // documentation 971 // "DIFF_UPLOAD_REQUEST" - # gdata.* are outside protos with mising 972 // documentation 973 // "DIFF_UPLOAD_RESPONSE" - # gdata.* are outside protos with mising 974 // documentation 975 // "COSMO_BINARY_REFERENCE" - # gdata.* are outside protos with mising 976 // documentation 977 // "ARBITRARY_BYTES" - # gdata.* are outside protos with mising documentation 978 ReferenceType string `json:"referenceType,omitempty"` 979 // Sha1Hash: # gdata.* are outside protos with mising documentation 980 Sha1Hash string `json:"sha1Hash,omitempty"` 981 // Sha256Hash: # gdata.* are outside protos with mising documentation 982 Sha256Hash string `json:"sha256Hash,omitempty"` 983 // Timestamp: # gdata.* are outside protos with mising documentation 984 Timestamp uint64 `json:"timestamp,omitempty,string"` 985 // Token: # gdata.* are outside protos with mising documentation 986 Token string `json:"token,omitempty"` 987 988 // ServerResponse contains the HTTP response code and headers from the server. 989 googleapi.ServerResponse `json:"-"` 990 // ForceSendFields is a list of field names (e.g. "Algorithm") to 991 // unconditionally include in API requests. By default, fields with empty or 992 // default values are omitted from API requests. See 993 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 994 // details. 995 ForceSendFields []string `json:"-"` 996 // NullFields is a list of field names (e.g. "Algorithm") to include in API 997 // requests with the JSON null value. By default, fields with empty values are 998 // omitted from API requests. See 999 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1000 NullFields []string `json:"-"` 1001 } 1002 1003 func (s *Media) MarshalJSON() ([]byte, error) { 1004 type NoMethod Media 1005 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1006 } 1007 1008 // ObjectId: # gdata.* are outside protos with mising documentation 1009 type ObjectId struct { 1010 // BucketName: # gdata.* are outside protos with mising documentation 1011 BucketName string `json:"bucketName,omitempty"` 1012 // Generation: # gdata.* are outside protos with mising documentation 1013 Generation int64 `json:"generation,omitempty,string"` 1014 // ObjectName: # gdata.* are outside protos with mising documentation 1015 ObjectName string `json:"objectName,omitempty"` 1016 // ForceSendFields is a list of field names (e.g. "BucketName") to 1017 // unconditionally include in API requests. By default, fields with empty or 1018 // default values are omitted from API requests. See 1019 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1020 // details. 1021 ForceSendFields []string `json:"-"` 1022 // NullFields is a list of field names (e.g. "BucketName") to include in API 1023 // requests with the JSON null value. By default, fields with empty values are 1024 // omitted from API requests. See 1025 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1026 NullFields []string `json:"-"` 1027 } 1028 1029 func (s *ObjectId) MarshalJSON() ([]byte, error) { 1030 type NoMethod ObjectId 1031 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1032 } 1033 1034 // SearchCaseClassificationsResponse: The response message for 1035 // SearchCaseClassifications endpoint. 1036 type SearchCaseClassificationsResponse struct { 1037 // CaseClassifications: The classifications retrieved. 1038 CaseClassifications []*CaseClassification `json:"caseClassifications,omitempty"` 1039 // NextPageToken: A token to retrieve the next page of results. Set this in the 1040 // `page_token` field of subsequent `caseClassifications.list` requests. If 1041 // unspecified, there are no more results to retrieve. 1042 NextPageToken string `json:"nextPageToken,omitempty"` 1043 1044 // ServerResponse contains the HTTP response code and headers from the server. 1045 googleapi.ServerResponse `json:"-"` 1046 // ForceSendFields is a list of field names (e.g. "CaseClassifications") to 1047 // unconditionally include in API requests. By default, fields with empty or 1048 // default values are omitted from API requests. See 1049 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1050 // details. 1051 ForceSendFields []string `json:"-"` 1052 // NullFields is a list of field names (e.g. "CaseClassifications") to include 1053 // in API requests with the JSON null value. By default, fields with empty 1054 // values are omitted from API requests. See 1055 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1056 NullFields []string `json:"-"` 1057 } 1058 1059 func (s *SearchCaseClassificationsResponse) MarshalJSON() ([]byte, error) { 1060 type NoMethod SearchCaseClassificationsResponse 1061 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1062 } 1063 1064 // SearchCasesResponse: The response message for the SearchCases endpoint. 1065 type SearchCasesResponse struct { 1066 // Cases: The list of cases associated with the parent after any filters have 1067 // been applied. 1068 Cases []*Case `json:"cases,omitempty"` 1069 // NextPageToken: A token to retrieve the next page of results. Set this in the 1070 // `page_token` field of subsequent `cases.search` requests. If unspecified, 1071 // there are no more results to retrieve. 1072 NextPageToken string `json:"nextPageToken,omitempty"` 1073 1074 // ServerResponse contains the HTTP response code and headers from the server. 1075 googleapi.ServerResponse `json:"-"` 1076 // ForceSendFields is a list of field names (e.g. "Cases") to unconditionally 1077 // include in API requests. By default, fields with empty or default values are 1078 // omitted from API requests. See 1079 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1080 // details. 1081 ForceSendFields []string `json:"-"` 1082 // NullFields is a list of field names (e.g. "Cases") to include in API 1083 // requests with the JSON null value. By default, fields with empty values are 1084 // omitted from API requests. See 1085 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1086 NullFields []string `json:"-"` 1087 } 1088 1089 func (s *SearchCasesResponse) MarshalJSON() ([]byte, error) { 1090 type NoMethod SearchCasesResponse 1091 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1092 } 1093 1094 // WorkflowOperationMetadata: Metadata about the operation. Used to lookup the 1095 // current status. 1096 type WorkflowOperationMetadata struct { 1097 // Namespace: The namespace that the job was scheduled in. Must be included in 1098 // the workflow metadata so the workflow status can be retrieved. 1099 Namespace string `json:"namespace,omitempty"` 1100 // OperationAction: The type of action the operation is classified as. 1101 // 1102 // Possible values: 1103 // "OPERATION_ACTION_UNSPECIFIED" - Operation action is not specified. 1104 // "CREATE_SUPPORT_ACCOUNT" - Operation pertains to the creation of a new 1105 // support account. 1106 // "UPDATE_SUPPORT_ACCOUNT" - Operation pertains to the updating of an 1107 // existing support account. 1108 // "PURCHASE_SUPPORT_ACCOUNT" - Operation pertains to the purchasing of a 1109 // support plan that may either create or update a support account. 1110 OperationAction string `json:"operationAction,omitempty"` 1111 // WorkflowOperationType: Which version of the workflow service this operation 1112 // came from. 1113 // 1114 // Possible values: 1115 // "UNKNOWN_OPERATION_TYPE" - Unknown version. 1116 // "WORKFLOWS_V1" - Version 1. 1117 // "WORKFLOWS_V2" - Version 2. 1118 WorkflowOperationType string `json:"workflowOperationType,omitempty"` 1119 // ForceSendFields is a list of field names (e.g. "Namespace") to 1120 // unconditionally include in API requests. By default, fields with empty or 1121 // default values are omitted from API requests. See 1122 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1123 // details. 1124 ForceSendFields []string `json:"-"` 1125 // NullFields is a list of field names (e.g. "Namespace") to include in API 1126 // requests with the JSON null value. By default, fields with empty values are 1127 // omitted from API requests. See 1128 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1129 NullFields []string `json:"-"` 1130 } 1131 1132 func (s *WorkflowOperationMetadata) MarshalJSON() ([]byte, error) { 1133 type NoMethod WorkflowOperationMetadata 1134 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1135 } 1136 1137 type CaseClassificationsSearchCall struct { 1138 s *Service 1139 urlParams_ gensupport.URLParams 1140 ifNoneMatch_ string 1141 ctx_ context.Context 1142 header_ http.Header 1143 } 1144 1145 // Search: Retrieve valid classifications to use when creating a support case. 1146 // Classifications are hierarchical. Each classification is a string containing 1147 // all levels of the hierarchy separated by " > ". For example, "Technical 1148 // Issue > Compute > Compute Engine". Classification IDs returned by this 1149 // endpoint are valid for at least six months. When a classification is 1150 // deactivated, this endpoint immediately stops returning it. After six months, 1151 // `case.create` requests using the classification will fail. EXAMPLES: cURL: 1152 // ```shell curl \ --header "Authorization: Bearer $(gcloud auth 1153 // print-access-token)" \ 1154 // 'https://cloudsupport.googleapis.com/v2/caseClassifications:search?query=disp 1155 // lay_name:"*Compute%20Engine*"' ``` Python: ```python import 1156 // googleapiclient.discovery supportApiService = 1157 // googleapiclient.discovery.build( serviceName="cloudsupport", version="v2", 1158 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 1159 // sion=v2", ) request = supportApiService.caseClassifications().search( 1160 // query='display_name:"*Compute Engine*"' ) print(request.execute()) ``` 1161 func (r *CaseClassificationsService) Search() *CaseClassificationsSearchCall { 1162 c := &CaseClassificationsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1163 return c 1164 } 1165 1166 // PageSize sets the optional parameter "pageSize": The maximum number of 1167 // classifications fetched with each request. 1168 func (c *CaseClassificationsSearchCall) PageSize(pageSize int64) *CaseClassificationsSearchCall { 1169 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1170 return c 1171 } 1172 1173 // PageToken sets the optional parameter "pageToken": A token identifying the 1174 // page of results to return. If unspecified, the first page is retrieved. 1175 func (c *CaseClassificationsSearchCall) PageToken(pageToken string) *CaseClassificationsSearchCall { 1176 c.urlParams_.Set("pageToken", pageToken) 1177 return c 1178 } 1179 1180 // Query sets the optional parameter "query": An expression used to filter case 1181 // classifications. If it's an empty string, then no filtering happens. 1182 // Otherwise, case classifications will be returned that match the filter. 1183 func (c *CaseClassificationsSearchCall) Query(query string) *CaseClassificationsSearchCall { 1184 c.urlParams_.Set("query", query) 1185 return c 1186 } 1187 1188 // Fields allows partial responses to be retrieved. See 1189 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1190 // details. 1191 func (c *CaseClassificationsSearchCall) Fields(s ...googleapi.Field) *CaseClassificationsSearchCall { 1192 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1193 return c 1194 } 1195 1196 // IfNoneMatch sets an optional parameter which makes the operation fail if the 1197 // object's ETag matches the given value. This is useful for getting updates 1198 // only after the object has changed since the last request. 1199 func (c *CaseClassificationsSearchCall) IfNoneMatch(entityTag string) *CaseClassificationsSearchCall { 1200 c.ifNoneMatch_ = entityTag 1201 return c 1202 } 1203 1204 // Context sets the context to be used in this call's Do method. 1205 func (c *CaseClassificationsSearchCall) Context(ctx context.Context) *CaseClassificationsSearchCall { 1206 c.ctx_ = ctx 1207 return c 1208 } 1209 1210 // Header returns a http.Header that can be modified by the caller to add 1211 // headers to the request. 1212 func (c *CaseClassificationsSearchCall) Header() http.Header { 1213 if c.header_ == nil { 1214 c.header_ = make(http.Header) 1215 } 1216 return c.header_ 1217 } 1218 1219 func (c *CaseClassificationsSearchCall) doRequest(alt string) (*http.Response, error) { 1220 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 1221 if c.ifNoneMatch_ != "" { 1222 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1223 } 1224 var body io.Reader = nil 1225 c.urlParams_.Set("alt", alt) 1226 c.urlParams_.Set("prettyPrint", "false") 1227 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/caseClassifications:search") 1228 urls += "?" + c.urlParams_.Encode() 1229 req, err := http.NewRequest("GET", urls, body) 1230 if err != nil { 1231 return nil, err 1232 } 1233 req.Header = reqHeaders 1234 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1235 } 1236 1237 // Do executes the "cloudsupport.caseClassifications.search" call. 1238 // Any non-2xx status code is an error. Response headers are in either 1239 // *SearchCaseClassificationsResponse.ServerResponse.Header or (if a response 1240 // was returned at all) in error.(*googleapi.Error).Header. Use 1241 // googleapi.IsNotModified to check whether the returned error was because 1242 // http.StatusNotModified was returned. 1243 func (c *CaseClassificationsSearchCall) Do(opts ...googleapi.CallOption) (*SearchCaseClassificationsResponse, error) { 1244 gensupport.SetOptions(c.urlParams_, opts...) 1245 res, err := c.doRequest("json") 1246 if res != nil && res.StatusCode == http.StatusNotModified { 1247 if res.Body != nil { 1248 res.Body.Close() 1249 } 1250 return nil, gensupport.WrapError(&googleapi.Error{ 1251 Code: res.StatusCode, 1252 Header: res.Header, 1253 }) 1254 } 1255 if err != nil { 1256 return nil, err 1257 } 1258 defer googleapi.CloseBody(res) 1259 if err := googleapi.CheckResponse(res); err != nil { 1260 return nil, gensupport.WrapError(err) 1261 } 1262 ret := &SearchCaseClassificationsResponse{ 1263 ServerResponse: googleapi.ServerResponse{ 1264 Header: res.Header, 1265 HTTPStatusCode: res.StatusCode, 1266 }, 1267 } 1268 target := &ret 1269 if err := gensupport.DecodeResponse(target, res); err != nil { 1270 return nil, err 1271 } 1272 return ret, nil 1273 } 1274 1275 // Pages invokes f for each page of results. 1276 // A non-nil error returned from f will halt the iteration. 1277 // The provided context supersedes any context provided to the Context method. 1278 func (c *CaseClassificationsSearchCall) Pages(ctx context.Context, f func(*SearchCaseClassificationsResponse) error) error { 1279 c.ctx_ = ctx 1280 defer c.PageToken(c.urlParams_.Get("pageToken")) 1281 for { 1282 x, err := c.Do() 1283 if err != nil { 1284 return err 1285 } 1286 if err := f(x); err != nil { 1287 return err 1288 } 1289 if x.NextPageToken == "" { 1290 return nil 1291 } 1292 c.PageToken(x.NextPageToken) 1293 } 1294 } 1295 1296 type CasesCloseCall struct { 1297 s *Service 1298 name string 1299 closecaserequest *CloseCaseRequest 1300 urlParams_ gensupport.URLParams 1301 ctx_ context.Context 1302 header_ http.Header 1303 } 1304 1305 // Close: Close a case. EXAMPLES: cURL: ```shell 1306 // case="projects/some-project/cases/43595344" curl \ --request POST \ --header 1307 // "Authorization: Bearer $(gcloud auth print-access-token)" \ 1308 // "https://cloudsupport.googleapis.com/v2/$case:close" ``` Python: ```python 1309 // import googleapiclient.discovery api_version = "v2" supportApiService = 1310 // googleapiclient.discovery.build( serviceName="cloudsupport", 1311 // version=api_version, 1312 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 1313 // sion={api_version}", ) request = supportApiService.cases().close( 1314 // name="projects/some-project/cases/43595344" ) print(request.execute()) ``` 1315 // 1316 // - name: The name of the case to close. 1317 func (r *CasesService) Close(name string, closecaserequest *CloseCaseRequest) *CasesCloseCall { 1318 c := &CasesCloseCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1319 c.name = name 1320 c.closecaserequest = closecaserequest 1321 return c 1322 } 1323 1324 // Fields allows partial responses to be retrieved. See 1325 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1326 // details. 1327 func (c *CasesCloseCall) Fields(s ...googleapi.Field) *CasesCloseCall { 1328 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1329 return c 1330 } 1331 1332 // Context sets the context to be used in this call's Do method. 1333 func (c *CasesCloseCall) Context(ctx context.Context) *CasesCloseCall { 1334 c.ctx_ = ctx 1335 return c 1336 } 1337 1338 // Header returns a http.Header that can be modified by the caller to add 1339 // headers to the request. 1340 func (c *CasesCloseCall) Header() http.Header { 1341 if c.header_ == nil { 1342 c.header_ = make(http.Header) 1343 } 1344 return c.header_ 1345 } 1346 1347 func (c *CasesCloseCall) doRequest(alt string) (*http.Response, error) { 1348 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1349 var body io.Reader = nil 1350 body, err := googleapi.WithoutDataWrapper.JSONReader(c.closecaserequest) 1351 if err != nil { 1352 return nil, err 1353 } 1354 c.urlParams_.Set("alt", alt) 1355 c.urlParams_.Set("prettyPrint", "false") 1356 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:close") 1357 urls += "?" + c.urlParams_.Encode() 1358 req, err := http.NewRequest("POST", urls, body) 1359 if err != nil { 1360 return nil, err 1361 } 1362 req.Header = reqHeaders 1363 googleapi.Expand(req.URL, map[string]string{ 1364 "name": c.name, 1365 }) 1366 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1367 } 1368 1369 // Do executes the "cloudsupport.cases.close" call. 1370 // Any non-2xx status code is an error. Response headers are in either 1371 // *Case.ServerResponse.Header or (if a response was returned at all) in 1372 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1373 // whether the returned error was because http.StatusNotModified was returned. 1374 func (c *CasesCloseCall) Do(opts ...googleapi.CallOption) (*Case, error) { 1375 gensupport.SetOptions(c.urlParams_, opts...) 1376 res, err := c.doRequest("json") 1377 if res != nil && res.StatusCode == http.StatusNotModified { 1378 if res.Body != nil { 1379 res.Body.Close() 1380 } 1381 return nil, gensupport.WrapError(&googleapi.Error{ 1382 Code: res.StatusCode, 1383 Header: res.Header, 1384 }) 1385 } 1386 if err != nil { 1387 return nil, err 1388 } 1389 defer googleapi.CloseBody(res) 1390 if err := googleapi.CheckResponse(res); err != nil { 1391 return nil, gensupport.WrapError(err) 1392 } 1393 ret := &Case{ 1394 ServerResponse: googleapi.ServerResponse{ 1395 Header: res.Header, 1396 HTTPStatusCode: res.StatusCode, 1397 }, 1398 } 1399 target := &ret 1400 if err := gensupport.DecodeResponse(target, res); err != nil { 1401 return nil, err 1402 } 1403 return ret, nil 1404 } 1405 1406 type CasesCreateCall struct { 1407 s *Service 1408 parent string 1409 case_ *Case 1410 urlParams_ gensupport.URLParams 1411 ctx_ context.Context 1412 header_ http.Header 1413 } 1414 1415 // Create: Create a new case and associate it with a parent. It must have the 1416 // following fields set: `display_name`, `description`, `classification`, and 1417 // `priority`. If you're just testing the API and don't want to route your case 1418 // to an agent, set `testCase=true`. EXAMPLES: cURL: ```shell 1419 // parent="projects/some-project" curl \ --request POST \ --header 1420 // "Authorization: Bearer $(gcloud auth print-access-token)" \ --header 1421 // 'Content-Type: application/json' \ --data '{ "display_name": "Test case 1422 // created by me.", "description": "a random test case, feel free to close", 1423 // "classification": { "id": 1424 // "100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN 1425 // 6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8" }, "time_zone": "-07:00", 1426 // "subscriber_email_addresses": [ "foo@domain.com", "bar@domain.com" ], 1427 // "testCase": true, "priority": "P3" }' \ 1428 // "https://cloudsupport.googleapis.com/v2/$parent/cases" ``` Python: ```python 1429 // import googleapiclient.discovery api_version = "v2" supportApiService = 1430 // googleapiclient.discovery.build( serviceName="cloudsupport", 1431 // version=api_version, 1432 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 1433 // sion={api_version}", ) request = supportApiService.cases().create( 1434 // parent="projects/some-project", body={ "displayName": "A Test Case", 1435 // "description": "This is a test case.", "testCase": True, "priority": "P2", 1436 // "classification": { "id": 1437 // "100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN 1438 // 6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8" }, }, ) print(request.execute()) 1439 // ``` 1440 // 1441 // - parent: The name of the parent under which the case should be created. 1442 func (r *CasesService) Create(parent string, case_ *Case) *CasesCreateCall { 1443 c := &CasesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1444 c.parent = parent 1445 c.case_ = case_ 1446 return c 1447 } 1448 1449 // Fields allows partial responses to be retrieved. See 1450 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1451 // details. 1452 func (c *CasesCreateCall) Fields(s ...googleapi.Field) *CasesCreateCall { 1453 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1454 return c 1455 } 1456 1457 // Context sets the context to be used in this call's Do method. 1458 func (c *CasesCreateCall) Context(ctx context.Context) *CasesCreateCall { 1459 c.ctx_ = ctx 1460 return c 1461 } 1462 1463 // Header returns a http.Header that can be modified by the caller to add 1464 // headers to the request. 1465 func (c *CasesCreateCall) Header() http.Header { 1466 if c.header_ == nil { 1467 c.header_ = make(http.Header) 1468 } 1469 return c.header_ 1470 } 1471 1472 func (c *CasesCreateCall) doRequest(alt string) (*http.Response, error) { 1473 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1474 var body io.Reader = nil 1475 body, err := googleapi.WithoutDataWrapper.JSONReader(c.case_) 1476 if err != nil { 1477 return nil, err 1478 } 1479 c.urlParams_.Set("alt", alt) 1480 c.urlParams_.Set("prettyPrint", "false") 1481 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/cases") 1482 urls += "?" + c.urlParams_.Encode() 1483 req, err := http.NewRequest("POST", urls, body) 1484 if err != nil { 1485 return nil, err 1486 } 1487 req.Header = reqHeaders 1488 googleapi.Expand(req.URL, map[string]string{ 1489 "parent": c.parent, 1490 }) 1491 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1492 } 1493 1494 // Do executes the "cloudsupport.cases.create" call. 1495 // Any non-2xx status code is an error. Response headers are in either 1496 // *Case.ServerResponse.Header or (if a response was returned at all) in 1497 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1498 // whether the returned error was because http.StatusNotModified was returned. 1499 func (c *CasesCreateCall) Do(opts ...googleapi.CallOption) (*Case, error) { 1500 gensupport.SetOptions(c.urlParams_, opts...) 1501 res, err := c.doRequest("json") 1502 if res != nil && res.StatusCode == http.StatusNotModified { 1503 if res.Body != nil { 1504 res.Body.Close() 1505 } 1506 return nil, gensupport.WrapError(&googleapi.Error{ 1507 Code: res.StatusCode, 1508 Header: res.Header, 1509 }) 1510 } 1511 if err != nil { 1512 return nil, err 1513 } 1514 defer googleapi.CloseBody(res) 1515 if err := googleapi.CheckResponse(res); err != nil { 1516 return nil, gensupport.WrapError(err) 1517 } 1518 ret := &Case{ 1519 ServerResponse: googleapi.ServerResponse{ 1520 Header: res.Header, 1521 HTTPStatusCode: res.StatusCode, 1522 }, 1523 } 1524 target := &ret 1525 if err := gensupport.DecodeResponse(target, res); err != nil { 1526 return nil, err 1527 } 1528 return ret, nil 1529 } 1530 1531 type CasesEscalateCall struct { 1532 s *Service 1533 name string 1534 escalatecaserequest *EscalateCaseRequest 1535 urlParams_ gensupport.URLParams 1536 ctx_ context.Context 1537 header_ http.Header 1538 } 1539 1540 // Escalate: Escalate a case, starting the Google Cloud Support escalation 1541 // management process. This operation is only available for some support 1542 // services. Go to https://cloud.google.com/support and look for 'Technical 1543 // support escalations' in the feature list to find out which ones let you do 1544 // that. EXAMPLES: cURL: ```shell case="projects/some-project/cases/43595344" 1545 // curl \ --request POST \ --header "Authorization: Bearer $(gcloud auth 1546 // print-access-token)" \ --header "Content-Type: application/json" \ --data '{ 1547 // "escalation": { "reason": "BUSINESS_IMPACT", "justification": "This is a 1548 // test escalation." } }' \ 1549 // "https://cloudsupport.googleapis.com/v2/$case:escalate" ``` Python: 1550 // ```python import googleapiclient.discovery api_version = "v2" 1551 // supportApiService = googleapiclient.discovery.build( 1552 // serviceName="cloudsupport", version=api_version, 1553 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 1554 // sion={api_version}", ) request = supportApiService.cases().escalate( 1555 // name="projects/some-project/cases/43595344", body={ "escalation": { 1556 // "reason": "BUSINESS_IMPACT", "justification": "This is a test escalation.", 1557 // }, }, ) print(request.execute()) ``` 1558 // 1559 // - name: The name of the case to be escalated. 1560 func (r *CasesService) Escalate(name string, escalatecaserequest *EscalateCaseRequest) *CasesEscalateCall { 1561 c := &CasesEscalateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1562 c.name = name 1563 c.escalatecaserequest = escalatecaserequest 1564 return c 1565 } 1566 1567 // Fields allows partial responses to be retrieved. See 1568 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1569 // details. 1570 func (c *CasesEscalateCall) Fields(s ...googleapi.Field) *CasesEscalateCall { 1571 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1572 return c 1573 } 1574 1575 // Context sets the context to be used in this call's Do method. 1576 func (c *CasesEscalateCall) Context(ctx context.Context) *CasesEscalateCall { 1577 c.ctx_ = ctx 1578 return c 1579 } 1580 1581 // Header returns a http.Header that can be modified by the caller to add 1582 // headers to the request. 1583 func (c *CasesEscalateCall) Header() http.Header { 1584 if c.header_ == nil { 1585 c.header_ = make(http.Header) 1586 } 1587 return c.header_ 1588 } 1589 1590 func (c *CasesEscalateCall) doRequest(alt string) (*http.Response, error) { 1591 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1592 var body io.Reader = nil 1593 body, err := googleapi.WithoutDataWrapper.JSONReader(c.escalatecaserequest) 1594 if err != nil { 1595 return nil, err 1596 } 1597 c.urlParams_.Set("alt", alt) 1598 c.urlParams_.Set("prettyPrint", "false") 1599 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:escalate") 1600 urls += "?" + c.urlParams_.Encode() 1601 req, err := http.NewRequest("POST", urls, body) 1602 if err != nil { 1603 return nil, err 1604 } 1605 req.Header = reqHeaders 1606 googleapi.Expand(req.URL, map[string]string{ 1607 "name": c.name, 1608 }) 1609 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1610 } 1611 1612 // Do executes the "cloudsupport.cases.escalate" call. 1613 // Any non-2xx status code is an error. Response headers are in either 1614 // *Case.ServerResponse.Header or (if a response was returned at all) in 1615 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1616 // whether the returned error was because http.StatusNotModified was returned. 1617 func (c *CasesEscalateCall) Do(opts ...googleapi.CallOption) (*Case, error) { 1618 gensupport.SetOptions(c.urlParams_, opts...) 1619 res, err := c.doRequest("json") 1620 if res != nil && res.StatusCode == http.StatusNotModified { 1621 if res.Body != nil { 1622 res.Body.Close() 1623 } 1624 return nil, gensupport.WrapError(&googleapi.Error{ 1625 Code: res.StatusCode, 1626 Header: res.Header, 1627 }) 1628 } 1629 if err != nil { 1630 return nil, err 1631 } 1632 defer googleapi.CloseBody(res) 1633 if err := googleapi.CheckResponse(res); err != nil { 1634 return nil, gensupport.WrapError(err) 1635 } 1636 ret := &Case{ 1637 ServerResponse: googleapi.ServerResponse{ 1638 Header: res.Header, 1639 HTTPStatusCode: res.StatusCode, 1640 }, 1641 } 1642 target := &ret 1643 if err := gensupport.DecodeResponse(target, res); err != nil { 1644 return nil, err 1645 } 1646 return ret, nil 1647 } 1648 1649 type CasesGetCall struct { 1650 s *Service 1651 name string 1652 urlParams_ gensupport.URLParams 1653 ifNoneMatch_ string 1654 ctx_ context.Context 1655 header_ http.Header 1656 } 1657 1658 // Get: Retrieve a case. EXAMPLES: cURL: ```shell 1659 // case="projects/some-project/cases/16033687" curl \ --header "Authorization: 1660 // Bearer $(gcloud auth print-access-token)" \ 1661 // "https://cloudsupport.googleapis.com/v2/$case" ``` Python: ```python import 1662 // googleapiclient.discovery api_version = "v2" supportApiService = 1663 // googleapiclient.discovery.build( serviceName="cloudsupport", 1664 // version=api_version, 1665 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 1666 // sion={api_version}", ) request = supportApiService.cases().get( 1667 // name="projects/some-project/cases/43595344", ) print(request.execute()) ``` 1668 // 1669 // - name: The full name of a case to be retrieved. 1670 func (r *CasesService) Get(name string) *CasesGetCall { 1671 c := &CasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1672 c.name = name 1673 return c 1674 } 1675 1676 // Fields allows partial responses to be retrieved. See 1677 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1678 // details. 1679 func (c *CasesGetCall) Fields(s ...googleapi.Field) *CasesGetCall { 1680 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1681 return c 1682 } 1683 1684 // IfNoneMatch sets an optional parameter which makes the operation fail if the 1685 // object's ETag matches the given value. This is useful for getting updates 1686 // only after the object has changed since the last request. 1687 func (c *CasesGetCall) IfNoneMatch(entityTag string) *CasesGetCall { 1688 c.ifNoneMatch_ = entityTag 1689 return c 1690 } 1691 1692 // Context sets the context to be used in this call's Do method. 1693 func (c *CasesGetCall) Context(ctx context.Context) *CasesGetCall { 1694 c.ctx_ = ctx 1695 return c 1696 } 1697 1698 // Header returns a http.Header that can be modified by the caller to add 1699 // headers to the request. 1700 func (c *CasesGetCall) Header() http.Header { 1701 if c.header_ == nil { 1702 c.header_ = make(http.Header) 1703 } 1704 return c.header_ 1705 } 1706 1707 func (c *CasesGetCall) doRequest(alt string) (*http.Response, error) { 1708 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 1709 if c.ifNoneMatch_ != "" { 1710 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1711 } 1712 var body io.Reader = nil 1713 c.urlParams_.Set("alt", alt) 1714 c.urlParams_.Set("prettyPrint", "false") 1715 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 1716 urls += "?" + c.urlParams_.Encode() 1717 req, err := http.NewRequest("GET", urls, body) 1718 if err != nil { 1719 return nil, err 1720 } 1721 req.Header = reqHeaders 1722 googleapi.Expand(req.URL, map[string]string{ 1723 "name": c.name, 1724 }) 1725 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1726 } 1727 1728 // Do executes the "cloudsupport.cases.get" call. 1729 // Any non-2xx status code is an error. Response headers are in either 1730 // *Case.ServerResponse.Header or (if a response was returned at all) in 1731 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1732 // whether the returned error was because http.StatusNotModified was returned. 1733 func (c *CasesGetCall) Do(opts ...googleapi.CallOption) (*Case, error) { 1734 gensupport.SetOptions(c.urlParams_, opts...) 1735 res, err := c.doRequest("json") 1736 if res != nil && res.StatusCode == http.StatusNotModified { 1737 if res.Body != nil { 1738 res.Body.Close() 1739 } 1740 return nil, gensupport.WrapError(&googleapi.Error{ 1741 Code: res.StatusCode, 1742 Header: res.Header, 1743 }) 1744 } 1745 if err != nil { 1746 return nil, err 1747 } 1748 defer googleapi.CloseBody(res) 1749 if err := googleapi.CheckResponse(res); err != nil { 1750 return nil, gensupport.WrapError(err) 1751 } 1752 ret := &Case{ 1753 ServerResponse: googleapi.ServerResponse{ 1754 Header: res.Header, 1755 HTTPStatusCode: res.StatusCode, 1756 }, 1757 } 1758 target := &ret 1759 if err := gensupport.DecodeResponse(target, res); err != nil { 1760 return nil, err 1761 } 1762 return ret, nil 1763 } 1764 1765 type CasesListCall struct { 1766 s *Service 1767 parent string 1768 urlParams_ gensupport.URLParams 1769 ifNoneMatch_ string 1770 ctx_ context.Context 1771 header_ http.Header 1772 } 1773 1774 // List: Retrieve all cases under a parent, but not its children. For example, 1775 // listing cases under an organization only returns the cases that are directly 1776 // parented by that organization. To retrieve cases under an organization and 1777 // its projects, use `cases.search`. EXAMPLES: cURL: ```shell 1778 // parent="projects/some-project" curl \ --header "Authorization: Bearer 1779 // $(gcloud auth print-access-token)" \ 1780 // "https://cloudsupport.googleapis.com/v2/$parent/cases" ``` Python: ```python 1781 // import googleapiclient.discovery api_version = "v2" supportApiService = 1782 // googleapiclient.discovery.build( serviceName="cloudsupport", 1783 // version=api_version, 1784 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 1785 // sion={api_version}", ) request = 1786 // supportApiService.cases().list(parent="projects/some-project") 1787 // print(request.execute()) ``` 1788 // 1789 // - parent: The name of a parent to list cases under. 1790 func (r *CasesService) List(parent string) *CasesListCall { 1791 c := &CasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1792 c.parent = parent 1793 return c 1794 } 1795 1796 // Filter sets the optional parameter "filter": An expression used to filter 1797 // cases. If it's an empty string, then no filtering happens. Otherwise, the 1798 // endpoint returns the cases that match the filter. Expressions use the 1799 // following fields separated by `AND` and specified with `=`: - `state`: Can 1800 // be `OPEN` or `CLOSED`. - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. 1801 // You can specify multiple values for priority using the `OR` operator. For 1802 // example, `priority=P1 OR priority=P2`. - `creator.email`: The email address 1803 // of the case creator. EXAMPLES: - `state=CLOSED` - `state=OPEN AND 1804 // creator.email="tester@example.com" - `state=OPEN AND (priority=P0 OR 1805 // priority=P1)` 1806 func (c *CasesListCall) Filter(filter string) *CasesListCall { 1807 c.urlParams_.Set("filter", filter) 1808 return c 1809 } 1810 1811 // PageSize sets the optional parameter "pageSize": The maximum number of cases 1812 // fetched with each request. Defaults to 10. 1813 func (c *CasesListCall) PageSize(pageSize int64) *CasesListCall { 1814 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1815 return c 1816 } 1817 1818 // PageToken sets the optional parameter "pageToken": A token identifying the 1819 // page of results to return. If unspecified, the first page is retrieved. 1820 func (c *CasesListCall) PageToken(pageToken string) *CasesListCall { 1821 c.urlParams_.Set("pageToken", pageToken) 1822 return c 1823 } 1824 1825 // Fields allows partial responses to be retrieved. See 1826 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1827 // details. 1828 func (c *CasesListCall) Fields(s ...googleapi.Field) *CasesListCall { 1829 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1830 return c 1831 } 1832 1833 // IfNoneMatch sets an optional parameter which makes the operation fail if the 1834 // object's ETag matches the given value. This is useful for getting updates 1835 // only after the object has changed since the last request. 1836 func (c *CasesListCall) IfNoneMatch(entityTag string) *CasesListCall { 1837 c.ifNoneMatch_ = entityTag 1838 return c 1839 } 1840 1841 // Context sets the context to be used in this call's Do method. 1842 func (c *CasesListCall) Context(ctx context.Context) *CasesListCall { 1843 c.ctx_ = ctx 1844 return c 1845 } 1846 1847 // Header returns a http.Header that can be modified by the caller to add 1848 // headers to the request. 1849 func (c *CasesListCall) Header() http.Header { 1850 if c.header_ == nil { 1851 c.header_ = make(http.Header) 1852 } 1853 return c.header_ 1854 } 1855 1856 func (c *CasesListCall) doRequest(alt string) (*http.Response, error) { 1857 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 1858 if c.ifNoneMatch_ != "" { 1859 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1860 } 1861 var body io.Reader = nil 1862 c.urlParams_.Set("alt", alt) 1863 c.urlParams_.Set("prettyPrint", "false") 1864 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/cases") 1865 urls += "?" + c.urlParams_.Encode() 1866 req, err := http.NewRequest("GET", urls, body) 1867 if err != nil { 1868 return nil, err 1869 } 1870 req.Header = reqHeaders 1871 googleapi.Expand(req.URL, map[string]string{ 1872 "parent": c.parent, 1873 }) 1874 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1875 } 1876 1877 // Do executes the "cloudsupport.cases.list" call. 1878 // Any non-2xx status code is an error. Response headers are in either 1879 // *ListCasesResponse.ServerResponse.Header or (if a response was returned at 1880 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1881 // check whether the returned error was because http.StatusNotModified was 1882 // returned. 1883 func (c *CasesListCall) Do(opts ...googleapi.CallOption) (*ListCasesResponse, error) { 1884 gensupport.SetOptions(c.urlParams_, opts...) 1885 res, err := c.doRequest("json") 1886 if res != nil && res.StatusCode == http.StatusNotModified { 1887 if res.Body != nil { 1888 res.Body.Close() 1889 } 1890 return nil, gensupport.WrapError(&googleapi.Error{ 1891 Code: res.StatusCode, 1892 Header: res.Header, 1893 }) 1894 } 1895 if err != nil { 1896 return nil, err 1897 } 1898 defer googleapi.CloseBody(res) 1899 if err := googleapi.CheckResponse(res); err != nil { 1900 return nil, gensupport.WrapError(err) 1901 } 1902 ret := &ListCasesResponse{ 1903 ServerResponse: googleapi.ServerResponse{ 1904 Header: res.Header, 1905 HTTPStatusCode: res.StatusCode, 1906 }, 1907 } 1908 target := &ret 1909 if err := gensupport.DecodeResponse(target, res); err != nil { 1910 return nil, err 1911 } 1912 return ret, nil 1913 } 1914 1915 // Pages invokes f for each page of results. 1916 // A non-nil error returned from f will halt the iteration. 1917 // The provided context supersedes any context provided to the Context method. 1918 func (c *CasesListCall) Pages(ctx context.Context, f func(*ListCasesResponse) error) error { 1919 c.ctx_ = ctx 1920 defer c.PageToken(c.urlParams_.Get("pageToken")) 1921 for { 1922 x, err := c.Do() 1923 if err != nil { 1924 return err 1925 } 1926 if err := f(x); err != nil { 1927 return err 1928 } 1929 if x.NextPageToken == "" { 1930 return nil 1931 } 1932 c.PageToken(x.NextPageToken) 1933 } 1934 } 1935 1936 type CasesPatchCall struct { 1937 s *Service 1938 name string 1939 case_ *Case 1940 urlParams_ gensupport.URLParams 1941 ctx_ context.Context 1942 header_ http.Header 1943 } 1944 1945 // Patch: Update a case. Only some fields can be updated. EXAMPLES: cURL: 1946 // ```shell case="projects/some-project/cases/43595344" curl \ --request PATCH 1947 // \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ 1948 // --header "Content-Type: application/json" \ --data '{ "priority": "P1" }' \ 1949 // "https://cloudsupport.googleapis.com/v2/$case?updateMask=priority" ``` 1950 // Python: ```python import googleapiclient.discovery api_version = "v2" 1951 // supportApiService = googleapiclient.discovery.build( 1952 // serviceName="cloudsupport", version=api_version, 1953 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 1954 // sion={api_version}", ) request = supportApiService.cases().patch( 1955 // name="projects/some-project/cases/43112854", body={ "displayName": "This is 1956 // Now a New Title", "priority": "P2", }, ) print(request.execute()) ``` 1957 // 1958 // - name: The resource name for the case. 1959 func (r *CasesService) Patch(name string, case_ *Case) *CasesPatchCall { 1960 c := &CasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1961 c.name = name 1962 c.case_ = case_ 1963 return c 1964 } 1965 1966 // UpdateMask sets the optional parameter "updateMask": A list of attributes of 1967 // the case that should be updated. Supported values are `priority`, 1968 // `display_name`, and `subscriber_email_addresses`. If no fields are 1969 // specified, all supported fields are updated. Be careful - if you do not 1970 // provide a field mask, then you might accidentally clear some fields. For 1971 // example, if you leave the field mask empty and do not provide a value for 1972 // `subscriber_email_addresses`, then `subscriber_email_addresses` is updated 1973 // to empty. 1974 func (c *CasesPatchCall) UpdateMask(updateMask string) *CasesPatchCall { 1975 c.urlParams_.Set("updateMask", updateMask) 1976 return c 1977 } 1978 1979 // Fields allows partial responses to be retrieved. See 1980 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1981 // details. 1982 func (c *CasesPatchCall) Fields(s ...googleapi.Field) *CasesPatchCall { 1983 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1984 return c 1985 } 1986 1987 // Context sets the context to be used in this call's Do method. 1988 func (c *CasesPatchCall) Context(ctx context.Context) *CasesPatchCall { 1989 c.ctx_ = ctx 1990 return c 1991 } 1992 1993 // Header returns a http.Header that can be modified by the caller to add 1994 // headers to the request. 1995 func (c *CasesPatchCall) Header() http.Header { 1996 if c.header_ == nil { 1997 c.header_ = make(http.Header) 1998 } 1999 return c.header_ 2000 } 2001 2002 func (c *CasesPatchCall) doRequest(alt string) (*http.Response, error) { 2003 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2004 var body io.Reader = nil 2005 body, err := googleapi.WithoutDataWrapper.JSONReader(c.case_) 2006 if err != nil { 2007 return nil, err 2008 } 2009 c.urlParams_.Set("alt", alt) 2010 c.urlParams_.Set("prettyPrint", "false") 2011 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 2012 urls += "?" + c.urlParams_.Encode() 2013 req, err := http.NewRequest("PATCH", urls, body) 2014 if err != nil { 2015 return nil, err 2016 } 2017 req.Header = reqHeaders 2018 googleapi.Expand(req.URL, map[string]string{ 2019 "name": c.name, 2020 }) 2021 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2022 } 2023 2024 // Do executes the "cloudsupport.cases.patch" call. 2025 // Any non-2xx status code is an error. Response headers are in either 2026 // *Case.ServerResponse.Header or (if a response was returned at all) in 2027 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2028 // whether the returned error was because http.StatusNotModified was returned. 2029 func (c *CasesPatchCall) Do(opts ...googleapi.CallOption) (*Case, error) { 2030 gensupport.SetOptions(c.urlParams_, opts...) 2031 res, err := c.doRequest("json") 2032 if res != nil && res.StatusCode == http.StatusNotModified { 2033 if res.Body != nil { 2034 res.Body.Close() 2035 } 2036 return nil, gensupport.WrapError(&googleapi.Error{ 2037 Code: res.StatusCode, 2038 Header: res.Header, 2039 }) 2040 } 2041 if err != nil { 2042 return nil, err 2043 } 2044 defer googleapi.CloseBody(res) 2045 if err := googleapi.CheckResponse(res); err != nil { 2046 return nil, gensupport.WrapError(err) 2047 } 2048 ret := &Case{ 2049 ServerResponse: googleapi.ServerResponse{ 2050 Header: res.Header, 2051 HTTPStatusCode: res.StatusCode, 2052 }, 2053 } 2054 target := &ret 2055 if err := gensupport.DecodeResponse(target, res); err != nil { 2056 return nil, err 2057 } 2058 return ret, nil 2059 } 2060 2061 type CasesSearchCall struct { 2062 s *Service 2063 parent string 2064 urlParams_ gensupport.URLParams 2065 ifNoneMatch_ string 2066 ctx_ context.Context 2067 header_ http.Header 2068 } 2069 2070 // Search: Search for cases using a query. EXAMPLES: cURL: ```shell 2071 // parent="projects/some-project" curl \ --header "Authorization: Bearer 2072 // $(gcloud auth print-access-token)" \ 2073 // "https://cloudsupport.googleapis.com/v2/$parent/cases:search" ``` Python: 2074 // ```python import googleapiclient.discovery api_version = "v2" 2075 // supportApiService = googleapiclient.discovery.build( 2076 // serviceName="cloudsupport", version=api_version, 2077 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 2078 // sion={api_version}", ) request = supportApiService.cases().search( 2079 // parent="projects/some-project", query="state=OPEN" ) 2080 // print(request.execute()) ``` 2081 // 2082 // - parent: The name of the parent resource to search for cases under. 2083 func (r *CasesService) Search(parent string) *CasesSearchCall { 2084 c := &CasesSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2085 c.parent = parent 2086 return c 2087 } 2088 2089 // PageSize sets the optional parameter "pageSize": The maximum number of cases 2090 // fetched with each request. The default page size is 10. 2091 func (c *CasesSearchCall) PageSize(pageSize int64) *CasesSearchCall { 2092 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2093 return c 2094 } 2095 2096 // PageToken sets the optional parameter "pageToken": A token identifying the 2097 // page of results to return. If unspecified, the first page is retrieved. 2098 func (c *CasesSearchCall) PageToken(pageToken string) *CasesSearchCall { 2099 c.urlParams_.Set("pageToken", pageToken) 2100 return c 2101 } 2102 2103 // Query sets the optional parameter "query": An expression used to filter 2104 // cases. Expressions use the following fields separated by `AND` and specified 2105 // with `=`: - `organization`: An organization name in the form 2106 // `organizations/`. - `project`: A project name in the form `projects/`. - 2107 // `state`: Can be `OPEN` or `CLOSED`. - `priority`: Can be `P0`, `P1`, `P2`, 2108 // `P3`, or `P4`. You can specify multiple values for priority using the `OR` 2109 // operator. For example, `priority=P1 OR priority=P2`. - `creator.email`: The 2110 // email address of the case creator. You must specify either `organization` or 2111 // `project`. To search across `displayName`, `description`, and comments, use 2112 // a global restriction with no keyword or operator. For example, "my 2113 // search". To search only cases updated after a certain date, use 2114 // `update_time` restricted with that particular date, time, and timezone in 2115 // ISO datetime format. For example, `update_time>"2020-01-01T00:00:00-05:00". 2116 // `update_time` only supports the greater than operator (`>`). Examples: - 2117 // `organization="organizations/123456789" - 2118 // `project="projects/my-project-id" - `project="projects/123456789" - 2119 // `organization="organizations/123456789" AND state=CLOSED` - 2120 // `project="projects/my-project-id" AND creator.email="tester@example.com" - 2121 // `project="projects/my-project-id" AND (priority=P0 OR priority=P1)` 2122 func (c *CasesSearchCall) Query(query string) *CasesSearchCall { 2123 c.urlParams_.Set("query", query) 2124 return c 2125 } 2126 2127 // Fields allows partial responses to be retrieved. See 2128 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2129 // details. 2130 func (c *CasesSearchCall) Fields(s ...googleapi.Field) *CasesSearchCall { 2131 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2132 return c 2133 } 2134 2135 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2136 // object's ETag matches the given value. This is useful for getting updates 2137 // only after the object has changed since the last request. 2138 func (c *CasesSearchCall) IfNoneMatch(entityTag string) *CasesSearchCall { 2139 c.ifNoneMatch_ = entityTag 2140 return c 2141 } 2142 2143 // Context sets the context to be used in this call's Do method. 2144 func (c *CasesSearchCall) Context(ctx context.Context) *CasesSearchCall { 2145 c.ctx_ = ctx 2146 return c 2147 } 2148 2149 // Header returns a http.Header that can be modified by the caller to add 2150 // headers to the request. 2151 func (c *CasesSearchCall) Header() http.Header { 2152 if c.header_ == nil { 2153 c.header_ = make(http.Header) 2154 } 2155 return c.header_ 2156 } 2157 2158 func (c *CasesSearchCall) doRequest(alt string) (*http.Response, error) { 2159 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2160 if c.ifNoneMatch_ != "" { 2161 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2162 } 2163 var body io.Reader = nil 2164 c.urlParams_.Set("alt", alt) 2165 c.urlParams_.Set("prettyPrint", "false") 2166 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/cases:search") 2167 urls += "?" + c.urlParams_.Encode() 2168 req, err := http.NewRequest("GET", urls, body) 2169 if err != nil { 2170 return nil, err 2171 } 2172 req.Header = reqHeaders 2173 googleapi.Expand(req.URL, map[string]string{ 2174 "parent": c.parent, 2175 }) 2176 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2177 } 2178 2179 // Do executes the "cloudsupport.cases.search" call. 2180 // Any non-2xx status code is an error. Response headers are in either 2181 // *SearchCasesResponse.ServerResponse.Header or (if a response was returned at 2182 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2183 // check whether the returned error was because http.StatusNotModified was 2184 // returned. 2185 func (c *CasesSearchCall) Do(opts ...googleapi.CallOption) (*SearchCasesResponse, error) { 2186 gensupport.SetOptions(c.urlParams_, opts...) 2187 res, err := c.doRequest("json") 2188 if res != nil && res.StatusCode == http.StatusNotModified { 2189 if res.Body != nil { 2190 res.Body.Close() 2191 } 2192 return nil, gensupport.WrapError(&googleapi.Error{ 2193 Code: res.StatusCode, 2194 Header: res.Header, 2195 }) 2196 } 2197 if err != nil { 2198 return nil, err 2199 } 2200 defer googleapi.CloseBody(res) 2201 if err := googleapi.CheckResponse(res); err != nil { 2202 return nil, gensupport.WrapError(err) 2203 } 2204 ret := &SearchCasesResponse{ 2205 ServerResponse: googleapi.ServerResponse{ 2206 Header: res.Header, 2207 HTTPStatusCode: res.StatusCode, 2208 }, 2209 } 2210 target := &ret 2211 if err := gensupport.DecodeResponse(target, res); err != nil { 2212 return nil, err 2213 } 2214 return ret, nil 2215 } 2216 2217 // Pages invokes f for each page of results. 2218 // A non-nil error returned from f will halt the iteration. 2219 // The provided context supersedes any context provided to the Context method. 2220 func (c *CasesSearchCall) Pages(ctx context.Context, f func(*SearchCasesResponse) error) error { 2221 c.ctx_ = ctx 2222 defer c.PageToken(c.urlParams_.Get("pageToken")) 2223 for { 2224 x, err := c.Do() 2225 if err != nil { 2226 return err 2227 } 2228 if err := f(x); err != nil { 2229 return err 2230 } 2231 if x.NextPageToken == "" { 2232 return nil 2233 } 2234 c.PageToken(x.NextPageToken) 2235 } 2236 } 2237 2238 type CasesAttachmentsListCall struct { 2239 s *Service 2240 parent string 2241 urlParams_ gensupport.URLParams 2242 ifNoneMatch_ string 2243 ctx_ context.Context 2244 header_ http.Header 2245 } 2246 2247 // List: List all the attachments associated with a support case. EXAMPLES: 2248 // cURL: ```shell case="projects/some-project/cases/23598314" curl \ --header 2249 // "Authorization: Bearer $(gcloud auth print-access-token)" \ 2250 // "https://cloudsupport.googleapis.com/v2/$case/attachments" ``` Python: 2251 // ```python import googleapiclient.discovery api_version = "v2" 2252 // supportApiService = googleapiclient.discovery.build( 2253 // serviceName="cloudsupport", version=api_version, 2254 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 2255 // sion={api_version}", ) request = ( supportApiService.cases() .attachments() 2256 // .list(parent="projects/some-project/cases/43595344") ) 2257 // print(request.execute()) ``` 2258 // 2259 // - parent: The name of the case for which attachments should be listed. 2260 func (r *CasesAttachmentsService) List(parent string) *CasesAttachmentsListCall { 2261 c := &CasesAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2262 c.parent = parent 2263 return c 2264 } 2265 2266 // PageSize sets the optional parameter "pageSize": The maximum number of 2267 // attachments fetched with each request. If not provided, the default is 10. 2268 // The maximum page size that will be returned is 100. 2269 func (c *CasesAttachmentsListCall) PageSize(pageSize int64) *CasesAttachmentsListCall { 2270 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2271 return c 2272 } 2273 2274 // PageToken sets the optional parameter "pageToken": A token identifying the 2275 // page of results to return. If unspecified, the first page is retrieved. 2276 func (c *CasesAttachmentsListCall) PageToken(pageToken string) *CasesAttachmentsListCall { 2277 c.urlParams_.Set("pageToken", pageToken) 2278 return c 2279 } 2280 2281 // Fields allows partial responses to be retrieved. See 2282 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2283 // details. 2284 func (c *CasesAttachmentsListCall) Fields(s ...googleapi.Field) *CasesAttachmentsListCall { 2285 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2286 return c 2287 } 2288 2289 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2290 // object's ETag matches the given value. This is useful for getting updates 2291 // only after the object has changed since the last request. 2292 func (c *CasesAttachmentsListCall) IfNoneMatch(entityTag string) *CasesAttachmentsListCall { 2293 c.ifNoneMatch_ = entityTag 2294 return c 2295 } 2296 2297 // Context sets the context to be used in this call's Do method. 2298 func (c *CasesAttachmentsListCall) Context(ctx context.Context) *CasesAttachmentsListCall { 2299 c.ctx_ = ctx 2300 return c 2301 } 2302 2303 // Header returns a http.Header that can be modified by the caller to add 2304 // headers to the request. 2305 func (c *CasesAttachmentsListCall) Header() http.Header { 2306 if c.header_ == nil { 2307 c.header_ = make(http.Header) 2308 } 2309 return c.header_ 2310 } 2311 2312 func (c *CasesAttachmentsListCall) doRequest(alt string) (*http.Response, error) { 2313 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2314 if c.ifNoneMatch_ != "" { 2315 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2316 } 2317 var body io.Reader = nil 2318 c.urlParams_.Set("alt", alt) 2319 c.urlParams_.Set("prettyPrint", "false") 2320 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/attachments") 2321 urls += "?" + c.urlParams_.Encode() 2322 req, err := http.NewRequest("GET", urls, body) 2323 if err != nil { 2324 return nil, err 2325 } 2326 req.Header = reqHeaders 2327 googleapi.Expand(req.URL, map[string]string{ 2328 "parent": c.parent, 2329 }) 2330 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2331 } 2332 2333 // Do executes the "cloudsupport.cases.attachments.list" call. 2334 // Any non-2xx status code is an error. Response headers are in either 2335 // *ListAttachmentsResponse.ServerResponse.Header or (if a response was 2336 // returned at all) in error.(*googleapi.Error).Header. Use 2337 // googleapi.IsNotModified to check whether the returned error was because 2338 // http.StatusNotModified was returned. 2339 func (c *CasesAttachmentsListCall) Do(opts ...googleapi.CallOption) (*ListAttachmentsResponse, error) { 2340 gensupport.SetOptions(c.urlParams_, opts...) 2341 res, err := c.doRequest("json") 2342 if res != nil && res.StatusCode == http.StatusNotModified { 2343 if res.Body != nil { 2344 res.Body.Close() 2345 } 2346 return nil, gensupport.WrapError(&googleapi.Error{ 2347 Code: res.StatusCode, 2348 Header: res.Header, 2349 }) 2350 } 2351 if err != nil { 2352 return nil, err 2353 } 2354 defer googleapi.CloseBody(res) 2355 if err := googleapi.CheckResponse(res); err != nil { 2356 return nil, gensupport.WrapError(err) 2357 } 2358 ret := &ListAttachmentsResponse{ 2359 ServerResponse: googleapi.ServerResponse{ 2360 Header: res.Header, 2361 HTTPStatusCode: res.StatusCode, 2362 }, 2363 } 2364 target := &ret 2365 if err := gensupport.DecodeResponse(target, res); err != nil { 2366 return nil, err 2367 } 2368 return ret, nil 2369 } 2370 2371 // Pages invokes f for each page of results. 2372 // A non-nil error returned from f will halt the iteration. 2373 // The provided context supersedes any context provided to the Context method. 2374 func (c *CasesAttachmentsListCall) Pages(ctx context.Context, f func(*ListAttachmentsResponse) error) error { 2375 c.ctx_ = ctx 2376 defer c.PageToken(c.urlParams_.Get("pageToken")) 2377 for { 2378 x, err := c.Do() 2379 if err != nil { 2380 return err 2381 } 2382 if err := f(x); err != nil { 2383 return err 2384 } 2385 if x.NextPageToken == "" { 2386 return nil 2387 } 2388 c.PageToken(x.NextPageToken) 2389 } 2390 } 2391 2392 type CasesCommentsCreateCall struct { 2393 s *Service 2394 parent string 2395 comment *Comment 2396 urlParams_ gensupport.URLParams 2397 ctx_ context.Context 2398 header_ http.Header 2399 } 2400 2401 // Create: Add a new comment to a case. The comment must have the following 2402 // fields set: `body`. EXAMPLES: cURL: ```shell 2403 // case="projects/some-project/cases/43591344" curl \ --request POST \ --header 2404 // "Authorization: Bearer $(gcloud auth print-access-token)" \ --header 2405 // 'Content-Type: application/json' \ --data '{ "body": "This is a test 2406 // comment." }' \ "https://cloudsupport.googleapis.com/v2/$case/comments" ``` 2407 // Python: ```python import googleapiclient.discovery api_version = "v2" 2408 // supportApiService = googleapiclient.discovery.build( 2409 // serviceName="cloudsupport", version=api_version, 2410 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 2411 // sion={api_version}", ) request = ( supportApiService.cases() .comments() 2412 // .create( parent="projects/some-project/cases/43595344", body={"body": "This 2413 // is a test comment."}, ) ) print(request.execute()) ``` 2414 // 2415 // - parent: The name of the case to which the comment should be added. 2416 func (r *CasesCommentsService) Create(parent string, comment *Comment) *CasesCommentsCreateCall { 2417 c := &CasesCommentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2418 c.parent = parent 2419 c.comment = comment 2420 return c 2421 } 2422 2423 // Fields allows partial responses to be retrieved. See 2424 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2425 // details. 2426 func (c *CasesCommentsCreateCall) Fields(s ...googleapi.Field) *CasesCommentsCreateCall { 2427 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2428 return c 2429 } 2430 2431 // Context sets the context to be used in this call's Do method. 2432 func (c *CasesCommentsCreateCall) Context(ctx context.Context) *CasesCommentsCreateCall { 2433 c.ctx_ = ctx 2434 return c 2435 } 2436 2437 // Header returns a http.Header that can be modified by the caller to add 2438 // headers to the request. 2439 func (c *CasesCommentsCreateCall) Header() http.Header { 2440 if c.header_ == nil { 2441 c.header_ = make(http.Header) 2442 } 2443 return c.header_ 2444 } 2445 2446 func (c *CasesCommentsCreateCall) doRequest(alt string) (*http.Response, error) { 2447 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2448 var body io.Reader = nil 2449 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) 2450 if err != nil { 2451 return nil, err 2452 } 2453 c.urlParams_.Set("alt", alt) 2454 c.urlParams_.Set("prettyPrint", "false") 2455 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/comments") 2456 urls += "?" + c.urlParams_.Encode() 2457 req, err := http.NewRequest("POST", urls, body) 2458 if err != nil { 2459 return nil, err 2460 } 2461 req.Header = reqHeaders 2462 googleapi.Expand(req.URL, map[string]string{ 2463 "parent": c.parent, 2464 }) 2465 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2466 } 2467 2468 // Do executes the "cloudsupport.cases.comments.create" call. 2469 // Any non-2xx status code is an error. Response headers are in either 2470 // *Comment.ServerResponse.Header or (if a response was returned at all) in 2471 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2472 // whether the returned error was because http.StatusNotModified was returned. 2473 func (c *CasesCommentsCreateCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 2474 gensupport.SetOptions(c.urlParams_, opts...) 2475 res, err := c.doRequest("json") 2476 if res != nil && res.StatusCode == http.StatusNotModified { 2477 if res.Body != nil { 2478 res.Body.Close() 2479 } 2480 return nil, gensupport.WrapError(&googleapi.Error{ 2481 Code: res.StatusCode, 2482 Header: res.Header, 2483 }) 2484 } 2485 if err != nil { 2486 return nil, err 2487 } 2488 defer googleapi.CloseBody(res) 2489 if err := googleapi.CheckResponse(res); err != nil { 2490 return nil, gensupport.WrapError(err) 2491 } 2492 ret := &Comment{ 2493 ServerResponse: googleapi.ServerResponse{ 2494 Header: res.Header, 2495 HTTPStatusCode: res.StatusCode, 2496 }, 2497 } 2498 target := &ret 2499 if err := gensupport.DecodeResponse(target, res); err != nil { 2500 return nil, err 2501 } 2502 return ret, nil 2503 } 2504 2505 type CasesCommentsListCall struct { 2506 s *Service 2507 parent string 2508 urlParams_ gensupport.URLParams 2509 ifNoneMatch_ string 2510 ctx_ context.Context 2511 header_ http.Header 2512 } 2513 2514 // List: List all the comments associated with a case. EXAMPLES: cURL: ```shell 2515 // case="projects/some-project/cases/43595344" curl \ --header "Authorization: 2516 // Bearer $(gcloud auth print-access-token)" \ 2517 // "https://cloudsupport.googleapis.com/v2/$case/comments" ``` Python: 2518 // ```python import googleapiclient.discovery api_version = "v2" 2519 // supportApiService = googleapiclient.discovery.build( 2520 // serviceName="cloudsupport", version=api_version, 2521 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 2522 // sion={api_version}", ) request = ( supportApiService.cases() .comments() 2523 // .list(parent="projects/some-project/cases/43595344") ) 2524 // print(request.execute()) ``` 2525 // 2526 // - parent: The name of the case for which to list comments. 2527 func (r *CasesCommentsService) List(parent string) *CasesCommentsListCall { 2528 c := &CasesCommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2529 c.parent = parent 2530 return c 2531 } 2532 2533 // PageSize sets the optional parameter "pageSize": The maximum number of 2534 // comments to fetch. Defaults to 10. 2535 func (c *CasesCommentsListCall) PageSize(pageSize int64) *CasesCommentsListCall { 2536 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2537 return c 2538 } 2539 2540 // PageToken sets the optional parameter "pageToken": A token identifying the 2541 // page of results to return. If unspecified, the first page is returned. 2542 func (c *CasesCommentsListCall) PageToken(pageToken string) *CasesCommentsListCall { 2543 c.urlParams_.Set("pageToken", pageToken) 2544 return c 2545 } 2546 2547 // Fields allows partial responses to be retrieved. See 2548 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2549 // details. 2550 func (c *CasesCommentsListCall) Fields(s ...googleapi.Field) *CasesCommentsListCall { 2551 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2552 return c 2553 } 2554 2555 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2556 // object's ETag matches the given value. This is useful for getting updates 2557 // only after the object has changed since the last request. 2558 func (c *CasesCommentsListCall) IfNoneMatch(entityTag string) *CasesCommentsListCall { 2559 c.ifNoneMatch_ = entityTag 2560 return c 2561 } 2562 2563 // Context sets the context to be used in this call's Do method. 2564 func (c *CasesCommentsListCall) Context(ctx context.Context) *CasesCommentsListCall { 2565 c.ctx_ = ctx 2566 return c 2567 } 2568 2569 // Header returns a http.Header that can be modified by the caller to add 2570 // headers to the request. 2571 func (c *CasesCommentsListCall) Header() http.Header { 2572 if c.header_ == nil { 2573 c.header_ = make(http.Header) 2574 } 2575 return c.header_ 2576 } 2577 2578 func (c *CasesCommentsListCall) doRequest(alt string) (*http.Response, error) { 2579 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2580 if c.ifNoneMatch_ != "" { 2581 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2582 } 2583 var body io.Reader = nil 2584 c.urlParams_.Set("alt", alt) 2585 c.urlParams_.Set("prettyPrint", "false") 2586 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/comments") 2587 urls += "?" + c.urlParams_.Encode() 2588 req, err := http.NewRequest("GET", urls, body) 2589 if err != nil { 2590 return nil, err 2591 } 2592 req.Header = reqHeaders 2593 googleapi.Expand(req.URL, map[string]string{ 2594 "parent": c.parent, 2595 }) 2596 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2597 } 2598 2599 // Do executes the "cloudsupport.cases.comments.list" call. 2600 // Any non-2xx status code is an error. Response headers are in either 2601 // *ListCommentsResponse.ServerResponse.Header or (if a response was returned 2602 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2603 // check whether the returned error was because http.StatusNotModified was 2604 // returned. 2605 func (c *CasesCommentsListCall) Do(opts ...googleapi.CallOption) (*ListCommentsResponse, error) { 2606 gensupport.SetOptions(c.urlParams_, opts...) 2607 res, err := c.doRequest("json") 2608 if res != nil && res.StatusCode == http.StatusNotModified { 2609 if res.Body != nil { 2610 res.Body.Close() 2611 } 2612 return nil, gensupport.WrapError(&googleapi.Error{ 2613 Code: res.StatusCode, 2614 Header: res.Header, 2615 }) 2616 } 2617 if err != nil { 2618 return nil, err 2619 } 2620 defer googleapi.CloseBody(res) 2621 if err := googleapi.CheckResponse(res); err != nil { 2622 return nil, gensupport.WrapError(err) 2623 } 2624 ret := &ListCommentsResponse{ 2625 ServerResponse: googleapi.ServerResponse{ 2626 Header: res.Header, 2627 HTTPStatusCode: res.StatusCode, 2628 }, 2629 } 2630 target := &ret 2631 if err := gensupport.DecodeResponse(target, res); err != nil { 2632 return nil, err 2633 } 2634 return ret, nil 2635 } 2636 2637 // Pages invokes f for each page of results. 2638 // A non-nil error returned from f will halt the iteration. 2639 // The provided context supersedes any context provided to the Context method. 2640 func (c *CasesCommentsListCall) Pages(ctx context.Context, f func(*ListCommentsResponse) error) error { 2641 c.ctx_ = ctx 2642 defer c.PageToken(c.urlParams_.Get("pageToken")) 2643 for { 2644 x, err := c.Do() 2645 if err != nil { 2646 return err 2647 } 2648 if err := f(x); err != nil { 2649 return err 2650 } 2651 if x.NextPageToken == "" { 2652 return nil 2653 } 2654 c.PageToken(x.NextPageToken) 2655 } 2656 } 2657 2658 type MediaDownloadCall struct { 2659 s *Service 2660 name string 2661 urlParams_ gensupport.URLParams 2662 ifNoneMatch_ string 2663 ctx_ context.Context 2664 header_ http.Header 2665 } 2666 2667 // Download: Download a file attached to a case. Note: HTTP requests must 2668 // append "?alt=media" to the URL. EXAMPLES: cURL: ```shell 2669 // name="projects/some-project/cases/43594844/attachments/0674M00000WijAnZAJ" 2670 // curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ 2671 // "https://cloudsupport.googleapis.com/v2/$name:download?alt=media" ``` 2672 // Python: ```python import googleapiclient.discovery api_version = "v2" 2673 // supportApiService = googleapiclient.discovery.build( 2674 // serviceName="cloudsupport", version=api_version, 2675 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 2676 // sion={api_version}", ) request = supportApiService.media().download( 2677 // name="projects/some-project/cases/43595344/attachments/0684M00000Pw6pHQAR" ) 2678 // request.uri = request.uri.split("?")[0] + "?alt=media" 2679 // print(request.execute()) ``` 2680 // 2681 // - name: The name of the file attachment to download. 2682 func (r *MediaService) Download(name string) *MediaDownloadCall { 2683 c := &MediaDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2684 c.name = name 2685 return c 2686 } 2687 2688 // Fields allows partial responses to be retrieved. See 2689 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2690 // details. 2691 func (c *MediaDownloadCall) Fields(s ...googleapi.Field) *MediaDownloadCall { 2692 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2693 return c 2694 } 2695 2696 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2697 // object's ETag matches the given value. This is useful for getting updates 2698 // only after the object has changed since the last request. 2699 func (c *MediaDownloadCall) IfNoneMatch(entityTag string) *MediaDownloadCall { 2700 c.ifNoneMatch_ = entityTag 2701 return c 2702 } 2703 2704 // Context sets the context to be used in this call's Do and Download methods. 2705 func (c *MediaDownloadCall) Context(ctx context.Context) *MediaDownloadCall { 2706 c.ctx_ = ctx 2707 return c 2708 } 2709 2710 // Header returns a http.Header that can be modified by the caller to add 2711 // headers to the request. 2712 func (c *MediaDownloadCall) Header() http.Header { 2713 if c.header_ == nil { 2714 c.header_ = make(http.Header) 2715 } 2716 return c.header_ 2717 } 2718 2719 func (c *MediaDownloadCall) doRequest(alt string) (*http.Response, error) { 2720 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2721 if c.ifNoneMatch_ != "" { 2722 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2723 } 2724 var body io.Reader = nil 2725 c.urlParams_.Set("alt", alt) 2726 c.urlParams_.Set("prettyPrint", "false") 2727 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:download") 2728 urls += "?" + c.urlParams_.Encode() 2729 req, err := http.NewRequest("GET", urls, body) 2730 if err != nil { 2731 return nil, err 2732 } 2733 req.Header = reqHeaders 2734 googleapi.Expand(req.URL, map[string]string{ 2735 "name": c.name, 2736 }) 2737 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2738 } 2739 2740 // Download fetches the API endpoint's "media" value, instead of the normal 2741 // API response value. If the returned error is nil, the Response is guaranteed to 2742 // have a 2xx status code. Callers must close the Response.Body as usual. 2743 func (c *MediaDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 2744 gensupport.SetOptions(c.urlParams_, opts...) 2745 res, err := c.doRequest("media") 2746 if err != nil { 2747 return nil, err 2748 } 2749 if err := googleapi.CheckResponse(res); err != nil { 2750 res.Body.Close() 2751 return nil, gensupport.WrapError(err) 2752 } 2753 return res, nil 2754 } 2755 2756 // Do executes the "cloudsupport.media.download" call. 2757 // Any non-2xx status code is an error. Response headers are in either 2758 // *Media.ServerResponse.Header or (if a response was returned at all) in 2759 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2760 // whether the returned error was because http.StatusNotModified was returned. 2761 func (c *MediaDownloadCall) Do(opts ...googleapi.CallOption) (*Media, error) { 2762 gensupport.SetOptions(c.urlParams_, opts...) 2763 res, err := c.doRequest("json") 2764 if res != nil && res.StatusCode == http.StatusNotModified { 2765 if res.Body != nil { 2766 res.Body.Close() 2767 } 2768 return nil, gensupport.WrapError(&googleapi.Error{ 2769 Code: res.StatusCode, 2770 Header: res.Header, 2771 }) 2772 } 2773 if err != nil { 2774 return nil, err 2775 } 2776 defer googleapi.CloseBody(res) 2777 if err := googleapi.CheckResponse(res); err != nil { 2778 return nil, gensupport.WrapError(err) 2779 } 2780 ret := &Media{ 2781 ServerResponse: googleapi.ServerResponse{ 2782 Header: res.Header, 2783 HTTPStatusCode: res.StatusCode, 2784 }, 2785 } 2786 target := &ret 2787 if err := gensupport.DecodeResponse(target, res); err != nil { 2788 return nil, err 2789 } 2790 return ret, nil 2791 } 2792 2793 type MediaUploadCall struct { 2794 s *Service 2795 parent string 2796 createattachmentrequest *CreateAttachmentRequest 2797 urlParams_ gensupport.URLParams 2798 mediaInfo_ *gensupport.MediaInfo 2799 ctx_ context.Context 2800 header_ http.Header 2801 } 2802 2803 // Upload: Create a file attachment on a case or Cloud resource. The attachment 2804 // must have the following fields set: `filename`. EXAMPLES: cURL: ```shell 2805 // echo "This text is in a file I'm uploading using CSAPI." \ > 2806 // "./example_file.txt" case="projects/some-project/cases/43594844" curl \ 2807 // --header "Authorization: Bearer $(gcloud auth print-access-token)" \ 2808 // --data-binary @"./example_file.txt" \ 2809 // "https://cloudsupport.googleapis.com/upload/v2beta/$case/attachments?attachme 2810 // nt.filename=uploaded_via_curl.txt" ``` Python: ```python import 2811 // googleapiclient.discovery api_version = "v2" supportApiService = 2812 // googleapiclient.discovery.build( serviceName="cloudsupport", 2813 // version=api_version, 2814 // discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?ver 2815 // sion={api_version}", ) file_path = "./example_file.txt" with open(file_path, 2816 // "w") as file: file.write( "This text is inside a file I'm going to upload 2817 // using the Cloud Support API.", ) request = supportApiService.media().upload( 2818 // parent="projects/some-project/cases/43595344", media_body=file_path ) 2819 // request.uri = request.uri.split("?")[0] + 2820 // "?attachment.filename=uploaded_via_python.txt" print(request.execute()) ``` 2821 // 2822 // - parent: The name of the case or Cloud resource to which the attachment 2823 // should be attached. 2824 func (r *MediaService) Upload(parent string, createattachmentrequest *CreateAttachmentRequest) *MediaUploadCall { 2825 c := &MediaUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2826 c.parent = parent 2827 c.createattachmentrequest = createattachmentrequest 2828 return c 2829 } 2830 2831 // Media specifies the media to upload in one or more chunks. The chunk size 2832 // may be controlled by supplying a MediaOption generated by 2833 // googleapi.ChunkSize. The chunk size defaults to 2834 // googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload 2835 // request will be determined by sniffing the contents of r, unless a 2836 // MediaOption generated by googleapi.ContentType is supplied. 2837 // At most one of Media and ResumableMedia may be set. 2838 func (c *MediaUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *MediaUploadCall { 2839 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) 2840 return c 2841 } 2842 2843 // ResumableMedia specifies the media to upload in chunks and can be canceled 2844 // with ctx. 2845 // 2846 // Deprecated: use Media instead. 2847 // 2848 // At most one of Media and ResumableMedia may be set. mediaType identifies the 2849 // MIME media type of the upload, such as "image/png". If mediaType is "", it 2850 // will be auto-detected. The provided ctx will supersede any context 2851 // previously provided to the Context method. 2852 func (c *MediaUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *MediaUploadCall { 2853 c.ctx_ = ctx 2854 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) 2855 return c 2856 } 2857 2858 // ProgressUpdater provides a callback function that will be called after every 2859 // chunk. It should be a low-latency function in order to not slow down the 2860 // upload operation. This should only be called when using ResumableMedia (as 2861 // opposed to Media). 2862 func (c *MediaUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *MediaUploadCall { 2863 c.mediaInfo_.SetProgressUpdater(pu) 2864 return c 2865 } 2866 2867 // Fields allows partial responses to be retrieved. See 2868 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2869 // details. 2870 func (c *MediaUploadCall) Fields(s ...googleapi.Field) *MediaUploadCall { 2871 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2872 return c 2873 } 2874 2875 // Context sets the context to be used in this call's Do method. 2876 // This context will supersede any context previously provided to the 2877 // ResumableMedia method. 2878 func (c *MediaUploadCall) Context(ctx context.Context) *MediaUploadCall { 2879 c.ctx_ = ctx 2880 return c 2881 } 2882 2883 // Header returns a http.Header that can be modified by the caller to add 2884 // headers to the request. 2885 func (c *MediaUploadCall) Header() http.Header { 2886 if c.header_ == nil { 2887 c.header_ = make(http.Header) 2888 } 2889 return c.header_ 2890 } 2891 2892 func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) { 2893 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2894 var body io.Reader = nil 2895 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createattachmentrequest) 2896 if err != nil { 2897 return nil, err 2898 } 2899 c.urlParams_.Set("alt", alt) 2900 c.urlParams_.Set("prettyPrint", "false") 2901 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/attachments") 2902 if c.mediaInfo_ != nil { 2903 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/v2/{+parent}/attachments") 2904 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) 2905 } 2906 if body == nil { 2907 body = new(bytes.Buffer) 2908 reqHeaders.Set("Content-Type", "application/json") 2909 } 2910 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) 2911 defer cleanup() 2912 urls += "?" + c.urlParams_.Encode() 2913 req, err := http.NewRequest("POST", urls, body) 2914 if err != nil { 2915 return nil, err 2916 } 2917 req.Header = reqHeaders 2918 req.GetBody = getBody 2919 googleapi.Expand(req.URL, map[string]string{ 2920 "parent": c.parent, 2921 }) 2922 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2923 } 2924 2925 // Do executes the "cloudsupport.media.upload" call. 2926 // Any non-2xx status code is an error. Response headers are in either 2927 // *Attachment.ServerResponse.Header or (if a response was returned at all) in 2928 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2929 // whether the returned error was because http.StatusNotModified was returned. 2930 func (c *MediaUploadCall) Do(opts ...googleapi.CallOption) (*Attachment, error) { 2931 gensupport.SetOptions(c.urlParams_, opts...) 2932 res, err := c.doRequest("json") 2933 if res != nil && res.StatusCode == http.StatusNotModified { 2934 if res.Body != nil { 2935 res.Body.Close() 2936 } 2937 return nil, gensupport.WrapError(&googleapi.Error{ 2938 Code: res.StatusCode, 2939 Header: res.Header, 2940 }) 2941 } 2942 if err != nil { 2943 return nil, err 2944 } 2945 defer googleapi.CloseBody(res) 2946 if err := googleapi.CheckResponse(res); err != nil { 2947 return nil, gensupport.WrapError(err) 2948 } 2949 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) 2950 if rx != nil { 2951 rx.Client = c.s.client 2952 rx.UserAgent = c.s.userAgent() 2953 ctx := c.ctx_ 2954 if ctx == nil { 2955 ctx = context.TODO() 2956 } 2957 res, err = rx.Upload(ctx) 2958 if err != nil { 2959 return nil, err 2960 } 2961 defer res.Body.Close() 2962 if err := googleapi.CheckResponse(res); err != nil { 2963 return nil, gensupport.WrapError(err) 2964 } 2965 } 2966 ret := &Attachment{ 2967 ServerResponse: googleapi.ServerResponse{ 2968 Header: res.Header, 2969 HTTPStatusCode: res.StatusCode, 2970 }, 2971 } 2972 target := &ret 2973 if err := gensupport.DecodeResponse(target, res); err != nil { 2974 return nil, err 2975 } 2976 return ret, nil 2977 } 2978