Unverified Commit fdc58eef authored by Al McLean's avatar Al McLean Committed by GitHub
Browse files

New Services MediaLive and MediaPackage (#449)

* Added mediapackage with two examples, helloworld lists channels and list endpoints shows the endpoints

* Added medialive and helloworld to list inputs

* Fixing clippy error

* Changed based on clippy output

* Fixed up using new iterator pattern

* Added proper medialive binary
parent 513a5a50
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
[package]
name = "medialive-helloworld"
version = "0.1.0"
authors = ["Alistair McLean <mclean@amazon.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "medialive-hello-world"

[dependencies]
medialive = { package = "aws-sdk-medialive", path = "../../build/aws-sdk/medialive" }
tokio = { version = "1", features = ["full"] }
# used only to enable basic logging:
env_logger = "0.8.2"
+14 −0
Original line number Diff line number Diff line
#[tokio::main]
async fn main() -> Result<(), medialive::Error> {
    let client = medialive::Client::from_env();
    let input_list = client.list_inputs().send().await?;

    for i in input_list.inputs.unwrap_or_default() {
        let input_arn = i.arn.as_deref().unwrap_or_default();
        let input_name = i.name.as_deref().unwrap_or_default();

        println!("Input Name : {}, Input ARN : {}", input_name, input_arn);
    }

    Ok(())
}
+15 −0
Original line number Diff line number Diff line
[package]
name = "mediapackage-helloworld"
version = "0.1.0"
authors = ["Alistair McLean <mclean@amazon.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
mediapackage = { package = "aws-sdk-mediapackage", path = "../../build/aws-sdk/mediapackage" }
### To use native TLS:
# mediapackage = { package = "aws-sdk-mediapackage", path = "../../build/aws-sdk/mediapackage", default-features = false, features = ["native-tls"] }
tokio = { version = "1", features = ["full"] }
# used only to enable basic logging:
env_logger = "0.8.2"
 No newline at end of file
+23 −0
Original line number Diff line number Diff line
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

#[tokio::main]
async fn main() -> Result<(), mediapackage::Error> {
    let client = mediapackage::Client::from_env();
    let list_channels = client.list_channels().send().await?;

    // List out all the mediapackage channels and display their ARN and description.
    for c in list_channels.channels.unwrap_or_default() {
        let description = c.description.as_deref().unwrap_or_default();
        let arn = c.arn.as_deref().unwrap_or_default();

        println!(
            "Channel Description : {}, Channel ARN : {}",
            description, arn
        );
    }

    Ok(())
}
+15 −0
Original line number Diff line number Diff line
[package]
name = "mediapackage-listendpoints"
version = "0.1.0"
authors = ["Alistair McLean <mclean@amazon.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
mediapackage = { package = "aws-sdk-mediapackage", path = "../../build/aws-sdk/mediapackage" }
### To use native TLS:
# mediapackage = { package = "aws-sdk-mediapackage", path = "../../build/aws-sdk/mediapackage", default-features = false, features = ["native-tls"] }
tokio = { version = "1", features = ["full"] }
# used only to enable basic logging:
env_logger = "0.8.2"
 No newline at end of file
Loading