sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ SNS/ GetEndpointAttributes.ts

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

export interface GetEndpointAttributesRequest extends sns.GetEndpointAttributesInput {}

/**
 * Runtime binding for `sns:GetEndpointAttributes`.
 *
 * Bind this operation to a {@link PlatformApplication} to read the
 * attributes (`Token`, `Enabled`, `CustomUserData`) of one of its device
 * endpoints.
 * Provide the `GetEndpointAttributesHttp` layer on the Function to implement the binding.
 * ### Mobile Push
 * **Example:** Read Endpoint Attributes
 * ```typescript
 * const getEndpointAttributes = yield* SNS.GetEndpointAttributes(app);
 * const { Attributes } = yield* getEndpointAttributes({
 *   EndpointArn: endpointArn,
 * });
 * ```
 *
 * @binding
 */
export interface GetEndpointAttributes extends Binding.Service<
  GetEndpointAttributes,
  "AWS.SNS.GetEndpointAttributes",
  (
    application: PlatformApplication,
  ) => Effect.Effect<
    (
      request: GetEndpointAttributesRequest,
    ) => Effect.Effect<sns.GetEndpointAttributesResponse, sns.GetEndpointAttributesError>
  >
> {}

export const GetEndpointAttributes = Binding.Service<GetEndpointAttributes>(
  "AWS.SNS.GetEndpointAttributes",
);