

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# RequestParameter
<a name="sam-property-function-requestparameter"></a>

設定特定 Api\$1Path\$1Method 的請求參數。

請求參數需要指定 `Required`或 `Caching` 屬性

## 語法
<a name="sam-property-function-requestparameter-syntax"></a>

若要在 AWS Serverless Application Model (AWS SAM) 範本中宣告此實體，請使用下列語法。

### YAML
<a name="sam-property-function-requestparameter-syntax.yaml"></a>

```
  [Caching](#sam-function-requestparameter-caching): Boolean
  [Required](#sam-function-requestparameter-required): Boolean
```

## Properties
<a name="sam-property-function-requestparameter-properties"></a>

 `Caching`   <a name="sam-function-requestparameter-caching"></a>
將 `cacheKeyParameters` 區段新增至 API Gateway OpenApi 定義  
*類型*：布林值  
*必要*：有條件  
*CloudFormation 相容性*：此屬性對 是唯一的 AWS SAM ，並且沒有 CloudFormation 同等屬性。

 `Required`   <a name="sam-function-requestparameter-required"></a>
此欄位指定是否需要參數  
*類型*：布林值  
*必要*：有條件  
*CloudFormation 相容性*：此屬性對 是唯一的 AWS SAM ，並且沒有 CloudFormation 同等屬性。

## 範例
<a name="sam-property-function-requestparameter--examples"></a>

### 請求參數
<a name="sam-property-function-requestparameter--examples--request-parameter"></a>

設定請求參數的範例

#### YAML
<a name="sam-property-function-requestparameter--examples--request-parameter--yaml"></a>

```
RequestParameters:
  - method.request.header.Authorization:
      Required: true
      Caching: true
```