Skip to content

Commit 4d6351a

Browse files
committed
chore: update codegen and generate all clients
1 parent 168c561 commit 4d6351a

File tree

95 files changed

+5507
-4680
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+5507
-4680
lines changed

.changeset/polite-avocados-move.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
"@effect-aws/client-api-gateway-management-api": minor
3+
"@effect-aws/client-cognito-identity-provider": minor
4+
"@effect-aws/client-opensearch-serverless": minor
5+
"@effect-aws/client-cloudwatch-events": minor
6+
"@effect-aws/client-cloudwatch-logs": minor
7+
"@effect-aws/client-secrets-manager": minor
8+
"@effect-aws/client-cloudsearch": minor
9+
"@effect-aws/client-elasticache": minor
10+
"@effect-aws/client-eventbridge": minor
11+
"@effect-aws/client-cloudtrail": minor
12+
"@effect-aws/client-cloudwatch": minor
13+
"@effect-aws/client-codedeploy": minor
14+
"@effect-aws/client-opensearch": minor
15+
"@effect-aws/client-scheduler": minor
16+
"@effect-aws/client-dynamodb": minor
17+
"@effect-aws/client-textract": minor
18+
"@effect-aws/client-account": minor
19+
"@effect-aws/client-bedrock": minor
20+
"@effect-aws/client-kinesis": minor
21+
"@effect-aws/client-lambda": minor
22+
"@effect-aws/client-ec2": minor
23+
"@effect-aws/client-iam": minor
24+
"@effect-aws/client-kms": minor
25+
"@effect-aws/client-rds": minor
26+
"@effect-aws/client-sfn": minor
27+
"@effect-aws/client-sns": minor
28+
"@effect-aws/client-sqs": minor
29+
"@effect-aws/client-ssm": minor
30+
"@effect-aws/client-sts": minor
31+
"@effect-aws/client-mq": minor
32+
"@effect-aws/client-s3": minor
33+
---
34+
35+
simplify layers configuration (closes #78)

packages/client-account/README.md

Lines changed: 13 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -14,72 +14,45 @@ npm install --save @effect-aws/client-account
1414
With default AccountClient instance:
1515

1616
```typescript
17-
import { AccountService, DefaultAccountServiceLayer } from "@effect-aws/client-account";
17+
import { Account } from "@effect-aws/client-account";
1818

19-
const program = AccountService.listRegions(args);
19+
const program = Account.listRegions(args);
2020

2121
const result = pipe(
2222
program,
23-
Effect.provide(DefaultAccountServiceLayer),
23+
Effect.provide(Account.defaultLayer),
2424
Effect.runPromise,
2525
);
2626
```
2727

2828
With custom AccountClient instance:
2929

3030
```typescript
31-
import {
32-
AccountService,
33-
BaseAccountServiceLayer,
34-
AccountClientInstance,
35-
} from "@effect-aws/client-account";
31+
import { Account } from "@effect-aws/client-account";
3632

37-
const program = AccountService.listRegions(args);
38-
39-
const AccountClientInstanceLayer = Layer.succeed(
40-
AccountClientInstance,
41-
new AccountClient({ region: "eu-central-1" }),
42-
);
33+
const program = Account.listRegions(args);
4334

4435
const result = await pipe(
4536
program,
46-
Effect.provide(BaseAccountServiceLayer),
47-
Effect.provide(AccountClientInstanceLayer),
37+
Effect.provide(
38+
Account.baseLayer(() => new AccountClient({ region: "eu-central-1" })),
39+
),
4840
Effect.runPromise,
4941
);
5042
```
5143

5244
With custom AccountClient configuration:
5345

5446
```typescript
55-
import {
56-
AccountService,
57-
BaseAccountServiceLayer,
58-
DefaultAccountClientConfigLayer,
59-
AccountClientInstance,
60-
AccountClientInstanceConfig,
61-
} from "@effect-aws/client-account";
62-
63-
const program = AccountService.listRegions(args);
64-
65-
const AccountClientInstanceLayer = Layer.provide(
66-
Layer.effect(
67-
AccountClientInstance,
68-
AccountClientInstanceConfig.pipe(
69-
Effect.map(
70-
(config) => new AccountClient({ ...config, region: "eu-central-1" }),
71-
),
72-
),
73-
),
74-
DefaultAccountClientConfigLayer,
75-
);
47+
import { Account } from "@effect-aws/client-account";
48+
49+
const program = Account.listRegions(args);
7650

7751
const result = await pipe(
7852
program,
79-
Effect.provide(BaseAccountServiceLayer),
80-
Effect.provide(AccountClientInstanceLayer),
53+
Effect.provide(Account.layer({ region: "eu-central-1" })),
8154
Effect.runPromiseExit,
8255
);
8356
```
8457

85-
or map over `DefaultAccountClientConfigLayer` layer context and update the configuration...
58+
or use `Account.baseLayer((default) => new AccountClient({ ...default, region: "eu-central-1" }))`

packages/client-account/src/AccountService.ts

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*/
44
import {
55
AccountServiceException,
6+
type AccountClient,
7+
type AccountClientConfig,
68
AcceptPrimaryEmailUpdateCommand,
79
type AcceptPrimaryEmailUpdateCommandInput,
810
type AcceptPrimaryEmailUpdateCommandOutput,
@@ -45,7 +47,11 @@ import {
4547
AccountClientInstance,
4648
AccountClientInstanceLayer,
4749
} from "./AccountClientInstance";
48-
import { DefaultAccountClientConfigLayer } from "./AccountClientInstanceConfig";
50+
import {
51+
DefaultAccountClientConfigLayer,
52+
makeDefaultAccountClientInstanceConfig,
53+
AccountClientInstanceConfig,
54+
} from "./AccountClientInstanceConfig";
4955
import {
5056
AllServiceErrors,
5157
AccessDeniedError,
@@ -59,7 +65,7 @@ import {
5965
} from "./Errors";
6066

6167
/**
62-
* @since 1.0.1
68+
* @since 1.0.0
6369
*/
6470
export interface HttpHandlerOptions {
6571
/**
@@ -278,14 +284,6 @@ interface AccountService$ {
278284
>;
279285
}
280286

281-
/**
282-
* @since 1.0.0
283-
* @category models
284-
*/
285-
export class AccountService extends Effect.Tag(
286-
"@effect-aws/client-account/AccountService",
287-
)<AccountService, AccountService$>() {}
288-
289287
/**
290288
* @since 1.0.0
291289
* @category constructors
@@ -336,9 +334,53 @@ export const makeAccountService = Effect.gen(function* (_) {
336334
}, {}) as AccountService$;
337335
});
338336

337+
/**
338+
* @since 1.0.0
339+
* @category models
340+
*/
341+
export class AccountService extends Effect.Tag(
342+
"@effect-aws/client-account/AccountService",
343+
)<AccountService, AccountService$>() {
344+
static readonly defaultLayer = Layer.effect(this, makeAccountService).pipe(
345+
Layer.provide(AccountClientInstanceLayer),
346+
Layer.provide(DefaultAccountClientConfigLayer),
347+
);
348+
static readonly layer = (config: AccountClientConfig) =>
349+
Layer.effect(this, makeAccountService).pipe(
350+
Layer.provide(AccountClientInstanceLayer),
351+
Layer.provide(
352+
Layer.effect(
353+
AccountClientInstanceConfig,
354+
makeDefaultAccountClientInstanceConfig.pipe(
355+
Effect.map((defaultConfig) => ({ ...defaultConfig, ...config })),
356+
),
357+
),
358+
),
359+
);
360+
static readonly baseLayer = (
361+
evaluate: (defaultConfig: AccountClientConfig) => AccountClient,
362+
) =>
363+
Layer.effect(this, makeAccountService).pipe(
364+
Layer.provide(
365+
Layer.effect(
366+
AccountClientInstance,
367+
Effect.map(makeDefaultAccountClientInstanceConfig, evaluate),
368+
),
369+
),
370+
);
371+
}
372+
373+
/**
374+
* @since 1.0.0
375+
* @category models
376+
* @alias AccountService
377+
*/
378+
export const Account = AccountService;
379+
339380
/**
340381
* @since 1.0.0
341382
* @category layers
383+
* @deprecated use Account.baseLayer instead
342384
*/
343385
export const BaseAccountServiceLayer = Layer.effect(
344386
AccountService,
@@ -348,6 +390,7 @@ export const BaseAccountServiceLayer = Layer.effect(
348390
/**
349391
* @since 1.0.0
350392
* @category layers
393+
* @deprecated use Account.layer instead
351394
*/
352395
export const AccountServiceLayer = BaseAccountServiceLayer.pipe(
353396
Layer.provide(AccountClientInstanceLayer),
@@ -356,7 +399,6 @@ export const AccountServiceLayer = BaseAccountServiceLayer.pipe(
356399
/**
357400
* @since 1.0.0
358401
* @category layers
402+
* @deprecated use Account.defaultLayer instead
359403
*/
360-
export const DefaultAccountServiceLayer = AccountServiceLayer.pipe(
361-
Layer.provide(DefaultAccountClientConfigLayer),
362-
);
404+
export const DefaultAccountServiceLayer = AccountService.defaultLayer;

0 commit comments

Comments
 (0)