ManagedBlockchain - 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 { ManagedBlockchain } from "https://aws-api.deno.dev/v0.3/services/managedblockchain.ts";


Generated Source (the actual code)

// Autogenerated API client for: Amazon Managed Blockchain
// Generation parameters:
//   aws-sdk-js definitions from v2.1060.0
//   AWS service UID: managedblockchain-2018-09-24
//   code generation: v0.3
//   generated at: 2025-09-27
//
// Originally served at https://aws-api.deno.dev/v0.3/services/managedblockchain.ts


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";
function generateIdemptToken() {
  return crypto.randomUUID();
}

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

  static ApiMetadata: client.ApiMetadata = {
    "apiVersion": "2018-09-24",
    "endpointPrefix": "managedblockchain",
    "jsonVersion": "1.1",
    "protocol": "rest-json",
    "serviceAbbreviation": "ManagedBlockchain",
    "serviceFullName": "Amazon Managed Blockchain",
    "serviceId": "ManagedBlockchain",
    "signatureVersion": "v4",
    "signingName": "managedblockchain",
    "uid": "managedblockchain-2018-09-24"
  };

  /** Creates a member within a Managed Blockchain network. */
  async createMember(
    params: CreateMemberInput,
    opts: client.RequestOptions = {},
  ): Promise<CreateMemberOutput> {
    const body: jsonP.JSONObject = {
      ClientRequestToken: params["ClientRequestToken"] ?? generateIdemptToken(),
      InvitationId: params["InvitationId"],
      MemberConfiguration: fromMemberConfiguration(params["MemberConfiguration"]),
    };
    const resp = await this.#client.performRequest({
      opts, body,
      action: "CreateMember",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/members`,
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "MemberId": "s",
      },
    }, await resp.json());
  }

  /** Creates a new blockchain network using Amazon Managed Blockchain. */
  async createNetwork(
    params: CreateNetworkInput,
    opts: client.RequestOptions = {},
  ): Promise<CreateNetworkOutput> {
    const body: jsonP.JSONObject = {
      ClientRequestToken: params["ClientRequestToken"] ?? generateIdemptToken(),
      Name: params["Name"],
      Description: params["Description"],
      Framework: params["Framework"],
      FrameworkVersion: params["FrameworkVersion"],
      FrameworkConfiguration: fromNetworkFrameworkConfiguration(params["FrameworkConfiguration"]),
      VotingPolicy: fromVotingPolicy(params["VotingPolicy"]),
      MemberConfiguration: fromMemberConfiguration(params["MemberConfiguration"]),
      Tags: params["Tags"],
    };
    const resp = await this.#client.performRequest({
      opts, body,
      action: "CreateNetwork",
      requestUri: "/networks",
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "NetworkId": "s",
        "MemberId": "s",
      },
    }, await resp.json());
  }

  /** Creates a node on the specified blockchain network. */
  async createNode(
    params: CreateNodeInput,
    opts: client.RequestOptions = {},
  ): Promise<CreateNodeOutput> {
    const body: jsonP.JSONObject = {
      ClientRequestToken: params["ClientRequestToken"] ?? generateIdemptToken(),
      MemberId: params["MemberId"],
      NodeConfiguration: fromNodeConfiguration(params["NodeConfiguration"]),
      Tags: params["Tags"],
    };
    const resp = await this.#client.performRequest({
      opts, body,
      action: "CreateNode",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/nodes`,
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "NodeId": "s",
      },
    }, await resp.json());
  }

  /** Creates a proposal for a change to the network that other members of the network can vote on, for example, a proposal to add a new member to the network. */
  async createProposal(
    params: CreateProposalInput,
    opts: client.RequestOptions = {},
  ): Promise<CreateProposalOutput> {
    const body: jsonP.JSONObject = {
      ClientRequestToken: params["ClientRequestToken"] ?? generateIdemptToken(),
      MemberId: params["MemberId"],
      Actions: fromProposalActions(params["Actions"]),
      Description: params["Description"],
      Tags: params["Tags"],
    };
    const resp = await this.#client.performRequest({
      opts, body,
      action: "CreateProposal",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/proposals`,
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "ProposalId": "s",
      },
    }, await resp.json());
  }

  /** Deletes a member. */
  async deleteMember(
    params: DeleteMemberInput,
    opts: client.RequestOptions = {},
  ): Promise<void> {

    const resp = await this.#client.performRequest({
      opts,
      action: "DeleteMember",
      method: "DELETE",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/members/${params["MemberId"]}`,
    });
    await resp.body?.cancel();
  }

  /** Deletes a node that your AWS account owns. */
  async deleteNode(
    params: DeleteNodeInput,
    opts: client.RequestOptions = {},
  ): Promise<void> {
    const query = new URLSearchParams;
    if (params["MemberId"] != null) query.set("memberId", params["MemberId"]?.toString() ?? "");
    const resp = await this.#client.performRequest({
      opts, query,
      action: "DeleteNode",
      method: "DELETE",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/nodes/${params["NodeId"]}`,
    });
    await resp.body?.cancel();
  }

  /** Returns detailed information about a member. */
  async getMember(
    params: GetMemberInput,
    opts: client.RequestOptions = {},
  ): Promise<GetMemberOutput> {

    const resp = await this.#client.performRequest({
      opts,
      action: "GetMember",
      method: "GET",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/members/${params["MemberId"]}`,
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "Member": toMember,
      },
    }, await resp.json());
  }

  /** Returns detailed information about a network. */
  async getNetwork(
    params: GetNetworkInput,
    opts: client.RequestOptions = {},
  ): Promise<GetNetworkOutput> {

    const resp = await this.#client.performRequest({
      opts,
      action: "GetNetwork",
      method: "GET",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}`,
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "Network": toNetwork,
      },
    }, await resp.json());
  }

  /** Returns detailed information about a node. */
  async getNode(
    params: GetNodeInput,
    opts: client.RequestOptions = {},
  ): Promise<GetNodeOutput> {
    const query = new URLSearchParams;
    if (params["MemberId"] != null) query.set("memberId", params["MemberId"]?.toString() ?? "");
    const resp = await this.#client.performRequest({
      opts, query,
      action: "GetNode",
      method: "GET",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/nodes/${params["NodeId"]}`,
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "Node": toNode,
      },
    }, await resp.json());
  }

  /** Returns detailed information about a proposal. */
  async getProposal(
    params: GetProposalInput,
    opts: client.RequestOptions = {},
  ): Promise<GetProposalOutput> {

    const resp = await this.#client.performRequest({
      opts,
      action: "GetProposal",
      method: "GET",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/proposals/${params["ProposalId"]}`,
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "Proposal": toProposal,
      },
    }, await resp.json());
  }

  /** Returns a list of all invitations for the current AWS account. */
  async listInvitations(
    params: ListInvitationsInput = {},
    opts: client.RequestOptions = {},
  ): Promise<ListInvitationsOutput> {
    const query = new URLSearchParams;
    if (params["MaxResults"] != null) query.set("maxResults", params["MaxResults"]?.toString() ?? "");
    if (params["NextToken"] != null) query.set("nextToken", params["NextToken"]?.toString() ?? "");
    const resp = await this.#client.performRequest({
      opts, query,
      action: "ListInvitations",
      method: "GET",
      requestUri: "/invitations",
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "Invitations": [toInvitation],
        "NextToken": "s",
      },
    }, await resp.json());
  }

  /** Returns a list of the members in a network and properties of their configurations. */
  async listMembers(
    params: ListMembersInput,
    opts: client.RequestOptions = {},
  ): Promise<ListMembersOutput> {
    const query = new URLSearchParams;
    if (params["Name"] != null) query.set("name", params["Name"]?.toString() ?? "");
    if (params["Status"] != null) query.set("status", params["Status"]?.toString() ?? "");
    if (params["IsOwned"] != null) query.set("isOwned", params["IsOwned"]?.toString() ?? "");
    if (params["MaxResults"] != null) query.set("maxResults", params["MaxResults"]?.toString() ?? "");
    if (params["NextToken"] != null) query.set("nextToken", params["NextToken"]?.toString() ?? "");
    const resp = await this.#client.performRequest({
      opts, query,
      action: "ListMembers",
      method: "GET",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/members`,
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "Members": [toMemberSummary],
        "NextToken": "s",
      },
    }, await resp.json());
  }

  /** Returns information about the networks in which the current AWS account participates. */
  async listNetworks(
    params: ListNetworksInput = {},
    opts: client.RequestOptions = {},
  ): Promise<ListNetworksOutput> {
    const query = new URLSearchParams;
    if (params["Name"] != null) query.set("name", params["Name"]?.toString() ?? "");
    if (params["Framework"] != null) query.set("framework", params["Framework"]?.toString() ?? "");
    if (params["Status"] != null) query.set("status", params["Status"]?.toString() ?? "");
    if (params["MaxResults"] != null) query.set("maxResults", params["MaxResults"]?.toString() ?? "");
    if (params["NextToken"] != null) query.set("nextToken", params["NextToken"]?.toString() ?? "");
    const resp = await this.#client.performRequest({
      opts, query,
      action: "ListNetworks",
      method: "GET",
      requestUri: "/networks",
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "Networks": [toNetworkSummary],
        "NextToken": "s",
      },
    }, await resp.json());
  }

  /** Returns information about the nodes within a network. */
  async listNodes(
    params: ListNodesInput,
    opts: client.RequestOptions = {},
  ): Promise<ListNodesOutput> {
    const query = new URLSearchParams;
    if (params["MemberId"] != null) query.set("memberId", params["MemberId"]?.toString() ?? "");
    if (params["Status"] != null) query.set("status", params["Status"]?.toString() ?? "");
    if (params["MaxResults"] != null) query.set("maxResults", params["MaxResults"]?.toString() ?? "");
    if (params["NextToken"] != null) query.set("nextToken", params["NextToken"]?.toString() ?? "");
    const resp = await this.#client.performRequest({
      opts, query,
      action: "ListNodes",
      method: "GET",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/nodes`,
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "Nodes": [toNodeSummary],
        "NextToken": "s",
      },
    }, await resp.json());
  }

  /** Returns the list of votes for a specified proposal, including the value of each vote and the unique identifier of the member that cast the vote. */
  async listProposalVotes(
    params: ListProposalVotesInput,
    opts: client.RequestOptions = {},
  ): Promise<ListProposalVotesOutput> {
    const query = new URLSearchParams;
    if (params["MaxResults"] != null) query.set("maxResults", params["MaxResults"]?.toString() ?? "");
    if (params["NextToken"] != null) query.set("nextToken", params["NextToken"]?.toString() ?? "");
    const resp = await this.#client.performRequest({
      opts, query,
      action: "ListProposalVotes",
      method: "GET",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/proposals/${params["ProposalId"]}/votes`,
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "ProposalVotes": [toVoteSummary],
        "NextToken": "s",
      },
    }, await resp.json());
  }

  /** Returns a list of proposals for the network. */
  async listProposals(
    params: ListProposalsInput,
    opts: client.RequestOptions = {},
  ): Promise<ListProposalsOutput> {
    const query = new URLSearchParams;
    if (params["MaxResults"] != null) query.set("maxResults", params["MaxResults"]?.toString() ?? "");
    if (params["NextToken"] != null) query.set("nextToken", params["NextToken"]?.toString() ?? "");
    const resp = await this.#client.performRequest({
      opts, query,
      action: "ListProposals",
      method: "GET",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/proposals`,
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "Proposals": [toProposalSummary],
        "NextToken": "s",
      },
    }, await resp.json());
  }

  /** Returns a list of tags for the specified resource. */
  async listTagsForResource(
    params: ListTagsForResourceRequest,
    opts: client.RequestOptions = {},
  ): Promise<ListTagsForResourceResponse> {

    const resp = await this.#client.performRequest({
      opts,
      action: "ListTagsForResource",
      method: "GET",
      requestUri: cmnP.encodePath`/tags/${params["ResourceArn"]}`,
    });
    return jsonP.readObj({
      required: {},
      optional: {
        "Tags": x => jsonP.readMap(String, String, x),
      },
    }, await resp.json());
  }

  /** Rejects an invitation to join a network. */
  async rejectInvitation(
    params: RejectInvitationInput,
    opts: client.RequestOptions = {},
  ): Promise<void> {

    const resp = await this.#client.performRequest({
      opts,
      action: "RejectInvitation",
      method: "DELETE",
      requestUri: cmnP.encodePath`/invitations/${params["InvitationId"]}`,
    });
    await resp.body?.cancel();
  }

  /** Adds or overwrites the specified tags for the specified Amazon Managed Blockchain resource. */
  async tagResource(
    params: TagResourceRequest,
    opts: client.RequestOptions = {},
  ): Promise<void> {
    const body: jsonP.JSONObject = {
      Tags: params["Tags"],
    };
    const resp = await this.#client.performRequest({
      opts, body,
      action: "TagResource",
      requestUri: cmnP.encodePath`/tags/${params["ResourceArn"]}`,
    });
    await resp.body?.cancel();
  }

  /** Removes the specified tags from the Amazon Managed Blockchain resource. */
  async untagResource(
    params: UntagResourceRequest,
    opts: client.RequestOptions = {},
  ): Promise<void> {
    const query = new URLSearchParams;
    for (const item of params["TagKeys"]) {
      query.append("tagKeys", item?.toString() ?? "");
    }
    const resp = await this.#client.performRequest({
      opts, query,
      action: "UntagResource",
      method: "DELETE",
      requestUri: cmnP.encodePath`/tags/${params["ResourceArn"]}`,
    });
    await resp.body?.cancel();
  }

  /** Updates a member configuration with new parameters. */
  async updateMember(
    params: UpdateMemberInput,
    opts: client.RequestOptions = {},
  ): Promise<void> {
    const body: jsonP.JSONObject = {
      LogPublishingConfiguration: fromMemberLogPublishingConfiguration(params["LogPublishingConfiguration"]),
    };
    const resp = await this.#client.performRequest({
      opts, body,
      action: "UpdateMember",
      method: "PATCH",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/members/${params["MemberId"]}`,
    });
    await resp.body?.cancel();
  }

  /** Updates a node configuration with new parameters. */
  async updateNode(
    params: UpdateNodeInput,
    opts: client.RequestOptions = {},
  ): Promise<void> {
    const body: jsonP.JSONObject = {
      MemberId: params["MemberId"],
      LogPublishingConfiguration: fromNodeLogPublishingConfiguration(params["LogPublishingConfiguration"]),
    };
    const resp = await this.#client.performRequest({
      opts, body,
      action: "UpdateNode",
      method: "PATCH",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/nodes/${params["NodeId"]}`,
    });
    await resp.body?.cancel();
  }

  /** Casts a vote for a specified `ProposalId` on behalf of a member. */
  async voteOnProposal(
    params: VoteOnProposalInput,
    opts: client.RequestOptions = {},
  ): Promise<void> {
    const body: jsonP.JSONObject = {
      VoterMemberId: params["VoterMemberId"],
      Vote: params["Vote"],
    };
    const resp = await this.#client.performRequest({
      opts, body,
      action: "VoteOnProposal",
      requestUri: cmnP.encodePath`/networks/${params["NetworkId"]}/proposals/${params["ProposalId"]}/votes`,
    });
    await resp.body?.cancel();
  }

}

// refs: 1 - tags: named, input
export interface CreateMemberInput {
  /** A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. */
  ClientRequestToken: string;
  /** The unique identifier of the invitation that is sent to the member to join the network. */
  InvitationId: string;
  /** The unique identifier of the network in which the member is created. */
  NetworkId: string;
  /** Member configuration parameters. */
  MemberConfiguration: MemberConfiguration;
}

// refs: 1 - tags: named, input
export interface CreateNetworkInput {
  /** A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. */
  ClientRequestToken: string;
  /** The name of the network. */
  Name: string;
  /** An optional description for the network. */
  Description?: string | null;
  /** The blockchain framework that the network uses. */
  Framework: Framework;
  /** The version of the blockchain framework that the network uses. */
  FrameworkVersion: string;
  /** Configuration properties of the blockchain framework relevant to the network configuration. */
  FrameworkConfiguration?: NetworkFrameworkConfiguration | null;
  /** The voting rules used by the network to determine if a proposal is approved. */
  VotingPolicy: VotingPolicy;
  /** Configuration properties for the first member within the network. */
  MemberConfiguration: MemberConfiguration;
  /** Tags to assign to the network. */
  Tags?: { [key: string]: string | null | undefined } | null;
}

// refs: 1 - tags: named, input
export interface CreateNodeInput {
  /** A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. */
  ClientRequestToken: string;
  /** The unique identifier of the network for the node. */
  NetworkId: string;
  /** The unique identifier of the member that owns this node. */
  MemberId?: string | null;
  /** The properties of a node configuration. */
  NodeConfiguration: NodeConfiguration;
  /** Tags to assign to the node. */
  Tags?: { [key: string]: string | null | undefined } | null;
}

// refs: 1 - tags: named, input
export interface CreateProposalInput {
  /** A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. */
  ClientRequestToken: string;
  /** The unique identifier of the network for which the proposal is made. */
  NetworkId: string;
  /** The unique identifier of the member that is creating the proposal. */
  MemberId: string;
  /** The type of actions proposed, such as inviting a member or removing a member. */
  Actions: ProposalActions;
  /** A description for the proposal that is visible to voting members, for example, "Proposal to add Example Corp. */
  Description?: string | null;
  /** Tags to assign to the proposal. */
  Tags?: { [key: string]: string | null | undefined } | null;
}

// refs: 1 - tags: named, input
export interface DeleteMemberInput {
  /** The unique identifier of the network from which the member is removed. */
  NetworkId: string;
  /** The unique identifier of the member to remove. */
  MemberId: string;
}

// refs: 1 - tags: named, input
export interface DeleteNodeInput {
  /** The unique identifier of the network that the node is on. */
  NetworkId: string;
  /** The unique identifier of the member that owns this node. */
  MemberId?: string | null;
  /** The unique identifier of the node. */
  NodeId: string;
}

// refs: 1 - tags: named, input
export interface GetMemberInput {
  /** The unique identifier of the network to which the member belongs. */
  NetworkId: string;
  /** The unique identifier of the member. */
  MemberId: string;
}

// refs: 1 - tags: named, input
export interface GetNetworkInput {
  /** The unique identifier of the network to get information about. */
  NetworkId: string;
}

// refs: 1 - tags: named, input
export interface GetNodeInput {
  /** The unique identifier of the network that the node is on. */
  NetworkId: string;
  /** The unique identifier of the member that owns the node. */
  MemberId?: string | null;
  /** The unique identifier of the node. */
  NodeId: string;
}

// refs: 1 - tags: named, input
export interface GetProposalInput {
  /** The unique identifier of the network for which the proposal is made. */
  NetworkId: string;
  /** The unique identifier of the proposal. */
  ProposalId: string;
}

// refs: 1 - tags: named, input
export interface ListInvitationsInput {
  /** The maximum number of invitations to return. */
  MaxResults?: number | null;
  /** The pagination token that indicates the next set of results to retrieve. */
  NextToken?: string | null;
}

// refs: 1 - tags: named, input
export interface ListMembersInput {
  /** The unique identifier of the network for which to list members. */
  NetworkId: string;
  /** The optional name of the member to list. */
  Name?: string | null;
  /** An optional status specifier. */
  Status?: MemberStatus | null;
  /** An optional Boolean value. */
  IsOwned?: boolean | null;
  /** The maximum number of members to return in the request. */
  MaxResults?: number | null;
  /** The pagination token that indicates the next set of results to retrieve. */
  NextToken?: string | null;
}

// refs: 1 - tags: named, input
export interface ListNetworksInput {
  /** The name of the network. */
  Name?: string | null;
  /** An optional framework specifier. */
  Framework?: Framework | null;
  /** An optional status specifier. */
  Status?: NetworkStatus | null;
  /** The maximum number of networks to list. */
  MaxResults?: number | null;
  /** The pagination token that indicates the next set of results to retrieve. */
  NextToken?: string | null;
}

// refs: 1 - tags: named, input
export interface ListNodesInput {
  /** The unique identifier of the network for which to list nodes. */
  NetworkId: string;
  /** The unique identifier of the member who owns the nodes to list. */
  MemberId?: string | null;
  /** An optional status specifier. */
  Status?: NodeStatus | null;
  /** The maximum number of nodes to list. */
  MaxResults?: number | null;
  /** The pagination token that indicates the next set of results to retrieve. */
  NextToken?: string | null;
}

// refs: 1 - tags: named, input
export interface ListProposalVotesInput {
  /** The unique identifier of the network. */
  NetworkId: string;
  /** The unique identifier of the proposal. */
  ProposalId: string;
  /** The maximum number of votes to return. */
  MaxResults?: number | null;
  /** The pagination token that indicates the next set of results to retrieve. */
  NextToken?: string | null;
}

// refs: 1 - tags: named, input
export interface ListProposalsInput {
  /** The unique identifier of the network. */
  NetworkId: string;
  /** The maximum number of proposals to return. */
  MaxResults?: number | null;
  /** The pagination token that indicates the next set of results to retrieve. */
  NextToken?: string | null;
}

// refs: 1 - tags: named, input
export interface ListTagsForResourceRequest {
  /** The Amazon Resource Name (ARN) of the resource. */
  ResourceArn: string;
}

// refs: 1 - tags: named, input
export interface RejectInvitationInput {
  /** The unique identifier of the invitation to reject. */
  InvitationId: string;
}

// refs: 1 - tags: named, input
export interface TagResourceRequest {
  /** The Amazon Resource Name (ARN) of the resource. */
  ResourceArn: string;
  /** The tags to assign to the specified resource. */
  Tags: { [key: string]: string | null | undefined };
}

// refs: 1 - tags: named, input
export interface UntagResourceRequest {
  /** The Amazon Resource Name (ARN) of the resource. */
  ResourceArn: string;
  /** The tag keys. */
  TagKeys: string[];
}

// refs: 1 - tags: named, input
export interface UpdateMemberInput {
  /** The unique identifier of the Managed Blockchain network to which the member belongs. */
  NetworkId: string;
  /** The unique identifier of the member. */
  MemberId: string;
  /** Configuration properties for publishing to Amazon CloudWatch Logs. */
  LogPublishingConfiguration?: MemberLogPublishingConfiguration | null;
}

// refs: 1 - tags: named, input
export interface UpdateNodeInput {
  /** The unique identifier of the network that the node is on. */
  NetworkId: string;
  /** The unique identifier of the member that owns the node. */
  MemberId?: string | null;
  /** The unique identifier of the node. */
  NodeId: string;
  /** Configuration properties for publishing to Amazon CloudWatch Logs. */
  LogPublishingConfiguration?: NodeLogPublishingConfiguration | null;
}

// refs: 1 - tags: named, input
export interface VoteOnProposalInput {
  /** The unique identifier of the network. */
  NetworkId: string;
  /** The unique identifier of the proposal. */
  ProposalId: string;
  /** The unique identifier of the member casting the vote. */
  VoterMemberId: string;
  /** The value of the vote. */
  Vote: VoteValue;
}

// refs: 1 - tags: named, output
export interface CreateMemberOutput {
  /** The unique identifier of the member. */
  MemberId?: string | null;
}

// refs: 1 - tags: named, output
export interface CreateNetworkOutput {
  /** The unique identifier for the network. */
  NetworkId?: string | null;
  /** The unique identifier for the first member within the network. */
  MemberId?: string | null;
}

// refs: 1 - tags: named, output
export interface CreateNodeOutput {
  /** The unique identifier of the node. */
  NodeId?: string | null;
}

// refs: 1 - tags: named, output
export interface CreateProposalOutput {
  /** The unique identifier of the proposal. */
  ProposalId?: string | null;
}

// refs: 1 - tags: named, output
export interface GetMemberOutput {
  /** The properties of a member. */
  Member?: Member | null;
}

// refs: 1 - tags: named, output
export interface GetNetworkOutput {
  /** An object containing network configuration parameters. */
  Network?: Network | null;
}

// refs: 1 - tags: named, output
export interface GetNodeOutput {
  /** Properties of the node configuration. */
  Node?: Node | null;
}

// refs: 1 - tags: named, output
export interface GetProposalOutput {
  /** Information about a proposal. */
  Proposal?: Proposal | null;
}

// refs: 1 - tags: named, output
export interface ListInvitationsOutput {
  /** The invitations for the network. */
  Invitations?: Invitation[] | null;
  /** The pagination token that indicates the next set of results to retrieve. */
  NextToken?: string | null;
}

// refs: 1 - tags: named, output
export interface ListMembersOutput {
  /** An array of `MemberSummary` objects. */
  Members?: MemberSummary[] | null;
  /** The pagination token that indicates the next set of results to retrieve. */
  NextToken?: string | null;
}

// refs: 1 - tags: named, output
export interface ListNetworksOutput {
  /** An array of `NetworkSummary` objects that contain configuration properties for each network. */
  Networks?: NetworkSummary[] | null;
  /** The pagination token that indicates the next set of results to retrieve. */
  NextToken?: string | null;
}

// refs: 1 - tags: named, output
export interface ListNodesOutput {
  /** An array of `NodeSummary` objects that contain configuration properties for each node. */
  Nodes?: NodeSummary[] | null;
  /** The pagination token that indicates the next set of results to retrieve. */
  NextToken?: string | null;
}

// refs: 1 - tags: named, output
export interface ListProposalVotesOutput {
  /** The list of votes. */
  ProposalVotes?: VoteSummary[] | null;
  /** The pagination token that indicates the next set of results to retrieve. */
  NextToken?: string | null;
}

// refs: 1 - tags: named, output
export interface ListProposalsOutput {
  /** The summary of each proposal made on the network. */
  Proposals?: ProposalSummary[] | null;
  /** The pagination token that indicates the next set of results to retrieve. */
  NextToken?: string | null;
}

// refs: 1 - tags: named, output
export interface ListTagsForResourceResponse {
  /** The tags assigned to the resource. */
  Tags?: { [key: string]: string | null | undefined } | null;
}

// refs: 2 - tags: input, named, interface
/** Configuration properties of the member. */
export interface MemberConfiguration {
  /** The name of the member. */
  Name: string;
  /** An optional description of the member. */
  Description?: string | null;
  /** Configuration properties of the blockchain framework relevant to the member. */
  FrameworkConfiguration: MemberFrameworkConfiguration;
  /** Configuration properties for logging events associated with a member of a Managed Blockchain network. */
  LogPublishingConfiguration?: MemberLogPublishingConfiguration | null;
  /** Tags assigned to the member. */
  Tags?: { [key: string]: string | null | undefined } | null;
  /** The Amazon Resource Name (ARN) of the customer managed key in AWS Key Management Service (AWS KMS) to use for encryption at rest in the member. */
  KmsKeyArn?: string | null;
}
function fromMemberConfiguration(input?: MemberConfiguration | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    Name: input["Name"],
    Description: input["Description"],
    FrameworkConfiguration: fromMemberFrameworkConfiguration(input["FrameworkConfiguration"]),
    LogPublishingConfiguration: fromMemberLogPublishingConfiguration(input["LogPublishingConfiguration"]),
    Tags: input["Tags"],
    KmsKeyArn: input["KmsKeyArn"],
  }
}

// refs: 2 - tags: input, named, interface
/** Configuration properties relevant to a member for the blockchain framework that the Managed Blockchain network uses. */
export interface MemberFrameworkConfiguration {
  /** Attributes of Hyperledger Fabric for a member on a Managed Blockchain network that uses Hyperledger Fabric. */
  Fabric?: MemberFabricConfiguration | null;
}
function fromMemberFrameworkConfiguration(input?: MemberFrameworkConfiguration | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    Fabric: fromMemberFabricConfiguration(input["Fabric"]),
  }
}

// refs: 2 - tags: input, named, interface
/** Configuration properties for Hyperledger Fabric for a member in a Managed Blockchain network using the Hyperledger Fabric framework. */
export interface MemberFabricConfiguration {
  /** The user name for the member's initial administrative user. */
  AdminUsername: string;
  /** The password for the member's initial administrative user. */
  AdminPassword: string;
}
function fromMemberFabricConfiguration(input?: MemberFabricConfiguration | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    AdminUsername: input["AdminUsername"],
    AdminPassword: input["AdminPassword"],
  }
}

// refs: 4 - tags: input, named, interface, output
/** Configuration properties for logging events associated with a member of a Managed Blockchain network. */
export interface MemberLogPublishingConfiguration {
  /** Configuration properties for logging events associated with a member of a Managed Blockchain network using the Hyperledger Fabric framework. */
  Fabric?: MemberFabricLogPublishingConfiguration | null;
}
function fromMemberLogPublishingConfiguration(input?: MemberLogPublishingConfiguration | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    Fabric: fromMemberFabricLogPublishingConfiguration(input["Fabric"]),
  }
}
function toMemberLogPublishingConfiguration(root: jsonP.JSONValue): MemberLogPublishingConfiguration {
  return jsonP.readObj({
    required: {},
    optional: {
      "Fabric": toMemberFabricLogPublishingConfiguration,
    },
  }, root);
}

// refs: 4 - tags: input, named, interface, output
/** Configuration properties for logging events associated with a member of a Managed Blockchain network using the Hyperledger Fabric framework. */
export interface MemberFabricLogPublishingConfiguration {
  /** Configuration properties for logging events associated with a member's Certificate Authority (CA). */
  CaLogs?: LogConfigurations | null;
}
function fromMemberFabricLogPublishingConfiguration(input?: MemberFabricLogPublishingConfiguration | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    CaLogs: fromLogConfigurations(input["CaLogs"]),
  }
}
function toMemberFabricLogPublishingConfiguration(root: jsonP.JSONValue): MemberFabricLogPublishingConfiguration {
  return jsonP.readObj({
    required: {},
    optional: {
      "CaLogs": toLogConfigurations,
    },
  }, root);
}

// refs: 10 - tags: input, named, interface, output
/** A collection of log configurations. */
export interface LogConfigurations {
  /** Parameters for publishing logs to Amazon CloudWatch Logs. */
  Cloudwatch?: LogConfiguration | null;
}
function fromLogConfigurations(input?: LogConfigurations | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    Cloudwatch: fromLogConfiguration(input["Cloudwatch"]),
  }
}
function toLogConfigurations(root: jsonP.JSONValue): LogConfigurations {
  return jsonP.readObj({
    required: {},
    optional: {
      "Cloudwatch": toLogConfiguration,
    },
  }, root);
}

// refs: 10 - tags: input, named, interface, output
/** A configuration for logging events. */
export interface LogConfiguration {
  /** Indicates whether logging is enabled. */
  Enabled?: boolean | null;
}
function fromLogConfiguration(input?: LogConfiguration | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    Enabled: input["Enabled"],
  }
}
function toLogConfiguration(root: jsonP.JSONValue): LogConfiguration {
  return jsonP.readObj({
    required: {},
    optional: {
      "Enabled": "b",
    },
  }, root);
}

// refs: 5 - tags: input, named, enum, output
export type Framework =
| "HYPERLEDGER_FABRIC"
| "ETHEREUM"
| cmnP.UnexpectedEnumValue;

// refs: 1 - tags: input, named, interface
/** Configuration properties relevant to the network for the blockchain framework that the network uses. */
export interface NetworkFrameworkConfiguration {
  /** Hyperledger Fabric configuration properties for a Managed Blockchain network that uses Hyperledger Fabric. */
  Fabric?: NetworkFabricConfiguration | null;
}
function fromNetworkFrameworkConfiguration(input?: NetworkFrameworkConfiguration | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    Fabric: fromNetworkFabricConfiguration(input["Fabric"]),
  }
}

// refs: 1 - tags: input, named, interface
/** Hyperledger Fabric configuration properties for the network. */
export interface NetworkFabricConfiguration {
  /** The edition of Amazon Managed Blockchain that the network uses. */
  Edition: Edition;
}
function fromNetworkFabricConfiguration(input?: NetworkFabricConfiguration | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    Edition: input["Edition"],
  }
}

// refs: 2 - tags: input, named, enum, output
export type Edition =
| "STARTER"
| "STANDARD"
| cmnP.UnexpectedEnumValue;

// refs: 2 - tags: input, named, interface, output
/** The voting rules for the network to decide if a proposal is accepted */
export interface VotingPolicy {
  /** Defines the rules for the network for voting on proposals, such as the percentage of `YES` votes required for the proposal to be approved and the duration of the proposal. */
  ApprovalThresholdPolicy?: ApprovalThresholdPolicy | null;
}
function fromVotingPolicy(input?: VotingPolicy | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    ApprovalThresholdPolicy: fromApprovalThresholdPolicy(input["ApprovalThresholdPolicy"]),
  }
}
function toVotingPolicy(root: jsonP.JSONValue): VotingPolicy {
  return jsonP.readObj({
    required: {},
    optional: {
      "ApprovalThresholdPolicy": toApprovalThresholdPolicy,
    },
  }, root);
}

// refs: 2 - tags: input, named, interface, output
/** A policy type that defines the voting rules for the network. */
export interface ApprovalThresholdPolicy {
  /** The percentage of votes among all members that must be `YES` for a proposal to be approved. */
  ThresholdPercentage?: number | null;
  /** The duration from the time that a proposal is created until it expires. */
  ProposalDurationInHours?: number | null;
  /** Determines whether the vote percentage must be greater than the `ThresholdPercentage` or must be greater than or equal to the `ThreholdPercentage` to be approved. */
  ThresholdComparator?: ThresholdComparator | null;
}
function fromApprovalThresholdPolicy(input?: ApprovalThresholdPolicy | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    ThresholdPercentage: input["ThresholdPercentage"],
    ProposalDurationInHours: input["ProposalDurationInHours"],
    ThresholdComparator: input["ThresholdComparator"],
  }
}
function toApprovalThresholdPolicy(root: jsonP.JSONValue): ApprovalThresholdPolicy {
  return jsonP.readObj({
    required: {},
    optional: {
      "ThresholdPercentage": "n",
      "ProposalDurationInHours": "n",
      "ThresholdComparator": (x: jsonP.JSONValue) => cmnP.readEnum<ThresholdComparator>(x),
    },
  }, root);
}

// refs: 2 - tags: input, named, enum, output
export type ThresholdComparator =
| "GREATER_THAN"
| "GREATER_THAN_OR_EQUAL_TO"
| cmnP.UnexpectedEnumValue;

// refs: 1 - tags: input, named, interface
/** Configuration properties of a node. */
export interface NodeConfiguration {
  /** The Amazon Managed Blockchain instance type for the node. */
  InstanceType: string;
  /** The Availability Zone in which the node exists. */
  AvailabilityZone?: string | null;
  /** Configuration properties for logging events associated with a peer node on a Hyperledger Fabric network on Managed Blockchain. */
  LogPublishingConfiguration?: NodeLogPublishingConfiguration | null;
  /** The state database that the node uses. */
  StateDB?: StateDBType | null;
}
function fromNodeConfiguration(input?: NodeConfiguration | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    InstanceType: input["InstanceType"],
    AvailabilityZone: input["AvailabilityZone"],
    LogPublishingConfiguration: fromNodeLogPublishingConfiguration(input["LogPublishingConfiguration"]),
    StateDB: input["StateDB"],
  }
}

// refs: 3 - tags: input, named, interface, output
/** Configuration properties for logging events associated with a peer node on a Hyperledger Fabric network on Managed Blockchain. */
export interface NodeLogPublishingConfiguration {
  /** Configuration properties for logging events associated with a node that is owned by a member of a Managed Blockchain network using the Hyperledger Fabric framework. */
  Fabric?: NodeFabricLogPublishingConfiguration | null;
}
function fromNodeLogPublishingConfiguration(input?: NodeLogPublishingConfiguration | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    Fabric: fromNodeFabricLogPublishingConfiguration(input["Fabric"]),
  }
}
function toNodeLogPublishingConfiguration(root: jsonP.JSONValue): NodeLogPublishingConfiguration {
  return jsonP.readObj({
    required: {},
    optional: {
      "Fabric": toNodeFabricLogPublishingConfiguration,
    },
  }, root);
}

// refs: 3 - tags: input, named, interface, output
/** Configuration properties for logging events associated with a peer node owned by a member in a Managed Blockchain network. */
export interface NodeFabricLogPublishingConfiguration {
  /** Configuration properties for logging events associated with chaincode execution on a peer node. */
  ChaincodeLogs?: LogConfigurations | null;
  /** Configuration properties for a peer node log. */
  PeerLogs?: LogConfigurations | null;
}
function fromNodeFabricLogPublishingConfiguration(input?: NodeFabricLogPublishingConfiguration | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    ChaincodeLogs: fromLogConfigurations(input["ChaincodeLogs"]),
    PeerLogs: fromLogConfigurations(input["PeerLogs"]),
  }
}
function toNodeFabricLogPublishingConfiguration(root: jsonP.JSONValue): NodeFabricLogPublishingConfiguration {
  return jsonP.readObj({
    required: {},
    optional: {
      "ChaincodeLogs": toLogConfigurations,
      "PeerLogs": toLogConfigurations,
    },
  }, root);
}

// refs: 2 - tags: input, named, enum, output
export type StateDBType =
| "LevelDB"
| "CouchDB"
| cmnP.UnexpectedEnumValue;

// refs: 2 - tags: input, named, interface, output
/** The actions to carry out if a proposal is `APPROVED`. */
export interface ProposalActions {
  /** The actions to perform for an `APPROVED` proposal to invite an AWS account to create a member and join the network. */
  Invitations?: InviteAction[] | null;
  /** The actions to perform for an `APPROVED` proposal to remove a member from the network, which deletes the member and all associated member resources from the network. */
  Removals?: RemoveAction[] | null;
}
function fromProposalActions(input?: ProposalActions | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    Invitations: input["Invitations"]?.map(x => fromInviteAction(x)),
    Removals: input["Removals"]?.map(x => fromRemoveAction(x)),
  }
}
function toProposalActions(root: jsonP.JSONValue): ProposalActions {
  return jsonP.readObj({
    required: {},
    optional: {
      "Invitations": [toInviteAction],
      "Removals": [toRemoveAction],
    },
  }, root);
}

// refs: 2 - tags: input, named, interface, output
/** An action to invite a specific AWS account to create a member and join the network. */
export interface InviteAction {
  /** The AWS account ID to invite. */
  Principal: string;
}
function fromInviteAction(input?: InviteAction | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    Principal: input["Principal"],
  }
}
function toInviteAction(root: jsonP.JSONValue): InviteAction {
  return jsonP.readObj({
    required: {
      "Principal": "s",
    },
    optional: {},
  }, root);
}

// refs: 2 - tags: input, named, interface, output
/** An action to remove a member from a Managed Blockchain network as the result of a removal proposal that is `APPROVED`. */
export interface RemoveAction {
  /** The unique identifier of the member to remove. */
  MemberId: string;
}
function fromRemoveAction(input?: RemoveAction | null): jsonP.JSONValue {
  if (!input) return input;
  return {
    MemberId: input["MemberId"],
  }
}
function toRemoveAction(root: jsonP.JSONValue): RemoveAction {
  return jsonP.readObj({
    required: {
      "MemberId": "s",
    },
    optional: {},
  }, root);
}

// refs: 3 - tags: input, named, enum, output
export type MemberStatus =
| "CREATING"
| "AVAILABLE"
| "CREATE_FAILED"
| "UPDATING"
| "DELETING"
| "DELETED"
| "INACCESSIBLE_ENCRYPTION_KEY"
| cmnP.UnexpectedEnumValue;

// refs: 4 - tags: input, named, enum, output
export type NetworkStatus =
| "CREATING"
| "AVAILABLE"
| "CREATE_FAILED"
| "DELETING"
| "DELETED"
| cmnP.UnexpectedEnumValue;

// refs: 3 - tags: input, named, enum, output
export type NodeStatus =
| "CREATING"
| "AVAILABLE"
| "UNHEALTHY"
| "CREATE_FAILED"
| "UPDATING"
| "DELETING"
| "DELETED"
| "FAILED"
| "INACCESSIBLE_ENCRYPTION_KEY"
| cmnP.UnexpectedEnumValue;

// refs: 2 - tags: input, named, enum, output
export type VoteValue =
| "YES"
| "NO"
| cmnP.UnexpectedEnumValue;

// refs: 1 - tags: output, named, interface
/** Member configuration properties. */
export interface Member {
  /** The unique identifier of the network to which the member belongs. */
  NetworkId?: string | null;
  /** The unique identifier of the member. */
  Id?: string | null;
  /** The name of the member. */
  Name?: string | null;
  /** An optional description for the member. */
  Description?: string | null;
  /** Attributes relevant to a member for the blockchain framework that the Managed Blockchain network uses. */
  FrameworkAttributes?: MemberFrameworkAttributes | null;
  /** Configuration properties for logging events associated with a member. */
  LogPublishingConfiguration?: MemberLogPublishingConfiguration | null;
  /** The status of a member. */
  Status?: MemberStatus | null;
  /** The date and time that the member was created. */
  CreationDate?: Date | number | null;
  /** Tags assigned to the member. */
  Tags?: { [key: string]: string | null | undefined } | null;
  /** The Amazon Resource Name (ARN) of the member. */
  Arn?: string | null;
  /** The Amazon Resource Name (ARN) of the customer managed key in AWS Key Management Service (AWS KMS) that the member uses for encryption at rest. */
  KmsKeyArn?: string | null;
}
function toMember(root: jsonP.JSONValue): Member {
  return jsonP.readObj({
    required: {},
    optional: {
      "NetworkId": "s",
      "Id": "s",
      "Name": "s",
      "Description": "s",
      "FrameworkAttributes": toMemberFrameworkAttributes,
      "LogPublishingConfiguration": toMemberLogPublishingConfiguration,
      "Status": (x: jsonP.JSONValue) => cmnP.readEnum<MemberStatus>(x),
      "CreationDate": "d",
      "Tags": x => jsonP.readMap(String, String, x),
      "Arn": "s",
      "KmsKeyArn": "s",
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Attributes relevant to a member for the blockchain framework that the Managed Blockchain network uses. */
export interface MemberFrameworkAttributes {
  /** Attributes of Hyperledger Fabric relevant to a member on a Managed Blockchain network that uses Hyperledger Fabric. */
  Fabric?: MemberFabricAttributes | null;
}
function toMemberFrameworkAttributes(root: jsonP.JSONValue): MemberFrameworkAttributes {
  return jsonP.readObj({
    required: {},
    optional: {
      "Fabric": toMemberFabricAttributes,
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Attributes of Hyperledger Fabric for a member in a Managed Blockchain network using the Hyperledger Fabric framework. */
export interface MemberFabricAttributes {
  /** The user name for the initial administrator user for the member. */
  AdminUsername?: string | null;
  /** The endpoint used to access the member's certificate authority. */
  CaEndpoint?: string | null;
}
function toMemberFabricAttributes(root: jsonP.JSONValue): MemberFabricAttributes {
  return jsonP.readObj({
    required: {},
    optional: {
      "AdminUsername": "s",
      "CaEndpoint": "s",
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Network configuration properties. */
export interface Network {
  /** The unique identifier of the network. */
  Id?: string | null;
  /** The name of the network. */
  Name?: string | null;
  /** Attributes of the blockchain framework for the network. */
  Description?: string | null;
  /** The blockchain framework that the network uses. */
  Framework?: Framework | null;
  /** The version of the blockchain framework that the network uses. */
  FrameworkVersion?: string | null;
  /** Attributes of the blockchain framework that the network uses. */
  FrameworkAttributes?: NetworkFrameworkAttributes | null;
  /** The VPC endpoint service name of the VPC endpoint service of the network. */
  VpcEndpointServiceName?: string | null;
  /** The voting rules for the network to decide if a proposal is accepted. */
  VotingPolicy?: VotingPolicy | null;
  /** The current status of the network. */
  Status?: NetworkStatus | null;
  /** The date and time that the network was created. */
  CreationDate?: Date | number | null;
  /** Tags assigned to the network. */
  Tags?: { [key: string]: string | null | undefined } | null;
  /** The Amazon Resource Name (ARN) of the network. */
  Arn?: string | null;
}
function toNetwork(root: jsonP.JSONValue): Network {
  return jsonP.readObj({
    required: {},
    optional: {
      "Id": "s",
      "Name": "s",
      "Description": "s",
      "Framework": (x: jsonP.JSONValue) => cmnP.readEnum<Framework>(x),
      "FrameworkVersion": "s",
      "FrameworkAttributes": toNetworkFrameworkAttributes,
      "VpcEndpointServiceName": "s",
      "VotingPolicy": toVotingPolicy,
      "Status": (x: jsonP.JSONValue) => cmnP.readEnum<NetworkStatus>(x),
      "CreationDate": "d",
      "Tags": x => jsonP.readMap(String, String, x),
      "Arn": "s",
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Attributes relevant to the network for the blockchain framework that the network uses. */
export interface NetworkFrameworkAttributes {
  /** Attributes of Hyperledger Fabric for a Managed Blockchain network that uses Hyperledger Fabric. */
  Fabric?: NetworkFabricAttributes | null;
  /** Attributes of an Ethereum network for Managed Blockchain resources participating in an Ethereum network. */
  Ethereum?: NetworkEthereumAttributes | null;
}
function toNetworkFrameworkAttributes(root: jsonP.JSONValue): NetworkFrameworkAttributes {
  return jsonP.readObj({
    required: {},
    optional: {
      "Fabric": toNetworkFabricAttributes,
      "Ethereum": toNetworkEthereumAttributes,
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Attributes of Hyperledger Fabric for a network. */
export interface NetworkFabricAttributes {
  /** The endpoint of the ordering service for the network. */
  OrderingServiceEndpoint?: string | null;
  /** The edition of Amazon Managed Blockchain that Hyperledger Fabric uses. */
  Edition?: Edition | null;
}
function toNetworkFabricAttributes(root: jsonP.JSONValue): NetworkFabricAttributes {
  return jsonP.readObj({
    required: {},
    optional: {
      "OrderingServiceEndpoint": "s",
      "Edition": (x: jsonP.JSONValue) => cmnP.readEnum<Edition>(x),
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Attributes of Ethereum for a network. */
export interface NetworkEthereumAttributes {
  /** The Ethereum `CHAIN_ID` associated with the Ethereum network. */
  ChainId?: string | null;
}
function toNetworkEthereumAttributes(root: jsonP.JSONValue): NetworkEthereumAttributes {
  return jsonP.readObj({
    required: {},
    optional: {
      "ChainId": "s",
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Configuration properties of a node. */
export interface Node {
  /** The unique identifier of the network that the node is on. */
  NetworkId?: string | null;
  /** The unique identifier of the member to which the node belongs. */
  MemberId?: string | null;
  /** The unique identifier of the node. */
  Id?: string | null;
  /** The instance type of the node. */
  InstanceType?: string | null;
  /** The Availability Zone in which the node exists. */
  AvailabilityZone?: string | null;
  /** Attributes of the blockchain framework being used. */
  FrameworkAttributes?: NodeFrameworkAttributes | null;
  /** Configuration properties for logging events associated with a peer node on a Hyperledger Fabric network on Managed Blockchain. */
  LogPublishingConfiguration?: NodeLogPublishingConfiguration | null;
  /** The state database that the node uses. */
  StateDB?: StateDBType | null;
  /** The status of the node. */
  Status?: NodeStatus | null;
  /** The date and time that the node was created. */
  CreationDate?: Date | number | null;
  /** Tags assigned to the node. */
  Tags?: { [key: string]: string | null | undefined } | null;
  /** The Amazon Resource Name (ARN) of the node. */
  Arn?: string | null;
  /** The Amazon Resource Name (ARN) of the customer managed key in AWS Key Management Service (AWS KMS) that the node uses for encryption at rest. */
  KmsKeyArn?: string | null;
}
function toNode(root: jsonP.JSONValue): Node {
  return jsonP.readObj({
    required: {},
    optional: {
      "NetworkId": "s",
      "MemberId": "s",
      "Id": "s",
      "InstanceType": "s",
      "AvailabilityZone": "s",
      "FrameworkAttributes": toNodeFrameworkAttributes,
      "LogPublishingConfiguration": toNodeLogPublishingConfiguration,
      "StateDB": (x: jsonP.JSONValue) => cmnP.readEnum<StateDBType>(x),
      "Status": (x: jsonP.JSONValue) => cmnP.readEnum<NodeStatus>(x),
      "CreationDate": "d",
      "Tags": x => jsonP.readMap(String, String, x),
      "Arn": "s",
      "KmsKeyArn": "s",
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Attributes relevant to a node on a Managed Blockchain network for the blockchain framework that the network uses. */
export interface NodeFrameworkAttributes {
  /** Attributes of Hyperledger Fabric for a peer node on a Managed Blockchain network that uses Hyperledger Fabric. */
  Fabric?: NodeFabricAttributes | null;
  /** Attributes of Ethereum for a node on a Managed Blockchain network that uses Ethereum. */
  Ethereum?: NodeEthereumAttributes | null;
}
function toNodeFrameworkAttributes(root: jsonP.JSONValue): NodeFrameworkAttributes {
  return jsonP.readObj({
    required: {},
    optional: {
      "Fabric": toNodeFabricAttributes,
      "Ethereum": toNodeEthereumAttributes,
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Attributes of Hyperledger Fabric for a peer node on a Hyperledger Fabric network on Managed Blockchain. */
export interface NodeFabricAttributes {
  /** The endpoint that identifies the peer node for all services except peer channel-based event services. */
  PeerEndpoint?: string | null;
  /** The endpoint that identifies the peer node for peer channel-based event services. */
  PeerEventEndpoint?: string | null;
}
function toNodeFabricAttributes(root: jsonP.JSONValue): NodeFabricAttributes {
  return jsonP.readObj({
    required: {},
    optional: {
      "PeerEndpoint": "s",
      "PeerEventEndpoint": "s",
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Attributes of an Ethereum node. */
export interface NodeEthereumAttributes {
  /** The endpoint on which the Ethereum node listens to run Ethereum JSON-RPC methods over HTTP connections from a client. */
  HttpEndpoint?: string | null;
  /** The endpoint on which the Ethereum node listens to run Ethereum JSON-RPC methods over WebSockets connections from a client. */
  WebSocketEndpoint?: string | null;
}
function toNodeEthereumAttributes(root: jsonP.JSONValue): NodeEthereumAttributes {
  return jsonP.readObj({
    required: {},
    optional: {
      "HttpEndpoint": "s",
      "WebSocketEndpoint": "s",
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Properties of a proposal on a Managed Blockchain network. */
export interface Proposal {
  /** The unique identifier of the proposal. */
  ProposalId?: string | null;
  /** The unique identifier of the network for which the proposal is made. */
  NetworkId?: string | null;
  /** The description of the proposal. */
  Description?: string | null;
  /** The actions to perform on the network if the proposal is `APPROVED`. */
  Actions?: ProposalActions | null;
  /** The unique identifier of the member that created the proposal. */
  ProposedByMemberId?: string | null;
  /** The name of the member that created the proposal. */
  ProposedByMemberName?: string | null;
  /** The status of the proposal. */
  Status?: ProposalStatus | null;
  /** The date and time that the proposal was created. */
  CreationDate?: Date | number | null;
  /** The date and time that the proposal expires. */
  ExpirationDate?: Date | number | null;
  /** The current total of `YES` votes cast on the proposal by members. */
  YesVoteCount?: number | null;
  /** The current total of `NO` votes cast on the proposal by members. */
  NoVoteCount?: number | null;
  /** The number of votes remaining to be cast on the proposal by members. */
  OutstandingVoteCount?: number | null;
  /** Tags assigned to the proposal. */
  Tags?: { [key: string]: string | null | undefined } | null;
  /** The Amazon Resource Name (ARN) of the proposal. */
  Arn?: string | null;
}
function toProposal(root: jsonP.JSONValue): Proposal {
  return jsonP.readObj({
    required: {},
    optional: {
      "ProposalId": "s",
      "NetworkId": "s",
      "Description": "s",
      "Actions": toProposalActions,
      "ProposedByMemberId": "s",
      "ProposedByMemberName": "s",
      "Status": (x: jsonP.JSONValue) => cmnP.readEnum<ProposalStatus>(x),
      "CreationDate": "d",
      "ExpirationDate": "d",
      "YesVoteCount": "n",
      "NoVoteCount": "n",
      "OutstandingVoteCount": "n",
      "Tags": x => jsonP.readMap(String, String, x),
      "Arn": "s",
    },
  }, root);
}

// refs: 2 - tags: output, named, enum
export type ProposalStatus =
| "IN_PROGRESS"
| "APPROVED"
| "REJECTED"
| "EXPIRED"
| "ACTION_FAILED"
| cmnP.UnexpectedEnumValue;

// refs: 1 - tags: output, named, interface
/** An invitation to an AWS account to create a member and join the network. */
export interface Invitation {
  /** The unique identifier for the invitation. */
  InvitationId?: string | null;
  /** The date and time that the invitation was created. */
  CreationDate?: Date | number | null;
  /** The date and time that the invitation expires. */
  ExpirationDate?: Date | number | null;
  /** The status of the invitation: */
  Status?: InvitationStatus | null;
  NetworkSummary?: NetworkSummary | null;
  /** The Amazon Resource Name (ARN) of the invitation. */
  Arn?: string | null;
}
function toInvitation(root: jsonP.JSONValue): Invitation {
  return jsonP.readObj({
    required: {},
    optional: {
      "InvitationId": "s",
      "CreationDate": "d",
      "ExpirationDate": "d",
      "Status": (x: jsonP.JSONValue) => cmnP.readEnum<InvitationStatus>(x),
      "NetworkSummary": toNetworkSummary,
      "Arn": "s",
    },
  }, root);
}

// refs: 1 - tags: output, named, enum
export type InvitationStatus =
| "PENDING"
| "ACCEPTED"
| "ACCEPTING"
| "REJECTED"
| "EXPIRED"
| cmnP.UnexpectedEnumValue;

// refs: 2 - tags: output, named, interface
/** A summary of network configuration properties. */
export interface NetworkSummary {
  /** The unique identifier of the network. */
  Id?: string | null;
  /** The name of the network. */
  Name?: string | null;
  /** An optional description of the network. */
  Description?: string | null;
  /** The blockchain framework that the network uses. */
  Framework?: Framework | null;
  /** The version of the blockchain framework that the network uses. */
  FrameworkVersion?: string | null;
  /** The current status of the network. */
  Status?: NetworkStatus | null;
  /** The date and time that the network was created. */
  CreationDate?: Date | number | null;
  /** The Amazon Resource Name (ARN) of the network. */
  Arn?: string | null;
}
function toNetworkSummary(root: jsonP.JSONValue): NetworkSummary {
  return jsonP.readObj({
    required: {},
    optional: {
      "Id": "s",
      "Name": "s",
      "Description": "s",
      "Framework": (x: jsonP.JSONValue) => cmnP.readEnum<Framework>(x),
      "FrameworkVersion": "s",
      "Status": (x: jsonP.JSONValue) => cmnP.readEnum<NetworkStatus>(x),
      "CreationDate": "d",
      "Arn": "s",
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** A summary of configuration properties for a member. */
export interface MemberSummary {
  /** The unique identifier of the member. */
  Id?: string | null;
  /** The name of the member. */
  Name?: string | null;
  /** An optional description of the member. */
  Description?: string | null;
  /** The status of the member. */
  Status?: MemberStatus | null;
  /** The date and time that the member was created. */
  CreationDate?: Date | number | null;
  /** An indicator of whether the member is owned by your AWS account or a different AWS account. */
  IsOwned?: boolean | null;
  /** The Amazon Resource Name (ARN) of the member. */
  Arn?: string | null;
}
function toMemberSummary(root: jsonP.JSONValue): MemberSummary {
  return jsonP.readObj({
    required: {},
    optional: {
      "Id": "s",
      "Name": "s",
      "Description": "s",
      "Status": (x: jsonP.JSONValue) => cmnP.readEnum<MemberStatus>(x),
      "CreationDate": "d",
      "IsOwned": "b",
      "Arn": "s",
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** A summary of configuration properties for a node. */
export interface NodeSummary {
  /** The unique identifier of the node. */
  Id?: string | null;
  /** The status of the node. */
  Status?: NodeStatus | null;
  /** The date and time that the node was created. */
  CreationDate?: Date | number | null;
  /** The Availability Zone in which the node exists. */
  AvailabilityZone?: string | null;
  /** The EC2 instance type for the node. */
  InstanceType?: string | null;
  /** The Amazon Resource Name (ARN) of the node. */
  Arn?: string | null;
}
function toNodeSummary(root: jsonP.JSONValue): NodeSummary {
  return jsonP.readObj({
    required: {},
    optional: {
      "Id": "s",
      "Status": (x: jsonP.JSONValue) => cmnP.readEnum<NodeStatus>(x),
      "CreationDate": "d",
      "AvailabilityZone": "s",
      "InstanceType": "s",
      "Arn": "s",
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Properties of an individual vote that a member cast for a proposal. */
export interface VoteSummary {
  /** The vote value, either `YES` or `NO`. */
  Vote?: VoteValue | null;
  /** The name of the member that cast the vote. */
  MemberName?: string | null;
  /** The unique identifier of the member that cast the vote. */
  MemberId?: string | null;
}
function toVoteSummary(root: jsonP.JSONValue): VoteSummary {
  return jsonP.readObj({
    required: {},
    optional: {
      "Vote": (x: jsonP.JSONValue) => cmnP.readEnum<VoteValue>(x),
      "MemberName": "s",
      "MemberId": "s",
    },
  }, root);
}

// refs: 1 - tags: output, named, interface
/** Properties of a proposal. */
export interface ProposalSummary {
  /** The unique identifier of the proposal. */
  ProposalId?: string | null;
  /** The description of the proposal. */
  Description?: string | null;
  /** The unique identifier of the member that created the proposal. */
  ProposedByMemberId?: string | null;
  /** The name of the member that created the proposal. */
  ProposedByMemberName?: string | null;
  /** The status of the proposal. */
  Status?: ProposalStatus | null;
  /** The date and time that the proposal was created. */
  CreationDate?: Date | number | null;
  /** The date and time that the proposal expires. */
  ExpirationDate?: Date | number | null;
  /** The Amazon Resource Name (ARN) of the proposal. */
  Arn?: string | null;
}
function toProposalSummary(root: jsonP.JSONValue): ProposalSummary {
  return jsonP.readObj({
    required: {},
    optional: {
      "ProposalId": "s",
      "Description": "s",
      "ProposedByMemberId": "s",
      "ProposedByMemberName": "s",
      "Status": (x: jsonP.JSONValue) => cmnP.readEnum<ProposalStatus>(x),
      "CreationDate": "d",
      "ExpirationDate": "d",
      "Arn": "s",
    },
  }, root);
}