Skip to content

Commit

Permalink
Adopt AWSClient.baseRequestParams in AWS client classes
Browse files Browse the repository at this point in the history
  • Loading branch information
oleiade committed Jul 30, 2024
1 parent 54702b9 commit 82ad018
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/internal/event-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class EventBridgeClient extends AWSClient {
)

const res = await http.asyncRequest(this.method, signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, EventBridgeOperation.PutEvents)
Expand Down
1 change: 1 addition & 0 deletions src/internal/kinesis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ export class KinesisClient extends AWSClient {
)

const res = await http.asyncRequest('POST', signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})

Expand Down
2 changes: 2 additions & 0 deletions src/internal/kms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class KMSClient extends AWSClient {
)

const res = await http.asyncRequest(this.method, signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, KMSOperation.ListKeys)
Expand Down Expand Up @@ -112,6 +113,7 @@ export class KMSClient extends AWSClient {
)

const res = await http.asyncRequest(this.method, signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, KMSOperation.GenerateDataKey)
Expand Down
1 change: 1 addition & 0 deletions src/internal/lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export class LambdaClient extends AWSClient {
)

const res = await http.asyncRequest(this.method, signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res)
Expand Down
10 changes: 10 additions & 0 deletions src/internal/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class S3Client extends AWSClient {
)

const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, 'ListBuckets')
Expand Down Expand Up @@ -120,6 +121,7 @@ export class S3Client extends AWSClient {
)

const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, 'ListObjectsV2')
Expand Down Expand Up @@ -183,6 +185,7 @@ export class S3Client extends AWSClient {
)

const res = await http.asyncRequest(method, signedRequest.url, null, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, 'GetObject')
Expand Down Expand Up @@ -241,6 +244,7 @@ export class S3Client extends AWSClient {
)

const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, 'PutObject')
Expand Down Expand Up @@ -270,6 +274,7 @@ export class S3Client extends AWSClient {
)

const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, 'DeleteObject')
Expand Down Expand Up @@ -309,6 +314,7 @@ export class S3Client extends AWSClient {
)

const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, {
...this.baseRequestParams,
headers: signedRequest.headers,
})

Expand Down Expand Up @@ -343,6 +349,7 @@ export class S3Client extends AWSClient {
)

const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, 'CreateMultipartUpload')
Expand Down Expand Up @@ -393,6 +400,7 @@ export class S3Client extends AWSClient {
)

const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, 'UploadPart')
Expand Down Expand Up @@ -443,6 +451,7 @@ export class S3Client extends AWSClient {
)

const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, 'CompleteMultipartUpload')
Expand Down Expand Up @@ -477,6 +486,7 @@ export class S3Client extends AWSClient {
)

const res = await http.asyncRequest(method, signedRequest.url, signedRequest.body || null, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, 'AbortMultipartUpload')
Expand Down
5 changes: 5 additions & 0 deletions src/internal/secrets-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class SecretsManagerClient extends AWSClient {
)

const res = await http.asyncRequest(this.method, signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, SecretsManagerOperation.ListSecrets)
Expand Down Expand Up @@ -100,6 +101,7 @@ export class SecretsManagerClient extends AWSClient {
)

const res = await http.asyncRequest(this.method, signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})

Expand Down Expand Up @@ -160,6 +162,7 @@ export class SecretsManagerClient extends AWSClient {
// headers['X-Amz-Target'] = `${this.serviceName}.CreateSecret`

const res = await http.asyncRequest(this.method, signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, SecretsManagerOperation.CreateSecret)
Expand Down Expand Up @@ -200,6 +203,7 @@ export class SecretsManagerClient extends AWSClient {
)

const res = await http.asyncRequest(this.method, signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, SecretsManagerOperation.PutSecretValue)
Expand Down Expand Up @@ -249,6 +253,7 @@ export class SecretsManagerClient extends AWSClient {
)

const res = await http.asyncRequest(this.method, signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, SecretsManagerOperation.DeleteSecret)
Expand Down
1 change: 1 addition & 0 deletions src/internal/sqs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export class SQSClient extends AWSClient {
)

const res = await http.asyncRequest('POST', signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})

Expand Down
1 change: 1 addition & 0 deletions src/internal/ssm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export class SystemsManagerClient extends AWSClient {
)

const res = await http.asyncRequest(this.method, signedRequest.url, signedRequest.body, {
...this.baseRequestParams,
headers: signedRequest.headers,
})
this.handleError(res, SystemsManagerOperation.GetParameter)
Expand Down

0 comments on commit 82ad018

Please sign in to comment.