New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@effect-aws/client-account

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effect-aws/client-account

[![npm version](https://img.shields.io/npm/v/%40effect-aws%2Fclient-account?color=brightgreen&label=npm%20package)](https://www.npmjs.com/package/@effect-aws/client-account) [![npm downloads](https://img.shields.io/npm/dm/%40effect-aws%2Fclient-account)](

1.0.1
Version published
Weekly downloads
110
89.66%
Maintainers
0
Weekly downloads
 
Created

@effect-aws/client-account

npm version npm downloads

Installation

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

Usage

With default AccountClient instance:

import { AccountService, DefaultAccountServiceLayer } from "@effect-aws/client-account";

const program = AccountService.listRegions(args);

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

With custom AccountClient instance:

import {
  AccountService,
  BaseAccountServiceLayer,
  AccountClientInstance,
} from "@effect-aws/client-account";

const program = AccountService.listRegions(args);

const AccountClientInstanceLayer = Layer.succeed(
  AccountClientInstance,
  new AccountClient({ region: "eu-central-1" }),
);

const result = await pipe(
  program,
  Effect.provide(BaseAccountServiceLayer),
  Effect.provide(AccountClientInstanceLayer),
  Effect.runPromise,
);

With custom AccountClient configuration:

import {
  AccountService,
  BaseAccountServiceLayer,
  DefaultAccountClientConfigLayer,
  AccountClientInstance,
  AccountClientInstanceConfig,
} from "@effect-aws/client-account";

const program = AccountService.listRegions(args);

const AccountClientInstanceLayer = Layer.provide(
  Layer.effect(
    AccountClientInstance,
    AccountClientInstanceConfig.pipe(
      Effect.map(
        (config) => new AccountClient({ ...config, region: "eu-central-1" }),
      ),
    ),
  ),
  DefaultAccountClientConfigLayer,
);

const result = await pipe(
  program,
  Effect.provide(BaseAccountServiceLayer),
  Effect.provide(AccountClientInstanceLayer),
  Effect.runPromiseExit,
);

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

FAQs

Package last updated on 05 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts