

There are more AWS SDK examples available in the [AWS Doc SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples) GitHub repo.

# Code examples for MediaLive using AWS SDKs
<a name="medialive_code_examples"></a>

The following code examples show you how to use AWS Elemental MediaLive with an AWS software development kit (SDK).

*Actions* are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

**More resources**
+  **[ MediaLive User Guide](https://docs.aws.amazon.com/medialive/latest/ug/what-is.html)** – More information about MediaLive.
+ **[MediaLive API Reference](https://docs.aws.amazon.com/medialive/latest/apireference/what-is.html)** – Details about all available MediaLive actions.
+ **[AWS Developer Center](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23elemental-medialive)** – Code examples that you can filter by category or full-text search.
+ **[AWS SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples)** – GitHub repo with complete code in preferred languages. Includes instructions for setting up and running the code.

**Contents**
+ [Basics](medialive_code_examples_basics.md)
  + [Actions](medialive_code_examples_actions.md)
    + [`ListInputs`](medialive_example_medialive_ListInputs_section.md)

# Basic examples for MediaLive using AWS SDKs
<a name="medialive_code_examples_basics"></a>

The following code examples show how to use the basics of AWS Elemental MediaLive with AWS SDKs. 

**Contents**
+ [Actions](medialive_code_examples_actions.md)
  + [`ListInputs`](medialive_example_medialive_ListInputs_section.md)

# Actions for MediaLive using AWS SDKs
<a name="medialive_code_examples_actions"></a>

The following code examples demonstrate how to perform individual MediaLive actions with AWS SDKs. Each example includes a link to GitHub, where you can find instructions for setting up and running the code. 

 The following examples include only the most commonly used actions. For a complete list, see the [AWS Elemental MediaLive API Reference](https://docs.aws.amazon.com/medialive/latest/apireference/what-is.html). 

**Topics**
+ [`ListInputs`](medialive_example_medialive_ListInputs_section.md)

# Use `ListInputs` with an AWS SDK
<a name="medialive_example_medialive_ListInputs_section"></a>

The following code example shows how to use `ListInputs`.

------
#### [ Rust ]

**SDK for Rust**  
 There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1/examples/medialive#code-examples). 
List your MediaLive input names and ARNs in the Region.  

```
async fn show_inputs(client: &Client) -> Result<(), Error> {
    let input_list = client.list_inputs().send().await?;

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

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

    Ok(())
}
```
+  For API details, see [ListInputs](https://docs.rs/aws-sdk-medialive/latest/aws_sdk_medialive/client/struct.Client.html#method.list_inputs) in *AWS SDK for Rust API reference*. 

------