

文档 AWS SDK 示例 GitHub 存储库中还有更多 [S AWS DK 示例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用的代码示 MediaLive 例 AWS SDKs
<a name="medialive_code_examples"></a>

以下代码示例向您展示了如何 AWS Elemental MediaLive 使用 AWS 软件开发套件 (SDK)。

*操作*是大型程序的代码摘录，必须在上下文中运行。您可以通过操作了解如何调用单个服务函数，还可以通过函数相关场景的上下文查看操作。

**更多资源**
+  **[ MediaLive 用户指南](https://docs.aws.amazon.com/medialive/latest/ug/what-is.html)** —有关的更多信息 MediaLive.
+ **[MediaLive API 参考](https://docs.aws.amazon.com/medialive/latest/apireference/what-is.html)**-有关所有可用 MediaLive 操作的详细信息。
+ **[AWS 开发者中心](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23elemental-medialive)** — 您可以按类别或全文搜索筛选的代码示例。
+ **[AWS SDK 示例](https://github.com/awsdocs/aws-doc-sdk-examples)** — 包含首选语言完整代码的 GitHub 存储库。包括有关设置和运行代码的说明。

**Contents**
+ [基本功能](medialive_code_examples_basics.md)
  + [操作](medialive_code_examples_actions.md)
    + [`ListInputs`](medialive_example_medialive_ListInputs_section.md)

# 使用的基本示 MediaLive 例 AWS SDKs
<a name="medialive_code_examples_basics"></a>

以下代码示例说明如何使用 with 的基础 AWS Elemental MediaLive 知识 AWS SDKs。

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

# MediaLive 使用的操作 AWS SDKs
<a name="medialive_code_examples_actions"></a>

以下代码示例演示了如何使用执行单个 MediaLive操作 AWS SDKs。每个示例都包含一个指向的链接 GitHub，您可以在其中找到有关设置和运行代码的说明。

 以下示例仅包括最常用的操作。有关完整列表，请参阅 [AWS Elemental MediaLive API 参考](https://docs.aws.amazon.com/medialive/latest/apireference/what-is.html)。

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

# 与 AWS SDK `ListInputs` 配合使用
<a name="medialive_example_medialive_ListInputs_section"></a>

以下代码示例演示了如何使用 `ListInputs`。

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

**适用于 Rust 的 SDK**  
 还有更多相关信息 GitHub。在 [AWS 代码示例存储库](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/rustv1/examples/medialive#code-examples)中查找完整示例，了解如何进行设置和运行。
在 “区域” ARNs 中列出您的 MediaLive 输入名称。  

```
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(())
}
```
+  有关 API 的详细信息，请参阅适用[ListInputs](https://docs.rs/aws-sdk-medialive/latest/aws_sdk_medialive/client/struct.Client.html#method.list_inputs)于 *Rust 的AWS SDK API 参考*。

------