pub struct TranscoderService { /* private fields */ }Expand description
Implements a client for the Transcoder API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
let client = TranscoderService::builder().build().await?;
let parent = "parent_value";
let mut list = client.list_jobs()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}§Service Description
Using the Transcoder API, you can queue asynchronous jobs for transcoding media into various output formats. Output formats may include different streaming standards such as HTTP Live Streaming (HLS) and Dynamic Adaptive Streaming over HTTP (DASH). You can also customize jobs using advanced features such as Digital Rights Management (DRM), audio equalization, content concatenation, and digital ad-stitch ready content generation.
§Configuration
To configure TranscoderService use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://transcoder.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
TranscoderService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap TranscoderService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl TranscoderService
impl TranscoderService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for TranscoderService.
let client = TranscoderService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: TranscoderService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: TranscoderService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn create_job(&self) -> CreateJob
pub fn create_job(&self) -> CreateJob
Creates a job in the specified region.
§Example
use google_cloud_video_transcoder_v1::model::Job;
use google_cloud_video_transcoder_v1::Result;
async fn sample(
client: &TranscoderService, parent: &str
) -> Result<()> {
let response = client.create_job()
.set_parent(parent)
.set_job(
Job::new()/* set fields */
)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_jobs(&self) -> ListJobs
pub fn list_jobs(&self) -> ListJobs
Lists jobs in the specified region.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_video_transcoder_v1::Result;
async fn sample(
client: &TranscoderService, parent: &str
) -> Result<()> {
let mut list = client.list_jobs()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_job(&self) -> GetJob
pub fn get_job(&self) -> GetJob
Returns the job data.
§Example
use google_cloud_video_transcoder_v1::Result;
async fn sample(
client: &TranscoderService, name: &str
) -> Result<()> {
let response = client.get_job()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_job(&self) -> DeleteJob
pub fn delete_job(&self) -> DeleteJob
Deletes a job.
§Example
use google_cloud_video_transcoder_v1::Result;
async fn sample(
client: &TranscoderService, name: &str
) -> Result<()> {
client.delete_job()
.set_name(name)
.send().await?;
Ok(())
}Sourcepub fn create_job_template(&self) -> CreateJobTemplate
pub fn create_job_template(&self) -> CreateJobTemplate
Creates a job template in the specified region.
§Example
use google_cloud_video_transcoder_v1::model::JobTemplate;
use google_cloud_video_transcoder_v1::Result;
async fn sample(
client: &TranscoderService, parent: &str
) -> Result<()> {
let response = client.create_job_template()
.set_parent(parent)
.set_job_template(
JobTemplate::new()/* set fields */
)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_job_templates(&self) -> ListJobTemplates
pub fn list_job_templates(&self) -> ListJobTemplates
Lists job templates in the specified region.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_video_transcoder_v1::Result;
async fn sample(
client: &TranscoderService, parent: &str
) -> Result<()> {
let mut list = client.list_job_templates()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_job_template(&self) -> GetJobTemplate
pub fn get_job_template(&self) -> GetJobTemplate
Returns the job template data.
§Example
use google_cloud_video_transcoder_v1::Result;
async fn sample(
client: &TranscoderService, name: &str
) -> Result<()> {
let response = client.get_job_template()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_job_template(&self) -> DeleteJobTemplate
pub fn delete_job_template(&self) -> DeleteJobTemplate
Deletes a job template.
§Example
use google_cloud_video_transcoder_v1::Result;
async fn sample(
client: &TranscoderService, name: &str
) -> Result<()> {
client.delete_job_template()
.set_name(name)
.send().await?;
Ok(())
}Trait Implementations§
Source§impl Clone for TranscoderService
impl Clone for TranscoderService
Source§fn clone(&self) -> TranscoderService
fn clone(&self) -> TranscoderService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more