use std::collections::HashMap; use std::cell::RefCell; use std::default::Default; use std::collections::BTreeSet; use std::error::Error as StdError; use serde_json as json; use std::io; use std::fs; use std::mem; use hyper::client::connect; use tokio::io::{AsyncRead, AsyncWrite}; use tokio::time::sleep; use tower_service; use serde::{Serialize, Deserialize}; use crate::{client, client::GetToken, client::serde_with}; // ############## // UTILITIES ### // ############ /// Identifies the an OAuth2 authorization scope. /// A scope is needed when requesting an /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Ord, PartialOrd, Hash, Debug, Clone, Copy)] pub enum Scope { /// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. CloudPlatform, } impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", } } } impl Default for Scope { fn default() -> Scope { Scope::CloudPlatform } } // ######## // HUB ### // ###### /// Central instance to access all Transcoder related resource activities /// /// # Examples /// /// Instantiate a new hub /// /// ```test_harness,no_run /// extern crate hyper; /// extern crate hyper_rustls; /// extern crate google_transcoder1 as transcoder1; /// use transcoder1::api::Job; /// use transcoder1::{Result, Error}; /// # async fn dox() { /// use std::default::Default; /// use transcoder1::{Transcoder, oauth2, hyper, hyper_rustls, chrono, FieldMask}; /// /// // Get an ApplicationSecret instance by some means. It contains the `client_id` and /// // `client_secret`, among other things. /// let secret: oauth2::ApplicationSecret = Default::default(); /// // Instantiate the authenticator. It will choose a suitable authentication flow for you, /// // unless you replace `None` with the desired Flow. /// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about /// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and /// // retrieve them from storage. /// let auth = oauth2::InstalledFlowAuthenticator::builder( /// secret, /// oauth2::InstalledFlowReturnMethod::HTTPRedirect, /// ).build().await.unwrap(); /// let mut hub = Transcoder::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth); /// // As the method needs a request, you would usually fill it with the desired information /// // into the respective structure. Some of the parts shown here might not be applicable ! /// // Values shown here are possibly random and not representative ! /// let mut req = Job::default(); /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().locations_jobs_create(req, "parent") /// .doit().await; /// /// match result { /// Err(e) => match e { /// // The Error enum provides details about what exactly happened. /// // You can also just use its `Debug`, `Display` or `Error` traits /// Error::HttpError(_) /// |Error::Io(_) /// |Error::MissingAPIKey /// |Error::MissingToken(_) /// |Error::Cancelled /// |Error::UploadSizeLimitExceeded(_, _) /// |Error::Failure(_) /// |Error::BadRequest(_) /// |Error::FieldClash(_) /// |Error::JsonDecodeError(_, _) => println!("{}", e), /// }, /// Ok(res) => println!("Success: {:?}", res), /// } /// # } /// ``` #[derive(Clone)] pub struct Transcoder { pub client: hyper::Client, pub auth: Box, _user_agent: String, _base_url: String, _root_url: String, } impl<'a, S> client::Hub for Transcoder {} impl<'a, S> Transcoder { pub fn new(client: hyper::Client, auth: A) -> Transcoder { Transcoder { client, auth: Box::new(auth), _user_agent: "google-api-rust-client/5.0.4".to_string(), _base_url: "https://transcoder.googleapis.com/".to_string(), _root_url: "https://transcoder.googleapis.com/".to_string(), } } pub fn projects(&'a self) -> ProjectMethods<'a, S> { ProjectMethods { hub: &self } } /// Set the user-agent header field to use in all requests to the server. /// It defaults to `google-api-rust-client/5.0.4`. /// /// Returns the previously set user-agent. pub fn user_agent(&mut self, agent_name: String) -> String { mem::replace(&mut self._user_agent, agent_name) } /// Set the base url to use in all requests to the server. /// It defaults to `https://transcoder.googleapis.com/`. /// /// Returns the previously set base url. pub fn base_url(&mut self, new_base_url: String) -> String { mem::replace(&mut self._base_url, new_base_url) } /// Set the root url to use in all requests to the server. /// It defaults to `https://transcoder.googleapis.com/`. /// /// Returns the previously set root url. pub fn root_url(&mut self, new_root_url: String) -> String { mem::replace(&mut self._root_url, new_root_url) } } // ############ // SCHEMAS ### // ########## /// Ad break. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AdBreak { /// Start time in seconds for the ad break, relative to the output file timeline. The default is `0s`. #[serde(rename="startTimeOffset")] #[serde_as(as = "Option<::client::serde::duration::Wrapper>")] pub start_time_offset: Option, } impl client::Part for AdBreak {} /// Configuration for AES-128 encryption. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Aes128Encryption { _never_set: Option } impl client::Part for Aes128Encryption {} /// Animation types. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Animation { /// End previous animation. #[serde(rename="animationEnd")] pub animation_end: Option, /// Display overlay object with fade animation. #[serde(rename="animationFade")] pub animation_fade: Option, /// Display static overlay object. #[serde(rename="animationStatic")] pub animation_static: Option, } impl client::Part for Animation {} /// End previous overlay animation from the video. Without `AnimationEnd`, the overlay object will keep the state of previous animation until the end of the video. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AnimationEnd { /// The time to end overlay object, in seconds. Default: 0 #[serde(rename="startTimeOffset")] #[serde_as(as = "Option<::client::serde::duration::Wrapper>")] pub start_time_offset: Option, } impl client::Part for AnimationEnd {} /// Display overlay object with fade animation. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AnimationFade { /// The time to end the fade animation, in seconds. Default: `start_time_offset` + 1s #[serde(rename="endTimeOffset")] #[serde_as(as = "Option<::client::serde::duration::Wrapper>")] pub end_time_offset: Option, /// Required. Type of fade animation: `FADE_IN` or `FADE_OUT`. #[serde(rename="fadeType")] pub fade_type: Option, /// The time to start the fade animation, in seconds. Default: 0 #[serde(rename="startTimeOffset")] #[serde_as(as = "Option<::client::serde::duration::Wrapper>")] pub start_time_offset: Option, /// Normalized coordinates based on output video resolution. Valid values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay object. For example, use the x and y coordinates {0,0} to position the top-left corner of the overlay animation in the top-left corner of the output video. pub xy: Option, } impl client::Part for AnimationFade {} /// Display static overlay object. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AnimationStatic { /// The time to start displaying the overlay object, in seconds. Default: 0 #[serde(rename="startTimeOffset")] #[serde_as(as = "Option<::client::serde::duration::Wrapper>")] pub start_time_offset: Option, /// Normalized coordinates based on output video resolution. Valid values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay object. For example, use the x and y coordinates {0,0} to position the top-left corner of the overlay animation in the top-left corner of the output video. pub xy: Option, } impl client::Part for AnimationStatic {} /// Audio preprocessing configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Audio { /// Enable boosting high frequency components. The default is `false`. **Note:** This field is not supported. #[serde(rename="highBoost")] pub high_boost: Option, /// Enable boosting low frequency components. The default is `false`. **Note:** This field is not supported. #[serde(rename="lowBoost")] pub low_boost: Option, /// Specify audio loudness normalization in loudness units relative to full scale (LUFS). Enter a value between -24 and 0 (the default), where: * -24 is the Advanced Television Systems Committee (ATSC A/85) standard * -23 is the EU R128 broadcast standard * -19 is the prior standard for online mono audio * -18 is the ReplayGain standard * -16 is the prior standard for stereo audio * -14 is the new online audio standard recommended by Spotify, as well as Amazon Echo * 0 disables normalization pub lufs: Option, } impl client::Part for Audio {} /// The mapping for the JobConfig.edit_list atoms with audio EditAtom.inputs. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AudioMapping { /// Required. The EditAtom.key that references the atom with audio inputs in the JobConfig.edit_list. #[serde(rename="atomKey")] pub atom_key: Option, /// Audio volume control in dB. Negative values decrease volume, positive values increase. The default is 0. #[serde(rename="gainDb")] pub gain_db: Option, /// Required. The zero-based index of the channel in the input audio stream. #[serde(rename="inputChannel")] pub input_channel: Option, /// Required. The Input.key that identifies the input file. #[serde(rename="inputKey")] pub input_key: Option, /// Required. The zero-based index of the track in the input file. #[serde(rename="inputTrack")] pub input_track: Option, /// Required. The zero-based index of the channel in the output audio stream. #[serde(rename="outputChannel")] pub output_channel: Option, } impl client::Part for AudioMapping {} /// Audio stream resource. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AudioStream { /// Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000. #[serde(rename="bitrateBps")] pub bitrate_bps: Option, /// Number of audio channels. Must be between 1 and 6. The default is 2. #[serde(rename="channelCount")] pub channel_count: Option, /// A list of channel names specifying layout of the audio channels. This only affects the metadata embedded in the container headers, if supported by the specified format. The default is `["fl", "fr"]`. Supported channel names: - `fl` - Front left channel - `fr` - Front right channel - `sl` - Side left channel - `sr` - Side right channel - `fc` - Front center channel - `lfe` - Low frequency #[serde(rename="channelLayout")] pub channel_layout: Option>, /// The codec for this audio stream. The default is `aac`. Supported audio codecs: - `aac` - `aac-he` - `aac-he-v2` - `mp3` - `ac3` - `eac3` pub codec: Option, /// The name for this particular audio stream that will be added to the HLS/DASH manifest. Not supported in MP4 files. #[serde(rename="displayName")] pub display_name: Option, /// The BCP-47 language code, such as `en-US` or `sr-Latn`. For more information, see https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. Not supported in MP4 files. #[serde(rename="languageCode")] pub language_code: Option, /// The mapping for the JobConfig.edit_list atoms with audio EditAtom.inputs. pub mapping: Option>, /// The audio sample rate in Hertz. The default is 48000 Hertz. #[serde(rename="sampleRateHertz")] pub sample_rate_hertz: Option, } impl client::Part for AudioStream {} /// Bob Weaver Deinterlacing Filter Configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BwdifConfig { /// Deinterlace all frames rather than just the frames identified as interlaced. The default is `false`. #[serde(rename="deinterlaceAllFrames")] pub deinterlace_all_frames: Option, /// Specifies the deinterlacing mode to adopt. The default is `send_frame`. Supported values: - `send_frame`: Output one frame for each frame - `send_field`: Output one frame for each field pub mode: Option, /// The picture field parity assumed for the input interlaced video. The default is `auto`. Supported values: - `tff`: Assume the top field is first - `bff`: Assume the bottom field is first - `auto`: Enable automatic detection of field parity pub parity: Option, } impl client::Part for BwdifConfig {} /// Clearkey configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Clearkey { _never_set: Option } impl client::Part for Clearkey {} /// Color preprocessing configuration. **Note:** This configuration is not supported. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Color { /// Control brightness of the video. Enter a value between -1 and 1, where -1 is minimum brightness and 1 is maximum brightness. 0 is no change. The default is 0. pub brightness: Option, /// Control black and white contrast of the video. Enter a value between -1 and 1, where -1 is minimum contrast and 1 is maximum contrast. 0 is no change. The default is 0. pub contrast: Option, /// Control color saturation of the video. Enter a value between -1 and 1, where -1 is fully desaturated and 1 is maximum saturation. 0 is no change. The default is 0. pub saturation: Option, } impl client::Part for Color {} /// Video cropping configuration for the input video. The cropped input video is scaled to match the output resolution. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Crop { /// The number of pixels to crop from the bottom. The default is 0. #[serde(rename="bottomPixels")] pub bottom_pixels: Option, /// The number of pixels to crop from the left. The default is 0. #[serde(rename="leftPixels")] pub left_pixels: Option, /// The number of pixels to crop from the right. The default is 0. #[serde(rename="rightPixels")] pub right_pixels: Option, /// The number of pixels to crop from the top. The default is 0. #[serde(rename="topPixels")] pub top_pixels: Option, } impl client::Part for Crop {} /// `DASH` manifest configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DashConfig { /// The segment reference scheme for a `DASH` manifest. The default is `SEGMENT_LIST`. #[serde(rename="segmentReferenceScheme")] pub segment_reference_scheme: Option, } impl client::Part for DashConfig {} /// Deblock preprocessing configuration. **Note:** This configuration is not supported. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Deblock { /// Enable deblocker. The default is `false`. pub enabled: Option, /// Set strength of the deblocker. Enter a value between 0 and 1. The higher the value, the stronger the block removal. 0 is no deblocking. The default is 0. pub strength: Option, } impl client::Part for Deblock {} /// Deinterlace configuration for input video. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Deinterlace { /// Specifies the Bob Weaver Deinterlacing Filter Configuration. pub bwdif: Option, /// Specifies the Yet Another Deinterlacing Filter Configuration. pub yadif: Option, } impl client::Part for Deinterlace {} /// Denoise preprocessing configuration. **Note:** This configuration is not supported. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Denoise { /// Set strength of the denoise. Enter a value between 0 and 1. The higher the value, the smoother the image. 0 is no denoising. The default is 0. pub strength: Option, /// Set the denoiser mode. The default is `standard`. Supported denoiser modes: - `standard` - `grain` pub tune: Option, } impl client::Part for Denoise {} /// Defines configuration for DRM systems in use. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DrmSystems { /// Clearkey configuration. pub clearkey: Option, /// Fairplay configuration. pub fairplay: Option, /// Playready configuration. pub playready: Option, /// Widevine configuration. pub widevine: Option, } impl client::Part for DrmSystems {} /// Edit atom. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct EditAtom { /// End time in seconds for the atom, relative to the input file timeline. When `end_time_offset` is not specified, the `inputs` are used until the end of the atom. #[serde(rename="endTimeOffset")] #[serde_as(as = "Option<::client::serde::duration::Wrapper>")] pub end_time_offset: Option, /// List of Input.key values identifying files that should be used in this atom. The listed `inputs` must have the same timeline. pub inputs: Option>, /// A unique key for this atom. Must be specified when using advanced mapping. pub key: Option, /// Start time in seconds for the atom, relative to the input file timeline. The default is `0s`. #[serde(rename="startTimeOffset")] #[serde_as(as = "Option<::client::serde::duration::Wrapper>")] pub start_time_offset: Option, } impl client::Part for EditAtom {} /// Encoding of an input file such as an audio, video, or text track. Elementary streams must be packaged before mapping and sharing between different output formats. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ElementaryStream { /// Encoding of an audio stream. #[serde(rename="audioStream")] pub audio_stream: Option, /// A unique key for this elementary stream. pub key: Option, /// Encoding of a text stream. For example, closed captions or subtitles. #[serde(rename="textStream")] pub text_stream: Option, /// Encoding of a video stream. #[serde(rename="videoStream")] pub video_stream: Option, } impl client::Part for ElementaryStream {} /// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [locations job templates delete projects](ProjectLocationJobTemplateDeleteCall) (response) /// * [locations jobs delete projects](ProjectLocationJobDeleteCall) (response) #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Empty { _never_set: Option } impl client::ResponseResult for Empty {} /// Encryption settings. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Encryption { /// Configuration for AES-128 encryption. pub aes128: Option, /// Required. DRM system(s) to use; at least one must be specified. If a DRM system is omitted, it is considered disabled. #[serde(rename="drmSystems")] pub drm_systems: Option, /// Required. Identifier for this set of encryption options. pub id: Option, /// Configuration for MPEG Common Encryption (MPEG-CENC). #[serde(rename="mpegCenc")] pub mpeg_cenc: Option, /// Configuration for SAMPLE-AES encryption. #[serde(rename="sampleAes")] pub sample_aes: Option, /// Keys are stored in Google Secret Manager. #[serde(rename="secretManagerKeySource")] pub secret_manager_key_source: Option, } impl client::Part for Encryption {} /// Fairplay configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Fairplay { _never_set: Option } impl client::Part for Fairplay {} /// `fmp4` container configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Fmp4Config { /// Optional. Specify the codec tag string that will be used in the media bitstream. When not specified, the codec appropriate value is used. Supported H265 codec tags: - `hvc1` (default) - `hev1` #[serde(rename="codecTag")] pub codec_tag: Option, } impl client::Part for Fmp4Config {} /// H264 codec settings. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct H264CodecSettings { /// Specifies whether an open Group of Pictures (GOP) structure should be allowed or not. The default is `false`. #[serde(rename="allowOpenGop")] pub allow_open_gop: Option, /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0 and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A higher value equals a lower bitrate but smoother image. The default is 0. #[serde(rename="aqStrength")] pub aq_strength: Option, /// The number of consecutive B-frames. Must be greater than or equal to zero. Must be less than H264CodecSettings.gop_frame_count if set. The default is 0. #[serde(rename="bFrameCount")] pub b_frame_count: Option, /// Allow B-pyramid for reference frame selection. This may not be supported on all decoders. The default is `false`. #[serde(rename="bPyramid")] pub b_pyramid: Option, /// Required. The video bitrate in bits per second. The minimum value is 1,000. The maximum value is 800,000,000. #[serde(rename="bitrateBps")] pub bitrate_bps: Option, /// Target CRF level. Must be between 10 and 36, where 10 is the highest quality and 36 is the most efficient compression. The default is 21. #[serde(rename="crfLevel")] pub crf_level: Option, /// Use two-pass encoding strategy to achieve better video quality. H264CodecSettings.rate_control_mode must be `vbr`. The default is `false`. #[serde(rename="enableTwoPass")] pub enable_two_pass: Option, /// The entropy coder to use. The default is `cabac`. Supported entropy coders: - `cavlc` - `cabac` #[serde(rename="entropyCoder")] pub entropy_coder: Option, /// Required. The target video frame rate in frames per second (FPS). Must be less than or equal to 120. #[serde(rename="frameRate")] pub frame_rate: Option, /// Optional. Frame rate conversion strategy for desired frame rate. The default is `DOWNSAMPLE`. #[serde(rename="frameRateConversionStrategy")] pub frame_rate_conversion_strategy: Option, /// Select the GOP size based on the specified duration. The default is `3s`. Note that `gopDuration` must be less than or equal to [`segmentDuration`](#SegmentSettings), and [`segmentDuration`](#SegmentSettings) must be divisible by `gopDuration`. #[serde(rename="gopDuration")] #[serde_as(as = "Option<::client::serde::duration::Wrapper>")] pub gop_duration: Option, /// Select the GOP size based on the specified frame count. Must be greater than zero. #[serde(rename="gopFrameCount")] pub gop_frame_count: Option, /// The height of the video in pixels. Must be an even integer. When not specified, the height is adjusted to match the specified width and input aspect ratio. If both are omitted, the input height is used. For portrait videos that contain horizontal ASR and rotation metadata, provide the height, in pixels, per the horizontal ASR. The API calculates the width per the horizontal ASR. The API detects any rotation metadata and swaps the requested height and width for the output. #[serde(rename="heightPixels")] pub height_pixels: Option, /// Optional. HLG color format setting for H264. pub hlg: Option, /// Pixel format to use. The default is `yuv420p`. Supported pixel formats: - `yuv420p` pixel format - `yuv422p` pixel format - `yuv444p` pixel format - `yuv420p10` 10-bit HDR pixel format - `yuv422p10` 10-bit HDR pixel format - `yuv444p10` 10-bit HDR pixel format - `yuv420p12` 12-bit HDR pixel format - `yuv422p12` 12-bit HDR pixel format - `yuv444p12` 12-bit HDR pixel format #[serde(rename="pixelFormat")] pub pixel_format: Option, /// Enforces the specified codec preset. The default is `veryfast`. The available options are [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Preset). Note that certain values for this field may cause the transcoder to override other fields you set in the `H264CodecSettings` message. pub preset: Option, /// Enforces the specified codec profile. The following profiles are supported: * `baseline` * `main` * `high` (default) The available options are [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune). Note that certain values for this field may cause the transcoder to override other fields you set in the `H264CodecSettings` message. pub profile: Option, /// Specify the mode. The default is `vbr`. Supported rate control modes: - `vbr` - variable bitrate - `crf` - constant rate factor #[serde(rename="rateControlMode")] pub rate_control_mode: Option, /// Optional. SDR color format setting for H264. pub sdr: Option, /// Enforces the specified codec tune. The available options are [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune). Note that certain values for this field may cause the transcoder to override other fields you set in the `H264CodecSettings` message. pub tune: Option, /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. Must be greater than zero. The default is equal to 90% of H264CodecSettings.vbv_size_bits. #[serde(rename="vbvFullnessBits")] pub vbv_fullness_bits: Option, /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be greater than zero. The default is equal to H264CodecSettings.bitrate_bps. #[serde(rename="vbvSizeBits")] pub vbv_size_bits: Option, /// The width of the video in pixels. Must be an even integer. When not specified, the width is adjusted to match the specified height and input aspect ratio. If both are omitted, the input width is used. For portrait videos that contain horizontal ASR and rotation metadata, provide the width, in pixels, per the horizontal ASR. The API calculates the height per the horizontal ASR. The API detects any rotation metadata and swaps the requested height and width for the output. #[serde(rename="widthPixels")] pub width_pixels: Option, } impl client::Part for H264CodecSettings {} /// Convert the input video to a Hybrid Log Gamma (HLG) video. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct H264ColorFormatHLG { _never_set: Option } impl client::Part for H264ColorFormatHLG {} /// Convert the input video to a Standard Dynamic Range (SDR) video. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct H264ColorFormatSDR { _never_set: Option } impl client::Part for H264ColorFormatSDR {} /// H265 codec settings. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct H265CodecSettings { /// Specifies whether an open Group of Pictures (GOP) structure should be allowed or not. The default is `false`. #[serde(rename="allowOpenGop")] pub allow_open_gop: Option, /// Specify the intensity of the adaptive quantizer (AQ). Must be between 0 and 1, where 0 disables the quantizer and 1 maximizes the quantizer. A higher value equals a lower bitrate but smoother image. The default is 0. #[serde(rename="aqStrength")] pub aq_strength: Option, /// The number of consecutive B-frames. Must be greater than or equal to zero. Must be less than H265CodecSettings.gop_frame_count if set. The default is 0. #[serde(rename="bFrameCount")] pub b_frame_count: Option, /// Allow B-pyramid for reference frame selection. This may not be supported on all decoders. The default is `false`. #[serde(rename="bPyramid")] pub b_pyramid: Option, /// Required. The video bitrate in bits per second. The minimum value is 1,000. The maximum value is 800,000,000. #[serde(rename="bitrateBps")] pub bitrate_bps: Option, /// Target CRF level. Must be between 10 and 36, where 10 is the highest quality and 36 is the most efficient compression. The default is 21. #[serde(rename="crfLevel")] pub crf_level: Option, /// Use two-pass encoding strategy to achieve better video quality. H265CodecSettings.rate_control_mode must be `vbr`. The default is `false`. #[serde(rename="enableTwoPass")] pub enable_two_pass: Option, /// Required. The target video frame rate in frames per second (FPS). Must be less than or equal to 120. #[serde(rename="frameRate")] pub frame_rate: Option, /// Optional. Frame rate conversion strategy for desired frame rate. The default is `DOWNSAMPLE`. #[serde(rename="frameRateConversionStrategy")] pub frame_rate_conversion_strategy: Option, /// Select the GOP size based on the specified duration. The default is `3s`. Note that `gopDuration` must be less than or equal to [`segmentDuration`](#SegmentSettings), and [`segmentDuration`](#SegmentSettings) must be divisible by `gopDuration`. #[serde(rename="gopDuration")] #[serde_as(as = "Option<::client::serde::duration::Wrapper>")] pub gop_duration: Option, /// Select the GOP size based on the specified frame count. Must be greater than zero. #[serde(rename="gopFrameCount")] pub gop_frame_count: Option, /// Optional. HDR10 color format setting for H265. pub hdr10: Option, /// The height of the video in pixels. Must be an even integer. When not specified, the height is adjusted to match the specified width and input aspect ratio. If both are omitted, the input height is used. For portrait videos that contain horizontal ASR and rotation metadata, provide the height, in pixels, per the horizontal ASR. The API calculates the width per the horizontal ASR. The API detects any rotation metadata and swaps the requested height and width for the output. #[serde(rename="heightPixels")] pub height_pixels: Option, /// Optional. HLG color format setting for H265. pub hlg: Option, /// Pixel format to use. The default is `yuv420p`. Supported pixel formats: - `yuv420p` pixel format - `yuv422p` pixel format - `yuv444p` pixel format - `yuv420p10` 10-bit HDR pixel format - `yuv422p10` 10-bit HDR pixel format - `yuv444p10` 10-bit HDR pixel format - `yuv420p12` 12-bit HDR pixel format - `yuv422p12` 12-bit HDR pixel format - `yuv444p12` 12-bit HDR pixel format #[serde(rename="pixelFormat")] pub pixel_format: Option, /// Enforces the specified codec preset. The default is `veryfast`. The available options are [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265). Note that certain values for this field may cause the transcoder to override other fields you set in the `H265CodecSettings` message. pub preset: Option, /// Enforces the specified codec profile. The following profiles are supported: * 8-bit profiles * `main` (default) * `main-intra` * `mainstillpicture` * 10-bit profiles * `main10` (default) * `main10-intra` * `main422-10` * `main422-10-intra` * `main444-10` * `main444-10-intra` * 12-bit profiles * `main12` (default) * `main12-intra` * `main422-12` * `main422-12-intra` * `main444-12` * `main444-12-intra` The available options are [FFmpeg-compatible](https://x265.readthedocs.io/). Note that certain values for this field may cause the transcoder to override other fields you set in the `H265CodecSettings` message. pub profile: Option, /// Specify the mode. The default is `vbr`. Supported rate control modes: - `vbr` - variable bitrate - `crf` - constant rate factor #[serde(rename="rateControlMode")] pub rate_control_mode: Option, /// Optional. SDR color format setting for H265. pub sdr: Option, /// Enforces the specified codec tune. The available options are [FFmpeg-compatible](https://trac.ffmpeg.org/wiki/Encode/H.265). Note that certain values for this field may cause the transcoder to override other fields you set in the `H265CodecSettings` message. pub tune: Option, /// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits. Must be greater than zero. The default is equal to 90% of H265CodecSettings.vbv_size_bits. #[serde(rename="vbvFullnessBits")] pub vbv_fullness_bits: Option, /// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be greater than zero. The default is equal to `VideoStream.bitrate_bps`. #[serde(rename="vbvSizeBits")] pub vbv_size_bits: Option, /// The width of the video in pixels. Must be an even integer. When not specified, the width is adjusted to match the specified height and input aspect ratio. If both are omitted, the input width is used. For portrait videos that contain horizontal ASR and rotation metadata, provide the width, in pixels, per the horizontal ASR. The API calculates the height per the horizontal ASR. The API detects any rotation metadata and swaps the requested height and width for the output. #[serde(rename="widthPixels")] pub width_pixels: Option, } impl client::Part for H265CodecSettings {} /// Convert the input video to a High Dynamic Range 10 (HDR10) video. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct H265ColorFormatHDR10 { _never_set: Option } impl client::Part for H265ColorFormatHDR10 {} /// Convert the input video to a Hybrid Log Gamma (HLG) video. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct H265ColorFormatHLG { _never_set: Option } impl client::Part for H265ColorFormatHLG {} /// Convert the input video to a Standard Dynamic Range (SDR) video. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct H265ColorFormatSDR { _never_set: Option } impl client::Part for H265ColorFormatSDR {} /// Overlaid image. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Image { /// Target image opacity. Valid values are from `1.0` (solid, default) to `0.0` (transparent), exclusive. Set this to a value greater than `0.0`. pub alpha: Option, /// Normalized image resolution, based on output video resolution. Valid values: `0.0`–`1.0`. To respect the original image aspect ratio, set either `x` or `y` to `0.0`. To use the original image resolution, set both `x` and `y` to `0.0`. pub resolution: Option, /// Required. URI of the image in Cloud Storage. For example, `gs://bucket/inputs/image.png`. Only PNG and JPEG images are supported. pub uri: Option, } impl client::Part for Image {} /// Input asset. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Input { /// A unique key for this input. Must be specified when using advanced mapping and edit lists. pub key: Option, /// Preprocessing configurations. #[serde(rename="preprocessingConfig")] pub preprocessing_config: Option, /// URI of the media. Input files must be at least 5 seconds in duration and stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). If empty, the value is populated from Job.input_uri. See [Supported input and output formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats). pub uri: Option, } impl client::Part for Input {} /// Transcoding job resource. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [locations jobs create projects](ProjectLocationJobCreateCall) (request|response) /// * [locations jobs get projects](ProjectLocationJobGetCall) (response) #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Job { /// The processing priority of a batch job. This field can only be set for batch mode jobs. The default value is 0. This value cannot be negative. Higher values correspond to higher priorities for the job. #[serde(rename="batchModePriority")] pub batch_mode_priority: Option, /// The configuration for this job. pub config: Option, /// Output only. The time the job was created. #[serde(rename="createTime")] pub create_time: Option>, /// Output only. The time the transcoding finished. #[serde(rename="endTime")] pub end_time: Option>, /// Output only. An error object that describes the reason for the failure. This property is always present when ProcessingState is `FAILED`. pub error: Option, /// Input only. Specify the `input_uri` to populate empty `uri` fields in each element of `Job.config.inputs` or `JobTemplate.config.inputs` when using template. URI of the media. Input files must be at least 5 seconds in duration and stored in Cloud Storage (for example, `gs://bucket/inputs/file.mp4`). See [Supported input and output formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats). #[serde(rename="inputUri")] pub input_uri: Option, /// The labels associated with this job. You can use these to organize and group your jobs. pub labels: Option>, /// The processing mode of the job. The default is `PROCESSING_MODE_INTERACTIVE`. pub mode: Option, /// The resource name of the job. Format: `projects/{project_number}/locations/{location}/jobs/{job}` pub name: Option, /// Optional. The optimization strategy of the job. The default is `AUTODETECT`. pub optimization: Option, /// Input only. Specify the `output_uri` to populate an empty `Job.config.output.uri` or `JobTemplate.config.output.uri` when using template. URI for the output file(s). For example, `gs://my-bucket/outputs/`. See [Supported input and output formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats). #[serde(rename="outputUri")] pub output_uri: Option, /// Output only. The time the transcoding started. #[serde(rename="startTime")] pub start_time: Option>, /// Output only. The current state of the job. pub state: Option, /// Input only. Specify the `template_id` to use for populating `Job.config`. The default is `preset/web-hd`, which is the only supported preset. User defined JobTemplate: `{job_template_id}` #[serde(rename="templateId")] pub template_id: Option, /// Job time to live value in days, which will be effective after job completion. Job should be deleted automatically after the given TTL. Enter a value between 1 and 90. The default is 30. #[serde(rename="ttlAfterCompletionDays")] pub ttl_after_completion_days: Option, } impl client::RequestValue for Job {} impl client::ResponseResult for Job {} /// Job configuration /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobConfig { /// List of ad breaks. Specifies where to insert ad break tags in the output manifests. #[serde(rename="adBreaks")] pub ad_breaks: Option>, /// List of edit atoms. Defines the ultimate timeline of the resulting file or manifest. #[serde(rename="editList")] pub edit_list: Option>, /// List of elementary streams. #[serde(rename="elementaryStreams")] pub elementary_streams: Option>, /// List of encryption configurations for the content. Each configuration has an ID. Specify this ID in the MuxStream.encryption_id field to indicate the configuration to use for that `MuxStream` output. pub encryptions: Option>, /// List of input assets stored in Cloud Storage. pub inputs: Option>, /// List of output manifests. pub manifests: Option>, /// List of multiplexing settings for output streams. #[serde(rename="muxStreams")] pub mux_streams: Option>, /// Output configuration. pub output: Option, /// List of overlays on the output video, in descending Z-order. pub overlays: Option>, /// Destination on Pub/Sub. #[serde(rename="pubsubDestination")] pub pubsub_destination: Option, /// List of output sprite sheets. Spritesheets require at least one VideoStream in the Jobconfig. #[serde(rename="spriteSheets")] pub sprite_sheets: Option>, } impl client::Part for JobConfig {} /// Transcoding job template resource. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [locations job templates create projects](ProjectLocationJobTemplateCreateCall) (request|response) /// * [locations job templates get projects](ProjectLocationJobTemplateGetCall) (response) #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobTemplate { /// The configuration for this template. pub config: Option, /// The labels associated with this job template. You can use these to organize and group your job templates. pub labels: Option>, /// The resource name of the job template. Format: `projects/{project_number}/locations/{location}/jobTemplates/{job_template}` pub name: Option, } impl client::RequestValue for JobTemplate {} impl client::ResponseResult for JobTemplate {} /// Response message for `TranscoderService.ListJobTemplates`. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [locations job templates list projects](ProjectLocationJobTemplateListCall) (response) #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListJobTemplatesResponse { /// List of job templates in the specified region. #[serde(rename="jobTemplates")] pub job_templates: Option>, /// The pagination token. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// List of regions that could not be reached. pub unreachable: Option>, } impl client::ResponseResult for ListJobTemplatesResponse {} /// Response message for `TranscoderService.ListJobs`. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [locations jobs list projects](ProjectLocationJobListCall) (response) #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListJobsResponse { /// List of jobs in the specified region. pub jobs: Option>, /// The pagination token. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// List of regions that could not be reached. pub unreachable: Option>, } impl client::ResponseResult for ListJobsResponse {} /// Manifest configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Manifest { /// `DASH` manifest configuration. pub dash: Option, /// The name of the generated file. The default is `manifest` with the extension suffix corresponding to the Manifest.type. #[serde(rename="fileName")] pub file_name: Option, /// Required. List of user supplied MuxStream.key values that should appear in this manifest. When Manifest.type is `HLS`, a media manifest with name MuxStream.key and `.m3u8` extension is generated for each element in this list. #[serde(rename="muxStreams")] pub mux_streams: Option>, /// Required. Type of the manifest. #[serde(rename="type")] pub type_: Option, } impl client::Part for Manifest {} /// Configuration for MPEG Common Encryption (MPEG-CENC). /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MpegCommonEncryption { /// Required. Specify the encryption scheme. Supported encryption schemes: - `cenc` - `cbcs` pub scheme: Option, } impl client::Part for MpegCommonEncryption {} /// Multiplexing settings for output stream. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MuxStream { /// The container format. The default is `mp4` Supported container formats: - `ts` - `fmp4`- the corresponding file extension is `.m4s` - `mp4` - `vtt` See also: [Supported input and output formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats) pub container: Option, /// List of ElementaryStream.key values multiplexed in this stream. #[serde(rename="elementaryStreams")] pub elementary_streams: Option>, /// Identifier of the encryption configuration to use. If omitted, output will be unencrypted. #[serde(rename="encryptionId")] pub encryption_id: Option, /// The name of the generated file. The default is MuxStream.key with the extension suffix corresponding to the MuxStream.container. Individual segments also have an incremental 10-digit zero-padded suffix starting from 0 before the extension, such as `mux_stream0000000123.ts`. #[serde(rename="fileName")] pub file_name: Option, /// Optional. `fmp4` container configuration. pub fmp4: Option, /// A unique key for this multiplexed stream. pub key: Option, /// Segment settings for `ts`, `fmp4` and `vtt`. #[serde(rename="segmentSettings")] pub segment_settings: Option, } impl client::Part for MuxStream {} /// 2D normalized coordinates. Default: `{0.0, 0.0}` /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct NormalizedCoordinate { /// Normalized x coordinate. pub x: Option, /// Normalized y coordinate. pub y: Option, } impl client::Part for NormalizedCoordinate {} /// Location of output file(s) in a Cloud Storage bucket. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Output { /// URI for the output file(s). For example, `gs://my-bucket/outputs/`. If empty, the value is populated from Job.output_uri. See [Supported input and output formats](https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats). pub uri: Option, } impl client::Part for Output {} /// Overlay configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Overlay { /// List of animations. The list should be chronological, without any time overlap. pub animations: Option>, /// Image overlay. pub image: Option, } impl client::Part for Overlay {} /// Pad filter configuration for the input video. The padded input video is scaled after padding with black to match the output resolution. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Pad { /// The number of pixels to add to the bottom. The default is 0. #[serde(rename="bottomPixels")] pub bottom_pixels: Option, /// The number of pixels to add to the left. The default is 0. #[serde(rename="leftPixels")] pub left_pixels: Option, /// The number of pixels to add to the right. The default is 0. #[serde(rename="rightPixels")] pub right_pixels: Option, /// The number of pixels to add to the top. The default is 0. #[serde(rename="topPixels")] pub top_pixels: Option, } impl client::Part for Pad {} /// Playready configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Playready { _never_set: Option } impl client::Part for Playready {} /// Preprocessing configurations. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PreprocessingConfig { /// Audio preprocessing configuration. pub audio: Option