/**
 * Cloudflare NETWORK-INTERCONNECTS API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service network-interconnects
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
export const GetCniRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    cni: Schema.String.pipe(T.HttpPath("cni")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/cni/cnis/{cni}" }));
export const GetCniResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    account: Schema.String,
    custIp: Schema.String,
    interconnect: Schema.String,
    magic: Schema.Struct({
        conduitName: Schema.String,
        description: Schema.String,
        mtu: Schema.Number,
    }).pipe(Schema.encodeKeys({
        conduitName: "conduit_name",
        description: "description",
        mtu: "mtu",
    })),
    p2pIp: Schema.String,
    bgp: Schema.optional(Schema.Union([
        Schema.Struct({
            customerAsn: Schema.Number,
            extraPrefixes: Schema.Array(Schema.String),
            md5Key: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            customerAsn: "customer_asn",
            extraPrefixes: "extra_prefixes",
            md5Key: "md5_key",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({
    id: "id",
    account: "account",
    custIp: "cust_ip",
    interconnect: "interconnect",
    magic: "magic",
    p2pIp: "p2p_ip",
    bgp: "bgp",
}));
export const getCni = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetCniRequest,
    output: GetCniResponse,
    errors: [],
}));
export const ListCnisRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cursor: Schema.optional(Schema.Union([Schema.Number, Schema.Null])).pipe(T.HttpQuery("cursor")),
    limit: Schema.optional(Schema.Union([Schema.Number, Schema.Null])).pipe(T.HttpQuery("limit")),
    slot: Schema.optional(Schema.Union([Schema.String, Schema.Null])).pipe(T.HttpQuery("slot")),
    tunnelId: Schema.optional(Schema.Union([Schema.String, Schema.Null])).pipe(T.HttpQuery("tunnel_id")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/cni/cnis" }));
export const ListCnisResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    items: Schema.Array(Schema.Struct({
        id: Schema.String,
        account: Schema.String,
        custIp: Schema.String,
        interconnect: Schema.String,
        magic: Schema.Struct({
            conduitName: Schema.String,
            description: Schema.String,
            mtu: Schema.Number,
        }).pipe(Schema.encodeKeys({
            conduitName: "conduit_name",
            description: "description",
            mtu: "mtu",
        })),
        p2pIp: Schema.String,
        bgp: Schema.optional(Schema.Union([
            Schema.Struct({
                customerAsn: Schema.Number,
                extraPrefixes: Schema.Array(Schema.String),
                md5Key: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }).pipe(Schema.encodeKeys({
                customerAsn: "customer_asn",
                extraPrefixes: "extra_prefixes",
                md5Key: "md5_key",
            })),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        account: "account",
        custIp: "cust_ip",
        interconnect: "interconnect",
        magic: "magic",
        p2pIp: "p2p_ip",
        bgp: "bgp",
    }))),
    next: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
});
export const listCnis = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListCnisRequest,
    output: ListCnisResponse,
    errors: [],
}));
export const CreateCniRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    account: Schema.String,
    interconnect: Schema.String,
    magic: Schema.Struct({
        conduitName: Schema.String,
        description: Schema.String,
        mtu: Schema.Number,
    }).pipe(Schema.encodeKeys({
        conduitName: "conduit_name",
        description: "description",
        mtu: "mtu",
    })),
    bgp: Schema.optional(Schema.Struct({
        customerAsn: Schema.Number,
        extraPrefixes: Schema.Array(Schema.String),
        md5Key: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        customerAsn: "customer_asn",
        extraPrefixes: "extra_prefixes",
        md5Key: "md5_key",
    }))),
}).pipe(T.Http({ method: "POST", path: "/accounts/{account_id}/cni/cnis" }));
export const CreateCniResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    account: Schema.String,
    custIp: Schema.String,
    interconnect: Schema.String,
    magic: Schema.Struct({
        conduitName: Schema.String,
        description: Schema.String,
        mtu: Schema.Number,
    }).pipe(Schema.encodeKeys({
        conduitName: "conduit_name",
        description: "description",
        mtu: "mtu",
    })),
    p2pIp: Schema.String,
    bgp: Schema.optional(Schema.Union([
        Schema.Struct({
            customerAsn: Schema.Number,
            extraPrefixes: Schema.Array(Schema.String),
            md5Key: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            customerAsn: "customer_asn",
            extraPrefixes: "extra_prefixes",
            md5Key: "md5_key",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({
    id: "id",
    account: "account",
    custIp: "cust_ip",
    interconnect: "interconnect",
    magic: "magic",
    p2pIp: "p2p_ip",
    bgp: "bgp",
}));
export const createCni = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateCniRequest,
    output: CreateCniResponse,
    errors: [],
}));
export const UpdateCniRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    cni: Schema.String.pipe(T.HttpPath("cni")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    id: Schema.String,
    account: Schema.String,
    custIp: Schema.String,
    interconnect: Schema.String,
    magic: Schema.Struct({
        conduitName: Schema.String,
        description: Schema.String,
        mtu: Schema.Number,
    }).pipe(Schema.encodeKeys({
        conduitName: "conduit_name",
        description: "description",
        mtu: "mtu",
    })),
    p2pIp: Schema.String,
    bgp: Schema.optional(Schema.Struct({
        customerAsn: Schema.Number,
        extraPrefixes: Schema.Array(Schema.String),
        md5Key: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        customerAsn: "customer_asn",
        extraPrefixes: "extra_prefixes",
        md5Key: "md5_key",
    }))),
}).pipe(Schema.encodeKeys({
    id: "id",
    account: "account",
    custIp: "cust_ip",
    interconnect: "interconnect",
    magic: "magic",
    p2pIp: "p2p_ip",
    bgp: "bgp",
}), T.Http({ method: "PUT", path: "/accounts/{account_id}/cni/cnis/{cni}" }));
export const UpdateCniResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    account: Schema.String,
    custIp: Schema.String,
    interconnect: Schema.String,
    magic: Schema.Struct({
        conduitName: Schema.String,
        description: Schema.String,
        mtu: Schema.Number,
    }).pipe(Schema.encodeKeys({
        conduitName: "conduit_name",
        description: "description",
        mtu: "mtu",
    })),
    p2pIp: Schema.String,
    bgp: Schema.optional(Schema.Union([
        Schema.Struct({
            customerAsn: Schema.Number,
            extraPrefixes: Schema.Array(Schema.String),
            md5Key: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            customerAsn: "customer_asn",
            extraPrefixes: "extra_prefixes",
            md5Key: "md5_key",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({
    id: "id",
    account: "account",
    custIp: "cust_ip",
    interconnect: "interconnect",
    magic: "magic",
    p2pIp: "p2p_ip",
    bgp: "bgp",
}));
export const updateCni = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateCniRequest,
    output: UpdateCniResponse,
    errors: [],
}));
export const DeleteCniRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    cni: Schema.String.pipe(T.HttpPath("cni")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({ method: "DELETE", path: "/accounts/{account_id}/cni/cnis/{cni}" }));
export const DeleteCniResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const deleteCni = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteCniRequest,
    output: DeleteCniResponse,
    errors: [],
}));
export const GetInterconnectRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    icon: Schema.String.pipe(T.HttpPath("icon")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/cni/interconnects/{icon}",
}));
export const GetInterconnectResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
    Schema.Struct({
        account: Schema.String,
        facility: Schema.Struct({
            address: Schema.Array(Schema.String),
            name: Schema.String,
        }),
        name: Schema.String,
        site: Schema.String,
        slotId: Schema.String,
        speed: Schema.String,
        type: Schema.String,
        owner: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        account: "account",
        facility: "facility",
        name: "name",
        site: "site",
        slotId: "slot_id",
        speed: "speed",
        type: "type",
        owner: "owner",
    })),
    Schema.Struct({
        account: Schema.String,
        name: Schema.String,
        region: Schema.String,
        type: Schema.String,
        owner: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        speed: Schema.optional(Schema.Union([
            Schema.Literals([
                "50M",
                "100M",
                "200M",
                "300M",
                "400M",
                "500M",
                "1G",
                "2G",
                "5G",
                "10G",
                "20G",
                "50G",
            ]),
            Schema.Null,
        ])),
    }),
]);
export const getInterconnect = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInterconnectRequest,
    output: GetInterconnectResponse,
    errors: [],
}));
export const ListInterconnectsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    cursor: Schema.optional(Schema.Union([Schema.Number, Schema.Null])).pipe(T.HttpQuery("cursor")),
    limit: Schema.optional(Schema.Union([Schema.Number, Schema.Null])).pipe(T.HttpQuery("limit")),
    site: Schema.optional(Schema.Union([Schema.String, Schema.Null])).pipe(T.HttpQuery("site")),
    type: Schema.optional(Schema.Union([Schema.String, Schema.Null])).pipe(T.HttpQuery("type")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/cni/interconnects" }));
export const ListInterconnectsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    items: Schema.Array(Schema.Union([
        Schema.Struct({
            account: Schema.String,
            facility: Schema.Struct({
                address: Schema.Array(Schema.String),
                name: Schema.String,
            }),
            name: Schema.String,
            site: Schema.String,
            slotId: Schema.String,
            speed: Schema.String,
            type: Schema.String,
            owner: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            account: "account",
            facility: "facility",
            name: "name",
            site: "site",
            slotId: "slot_id",
            speed: "speed",
            type: "type",
            owner: "owner",
        })),
        Schema.Struct({
            account: Schema.String,
            name: Schema.String,
            region: Schema.String,
            type: Schema.String,
            owner: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            speed: Schema.optional(Schema.Union([
                Schema.Literals([
                    "50M",
                    "100M",
                    "200M",
                    "300M",
                    "400M",
                    "500M",
                    "1G",
                    "2G",
                    "5G",
                    "10G",
                    "20G",
                    "50G",
                ]),
                Schema.Null,
            ])),
        }),
    ])),
    next: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
});
export const listInterconnects = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListInterconnectsRequest,
    output: ListInterconnectsResponse,
    errors: [],
}));
export const CreateInterconnectRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    account: Schema.String,
    slotId: Schema.String,
    type: Schema.String,
    speed: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(Schema.encodeKeys({
    account: "account",
    slotId: "slot_id",
    type: "type",
    speed: "speed",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/cni/interconnects",
}));
export const CreateInterconnectResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Union([
    Schema.Struct({
        account: Schema.String,
        facility: Schema.Struct({
            address: Schema.Array(Schema.String),
            name: Schema.String,
        }),
        name: Schema.String,
        site: Schema.String,
        slotId: Schema.String,
        speed: Schema.String,
        type: Schema.String,
        owner: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        account: "account",
        facility: "facility",
        name: "name",
        site: "site",
        slotId: "slot_id",
        speed: "speed",
        type: "type",
        owner: "owner",
    })),
    Schema.Struct({
        account: Schema.String,
        name: Schema.String,
        region: Schema.String,
        type: Schema.String,
        owner: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        speed: Schema.optional(Schema.Union([
            Schema.Literals([
                "50M",
                "100M",
                "200M",
                "300M",
                "400M",
                "500M",
                "1G",
                "2G",
                "5G",
                "10G",
                "20G",
                "50G",
            ]),
            Schema.Null,
        ])),
    }),
]);
export const createInterconnect = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateInterconnectRequest,
    output: CreateInterconnectResponse,
    errors: [],
}));
export const DeleteInterconnectRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    icon: Schema.String.pipe(T.HttpPath("icon")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/cni/interconnects/{icon}",
}));
export const DeleteInterconnectResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const deleteInterconnect = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteInterconnectRequest,
    output: DeleteInterconnectResponse,
    errors: [],
}));
export const StatusInterconnectRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    icon: Schema.String.pipe(T.HttpPath("icon")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/cni/interconnects/{icon}/status",
}));
export const StatusInterconnectResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Union([
    Schema.Struct({
        state: Schema.Literal("Pending"),
    }),
    Schema.Struct({
        state: Schema.Literal("Down"),
        reason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }),
    Schema.Struct({
        state: Schema.Literal("Unhealthy"),
        reason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }),
    Schema.Struct({
        state: Schema.Literal("Healthy"),
    }),
]);
export const statusInterconnect = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StatusInterconnectRequest,
    output: StatusInterconnectResponse,
    errors: [],
}));
export const LoaInterconnectRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    icon: Schema.String.pipe(T.HttpPath("icon")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/cni/interconnects/{icon}/loa",
}));
export const LoaInterconnectResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const loaInterconnect = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: LoaInterconnectRequest,
    output: LoaInterconnectResponse,
    errors: [],
}));
export const GetSettingRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/cni/settings" }));
export const GetSettingResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    defaultAsn: Schema.Number,
}).pipe(Schema.encodeKeys({ defaultAsn: "default_asn" }));
export const getSetting = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSettingRequest,
    output: GetSettingResponse,
    errors: [],
}));
export const PutSettingRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    defaultAsn: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
}).pipe(Schema.encodeKeys({ defaultAsn: "default_asn" }), T.Http({ method: "PUT", path: "/accounts/{account_id}/cni/settings" }));
export const PutSettingResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    defaultAsn: Schema.Number,
}).pipe(Schema.encodeKeys({ defaultAsn: "default_asn" }));
export const putSetting = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutSettingRequest,
    output: PutSettingResponse,
    errors: [],
}));
export const GetSlotRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    slot: Schema.String.pipe(T.HttpPath("slot")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/cni/slots/{slot}" }));
export const GetSlotResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    facility: Schema.Struct({
        address: Schema.Array(Schema.String),
        name: Schema.String,
    }),
    occupied: Schema.Boolean,
    site: Schema.String,
    speed: Schema.String,
    account: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
});
export const getSlot = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSlotRequest,
    output: GetSlotResponse,
    errors: [],
}));
export const ListSlotsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    addressContains: Schema.optional(Schema.Union([Schema.String, Schema.Null])).pipe(T.HttpQuery("address_contains")),
    cursor: Schema.optional(Schema.Union([Schema.Number, Schema.Null])).pipe(T.HttpQuery("cursor")),
    limit: Schema.optional(Schema.Union([Schema.Number, Schema.Null])).pipe(T.HttpQuery("limit")),
    occupied: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])).pipe(T.HttpQuery("occupied")),
    site: Schema.optional(Schema.Union([Schema.String, Schema.Null])).pipe(T.HttpQuery("site")),
    speed: Schema.optional(Schema.Union([Schema.String, Schema.Null])).pipe(T.HttpQuery("speed")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/cni/slots" }));
export const ListSlotsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    items: Schema.Array(Schema.Struct({
        id: Schema.String,
        facility: Schema.Struct({
            address: Schema.Array(Schema.String),
            name: Schema.String,
        }),
        occupied: Schema.Boolean,
        site: Schema.String,
        speed: Schema.String,
        account: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
    next: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
});
export const listSlots = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListSlotsRequest,
    output: ListSlotsResponse,
    errors: [],
}));
//# sourceMappingURL=network-interconnects.js.map