use std::collections::HashMap; use std::cell::RefCell; use std::default::Default; use std::collections::BTreeMap; use serde_json as json; use std::io; use std::fs; use std::mem; use std::thread::sleep; use crate::client; // ############## // 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, Hash)] 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}; /// /// // 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::HttpsConnector::with_native_roots()), 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, hyper::body::Body>, pub auth: oauth2::authenticator::Authenticator>, _user_agent: String, _base_url: String, _root_url: String, } impl<'a, > client::Hub for Transcoder<> {} impl<'a, > Transcoder<> { pub fn new(client: hyper::Client, hyper::body::Body>, authenticator: oauth2::authenticator::Authenticator>) -> Transcoder<> { Transcoder { client, auth: authenticator, _user_agent: "google-api-rust-client/3.0.0".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> { ProjectMethods { hub: &self } } /// Set the user-agent header field to use in all requests to the server. /// It defaults to `google-api-rust-client/3.0.0`. /// /// 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. /// #[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")] pub start_time_offset: Option, } impl client::Part for AdBreak {} /// Animation types. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[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. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AnimationEnd { /// The time to end overlay object, in seconds. Default: 0 #[serde(rename="startTimeOffset")] 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. /// #[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")] 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")] 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. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AnimationStatic { /// The time to start displaying the overlay object, in seconds. Default: 0 #[serde(rename="startTimeOffset")] 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. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Audio { /// Enable boosting high frequency components. The default is `false`. #[serde(rename="highBoost")] pub high_boost: Option, /// Enable boosting low frequency components. The default is `false`. #[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 `Job.edit_list` atoms with audio `EditAtom.inputs`. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AudioMapping { /// Required. The `EditAtom.key` that references the atom with audio inputs in the `Job.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. /// #[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 mapping for the `Job.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 {} /// Color preprocessing configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[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. /// #[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 {} /// Deblock preprocessing configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[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 {} /// Denoise preprocessing configuration. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[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 {} /// Edit atom. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[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")] pub end_time_offset: Option, /// List of `Input.key`s 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")] 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. /// #[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); } The JSON representation for `Empty` is empty JSON object `{}`. /// /// # 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) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Empty { _never_set: Option } impl client::ResponseResult for Empty {} /// H264 codec settings. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[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 `VideoStream.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. `VideoStream.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. Will default to the input frame rate if larger than the input frame rate. The API will generate an output FPS that is divisible by the input FPS, and smaller or equal to the target FPS. See [Calculating frame rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for more information. #[serde(rename="frameRate")] pub frame_rate: 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")] 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. #[serde(rename="heightPixels")] pub height_pixels: 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 `rate_control_mode`. The default is `vbr`. Supported rate control modes: - `vbr` - variable bitrate - `crf` - constant rate factor #[serde(rename="rateControlMode")] pub rate_control_mode: 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 `VideoStream.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. #[serde(rename="widthPixels")] pub width_pixels: Option, } impl client::Part for H264CodecSettings {} /// H265 codec settings. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[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 `VideoStream.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. `VideoStream.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. Will default to the input frame rate if larger than the input frame rate. The API will generate an output FPS that is divisible by the input FPS, and smaller or equal to the target FPS. See [Calculating frame rate](https://cloud.google.com/transcoder/docs/concepts/frame-rate) for more information. #[serde(rename="frameRate")] pub frame_rate: 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")] 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. #[serde(rename="heightPixels")] pub height_pixels: 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 `rate_control_mode`. The default is `vbr`. Supported rate control modes: - `vbr` - variable bitrate - `crf` - constant rate factor #[serde(rename="rateControlMode")] pub rate_control_mode: 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 `VideoStream.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. #[serde(rename="widthPixels")] pub width_pixels: Option, } impl client::Part for H265CodecSettings {} /// Overlaid jpeg image. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[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 JPEG image in Cloud Storage. For example, `gs://bucket/inputs/image.jpeg`. JPEG is the only supported image type. 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. /// #[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 will be populated from `Job.input_uri`. 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) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Job { /// 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 `state` 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`). #[serde(rename="inputUri")] pub input_uri: Option, /// The resource name of the job. Format: `projects/{project_number}/locations/{location}/jobs/{job}` pub name: 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/`. #[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`. Preset Transcoder templates: - `preset/{preset_id}` - 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. /// #[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 atom`s. 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 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. #[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) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobTemplate { /// The configuration for this template. pub config: 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) /// #[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) /// #[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. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Manifest { /// 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 given `MuxStream.key`s 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 of the `Manifest.mux_streams`. #[serde(rename="muxStreams")] pub mux_streams: Option>, /// Required. Type of the manifest, can be `HLS` or `DASH`. #[serde(rename="type")] pub type_: Option, } impl client::Part for Manifest {} /// Multiplexing settings for output stream. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[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` pub container: Option, /// List of `ElementaryStream.key`s multiplexed in this stream. #[serde(rename="elementaryStreams")] pub elementary_streams: 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, /// A unique key for this multiplexed stream. HLS media manifests will be named `MuxStream.key` with the `.m3u8` extension suffix. 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. /// #[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. /// #[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`. 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. /// #[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. /// #[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 {} /// Preprocessing configurations. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PreprocessingConfig { /// Audio preprocessing configuration. pub audio: Option