1.2.0 • Published 10 months ago

@effect-aws/client-codedeploy v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

@effect-aws/client-codedeploy

Installation

npm install --save @effect-aws/client-codedeploy

Usage

With default CodeDeployClient instance:

import { CodeDeployService, DefaultCodeDeployServiceLayer } from "@effect-aws/client-codedeploy";

const program = CodeDeployService.listApplications(args);

const result = pipe(
  program,
  Effect.provide(DefaultCodeDeployServiceLayer),
  Effect.runPromise,
);

With custom CodeDeployClient instance:

import {
  CodeDeployService,
  BaseCodeDeployServiceLayer,
  CodeDeployClientInstance,
} from "@effect-aws/client-codedeploy";

const program = CodeDeployService.listApplications(args);

const CodeDeployClientInstanceLayer = Layer.succeed(
  CodeDeployClientInstance,
  new CodeDeployClient({ region: "eu-central-1" }),
);

const result = await pipe(
  program,
  Effect.provide(BaseCodeDeployServiceLayer),
  Effect.provide(CodeDeployClientInstanceLayer),
  Effect.runPromise,
);

With custom CodeDeployClient configuration:

import {
  CodeDeployService,
  BaseCodeDeployServiceLayer,
  DefaultCodeDeployClientConfigLayer,
  CodeDeployClientInstance,
  CodeDeployClientInstanceConfig,
} from "@effect-aws/client-codedeploy";

const program = CodeDeployService.listApplications(args);

const CodeDeployClientInstanceLayer = Layer.provide(
  Layer.effect(
    CodeDeployClientInstance,
    CodeDeployClientInstanceConfig.pipe(
      Effect.map(
        (config) => new CodeDeployClient({ ...config, region: "eu-central-1" }),
      ),
    ),
  ),
  DefaultCodeDeployClientConfigLayer,
);

const result = await pipe(
  program,
  Effect.provide(BaseCodeDeployServiceLayer),
  Effect.provide(CodeDeployClientInstanceLayer),
  Effect.runPromiseExit,
);

or map over DefaultCodeDeployClientConfigLayer layer context and update the configuration...

1.2.0

10 months ago

1.1.0

11 months ago

1.0.0

11 months ago