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, Hash)] pub enum Scope { /// See, edit, configure, and delete your Google Cloud Platform data 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_beta1 as transcoder1_beta1; /// use transcoder1_beta1::api::Job; /// use transcoder1_beta1::{Result, Error}; /// # async fn dox() { /// use std::default::Default; /// use transcoder1_beta1::{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.3".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.3`. /// /// 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 { /// Required. URI of the key delivery service. This URI is inserted into the M3U8 header. #[serde(rename="keyUri")] pub key_uri: 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`. #[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. /// #[serde_with::serde_as(crate = "::client::serde_with")] #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AudioAtom { /// List of `Channel`s for this audio stream. for in-depth explanation. pub channels: Option>, /// Required. The `EditAtom.key` that references the atom with audio inputs in the `Job.edit_list`. pub key: Option, } impl client::Part for AudioAtom {} /// The audio channel. /// /// 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 AudioChannel { /// List of `Job.inputs` for this audio channel. pub inputs: Option>, } impl client::Part for AudioChannel {} /// Identifies which input file, track, and channel should be used. /// /// 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 AudioChannelInput { /// Required. The zero-based index of the channel in the input file. pub channel: 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 `Input.key` that identifies the input file. pub key: Option, /// Required. The zero-based index of the track in the input file. pub track: Option, } impl client::Part for AudioChannelInput {} /// 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 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. /// #[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 {} /// Deblock 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 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. /// #[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 {} /// 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`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")] #[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); } 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) #[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. 128 bit Initialization Vector (IV) represented as lowercase hexadecimal digits. pub iv: Option, /// Required. 128 bit encryption key represented as lowercase hexadecimal digits. pub key: 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, } impl client::Part for Encryption {} /// Additional information about the reasons for the failure. /// /// 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 FailureDetail { /// A description of the failure. pub description: Option, } impl client::Part for FailureDetail {} /// Overlaid jpeg 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: `1.0` (solid, default) to `0.0` (transparent). 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. /// #[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 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) #[serde_with::serde_as(crate = "::client::serde_with")] #[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. List of failure details. This property may contain additional information about the failure when `failure_reason` is present. *Note*: This feature is not yet available. #[serde(rename="failureDetails")] pub failure_details: Option>, /// Output only. A description of the reason for the failure. This property is always present when `state` is `FAILED`. #[serde(rename="failureReason")] pub failure_reason: 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}/locations/{location}/jobs/{job}` pub name: Option, /// Output only. The origin URI. *Note*: This feature is not yet available. #[serde(rename="originUri")] pub origin_uri: 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, /// Specify the priority of the job. Enter a value between 0 and 100, where 0 is the lowest priority and 100 is the highest priority. The default is 0. pub priority: Option, /// Output only. Estimated fractional progress, from `0` to `1` for each step. *Note*: This feature is not yet available. pub progress: 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. /// #[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 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) #[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 resource name of the job template. Format: `projects/{project}/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, } 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, } 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 { /// 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 {} /// 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. 128 bit Key ID represented as lowercase hexadecimal digits for use with common encryption. #[serde(rename="keyId")] pub key_id: Option, /// 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' pub container: Option, /// List of `ElementaryStream.key`s multiplexed in this stream. #[serde(rename="elementaryStreams")] pub elementary_streams: Option>, /// Encryption settings. pub encryption: 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. /// #[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 {} /// The origin URI. /// /// 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 OriginUri { /// Dash manifest URI. If multiple Dash manifests are created, only the first one is listed. pub dash: Option, /// HLS manifest URI per https://tools.ietf.org/html/rfc8216#section-4.3.4. If multiple HLS manifests are created, only the first one is listed. pub hls: Option, } impl client::Part for OriginUri {} /// 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`. 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 {} /// 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