sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ CloudMap/ GetServiceAttributes.ts

import type * as SD from "@distilled.cloud/aws/servicediscovery";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { Service } from "./Service.ts";

/**
 * Runtime binding for `servicediscovery:GetServiceAttributes` — reads the
 * custom key/value attributes stored on the bound {@link Service} (declared
 * via the Service resource's `attributes` prop or written out-of-band).
 * Use it to distribute small pieces of service-level configuration to
 * consumers without an extra config store. Provide the implementation with
 * `Effect.provide(AWS.CloudMap.GetServiceAttributesHttp)`.
 * ### Service Attributes
 * **Example:** Read the Service's Attributes
 * ```typescript
 * const getServiceAttributes =
 *   yield* AWS.CloudMap.GetServiceAttributes(service);
 *
 * const { ServiceAttributes } = yield* getServiceAttributes();
 * console.log(ServiceAttributes?.Attributes?.tier);
 * ```
 *
 * @binding
 */
export interface GetServiceAttributes extends Binding.Service<
  GetServiceAttributes,
  "AWS.CloudMap.GetServiceAttributes",
  <S extends Service>(
    service: S,
  ) => Effect.Effect<
    () => Effect.Effect<SD.GetServiceAttributesResponse, SD.GetServiceAttributesError>
  >
> {}
export const GetServiceAttributes = Binding.Service<GetServiceAttributes>(
  "AWS.CloudMap.GetServiceAttributes",
);