@@ -11,6 +11,11 @@ import struct Foundation.Date
1111#endif
1212/// A type that performs HTTP operations defined by the OpenAPI document.
1313public protocol APIProtocol: Sendable {
14+ /// Status
15+ ///
16+ /// - Remark: HTTP `GET /v2/status`.
17+ /// - Remark: Generated from `#/paths//v2/status/get(status)`.
18+ func status(_ input: Operations.status.Input) async throws -> Operations.status.Output
1419 /// Get blockchain block data
1520 ///
1621 /// - Remark: HTTP `GET /v2/blockchain/blocks/{block_id}`.
@@ -515,6 +520,13 @@ public protocol APIProtocol: Sendable {
515520}
516521/// Convenience overloads for operation inputs.
517522extension APIProtocol {
523+ /// Status
524+ ///
525+ /// - Remark: HTTP `GET /v2/status`.
526+ /// - Remark: Generated from `#/paths//v2/status/get(status)`.
527+ public func status(headers: Operations.status.Input.Headers = .init()) async throws -> Operations.status.Output {
528+ try await status(Operations.status.Input(headers: headers))
529+ }
518530 /// Get blockchain block data
519531 ///
520532 /// - Remark: HTTP `GET /v2/blockchain/blocks/{block_id}`.
@@ -1622,6 +1634,85 @@ public enum Components {
16221634 case minted
16231635 }
16241636 }
1637+ /// - Remark: Generated from `#/components/schemas/ServiceStatus`.
1638+ public struct ServiceStatus: Codable, Hashable, Sendable {
1639+ /// - Remark: Generated from `#/components/schemas/ServiceStatus/rest_online`.
1640+ public var rest_online: Swift.Bool
1641+ /// - Remark: Generated from `#/components/schemas/ServiceStatus/indexing_latency`.
1642+ public var indexing_latency: Swift.Int
1643+ /// Creates a new `ServiceStatus`.
1644+ ///
1645+ /// - Parameters:
1646+ /// - rest_online:
1647+ /// - indexing_latency:
1648+ public init(rest_online: Swift.Bool, indexing_latency: Swift.Int) {
1649+ self.rest_online = rest_online
1650+ self.indexing_latency = indexing_latency
1651+ }
1652+ public enum CodingKeys: String, CodingKey {
1653+ case rest_online
1654+ case indexing_latency
1655+ }
1656+ }
1657+ /// - Remark: Generated from `#/components/schemas/ReducedBlock`.
1658+ public struct ReducedBlock: Codable, Hashable, Sendable {
1659+ /// - Remark: Generated from `#/components/schemas/ReducedBlock/workchain_id`.
1660+ public var workchain_id: Swift.Int32
1661+ /// - Remark: Generated from `#/components/schemas/ReducedBlock/shard`.
1662+ public var shard: Swift.String
1663+ /// - Remark: Generated from `#/components/schemas/ReducedBlock/seqno`.
1664+ public var seqno: Swift.Int32
1665+ /// - Remark: Generated from `#/components/schemas/ReducedBlock/master_ref`.
1666+ public var master_ref: Swift.String?
1667+ /// - Remark: Generated from `#/components/schemas/ReducedBlock/tx_quantity`.
1668+ public var tx_quantity: Swift.Int
1669+ /// - Remark: Generated from `#/components/schemas/ReducedBlock/utime`.
1670+ public var utime: Swift.Int64
1671+ /// - Remark: Generated from `#/components/schemas/ReducedBlock/shards_blocks`.
1672+ public var shards_blocks: [Swift.String]
1673+ /// - Remark: Generated from `#/components/schemas/ReducedBlock/parent`.
1674+ public var parent: [Swift.String]
1675+ /// Creates a new `ReducedBlock`.
1676+ ///
1677+ /// - Parameters:
1678+ /// - workchain_id:
1679+ /// - shard:
1680+ /// - seqno:
1681+ /// - master_ref:
1682+ /// - tx_quantity:
1683+ /// - utime:
1684+ /// - shards_blocks:
1685+ /// - parent:
1686+ public init(
1687+ workchain_id: Swift.Int32,
1688+ shard: Swift.String,
1689+ seqno: Swift.Int32,
1690+ master_ref: Swift.String? = nil,
1691+ tx_quantity: Swift.Int,
1692+ utime: Swift.Int64,
1693+ shards_blocks: [Swift.String],
1694+ parent: [Swift.String]
1695+ ) {
1696+ self.workchain_id = workchain_id
1697+ self.shard = shard
1698+ self.seqno = seqno
1699+ self.master_ref = master_ref
1700+ self.tx_quantity = tx_quantity
1701+ self.utime = utime
1702+ self.shards_blocks = shards_blocks
1703+ self.parent = parent
1704+ }
1705+ public enum CodingKeys: String, CodingKey {
1706+ case workchain_id
1707+ case shard
1708+ case seqno
1709+ case master_ref
1710+ case tx_quantity
1711+ case utime
1712+ case shards_blocks
1713+ case parent
1714+ }
1715+ }
16251716 /// - Remark: Generated from `#/components/schemas/BlockchainBlock`.
16261717 public struct BlockchainBlock: Codable, Hashable, Sendable {
16271718 /// - Remark: Generated from `#/components/schemas/BlockchainBlock/tx_quantity`.
@@ -8163,6 +8254,113 @@ public enum Components {
81638254}
81648255/// API operations, with input and output types, generated from `#/paths` in the OpenAPI document.
81658256public enum Operations {
8257+ /// Status
8258+ ///
8259+ /// - Remark: HTTP `GET /v2/status`.
8260+ /// - Remark: Generated from `#/paths//v2/status/get(status)`.
8261+ public enum status {
8262+ public static let id: Swift.String = "status"
8263+ public struct Input: Sendable, Hashable {
8264+ /// - Remark: Generated from `#/paths/v2/status/GET/header`.
8265+ public struct Headers: Sendable, Hashable {
8266+ public var accept: [OpenAPIRuntime.AcceptHeaderContentType<Operations.status.AcceptableContentType>]
8267+ /// Creates a new `Headers`.
8268+ ///
8269+ /// - Parameters:
8270+ /// - accept:
8271+ public init(
8272+ accept: [OpenAPIRuntime.AcceptHeaderContentType<Operations.status.AcceptableContentType>] =
8273+ .defaultValues()
8274+ ) { self.accept = accept }
8275+ }
8276+ public var headers: Operations.status.Input.Headers
8277+ /// Creates a new `Input`.
8278+ ///
8279+ /// - Parameters:
8280+ /// - headers:
8281+ public init(headers: Operations.status.Input.Headers = .init()) { self.headers = headers }
8282+ }
8283+ @frozen public enum Output: Sendable, Hashable {
8284+ public struct Ok: Sendable, Hashable {
8285+ /// - Remark: Generated from `#/paths/v2/status/GET/responses/200/content`.
8286+ @frozen public enum Body: Sendable, Hashable {
8287+ /// - Remark: Generated from `#/paths/v2/status/GET/responses/200/content/application\/json`.
8288+ case json(Components.Schemas.ServiceStatus)
8289+ /// The associated value of the enum case if `self` is `.json`.
8290+ ///
8291+ /// - Throws: An error if `self` is not `.json`.
8292+ /// - SeeAlso: `.json`.
8293+ public var json: Components.Schemas.ServiceStatus {
8294+ get throws {
8295+ switch self {
8296+ case let .json(body): return body
8297+ }
8298+ }
8299+ }
8300+ }
8301+ /// Received HTTP response body
8302+ public var body: Operations.status.Output.Ok.Body
8303+ /// Creates a new `Ok`.
8304+ ///
8305+ /// - Parameters:
8306+ /// - body: Received HTTP response body
8307+ public init(body: Operations.status.Output.Ok.Body) { self.body = body }
8308+ }
8309+ /// status
8310+ ///
8311+ /// - Remark: Generated from `#/paths//v2/status/get(status)/responses/200`.
8312+ ///
8313+ /// HTTP response code: `200 ok`.
8314+ case ok(Operations.status.Output.Ok)
8315+ /// The associated value of the enum case if `self` is `.ok`.
8316+ ///
8317+ /// - Throws: An error if `self` is not `.ok`.
8318+ /// - SeeAlso: `.ok`.
8319+ public var ok: Operations.status.Output.Ok {
8320+ get throws {
8321+ switch self {
8322+ case let .ok(response): return response
8323+ default: try throwUnexpectedResponseStatus(expectedStatus: "ok", response: self)
8324+ }
8325+ }
8326+ }
8327+ /// Some error during request processing
8328+ ///
8329+ /// - Remark: Generated from `#/paths//v2/status/get(status)/responses/default`.
8330+ ///
8331+ /// HTTP response code: `default`.
8332+ case `default`(statusCode: Swift.Int, Components.Responses._Error)
8333+ /// The associated value of the enum case if `self` is `.`default``.
8334+ ///
8335+ /// - Throws: An error if `self` is not `.`default``.
8336+ /// - SeeAlso: `.`default``.
8337+ public var `default`: Components.Responses._Error {
8338+ get throws {
8339+ switch self {
8340+ case let .`default`(_, response): return response
8341+ default: try throwUnexpectedResponseStatus(expectedStatus: "default", response: self)
8342+ }
8343+ }
8344+ }
8345+ }
8346+ @frozen public enum AcceptableContentType: AcceptableProtocol {
8347+ case json
8348+ case other(Swift.String)
8349+ public init?(rawValue: Swift.String) {
8350+ switch rawValue.lowercased() {
8351+ case "application/json": self = .json
8352+ default: self = .other(rawValue)
8353+ }
8354+ }
8355+ public var rawValue: Swift.String {
8356+ switch self {
8357+ case let .other(string): return string
8358+ case .json: return "application/json"
8359+ }
8360+ }
8361+ public static var allCases: [Self] { [.json] }
8362+ }
8363+ }
81668364 /// Get blockchain block data
81678365 ///
81688366 /// - Remark: HTTP `GET /v2/blockchain/blocks/{block_id}`.
0 commit comments