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 transcoder provides access to the Transcoder API. 8 // 9 // For product documentation, see: https://cloud.google.com/transcoder/docs/ 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/transcoder/v1" 27 // ... 28 // ctx := context.Background() 29 // transcoderService, err := transcoder.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 // transcoderService, err := transcoder.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 // transcoderService, err := transcoder.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 49 // 50 // See [google.golang.org/api/option.ClientOption] for details on options. 51 package transcoder // import "google.golang.org/api/transcoder/v1" 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 = "transcoder:v1" 90 const apiName = "transcoder" 91 const apiVersion = "v1" 92 const basePath = "https://transcoder.googleapis.com/" 93 const basePathTemplate = "https://transcoder.UNIVERSE_DOMAIN/" 94 const mtlsBasePath = "https://transcoder.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.Projects = NewProjectsService(s) 139 return s, nil 140 } 141 142 type Service struct { 143 client *http.Client 144 BasePath string // API endpoint base URL 145 UserAgent string // optional additional User-Agent fragment 146 147 Projects *ProjectsService 148 } 149 150 func (s *Service) userAgent() string { 151 if s.UserAgent == "" { 152 return googleapi.UserAgent 153 } 154 return googleapi.UserAgent + " " + s.UserAgent 155 } 156 157 func NewProjectsService(s *Service) *ProjectsService { 158 rs := &ProjectsService{s: s} 159 rs.Locations = NewProjectsLocationsService(s) 160 return rs 161 } 162 163 type ProjectsService struct { 164 s *Service 165 166 Locations *ProjectsLocationsService 167 } 168 169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 170 rs := &ProjectsLocationsService{s: s} 171 rs.JobTemplates = NewProjectsLocationsJobTemplatesService(s) 172 rs.Jobs = NewProjectsLocationsJobsService(s) 173 return rs 174 } 175 176 type ProjectsLocationsService struct { 177 s *Service 178 179 JobTemplates *ProjectsLocationsJobTemplatesService 180 181 Jobs *ProjectsLocationsJobsService 182 } 183 184 func NewProjectsLocationsJobTemplatesService(s *Service) *ProjectsLocationsJobTemplatesService { 185 rs := &ProjectsLocationsJobTemplatesService{s: s} 186 return rs 187 } 188 189 type ProjectsLocationsJobTemplatesService struct { 190 s *Service 191 } 192 193 func NewProjectsLocationsJobsService(s *Service) *ProjectsLocationsJobsService { 194 rs := &ProjectsLocationsJobsService{s: s} 195 return rs 196 } 197 198 type ProjectsLocationsJobsService struct { 199 s *Service 200 } 201 202 // AdBreak: Ad break. 203 type AdBreak struct { 204 // StartTimeOffset: Start time in seconds for the ad break, relative to the 205 // output file timeline. The default is `0s`. 206 StartTimeOffset string `json:"startTimeOffset,omitempty"` 207 // ForceSendFields is a list of field names (e.g. "StartTimeOffset") to 208 // unconditionally include in API requests. By default, fields with empty or 209 // default values are omitted from API requests. See 210 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 211 // details. 212 ForceSendFields []string `json:"-"` 213 // NullFields is a list of field names (e.g. "StartTimeOffset") to include in 214 // API requests with the JSON null value. By default, fields with empty values 215 // are omitted from API requests. See 216 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 217 NullFields []string `json:"-"` 218 } 219 220 func (s *AdBreak) MarshalJSON() ([]byte, error) { 221 type NoMethod AdBreak 222 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 223 } 224 225 // Aes128Encryption: Configuration for AES-128 encryption. 226 type Aes128Encryption struct { 227 } 228 229 // Animation: Animation types. 230 type Animation struct { 231 // AnimationEnd: End previous animation. 232 AnimationEnd *AnimationEnd `json:"animationEnd,omitempty"` 233 // AnimationFade: Display overlay object with fade animation. 234 AnimationFade *AnimationFade `json:"animationFade,omitempty"` 235 // AnimationStatic: Display static overlay object. 236 AnimationStatic *AnimationStatic `json:"animationStatic,omitempty"` 237 // ForceSendFields is a list of field names (e.g. "AnimationEnd") to 238 // unconditionally include in API requests. By default, fields with empty or 239 // default values are omitted from API requests. See 240 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 241 // details. 242 ForceSendFields []string `json:"-"` 243 // NullFields is a list of field names (e.g. "AnimationEnd") to include in API 244 // requests with the JSON null value. By default, fields with empty values are 245 // omitted from API requests. See 246 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 247 NullFields []string `json:"-"` 248 } 249 250 func (s *Animation) MarshalJSON() ([]byte, error) { 251 type NoMethod Animation 252 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 253 } 254 255 // AnimationEnd: End previous overlay animation from the video. Without 256 // `AnimationEnd`, the overlay object will keep the state of previous animation 257 // until the end of the video. 258 type AnimationEnd struct { 259 // StartTimeOffset: The time to end overlay object, in seconds. Default: 0 260 StartTimeOffset string `json:"startTimeOffset,omitempty"` 261 // ForceSendFields is a list of field names (e.g. "StartTimeOffset") to 262 // unconditionally include in API requests. By default, fields with empty or 263 // default values are omitted from API requests. See 264 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 265 // details. 266 ForceSendFields []string `json:"-"` 267 // NullFields is a list of field names (e.g. "StartTimeOffset") to include in 268 // API requests with the JSON null value. By default, fields with empty values 269 // are omitted from API requests. See 270 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 271 NullFields []string `json:"-"` 272 } 273 274 func (s *AnimationEnd) MarshalJSON() ([]byte, error) { 275 type NoMethod AnimationEnd 276 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 277 } 278 279 // AnimationFade: Display overlay object with fade animation. 280 type AnimationFade struct { 281 // EndTimeOffset: The time to end the fade animation, in seconds. Default: 282 // `start_time_offset` + 1s 283 EndTimeOffset string `json:"endTimeOffset,omitempty"` 284 // FadeType: Required. Type of fade animation: `FADE_IN` or `FADE_OUT`. 285 // 286 // Possible values: 287 // "FADE_TYPE_UNSPECIFIED" - The fade type is not specified. 288 // "FADE_IN" - Fade the overlay object into view. 289 // "FADE_OUT" - Fade the overlay object out of view. 290 FadeType string `json:"fadeType,omitempty"` 291 // StartTimeOffset: The time to start the fade animation, in seconds. Default: 292 // 0 293 StartTimeOffset string `json:"startTimeOffset,omitempty"` 294 // Xy: Normalized coordinates based on output video resolution. Valid values: 295 // `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay object. For 296 // example, use the x and y coordinates {0,0} to position the top-left corner 297 // of the overlay animation in the top-left corner of the output video. 298 Xy *NormalizedCoordinate `json:"xy,omitempty"` 299 // ForceSendFields is a list of field names (e.g. "EndTimeOffset") to 300 // unconditionally include in API requests. By default, fields with empty or 301 // default values are omitted from API requests. See 302 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 303 // details. 304 ForceSendFields []string `json:"-"` 305 // NullFields is a list of field names (e.g. "EndTimeOffset") to include in API 306 // requests with the JSON null value. By default, fields with empty values are 307 // omitted from API requests. See 308 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 309 NullFields []string `json:"-"` 310 } 311 312 func (s *AnimationFade) MarshalJSON() ([]byte, error) { 313 type NoMethod AnimationFade 314 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 315 } 316 317 // AnimationStatic: Display static overlay object. 318 type AnimationStatic struct { 319 // StartTimeOffset: The time to start displaying the overlay object, in 320 // seconds. Default: 0 321 StartTimeOffset string `json:"startTimeOffset,omitempty"` 322 // Xy: Normalized coordinates based on output video resolution. Valid values: 323 // `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay object. For 324 // example, use the x and y coordinates {0,0} to position the top-left corner 325 // of the overlay animation in the top-left corner of the output video. 326 Xy *NormalizedCoordinate `json:"xy,omitempty"` 327 // ForceSendFields is a list of field names (e.g. "StartTimeOffset") to 328 // unconditionally include in API requests. By default, fields with empty or 329 // default values are omitted from API requests. See 330 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 331 // details. 332 ForceSendFields []string `json:"-"` 333 // NullFields is a list of field names (e.g. "StartTimeOffset") to include in 334 // API requests with the JSON null value. By default, fields with empty values 335 // are omitted from API requests. See 336 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 337 NullFields []string `json:"-"` 338 } 339 340 func (s *AnimationStatic) MarshalJSON() ([]byte, error) { 341 type NoMethod AnimationStatic 342 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 343 } 344 345 // Audio: Audio preprocessing configuration. 346 type Audio struct { 347 // HighBoost: Enable boosting high frequency components. The default is 348 // `false`. **Note:** This field is not supported. 349 HighBoost bool `json:"highBoost,omitempty"` 350 // LowBoost: Enable boosting low frequency components. The default is `false`. 351 // **Note:** This field is not supported. 352 LowBoost bool `json:"lowBoost,omitempty"` 353 // Lufs: Specify audio loudness normalization in loudness units relative to 354 // full scale (LUFS). Enter a value between -24 and 0 (the default), where: * 355 // -24 is the Advanced Television Systems Committee (ATSC A/85) standard * -23 356 // is the EU R128 broadcast standard * -19 is the prior standard for online 357 // mono audio * -18 is the ReplayGain standard * -16 is the prior standard for 358 // stereo audio * -14 is the new online audio standard recommended by Spotify, 359 // as well as Amazon Echo * 0 disables normalization 360 Lufs float64 `json:"lufs,omitempty"` 361 // ForceSendFields is a list of field names (e.g. "HighBoost") to 362 // unconditionally include in API requests. By default, fields with empty or 363 // default values are omitted from API requests. See 364 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 365 // details. 366 ForceSendFields []string `json:"-"` 367 // NullFields is a list of field names (e.g. "HighBoost") to include in API 368 // requests with the JSON null value. By default, fields with empty values are 369 // omitted from API requests. See 370 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 371 NullFields []string `json:"-"` 372 } 373 374 func (s *Audio) MarshalJSON() ([]byte, error) { 375 type NoMethod Audio 376 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 377 } 378 379 func (s *Audio) UnmarshalJSON(data []byte) error { 380 type NoMethod Audio 381 var s1 struct { 382 Lufs gensupport.JSONFloat64 `json:"lufs"` 383 *NoMethod 384 } 385 s1.NoMethod = (*NoMethod)(s) 386 if err := json.Unmarshal(data, &s1); err != nil { 387 return err 388 } 389 s.Lufs = float64(s1.Lufs) 390 return nil 391 } 392 393 // AudioMapping: The mapping for the JobConfig.edit_list atoms with audio 394 // EditAtom.inputs. 395 type AudioMapping struct { 396 // AtomKey: Required. The EditAtom.key that references the atom with audio 397 // inputs in the JobConfig.edit_list. 398 AtomKey string `json:"atomKey,omitempty"` 399 // GainDb: Audio volume control in dB. Negative values decrease volume, 400 // positive values increase. The default is 0. 401 GainDb float64 `json:"gainDb,omitempty"` 402 // InputChannel: Required. The zero-based index of the channel in the input 403 // audio stream. 404 InputChannel int64 `json:"inputChannel,omitempty"` 405 // InputKey: Required. The Input.key that identifies the input file. 406 InputKey string `json:"inputKey,omitempty"` 407 // InputTrack: Required. The zero-based index of the track in the input file. 408 InputTrack int64 `json:"inputTrack,omitempty"` 409 // OutputChannel: Required. The zero-based index of the channel in the output 410 // audio stream. 411 OutputChannel int64 `json:"outputChannel,omitempty"` 412 // ForceSendFields is a list of field names (e.g. "AtomKey") to unconditionally 413 // include in API requests. By default, fields with empty or default values are 414 // omitted from API requests. See 415 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 416 // details. 417 ForceSendFields []string `json:"-"` 418 // NullFields is a list of field names (e.g. "AtomKey") to include in API 419 // requests with the JSON null value. By default, fields with empty values are 420 // omitted from API requests. See 421 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 422 NullFields []string `json:"-"` 423 } 424 425 func (s *AudioMapping) MarshalJSON() ([]byte, error) { 426 type NoMethod AudioMapping 427 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 428 } 429 430 func (s *AudioMapping) UnmarshalJSON(data []byte) error { 431 type NoMethod AudioMapping 432 var s1 struct { 433 GainDb gensupport.JSONFloat64 `json:"gainDb"` 434 *NoMethod 435 } 436 s1.NoMethod = (*NoMethod)(s) 437 if err := json.Unmarshal(data, &s1); err != nil { 438 return err 439 } 440 s.GainDb = float64(s1.GainDb) 441 return nil 442 } 443 444 // AudioStream: Audio stream resource. 445 type AudioStream struct { 446 // BitrateBps: Required. Audio bitrate in bits per second. Must be between 1 447 // and 10,000,000. 448 BitrateBps int64 `json:"bitrateBps,omitempty"` 449 // ChannelCount: Number of audio channels. Must be between 1 and 6. The default 450 // is 2. 451 ChannelCount int64 `json:"channelCount,omitempty"` 452 // ChannelLayout: A list of channel names specifying layout of the audio 453 // channels. This only affects the metadata embedded in the container headers, 454 // if supported by the specified format. The default is `["fl", "fr"]`. 455 // Supported channel names: - `fl` - Front left channel - `fr` - Front right 456 // channel - `sl` - Side left channel - `sr` - Side right channel - `fc` - 457 // Front center channel - `lfe` - Low frequency 458 ChannelLayout []string `json:"channelLayout,omitempty"` 459 // Codec: The codec for this audio stream. The default is `aac`. Supported 460 // audio codecs: - `aac` - `aac-he` - `aac-he-v2` - `mp3` - `ac3` - `eac3` 461 Codec string `json:"codec,omitempty"` 462 // DisplayName: The name for this particular audio stream that will be added to 463 // the HLS/DASH manifest. Not supported in MP4 files. 464 DisplayName string `json:"displayName,omitempty"` 465 // LanguageCode: The BCP-47 language code, such as `en-US` or `sr-Latn`. For 466 // more information, see 467 // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. Not 468 // supported in MP4 files. 469 LanguageCode string `json:"languageCode,omitempty"` 470 // Mapping: The mapping for the JobConfig.edit_list atoms with audio 471 // EditAtom.inputs. 472 Mapping []*AudioMapping `json:"mapping,omitempty"` 473 // SampleRateHertz: The audio sample rate in Hertz. The default is 48000 Hertz. 474 SampleRateHertz int64 `json:"sampleRateHertz,omitempty"` 475 // ForceSendFields is a list of field names (e.g. "BitrateBps") to 476 // unconditionally include in API requests. By default, fields with empty or 477 // default values are omitted from API requests. See 478 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 479 // details. 480 ForceSendFields []string `json:"-"` 481 // NullFields is a list of field names (e.g. "BitrateBps") to include in API 482 // requests with the JSON null value. By default, fields with empty values are 483 // omitted from API requests. See 484 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 485 NullFields []string `json:"-"` 486 } 487 488 func (s *AudioStream) MarshalJSON() ([]byte, error) { 489 type NoMethod AudioStream 490 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 491 } 492 493 // BwdifConfig: Bob Weaver Deinterlacing Filter Configuration. 494 type BwdifConfig struct { 495 // DeinterlaceAllFrames: Deinterlace all frames rather than just the frames 496 // identified as interlaced. The default is `false`. 497 DeinterlaceAllFrames bool `json:"deinterlaceAllFrames,omitempty"` 498 // Mode: Specifies the deinterlacing mode to adopt. The default is 499 // `send_frame`. Supported values: - `send_frame`: Output one frame for each 500 // frame - `send_field`: Output one frame for each field 501 Mode string `json:"mode,omitempty"` 502 // Parity: The picture field parity assumed for the input interlaced video. The 503 // default is `auto`. Supported values: - `tff`: Assume the top field is first 504 // - `bff`: Assume the bottom field is first - `auto`: Enable automatic 505 // detection of field parity 506 Parity string `json:"parity,omitempty"` 507 // ForceSendFields is a list of field names (e.g. "DeinterlaceAllFrames") to 508 // unconditionally include in API requests. By default, fields with empty or 509 // default values are omitted from API requests. See 510 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 511 // details. 512 ForceSendFields []string `json:"-"` 513 // NullFields is a list of field names (e.g. "DeinterlaceAllFrames") to include 514 // in API requests with the JSON null value. By default, fields with empty 515 // values are omitted from API requests. See 516 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 517 NullFields []string `json:"-"` 518 } 519 520 func (s *BwdifConfig) MarshalJSON() ([]byte, error) { 521 type NoMethod BwdifConfig 522 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 523 } 524 525 // Clearkey: Clearkey configuration. 526 type Clearkey struct { 527 } 528 529 // Color: Color preprocessing configuration. **Note:** This configuration is 530 // not supported. 531 type Color struct { 532 // Brightness: Control brightness of the video. Enter a value between -1 and 1, 533 // where -1 is minimum brightness and 1 is maximum brightness. 0 is no change. 534 // The default is 0. 535 Brightness float64 `json:"brightness,omitempty"` 536 // Contrast: Control black and white contrast of the video. Enter a value 537 // between -1 and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 538 // is no change. The default is 0. 539 Contrast float64 `json:"contrast,omitempty"` 540 // Saturation: Control color saturation of the video. Enter a value between -1 541 // and 1, where -1 is fully desaturated and 1 is maximum saturation. 0 is no 542 // change. The default is 0. 543 Saturation float64 `json:"saturation,omitempty"` 544 // ForceSendFields is a list of field names (e.g. "Brightness") to 545 // unconditionally include in API requests. By default, fields with empty or 546 // default values are omitted from API requests. See 547 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 548 // details. 549 ForceSendFields []string `json:"-"` 550 // NullFields is a list of field names (e.g. "Brightness") to include in API 551 // requests with the JSON null value. By default, fields with empty values are 552 // omitted from API requests. See 553 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 554 NullFields []string `json:"-"` 555 } 556 557 func (s *Color) MarshalJSON() ([]byte, error) { 558 type NoMethod Color 559 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 560 } 561 562 func (s *Color) UnmarshalJSON(data []byte) error { 563 type NoMethod Color 564 var s1 struct { 565 Brightness gensupport.JSONFloat64 `json:"brightness"` 566 Contrast gensupport.JSONFloat64 `json:"contrast"` 567 Saturation gensupport.JSONFloat64 `json:"saturation"` 568 *NoMethod 569 } 570 s1.NoMethod = (*NoMethod)(s) 571 if err := json.Unmarshal(data, &s1); err != nil { 572 return err 573 } 574 s.Brightness = float64(s1.Brightness) 575 s.Contrast = float64(s1.Contrast) 576 s.Saturation = float64(s1.Saturation) 577 return nil 578 } 579 580 // Crop: Video cropping configuration for the input video. The cropped input 581 // video is scaled to match the output resolution. 582 type Crop struct { 583 // BottomPixels: The number of pixels to crop from the bottom. The default is 584 // 0. 585 BottomPixels int64 `json:"bottomPixels,omitempty"` 586 // LeftPixels: The number of pixels to crop from the left. The default is 0. 587 LeftPixels int64 `json:"leftPixels,omitempty"` 588 // RightPixels: The number of pixels to crop from the right. The default is 0. 589 RightPixels int64 `json:"rightPixels,omitempty"` 590 // TopPixels: The number of pixels to crop from the top. The default is 0. 591 TopPixels int64 `json:"topPixels,omitempty"` 592 // ForceSendFields is a list of field names (e.g. "BottomPixels") to 593 // unconditionally include in API requests. By default, fields with empty or 594 // default values are omitted from API requests. See 595 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 596 // details. 597 ForceSendFields []string `json:"-"` 598 // NullFields is a list of field names (e.g. "BottomPixels") to include in API 599 // requests with the JSON null value. By default, fields with empty values are 600 // omitted from API requests. See 601 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 602 NullFields []string `json:"-"` 603 } 604 605 func (s *Crop) MarshalJSON() ([]byte, error) { 606 type NoMethod Crop 607 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 608 } 609 610 // DashConfig: `DASH` manifest configuration. 611 type DashConfig struct { 612 // SegmentReferenceScheme: The segment reference scheme for a `DASH` manifest. 613 // The default is `SEGMENT_LIST`. 614 // 615 // Possible values: 616 // "SEGMENT_REFERENCE_SCHEME_UNSPECIFIED" - The segment reference scheme is 617 // not specified. 618 // "SEGMENT_LIST" - Explicitly lists the URLs of media files for each 619 // segment. For example, if SegmentSettings.individual_segments is `true`, then 620 // the manifest contains fields similar to the following: ```xml ... ``` 621 // "SEGMENT_TEMPLATE_NUMBER" - SegmentSettings.individual_segments must be 622 // set to `true` to use this segment reference scheme. Uses the DASH 623 // specification `` tag to determine the URLs of media files for each segment. 624 // For example: ```xml ... ``` 625 SegmentReferenceScheme string `json:"segmentReferenceScheme,omitempty"` 626 // ForceSendFields is a list of field names (e.g. "SegmentReferenceScheme") to 627 // unconditionally include in API requests. By default, fields with empty or 628 // default values are omitted from API requests. See 629 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 630 // details. 631 ForceSendFields []string `json:"-"` 632 // NullFields is a list of field names (e.g. "SegmentReferenceScheme") to 633 // include in API requests with the JSON null value. By default, fields with 634 // empty values are omitted from API requests. See 635 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 636 NullFields []string `json:"-"` 637 } 638 639 func (s *DashConfig) MarshalJSON() ([]byte, error) { 640 type NoMethod DashConfig 641 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 642 } 643 644 // Deblock: Deblock preprocessing configuration. **Note:** This configuration 645 // is not supported. 646 type Deblock struct { 647 // Enabled: Enable deblocker. The default is `false`. 648 Enabled bool `json:"enabled,omitempty"` 649 // Strength: Set strength of the deblocker. Enter a value between 0 and 1. The 650 // higher the value, the stronger the block removal. 0 is no deblocking. The 651 // default is 0. 652 Strength float64 `json:"strength,omitempty"` 653 // ForceSendFields is a list of field names (e.g. "Enabled") to unconditionally 654 // include in API requests. By default, fields with empty or default values are 655 // omitted from API requests. See 656 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 657 // details. 658 ForceSendFields []string `json:"-"` 659 // NullFields is a list of field names (e.g. "Enabled") to include in API 660 // requests with the JSON null value. By default, fields with empty values are 661 // omitted from API requests. See 662 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 663 NullFields []string `json:"-"` 664 } 665 666 func (s *Deblock) MarshalJSON() ([]byte, error) { 667 type NoMethod Deblock 668 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 669 } 670 671 func (s *Deblock) UnmarshalJSON(data []byte) error { 672 type NoMethod Deblock 673 var s1 struct { 674 Strength gensupport.JSONFloat64 `json:"strength"` 675 *NoMethod 676 } 677 s1.NoMethod = (*NoMethod)(s) 678 if err := json.Unmarshal(data, &s1); err != nil { 679 return err 680 } 681 s.Strength = float64(s1.Strength) 682 return nil 683 } 684 685 // Deinterlace: Deinterlace configuration for input video. 686 type Deinterlace struct { 687 // Bwdif: Specifies the Bob Weaver Deinterlacing Filter Configuration. 688 Bwdif *BwdifConfig `json:"bwdif,omitempty"` 689 // Yadif: Specifies the Yet Another Deinterlacing Filter Configuration. 690 Yadif *YadifConfig `json:"yadif,omitempty"` 691 // ForceSendFields is a list of field names (e.g. "Bwdif") to unconditionally 692 // include in API requests. By default, fields with empty or default values are 693 // omitted from API requests. See 694 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 695 // details. 696 ForceSendFields []string `json:"-"` 697 // NullFields is a list of field names (e.g. "Bwdif") to include in API 698 // requests with the JSON null value. By default, fields with empty values are 699 // omitted from API requests. See 700 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 701 NullFields []string `json:"-"` 702 } 703 704 func (s *Deinterlace) MarshalJSON() ([]byte, error) { 705 type NoMethod Deinterlace 706 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 707 } 708 709 // Denoise: Denoise preprocessing configuration. **Note:** This configuration 710 // is not supported. 711 type Denoise struct { 712 // Strength: Set strength of the denoise. Enter a value between 0 and 1. The 713 // higher the value, the smoother the image. 0 is no denoising. The default is 714 // 0. 715 Strength float64 `json:"strength,omitempty"` 716 // Tune: Set the denoiser mode. The default is `standard`. Supported denoiser 717 // modes: - `standard` - `grain` 718 Tune string `json:"tune,omitempty"` 719 // ForceSendFields is a list of field names (e.g. "Strength") to 720 // unconditionally include in API requests. By default, fields with empty or 721 // default values are omitted from API requests. See 722 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 723 // details. 724 ForceSendFields []string `json:"-"` 725 // NullFields is a list of field names (e.g. "Strength") to include in API 726 // requests with the JSON null value. By default, fields with empty values are 727 // omitted from API requests. See 728 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 729 NullFields []string `json:"-"` 730 } 731 732 func (s *Denoise) MarshalJSON() ([]byte, error) { 733 type NoMethod Denoise 734 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 735 } 736 737 func (s *Denoise) UnmarshalJSON(data []byte) error { 738 type NoMethod Denoise 739 var s1 struct { 740 Strength gensupport.JSONFloat64 `json:"strength"` 741 *NoMethod 742 } 743 s1.NoMethod = (*NoMethod)(s) 744 if err := json.Unmarshal(data, &s1); err != nil { 745 return err 746 } 747 s.Strength = float64(s1.Strength) 748 return nil 749 } 750 751 // DrmSystems: Defines configuration for DRM systems in use. 752 type DrmSystems struct { 753 // Clearkey: Clearkey configuration. 754 Clearkey *Clearkey `json:"clearkey,omitempty"` 755 // Fairplay: Fairplay configuration. 756 Fairplay *Fairplay `json:"fairplay,omitempty"` 757 // Playready: Playready configuration. 758 Playready *Playready `json:"playready,omitempty"` 759 // Widevine: Widevine configuration. 760 Widevine *Widevine `json:"widevine,omitempty"` 761 // ForceSendFields is a list of field names (e.g. "Clearkey") to 762 // unconditionally include in API requests. By default, fields with empty or 763 // default values are omitted from API requests. See 764 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 765 // details. 766 ForceSendFields []string `json:"-"` 767 // NullFields is a list of field names (e.g. "Clearkey") to include in API 768 // requests with the JSON null value. By default, fields with empty values are 769 // omitted from API requests. See 770 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 771 NullFields []string `json:"-"` 772 } 773 774 func (s *DrmSystems) MarshalJSON() ([]byte, error) { 775 type NoMethod DrmSystems 776 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 777 } 778 779 // EditAtom: Edit atom. 780 type EditAtom struct { 781 // EndTimeOffset: End time in seconds for the atom, relative to the input file 782 // timeline. When `end_time_offset` is not specified, the `inputs` are used 783 // until the end of the atom. 784 EndTimeOffset string `json:"endTimeOffset,omitempty"` 785 // Inputs: List of Input.key values identifying files that should be used in 786 // this atom. The listed `inputs` must have the same timeline. 787 Inputs []string `json:"inputs,omitempty"` 788 // Key: A unique key for this atom. Must be specified when using advanced 789 // mapping. 790 Key string `json:"key,omitempty"` 791 // StartTimeOffset: Start time in seconds for the atom, relative to the input 792 // file timeline. The default is `0s`. 793 StartTimeOffset string `json:"startTimeOffset,omitempty"` 794 // ForceSendFields is a list of field names (e.g. "EndTimeOffset") to 795 // unconditionally include in API requests. By default, fields with empty or 796 // default values are omitted from API requests. See 797 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 798 // details. 799 ForceSendFields []string `json:"-"` 800 // NullFields is a list of field names (e.g. "EndTimeOffset") to include in API 801 // requests with the JSON null value. By default, fields with empty values are 802 // omitted from API requests. See 803 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 804 NullFields []string `json:"-"` 805 } 806 807 func (s *EditAtom) MarshalJSON() ([]byte, error) { 808 type NoMethod EditAtom 809 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 810 } 811 812 // ElementaryStream: Encoding of an input file such as an audio, video, or text 813 // track. Elementary streams must be packaged before mapping and sharing 814 // between different output formats. 815 type ElementaryStream struct { 816 // AudioStream: Encoding of an audio stream. 817 AudioStream *AudioStream `json:"audioStream,omitempty"` 818 // Key: A unique key for this elementary stream. 819 Key string `json:"key,omitempty"` 820 // TextStream: Encoding of a text stream. For example, closed captions or 821 // subtitles. 822 TextStream *TextStream `json:"textStream,omitempty"` 823 // VideoStream: Encoding of a video stream. 824 VideoStream *VideoStream `json:"videoStream,omitempty"` 825 // ForceSendFields is a list of field names (e.g. "AudioStream") to 826 // unconditionally include in API requests. By default, fields with empty or 827 // default values are omitted from API requests. See 828 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 829 // details. 830 ForceSendFields []string `json:"-"` 831 // NullFields is a list of field names (e.g. "AudioStream") to include in API 832 // requests with the JSON null value. By default, fields with empty values are 833 // omitted from API requests. See 834 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 835 NullFields []string `json:"-"` 836 } 837 838 func (s *ElementaryStream) MarshalJSON() ([]byte, error) { 839 type NoMethod ElementaryStream 840 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 841 } 842 843 // Empty: A generic empty message that you can re-use to avoid defining 844 // duplicated empty messages in your APIs. A typical example is to use it as 845 // the request or the response type of an API method. For instance: service Foo 846 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } 847 type Empty struct { 848 // ServerResponse contains the HTTP response code and headers from the server. 849 googleapi.ServerResponse `json:"-"` 850 } 851 852 // Encryption: Encryption settings. 853 type Encryption struct { 854 // Aes128: Configuration for AES-128 encryption. 855 Aes128 *Aes128Encryption `json:"aes128,omitempty"` 856 // DrmSystems: Required. DRM system(s) to use; at least one must be specified. 857 // If a DRM system is omitted, it is considered disabled. 858 DrmSystems *DrmSystems `json:"drmSystems,omitempty"` 859 // Id: Required. Identifier for this set of encryption options. 860 Id string `json:"id,omitempty"` 861 // MpegCenc: Configuration for MPEG Common Encryption (MPEG-CENC). 862 MpegCenc *MpegCommonEncryption `json:"mpegCenc,omitempty"` 863 // SampleAes: Configuration for SAMPLE-AES encryption. 864 SampleAes *SampleAesEncryption `json:"sampleAes,omitempty"` 865 // SecretManagerKeySource: Keys are stored in Google Secret Manager. 866 SecretManagerKeySource *SecretManagerSource `json:"secretManagerKeySource,omitempty"` 867 // ForceSendFields is a list of field names (e.g. "Aes128") to unconditionally 868 // include in API requests. By default, fields with empty or default values are 869 // omitted from API requests. See 870 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 871 // details. 872 ForceSendFields []string `json:"-"` 873 // NullFields is a list of field names (e.g. "Aes128") to include in API 874 // requests with the JSON null value. By default, fields with empty values are 875 // omitted from API requests. See 876 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 877 NullFields []string `json:"-"` 878 } 879 880 func (s *Encryption) MarshalJSON() ([]byte, error) { 881 type NoMethod Encryption 882 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 883 } 884 885 // Fairplay: Fairplay configuration. 886 type Fairplay struct { 887 } 888 889 // Fmp4Config: `fmp4` container configuration. 890 type Fmp4Config struct { 891 // CodecTag: Optional. Specify the codec tag string that will be used in the 892 // media bitstream. When not specified, the codec appropriate value is used. 893 // Supported H265 codec tags: - `hvc1` (default) - `hev1` 894 CodecTag string `json:"codecTag,omitempty"` 895 // ForceSendFields is a list of field names (e.g. "CodecTag") to 896 // unconditionally include in API requests. By default, fields with empty or 897 // default values are omitted from API requests. See 898 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 899 // details. 900 ForceSendFields []string `json:"-"` 901 // NullFields is a list of field names (e.g. "CodecTag") to include in API 902 // requests with the JSON null value. By default, fields with empty values are 903 // omitted from API requests. See 904 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 905 NullFields []string `json:"-"` 906 } 907 908 func (s *Fmp4Config) MarshalJSON() ([]byte, error) { 909 type NoMethod Fmp4Config 910 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 911 } 912 913 // H264CodecSettings: H264 codec settings. 914 type H264CodecSettings struct { 915 // AllowOpenGop: Specifies whether an open Group of Pictures (GOP) structure 916 // should be allowed or not. The default is `false`. 917 AllowOpenGop bool `json:"allowOpenGop,omitempty"` 918 // AqStrength: Specify the intensity of the adaptive quantizer (AQ). Must be 919 // between 0 and 1, where 0 disables the quantizer and 1 maximizes the 920 // quantizer. A higher value equals a lower bitrate but smoother image. The 921 // default is 0. 922 AqStrength float64 `json:"aqStrength,omitempty"` 923 // BFrameCount: The number of consecutive B-frames. Must be greater than or 924 // equal to zero. Must be less than H264CodecSettings.gop_frame_count if set. 925 // The default is 0. 926 BFrameCount int64 `json:"bFrameCount,omitempty"` 927 // BPyramid: Allow B-pyramid for reference frame selection. This may not be 928 // supported on all decoders. The default is `false`. 929 BPyramid bool `json:"bPyramid,omitempty"` 930 // BitrateBps: Required. The video bitrate in bits per second. The minimum 931 // value is 1,000. The maximum value is 800,000,000. 932 BitrateBps int64 `json:"bitrateBps,omitempty"` 933 // CrfLevel: Target CRF level. Must be between 10 and 36, where 10 is the 934 // highest quality and 36 is the most efficient compression. The default is 21. 935 CrfLevel int64 `json:"crfLevel,omitempty"` 936 // EnableTwoPass: Use two-pass encoding strategy to achieve better video 937 // quality. H264CodecSettings.rate_control_mode must be `vbr`. The default is 938 // `false`. 939 EnableTwoPass bool `json:"enableTwoPass,omitempty"` 940 // EntropyCoder: The entropy coder to use. The default is `cabac`. Supported 941 // entropy coders: - `cavlc` - `cabac` 942 EntropyCoder string `json:"entropyCoder,omitempty"` 943 // FrameRate: Required. The target video frame rate in frames per second (FPS). 944 // Must be less than or equal to 120. 945 FrameRate float64 `json:"frameRate,omitempty"` 946 // FrameRateConversionStrategy: Optional. Frame rate conversion strategy for 947 // desired frame rate. The default is `DOWNSAMPLE`. 948 // 949 // Possible values: 950 // "FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED" - Unspecified frame rate 951 // conversion strategy. 952 // "DOWNSAMPLE" - Selectively retain frames to reduce the output frame rate. 953 // Every _n_ th frame is kept, where `n = ceil(input frame rate / target frame 954 // rate)`. When _n_ = 1 (that is, the target frame rate is greater than the 955 // input frame rate), the output frame rate matches the input frame rate. When 956 // _n_ > 1, frames are dropped and the output frame rate is equal to `(input 957 // frame rate / n)`. For more information, see [Calculate frame 958 // rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate). 959 // "DROP_DUPLICATE" - Drop or duplicate frames to match the specified frame 960 // rate. 961 FrameRateConversionStrategy string `json:"frameRateConversionStrategy,omitempty"` 962 // GopDuration: Select the GOP size based on the specified duration. The 963 // default is `3s`. Note that `gopDuration` must be less than or equal to 964 // `segmentDuration` (#SegmentSettings), and `segmentDuration` 965 // (#SegmentSettings) must be divisible by `gopDuration`. 966 GopDuration string `json:"gopDuration,omitempty"` 967 // GopFrameCount: Select the GOP size based on the specified frame count. Must 968 // be greater than zero. 969 GopFrameCount int64 `json:"gopFrameCount,omitempty"` 970 // HeightPixels: The height of the video in pixels. Must be an even integer. 971 // When not specified, the height is adjusted to match the specified width and 972 // input aspect ratio. If both are omitted, the input height is used. For 973 // portrait videos that contain horizontal ASR and rotation metadata, provide 974 // the height, in pixels, per the horizontal ASR. The API calculates the width 975 // per the horizontal ASR. The API detects any rotation metadata and swaps the 976 // requested height and width for the output. 977 HeightPixels int64 `json:"heightPixels,omitempty"` 978 // Hlg: Optional. HLG color format setting for H264. 979 Hlg *H264ColorFormatHLG `json:"hlg,omitempty"` 980 // PixelFormat: Pixel format to use. The default is `yuv420p`. Supported pixel 981 // formats: - `yuv420p` pixel format - `yuv422p` pixel format - `yuv444p` pixel 982 // format - `yuv420p10` 10-bit HDR pixel format - `yuv422p10` 10-bit HDR pixel 983 // format - `yuv444p10` 10-bit HDR pixel format - `yuv420p12` 12-bit HDR pixel 984 // format - `yuv422p12` 12-bit HDR pixel format - `yuv444p12` 12-bit HDR pixel 985 // format 986 PixelFormat string `json:"pixelFormat,omitempty"` 987 // Preset: Enforces the specified codec preset. The default is `veryfast`. The 988 // available options are FFmpeg-compatible 989 // (https://trac.ffmpeg.org/wiki/Encode/H.264#Preset). Note that certain values 990 // for this field may cause the transcoder to override other fields you set in 991 // the `H264CodecSettings` message. 992 Preset string `json:"preset,omitempty"` 993 // Profile: Enforces the specified codec profile. The following profiles are 994 // supported: * `baseline` * `main` * `high` (default) The available options 995 // are FFmpeg-compatible (https://trac.ffmpeg.org/wiki/Encode/H.264#Tune). Note 996 // that certain values for this field may cause the transcoder to override 997 // other fields you set in the `H264CodecSettings` message. 998 Profile string `json:"profile,omitempty"` 999 // RateControlMode: Specify the mode. The default is `vbr`. Supported rate 1000 // control modes: - `vbr` - variable bitrate - `crf` - constant rate factor 1001 RateControlMode string `json:"rateControlMode,omitempty"` 1002 // Sdr: Optional. SDR color format setting for H264. 1003 Sdr *H264ColorFormatSDR `json:"sdr,omitempty"` 1004 // Tune: Enforces the specified codec tune. The available options are 1005 // FFmpeg-compatible (https://trac.ffmpeg.org/wiki/Encode/H.264#Tune). Note 1006 // that certain values for this field may cause the transcoder to override 1007 // other fields you set in the `H264CodecSettings` message. 1008 Tune string `json:"tune,omitempty"` 1009 // VbvFullnessBits: Initial fullness of the Video Buffering Verifier (VBV) 1010 // buffer in bits. Must be greater than zero. The default is equal to 90% of 1011 // H264CodecSettings.vbv_size_bits. 1012 VbvFullnessBits int64 `json:"vbvFullnessBits,omitempty"` 1013 // VbvSizeBits: Size of the Video Buffering Verifier (VBV) buffer in bits. Must 1014 // be greater than zero. The default is equal to H264CodecSettings.bitrate_bps. 1015 VbvSizeBits int64 `json:"vbvSizeBits,omitempty"` 1016 // WidthPixels: The width of the video in pixels. Must be an even integer. When 1017 // not specified, the width is adjusted to match the specified height and input 1018 // aspect ratio. If both are omitted, the input width is used. For portrait 1019 // videos that contain horizontal ASR and rotation metadata, provide the width, 1020 // in pixels, per the horizontal ASR. The API calculates the height per the 1021 // horizontal ASR. The API detects any rotation metadata and swaps the 1022 // requested height and width for the output. 1023 WidthPixels int64 `json:"widthPixels,omitempty"` 1024 // ForceSendFields is a list of field names (e.g. "AllowOpenGop") to 1025 // unconditionally include in API requests. By default, fields with empty or 1026 // default values are omitted from API requests. See 1027 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1028 // details. 1029 ForceSendFields []string `json:"-"` 1030 // NullFields is a list of field names (e.g. "AllowOpenGop") to include in API 1031 // requests with the JSON null value. By default, fields with empty values are 1032 // omitted from API requests. See 1033 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1034 NullFields []string `json:"-"` 1035 } 1036 1037 func (s *H264CodecSettings) MarshalJSON() ([]byte, error) { 1038 type NoMethod H264CodecSettings 1039 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1040 } 1041 1042 func (s *H264CodecSettings) UnmarshalJSON(data []byte) error { 1043 type NoMethod H264CodecSettings 1044 var s1 struct { 1045 AqStrength gensupport.JSONFloat64 `json:"aqStrength"` 1046 FrameRate gensupport.JSONFloat64 `json:"frameRate"` 1047 *NoMethod 1048 } 1049 s1.NoMethod = (*NoMethod)(s) 1050 if err := json.Unmarshal(data, &s1); err != nil { 1051 return err 1052 } 1053 s.AqStrength = float64(s1.AqStrength) 1054 s.FrameRate = float64(s1.FrameRate) 1055 return nil 1056 } 1057 1058 // H264ColorFormatHLG: Convert the input video to a Hybrid Log Gamma (HLG) 1059 // video. 1060 type H264ColorFormatHLG struct { 1061 } 1062 1063 // H264ColorFormatSDR: Convert the input video to a Standard Dynamic Range 1064 // (SDR) video. 1065 type H264ColorFormatSDR struct { 1066 } 1067 1068 // H265CodecSettings: H265 codec settings. 1069 type H265CodecSettings struct { 1070 // AllowOpenGop: Specifies whether an open Group of Pictures (GOP) structure 1071 // should be allowed or not. The default is `false`. 1072 AllowOpenGop bool `json:"allowOpenGop,omitempty"` 1073 // AqStrength: Specify the intensity of the adaptive quantizer (AQ). Must be 1074 // between 0 and 1, where 0 disables the quantizer and 1 maximizes the 1075 // quantizer. A higher value equals a lower bitrate but smoother image. The 1076 // default is 0. 1077 AqStrength float64 `json:"aqStrength,omitempty"` 1078 // BFrameCount: The number of consecutive B-frames. Must be greater than or 1079 // equal to zero. Must be less than H265CodecSettings.gop_frame_count if set. 1080 // The default is 0. 1081 BFrameCount int64 `json:"bFrameCount,omitempty"` 1082 // BPyramid: Allow B-pyramid for reference frame selection. This may not be 1083 // supported on all decoders. The default is `false`. 1084 BPyramid bool `json:"bPyramid,omitempty"` 1085 // BitrateBps: Required. The video bitrate in bits per second. The minimum 1086 // value is 1,000. The maximum value is 800,000,000. 1087 BitrateBps int64 `json:"bitrateBps,omitempty"` 1088 // CrfLevel: Target CRF level. Must be between 10 and 36, where 10 is the 1089 // highest quality and 36 is the most efficient compression. The default is 21. 1090 CrfLevel int64 `json:"crfLevel,omitempty"` 1091 // EnableTwoPass: Use two-pass encoding strategy to achieve better video 1092 // quality. H265CodecSettings.rate_control_mode must be `vbr`. The default is 1093 // `false`. 1094 EnableTwoPass bool `json:"enableTwoPass,omitempty"` 1095 // FrameRate: Required. The target video frame rate in frames per second (FPS). 1096 // Must be less than or equal to 120. 1097 FrameRate float64 `json:"frameRate,omitempty"` 1098 // FrameRateConversionStrategy: Optional. Frame rate conversion strategy for 1099 // desired frame rate. The default is `DOWNSAMPLE`. 1100 // 1101 // Possible values: 1102 // "FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED" - Unspecified frame rate 1103 // conversion strategy. 1104 // "DOWNSAMPLE" - Selectively retain frames to reduce the output frame rate. 1105 // Every _n_ th frame is kept, where `n = ceil(input frame rate / target frame 1106 // rate)`. When _n_ = 1 (that is, the target frame rate is greater than the 1107 // input frame rate), the output frame rate matches the input frame rate. When 1108 // _n_ > 1, frames are dropped and the output frame rate is equal to `(input 1109 // frame rate / n)`. For more information, see [Calculate frame 1110 // rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate). 1111 // "DROP_DUPLICATE" - Drop or duplicate frames to match the specified frame 1112 // rate. 1113 FrameRateConversionStrategy string `json:"frameRateConversionStrategy,omitempty"` 1114 // GopDuration: Select the GOP size based on the specified duration. The 1115 // default is `3s`. Note that `gopDuration` must be less than or equal to 1116 // `segmentDuration` (#SegmentSettings), and `segmentDuration` 1117 // (#SegmentSettings) must be divisible by `gopDuration`. 1118 GopDuration string `json:"gopDuration,omitempty"` 1119 // GopFrameCount: Select the GOP size based on the specified frame count. Must 1120 // be greater than zero. 1121 GopFrameCount int64 `json:"gopFrameCount,omitempty"` 1122 // Hdr10: Optional. HDR10 color format setting for H265. 1123 Hdr10 *H265ColorFormatHDR10 `json:"hdr10,omitempty"` 1124 // HeightPixels: The height of the video in pixels. Must be an even integer. 1125 // When not specified, the height is adjusted to match the specified width and 1126 // input aspect ratio. If both are omitted, the input height is used. For 1127 // portrait videos that contain horizontal ASR and rotation metadata, provide 1128 // the height, in pixels, per the horizontal ASR. The API calculates the width 1129 // per the horizontal ASR. The API detects any rotation metadata and swaps the 1130 // requested height and width for the output. 1131 HeightPixels int64 `json:"heightPixels,omitempty"` 1132 // Hlg: Optional. HLG color format setting for H265. 1133 Hlg *H265ColorFormatHLG `json:"hlg,omitempty"` 1134 // PixelFormat: Pixel format to use. The default is `yuv420p`. Supported pixel 1135 // formats: - `yuv420p` pixel format - `yuv422p` pixel format - `yuv444p` pixel 1136 // format - `yuv420p10` 10-bit HDR pixel format - `yuv422p10` 10-bit HDR pixel 1137 // format - `yuv444p10` 10-bit HDR pixel format - `yuv420p12` 12-bit HDR pixel 1138 // format - `yuv422p12` 12-bit HDR pixel format - `yuv444p12` 12-bit HDR pixel 1139 // format 1140 PixelFormat string `json:"pixelFormat,omitempty"` 1141 // Preset: Enforces the specified codec preset. The default is `veryfast`. The 1142 // available options are FFmpeg-compatible 1143 // (https://trac.ffmpeg.org/wiki/Encode/H.265). Note that certain values for 1144 // this field may cause the transcoder to override other fields you set in the 1145 // `H265CodecSettings` message. 1146 Preset string `json:"preset,omitempty"` 1147 // Profile: Enforces the specified codec profile. The following profiles are 1148 // supported: * 8-bit profiles * `main` (default) * `main-intra` * 1149 // `mainstillpicture` * 10-bit profiles * `main10` (default) * `main10-intra` * 1150 // `main422-10` * `main422-10-intra` * `main444-10` * `main444-10-intra` * 1151 // 12-bit profiles * `main12` (default) * `main12-intra` * `main422-12` * 1152 // `main422-12-intra` * `main444-12` * `main444-12-intra` The available options 1153 // are FFmpeg-compatible (https://x265.readthedocs.io/). Note that certain 1154 // values for this field may cause the transcoder to override other fields you 1155 // set in the `H265CodecSettings` message. 1156 Profile string `json:"profile,omitempty"` 1157 // RateControlMode: Specify the mode. The default is `vbr`. Supported rate 1158 // control modes: - `vbr` - variable bitrate - `crf` - constant rate factor 1159 RateControlMode string `json:"rateControlMode,omitempty"` 1160 // Sdr: Optional. SDR color format setting for H265. 1161 Sdr *H265ColorFormatSDR `json:"sdr,omitempty"` 1162 // Tune: Enforces the specified codec tune. The available options are 1163 // FFmpeg-compatible (https://trac.ffmpeg.org/wiki/Encode/H.265). Note that 1164 // certain values for this field may cause the transcoder to override other 1165 // fields you set in the `H265CodecSettings` message. 1166 Tune string `json:"tune,omitempty"` 1167 // VbvFullnessBits: Initial fullness of the Video Buffering Verifier (VBV) 1168 // buffer in bits. Must be greater than zero. The default is equal to 90% of 1169 // H265CodecSettings.vbv_size_bits. 1170 VbvFullnessBits int64 `json:"vbvFullnessBits,omitempty"` 1171 // VbvSizeBits: Size of the Video Buffering Verifier (VBV) buffer in bits. Must 1172 // be greater than zero. The default is equal to `VideoStream.bitrate_bps`. 1173 VbvSizeBits int64 `json:"vbvSizeBits,omitempty"` 1174 // WidthPixels: The width of the video in pixels. Must be an even integer. When 1175 // not specified, the width is adjusted to match the specified height and input 1176 // aspect ratio. If both are omitted, the input width is used. For portrait 1177 // videos that contain horizontal ASR and rotation metadata, provide the width, 1178 // in pixels, per the horizontal ASR. The API calculates the height per the 1179 // horizontal ASR. The API detects any rotation metadata and swaps the 1180 // requested height and width for the output. 1181 WidthPixels int64 `json:"widthPixels,omitempty"` 1182 // ForceSendFields is a list of field names (e.g. "AllowOpenGop") to 1183 // unconditionally include in API requests. By default, fields with empty or 1184 // default values are omitted from API requests. See 1185 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1186 // details. 1187 ForceSendFields []string `json:"-"` 1188 // NullFields is a list of field names (e.g. "AllowOpenGop") to include in API 1189 // requests with the JSON null value. By default, fields with empty values are 1190 // omitted from API requests. See 1191 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1192 NullFields []string `json:"-"` 1193 } 1194 1195 func (s *H265CodecSettings) MarshalJSON() ([]byte, error) { 1196 type NoMethod H265CodecSettings 1197 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1198 } 1199 1200 func (s *H265CodecSettings) UnmarshalJSON(data []byte) error { 1201 type NoMethod H265CodecSettings 1202 var s1 struct { 1203 AqStrength gensupport.JSONFloat64 `json:"aqStrength"` 1204 FrameRate gensupport.JSONFloat64 `json:"frameRate"` 1205 *NoMethod 1206 } 1207 s1.NoMethod = (*NoMethod)(s) 1208 if err := json.Unmarshal(data, &s1); err != nil { 1209 return err 1210 } 1211 s.AqStrength = float64(s1.AqStrength) 1212 s.FrameRate = float64(s1.FrameRate) 1213 return nil 1214 } 1215 1216 // H265ColorFormatHDR10: Convert the input video to a High Dynamic Range 10 1217 // (HDR10) video. 1218 type H265ColorFormatHDR10 struct { 1219 } 1220 1221 // H265ColorFormatHLG: Convert the input video to a Hybrid Log Gamma (HLG) 1222 // video. 1223 type H265ColorFormatHLG struct { 1224 } 1225 1226 // H265ColorFormatSDR: Convert the input video to a Standard Dynamic Range 1227 // (SDR) video. 1228 type H265ColorFormatSDR struct { 1229 } 1230 1231 // Image: Overlaid image. 1232 type Image struct { 1233 // Alpha: Target image opacity. Valid values are from `1.0` (solid, default) to 1234 // `0.0` (transparent), exclusive. Set this to a value greater than `0.0`. 1235 Alpha float64 `json:"alpha,omitempty"` 1236 // Resolution: Normalized image resolution, based on output video resolution. 1237 // Valid values: `0.0`–`1.0`. To respect the original image aspect ratio, set 1238 // either `x` or `y` to `0.0`. To use the original image resolution, set both 1239 // `x` and `y` to `0.0`. 1240 Resolution *NormalizedCoordinate `json:"resolution,omitempty"` 1241 // Uri: Required. URI of the image in Cloud Storage. For example, 1242 // `gs://bucket/inputs/image.png`. Only PNG and JPEG images are supported. 1243 Uri string `json:"uri,omitempty"` 1244 // ForceSendFields is a list of field names (e.g. "Alpha") to unconditionally 1245 // include in API requests. By default, fields with empty or default values are 1246 // omitted from API requests. See 1247 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1248 // details. 1249 ForceSendFields []string `json:"-"` 1250 // NullFields is a list of field names (e.g. "Alpha") to include in API 1251 // requests with the JSON null value. By default, fields with empty values are 1252 // omitted from API requests. See 1253 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1254 NullFields []string `json:"-"` 1255 } 1256 1257 func (s *Image) MarshalJSON() ([]byte, error) { 1258 type NoMethod Image 1259 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1260 } 1261 1262 func (s *Image) UnmarshalJSON(data []byte) error { 1263 type NoMethod Image 1264 var s1 struct { 1265 Alpha gensupport.JSONFloat64 `json:"alpha"` 1266 *NoMethod 1267 } 1268 s1.NoMethod = (*NoMethod)(s) 1269 if err := json.Unmarshal(data, &s1); err != nil { 1270 return err 1271 } 1272 s.Alpha = float64(s1.Alpha) 1273 return nil 1274 } 1275 1276 // Input: Input asset. 1277 type Input struct { 1278 // Key: A unique key for this input. Must be specified when using advanced 1279 // mapping and edit lists. 1280 Key string `json:"key,omitempty"` 1281 // PreprocessingConfig: Preprocessing configurations. 1282 PreprocessingConfig *PreprocessingConfig `json:"preprocessingConfig,omitempty"` 1283 // Uri: URI of the media. Input files must be at least 5 seconds in duration 1284 // and stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). If 1285 // empty, the value is populated from Job.input_uri. See Supported input and 1286 // output formats 1287 // (https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats). 1288 Uri string `json:"uri,omitempty"` 1289 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 1290 // include in API requests. By default, fields with empty or default values are 1291 // omitted from API requests. See 1292 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1293 // details. 1294 ForceSendFields []string `json:"-"` 1295 // NullFields is a list of field names (e.g. "Key") to include in API requests 1296 // with the JSON null value. By default, fields with empty values are omitted 1297 // from API requests. See 1298 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1299 NullFields []string `json:"-"` 1300 } 1301 1302 func (s *Input) MarshalJSON() ([]byte, error) { 1303 type NoMethod Input 1304 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1305 } 1306 1307 // Job: Transcoding job resource. 1308 type Job struct { 1309 // BatchModePriority: The processing priority of a batch job. This field can 1310 // only be set for batch mode jobs. The default value is 0. This value cannot 1311 // be negative. Higher values correspond to higher priorities for the job. 1312 BatchModePriority int64 `json:"batchModePriority,omitempty"` 1313 // Config: The configuration for this job. 1314 Config *JobConfig `json:"config,omitempty"` 1315 // CreateTime: Output only. The time the job was created. 1316 CreateTime string `json:"createTime,omitempty"` 1317 // EndTime: Output only. The time the transcoding finished. 1318 EndTime string `json:"endTime,omitempty"` 1319 // Error: Output only. An error object that describes the reason for the 1320 // failure. This property is always present when ProcessingState is `FAILED`. 1321 Error *Status `json:"error,omitempty"` 1322 // InputUri: Input only. Specify the `input_uri` to populate empty `uri` fields 1323 // in each element of `Job.config.inputs` or `JobTemplate.config.inputs` when 1324 // using template. URI of the media. Input files must be at least 5 seconds in 1325 // duration and stored in Cloud Storage (for example, 1326 // `gs://bucket/inputs/file.mp4`). See Supported input and output formats 1327 // (https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats). 1328 InputUri string `json:"inputUri,omitempty"` 1329 // Labels: The labels associated with this job. You can use these to organize 1330 // and group your jobs. 1331 Labels map[string]string `json:"labels,omitempty"` 1332 // Mode: The processing mode of the job. The default is 1333 // `PROCESSING_MODE_INTERACTIVE`. 1334 // 1335 // Possible values: 1336 // "PROCESSING_MODE_UNSPECIFIED" - The job processing mode is not specified. 1337 // "PROCESSING_MODE_INTERACTIVE" - The job processing mode is interactive 1338 // mode. Interactive job will either be ran or rejected if quota does not allow 1339 // for it. 1340 // "PROCESSING_MODE_BATCH" - The job processing mode is batch mode. Batch 1341 // mode allows queuing of jobs. 1342 Mode string `json:"mode,omitempty"` 1343 // Name: The resource name of the job. Format: 1344 // `projects/{project_number}/locations/{location}/jobs/{job}` 1345 Name string `json:"name,omitempty"` 1346 // Optimization: Optional. The optimization strategy of the job. The default is 1347 // `AUTODETECT`. 1348 // 1349 // Possible values: 1350 // "OPTIMIZATION_STRATEGY_UNSPECIFIED" - The optimization strategy is not 1351 // specified. 1352 // "AUTODETECT" - Prioritize job processing speed. 1353 // "DISABLED" - Disable all optimizations. 1354 Optimization string `json:"optimization,omitempty"` 1355 // OutputUri: Input only. Specify the `output_uri` to populate an empty 1356 // `Job.config.output.uri` or `JobTemplate.config.output.uri` when using 1357 // template. URI for the output file(s). For example, 1358 // `gs://my-bucket/outputs/`. See Supported input and output formats 1359 // (https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats). 1360 OutputUri string `json:"outputUri,omitempty"` 1361 // StartTime: Output only. The time the transcoding started. 1362 StartTime string `json:"startTime,omitempty"` 1363 // State: Output only. The current state of the job. 1364 // 1365 // Possible values: 1366 // "PROCESSING_STATE_UNSPECIFIED" - The processing state is not specified. 1367 // "PENDING" - The job is enqueued and will be picked up for processing soon. 1368 // "RUNNING" - The job is being processed. 1369 // "SUCCEEDED" - The job has been completed successfully. 1370 // "FAILED" - The job has failed. For additional information, see 1371 // [Troubleshooting](https://cloud.google.com/transcoder/docs/troubleshooting). 1372 State string `json:"state,omitempty"` 1373 // TemplateId: Input only. Specify the `template_id` to use for populating 1374 // `Job.config`. The default is `preset/web-hd`, which is the only supported 1375 // preset. User defined JobTemplate: `{job_template_id}` 1376 TemplateId string `json:"templateId,omitempty"` 1377 // TtlAfterCompletionDays: Job time to live value in days, which will be 1378 // effective after job completion. Job should be deleted automatically after 1379 // the given TTL. Enter a value between 1 and 90. The default is 30. 1380 TtlAfterCompletionDays int64 `json:"ttlAfterCompletionDays,omitempty"` 1381 1382 // ServerResponse contains the HTTP response code and headers from the server. 1383 googleapi.ServerResponse `json:"-"` 1384 // ForceSendFields is a list of field names (e.g. "BatchModePriority") to 1385 // unconditionally include in API requests. By default, fields with empty or 1386 // default values are omitted from API requests. See 1387 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1388 // details. 1389 ForceSendFields []string `json:"-"` 1390 // NullFields is a list of field names (e.g. "BatchModePriority") to include in 1391 // API requests with the JSON null value. By default, fields with empty values 1392 // are omitted from API requests. See 1393 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1394 NullFields []string `json:"-"` 1395 } 1396 1397 func (s *Job) MarshalJSON() ([]byte, error) { 1398 type NoMethod Job 1399 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1400 } 1401 1402 // JobConfig: Job configuration 1403 type JobConfig struct { 1404 // AdBreaks: List of ad breaks. Specifies where to insert ad break tags in the 1405 // output manifests. 1406 AdBreaks []*AdBreak `json:"adBreaks,omitempty"` 1407 // EditList: List of edit atoms. Defines the ultimate timeline of the resulting 1408 // file or manifest. 1409 EditList []*EditAtom `json:"editList,omitempty"` 1410 // ElementaryStreams: List of elementary streams. 1411 ElementaryStreams []*ElementaryStream `json:"elementaryStreams,omitempty"` 1412 // Encryptions: List of encryption configurations for the content. Each 1413 // configuration has an ID. Specify this ID in the MuxStream.encryption_id 1414 // field to indicate the configuration to use for that `MuxStream` output. 1415 Encryptions []*Encryption `json:"encryptions,omitempty"` 1416 // Inputs: List of input assets stored in Cloud Storage. 1417 Inputs []*Input `json:"inputs,omitempty"` 1418 // Manifests: List of output manifests. 1419 Manifests []*Manifest `json:"manifests,omitempty"` 1420 // MuxStreams: List of multiplexing settings for output streams. 1421 MuxStreams []*MuxStream `json:"muxStreams,omitempty"` 1422 // Output: Output configuration. 1423 Output *Output `json:"output,omitempty"` 1424 // Overlays: List of overlays on the output video, in descending Z-order. 1425 Overlays []*Overlay `json:"overlays,omitempty"` 1426 // PubsubDestination: Destination on Pub/Sub. 1427 PubsubDestination *PubsubDestination `json:"pubsubDestination,omitempty"` 1428 // SpriteSheets: List of output sprite sheets. Spritesheets require at least 1429 // one VideoStream in the Jobconfig. 1430 SpriteSheets []*SpriteSheet `json:"spriteSheets,omitempty"` 1431 // ForceSendFields is a list of field names (e.g. "AdBreaks") to 1432 // unconditionally include in API requests. By default, fields with empty or 1433 // default values are omitted from API requests. See 1434 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1435 // details. 1436 ForceSendFields []string `json:"-"` 1437 // NullFields is a list of field names (e.g. "AdBreaks") to include in API 1438 // requests with the JSON null value. By default, fields with empty values are 1439 // omitted from API requests. See 1440 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1441 NullFields []string `json:"-"` 1442 } 1443 1444 func (s *JobConfig) MarshalJSON() ([]byte, error) { 1445 type NoMethod JobConfig 1446 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1447 } 1448 1449 // JobTemplate: Transcoding job template resource. 1450 type JobTemplate struct { 1451 // Config: The configuration for this template. 1452 Config *JobConfig `json:"config,omitempty"` 1453 // Labels: The labels associated with this job template. You can use these to 1454 // organize and group your job templates. 1455 Labels map[string]string `json:"labels,omitempty"` 1456 // Name: The resource name of the job template. Format: 1457 // `projects/{project_number}/locations/{location}/jobTemplates/{job_template}` 1458 Name string `json:"name,omitempty"` 1459 1460 // ServerResponse contains the HTTP response code and headers from the server. 1461 googleapi.ServerResponse `json:"-"` 1462 // ForceSendFields is a list of field names (e.g. "Config") to unconditionally 1463 // include in API requests. By default, fields with empty or default values are 1464 // omitted from API requests. See 1465 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1466 // details. 1467 ForceSendFields []string `json:"-"` 1468 // NullFields is a list of field names (e.g. "Config") to include in API 1469 // requests with the JSON null value. By default, fields with empty values are 1470 // omitted from API requests. See 1471 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1472 NullFields []string `json:"-"` 1473 } 1474 1475 func (s *JobTemplate) MarshalJSON() ([]byte, error) { 1476 type NoMethod JobTemplate 1477 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1478 } 1479 1480 // ListJobTemplatesResponse: Response message for 1481 // `TranscoderService.ListJobTemplates`. 1482 type ListJobTemplatesResponse struct { 1483 // JobTemplates: List of job templates in the specified region. 1484 JobTemplates []*JobTemplate `json:"jobTemplates,omitempty"` 1485 // NextPageToken: The pagination token. 1486 NextPageToken string `json:"nextPageToken,omitempty"` 1487 // Unreachable: List of regions that could not be reached. 1488 Unreachable []string `json:"unreachable,omitempty"` 1489 1490 // ServerResponse contains the HTTP response code and headers from the server. 1491 googleapi.ServerResponse `json:"-"` 1492 // ForceSendFields is a list of field names (e.g. "JobTemplates") to 1493 // unconditionally include in API requests. By default, fields with empty or 1494 // default values are omitted from API requests. See 1495 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1496 // details. 1497 ForceSendFields []string `json:"-"` 1498 // NullFields is a list of field names (e.g. "JobTemplates") to include in API 1499 // requests with the JSON null value. By default, fields with empty values are 1500 // omitted from API requests. See 1501 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1502 NullFields []string `json:"-"` 1503 } 1504 1505 func (s *ListJobTemplatesResponse) MarshalJSON() ([]byte, error) { 1506 type NoMethod ListJobTemplatesResponse 1507 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1508 } 1509 1510 // ListJobsResponse: Response message for `TranscoderService.ListJobs`. 1511 type ListJobsResponse struct { 1512 // Jobs: List of jobs in the specified region. 1513 Jobs []*Job `json:"jobs,omitempty"` 1514 // NextPageToken: The pagination token. 1515 NextPageToken string `json:"nextPageToken,omitempty"` 1516 // Unreachable: List of regions that could not be reached. 1517 Unreachable []string `json:"unreachable,omitempty"` 1518 1519 // ServerResponse contains the HTTP response code and headers from the server. 1520 googleapi.ServerResponse `json:"-"` 1521 // ForceSendFields is a list of field names (e.g. "Jobs") to unconditionally 1522 // include in API requests. By default, fields with empty or default values are 1523 // omitted from API requests. See 1524 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1525 // details. 1526 ForceSendFields []string `json:"-"` 1527 // NullFields is a list of field names (e.g. "Jobs") to include in API requests 1528 // with the JSON null value. By default, fields with empty values are omitted 1529 // from API requests. See 1530 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1531 NullFields []string `json:"-"` 1532 } 1533 1534 func (s *ListJobsResponse) MarshalJSON() ([]byte, error) { 1535 type NoMethod ListJobsResponse 1536 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1537 } 1538 1539 // Manifest: Manifest configuration. 1540 type Manifest struct { 1541 // Dash: `DASH` manifest configuration. 1542 Dash *DashConfig `json:"dash,omitempty"` 1543 // FileName: The name of the generated file. The default is `manifest` with the 1544 // extension suffix corresponding to the Manifest.type. 1545 FileName string `json:"fileName,omitempty"` 1546 // MuxStreams: Required. List of user supplied MuxStream.key values that should 1547 // appear in this manifest. When Manifest.type is `HLS`, a media manifest with 1548 // name MuxStream.key and `.m3u8` extension is generated for each element in 1549 // this list. 1550 MuxStreams []string `json:"muxStreams,omitempty"` 1551 // Type: Required. Type of the manifest. 1552 // 1553 // Possible values: 1554 // "MANIFEST_TYPE_UNSPECIFIED" - The manifest type is not specified. 1555 // "HLS" - Create an HLS manifest. The corresponding file extension is 1556 // `.m3u8`. 1557 // "DASH" - Create an MPEG-DASH manifest. The corresponding file extension is 1558 // `.mpd`. 1559 Type string `json:"type,omitempty"` 1560 // ForceSendFields is a list of field names (e.g. "Dash") to unconditionally 1561 // include in API requests. By default, fields with empty or default values are 1562 // omitted from API requests. See 1563 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1564 // details. 1565 ForceSendFields []string `json:"-"` 1566 // NullFields is a list of field names (e.g. "Dash") to include in API requests 1567 // with the JSON null value. By default, fields with empty values are omitted 1568 // from API requests. See 1569 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1570 NullFields []string `json:"-"` 1571 } 1572 1573 func (s *Manifest) MarshalJSON() ([]byte, error) { 1574 type NoMethod Manifest 1575 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1576 } 1577 1578 // MpegCommonEncryption: Configuration for MPEG Common Encryption (MPEG-CENC). 1579 type MpegCommonEncryption struct { 1580 // Scheme: Required. Specify the encryption scheme. Supported encryption 1581 // schemes: - `cenc` - `cbcs` 1582 Scheme string `json:"scheme,omitempty"` 1583 // ForceSendFields is a list of field names (e.g. "Scheme") to unconditionally 1584 // include in API requests. By default, fields with empty or default values are 1585 // omitted from API requests. See 1586 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1587 // details. 1588 ForceSendFields []string `json:"-"` 1589 // NullFields is a list of field names (e.g. "Scheme") to include in API 1590 // requests with the JSON null value. By default, fields with empty values are 1591 // omitted from API requests. See 1592 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1593 NullFields []string `json:"-"` 1594 } 1595 1596 func (s *MpegCommonEncryption) MarshalJSON() ([]byte, error) { 1597 type NoMethod MpegCommonEncryption 1598 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1599 } 1600 1601 // MuxStream: Multiplexing settings for output stream. 1602 type MuxStream struct { 1603 // Container: The container format. The default is `mp4` Supported container 1604 // formats: - `ts` - `fmp4`- the corresponding file extension is `.m4s` - `mp4` 1605 // - `vtt` See also: Supported input and output formats 1606 // (https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats) 1607 Container string `json:"container,omitempty"` 1608 // ElementaryStreams: List of ElementaryStream.key values multiplexed in this 1609 // stream. 1610 ElementaryStreams []string `json:"elementaryStreams,omitempty"` 1611 // EncryptionId: Identifier of the encryption configuration to use. If omitted, 1612 // output will be unencrypted. 1613 EncryptionId string `json:"encryptionId,omitempty"` 1614 // FileName: The name of the generated file. The default is MuxStream.key with 1615 // the extension suffix corresponding to the MuxStream.container. Individual 1616 // segments also have an incremental 10-digit zero-padded suffix starting from 1617 // 0 before the extension, such as `mux_stream0000000123.ts`. 1618 FileName string `json:"fileName,omitempty"` 1619 // Fmp4: Optional. `fmp4` container configuration. 1620 Fmp4 *Fmp4Config `json:"fmp4,omitempty"` 1621 // Key: A unique key for this multiplexed stream. 1622 Key string `json:"key,omitempty"` 1623 // SegmentSettings: Segment settings for `ts`, `fmp4` and `vtt`. 1624 SegmentSettings *SegmentSettings `json:"segmentSettings,omitempty"` 1625 // ForceSendFields is a list of field names (e.g. "Container") to 1626 // unconditionally include in API requests. By default, fields with empty or 1627 // default values are omitted from API requests. See 1628 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1629 // details. 1630 ForceSendFields []string `json:"-"` 1631 // NullFields is a list of field names (e.g. "Container") to include in API 1632 // requests with the JSON null value. By default, fields with empty values are 1633 // omitted from API requests. See 1634 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1635 NullFields []string `json:"-"` 1636 } 1637 1638 func (s *MuxStream) MarshalJSON() ([]byte, error) { 1639 type NoMethod MuxStream 1640 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1641 } 1642 1643 // NormalizedCoordinate: 2D normalized coordinates. Default: `{0.0, 0.0}` 1644 type NormalizedCoordinate struct { 1645 // X: Normalized x coordinate. 1646 X float64 `json:"x,omitempty"` 1647 // Y: Normalized y coordinate. 1648 Y float64 `json:"y,omitempty"` 1649 // ForceSendFields is a list of field names (e.g. "X") to unconditionally 1650 // include in API requests. By default, fields with empty or default values are 1651 // omitted from API requests. See 1652 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1653 // details. 1654 ForceSendFields []string `json:"-"` 1655 // NullFields is a list of field names (e.g. "X") to include in API requests 1656 // with the JSON null value. By default, fields with empty values are omitted 1657 // from API requests. See 1658 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1659 NullFields []string `json:"-"` 1660 } 1661 1662 func (s *NormalizedCoordinate) MarshalJSON() ([]byte, error) { 1663 type NoMethod NormalizedCoordinate 1664 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1665 } 1666 1667 func (s *NormalizedCoordinate) UnmarshalJSON(data []byte) error { 1668 type NoMethod NormalizedCoordinate 1669 var s1 struct { 1670 X gensupport.JSONFloat64 `json:"x"` 1671 Y gensupport.JSONFloat64 `json:"y"` 1672 *NoMethod 1673 } 1674 s1.NoMethod = (*NoMethod)(s) 1675 if err := json.Unmarshal(data, &s1); err != nil { 1676 return err 1677 } 1678 s.X = float64(s1.X) 1679 s.Y = float64(s1.Y) 1680 return nil 1681 } 1682 1683 // Output: Location of output file(s) in a Cloud Storage bucket. 1684 type Output struct { 1685 // Uri: URI for the output file(s). For example, `gs://my-bucket/outputs/`. If 1686 // empty, the value is populated from Job.output_uri. See Supported input and 1687 // output formats 1688 // (https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats). 1689 Uri string `json:"uri,omitempty"` 1690 // ForceSendFields is a list of field names (e.g. "Uri") to unconditionally 1691 // include in API requests. By default, fields with empty or default values are 1692 // omitted from API requests. See 1693 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1694 // details. 1695 ForceSendFields []string `json:"-"` 1696 // NullFields is a list of field names (e.g. "Uri") to include in API requests 1697 // with the JSON null value. By default, fields with empty values are omitted 1698 // from API requests. See 1699 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1700 NullFields []string `json:"-"` 1701 } 1702 1703 func (s *Output) MarshalJSON() ([]byte, error) { 1704 type NoMethod Output 1705 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1706 } 1707 1708 // Overlay: Overlay configuration. 1709 type Overlay struct { 1710 // Animations: List of animations. The list should be chronological, without 1711 // any time overlap. 1712 Animations []*Animation `json:"animations,omitempty"` 1713 // Image: Image overlay. 1714 Image *Image `json:"image,omitempty"` 1715 // ForceSendFields is a list of field names (e.g. "Animations") to 1716 // unconditionally include in API requests. By default, fields with empty or 1717 // default values are omitted from API requests. See 1718 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1719 // details. 1720 ForceSendFields []string `json:"-"` 1721 // NullFields is a list of field names (e.g. "Animations") to include in API 1722 // requests with the JSON null value. By default, fields with empty values are 1723 // omitted from API requests. See 1724 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1725 NullFields []string `json:"-"` 1726 } 1727 1728 func (s *Overlay) MarshalJSON() ([]byte, error) { 1729 type NoMethod Overlay 1730 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1731 } 1732 1733 // Pad: Pad filter configuration for the input video. The padded input video is 1734 // scaled after padding with black to match the output resolution. 1735 type Pad struct { 1736 // BottomPixels: The number of pixels to add to the bottom. The default is 0. 1737 BottomPixels int64 `json:"bottomPixels,omitempty"` 1738 // LeftPixels: The number of pixels to add to the left. The default is 0. 1739 LeftPixels int64 `json:"leftPixels,omitempty"` 1740 // RightPixels: The number of pixels to add to the right. The default is 0. 1741 RightPixels int64 `json:"rightPixels,omitempty"` 1742 // TopPixels: The number of pixels to add to the top. The default is 0. 1743 TopPixels int64 `json:"topPixels,omitempty"` 1744 // ForceSendFields is a list of field names (e.g. "BottomPixels") to 1745 // unconditionally include in API requests. By default, fields with empty or 1746 // default values are omitted from API requests. See 1747 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1748 // details. 1749 ForceSendFields []string `json:"-"` 1750 // NullFields is a list of field names (e.g. "BottomPixels") to include in API 1751 // requests with the JSON null value. By default, fields with empty values are 1752 // omitted from API requests. See 1753 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1754 NullFields []string `json:"-"` 1755 } 1756 1757 func (s *Pad) MarshalJSON() ([]byte, error) { 1758 type NoMethod Pad 1759 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1760 } 1761 1762 // Playready: Playready configuration. 1763 type Playready struct { 1764 } 1765 1766 // PreprocessingConfig: Preprocessing configurations. 1767 type PreprocessingConfig struct { 1768 // Audio: Audio preprocessing configuration. 1769 Audio *Audio `json:"audio,omitempty"` 1770 // Color: Color preprocessing configuration. 1771 Color *Color `json:"color,omitempty"` 1772 // Crop: Specify the video cropping configuration. 1773 Crop *Crop `json:"crop,omitempty"` 1774 // Deblock: Deblock preprocessing configuration. 1775 Deblock *Deblock `json:"deblock,omitempty"` 1776 // Deinterlace: Specify the video deinterlace configuration. 1777 Deinterlace *Deinterlace `json:"deinterlace,omitempty"` 1778 // Denoise: Denoise preprocessing configuration. 1779 Denoise *Denoise `json:"denoise,omitempty"` 1780 // Pad: Specify the video pad filter configuration. 1781 Pad *Pad `json:"pad,omitempty"` 1782 // ForceSendFields is a list of field names (e.g. "Audio") to unconditionally 1783 // include in API requests. By default, fields with empty or default values are 1784 // omitted from API requests. See 1785 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1786 // details. 1787 ForceSendFields []string `json:"-"` 1788 // NullFields is a list of field names (e.g. "Audio") to include in API 1789 // requests with the JSON null value. By default, fields with empty values are 1790 // omitted from API requests. See 1791 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1792 NullFields []string `json:"-"` 1793 } 1794 1795 func (s *PreprocessingConfig) MarshalJSON() ([]byte, error) { 1796 type NoMethod PreprocessingConfig 1797 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1798 } 1799 1800 // PubsubDestination: A Pub/Sub destination. 1801 type PubsubDestination struct { 1802 // Topic: The name of the Pub/Sub topic to publish job completion notification 1803 // to. For example: `projects/{project}/topics/{topic}`. 1804 Topic string `json:"topic,omitempty"` 1805 // ForceSendFields is a list of field names (e.g. "Topic") to unconditionally 1806 // include in API requests. By default, fields with empty or default values are 1807 // omitted from API requests. See 1808 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1809 // details. 1810 ForceSendFields []string `json:"-"` 1811 // NullFields is a list of field names (e.g. "Topic") to include in API 1812 // requests with the JSON null value. By default, fields with empty values are 1813 // omitted from API requests. See 1814 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1815 NullFields []string `json:"-"` 1816 } 1817 1818 func (s *PubsubDestination) MarshalJSON() ([]byte, error) { 1819 type NoMethod PubsubDestination 1820 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1821 } 1822 1823 // SampleAesEncryption: Configuration for SAMPLE-AES encryption. 1824 type SampleAesEncryption struct { 1825 } 1826 1827 // SecretManagerSource: Configuration for secrets stored in Google Secret 1828 // Manager. 1829 type SecretManagerSource struct { 1830 // SecretVersion: Required. The name of the Secret Version containing the 1831 // encryption key in the following format: 1832 // `projects/{project}/secrets/{secret_id}/versions/{version_number}` Note that 1833 // only numbered versions are supported. Aliases like "latest" are not 1834 // supported. 1835 SecretVersion string `json:"secretVersion,omitempty"` 1836 // ForceSendFields is a list of field names (e.g. "SecretVersion") to 1837 // unconditionally include in API requests. By default, fields with empty or 1838 // default values are omitted from API requests. See 1839 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1840 // details. 1841 ForceSendFields []string `json:"-"` 1842 // NullFields is a list of field names (e.g. "SecretVersion") to include in API 1843 // requests with the JSON null value. By default, fields with empty values are 1844 // omitted from API requests. See 1845 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1846 NullFields []string `json:"-"` 1847 } 1848 1849 func (s *SecretManagerSource) MarshalJSON() ([]byte, error) { 1850 type NoMethod SecretManagerSource 1851 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1852 } 1853 1854 // SegmentSettings: Segment settings for `ts`, `fmp4` and `vtt`. 1855 type SegmentSettings struct { 1856 // IndividualSegments: Required. Create an individual segment file. The default 1857 // is `false`. 1858 IndividualSegments bool `json:"individualSegments,omitempty"` 1859 // SegmentDuration: Duration of the segments in seconds. The default is `6.0s`. 1860 // Note that `segmentDuration` must be greater than or equal to `gopDuration` 1861 // (#videostream), and `segmentDuration` must be divisible by `gopDuration` 1862 // (#videostream). 1863 SegmentDuration string `json:"segmentDuration,omitempty"` 1864 // ForceSendFields is a list of field names (e.g. "IndividualSegments") to 1865 // unconditionally include in API requests. By default, fields with empty or 1866 // default values are omitted from API requests. See 1867 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1868 // details. 1869 ForceSendFields []string `json:"-"` 1870 // NullFields is a list of field names (e.g. "IndividualSegments") to include 1871 // in API requests with the JSON null value. By default, fields with empty 1872 // values are omitted from API requests. See 1873 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1874 NullFields []string `json:"-"` 1875 } 1876 1877 func (s *SegmentSettings) MarshalJSON() ([]byte, error) { 1878 type NoMethod SegmentSettings 1879 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1880 } 1881 1882 // SpriteSheet: Sprite sheet configuration. 1883 type SpriteSheet struct { 1884 // ColumnCount: The maximum number of sprites per row in a sprite sheet. The 1885 // default is 0, which indicates no maximum limit. 1886 ColumnCount int64 `json:"columnCount,omitempty"` 1887 // EndTimeOffset: End time in seconds, relative to the output file timeline. 1888 // When `end_time_offset` is not specified, the sprites are generated until the 1889 // end of the output file. 1890 EndTimeOffset string `json:"endTimeOffset,omitempty"` 1891 // FilePrefix: Required. File name prefix for the generated sprite sheets. Each 1892 // sprite sheet has an incremental 10-digit zero-padded suffix starting from 0 1893 // before the extension, such as `sprite_sheet0000000123.jpeg`. 1894 FilePrefix string `json:"filePrefix,omitempty"` 1895 // Format: Format type. The default is `jpeg`. Supported formats: - `jpeg` 1896 Format string `json:"format,omitempty"` 1897 // Interval: Starting from `0s`, create sprites at regular intervals. Specify 1898 // the interval value in seconds. 1899 Interval string `json:"interval,omitempty"` 1900 // Quality: The quality of the generated sprite sheet. Enter a value between 1 1901 // and 100, where 1 is the lowest quality and 100 is the highest quality. The 1902 // default is 100. A high quality value corresponds to a low image data 1903 // compression ratio. 1904 Quality int64 `json:"quality,omitempty"` 1905 // RowCount: The maximum number of rows per sprite sheet. When the sprite sheet 1906 // is full, a new sprite sheet is created. The default is 0, which indicates no 1907 // maximum limit. 1908 RowCount int64 `json:"rowCount,omitempty"` 1909 // SpriteHeightPixels: Required. The height of sprite in pixels. Must be an 1910 // even integer. To preserve the source aspect ratio, set the 1911 // SpriteSheet.sprite_height_pixels field or the 1912 // SpriteSheet.sprite_width_pixels field, but not both (the API will 1913 // automatically calculate the missing field). For portrait videos that contain 1914 // horizontal ASR and rotation metadata, provide the height, in pixels, per the 1915 // horizontal ASR. The API calculates the width per the horizontal ASR. The API 1916 // detects any rotation metadata and swaps the requested height and width for 1917 // the output. 1918 SpriteHeightPixels int64 `json:"spriteHeightPixels,omitempty"` 1919 // SpriteWidthPixels: Required. The width of sprite in pixels. Must be an even 1920 // integer. To preserve the source aspect ratio, set the 1921 // SpriteSheet.sprite_width_pixels field or the 1922 // SpriteSheet.sprite_height_pixels field, but not both (the API will 1923 // automatically calculate the missing field). For portrait videos that contain 1924 // horizontal ASR and rotation metadata, provide the width, in pixels, per the 1925 // horizontal ASR. The API calculates the height per the horizontal ASR. The 1926 // API detects any rotation metadata and swaps the requested height and width 1927 // for the output. 1928 SpriteWidthPixels int64 `json:"spriteWidthPixels,omitempty"` 1929 // StartTimeOffset: Start time in seconds, relative to the output file 1930 // timeline. Determines the first sprite to pick. The default is `0s`. 1931 StartTimeOffset string `json:"startTimeOffset,omitempty"` 1932 // TotalCount: Total number of sprites. Create the specified number of sprites 1933 // distributed evenly across the timeline of the output media. The default is 1934 // 100. 1935 TotalCount int64 `json:"totalCount,omitempty"` 1936 // ForceSendFields is a list of field names (e.g. "ColumnCount") to 1937 // unconditionally include in API requests. By default, fields with empty or 1938 // default values are omitted from API requests. See 1939 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1940 // details. 1941 ForceSendFields []string `json:"-"` 1942 // NullFields is a list of field names (e.g. "ColumnCount") to include in API 1943 // requests with the JSON null value. By default, fields with empty values are 1944 // omitted from API requests. See 1945 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1946 NullFields []string `json:"-"` 1947 } 1948 1949 func (s *SpriteSheet) MarshalJSON() ([]byte, error) { 1950 type NoMethod SpriteSheet 1951 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1952 } 1953 1954 // Status: The `Status` type defines a logical error model that is suitable for 1955 // different programming environments, including REST APIs and RPC APIs. It is 1956 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 1957 // pieces of data: error code, error message, and error details. You can find 1958 // out more about this error model and how to work with it in the API Design 1959 // Guide (https://cloud.google.com/apis/design/errors). 1960 type Status struct { 1961 // Code: The status code, which should be an enum value of google.rpc.Code. 1962 Code int64 `json:"code,omitempty"` 1963 // Details: A list of messages that carry the error details. There is a common 1964 // set of message types for APIs to use. 1965 Details []googleapi.RawMessage `json:"details,omitempty"` 1966 // Message: A developer-facing error message, which should be in English. Any 1967 // user-facing error message should be localized and sent in the 1968 // google.rpc.Status.details field, or localized by the client. 1969 Message string `json:"message,omitempty"` 1970 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 1971 // include in API requests. By default, fields with empty or default values are 1972 // omitted from API requests. See 1973 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1974 // details. 1975 ForceSendFields []string `json:"-"` 1976 // NullFields is a list of field names (e.g. "Code") to include in API requests 1977 // with the JSON null value. By default, fields with empty values are omitted 1978 // from API requests. See 1979 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1980 NullFields []string `json:"-"` 1981 } 1982 1983 func (s *Status) MarshalJSON() ([]byte, error) { 1984 type NoMethod Status 1985 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1986 } 1987 1988 // TextMapping: The mapping for the JobConfig.edit_list atoms with text 1989 // EditAtom.inputs. 1990 type TextMapping struct { 1991 // AtomKey: Required. The EditAtom.key that references atom with text inputs in 1992 // the JobConfig.edit_list. 1993 AtomKey string `json:"atomKey,omitempty"` 1994 // InputKey: Required. The Input.key that identifies the input file. 1995 InputKey string `json:"inputKey,omitempty"` 1996 // InputTrack: Required. The zero-based index of the track in the input file. 1997 InputTrack int64 `json:"inputTrack,omitempty"` 1998 // ForceSendFields is a list of field names (e.g. "AtomKey") to unconditionally 1999 // include in API requests. By default, fields with empty or default values are 2000 // omitted from API requests. See 2001 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2002 // details. 2003 ForceSendFields []string `json:"-"` 2004 // NullFields is a list of field names (e.g. "AtomKey") to include in API 2005 // requests with the JSON null value. By default, fields with empty values are 2006 // omitted from API requests. See 2007 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2008 NullFields []string `json:"-"` 2009 } 2010 2011 func (s *TextMapping) MarshalJSON() ([]byte, error) { 2012 type NoMethod TextMapping 2013 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2014 } 2015 2016 // TextStream: Encoding of a text stream. For example, closed captions or 2017 // subtitles. 2018 type TextStream struct { 2019 // Codec: The codec for this text stream. The default is `webvtt`. Supported 2020 // text codecs: - `srt` - `ttml` - `cea608` - `cea708` - `webvtt` 2021 Codec string `json:"codec,omitempty"` 2022 // DisplayName: The name for this particular text stream that will be added to 2023 // the HLS/DASH manifest. Not supported in MP4 files. 2024 DisplayName string `json:"displayName,omitempty"` 2025 // LanguageCode: The BCP-47 language code, such as `en-US` or `sr-Latn`. For 2026 // more information, see 2027 // https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. Not 2028 // supported in MP4 files. 2029 LanguageCode string `json:"languageCode,omitempty"` 2030 // Mapping: The mapping for the JobConfig.edit_list atoms with text 2031 // EditAtom.inputs. 2032 Mapping []*TextMapping `json:"mapping,omitempty"` 2033 // ForceSendFields is a list of field names (e.g. "Codec") to unconditionally 2034 // include in API requests. By default, fields with empty or default values are 2035 // omitted from API requests. See 2036 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2037 // details. 2038 ForceSendFields []string `json:"-"` 2039 // NullFields is a list of field names (e.g. "Codec") to include in API 2040 // requests with the JSON null value. By default, fields with empty values are 2041 // omitted from API requests. See 2042 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2043 NullFields []string `json:"-"` 2044 } 2045 2046 func (s *TextStream) MarshalJSON() ([]byte, error) { 2047 type NoMethod TextStream 2048 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2049 } 2050 2051 // VideoStream: Video stream resource. 2052 type VideoStream struct { 2053 // H264: H264 codec settings. 2054 H264 *H264CodecSettings `json:"h264,omitempty"` 2055 // H265: H265 codec settings. 2056 H265 *H265CodecSettings `json:"h265,omitempty"` 2057 // Vp9: VP9 codec settings. 2058 Vp9 *Vp9CodecSettings `json:"vp9,omitempty"` 2059 // ForceSendFields is a list of field names (e.g. "H264") to unconditionally 2060 // include in API requests. By default, fields with empty or default values are 2061 // omitted from API requests. See 2062 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2063 // details. 2064 ForceSendFields []string `json:"-"` 2065 // NullFields is a list of field names (e.g. "H264") to include in API requests 2066 // with the JSON null value. By default, fields with empty values are omitted 2067 // from API requests. See 2068 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2069 NullFields []string `json:"-"` 2070 } 2071 2072 func (s *VideoStream) MarshalJSON() ([]byte, error) { 2073 type NoMethod VideoStream 2074 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2075 } 2076 2077 // Vp9CodecSettings: VP9 codec settings. 2078 type Vp9CodecSettings struct { 2079 // BitrateBps: Required. The video bitrate in bits per second. The minimum 2080 // value is 1,000. The maximum value is 480,000,000. 2081 BitrateBps int64 `json:"bitrateBps,omitempty"` 2082 // CrfLevel: Target CRF level. Must be between 10 and 36, where 10 is the 2083 // highest quality and 36 is the most efficient compression. The default is 21. 2084 // **Note:** This field is not supported. 2085 CrfLevel int64 `json:"crfLevel,omitempty"` 2086 // FrameRate: Required. The target video frame rate in frames per second (FPS). 2087 // Must be less than or equal to 120. 2088 FrameRate float64 `json:"frameRate,omitempty"` 2089 // FrameRateConversionStrategy: Optional. Frame rate conversion strategy for 2090 // desired frame rate. The default is `DOWNSAMPLE`. 2091 // 2092 // Possible values: 2093 // "FRAME_RATE_CONVERSION_STRATEGY_UNSPECIFIED" - Unspecified frame rate 2094 // conversion strategy. 2095 // "DOWNSAMPLE" - Selectively retain frames to reduce the output frame rate. 2096 // Every _n_ th frame is kept, where `n = ceil(input frame rate / target frame 2097 // rate)`. When _n_ = 1 (that is, the target frame rate is greater than the 2098 // input frame rate), the output frame rate matches the input frame rate. When 2099 // _n_ > 1, frames are dropped and the output frame rate is equal to `(input 2100 // frame rate / n)`. For more information, see [Calculate frame 2101 // rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate). 2102 // "DROP_DUPLICATE" - Drop or duplicate frames to match the specified frame 2103 // rate. 2104 FrameRateConversionStrategy string `json:"frameRateConversionStrategy,omitempty"` 2105 // GopDuration: Select the GOP size based on the specified duration. The 2106 // default is `3s`. Note that `gopDuration` must be less than or equal to 2107 // `segmentDuration` (#SegmentSettings), and `segmentDuration` 2108 // (#SegmentSettings) must be divisible by `gopDuration`. 2109 GopDuration string `json:"gopDuration,omitempty"` 2110 // GopFrameCount: Select the GOP size based on the specified frame count. Must 2111 // be greater than zero. 2112 GopFrameCount int64 `json:"gopFrameCount,omitempty"` 2113 // HeightPixels: The height of the video in pixels. Must be an even integer. 2114 // When not specified, the height is adjusted to match the specified width and 2115 // input aspect ratio. If both are omitted, the input height is used. For 2116 // portrait videos that contain horizontal ASR and rotation metadata, provide 2117 // the height, in pixels, per the horizontal ASR. The API calculates the width 2118 // per the horizontal ASR. The API detects any rotation metadata and swaps the 2119 // requested height and width for the output. 2120 HeightPixels int64 `json:"heightPixels,omitempty"` 2121 // Hlg: Optional. HLG color format setting for VP9. 2122 Hlg *Vp9ColorFormatHLG `json:"hlg,omitempty"` 2123 // PixelFormat: Pixel format to use. The default is `yuv420p`. Supported pixel 2124 // formats: - `yuv420p` pixel format - `yuv422p` pixel format - `yuv444p` pixel 2125 // format - `yuv420p10` 10-bit HDR pixel format - `yuv422p10` 10-bit HDR pixel 2126 // format - `yuv444p10` 10-bit HDR pixel format - `yuv420p12` 12-bit HDR pixel 2127 // format - `yuv422p12` 12-bit HDR pixel format - `yuv444p12` 12-bit HDR pixel 2128 // format 2129 PixelFormat string `json:"pixelFormat,omitempty"` 2130 // Profile: Enforces the specified codec profile. The following profiles are 2131 // supported: * `profile0` (default) * `profile1` * `profile2` * `profile3` The 2132 // available options are WebM-compatible 2133 // (https://www.webmproject.org/vp9/profiles/). Note that certain values for 2134 // this field may cause the transcoder to override other fields you set in the 2135 // `Vp9CodecSettings` message. 2136 Profile string `json:"profile,omitempty"` 2137 // RateControlMode: Specify the mode. The default is `vbr`. Supported rate 2138 // control modes: - `vbr` - variable bitrate 2139 RateControlMode string `json:"rateControlMode,omitempty"` 2140 // Sdr: Optional. SDR color format setting for VP9. 2141 Sdr *Vp9ColorFormatSDR `json:"sdr,omitempty"` 2142 // WidthPixels: The width of the video in pixels. Must be an even integer. When 2143 // not specified, the width is adjusted to match the specified height and input 2144 // aspect ratio. If both are omitted, the input width is used. For portrait 2145 // videos that contain horizontal ASR and rotation metadata, provide the width, 2146 // in pixels, per the horizontal ASR. The API calculates the height per the 2147 // horizontal ASR. The API detects any rotation metadata and swaps the 2148 // requested height and width for the output. 2149 WidthPixels int64 `json:"widthPixels,omitempty"` 2150 // ForceSendFields is a list of field names (e.g. "BitrateBps") to 2151 // unconditionally include in API requests. By default, fields with empty or 2152 // default values are omitted from API requests. See 2153 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2154 // details. 2155 ForceSendFields []string `json:"-"` 2156 // NullFields is a list of field names (e.g. "BitrateBps") to include in API 2157 // requests with the JSON null value. By default, fields with empty values are 2158 // omitted from API requests. See 2159 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2160 NullFields []string `json:"-"` 2161 } 2162 2163 func (s *Vp9CodecSettings) MarshalJSON() ([]byte, error) { 2164 type NoMethod Vp9CodecSettings 2165 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2166 } 2167 2168 func (s *Vp9CodecSettings) UnmarshalJSON(data []byte) error { 2169 type NoMethod Vp9CodecSettings 2170 var s1 struct { 2171 FrameRate gensupport.JSONFloat64 `json:"frameRate"` 2172 *NoMethod 2173 } 2174 s1.NoMethod = (*NoMethod)(s) 2175 if err := json.Unmarshal(data, &s1); err != nil { 2176 return err 2177 } 2178 s.FrameRate = float64(s1.FrameRate) 2179 return nil 2180 } 2181 2182 // Vp9ColorFormatHLG: Convert the input video to a Hybrid Log Gamma (HLG) 2183 // video. 2184 type Vp9ColorFormatHLG struct { 2185 } 2186 2187 // Vp9ColorFormatSDR: Convert the input video to a Standard Dynamic Range (SDR) 2188 // video. 2189 type Vp9ColorFormatSDR struct { 2190 } 2191 2192 // Widevine: Widevine configuration. 2193 type Widevine struct { 2194 } 2195 2196 // YadifConfig: Yet Another Deinterlacing Filter Configuration. 2197 type YadifConfig struct { 2198 // DeinterlaceAllFrames: Deinterlace all frames rather than just the frames 2199 // identified as interlaced. The default is `false`. 2200 DeinterlaceAllFrames bool `json:"deinterlaceAllFrames,omitempty"` 2201 // DisableSpatialInterlacing: Disable spacial interlacing. The default is 2202 // `false`. 2203 DisableSpatialInterlacing bool `json:"disableSpatialInterlacing,omitempty"` 2204 // Mode: Specifies the deinterlacing mode to adopt. The default is 2205 // `send_frame`. Supported values: - `send_frame`: Output one frame for each 2206 // frame - `send_field`: Output one frame for each field 2207 Mode string `json:"mode,omitempty"` 2208 // Parity: The picture field parity assumed for the input interlaced video. The 2209 // default is `auto`. Supported values: - `tff`: Assume the top field is first 2210 // - `bff`: Assume the bottom field is first - `auto`: Enable automatic 2211 // detection of field parity 2212 Parity string `json:"parity,omitempty"` 2213 // ForceSendFields is a list of field names (e.g. "DeinterlaceAllFrames") to 2214 // unconditionally include in API requests. By default, fields with empty or 2215 // default values are omitted from API requests. See 2216 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2217 // details. 2218 ForceSendFields []string `json:"-"` 2219 // NullFields is a list of field names (e.g. "DeinterlaceAllFrames") to include 2220 // in API requests with the JSON null value. By default, fields with empty 2221 // values are omitted from API requests. See 2222 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2223 NullFields []string `json:"-"` 2224 } 2225 2226 func (s *YadifConfig) MarshalJSON() ([]byte, error) { 2227 type NoMethod YadifConfig 2228 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2229 } 2230 2231 type ProjectsLocationsJobTemplatesCreateCall struct { 2232 s *Service 2233 parent string 2234 jobtemplate *JobTemplate 2235 urlParams_ gensupport.URLParams 2236 ctx_ context.Context 2237 header_ http.Header 2238 } 2239 2240 // Create: Creates a job template in the specified region. 2241 // 2242 // - parent: The parent location to create this job template. Format: 2243 // `projects/{project}/locations/{location}`. 2244 func (r *ProjectsLocationsJobTemplatesService) Create(parent string, jobtemplate *JobTemplate) *ProjectsLocationsJobTemplatesCreateCall { 2245 c := &ProjectsLocationsJobTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2246 c.parent = parent 2247 c.jobtemplate = jobtemplate 2248 return c 2249 } 2250 2251 // JobTemplateId sets the optional parameter "jobTemplateId": Required. The ID 2252 // to use for the job template, which will become the final component of the 2253 // job template's resource name. This value should be 4-63 characters, and 2254 // valid characters must match the regular expression `a-zA-Z*`. 2255 func (c *ProjectsLocationsJobTemplatesCreateCall) JobTemplateId(jobTemplateId string) *ProjectsLocationsJobTemplatesCreateCall { 2256 c.urlParams_.Set("jobTemplateId", jobTemplateId) 2257 return c 2258 } 2259 2260 // Fields allows partial responses to be retrieved. See 2261 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2262 // details. 2263 func (c *ProjectsLocationsJobTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobTemplatesCreateCall { 2264 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2265 return c 2266 } 2267 2268 // Context sets the context to be used in this call's Do method. 2269 func (c *ProjectsLocationsJobTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsJobTemplatesCreateCall { 2270 c.ctx_ = ctx 2271 return c 2272 } 2273 2274 // Header returns a http.Header that can be modified by the caller to add 2275 // headers to the request. 2276 func (c *ProjectsLocationsJobTemplatesCreateCall) Header() http.Header { 2277 if c.header_ == nil { 2278 c.header_ = make(http.Header) 2279 } 2280 return c.header_ 2281 } 2282 2283 func (c *ProjectsLocationsJobTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { 2284 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2285 var body io.Reader = nil 2286 body, err := googleapi.WithoutDataWrapper.JSONReader(c.jobtemplate) 2287 if err != nil { 2288 return nil, err 2289 } 2290 c.urlParams_.Set("alt", alt) 2291 c.urlParams_.Set("prettyPrint", "false") 2292 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobTemplates") 2293 urls += "?" + c.urlParams_.Encode() 2294 req, err := http.NewRequest("POST", urls, body) 2295 if err != nil { 2296 return nil, err 2297 } 2298 req.Header = reqHeaders 2299 googleapi.Expand(req.URL, map[string]string{ 2300 "parent": c.parent, 2301 }) 2302 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2303 } 2304 2305 // Do executes the "transcoder.projects.locations.jobTemplates.create" call. 2306 // Any non-2xx status code is an error. Response headers are in either 2307 // *JobTemplate.ServerResponse.Header or (if a response was returned at all) in 2308 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2309 // whether the returned error was because http.StatusNotModified was returned. 2310 func (c *ProjectsLocationsJobTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*JobTemplate, error) { 2311 gensupport.SetOptions(c.urlParams_, opts...) 2312 res, err := c.doRequest("json") 2313 if res != nil && res.StatusCode == http.StatusNotModified { 2314 if res.Body != nil { 2315 res.Body.Close() 2316 } 2317 return nil, gensupport.WrapError(&googleapi.Error{ 2318 Code: res.StatusCode, 2319 Header: res.Header, 2320 }) 2321 } 2322 if err != nil { 2323 return nil, err 2324 } 2325 defer googleapi.CloseBody(res) 2326 if err := googleapi.CheckResponse(res); err != nil { 2327 return nil, gensupport.WrapError(err) 2328 } 2329 ret := &JobTemplate{ 2330 ServerResponse: googleapi.ServerResponse{ 2331 Header: res.Header, 2332 HTTPStatusCode: res.StatusCode, 2333 }, 2334 } 2335 target := &ret 2336 if err := gensupport.DecodeResponse(target, res); err != nil { 2337 return nil, err 2338 } 2339 return ret, nil 2340 } 2341 2342 type ProjectsLocationsJobTemplatesDeleteCall struct { 2343 s *Service 2344 name string 2345 urlParams_ gensupport.URLParams 2346 ctx_ context.Context 2347 header_ http.Header 2348 } 2349 2350 // Delete: Deletes a job template. 2351 // 2352 // - name: The name of the job template to delete. 2353 // `projects/{project}/locations/{location}/jobTemplates/{job_template}`. 2354 func (r *ProjectsLocationsJobTemplatesService) Delete(name string) *ProjectsLocationsJobTemplatesDeleteCall { 2355 c := &ProjectsLocationsJobTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2356 c.name = name 2357 return c 2358 } 2359 2360 // AllowMissing sets the optional parameter "allowMissing": If set to true, and 2361 // the job template is not found, the request will succeed but no action will 2362 // be taken on the server. 2363 func (c *ProjectsLocationsJobTemplatesDeleteCall) AllowMissing(allowMissing bool) *ProjectsLocationsJobTemplatesDeleteCall { 2364 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) 2365 return c 2366 } 2367 2368 // Fields allows partial responses to be retrieved. See 2369 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2370 // details. 2371 func (c *ProjectsLocationsJobTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobTemplatesDeleteCall { 2372 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2373 return c 2374 } 2375 2376 // Context sets the context to be used in this call's Do method. 2377 func (c *ProjectsLocationsJobTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsJobTemplatesDeleteCall { 2378 c.ctx_ = ctx 2379 return c 2380 } 2381 2382 // Header returns a http.Header that can be modified by the caller to add 2383 // headers to the request. 2384 func (c *ProjectsLocationsJobTemplatesDeleteCall) Header() http.Header { 2385 if c.header_ == nil { 2386 c.header_ = make(http.Header) 2387 } 2388 return c.header_ 2389 } 2390 2391 func (c *ProjectsLocationsJobTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { 2392 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2393 var body io.Reader = nil 2394 c.urlParams_.Set("alt", alt) 2395 c.urlParams_.Set("prettyPrint", "false") 2396 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2397 urls += "?" + c.urlParams_.Encode() 2398 req, err := http.NewRequest("DELETE", urls, body) 2399 if err != nil { 2400 return nil, err 2401 } 2402 req.Header = reqHeaders 2403 googleapi.Expand(req.URL, map[string]string{ 2404 "name": c.name, 2405 }) 2406 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2407 } 2408 2409 // Do executes the "transcoder.projects.locations.jobTemplates.delete" call. 2410 // Any non-2xx status code is an error. Response headers are in either 2411 // *Empty.ServerResponse.Header or (if a response was returned at all) in 2412 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2413 // whether the returned error was because http.StatusNotModified was returned. 2414 func (c *ProjectsLocationsJobTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2415 gensupport.SetOptions(c.urlParams_, opts...) 2416 res, err := c.doRequest("json") 2417 if res != nil && res.StatusCode == http.StatusNotModified { 2418 if res.Body != nil { 2419 res.Body.Close() 2420 } 2421 return nil, gensupport.WrapError(&googleapi.Error{ 2422 Code: res.StatusCode, 2423 Header: res.Header, 2424 }) 2425 } 2426 if err != nil { 2427 return nil, err 2428 } 2429 defer googleapi.CloseBody(res) 2430 if err := googleapi.CheckResponse(res); err != nil { 2431 return nil, gensupport.WrapError(err) 2432 } 2433 ret := &Empty{ 2434 ServerResponse: googleapi.ServerResponse{ 2435 Header: res.Header, 2436 HTTPStatusCode: res.StatusCode, 2437 }, 2438 } 2439 target := &ret 2440 if err := gensupport.DecodeResponse(target, res); err != nil { 2441 return nil, err 2442 } 2443 return ret, nil 2444 } 2445 2446 type ProjectsLocationsJobTemplatesGetCall struct { 2447 s *Service 2448 name string 2449 urlParams_ gensupport.URLParams 2450 ifNoneMatch_ string 2451 ctx_ context.Context 2452 header_ http.Header 2453 } 2454 2455 // Get: Returns the job template data. 2456 // 2457 // - name: The name of the job template to retrieve. Format: 2458 // `projects/{project}/locations/{location}/jobTemplates/{job_template}`. 2459 func (r *ProjectsLocationsJobTemplatesService) Get(name string) *ProjectsLocationsJobTemplatesGetCall { 2460 c := &ProjectsLocationsJobTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2461 c.name = name 2462 return c 2463 } 2464 2465 // Fields allows partial responses to be retrieved. See 2466 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2467 // details. 2468 func (c *ProjectsLocationsJobTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobTemplatesGetCall { 2469 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2470 return c 2471 } 2472 2473 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2474 // object's ETag matches the given value. This is useful for getting updates 2475 // only after the object has changed since the last request. 2476 func (c *ProjectsLocationsJobTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsJobTemplatesGetCall { 2477 c.ifNoneMatch_ = entityTag 2478 return c 2479 } 2480 2481 // Context sets the context to be used in this call's Do method. 2482 func (c *ProjectsLocationsJobTemplatesGetCall) Context(ctx context.Context) *ProjectsLocationsJobTemplatesGetCall { 2483 c.ctx_ = ctx 2484 return c 2485 } 2486 2487 // Header returns a http.Header that can be modified by the caller to add 2488 // headers to the request. 2489 func (c *ProjectsLocationsJobTemplatesGetCall) Header() http.Header { 2490 if c.header_ == nil { 2491 c.header_ = make(http.Header) 2492 } 2493 return c.header_ 2494 } 2495 2496 func (c *ProjectsLocationsJobTemplatesGetCall) doRequest(alt string) (*http.Response, error) { 2497 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2498 if c.ifNoneMatch_ != "" { 2499 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2500 } 2501 var body io.Reader = nil 2502 c.urlParams_.Set("alt", alt) 2503 c.urlParams_.Set("prettyPrint", "false") 2504 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2505 urls += "?" + c.urlParams_.Encode() 2506 req, err := http.NewRequest("GET", urls, body) 2507 if err != nil { 2508 return nil, err 2509 } 2510 req.Header = reqHeaders 2511 googleapi.Expand(req.URL, map[string]string{ 2512 "name": c.name, 2513 }) 2514 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2515 } 2516 2517 // Do executes the "transcoder.projects.locations.jobTemplates.get" call. 2518 // Any non-2xx status code is an error. Response headers are in either 2519 // *JobTemplate.ServerResponse.Header or (if a response was returned at all) in 2520 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2521 // whether the returned error was because http.StatusNotModified was returned. 2522 func (c *ProjectsLocationsJobTemplatesGetCall) Do(opts ...googleapi.CallOption) (*JobTemplate, error) { 2523 gensupport.SetOptions(c.urlParams_, opts...) 2524 res, err := c.doRequest("json") 2525 if res != nil && res.StatusCode == http.StatusNotModified { 2526 if res.Body != nil { 2527 res.Body.Close() 2528 } 2529 return nil, gensupport.WrapError(&googleapi.Error{ 2530 Code: res.StatusCode, 2531 Header: res.Header, 2532 }) 2533 } 2534 if err != nil { 2535 return nil, err 2536 } 2537 defer googleapi.CloseBody(res) 2538 if err := googleapi.CheckResponse(res); err != nil { 2539 return nil, gensupport.WrapError(err) 2540 } 2541 ret := &JobTemplate{ 2542 ServerResponse: googleapi.ServerResponse{ 2543 Header: res.Header, 2544 HTTPStatusCode: res.StatusCode, 2545 }, 2546 } 2547 target := &ret 2548 if err := gensupport.DecodeResponse(target, res); err != nil { 2549 return nil, err 2550 } 2551 return ret, nil 2552 } 2553 2554 type ProjectsLocationsJobTemplatesListCall struct { 2555 s *Service 2556 parent string 2557 urlParams_ gensupport.URLParams 2558 ifNoneMatch_ string 2559 ctx_ context.Context 2560 header_ http.Header 2561 } 2562 2563 // List: Lists job templates in the specified region. 2564 // 2565 // - parent: The parent location from which to retrieve the collection of job 2566 // templates. Format: `projects/{project}/locations/{location}`. 2567 func (r *ProjectsLocationsJobTemplatesService) List(parent string) *ProjectsLocationsJobTemplatesListCall { 2568 c := &ProjectsLocationsJobTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2569 c.parent = parent 2570 return c 2571 } 2572 2573 // Filter sets the optional parameter "filter": The filter expression, 2574 // following the syntax outlined in https://google.aip.dev/160. 2575 func (c *ProjectsLocationsJobTemplatesListCall) Filter(filter string) *ProjectsLocationsJobTemplatesListCall { 2576 c.urlParams_.Set("filter", filter) 2577 return c 2578 } 2579 2580 // OrderBy sets the optional parameter "orderBy": One or more fields to compare 2581 // and use to sort the output. See https://google.aip.dev/132#ordering. 2582 func (c *ProjectsLocationsJobTemplatesListCall) OrderBy(orderBy string) *ProjectsLocationsJobTemplatesListCall { 2583 c.urlParams_.Set("orderBy", orderBy) 2584 return c 2585 } 2586 2587 // PageSize sets the optional parameter "pageSize": The maximum number of items 2588 // to return. 2589 func (c *ProjectsLocationsJobTemplatesListCall) PageSize(pageSize int64) *ProjectsLocationsJobTemplatesListCall { 2590 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2591 return c 2592 } 2593 2594 // PageToken sets the optional parameter "pageToken": The `next_page_token` 2595 // value returned from a previous List request, if any. 2596 func (c *ProjectsLocationsJobTemplatesListCall) PageToken(pageToken string) *ProjectsLocationsJobTemplatesListCall { 2597 c.urlParams_.Set("pageToken", pageToken) 2598 return c 2599 } 2600 2601 // Fields allows partial responses to be retrieved. See 2602 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2603 // details. 2604 func (c *ProjectsLocationsJobTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobTemplatesListCall { 2605 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2606 return c 2607 } 2608 2609 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2610 // object's ETag matches the given value. This is useful for getting updates 2611 // only after the object has changed since the last request. 2612 func (c *ProjectsLocationsJobTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsJobTemplatesListCall { 2613 c.ifNoneMatch_ = entityTag 2614 return c 2615 } 2616 2617 // Context sets the context to be used in this call's Do method. 2618 func (c *ProjectsLocationsJobTemplatesListCall) Context(ctx context.Context) *ProjectsLocationsJobTemplatesListCall { 2619 c.ctx_ = ctx 2620 return c 2621 } 2622 2623 // Header returns a http.Header that can be modified by the caller to add 2624 // headers to the request. 2625 func (c *ProjectsLocationsJobTemplatesListCall) Header() http.Header { 2626 if c.header_ == nil { 2627 c.header_ = make(http.Header) 2628 } 2629 return c.header_ 2630 } 2631 2632 func (c *ProjectsLocationsJobTemplatesListCall) doRequest(alt string) (*http.Response, error) { 2633 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2634 if c.ifNoneMatch_ != "" { 2635 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2636 } 2637 var body io.Reader = nil 2638 c.urlParams_.Set("alt", alt) 2639 c.urlParams_.Set("prettyPrint", "false") 2640 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobTemplates") 2641 urls += "?" + c.urlParams_.Encode() 2642 req, err := http.NewRequest("GET", urls, body) 2643 if err != nil { 2644 return nil, err 2645 } 2646 req.Header = reqHeaders 2647 googleapi.Expand(req.URL, map[string]string{ 2648 "parent": c.parent, 2649 }) 2650 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2651 } 2652 2653 // Do executes the "transcoder.projects.locations.jobTemplates.list" call. 2654 // Any non-2xx status code is an error. Response headers are in either 2655 // *ListJobTemplatesResponse.ServerResponse.Header or (if a response was 2656 // returned at all) in error.(*googleapi.Error).Header. Use 2657 // googleapi.IsNotModified to check whether the returned error was because 2658 // http.StatusNotModified was returned. 2659 func (c *ProjectsLocationsJobTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListJobTemplatesResponse, error) { 2660 gensupport.SetOptions(c.urlParams_, opts...) 2661 res, err := c.doRequest("json") 2662 if res != nil && res.StatusCode == http.StatusNotModified { 2663 if res.Body != nil { 2664 res.Body.Close() 2665 } 2666 return nil, gensupport.WrapError(&googleapi.Error{ 2667 Code: res.StatusCode, 2668 Header: res.Header, 2669 }) 2670 } 2671 if err != nil { 2672 return nil, err 2673 } 2674 defer googleapi.CloseBody(res) 2675 if err := googleapi.CheckResponse(res); err != nil { 2676 return nil, gensupport.WrapError(err) 2677 } 2678 ret := &ListJobTemplatesResponse{ 2679 ServerResponse: googleapi.ServerResponse{ 2680 Header: res.Header, 2681 HTTPStatusCode: res.StatusCode, 2682 }, 2683 } 2684 target := &ret 2685 if err := gensupport.DecodeResponse(target, res); err != nil { 2686 return nil, err 2687 } 2688 return ret, nil 2689 } 2690 2691 // Pages invokes f for each page of results. 2692 // A non-nil error returned from f will halt the iteration. 2693 // The provided context supersedes any context provided to the Context method. 2694 func (c *ProjectsLocationsJobTemplatesListCall) Pages(ctx context.Context, f func(*ListJobTemplatesResponse) error) error { 2695 c.ctx_ = ctx 2696 defer c.PageToken(c.urlParams_.Get("pageToken")) 2697 for { 2698 x, err := c.Do() 2699 if err != nil { 2700 return err 2701 } 2702 if err := f(x); err != nil { 2703 return err 2704 } 2705 if x.NextPageToken == "" { 2706 return nil 2707 } 2708 c.PageToken(x.NextPageToken) 2709 } 2710 } 2711 2712 type ProjectsLocationsJobsCreateCall struct { 2713 s *Service 2714 parent string 2715 job *Job 2716 urlParams_ gensupport.URLParams 2717 ctx_ context.Context 2718 header_ http.Header 2719 } 2720 2721 // Create: Creates a job in the specified region. 2722 // 2723 // - parent: The parent location to create and process this job. Format: 2724 // `projects/{project}/locations/{location}`. 2725 func (r *ProjectsLocationsJobsService) Create(parent string, job *Job) *ProjectsLocationsJobsCreateCall { 2726 c := &ProjectsLocationsJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2727 c.parent = parent 2728 c.job = job 2729 return c 2730 } 2731 2732 // Fields allows partial responses to be retrieved. See 2733 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2734 // details. 2735 func (c *ProjectsLocationsJobsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsCreateCall { 2736 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2737 return c 2738 } 2739 2740 // Context sets the context to be used in this call's Do method. 2741 func (c *ProjectsLocationsJobsCreateCall) Context(ctx context.Context) *ProjectsLocationsJobsCreateCall { 2742 c.ctx_ = ctx 2743 return c 2744 } 2745 2746 // Header returns a http.Header that can be modified by the caller to add 2747 // headers to the request. 2748 func (c *ProjectsLocationsJobsCreateCall) Header() http.Header { 2749 if c.header_ == nil { 2750 c.header_ = make(http.Header) 2751 } 2752 return c.header_ 2753 } 2754 2755 func (c *ProjectsLocationsJobsCreateCall) doRequest(alt string) (*http.Response, error) { 2756 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2757 var body io.Reader = nil 2758 body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) 2759 if err != nil { 2760 return nil, err 2761 } 2762 c.urlParams_.Set("alt", alt) 2763 c.urlParams_.Set("prettyPrint", "false") 2764 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") 2765 urls += "?" + c.urlParams_.Encode() 2766 req, err := http.NewRequest("POST", urls, body) 2767 if err != nil { 2768 return nil, err 2769 } 2770 req.Header = reqHeaders 2771 googleapi.Expand(req.URL, map[string]string{ 2772 "parent": c.parent, 2773 }) 2774 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2775 } 2776 2777 // Do executes the "transcoder.projects.locations.jobs.create" call. 2778 // Any non-2xx status code is an error. Response headers are in either 2779 // *Job.ServerResponse.Header or (if a response was returned at all) in 2780 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2781 // whether the returned error was because http.StatusNotModified was returned. 2782 func (c *ProjectsLocationsJobsCreateCall) Do(opts ...googleapi.CallOption) (*Job, error) { 2783 gensupport.SetOptions(c.urlParams_, opts...) 2784 res, err := c.doRequest("json") 2785 if res != nil && res.StatusCode == http.StatusNotModified { 2786 if res.Body != nil { 2787 res.Body.Close() 2788 } 2789 return nil, gensupport.WrapError(&googleapi.Error{ 2790 Code: res.StatusCode, 2791 Header: res.Header, 2792 }) 2793 } 2794 if err != nil { 2795 return nil, err 2796 } 2797 defer googleapi.CloseBody(res) 2798 if err := googleapi.CheckResponse(res); err != nil { 2799 return nil, gensupport.WrapError(err) 2800 } 2801 ret := &Job{ 2802 ServerResponse: googleapi.ServerResponse{ 2803 Header: res.Header, 2804 HTTPStatusCode: res.StatusCode, 2805 }, 2806 } 2807 target := &ret 2808 if err := gensupport.DecodeResponse(target, res); err != nil { 2809 return nil, err 2810 } 2811 return ret, nil 2812 } 2813 2814 type ProjectsLocationsJobsDeleteCall struct { 2815 s *Service 2816 name string 2817 urlParams_ gensupport.URLParams 2818 ctx_ context.Context 2819 header_ http.Header 2820 } 2821 2822 // Delete: Deletes a job. 2823 // 2824 // - name: The name of the job to delete. Format: 2825 // `projects/{project}/locations/{location}/jobs/{job}`. 2826 func (r *ProjectsLocationsJobsService) Delete(name string) *ProjectsLocationsJobsDeleteCall { 2827 c := &ProjectsLocationsJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2828 c.name = name 2829 return c 2830 } 2831 2832 // AllowMissing sets the optional parameter "allowMissing": If set to true, and 2833 // the job is not found, the request will succeed but no action will be taken 2834 // on the server. 2835 func (c *ProjectsLocationsJobsDeleteCall) AllowMissing(allowMissing bool) *ProjectsLocationsJobsDeleteCall { 2836 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) 2837 return c 2838 } 2839 2840 // Fields allows partial responses to be retrieved. See 2841 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2842 // details. 2843 func (c *ProjectsLocationsJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsDeleteCall { 2844 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2845 return c 2846 } 2847 2848 // Context sets the context to be used in this call's Do method. 2849 func (c *ProjectsLocationsJobsDeleteCall) Context(ctx context.Context) *ProjectsLocationsJobsDeleteCall { 2850 c.ctx_ = ctx 2851 return c 2852 } 2853 2854 // Header returns a http.Header that can be modified by the caller to add 2855 // headers to the request. 2856 func (c *ProjectsLocationsJobsDeleteCall) Header() http.Header { 2857 if c.header_ == nil { 2858 c.header_ = make(http.Header) 2859 } 2860 return c.header_ 2861 } 2862 2863 func (c *ProjectsLocationsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { 2864 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2865 var body io.Reader = nil 2866 c.urlParams_.Set("alt", alt) 2867 c.urlParams_.Set("prettyPrint", "false") 2868 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2869 urls += "?" + c.urlParams_.Encode() 2870 req, err := http.NewRequest("DELETE", urls, body) 2871 if err != nil { 2872 return nil, err 2873 } 2874 req.Header = reqHeaders 2875 googleapi.Expand(req.URL, map[string]string{ 2876 "name": c.name, 2877 }) 2878 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2879 } 2880 2881 // Do executes the "transcoder.projects.locations.jobs.delete" call. 2882 // Any non-2xx status code is an error. Response headers are in either 2883 // *Empty.ServerResponse.Header or (if a response was returned at all) in 2884 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2885 // whether the returned error was because http.StatusNotModified was returned. 2886 func (c *ProjectsLocationsJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2887 gensupport.SetOptions(c.urlParams_, opts...) 2888 res, err := c.doRequest("json") 2889 if res != nil && res.StatusCode == http.StatusNotModified { 2890 if res.Body != nil { 2891 res.Body.Close() 2892 } 2893 return nil, gensupport.WrapError(&googleapi.Error{ 2894 Code: res.StatusCode, 2895 Header: res.Header, 2896 }) 2897 } 2898 if err != nil { 2899 return nil, err 2900 } 2901 defer googleapi.CloseBody(res) 2902 if err := googleapi.CheckResponse(res); err != nil { 2903 return nil, gensupport.WrapError(err) 2904 } 2905 ret := &Empty{ 2906 ServerResponse: googleapi.ServerResponse{ 2907 Header: res.Header, 2908 HTTPStatusCode: res.StatusCode, 2909 }, 2910 } 2911 target := &ret 2912 if err := gensupport.DecodeResponse(target, res); err != nil { 2913 return nil, err 2914 } 2915 return ret, nil 2916 } 2917 2918 type ProjectsLocationsJobsGetCall struct { 2919 s *Service 2920 name string 2921 urlParams_ gensupport.URLParams 2922 ifNoneMatch_ string 2923 ctx_ context.Context 2924 header_ http.Header 2925 } 2926 2927 // Get: Returns the job data. 2928 // 2929 // - name: The name of the job to retrieve. Format: 2930 // `projects/{project}/locations/{location}/jobs/{job}`. 2931 func (r *ProjectsLocationsJobsService) Get(name string) *ProjectsLocationsJobsGetCall { 2932 c := &ProjectsLocationsJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2933 c.name = name 2934 return c 2935 } 2936 2937 // Fields allows partial responses to be retrieved. See 2938 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2939 // details. 2940 func (c *ProjectsLocationsJobsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsGetCall { 2941 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2942 return c 2943 } 2944 2945 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2946 // object's ETag matches the given value. This is useful for getting updates 2947 // only after the object has changed since the last request. 2948 func (c *ProjectsLocationsJobsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsJobsGetCall { 2949 c.ifNoneMatch_ = entityTag 2950 return c 2951 } 2952 2953 // Context sets the context to be used in this call's Do method. 2954 func (c *ProjectsLocationsJobsGetCall) Context(ctx context.Context) *ProjectsLocationsJobsGetCall { 2955 c.ctx_ = ctx 2956 return c 2957 } 2958 2959 // Header returns a http.Header that can be modified by the caller to add 2960 // headers to the request. 2961 func (c *ProjectsLocationsJobsGetCall) Header() http.Header { 2962 if c.header_ == nil { 2963 c.header_ = make(http.Header) 2964 } 2965 return c.header_ 2966 } 2967 2968 func (c *ProjectsLocationsJobsGetCall) doRequest(alt string) (*http.Response, error) { 2969 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2970 if c.ifNoneMatch_ != "" { 2971 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2972 } 2973 var body io.Reader = nil 2974 c.urlParams_.Set("alt", alt) 2975 c.urlParams_.Set("prettyPrint", "false") 2976 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2977 urls += "?" + c.urlParams_.Encode() 2978 req, err := http.NewRequest("GET", urls, body) 2979 if err != nil { 2980 return nil, err 2981 } 2982 req.Header = reqHeaders 2983 googleapi.Expand(req.URL, map[string]string{ 2984 "name": c.name, 2985 }) 2986 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2987 } 2988 2989 // Do executes the "transcoder.projects.locations.jobs.get" call. 2990 // Any non-2xx status code is an error. Response headers are in either 2991 // *Job.ServerResponse.Header or (if a response was returned at all) in 2992 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2993 // whether the returned error was because http.StatusNotModified was returned. 2994 func (c *ProjectsLocationsJobsGetCall) Do(opts ...googleapi.CallOption) (*Job, error) { 2995 gensupport.SetOptions(c.urlParams_, opts...) 2996 res, err := c.doRequest("json") 2997 if res != nil && res.StatusCode == http.StatusNotModified { 2998 if res.Body != nil { 2999 res.Body.Close() 3000 } 3001 return nil, gensupport.WrapError(&googleapi.Error{ 3002 Code: res.StatusCode, 3003 Header: res.Header, 3004 }) 3005 } 3006 if err != nil { 3007 return nil, err 3008 } 3009 defer googleapi.CloseBody(res) 3010 if err := googleapi.CheckResponse(res); err != nil { 3011 return nil, gensupport.WrapError(err) 3012 } 3013 ret := &Job{ 3014 ServerResponse: googleapi.ServerResponse{ 3015 Header: res.Header, 3016 HTTPStatusCode: res.StatusCode, 3017 }, 3018 } 3019 target := &ret 3020 if err := gensupport.DecodeResponse(target, res); err != nil { 3021 return nil, err 3022 } 3023 return ret, nil 3024 } 3025 3026 type ProjectsLocationsJobsListCall struct { 3027 s *Service 3028 parent string 3029 urlParams_ gensupport.URLParams 3030 ifNoneMatch_ string 3031 ctx_ context.Context 3032 header_ http.Header 3033 } 3034 3035 // List: Lists jobs in the specified region. 3036 // 3037 // - parent: Format: `projects/{project}/locations/{location}`. 3038 func (r *ProjectsLocationsJobsService) List(parent string) *ProjectsLocationsJobsListCall { 3039 c := &ProjectsLocationsJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3040 c.parent = parent 3041 return c 3042 } 3043 3044 // Filter sets the optional parameter "filter": The filter expression, 3045 // following the syntax outlined in https://google.aip.dev/160. 3046 func (c *ProjectsLocationsJobsListCall) Filter(filter string) *ProjectsLocationsJobsListCall { 3047 c.urlParams_.Set("filter", filter) 3048 return c 3049 } 3050 3051 // OrderBy sets the optional parameter "orderBy": One or more fields to compare 3052 // and use to sort the output. See https://google.aip.dev/132#ordering. 3053 func (c *ProjectsLocationsJobsListCall) OrderBy(orderBy string) *ProjectsLocationsJobsListCall { 3054 c.urlParams_.Set("orderBy", orderBy) 3055 return c 3056 } 3057 3058 // PageSize sets the optional parameter "pageSize": The maximum number of items 3059 // to return. 3060 func (c *ProjectsLocationsJobsListCall) PageSize(pageSize int64) *ProjectsLocationsJobsListCall { 3061 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3062 return c 3063 } 3064 3065 // PageToken sets the optional parameter "pageToken": The `next_page_token` 3066 // value returned from a previous List request, if any. 3067 func (c *ProjectsLocationsJobsListCall) PageToken(pageToken string) *ProjectsLocationsJobsListCall { 3068 c.urlParams_.Set("pageToken", pageToken) 3069 return c 3070 } 3071 3072 // Fields allows partial responses to be retrieved. See 3073 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3074 // details. 3075 func (c *ProjectsLocationsJobsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsJobsListCall { 3076 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3077 return c 3078 } 3079 3080 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3081 // object's ETag matches the given value. This is useful for getting updates 3082 // only after the object has changed since the last request. 3083 func (c *ProjectsLocationsJobsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsJobsListCall { 3084 c.ifNoneMatch_ = entityTag 3085 return c 3086 } 3087 3088 // Context sets the context to be used in this call's Do method. 3089 func (c *ProjectsLocationsJobsListCall) Context(ctx context.Context) *ProjectsLocationsJobsListCall { 3090 c.ctx_ = ctx 3091 return c 3092 } 3093 3094 // Header returns a http.Header that can be modified by the caller to add 3095 // headers to the request. 3096 func (c *ProjectsLocationsJobsListCall) Header() http.Header { 3097 if c.header_ == nil { 3098 c.header_ = make(http.Header) 3099 } 3100 return c.header_ 3101 } 3102 3103 func (c *ProjectsLocationsJobsListCall) doRequest(alt string) (*http.Response, error) { 3104 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3105 if c.ifNoneMatch_ != "" { 3106 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3107 } 3108 var body io.Reader = nil 3109 c.urlParams_.Set("alt", alt) 3110 c.urlParams_.Set("prettyPrint", "false") 3111 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs") 3112 urls += "?" + c.urlParams_.Encode() 3113 req, err := http.NewRequest("GET", urls, body) 3114 if err != nil { 3115 return nil, err 3116 } 3117 req.Header = reqHeaders 3118 googleapi.Expand(req.URL, map[string]string{ 3119 "parent": c.parent, 3120 }) 3121 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3122 } 3123 3124 // Do executes the "transcoder.projects.locations.jobs.list" call. 3125 // Any non-2xx status code is an error. Response headers are in either 3126 // *ListJobsResponse.ServerResponse.Header or (if a response was returned at 3127 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3128 // check whether the returned error was because http.StatusNotModified was 3129 // returned. 3130 func (c *ProjectsLocationsJobsListCall) Do(opts ...googleapi.CallOption) (*ListJobsResponse, error) { 3131 gensupport.SetOptions(c.urlParams_, opts...) 3132 res, err := c.doRequest("json") 3133 if res != nil && res.StatusCode == http.StatusNotModified { 3134 if res.Body != nil { 3135 res.Body.Close() 3136 } 3137 return nil, gensupport.WrapError(&googleapi.Error{ 3138 Code: res.StatusCode, 3139 Header: res.Header, 3140 }) 3141 } 3142 if err != nil { 3143 return nil, err 3144 } 3145 defer googleapi.CloseBody(res) 3146 if err := googleapi.CheckResponse(res); err != nil { 3147 return nil, gensupport.WrapError(err) 3148 } 3149 ret := &ListJobsResponse{ 3150 ServerResponse: googleapi.ServerResponse{ 3151 Header: res.Header, 3152 HTTPStatusCode: res.StatusCode, 3153 }, 3154 } 3155 target := &ret 3156 if err := gensupport.DecodeResponse(target, res); err != nil { 3157 return nil, err 3158 } 3159 return ret, nil 3160 } 3161 3162 // Pages invokes f for each page of results. 3163 // A non-nil error returned from f will halt the iteration. 3164 // The provided context supersedes any context provided to the Context method. 3165 func (c *ProjectsLocationsJobsListCall) Pages(ctx context.Context, f func(*ListJobsResponse) error) error { 3166 c.ctx_ = ctx 3167 defer c.PageToken(c.urlParams_.Get("pageToken")) 3168 for { 3169 x, err := c.Do() 3170 if err != nil { 3171 return err 3172 } 3173 if err := f(x); err != nil { 3174 return err 3175 } 3176 if x.NextPageToken == "" { 3177 return nil 3178 } 3179 c.PageToken(x.NextPageToken) 3180 } 3181 } 3182