WorkMailMessageFlow - AWS API Codegen

API Documentation | Deno Module Docs | Original docs from AWS-JS-SDK

Customize Generated Module

Only include specific operations:
Include documentation comments:

Example Import

import { WorkMailMessageFlow } from "https://aws-api.deno.dev/v0.3/services/workmailmessageflow.ts";


Generated Source (the actual code)

// Generation parameters:
//   aws-sdk-js definitions from v2.1060.0
//   AWS service UID: workmailmessageflow-2019-05-01
//   code generation: v0.3
//   generated at: 2025-08-14

// Originally served at https://aws-api.deno.dev/v0.3/services/workmailmessageflow.ts

// Autogenerated API client for: Amazon WorkMail Message Flow

import * as client from "https://deno.land/x/aws_api@v0.6.0/client/common.ts";
import * as cmnP from "https://deno.land/x/aws_api@v0.6.0/encoding/common.ts";
import * as jsonP from "https://deno.land/x/aws_api@v0.6.0/encoding/json.ts";

export class WorkMailMessageFlow {
  #client: client.ServiceClient;
  constructor(apiFactory: client.ApiFactory) {
    this.#client = apiFactory.buildServiceClient(WorkMailMessageFlow.ApiMetadata);
  }

  static ApiMetadata: client.ApiMetadata = {
    "apiVersion": "2019-05-01",
    "endpointPrefix": "workmailmessageflow",
    "jsonVersion": "1.1",
    "protocol": "rest-json",
    "serviceFullName": "Amazon WorkMail Message Flow",
    "serviceId": "WorkMailMessageFlow",
    "signatureVersion": "v4",
    "uid": "workmailmessageflow-2019-05-01"
  };

  /** Retrieves the raw content of an in-transit email message, in MIME format. */
  async getRawMessageContent(
    params: GetRawMessageContentRequest,
    opts: client.RequestOptions = {},
  ): Promise<GetRawMessageContentResponse> {

    const resp = await this.#client.performRequest({
      opts,
      action: "GetRawMessageContent",
      method: "GET",
      requestUri: cmnP.encodePath`/messages/${params["messageId"]}`,
    });
    return {
      messageContent: new Uint8Array(await resp.arrayBuffer()),
    };
  }

  /** Updates the raw content of an in-transit email message, in MIME format. */
  async putRawMessageContent(
    params: PutRawMessageContentRequest,
    opts: client.RequestOptions = {},
  ): Promise<void> {
    const body: jsonP.JSONObject = {
      content: fromRawMessageContent(params["content"]),
    };
    const resp = await this.#client.performRequest({
      opts, body,
      action: "PutRawMessageContent",
      requestUri: cmnP.encodePath`/messages/${params["messageId"]}`,
    });
    await resp.body?.cancel();
  }

}

// refs: 1 - tags: named, input
export interface GetRawMessageContentRequest {
  /** The identifier of the email message to retrieve. */
  messageId: string;
}

// refs: 1 - tags: named, input
export interface PutRawMessageContentRequest {
  /** The identifier of the email message being updated. */
  messageId: string;
  /** Describes the raw message content of the updated email message. */
  content: RawMessageContent;
}

// refs: 1 - tags: named, output
export interface GetRawMessageContentResponse {
  /** The raw content of the email message, in MIME format. */
  messageContent: Uint8Array;
}

// refs: 1 - tags: input, named, interface
/** Provides the MIME content of the updated email message as an S3 object. */
export interface RawMessageContent {
  /** The S3 reference of an email message. */
  s3Reference: S3Reference;
}
function fromRawMessageContent(input?: RawMessageContent | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    s3Reference: fromS3Reference(input["s3Reference"]),
  }
}

// refs: 1 - tags: input, named, interface
/** Amazon S3 object representing the updated message content, in MIME format. */
export interface S3Reference {
  /** The S3 bucket name. */
  bucket: string;
  /** The S3 key object name. */
  key: string;
  /** If you enable versioning for the bucket, you can specify the object version. */
  objectVersion?: string | null;
}
function fromS3Reference(input?: S3Reference | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    bucket: input["bucket"],
    key: input["key"],
    objectVersion: input["objectVersion"],
  }
}