

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 요청을 생성
<a name="making-requests"></a>

서비스 클라이언트를 사용하여에 요청합니다 AWS 서비스. 는 [형식 안전 빌더](https://kotlinlang.org/docs/type-safe-builders.html) 패턴에 따라 도메인별 언어(DSLs)를 AWS SDK for Kotlin 제공하여 요청을 생성합니다. 중첩된 요청 구조도 DSLs 통해 액세스할 수 있습니다.

다음 예제에서는 Amazon DynamoDB [createTable](https://docs.aws.amazon.com/sdk-for-kotlin/api/latest/dynamodb/aws.sdk.kotlin.services.dynamodb/create-table.html) 작업 입력을 생성하는 방법을 보여줍니다.

```
val ddb = DynamoDbClient.fromEnvironment()

val req = CreateTableRequest {
    tableName = name
    keySchema = listOf(
        KeySchemaElement {
            attributeName = "year"
            keyType = KeyType.Hash
        },
        KeySchemaElement {
            attributeName = "title"
            keyType = KeyType.Range
        }
    )

    attributeDefinitions = listOf(
        AttributeDefinition {
            attributeName = "year"
            attributeType = ScalarAttributeType.N
        },
        AttributeDefinition {
            attributeName = "title"
            attributeType = ScalarAttributeType.S
        }
    )
    
    // You can configure the `provisionedThroughput` member
    // by using the `ProvisionedThroughput.Builder` directly:
    provisionedThroughput {
        readCapacityUnits = 10
        writeCapacityUnits = 10
    }
}

val resp = ddb.createTable(req)
```

## 서비스 인터페이스 DSL 오버로드
<a name="service-interface-dsl-overloads"></a>

서비스 클라이언트 인터페이스의 각 비스트리밍 작업에는 DSL 오버로드가 있으므로 별도의 요청을 생성할 필요가 없습니다.

오버로드된 함수를 사용하여 Amazon Simple Storage Service(Amazon S3) 버킷을 생성하는 예:

```
s3Client.createBucket {    // this: CreateBucketRequest.Builder
    bucket = newBucketName
}
```

이는 다음과 동일합니다.

```
val request = CreateBucketRequest {    // this: CreateBucketRequest.Builder 
    bucket = newBucketName 
}

s3client.createBucket(request)
```

## 필수 입력이 없는 요청
<a name="requests-no-required-inputs"></a>

필수 입력이 없는 작업은 요청 객체를 전달할 필요 없이 호출할 수 있습니다. 이는 Amazon S3 `listBuckets` API 작업과 같은 목록 유형 작업에서 가능한 경우가 많습니다.

 예를 들어 다음 세 문은 동일합니다.

```
s3Client.listBuckets(ListBucketsRequest {
  // Construct the request object directly.
})
s3Client.listBuckets {
  // DSL builder without explicitly setting any arguments.
}
s3Client.listBuckets()
```