diff --git a/api/openapi.yaml b/api/openapi.yaml index 14a327a..3041c41 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -15,8 +15,14 @@ tags: description: Service health. - name: Networks description: Supported networks. + - name: Wallet Types + description: Wallet implementation version catalog. - name: Wallets description: Wallet lifecycle. + - name: Wallet Upgrades + description: Wallet implementation upgrades. + - name: Wallet Admin Operations + description: Signature-authorized wallet administrative operations. - name: Channels description: Channels for watchers, events, and operations. - name: Watchers @@ -70,6 +76,127 @@ paths: schema: $ref: "#/components/schemas/ApplicationError" example: {type: "INTERNAL_ERROR", message: "An internal error occurred."} + /wallet-types/{wallet_type}/versions: + get: + tags: + - Wallet Types + operationId: listWalletTypeVersions + x-permissions: [crec:wallet:read] + summary: Retrieves published implementation versions for a wallet type. + description: | + Returns the published implementation versions for the wallet type with + changelog, support state, the default marker, upgradeability, capability + descriptors and per-network deployments. The list carries no sequence and + callers must not infer one. `status=active` returns every version supported + as an upgrade target, the default one included. Filtering deployments to + the wallet's chain selector gives the client the implementation addresses + it needs to sign. + parameters: + - in: path + name: wallet_type + required: true + description: Wallet type the versions belong to. + schema: + $ref: "#/components/schemas/WalletType" + - in: query + name: chain_selector + description: Filter deployments to a chain selector. Versions with no deployment on that chain are still returned. + schema: + $ref: "#/components/schemas/ChainSelector" + - in: query + name: status + description: Filter versions by support state. + schema: + $ref: "#/components/schemas/WalletTypeVersionStatus" + responses: + "401": + $ref: "#/components/responses/OrganizationNotFound" + "403": + $ref: "#/components/responses/PermissionDenied" + "200": + description: Successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/WalletTypeVersionList" + example: {data: [], has_more: false} + "404": + description: Wallet type not found + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "NOT_FOUND", message: "The requested wallet type was not found."} + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "INTERNAL_ERROR", message: "An internal error occurred."} + /wallet-types/{wallet_type}/versions/{implementation_version}: + get: + tags: + - Wallet Types + operationId: getWalletTypeVersion + x-permissions: [crec:wallet:read] + summary: Retrieves one published implementation version for a wallet type. + description: | + Returns one published version with its deployments. The SDK's fact fetch + before building and signing an upgrade or administrative authorization. + parameters: + - in: path + name: wallet_type + required: true + description: Wallet type the version belongs to. + schema: + $ref: "#/components/schemas/WalletType" + - in: path + name: implementation_version + required: true + description: Implementation version label. Opaque, never ordered or parsed. + schema: + type: string + responses: + "401": + $ref: "#/components/responses/OrganizationNotFound" + "403": + $ref: "#/components/responses/PermissionDenied" + "200": + description: Version found + content: + application/json: + schema: + $ref: "#/components/schemas/WalletTypeVersion" + example: + wallet_type: "ecdsa" + implementation_version: "2025.06.0" + status: "active" + is_default: true + is_upgradeable: true + changelog: "Adds signature-authorized upgrade and administrative capabilities." + capabilities: + - name: "revokeAuthorization" + abi_fragment: {type: "function", name: "revokeAuthorization", inputs: [{name: "opId", type: "uint256"}, {name: "deadline", type: "uint256"}], outputs: [], stateMutability: "nonpayable"} + eip712_type: "RevokeAuthorization(uint256 opId,uint256 deadline)" + deployments: + - chain_selector: "16015286601757825753" + implementation_address: "0x742d35cc6634c0532925a3b844bc454e4438f44e" + created_at: 1715698800 + "404": + description: Version not found for this wallet type + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "NOT_FOUND", code: "WALLET_TYPE_VERSION_NOT_FOUND", message: "no version 2025.09.0 published for wallet type ecdsa"} + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "INTERNAL_ERROR", message: "An internal error occurred."} /wallets: post: tags: @@ -162,6 +289,11 @@ paths: $ref: "#/components/schemas/WalletStatus" style: form explode: true + - in: query + name: implementation_version + description: Filter wallets by recorded implementation version + schema: + type: string - in: query name: chain_environment description: Filter wallets by chain environment (mainnet or testnet). If omitted, returns all chain environments. @@ -202,13 +334,478 @@ paths: schema: $ref: "#/components/schemas/ApplicationError" example: {type: "INTERNAL_ERROR", message: "An internal error occurred."} - /wallets/{wallet_id}: + /wallets/{wallet_id}: + get: + tags: + - Wallets + operationId: getWallet + x-permissions: [crec:wallet:read] + summary: Retrieves a specific wallet by ID. + parameters: + - in: path + name: wallet_id + required: true + description: Unique wallet identifier. + schema: + type: string + format: uuid + responses: + "401": + $ref: "#/components/responses/OrganizationNotFound" + "403": + $ref: "#/components/responses/PermissionDenied" + "200": + description: Wallet found + content: + application/json: + schema: + $ref: "#/components/schemas/Wallet" + example: {wallet_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", name: "my-wallet", address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", chain_selector: "16015286601757825753", wallet_type: "ecdsa", wallet_owner_address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", status: "deployed", allowed_rsa_signers: [], allowed_ecdsa_signers: [], configuration: {allowed_signers: []}} + "404": + description: Wallet not found + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "NOT_FOUND", message: "The requested resource was not found."} + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "INTERNAL_ERROR", message: "An internal error occurred."} + patch: + tags: + - Wallets + operationId: updateWallet + x-permissions: [crec:wallet:write, crec:wallet:archive:write] + summary: Updates a wallet name. + parameters: + - in: path + name: wallet_id + required: true + description: Unique wallet identifier. + schema: + type: string + format: uuid + requestBody: + description: Wallet update parameters. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateWallet" + example: {name: "updated-wallet"} + responses: + "401": + $ref: "#/components/responses/OrganizationNotFound" + "403": + $ref: "#/components/responses/PermissionDenied" + "200": + description: Wallet updated successfully + content: + application/json: + schema: + $ref: "#/components/schemas/Wallet" + example: {wallet_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", name: "updated-wallet", address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", chain_selector: "16015286601757825753", wallet_type: "ecdsa", wallet_owner_address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", status: "deployed", allowed_rsa_signers: [], allowed_ecdsa_signers: [], configuration: {allowed_signers: []}} + "400": + description: Invalid request data + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "VALIDATION_ERROR", message: "Invalid request data."} + "404": + description: Wallet not found + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "NOT_FOUND", message: "The requested resource was not found."} + "409": + description: Wallet is already archived, or was modified concurrently by another request. + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "CONFLICT", code: "WALLET_ALREADY_ARCHIVED", message: "conflict error: wallet already in archived state"} + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "INTERNAL_ERROR", message: "An internal error occurred."} + + /wallets/{wallet_id}/upgrades: + post: + tags: + - Wallet Upgrades + operationId: createWalletUpgrade + x-permissions: [crec:wallet:management:write] + summary: Submits a client-signed wallet upgrade. + description: | + Submits an upgrade naming a target version and the implementation address + the owner's authorization commits to. The enclosing operation is an + ordinary signed operation: it must carry exactly one transaction, + self-targeted at the wallet, with a non-zero deadline, and its + chain_selector and address must name the wallet the path names. On + acceptance the wallet moves to `upgrading` until the upgrade is confirmed + onchain or expires. + parameters: + - in: path + name: wallet_id + required: true + description: Unique wallet identifier. + schema: + type: string + format: uuid + requestBody: + description: Wallet upgrade submission. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateWalletUpgrade" + example: + target_version: "2025.06.0" + implementation_address: "0x742d35cc6634c0532925a3b844bc454e4438f44e" + authorization: + wallet_operation_id: "43" + deadline: 1735689600 + signature: "0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + operation: + chain_selector: "16015286601757825753" + address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" + wallet_operation_id: "42" + deadline: 1735689600 + transactions: [{to: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", value: "0", data: "0x"}] + responses: + "401": + $ref: "#/components/responses/OrganizationNotFound" + "403": + $ref: "#/components/responses/PermissionDenied" + "202": + description: Upgrade submission accepted + content: + application/json: + schema: + $ref: "#/components/schemas/WalletUpgrade" + example: + upgrade_id: "b3d1c2a4-5e6f-4a7b-8c9d-0e1f2a3b4c5d" + wallet_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" + from_version: "2025.03.0" + to_version: "2025.06.0" + implementation_address: "0x742d35cc6634c0532925a3b844bc454e4438f44e" + source: "crec_upgrade" + outcome: "pending" + operation_id: "c1e5b8d0-1234-5678-abcd-ef0123456789" + operation_status: "broadcasting" + requested_by: {subject_type: "api_key", subject_id: "key-123", subject_name: "my-key"} + authorized_key: "0x742d35cc6634c0532925a3b844bc454e4438f44e" + created_at: 1715698800 + updated_at: 1715698800 + "400": + description: Invalid request data + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + examples: + typeMismatch: + value: {type: "VALIDATION_ERROR", code: "WALLET_UPGRADE_TYPE_MISMATCH", message: "validation error: target version belongs to a different wallet type or family"} + payloadMismatch: + value: {type: "VALIDATION_ERROR", code: "WALLET_UPGRADE_PAYLOAD_MISMATCH", message: "validation error: implementation address disagrees with the catalog address for the target version"} + operationMismatch: + value: {type: "VALIDATION_ERROR", message: "validation error: operation chain_selector and address must name the wallet and carry exactly one self-targeted transaction with a non-zero deadline"} + "404": + description: Wallet or target version not found + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + examples: + walletNotFound: + value: {type: "NOT_FOUND", code: "WALLET_NOT_FOUND", message: "wallet with ID 3fa85f64-5717-4562-b3fc-2c963f66afa6 not found"} + versionNotFound: + value: {type: "NOT_FOUND", code: "WALLET_TYPE_VERSION_NOT_FOUND", message: "no version 2025.09.0 published for wallet type ecdsa"} + "409": + description: Upgrade not accepted in the wallet's current state + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + examples: + versionNotDeployed: + value: {type: "CONFLICT", code: "WALLET_TYPE_VERSION_NOT_DEPLOYED", message: "conflict error: version 2025.06.0 is not deployed on the wallet's network"} + versionDeprecated: + value: {type: "CONFLICT", code: "WALLET_TYPE_VERSION_DEPRECATED", message: "conflict error: version 2025.03.0 is deprecated and not supported as a target"} + targetAlreadyRecorded: + value: {type: "CONFLICT", code: "WALLET_UPGRADE_TARGET_ALREADY_RECORDED", message: "conflict error: wallet is already recorded on version 2025.06.0"} + upgradeInProgress: + value: {type: "CONFLICT", code: "WALLET_UPGRADE_IN_PROGRESS", message: "conflict error: an upgrade is already in flight for this wallet"} + walletNotUpgradeable: + value: {type: "CONFLICT", code: "WALLET_NOT_UPGRADEABLE", message: "conflict error: the wallet's recorded version is not upgradeable through CREC"} + walletArchived: + value: {type: "CONFLICT", code: "WALLET_ALREADY_ARCHIVED", message: "conflict error: cannot upgrade an archived wallet"} + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "INTERNAL_ERROR", message: "An internal error occurred."} + get: + tags: + - Wallet Upgrades + operationId: listWalletUpgrades + x-permissions: [crec:wallet:read] + summary: Retrieves the implementation version history for a wallet. + description: | + Implementation history for the wallet, upgrades and corrections + distinguished by `source`. + parameters: + - in: path + name: wallet_id + required: true + description: Unique wallet identifier. + schema: + type: string + format: uuid + - in: query + name: limit + description: Maximum number of upgrades to return + schema: + type: integer + minimum: 1 + maximum: 100 + default: 20 + - in: query + name: offset + description: Number of upgrades to skip for pagination + schema: + type: integer + format: int64 + minimum: 0 + default: 0 + - in: query + name: source + description: Filter upgrades by source + schema: + $ref: "#/components/schemas/WalletVersionChangeSource" + - in: query + name: outcome + description: Filter upgrades by outcome + schema: + $ref: "#/components/schemas/WalletUpgradeOutcome" + responses: + "401": + $ref: "#/components/responses/OrganizationNotFound" + "403": + $ref: "#/components/responses/PermissionDenied" + "200": + description: Successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/WalletUpgradeList" + example: {data: [], has_more: false} + "404": + description: Wallet not found + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "NOT_FOUND", code: "WALLET_NOT_FOUND", message: "wallet with ID 3fa85f64-5717-4562-b3fc-2c963f66afa6 not found"} + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "INTERNAL_ERROR", message: "An internal error occurred."} + /wallets/{wallet_id}/upgrades/{upgrade_id}: + get: + tags: + - Wallet Upgrades + operationId: getWalletUpgrade + x-permissions: [crec:wallet:read] + summary: Retrieves one wallet upgrade. + description: | + One upgrade's outcome with its verbatim revert reason. + parameters: + - in: path + name: wallet_id + required: true + description: Unique wallet identifier. + schema: + type: string + format: uuid + - in: path + name: upgrade_id + required: true + description: Unique wallet upgrade identifier. + schema: + type: string + format: uuid + responses: + "401": + $ref: "#/components/responses/OrganizationNotFound" + "403": + $ref: "#/components/responses/PermissionDenied" + "200": + description: Upgrade found + content: + application/json: + schema: + $ref: "#/components/schemas/WalletUpgrade" + example: + upgrade_id: "b3d1c2a4-5e6f-4a7b-8c9d-0e1f2a3b4c5d" + wallet_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" + from_version: "2025.03.0" + to_version: "2025.06.0" + implementation_address: "0x742d35cc6634c0532925a3b844bc454e4438f44e" + source: "crec_upgrade" + outcome: "failed" + operation_id: "c1e5b8d0-1234-5678-abcd-ef0123456789" + operation_status: "reverted" + failure_reason: "ERC1967Upgrade: upgrade fails if UUPS probe targets non-UUPS contract" + requested_by: {subject_type: "api_key", subject_id: "key-123", subject_name: "my-key"} + authorized_key: "0x742d35cc6634c0532925a3b844bc454e4438f44e" + created_at: 1715698800 + updated_at: 1715698800 + "404": + description: Wallet or upgrade not found + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + examples: + walletNotFound: + value: {type: "NOT_FOUND", code: "WALLET_NOT_FOUND", message: "wallet with ID 3fa85f64-5717-4562-b3fc-2c963f66afa6 not found"} + upgradeNotFound: + value: {type: "NOT_FOUND", code: "WALLET_UPGRADE_NOT_FOUND", message: "no upgrade b3d1c2a4-5e6f-4a7b-8c9d-0e1f2a3b4c5d found for wallet 3fa85f64-5717-4562-b3fc-2c963f66afa6"} + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "INTERNAL_ERROR", message: "An internal error occurred."} + /wallets/{wallet_id}/admin-operations: + post: + tags: + - Wallet Admin Operations + operationId: createWalletAdminOperation + x-permissions: [crec:wallet:management:write] + summary: Submits a signed administrative wallet operation. + description: | + Submits a signed administrative operation naming a capability the + wallet's version row publishes, with arguments by name. The enclosing + operation is an ordinary signed operation: it must carry exactly one + transaction, self-targeted at the wallet, with a non-zero deadline, and + its chain_selector and address must name the wallet the path names. + Courier packs the published capability's ABI fragment with the + submitted arguments and authorization and requires the result to equal + the transaction's calldata byte for byte. + parameters: + - in: path + name: wallet_id + required: true + description: Unique wallet identifier. + schema: + type: string + format: uuid + requestBody: + description: Administrative wallet operation submission. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/CreateWalletAdminOperation" + example: + capability: "revokeAuthorization" + arguments: {opId: "44"} + authorization: + wallet_operation_id: "45" + deadline: 1735689600 + signature: "0x1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + operation: + chain_selector: "16015286601757825753" + address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e" + wallet_operation_id: "46" + deadline: 1735689600 + transactions: [{to: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", value: "0", data: "0x"}] + responses: + "401": + $ref: "#/components/responses/OrganizationNotFound" + "403": + $ref: "#/components/responses/PermissionDenied" + "202": + description: Administrative operation submission accepted + content: + application/json: + schema: + $ref: "#/components/schemas/WalletAdminOperation" + example: + admin_operation_id: "c1e5b8d0-1234-5678-abcd-ef0123456789" + wallet_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" + capability: "revokeAuthorization" + arguments: {opId: "44"} + outcome: "pending" + operation_status: "broadcasting" + requested_by: {subject_type: "api_key", subject_id: "key-123", subject_name: "my-key"} + authorized_key: "0x742d35cc6634c0532925a3b844bc454e4438f44e" + created_at: 1715698800 + updated_at: 1715698800 + "400": + description: Invalid request data + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + examples: + payloadMismatch: + value: {type: "VALIDATION_ERROR", code: "WALLET_ADMIN_OPERATION_PAYLOAD_MISMATCH", message: "validation error: the operation's calldata is not the published capability packed with the submitted arguments and authorization"} + entryPointNotRecognized: + value: {type: "VALIDATION_ERROR", code: "ENTRY_POINT_NOT_RECOGNIZED", message: "validation error: not an EntryPoint CREC knows on that network"} + operationMismatch: + value: {type: "VALIDATION_ERROR", message: "validation error: operation chain_selector and address must name the wallet and carry exactly one self-targeted transaction with a non-zero deadline"} + "404": + description: Wallet not found + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "NOT_FOUND", code: "WALLET_NOT_FOUND", message: "wallet with ID 3fa85f64-5717-4562-b3fc-2c963f66afa6 not found"} + "409": + description: Administrative operation not accepted in the wallet's current state + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + examples: + capabilityNotSupported: + value: {type: "CONFLICT", code: "WALLET_CAPABILITY_NOT_SUPPORTED", message: "conflict error: the wallet's version does not publish the named capability"} + walletArchived: + value: {type: "CONFLICT", code: "WALLET_ALREADY_ARCHIVED", message: "conflict error: cannot submit an administrative operation on an archived wallet"} + "500": + description: Internal server error + content: + application/json: + schema: + $ref: "#/components/schemas/ApplicationError" + example: {type: "INTERNAL_ERROR", message: "An internal error occurred."} get: tags: - - Wallets - operationId: getWallet + - Wallet Admin Operations + operationId: listWalletAdminOperations x-permissions: [crec:wallet:read] - summary: Retrieves a specific wallet by ID. + summary: Retrieves administrative operations for a wallet. + description: | + Capability, arguments, authorizing key and outcome for the wallet's + administrative operations. parameters: - in: path name: wallet_id @@ -217,25 +814,41 @@ paths: schema: type: string format: uuid + - in: query + name: limit + description: Maximum number of administrative operations to return + schema: + type: integer + minimum: 1 + maximum: 100 + default: 20 + - in: query + name: offset + description: Number of administrative operations to skip for pagination + schema: + type: integer + format: int64 + minimum: 0 + default: 0 responses: "401": $ref: "#/components/responses/OrganizationNotFound" "403": $ref: "#/components/responses/PermissionDenied" "200": - description: Wallet found + description: Successful operation content: application/json: schema: - $ref: "#/components/schemas/Wallet" - example: {wallet_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", name: "my-wallet", address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", chain_selector: "16015286601757825753", wallet_type: "ecdsa", wallet_owner_address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", status: "deployed", allowed_rsa_signers: [], allowed_ecdsa_signers: [], configuration: {allowed_signers: []}} + $ref: "#/components/schemas/WalletAdminOperationList" + example: {data: [], has_more: false} "404": description: Wallet not found content: application/json: schema: $ref: "#/components/schemas/ApplicationError" - example: {type: "NOT_FOUND", message: "The requested resource was not found."} + example: {type: "NOT_FOUND", code: "WALLET_NOT_FOUND", message: "wallet with ID 3fa85f64-5717-4562-b3fc-2c963f66afa6 not found"} "500": description: Internal server error content: @@ -243,12 +856,15 @@ paths: schema: $ref: "#/components/schemas/ApplicationError" example: {type: "INTERNAL_ERROR", message: "An internal error occurred."} - patch: + /wallets/{wallet_id}/admin-operations/{admin_operation_id}: + get: tags: - - Wallets - operationId: updateWallet - x-permissions: [crec:wallet:write, crec:wallet:archive:write] - summary: Updates a wallet name. + - Wallet Admin Operations + operationId: getWalletAdminOperation + x-permissions: [crec:wallet:read] + summary: Retrieves one administrative wallet operation. + description: | + One administrative operation with its verbatim revert reason. parameters: - in: path name: wallet_id @@ -257,47 +873,46 @@ paths: schema: type: string format: uuid - requestBody: - description: Wallet update parameters. - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/UpdateWallet" - example: {name: "updated-wallet"} + - in: path + name: admin_operation_id + required: true + description: Unique administrative operation identifier. + schema: + type: string + format: uuid responses: "401": $ref: "#/components/responses/OrganizationNotFound" "403": $ref: "#/components/responses/PermissionDenied" "200": - description: Wallet updated successfully - content: - application/json: - schema: - $ref: "#/components/schemas/Wallet" - example: {wallet_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6", name: "updated-wallet", address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", chain_selector: "16015286601757825753", wallet_type: "ecdsa", wallet_owner_address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", status: "deployed", allowed_rsa_signers: [], allowed_ecdsa_signers: [], configuration: {allowed_signers: []}} - "400": - description: Invalid request data + description: Administrative operation found content: application/json: schema: - $ref: "#/components/schemas/ApplicationError" - example: {type: "VALIDATION_ERROR", message: "Invalid request data."} + $ref: "#/components/schemas/WalletAdminOperation" + example: + admin_operation_id: "c1e5b8d0-1234-5678-abcd-ef0123456789" + wallet_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6" + capability: "revokeAuthorization" + arguments: {opId: "44"} + outcome: "succeeded" + operation_status: "confirmed" + requested_by: {subject_type: "api_key", subject_id: "key-123", subject_name: "my-key"} + authorized_key: "0x742d35cc6634c0532925a3b844bc454e4438f44e" + created_at: 1715698800 + updated_at: 1715698800 "404": - description: Wallet not found - content: - application/json: - schema: - $ref: "#/components/schemas/ApplicationError" - example: {type: "NOT_FOUND", message: "The requested resource was not found."} - "409": - description: Wallet is already archived, or was modified concurrently by another request. + description: Wallet or administrative operation not found content: application/json: schema: $ref: "#/components/schemas/ApplicationError" - example: {type: "CONFLICT", code: "WALLET_ALREADY_ARCHIVED", message: "conflict error: wallet already in archived state"} + examples: + walletNotFound: + value: {type: "NOT_FOUND", code: "WALLET_NOT_FOUND", message: "wallet with ID 3fa85f64-5717-4562-b3fc-2c963f66afa6 not found"} + adminOperationNotFound: + value: {type: "NOT_FOUND", code: "WALLET_ADMIN_OPERATION_NOT_FOUND", message: "no administrative operation c1e5b8d0-1234-5678-abcd-ef0123456789 found for wallet 3fa85f64-5717-4562-b3fc-2c963f66afa6"} "500": description: Internal server error content: @@ -1833,12 +2448,14 @@ components: - pending - deploying - deployed + - upgrading - archived - failed x-enum-varnames: - WalletStatusPending - WalletStatusDeploying - WalletStatusDeployed + - WalletStatusUpgrading - WalletStatusArchived - WalletStatusFailed example: "pending" @@ -2175,6 +2792,26 @@ components: $ref: "#/components/schemas/ECDSASignersList" configuration: $ref: "#/components/schemas/WalletConfiguration" + implementation_version: + # switch to type: [string, "null"] when upgrading to OpenAPI 3.1.2 + type: string + nullable: true + description: Operator-assigned implementation version label the wallet is recorded on. Opaque, never ordered or parsed. Null where no version is recorded. + example: "2025.06.0" + default_version: + # switch to type: [string, "null"] when upgrading to OpenAPI 3.1.2 + type: string + nullable: true + description: The wallet type's default version, the one new wallets of this type deploy at. + example: "2025.06.0" + on_default_version: + type: boolean + description: True when the wallet's recorded version is the type's default. + example: true + is_upgradeable: + type: boolean + description: Whether the wallet's recorded version can be upgraded through CREC. False while the wallet cannot be upgraded through CREC. + example: true created_at: $ref: "#/components/schemas/Timestamp" updated_at: @@ -2217,6 +2854,364 @@ components: - data - has_more + WalletTypeVersionStatus: + type: string + description: Support state of a wallet type implementation version. A deprecated version is not a supported upgrade target. + enum: + - active + - deprecated + x-enum-varnames: + - WalletTypeVersionStatusActive + - WalletTypeVersionStatusDeprecated + example: "active" + WalletVersionChangeSource: + type: string + description: Writer of a wallet's recorded implementation version. + enum: + - crec_upgrade + - operator_correction + x-enum-varnames: + - WalletVersionChangeSourceCRECUpgrade + - WalletVersionChangeSourceOperatorCorrection + example: "crec_upgrade" + WalletUpgradeOutcome: + type: string + description: Outcome of a wallet upgrade or administrative operation. + enum: + - pending + - succeeded + - failed + - expired + x-enum-varnames: + - WalletUpgradeOutcomePending + - WalletUpgradeOutcomeSucceeded + - WalletUpgradeOutcomeFailed + - WalletUpgradeOutcomeExpired + example: "pending" + WalletCapabilityDescriptor: + description: A non-upgrade administrative capability a wallet type implementation version publishes. + type: object + properties: + name: + type: string + description: The capability name an administrative operation submission names. + example: "revokeAuthorization" + abi_fragment: + type: object + additionalProperties: true + description: Full ABI function object with parameter names and types. The packed result includes the 4-byte selector. + example: {type: "function", name: "revokeAuthorization", inputs: [{name: "opId", type: "uint256"}, {name: "deadline", type: "uint256"}], outputs: [], stateMutability: "nonpayable"} + eip712_type: + type: string + description: The pinned EIP-712 type string for this capability's signed struct. + example: "RevokeAuthorization(uint256 opId,uint256 deadline)" + required: + - name + - abi_fragment + - eip712_type + WalletTypeVersionDeployment: + description: One network's implementation address for a wallet type version. + type: object + properties: + chain_selector: + $ref: "#/components/schemas/ChainSelector" + implementation_address: + allOf: + - $ref: "#/components/schemas/EthereumAddress" + description: Implementation address for the version on the network. Lowercase hex. + example: "0x742d35cc6634c0532925a3b844bc454e4438f44e" + required: + - chain_selector + - implementation_address + WalletTypeVersion: + description: A published implementation version of a wallet type. + type: object + properties: + wallet_type: + $ref: "#/components/schemas/WalletType" + implementation_version: + type: string + description: Operator-assigned label, unique per wallet type. Opaque, never ordered or parsed. + example: "2025.06.0" + status: + $ref: "#/components/schemas/WalletTypeVersionStatus" + is_default: + type: boolean + description: The version new wallets of this type deploy at. Exactly one per wallet type. + example: true + is_upgradeable: + type: boolean + description: Whether a wallet recorded on this version can be upgraded through CREC. False on backfilled legacy rows. + example: true + changelog: + type: string + description: Release notes for the version. + example: "Adds signature-authorized upgrade and administrative capabilities." + capabilities: + type: array + items: + $ref: "#/components/schemas/WalletCapabilityDescriptor" + description: The non-upgrade administrative capabilities this implementation publishes. Empty on backfilled legacy rows. + example: [] + deployments: + type: array + items: + $ref: "#/components/schemas/WalletTypeVersionDeployment" + description: Per-network implementation addresses. Filtered to chain_selector when the query parameter is present. + example: [] + created_at: + $ref: "#/components/schemas/Timestamp" + required: + - wallet_type + - implementation_version + - status + - is_default + - is_upgradeable + - capabilities + - deployments + - created_at + WalletTypeVersionList: + description: List of published implementation versions for a wallet type. + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/WalletTypeVersion" + example: [] + has_more: + type: boolean + description: True if there are more versions to fetch + example: false + required: + - data + - has_more + AdminAuthorization: + type: object + additionalProperties: false + description: Owner signature over an administrative capability's pinned EIP-712 struct. + properties: + wallet_operation_id: + allOf: + - $ref: "#/components/schemas/WalletOperationId" + description: The authorization's own identifier in the wallet's executed-operation namespace. Must differ from the enclosing operation's. + example: "43" + deadline: + type: integer + format: int64 + minimum: 1 + description: Unix timestamp deadline for the authorization. Zero is rejected. + example: 1735689600 + signature: + allOf: + - $ref: "#/components/schemas/OperationSignature" + description: The owner's EIP-712 signature over the capability's pinned struct. + required: + - wallet_operation_id + - deadline + - signature + CreateWalletUpgrade: + type: object + additionalProperties: false + description: Request body for submitting a client-signed wallet upgrade. + properties: + target_version: + type: string + description: A label the wallet type's catalog publishes. + example: "2025.06.0" + implementation_address: + allOf: + - $ref: "#/components/schemas/EthereumAddress" + description: What the authorization commits to. Must equal the catalog's address for target_version on the wallet's network, both as declared and as decoded from the packed calldata. + example: "0x742d35cc6634c0532925a3b844bc454e4438f44e" + authorization: + $ref: "#/components/schemas/AdminAuthorization" + operation: + $ref: "#/components/schemas/CreateOperation" + required: + - target_version + - implementation_address + - authorization + - operation + WalletUpgrade: + description: A wallet implementation version change. + type: object + properties: + upgrade_id: + type: string + format: uuid + description: Unique identifier for the upgrade + example: "b3d1c2a4-5e6f-4a7b-8c9d-0e1f2a3b4c5d" + wallet_id: + type: string + format: uuid + description: Unique identifier for the wallet + example: "3fa85f64-5717-4562-b3fc-2c963f66afa6" + from_version: + # switch to type: [string, "null"] when upgrading to OpenAPI 3.1.2 + type: string + nullable: true + description: The version recorded when the event began. Null where none was recorded. + example: "2025.03.0" + to_version: + type: string + description: The version the wallet is recorded on after the event. + example: "2025.06.0" + implementation_address: + nullable: true + allOf: + - $ref: "#/components/schemas/EthereumAddress" + description: The implementation address the authorization commits to. Null on a correction. + example: "0x742d35cc6634c0532925a3b844bc454e4438f44e" + source: + $ref: "#/components/schemas/WalletVersionChangeSource" + outcome: + $ref: "#/components/schemas/WalletUpgradeOutcome" + operation_id: + # switch to type: [string, "null"] when upgrading to OpenAPI 3.1.2 + type: string + format: uuid + nullable: true + description: The internal operation. Null on a correction. + example: "c1e5b8d0-1234-5678-abcd-ef0123456789" + operation_status: + allOf: + - $ref: "#/components/schemas/OperationStatus" + description: The underlying lifecycle status while the upgrade is in flight. + example: "broadcasting" + failure_reason: + type: string + description: The onchain revert reason, verbatim. + example: "ERC1967Upgrade: upgrade fails if UUPS probe targets non-UUPS contract" + requested_by: + $ref: "#/components/schemas/Subject" + authorized_key: + nullable: true + allOf: + - $ref: "#/components/schemas/EthereumAddress" + description: The owner key that signed. Null on a correction. + example: "0x742d35cc6634c0532925a3b844bc454e4438f44e" + created_at: + $ref: "#/components/schemas/Timestamp" + updated_at: + $ref: "#/components/schemas/Timestamp" + required: + - upgrade_id + - wallet_id + - to_version + - source + - outcome + - requested_by + - created_at + - updated_at + WalletUpgradeList: + description: Paginated list of wallet implementation version changes. + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/WalletUpgrade" + example: [] + has_more: + type: boolean + description: True if there are more upgrades to fetch + example: false + required: + - data + - has_more + CreateWalletAdminOperation: + type: object + additionalProperties: false + description: Request body for submitting a signed administrative wallet operation. + properties: + capability: + type: string + description: A name the wallet's version row publishes. An unpublished name is rejected. + example: "revokeAuthorization" + arguments: + type: object + additionalProperties: true + description: "Values keyed by parameter name, canonically encoded: integers as decimal strings, addresses lowercase hex, absent distinguished from null." + example: {opId: "44"} + authorization: + $ref: "#/components/schemas/AdminAuthorization" + operation: + $ref: "#/components/schemas/CreateOperation" + required: + - capability + - arguments + - authorization + - operation + WalletAdminOperation: + description: A signature-authorized administrative wallet operation. + type: object + properties: + admin_operation_id: + type: string + format: uuid + description: The internal operation's identifier + example: "c1e5b8d0-1234-5678-abcd-ef0123456789" + wallet_id: + type: string + format: uuid + description: Unique identifier for the wallet + example: "3fa85f64-5717-4562-b3fc-2c963f66afa6" + capability: + type: string + description: The capability the operation exercises + example: "revokeAuthorization" + arguments: + type: object + additionalProperties: true + description: As submitted, canonically encoded + example: {opId: "44"} + outcome: + $ref: "#/components/schemas/WalletUpgradeOutcome" + operation_status: + allOf: + - $ref: "#/components/schemas/OperationStatus" + description: The underlying lifecycle status while the operation is in flight. + example: "broadcasting" + failure_reason: + type: string + description: The onchain revert reason, verbatim. + example: "ERC1967Upgrade: upgrade fails if UUPS probe targets non-UUPS contract" + requested_by: + $ref: "#/components/schemas/Subject" + authorized_key: + $ref: "#/components/schemas/EthereumAddress" + created_at: + $ref: "#/components/schemas/Timestamp" + updated_at: + $ref: "#/components/schemas/Timestamp" + required: + - admin_operation_id + - wallet_id + - capability + - arguments + - outcome + - requested_by + - authorized_key + - created_at + - updated_at + WalletAdminOperationList: + description: Paginated list of administrative wallet operations. + type: object + properties: + data: + type: array + items: + $ref: "#/components/schemas/WalletAdminOperation" + example: [] + has_more: + type: boolean + description: True if there are more administrative operations to fetch + example: false + required: + - data + - has_more + Network: description: A blockchain network supported by CRE Connect. type: object @@ -2372,6 +3367,19 @@ components: - WALLET_NOT_READY - CHAIN_UNAVAILABLE - CHANNEL_ARCHIVED + - WALLET_TYPE_VERSION_NOT_FOUND + - WALLET_TYPE_VERSION_NOT_DEPLOYED + - WALLET_TYPE_VERSION_DEPRECATED + - WALLET_UPGRADE_NOT_FOUND + - WALLET_UPGRADE_TARGET_ALREADY_RECORDED + - WALLET_UPGRADE_IN_PROGRESS + - WALLET_NOT_UPGRADEABLE + - WALLET_UPGRADE_TYPE_MISMATCH + - WALLET_UPGRADE_PAYLOAD_MISMATCH + - WALLET_ADMIN_OPERATION_NOT_FOUND + - WALLET_ADMIN_OPERATION_PAYLOAD_MISMATCH + - WALLET_CAPABILITY_NOT_SUPPORTED + - ENTRY_POINT_NOT_RECOGNIZED x-enum-varnames: - ApplicationErrorCodeChannelNotFound - ApplicationErrorCodeWalletNotFound @@ -2390,6 +3398,19 @@ components: - ApplicationErrorCodeWalletNotReady - ApplicationErrorCodeChainUnavailable - ApplicationErrorCodeChannelArchived + - ApplicationErrorCodeWalletTypeVersionNotFound + - ApplicationErrorCodeWalletTypeVersionNotDeployed + - ApplicationErrorCodeWalletTypeVersionDeprecated + - ApplicationErrorCodeWalletUpgradeNotFound + - ApplicationErrorCodeWalletUpgradeTargetAlreadyRecorded + - ApplicationErrorCodeWalletUpgradeInProgress + - ApplicationErrorCodeWalletNotUpgradeable + - ApplicationErrorCodeWalletUpgradeTypeMismatch + - ApplicationErrorCodeWalletUpgradePayloadMismatch + - ApplicationErrorCodeWalletAdminOperationNotFound + - ApplicationErrorCodeWalletAdminOperationPayloadMismatch + - ApplicationErrorCodeWalletCapabilityNotSupported + - ApplicationErrorCodeEntryPointNotRecognized example: "WALLET_NOT_FOUND" ApplicationError: description: Standard error response body. @@ -3626,6 +4647,12 @@ components: format: uuid description: Unique identifier for the wallet example: "3fa85f64-5717-4562-b3fc-2c963f66afa6" + implementation_version: + # switch to type: [string, "null"] when upgrading to OpenAPI 3.1.2 + type: string + nullable: true + description: Implementation version recorded for the wallet after the status change. An upgrade's outcome arrives on this field. + example: "2025.06.0" timestamp: type: integer format: int64 diff --git a/client/client.gen.go b/client/client.gen.go index 1d8f83f..ae3bfe5 100644 --- a/client/client.gen.go +++ b/client/client.gen.go @@ -34,23 +34,36 @@ const ( // Defines values for ApplicationErrorCode. const ( - ApplicationErrorCodeChainUnavailable ApplicationErrorCode = "CHAIN_UNAVAILABLE" - ApplicationErrorCodeChannelAlreadyExists ApplicationErrorCode = "CHANNEL_ALREADY_EXISTS" - ApplicationErrorCodeChannelArchived ApplicationErrorCode = "CHANNEL_ARCHIVED" - ApplicationErrorCodeChannelNotFound ApplicationErrorCode = "CHANNEL_NOT_FOUND" - ApplicationErrorCodeIdempotencyKeyMismatch ApplicationErrorCode = "IDEMPOTENCY_KEY_MISMATCH" - ApplicationErrorCodeOperationDeadlineElapsed ApplicationErrorCode = "OPERATION_DEADLINE_ELAPSED" - ApplicationErrorCodeOperationNotCancellable ApplicationErrorCode = "OPERATION_NOT_CANCELLABLE" - ApplicationErrorCodeOperationNotFinalizable ApplicationErrorCode = "OPERATION_NOT_FINALIZABLE" - ApplicationErrorCodeOperationNotFound ApplicationErrorCode = "OPERATION_NOT_FOUND" - ApplicationErrorCodeQueryNotFound ApplicationErrorCode = "QUERY_NOT_FOUND" - ApplicationErrorCodeResourceVersionConflict ApplicationErrorCode = "RESOURCE_VERSION_CONFLICT" - ApplicationErrorCodeWalletAlreadyArchived ApplicationErrorCode = "WALLET_ALREADY_ARCHIVED" - ApplicationErrorCodeWalletAlreadyExists ApplicationErrorCode = "WALLET_ALREADY_EXISTS" - ApplicationErrorCodeWalletNotFound ApplicationErrorCode = "WALLET_NOT_FOUND" - ApplicationErrorCodeWalletNotReady ApplicationErrorCode = "WALLET_NOT_READY" - ApplicationErrorCodeWatcherAlreadyExists ApplicationErrorCode = "WATCHER_ALREADY_EXISTS" - ApplicationErrorCodeWatcherNotFound ApplicationErrorCode = "WATCHER_NOT_FOUND" + ApplicationErrorCodeChainUnavailable ApplicationErrorCode = "CHAIN_UNAVAILABLE" + ApplicationErrorCodeChannelAlreadyExists ApplicationErrorCode = "CHANNEL_ALREADY_EXISTS" + ApplicationErrorCodeChannelArchived ApplicationErrorCode = "CHANNEL_ARCHIVED" + ApplicationErrorCodeChannelNotFound ApplicationErrorCode = "CHANNEL_NOT_FOUND" + ApplicationErrorCodeEntryPointNotRecognized ApplicationErrorCode = "ENTRY_POINT_NOT_RECOGNIZED" + ApplicationErrorCodeIdempotencyKeyMismatch ApplicationErrorCode = "IDEMPOTENCY_KEY_MISMATCH" + ApplicationErrorCodeOperationDeadlineElapsed ApplicationErrorCode = "OPERATION_DEADLINE_ELAPSED" + ApplicationErrorCodeOperationNotCancellable ApplicationErrorCode = "OPERATION_NOT_CANCELLABLE" + ApplicationErrorCodeOperationNotFinalizable ApplicationErrorCode = "OPERATION_NOT_FINALIZABLE" + ApplicationErrorCodeOperationNotFound ApplicationErrorCode = "OPERATION_NOT_FOUND" + ApplicationErrorCodeQueryNotFound ApplicationErrorCode = "QUERY_NOT_FOUND" + ApplicationErrorCodeResourceVersionConflict ApplicationErrorCode = "RESOURCE_VERSION_CONFLICT" + ApplicationErrorCodeWalletAdminOperationNotFound ApplicationErrorCode = "WALLET_ADMIN_OPERATION_NOT_FOUND" + ApplicationErrorCodeWalletAdminOperationPayloadMismatch ApplicationErrorCode = "WALLET_ADMIN_OPERATION_PAYLOAD_MISMATCH" + ApplicationErrorCodeWalletAlreadyArchived ApplicationErrorCode = "WALLET_ALREADY_ARCHIVED" + ApplicationErrorCodeWalletAlreadyExists ApplicationErrorCode = "WALLET_ALREADY_EXISTS" + ApplicationErrorCodeWalletCapabilityNotSupported ApplicationErrorCode = "WALLET_CAPABILITY_NOT_SUPPORTED" + ApplicationErrorCodeWalletNotFound ApplicationErrorCode = "WALLET_NOT_FOUND" + ApplicationErrorCodeWalletNotReady ApplicationErrorCode = "WALLET_NOT_READY" + ApplicationErrorCodeWalletNotUpgradeable ApplicationErrorCode = "WALLET_NOT_UPGRADEABLE" + ApplicationErrorCodeWalletTypeVersionDeprecated ApplicationErrorCode = "WALLET_TYPE_VERSION_DEPRECATED" + ApplicationErrorCodeWalletTypeVersionNotDeployed ApplicationErrorCode = "WALLET_TYPE_VERSION_NOT_DEPLOYED" + ApplicationErrorCodeWalletTypeVersionNotFound ApplicationErrorCode = "WALLET_TYPE_VERSION_NOT_FOUND" + ApplicationErrorCodeWalletUpgradeInProgress ApplicationErrorCode = "WALLET_UPGRADE_IN_PROGRESS" + ApplicationErrorCodeWalletUpgradeNotFound ApplicationErrorCode = "WALLET_UPGRADE_NOT_FOUND" + ApplicationErrorCodeWalletUpgradePayloadMismatch ApplicationErrorCode = "WALLET_UPGRADE_PAYLOAD_MISMATCH" + ApplicationErrorCodeWalletUpgradeTargetAlreadyRecorded ApplicationErrorCode = "WALLET_UPGRADE_TARGET_ALREADY_RECORDED" + ApplicationErrorCodeWalletUpgradeTypeMismatch ApplicationErrorCode = "WALLET_UPGRADE_TYPE_MISMATCH" + ApplicationErrorCodeWatcherAlreadyExists ApplicationErrorCode = "WATCHER_ALREADY_EXISTS" + ApplicationErrorCodeWatcherNotFound ApplicationErrorCode = "WATCHER_NOT_FOUND" ) // Defines values for BlockNumberBlockSelectionType. @@ -148,6 +161,7 @@ const ( WalletStatusDeploying WalletStatus = "deploying" WalletStatusFailed WalletStatus = "failed" WalletStatusPending WalletStatus = "pending" + WalletStatusUpgrading WalletStatus = "upgrading" ) // Defines values for WalletType. @@ -158,6 +172,26 @@ const ( WalletTypeRSA WalletType = "rsa" ) +// Defines values for WalletTypeVersionStatus. +const ( + WalletTypeVersionStatusActive WalletTypeVersionStatus = "active" + WalletTypeVersionStatusDeprecated WalletTypeVersionStatus = "deprecated" +) + +// Defines values for WalletUpgradeOutcome. +const ( + WalletUpgradeOutcomeExpired WalletUpgradeOutcome = "expired" + WalletUpgradeOutcomeFailed WalletUpgradeOutcome = "failed" + WalletUpgradeOutcomePending WalletUpgradeOutcome = "pending" + WalletUpgradeOutcomeSucceeded WalletUpgradeOutcome = "succeeded" +) + +// Defines values for WalletVersionChangeSource. +const ( + WalletVersionChangeSourceCRECUpgrade WalletVersionChangeSource = "crec_upgrade" + WalletVersionChangeSourceOperatorCorrection WalletVersionChangeSource = "operator_correction" +) + // Defines values for WatcherStatus. const ( WatcherStatusActive WatcherStatus = "active" @@ -170,6 +204,18 @@ const ( // Actor Resource attribution actor — ":" for a user, "api:" for an API key. type Actor = string +// AdminAuthorization Owner signature over an administrative capability's pinned EIP-712 struct. +type AdminAuthorization struct { + // Deadline Unix timestamp deadline for the authorization. Zero is rejected. + Deadline int64 `json:"deadline"` + + // Signature The owner's EIP-712 signature over the capability's pinned struct. + Signature OperationSignature `json:"signature"` + + // WalletOperationId The authorization's own identifier in the wallet's executed-operation namespace. Must differ from the enclosing operation's. + WalletOperationId WalletOperationId `json:"wallet_operation_id"` +} + // ApplicationError Standard error response body. type ApplicationError struct { // Code Machine-readable error code for classified tenant error responses. @@ -337,6 +383,36 @@ type CreateWallet struct { WalletType WalletType `json:"wallet_type"` } +// CreateWalletAdminOperation Request body for submitting a signed administrative wallet operation. +type CreateWalletAdminOperation struct { + // Arguments Values keyed by parameter name, canonically encoded: integers as decimal strings, addresses lowercase hex, absent distinguished from null. + Arguments map[string]interface{} `json:"arguments"` + + // Authorization Owner signature over an administrative capability's pinned EIP-712 struct. + Authorization AdminAuthorization `json:"authorization"` + + // Capability A name the wallet's version row publishes. An unpublished name is rejected. + Capability string `json:"capability"` + + // Operation Request body for creating a signed operation or a draft when the signature is omitted. + Operation CreateOperation `json:"operation"` +} + +// CreateWalletUpgrade Request body for submitting a client-signed wallet upgrade. +type CreateWalletUpgrade struct { + // Authorization Owner signature over an administrative capability's pinned EIP-712 struct. + Authorization AdminAuthorization `json:"authorization"` + + // ImplementationAddress What the authorization commits to. Must equal the catalog's address for target_version on the wallet's network, both as declared and as decoded from the packed calldata. + ImplementationAddress EthereumAddress `json:"implementation_address"` + + // Operation Request body for creating a signed operation or a draft when the signature is omitted. + Operation CreateOperation `json:"operation"` + + // TargetVersion A label the wallet type's catalog publishes. + TargetVersion string `json:"target_version"` +} + // CreateWatcher Request body for creating a new watcher (service-based or ABI-based). type CreateWatcher struct { union json.RawMessage @@ -988,12 +1064,24 @@ type Wallet struct { // CreatedBy Actor that created the resource. Null when there is no attributable subject (e.g. background job). CreatedBy *Actor `json:"created_by"` + // DefaultVersion The wallet type's default version, the one new wallets of this type deploy at. + DefaultVersion *string `json:"default_version"` + // Description Description of the wallet Description *string `json:"description,omitempty"` + // ImplementationVersion Operator-assigned implementation version label the wallet is recorded on. Opaque, never ordered or parsed. Null where no version is recorded. + ImplementationVersion *string `json:"implementation_version"` + + // IsUpgradeable Whether the wallet's recorded version can be upgraded through CREC. False while the wallet cannot be upgraded through CREC. + IsUpgradeable *bool `json:"is_upgradeable,omitempty"` + // Name Name of the wallet Name string `json:"name"` + // OnDefaultVersion True when the wallet's recorded version is the type's default. + OnDefaultVersion *bool `json:"on_default_version,omitempty"` + // Status Status of a wallet entity Status WalletStatus `json:"status"` @@ -1016,6 +1104,62 @@ type Wallet struct { WalletType WalletType `json:"wallet_type"` } +// WalletAdminOperation A signature-authorized administrative wallet operation. +type WalletAdminOperation struct { + // AdminOperationId The internal operation's identifier + AdminOperationId openapi_types.UUID `json:"admin_operation_id"` + + // Arguments As submitted, canonically encoded + Arguments map[string]interface{} `json:"arguments"` + + // AuthorizedKey 42-character hex Ethereum address + AuthorizedKey EthereumAddress `json:"authorized_key"` + + // Capability The capability the operation exercises + Capability string `json:"capability"` + + // CreatedAt Unix timestamp in seconds + CreatedAt Timestamp `json:"created_at"` + + // FailureReason The onchain revert reason, verbatim. + FailureReason *string `json:"failure_reason,omitempty"` + + // OperationStatus The underlying lifecycle status while the operation is in flight. + OperationStatus *OperationStatus `json:"operation_status,omitempty"` + + // Outcome Outcome of a wallet upgrade or administrative operation. + Outcome WalletUpgradeOutcome `json:"outcome"` + + // RequestedBy Subject used to describe who initiated, signed, or cancelled an operation. `subject_name` is informational; `subject_id` remains the stable identifier for filtering and equality. + RequestedBy Subject `json:"requested_by"` + + // UpdatedAt Unix timestamp in seconds + UpdatedAt Timestamp `json:"updated_at"` + + // WalletId Unique identifier for the wallet + WalletId openapi_types.UUID `json:"wallet_id"` +} + +// WalletAdminOperationList Paginated list of administrative wallet operations. +type WalletAdminOperationList struct { + Data []WalletAdminOperation `json:"data"` + + // HasMore True if there are more administrative operations to fetch + HasMore bool `json:"has_more"` +} + +// WalletCapabilityDescriptor A non-upgrade administrative capability a wallet type implementation version publishes. +type WalletCapabilityDescriptor struct { + // AbiFragment Full ABI function object with parameter names and types. The packed result includes the 4-byte selector. + AbiFragment map[string]interface{} `json:"abi_fragment"` + + // Eip712Type The pinned EIP-712 type string for this capability's signed struct. + Eip712Type string `json:"eip712_type"` + + // Name The capability name an administrative operation submission names. + Name string `json:"name"` +} + // WalletConfiguration Type-specific wallet configuration. The structure depends on the accompanying wallet_type and is validated by the server at wallet-creation time, not by this schema - this allows wallet types unknown to this spec (e.g. third-party types registered directly in the courier) to carry their own configuration shape. type WalletConfiguration map[string]interface{} @@ -1041,6 +1185,9 @@ type WalletStatusPayload struct { // ChainSelector Chain selector identifier for the blockchain network ChainSelector string `json:"chain_selector"` + // ImplementationVersion Implementation version recorded for the wallet after the status change. An upgrade's outcome arrives on this field. + ImplementationVersion *string `json:"implementation_version"` + // Status Status of a wallet entity Status WalletStatus `json:"status"` @@ -1057,6 +1204,115 @@ type WalletStatusPayload struct { // WalletType Type of wallet type WalletType string +// WalletTypeVersion A published implementation version of a wallet type. +type WalletTypeVersion struct { + // Capabilities The non-upgrade administrative capabilities this implementation publishes. Empty on backfilled legacy rows. + Capabilities []WalletCapabilityDescriptor `json:"capabilities"` + + // Changelog Release notes for the version. + Changelog *string `json:"changelog,omitempty"` + + // CreatedAt Unix timestamp in seconds + CreatedAt Timestamp `json:"created_at"` + + // Deployments Per-network implementation addresses. Filtered to chain_selector when the query parameter is present. + Deployments []WalletTypeVersionDeployment `json:"deployments"` + + // ImplementationVersion Operator-assigned label, unique per wallet type. Opaque, never ordered or parsed. + ImplementationVersion string `json:"implementation_version"` + + // IsDefault The version new wallets of this type deploy at. Exactly one per wallet type. + IsDefault bool `json:"is_default"` + + // IsUpgradeable Whether a wallet recorded on this version can be upgraded through CREC. False on backfilled legacy rows. + IsUpgradeable bool `json:"is_upgradeable"` + + // Status Support state of a wallet type implementation version. A deprecated version is not a supported upgrade target. + Status WalletTypeVersionStatus `json:"status"` + + // WalletType Type of wallet + WalletType WalletType `json:"wallet_type"` +} + +// WalletTypeVersionDeployment One network's implementation address for a wallet type version. +type WalletTypeVersionDeployment struct { + // ChainSelector Chain selector identifier for the blockchain network + ChainSelector ChainSelector `json:"chain_selector"` + + // ImplementationAddress Implementation address for the version on the network. Lowercase hex. + ImplementationAddress EthereumAddress `json:"implementation_address"` +} + +// WalletTypeVersionList List of published implementation versions for a wallet type. +type WalletTypeVersionList struct { + Data []WalletTypeVersion `json:"data"` + + // HasMore True if there are more versions to fetch + HasMore bool `json:"has_more"` +} + +// WalletTypeVersionStatus Support state of a wallet type implementation version. A deprecated version is not a supported upgrade target. +type WalletTypeVersionStatus string + +// WalletUpgrade A wallet implementation version change. +type WalletUpgrade struct { + // AuthorizedKey The owner key that signed. Null on a correction. + AuthorizedKey *EthereumAddress `json:"authorized_key"` + + // CreatedAt Unix timestamp in seconds + CreatedAt Timestamp `json:"created_at"` + + // FailureReason The onchain revert reason, verbatim. + FailureReason *string `json:"failure_reason,omitempty"` + + // FromVersion The version recorded when the event began. Null where none was recorded. + FromVersion *string `json:"from_version"` + + // ImplementationAddress The implementation address the authorization commits to. Null on a correction. + ImplementationAddress *EthereumAddress `json:"implementation_address"` + + // OperationId The internal operation. Null on a correction. + OperationId *openapi_types.UUID `json:"operation_id"` + + // OperationStatus The underlying lifecycle status while the upgrade is in flight. + OperationStatus *OperationStatus `json:"operation_status,omitempty"` + + // Outcome Outcome of a wallet upgrade or administrative operation. + Outcome WalletUpgradeOutcome `json:"outcome"` + + // RequestedBy Subject used to describe who initiated, signed, or cancelled an operation. `subject_name` is informational; `subject_id` remains the stable identifier for filtering and equality. + RequestedBy Subject `json:"requested_by"` + + // Source Writer of a wallet's recorded implementation version. + Source WalletVersionChangeSource `json:"source"` + + // ToVersion The version the wallet is recorded on after the event. + ToVersion string `json:"to_version"` + + // UpdatedAt Unix timestamp in seconds + UpdatedAt Timestamp `json:"updated_at"` + + // UpgradeId Unique identifier for the upgrade + UpgradeId openapi_types.UUID `json:"upgrade_id"` + + // WalletId Unique identifier for the wallet + WalletId openapi_types.UUID `json:"wallet_id"` +} + +// WalletUpgradeList Paginated list of wallet implementation version changes. +type WalletUpgradeList struct { + Data []WalletUpgrade `json:"data"` + + // HasMore True if there are more upgrades to fetch + HasMore bool `json:"has_more"` +} + +// WalletUpgradeOutcome Outcome of a wallet upgrade or administrative operation. +type WalletUpgradeOutcome string + +// WalletVersionChangeSource Writer of a wallet's recorded implementation version. +type WalletVersionChangeSource string + // Watcher A watcher resource. type Watcher struct { // Abi ABI definitions for the events (if not using service-based events) @@ -1389,6 +1645,15 @@ type ListWatchersParams struct { EventName *string `form:"event_name,omitempty" json:"event_name,omitempty"` } +// ListWalletTypeVersionsParams defines parameters for ListWalletTypeVersions. +type ListWalletTypeVersionsParams struct { + // ChainSelector Filter deployments to a chain selector. Versions with no deployment on that chain are still returned. + ChainSelector *ChainSelector `form:"chain_selector,omitempty" json:"chain_selector,omitempty"` + + // Status Filter versions by support state. + Status *WalletTypeVersionStatus `form:"status,omitempty" json:"status,omitempty"` +} + // ListWalletsParams defines parameters for ListWallets. type ListWalletsParams struct { // Name Filter wallets by name (case-insensitive partial match) @@ -1409,6 +1674,9 @@ type ListWalletsParams struct { // Status Filter wallets by status. Multiple values allowed. Archived wallets are excluded by default when no status filter is specified. Status *[]WalletStatus `form:"status,omitempty" json:"status,omitempty"` + // ImplementationVersion Filter wallets by recorded implementation version + ImplementationVersion *string `form:"implementation_version,omitempty" json:"implementation_version,omitempty"` + // ChainEnvironment Filter wallets by chain environment (mainnet or testnet). If omitted, returns all chain environments. ChainEnvironment *ChainEnvironment `form:"chain_environment,omitempty" json:"chain_environment,omitempty"` @@ -1419,6 +1687,30 @@ type ListWalletsParams struct { Offset *int64 `form:"offset,omitempty" json:"offset,omitempty"` } +// ListWalletAdminOperationsParams defines parameters for ListWalletAdminOperations. +type ListWalletAdminOperationsParams struct { + // Limit Maximum number of administrative operations to return + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Number of administrative operations to skip for pagination + Offset *int64 `form:"offset,omitempty" json:"offset,omitempty"` +} + +// ListWalletUpgradesParams defines parameters for ListWalletUpgrades. +type ListWalletUpgradesParams struct { + // Limit Maximum number of upgrades to return + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Number of upgrades to skip for pagination + Offset *int64 `form:"offset,omitempty" json:"offset,omitempty"` + + // Source Filter upgrades by source + Source *WalletVersionChangeSource `form:"source,omitempty" json:"source,omitempty"` + + // Outcome Filter upgrades by outcome + Outcome *WalletUpgradeOutcome `form:"outcome,omitempty" json:"outcome,omitempty"` +} + // CreateChannelJSONRequestBody defines body for CreateChannel for application/json ContentType. type CreateChannelJSONRequestBody = CreateChannel @@ -1446,6 +1738,12 @@ type CreateWalletJSONRequestBody = CreateWallet // UpdateWalletJSONRequestBody defines body for UpdateWallet for application/json ContentType. type UpdateWalletJSONRequestBody = UpdateWallet +// CreateWalletAdminOperationJSONRequestBody defines body for CreateWalletAdminOperation for application/json ContentType. +type CreateWalletAdminOperationJSONRequestBody = CreateWalletAdminOperation + +// CreateWalletUpgradeJSONRequestBody defines body for CreateWalletUpgrade for application/json ContentType. +type CreateWalletUpgradeJSONRequestBody = CreateWalletUpgrade + // Getter for additional properties for GenericProofObject. Returns the specified // element and whether it was found func (a GenericProofObject) Get(fieldName string) (value interface{}, found bool) { @@ -2133,6 +2431,12 @@ type ClientInterface interface { // ListNetworks request ListNetworks(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListWalletTypeVersions request + ListWalletTypeVersions(ctx context.Context, walletType WalletType, params *ListWalletTypeVersionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetWalletTypeVersion request + GetWalletTypeVersion(ctx context.Context, walletType WalletType, implementationVersion string, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListWallets request ListWallets(ctx context.Context, params *ListWalletsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -2148,6 +2452,28 @@ type ClientInterface interface { UpdateWalletWithBody(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) UpdateWallet(ctx context.Context, walletId openapi_types.UUID, body UpdateWalletJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListWalletAdminOperations request + ListWalletAdminOperations(ctx context.Context, walletId openapi_types.UUID, params *ListWalletAdminOperationsParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateWalletAdminOperationWithBody request with any body + CreateWalletAdminOperationWithBody(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateWalletAdminOperation(ctx context.Context, walletId openapi_types.UUID, body CreateWalletAdminOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetWalletAdminOperation request + GetWalletAdminOperation(ctx context.Context, walletId openapi_types.UUID, adminOperationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListWalletUpgrades request + ListWalletUpgrades(ctx context.Context, walletId openapi_types.UUID, params *ListWalletUpgradesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // CreateWalletUpgradeWithBody request with any body + CreateWalletUpgradeWithBody(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreateWalletUpgrade(ctx context.Context, walletId openapi_types.UUID, body CreateWalletUpgradeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetWalletUpgrade request + GetWalletUpgrade(ctx context.Context, walletId openapi_types.UUID, upgradeId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) } func (c *Client) ListChannels(ctx context.Context, params *ListChannelsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { @@ -2474,6 +2800,30 @@ func (c *Client) ListNetworks(ctx context.Context, reqEditors ...RequestEditorFn return c.Client.Do(req) } +func (c *Client) ListWalletTypeVersions(ctx context.Context, walletType WalletType, params *ListWalletTypeVersionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListWalletTypeVersionsRequest(c.Server, walletType, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetWalletTypeVersion(ctx context.Context, walletType WalletType, implementationVersion string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetWalletTypeVersionRequest(c.Server, walletType, implementationVersion) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) ListWallets(ctx context.Context, params *ListWalletsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListWalletsRequest(c.Server, params) if err != nil { @@ -2546,6 +2896,102 @@ func (c *Client) UpdateWallet(ctx context.Context, walletId openapi_types.UUID, return c.Client.Do(req) } +func (c *Client) ListWalletAdminOperations(ctx context.Context, walletId openapi_types.UUID, params *ListWalletAdminOperationsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListWalletAdminOperationsRequest(c.Server, walletId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateWalletAdminOperationWithBody(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateWalletAdminOperationRequestWithBody(c.Server, walletId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateWalletAdminOperation(ctx context.Context, walletId openapi_types.UUID, body CreateWalletAdminOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateWalletAdminOperationRequest(c.Server, walletId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetWalletAdminOperation(ctx context.Context, walletId openapi_types.UUID, adminOperationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetWalletAdminOperationRequest(c.Server, walletId, adminOperationId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListWalletUpgrades(ctx context.Context, walletId openapi_types.UUID, params *ListWalletUpgradesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListWalletUpgradesRequest(c.Server, walletId, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateWalletUpgradeWithBody(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateWalletUpgradeRequestWithBody(c.Server, walletId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreateWalletUpgrade(ctx context.Context, walletId openapi_types.UUID, body CreateWalletUpgradeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreateWalletUpgradeRequest(c.Server, walletId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) GetWalletUpgrade(ctx context.Context, walletId openapi_types.UUID, upgradeId openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetWalletUpgradeRequest(c.Server, walletId, upgradeId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + // NewListChannelsRequest generates requests for ListChannels func NewListChannelsRequest(server string, params *ListChannelsParams) (*http.Request, error) { var err error @@ -4199,16 +4645,23 @@ func NewListNetworksRequest(server string) (*http.Request, error) { return req, nil } -// NewListWalletsRequest generates requests for ListWallets -func NewListWalletsRequest(server string, params *ListWalletsParams) (*http.Request, error) { +// NewListWalletTypeVersionsRequest generates requests for ListWalletTypeVersions +func NewListWalletTypeVersionsRequest(server string, walletType WalletType, params *ListWalletTypeVersionsParams) (*http.Request, error) { var err error + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "wallet_type", runtime.ParamLocationPath, walletType) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/wallets") + operationPath := fmt.Sprintf("/wallet-types/%s/versions", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -4221,9 +4674,9 @@ func NewListWalletsRequest(server string, params *ListWalletsParams) (*http.Requ if params != nil { queryValues := queryURL.Query() - if params.Name != nil { + if params.ChainSelector != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, *params.Name); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "chain_selector", runtime.ParamLocationQuery, *params.ChainSelector); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -4237,9 +4690,9 @@ func NewListWalletsRequest(server string, params *ListWalletsParams) (*http.Requ } - if params.ChainSelector != nil { + if params.Status != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "chain_selector", runtime.ParamLocationQuery, *params.ChainSelector); err != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "status", runtime.ParamLocationQuery, *params.Status); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { return nil, err @@ -4253,8 +4706,114 @@ func NewListWalletsRequest(server string, params *ListWalletsParams) (*http.Requ } - if params.Owner != nil { - + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetWalletTypeVersionRequest generates requests for GetWalletTypeVersion +func NewGetWalletTypeVersionRequest(server string, walletType WalletType, implementationVersion string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "wallet_type", runtime.ParamLocationPath, walletType) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "implementation_version", runtime.ParamLocationPath, implementationVersion) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/wallet-types/%s/versions/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListWalletsRequest generates requests for ListWallets +func NewListWalletsRequest(server string, params *ListWalletsParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/wallets") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Name != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name", runtime.ParamLocationQuery, *params.Name); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ChainSelector != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "chain_selector", runtime.ParamLocationQuery, *params.ChainSelector); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Owner != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "owner", runtime.ParamLocationQuery, *params.Owner); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -4317,6 +4876,22 @@ func NewListWalletsRequest(server string, params *ListWalletsParams) (*http.Requ } + if params.ImplementationVersion != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "implementation_version", runtime.ParamLocationQuery, *params.ImplementationVersion); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + if params.ChainEnvironment != nil { if queryFrag, err := runtime.StyleParamWithLocation("form", true, "chain_environment", runtime.ParamLocationQuery, *params.ChainEnvironment); err != nil { @@ -4497,151 +5072,906 @@ func NewUpdateWalletRequestWithBody(server string, walletId openapi_types.UUID, return req, nil } -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } - } - return nil -} +// NewListWalletAdminOperationsRequest generates requests for ListWalletAdminOperations +func NewListWalletAdminOperationsRequest(server string, walletId openapi_types.UUID, params *ListWalletAdminOperationsParams) (*http.Request, error) { + var err error -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} + var pathParam0 string -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "wallet_id", runtime.ParamLocationPath, walletId) if err != nil { return nil, err } - return &ClientWithResponses{client}, nil -} -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } -} - -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // ListChannelsWithResponse request - ListChannelsWithResponse(ctx context.Context, params *ListChannelsParams, reqEditors ...RequestEditorFn) (*ListChannelsResponse, error) - // CreateChannelWithBodyWithResponse request with any body - CreateChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) + operationPath := fmt.Sprintf("/wallets/%s/admin-operations", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - CreateChannelWithResponse(ctx context.Context, body CreateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // GetChannelWithResponse request - GetChannelWithResponse(ctx context.Context, channelId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetChannelResponse, error) + if params != nil { + queryValues := queryURL.Query() - // UpdateChannelWithBodyWithResponse request with any body - UpdateChannelWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) + if params.Limit != nil { - UpdateChannelWithResponse(ctx context.Context, channelId openapi_types.UUID, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // ListChannelEventsWithResponse request - ListChannelEventsWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListChannelEventsParams, reqEditors ...RequestEditorFn) (*ListChannelEventsResponse, error) + } - // SearchChannelEventsWithResponse request - SearchChannelEventsWithResponse(ctx context.Context, channelId openapi_types.UUID, params *SearchChannelEventsParams, reqEditors ...RequestEditorFn) (*SearchChannelEventsResponse, error) + if params.Offset != nil { - // GetChannelEventWithResponse request - GetChannelEventWithResponse(ctx context.Context, channelId openapi_types.UUID, eventId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetChannelEventResponse, error) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - // ListOperationsWithResponse request - ListOperationsWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListOperationsParams, reqEditors ...RequestEditorFn) (*ListOperationsResponse, error) + } - // CreateOperationWithBodyWithResponse request with any body - CreateOperationWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOperationResponse, error) + queryURL.RawQuery = queryValues.Encode() + } - CreateOperationWithResponse(ctx context.Context, channelId openapi_types.UUID, body CreateOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOperationResponse, error) + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } - // GetOperationWithResponse request - GetOperationWithResponse(ctx context.Context, channelId openapi_types.UUID, operationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetOperationResponse, error) + return req, nil +} - // FinalizeOrCancelOperationWithBodyWithResponse request with any body - FinalizeOrCancelOperationWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, operationId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinalizeOrCancelOperationResponse, error) +// NewCreateWalletAdminOperationRequest calls the generic CreateWalletAdminOperation builder with application/json body +func NewCreateWalletAdminOperationRequest(server string, walletId openapi_types.UUID, body CreateWalletAdminOperationJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateWalletAdminOperationRequestWithBody(server, walletId, "application/json", bodyReader) +} - FinalizeOrCancelOperationWithResponse(ctx context.Context, channelId openapi_types.UUID, operationId openapi_types.UUID, body FinalizeOrCancelOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*FinalizeOrCancelOperationResponse, error) +// NewCreateWalletAdminOperationRequestWithBody generates requests for CreateWalletAdminOperation with any type of body +func NewCreateWalletAdminOperationRequestWithBody(server string, walletId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { + var err error - // ListQueriesWithResponse request - ListQueriesWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListQueriesParams, reqEditors ...RequestEditorFn) (*ListQueriesResponse, error) + var pathParam0 string - // CreateQueryWithBodyWithResponse request with any body - CreateQueryWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateQueryResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "wallet_id", runtime.ParamLocationPath, walletId) + if err != nil { + return nil, err + } - CreateQueryWithResponse(ctx context.Context, channelId openapi_types.UUID, body CreateQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateQueryResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - // GetQueryWithResponse request - GetQueryWithResponse(ctx context.Context, channelId openapi_types.UUID, queryId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetQueryResponse, error) + operationPath := fmt.Sprintf("/wallets/%s/admin-operations", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // ListWatchersWithResponse request + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetWalletAdminOperationRequest generates requests for GetWalletAdminOperation +func NewGetWalletAdminOperationRequest(server string, walletId openapi_types.UUID, adminOperationId openapi_types.UUID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "wallet_id", runtime.ParamLocationPath, walletId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "admin_operation_id", runtime.ParamLocationPath, adminOperationId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/wallets/%s/admin-operations/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewListWalletUpgradesRequest generates requests for ListWalletUpgrades +func NewListWalletUpgradesRequest(server string, walletId openapi_types.UUID, params *ListWalletUpgradesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "wallet_id", runtime.ParamLocationPath, walletId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/wallets/%s/upgrades", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Source != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "source", runtime.ParamLocationQuery, *params.Source); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Outcome != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "outcome", runtime.ParamLocationQuery, *params.Outcome); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateWalletUpgradeRequest calls the generic CreateWalletUpgrade builder with application/json body +func NewCreateWalletUpgradeRequest(server string, walletId openapi_types.UUID, body CreateWalletUpgradeJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreateWalletUpgradeRequestWithBody(server, walletId, "application/json", bodyReader) +} + +// NewCreateWalletUpgradeRequestWithBody generates requests for CreateWalletUpgrade with any type of body +func NewCreateWalletUpgradeRequestWithBody(server string, walletId openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "wallet_id", runtime.ParamLocationPath, walletId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/wallets/%s/upgrades", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetWalletUpgradeRequest generates requests for GetWalletUpgrade +func NewGetWalletUpgradeRequest(server string, walletId openapi_types.UUID, upgradeId openapi_types.UUID) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "wallet_id", runtime.ParamLocationPath, walletId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "upgrade_id", runtime.ParamLocationPath, upgradeId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/wallets/%s/upgrades/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // ListChannelsWithResponse request + ListChannelsWithResponse(ctx context.Context, params *ListChannelsParams, reqEditors ...RequestEditorFn) (*ListChannelsResponse, error) + + // CreateChannelWithBodyWithResponse request with any body + CreateChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) + + CreateChannelWithResponse(ctx context.Context, body CreateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) + + // GetChannelWithResponse request + GetChannelWithResponse(ctx context.Context, channelId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetChannelResponse, error) + + // UpdateChannelWithBodyWithResponse request with any body + UpdateChannelWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) + + UpdateChannelWithResponse(ctx context.Context, channelId openapi_types.UUID, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) + + // ListChannelEventsWithResponse request + ListChannelEventsWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListChannelEventsParams, reqEditors ...RequestEditorFn) (*ListChannelEventsResponse, error) + + // SearchChannelEventsWithResponse request + SearchChannelEventsWithResponse(ctx context.Context, channelId openapi_types.UUID, params *SearchChannelEventsParams, reqEditors ...RequestEditorFn) (*SearchChannelEventsResponse, error) + + // GetChannelEventWithResponse request + GetChannelEventWithResponse(ctx context.Context, channelId openapi_types.UUID, eventId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetChannelEventResponse, error) + + // ListOperationsWithResponse request + ListOperationsWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListOperationsParams, reqEditors ...RequestEditorFn) (*ListOperationsResponse, error) + + // CreateOperationWithBodyWithResponse request with any body + CreateOperationWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOperationResponse, error) + + CreateOperationWithResponse(ctx context.Context, channelId openapi_types.UUID, body CreateOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOperationResponse, error) + + // GetOperationWithResponse request + GetOperationWithResponse(ctx context.Context, channelId openapi_types.UUID, operationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetOperationResponse, error) + + // FinalizeOrCancelOperationWithBodyWithResponse request with any body + FinalizeOrCancelOperationWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, operationId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinalizeOrCancelOperationResponse, error) + + FinalizeOrCancelOperationWithResponse(ctx context.Context, channelId openapi_types.UUID, operationId openapi_types.UUID, body FinalizeOrCancelOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*FinalizeOrCancelOperationResponse, error) + + // ListQueriesWithResponse request + ListQueriesWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListQueriesParams, reqEditors ...RequestEditorFn) (*ListQueriesResponse, error) + + // CreateQueryWithBodyWithResponse request with any body + CreateQueryWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateQueryResponse, error) + + CreateQueryWithResponse(ctx context.Context, channelId openapi_types.UUID, body CreateQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateQueryResponse, error) + + // GetQueryWithResponse request + GetQueryWithResponse(ctx context.Context, channelId openapi_types.UUID, queryId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetQueryResponse, error) + + // ListWatchersWithResponse request ListWatchersWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListWatchersParams, reqEditors ...RequestEditorFn) (*ListWatchersResponse, error) - // CreateWatcherWithBodyWithResponse request with any body - CreateWatcherWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWatcherResponse, error) + // CreateWatcherWithBodyWithResponse request with any body + CreateWatcherWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWatcherResponse, error) + + CreateWatcherWithResponse(ctx context.Context, channelId openapi_types.UUID, body CreateWatcherJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWatcherResponse, error) + + // GetWatcherWithResponse request + GetWatcherWithResponse(ctx context.Context, channelId openapi_types.UUID, watcherId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWatcherResponse, error) + + // UpdateWatcherWithBodyWithResponse request with any body + UpdateWatcherWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, watcherId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWatcherResponse, error) + + UpdateWatcherWithResponse(ctx context.Context, channelId openapi_types.UUID, watcherId openapi_types.UUID, body UpdateWatcherJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWatcherResponse, error) + + // GetHealthCheckWithResponse request + GetHealthCheckWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthCheckResponse, error) + + // ListNetworksWithResponse request + ListNetworksWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListNetworksResponse, error) + + // ListWalletTypeVersionsWithResponse request + ListWalletTypeVersionsWithResponse(ctx context.Context, walletType WalletType, params *ListWalletTypeVersionsParams, reqEditors ...RequestEditorFn) (*ListWalletTypeVersionsResponse, error) + + // GetWalletTypeVersionWithResponse request + GetWalletTypeVersionWithResponse(ctx context.Context, walletType WalletType, implementationVersion string, reqEditors ...RequestEditorFn) (*GetWalletTypeVersionResponse, error) + + // ListWalletsWithResponse request + ListWalletsWithResponse(ctx context.Context, params *ListWalletsParams, reqEditors ...RequestEditorFn) (*ListWalletsResponse, error) + + // CreateWalletWithBodyWithResponse request with any body + CreateWalletWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWalletResponse, error) + + CreateWalletWithResponse(ctx context.Context, body CreateWalletJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWalletResponse, error) + + // GetWalletWithResponse request + GetWalletWithResponse(ctx context.Context, walletId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWalletResponse, error) + + // UpdateWalletWithBodyWithResponse request with any body + UpdateWalletWithBodyWithResponse(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWalletResponse, error) + + UpdateWalletWithResponse(ctx context.Context, walletId openapi_types.UUID, body UpdateWalletJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWalletResponse, error) + + // ListWalletAdminOperationsWithResponse request + ListWalletAdminOperationsWithResponse(ctx context.Context, walletId openapi_types.UUID, params *ListWalletAdminOperationsParams, reqEditors ...RequestEditorFn) (*ListWalletAdminOperationsResponse, error) + + // CreateWalletAdminOperationWithBodyWithResponse request with any body + CreateWalletAdminOperationWithBodyWithResponse(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWalletAdminOperationResponse, error) + + CreateWalletAdminOperationWithResponse(ctx context.Context, walletId openapi_types.UUID, body CreateWalletAdminOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWalletAdminOperationResponse, error) + + // GetWalletAdminOperationWithResponse request + GetWalletAdminOperationWithResponse(ctx context.Context, walletId openapi_types.UUID, adminOperationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWalletAdminOperationResponse, error) + + // ListWalletUpgradesWithResponse request + ListWalletUpgradesWithResponse(ctx context.Context, walletId openapi_types.UUID, params *ListWalletUpgradesParams, reqEditors ...RequestEditorFn) (*ListWalletUpgradesResponse, error) + + // CreateWalletUpgradeWithBodyWithResponse request with any body + CreateWalletUpgradeWithBodyWithResponse(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWalletUpgradeResponse, error) + + CreateWalletUpgradeWithResponse(ctx context.Context, walletId openapi_types.UUID, body CreateWalletUpgradeJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWalletUpgradeResponse, error) + + // GetWalletUpgradeWithResponse request + GetWalletUpgradeWithResponse(ctx context.Context, walletId openapi_types.UUID, upgradeId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWalletUpgradeResponse, error) +} + +type ListChannelsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ChannelList + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON500 *ApplicationError +} + +// Status returns HTTPResponse.Status +func (r ListChannelsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListChannelsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateChannelResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *Channel + JSON400 *ApplicationError + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON409 *ApplicationError + JSON500 *ApplicationError +} + +// Status returns HTTPResponse.Status +func (r CreateChannelResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateChannelResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetChannelResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Channel + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON404 *ApplicationError + JSON500 *ApplicationError +} + +// Status returns HTTPResponse.Status +func (r GetChannelResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetChannelResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateChannelResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Channel + JSON400 *ApplicationError + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON404 *ApplicationError + JSON409 *ApplicationError + JSON500 *ApplicationError +} + +// Status returns HTTPResponse.Status +func (r UpdateChannelResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateChannelResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListChannelEventsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EventList + JSON400 *ApplicationError + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON404 *ApplicationError + JSON500 *ApplicationError +} + +// Status returns HTTPResponse.Status +func (r ListChannelEventsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - CreateWatcherWithResponse(ctx context.Context, channelId openapi_types.UUID, body CreateWatcherJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWatcherResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r ListChannelEventsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // GetWatcherWithResponse request - GetWatcherWithResponse(ctx context.Context, channelId openapi_types.UUID, watcherId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWatcherResponse, error) +type SearchChannelEventsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EventList + JSON400 *ApplicationError + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON404 *ApplicationError + JSON500 *ApplicationError +} - // UpdateWatcherWithBodyWithResponse request with any body - UpdateWatcherWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, watcherId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWatcherResponse, error) +// Status returns HTTPResponse.Status +func (r SearchChannelEventsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - UpdateWatcherWithResponse(ctx context.Context, channelId openapi_types.UUID, watcherId openapi_types.UUID, body UpdateWatcherJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWatcherResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r SearchChannelEventsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // GetHealthCheckWithResponse request - GetHealthCheckWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthCheckResponse, error) +type GetChannelEventResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Event + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON404 *ApplicationError + JSON500 *ApplicationError +} - // ListNetworksWithResponse request - ListNetworksWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListNetworksResponse, error) +// Status returns HTTPResponse.Status +func (r GetChannelEventResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // ListWalletsWithResponse request - ListWalletsWithResponse(ctx context.Context, params *ListWalletsParams, reqEditors ...RequestEditorFn) (*ListWalletsResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r GetChannelEventResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // CreateWalletWithBodyWithResponse request with any body - CreateWalletWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWalletResponse, error) +type ListOperationsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *OperationList + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON404 *ApplicationError + JSON500 *ApplicationError +} - CreateWalletWithResponse(ctx context.Context, body CreateWalletJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWalletResponse, error) +// Status returns HTTPResponse.Status +func (r ListOperationsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // GetWalletWithResponse request - GetWalletWithResponse(ctx context.Context, walletId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWalletResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r ListOperationsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateOperationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON201 *OperationResponse + JSON400 *ApplicationError + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON404 *ApplicationError + JSON409 *ApplicationError + JSON500 *ApplicationError +} + +// Status returns HTTPResponse.Status +func (r CreateOperationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateOperationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetOperationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Operation + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON404 *ApplicationError + JSON500 *ApplicationError +} + +// Status returns HTTPResponse.Status +func (r GetOperationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetOperationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type FinalizeOrCancelOperationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Operation + JSON400 *ApplicationError + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON404 *ApplicationError + JSON409 *ApplicationError +} + +// Status returns HTTPResponse.Status +func (r FinalizeOrCancelOperationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r FinalizeOrCancelOperationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListQueriesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *QueryList + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON404 *ApplicationError + JSON500 *ApplicationError +} + +// Status returns HTTPResponse.Status +func (r ListQueriesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListQueriesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateQueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON202 *QueryAcceptedResponse + JSON400 *ApplicationError + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON404 *ApplicationError + JSON409 *ApplicationError + JSON429 *ApplicationError + JSON500 *ApplicationError +} + +// Status returns HTTPResponse.Status +func (r CreateQueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateQueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetQueryResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Query + JSON401 *OrganizationNotFound + JSON403 *PermissionDenied + JSON404 *ApplicationError + JSON500 *ApplicationError +} - // UpdateWalletWithBodyWithResponse request with any body - UpdateWalletWithBodyWithResponse(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWalletResponse, error) +// Status returns HTTPResponse.Status +func (r GetQueryResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - UpdateWalletWithResponse(ctx context.Context, walletId openapi_types.UUID, body UpdateWalletJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWalletResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r GetQueryResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 } -type ListChannelsResponse struct { +type ListWatchersResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ChannelList + JSON200 *WatcherList JSON401 *OrganizationNotFound JSON403 *PermissionDenied + JSON404 *ApplicationError JSON500 *ApplicationError } // Status returns HTTPResponse.Status -func (r ListChannelsResponse) Status() string { +func (r ListWatchersResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4649,26 +5979,27 @@ func (r ListChannelsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListChannelsResponse) StatusCode() int { +func (r ListWatchersResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateChannelResponse struct { +type CreateWatcherResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *Channel + JSON201 *Watcher JSON400 *ApplicationError JSON401 *OrganizationNotFound JSON403 *PermissionDenied + JSON404 *ApplicationError JSON409 *ApplicationError JSON500 *ApplicationError } // Status returns HTTPResponse.Status -func (r CreateChannelResponse) Status() string { +func (r CreateWatcherResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4676,17 +6007,17 @@ func (r CreateChannelResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateChannelResponse) StatusCode() int { +func (r CreateWatcherResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetChannelResponse struct { +type GetWatcherResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Channel + JSON200 *Watcher JSON401 *OrganizationNotFound JSON403 *PermissionDenied JSON404 *ApplicationError @@ -4694,7 +6025,7 @@ type GetChannelResponse struct { } // Status returns HTTPResponse.Status -func (r GetChannelResponse) Status() string { +func (r GetWatcherResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4702,17 +6033,18 @@ func (r GetChannelResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetChannelResponse) StatusCode() int { +func (r GetWatcherResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateChannelResponse struct { +type UpdateWatcherResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Channel + JSON200 *Watcher + JSON202 *Watcher JSON400 *ApplicationError JSON401 *OrganizationNotFound JSON403 *PermissionDenied @@ -4722,7 +6054,7 @@ type UpdateChannelResponse struct { } // Status returns HTTPResponse.Status -func (r UpdateChannelResponse) Status() string { +func (r UpdateWatcherResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4730,26 +6062,46 @@ func (r UpdateChannelResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateChannelResponse) StatusCode() int { +func (r UpdateWatcherResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListChannelEventsResponse struct { +type GetHealthCheckResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *EventList - JSON400 *ApplicationError + JSON200 *HealthCheck +} + +// Status returns HTTPResponse.Status +func (r GetHealthCheckResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetHealthCheckResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListNetworksResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *NetworkList JSON401 *OrganizationNotFound JSON403 *PermissionDenied - JSON404 *ApplicationError JSON500 *ApplicationError } // Status returns HTTPResponse.Status -func (r ListChannelEventsResponse) Status() string { +func (r ListNetworksResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4757,18 +6109,17 @@ func (r ListChannelEventsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListChannelEventsResponse) StatusCode() int { +func (r ListNetworksResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type SearchChannelEventsResponse struct { +type ListWalletTypeVersionsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *EventList - JSON400 *ApplicationError + JSON200 *WalletTypeVersionList JSON401 *OrganizationNotFound JSON403 *PermissionDenied JSON404 *ApplicationError @@ -4776,7 +6127,7 @@ type SearchChannelEventsResponse struct { } // Status returns HTTPResponse.Status -func (r SearchChannelEventsResponse) Status() string { +func (r ListWalletTypeVersionsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4784,17 +6135,17 @@ func (r SearchChannelEventsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r SearchChannelEventsResponse) StatusCode() int { +func (r ListWalletTypeVersionsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetChannelEventResponse struct { +type GetWalletTypeVersionResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Event + JSON200 *WalletTypeVersion JSON401 *OrganizationNotFound JSON403 *PermissionDenied JSON404 *ApplicationError @@ -4802,7 +6153,7 @@ type GetChannelEventResponse struct { } // Status returns HTTPResponse.Status -func (r GetChannelEventResponse) Status() string { +func (r GetWalletTypeVersionResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4810,25 +6161,24 @@ func (r GetChannelEventResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetChannelEventResponse) StatusCode() int { +func (r GetWalletTypeVersionResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListOperationsResponse struct { +type ListWalletsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *OperationList + JSON200 *WalletList JSON401 *OrganizationNotFound JSON403 *PermissionDenied - JSON404 *ApplicationError JSON500 *ApplicationError } // Status returns HTTPResponse.Status -func (r ListOperationsResponse) Status() string { +func (r ListWalletsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4836,27 +6186,26 @@ func (r ListOperationsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListOperationsResponse) StatusCode() int { +func (r ListWalletsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateOperationResponse struct { +type CreateWalletResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *OperationResponse + JSON201 *Wallet JSON400 *ApplicationError JSON401 *OrganizationNotFound JSON403 *PermissionDenied - JSON404 *ApplicationError JSON409 *ApplicationError JSON500 *ApplicationError } // Status returns HTTPResponse.Status -func (r CreateOperationResponse) Status() string { +func (r CreateWalletResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4864,17 +6213,17 @@ func (r CreateOperationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateOperationResponse) StatusCode() int { +func (r CreateWalletResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetOperationResponse struct { +type GetWalletResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Operation + JSON200 *Wallet JSON401 *OrganizationNotFound JSON403 *PermissionDenied JSON404 *ApplicationError @@ -4882,7 +6231,7 @@ type GetOperationResponse struct { } // Status returns HTTPResponse.Status -func (r GetOperationResponse) Status() string { +func (r GetWalletResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4890,26 +6239,27 @@ func (r GetOperationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetOperationResponse) StatusCode() int { +func (r GetWalletResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type FinalizeOrCancelOperationResponse struct { +type UpdateWalletResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Operation + JSON200 *Wallet JSON400 *ApplicationError JSON401 *OrganizationNotFound JSON403 *PermissionDenied JSON404 *ApplicationError JSON409 *ApplicationError + JSON500 *ApplicationError } // Status returns HTTPResponse.Status -func (r FinalizeOrCancelOperationResponse) Status() string { +func (r UpdateWalletResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4917,17 +6267,17 @@ func (r FinalizeOrCancelOperationResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r FinalizeOrCancelOperationResponse) StatusCode() int { +func (r UpdateWalletResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListQueriesResponse struct { +type ListWalletAdminOperationsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *QueryList + JSON200 *WalletAdminOperationList JSON401 *OrganizationNotFound JSON403 *PermissionDenied JSON404 *ApplicationError @@ -4935,7 +6285,7 @@ type ListQueriesResponse struct { } // Status returns HTTPResponse.Status -func (r ListQueriesResponse) Status() string { +func (r ListWalletAdminOperationsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4943,28 +6293,27 @@ func (r ListQueriesResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListQueriesResponse) StatusCode() int { +func (r ListWalletAdminOperationsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateQueryResponse struct { +type CreateWalletAdminOperationResponse struct { Body []byte HTTPResponse *http.Response - JSON202 *QueryAcceptedResponse + JSON202 *WalletAdminOperation JSON400 *ApplicationError JSON401 *OrganizationNotFound JSON403 *PermissionDenied JSON404 *ApplicationError JSON409 *ApplicationError - JSON429 *ApplicationError JSON500 *ApplicationError } // Status returns HTTPResponse.Status -func (r CreateQueryResponse) Status() string { +func (r CreateWalletAdminOperationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4972,17 +6321,17 @@ func (r CreateQueryResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateQueryResponse) StatusCode() int { +func (r CreateWalletAdminOperationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetQueryResponse struct { +type GetWalletAdminOperationResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Query + JSON200 *WalletAdminOperation JSON401 *OrganizationNotFound JSON403 *PermissionDenied JSON404 *ApplicationError @@ -4990,7 +6339,7 @@ type GetQueryResponse struct { } // Status returns HTTPResponse.Status -func (r GetQueryResponse) Status() string { +func (r GetWalletAdminOperationResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -4998,17 +6347,17 @@ func (r GetQueryResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetQueryResponse) StatusCode() int { +func (r GetWalletAdminOperationResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListWatchersResponse struct { +type ListWalletUpgradesResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *WatcherList + JSON200 *WalletUpgradeList JSON401 *OrganizationNotFound JSON403 *PermissionDenied JSON404 *ApplicationError @@ -5016,7 +6365,7 @@ type ListWatchersResponse struct { } // Status returns HTTPResponse.Status -func (r ListWatchersResponse) Status() string { +func (r ListWalletUpgradesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5024,17 +6373,17 @@ func (r ListWatchersResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListWatchersResponse) StatusCode() int { +func (r ListWalletUpgradesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateWatcherResponse struct { +type CreateWalletUpgradeResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *Watcher + JSON202 *WalletUpgrade JSON400 *ApplicationError JSON401 *OrganizationNotFound JSON403 *PermissionDenied @@ -5044,7 +6393,7 @@ type CreateWatcherResponse struct { } // Status returns HTTPResponse.Status -func (r CreateWatcherResponse) Status() string { +func (r CreateWalletUpgradeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5052,17 +6401,17 @@ func (r CreateWatcherResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateWatcherResponse) StatusCode() int { +func (r CreateWalletUpgradeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetWatcherResponse struct { +type GetWalletUpgradeResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Watcher + JSON200 *WalletUpgrade JSON401 *OrganizationNotFound JSON403 *PermissionDenied JSON404 *ApplicationError @@ -5070,7 +6419,7 @@ type GetWatcherResponse struct { } // Status returns HTTPResponse.Status -func (r GetWatcherResponse) Status() string { +func (r GetWalletUpgradeResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -5078,499 +6427,811 @@ func (r GetWatcherResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetWatcherResponse) StatusCode() int { +func (r GetWalletUpgradeResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateWatcherResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Watcher - JSON202 *Watcher - JSON400 *ApplicationError - JSON401 *OrganizationNotFound - JSON403 *PermissionDenied - JSON404 *ApplicationError - JSON409 *ApplicationError - JSON500 *ApplicationError +// ListChannelsWithResponse request returning *ListChannelsResponse +func (c *ClientWithResponses) ListChannelsWithResponse(ctx context.Context, params *ListChannelsParams, reqEditors ...RequestEditorFn) (*ListChannelsResponse, error) { + rsp, err := c.ListChannels(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListChannelsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r UpdateWatcherResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// CreateChannelWithBodyWithResponse request with arbitrary body returning *CreateChannelResponse +func (c *ClientWithResponses) CreateChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) { + rsp, err := c.CreateChannelWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateChannelResponse(rsp) +} + +func (c *ClientWithResponses) CreateChannelWithResponse(ctx context.Context, body CreateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) { + rsp, err := c.CreateChannel(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateChannelResponse(rsp) +} + +// GetChannelWithResponse request returning *GetChannelResponse +func (c *ClientWithResponses) GetChannelWithResponse(ctx context.Context, channelId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetChannelResponse, error) { + rsp, err := c.GetChannel(ctx, channelId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetChannelResponse(rsp) +} + +// UpdateChannelWithBodyWithResponse request with arbitrary body returning *UpdateChannelResponse +func (c *ClientWithResponses) UpdateChannelWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) { + rsp, err := c.UpdateChannelWithBody(ctx, channelId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateChannelResponse(rsp) +} + +func (c *ClientWithResponses) UpdateChannelWithResponse(ctx context.Context, channelId openapi_types.UUID, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) { + rsp, err := c.UpdateChannel(ctx, channelId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateChannelResponse(rsp) +} + +// ListChannelEventsWithResponse request returning *ListChannelEventsResponse +func (c *ClientWithResponses) ListChannelEventsWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListChannelEventsParams, reqEditors ...RequestEditorFn) (*ListChannelEventsResponse, error) { + rsp, err := c.ListChannelEvents(ctx, channelId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListChannelEventsResponse(rsp) +} + +// SearchChannelEventsWithResponse request returning *SearchChannelEventsResponse +func (c *ClientWithResponses) SearchChannelEventsWithResponse(ctx context.Context, channelId openapi_types.UUID, params *SearchChannelEventsParams, reqEditors ...RequestEditorFn) (*SearchChannelEventsResponse, error) { + rsp, err := c.SearchChannelEvents(ctx, channelId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseSearchChannelEventsResponse(rsp) +} + +// GetChannelEventWithResponse request returning *GetChannelEventResponse +func (c *ClientWithResponses) GetChannelEventWithResponse(ctx context.Context, channelId openapi_types.UUID, eventId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetChannelEventResponse, error) { + rsp, err := c.GetChannelEvent(ctx, channelId, eventId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetChannelEventResponse(rsp) +} + +// ListOperationsWithResponse request returning *ListOperationsResponse +func (c *ClientWithResponses) ListOperationsWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListOperationsParams, reqEditors ...RequestEditorFn) (*ListOperationsResponse, error) { + rsp, err := c.ListOperations(ctx, channelId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListOperationsResponse(rsp) +} + +// CreateOperationWithBodyWithResponse request with arbitrary body returning *CreateOperationResponse +func (c *ClientWithResponses) CreateOperationWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOperationResponse, error) { + rsp, err := c.CreateOperationWithBody(ctx, channelId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreateOperationResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateWatcherResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) CreateOperationWithResponse(ctx context.Context, channelId openapi_types.UUID, body CreateOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOperationResponse, error) { + rsp, err := c.CreateOperation(ctx, channelId, body, reqEditors...) + if err != nil { + return nil, err } - return 0 -} - -type GetHealthCheckResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *HealthCheck + return ParseCreateOperationResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetHealthCheckResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetOperationWithResponse request returning *GetOperationResponse +func (c *ClientWithResponses) GetOperationWithResponse(ctx context.Context, channelId openapi_types.UUID, operationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetOperationResponse, error) { + rsp, err := c.GetOperation(ctx, channelId, operationId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetOperationResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetHealthCheckResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// FinalizeOrCancelOperationWithBodyWithResponse request with arbitrary body returning *FinalizeOrCancelOperationResponse +func (c *ClientWithResponses) FinalizeOrCancelOperationWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, operationId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinalizeOrCancelOperationResponse, error) { + rsp, err := c.FinalizeOrCancelOperationWithBody(ctx, channelId, operationId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseFinalizeOrCancelOperationResponse(rsp) } -type ListNetworksResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *NetworkList - JSON401 *OrganizationNotFound - JSON403 *PermissionDenied - JSON500 *ApplicationError +func (c *ClientWithResponses) FinalizeOrCancelOperationWithResponse(ctx context.Context, channelId openapi_types.UUID, operationId openapi_types.UUID, body FinalizeOrCancelOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*FinalizeOrCancelOperationResponse, error) { + rsp, err := c.FinalizeOrCancelOperation(ctx, channelId, operationId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseFinalizeOrCancelOperationResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListNetworksResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ListQueriesWithResponse request returning *ListQueriesResponse +func (c *ClientWithResponses) ListQueriesWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListQueriesParams, reqEditors ...RequestEditorFn) (*ListQueriesResponse, error) { + rsp, err := c.ListQueries(ctx, channelId, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseListQueriesResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListNetworksResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// CreateQueryWithBodyWithResponse request with arbitrary body returning *CreateQueryResponse +func (c *ClientWithResponses) CreateQueryWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateQueryResponse, error) { + rsp, err := c.CreateQueryWithBody(ctx, channelId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreateQueryResponse(rsp) } -type ListWalletsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *WalletList - JSON401 *OrganizationNotFound - JSON403 *PermissionDenied - JSON500 *ApplicationError +func (c *ClientWithResponses) CreateQueryWithResponse(ctx context.Context, channelId openapi_types.UUID, body CreateQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateQueryResponse, error) { + rsp, err := c.CreateQuery(ctx, channelId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateQueryResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListWalletsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetQueryWithResponse request returning *GetQueryResponse +func (c *ClientWithResponses) GetQueryWithResponse(ctx context.Context, channelId openapi_types.UUID, queryId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetQueryResponse, error) { + rsp, err := c.GetQuery(ctx, channelId, queryId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetQueryResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListWalletsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ListWatchersWithResponse request returning *ListWatchersResponse +func (c *ClientWithResponses) ListWatchersWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListWatchersParams, reqEditors ...RequestEditorFn) (*ListWatchersResponse, error) { + rsp, err := c.ListWatchers(ctx, channelId, params, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseListWatchersResponse(rsp) } -type CreateWalletResponse struct { - Body []byte - HTTPResponse *http.Response - JSON201 *Wallet - JSON400 *ApplicationError - JSON401 *OrganizationNotFound - JSON403 *PermissionDenied - JSON409 *ApplicationError - JSON500 *ApplicationError +// CreateWatcherWithBodyWithResponse request with arbitrary body returning *CreateWatcherResponse +func (c *ClientWithResponses) CreateWatcherWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWatcherResponse, error) { + rsp, err := c.CreateWatcherWithBody(ctx, channelId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateWatcherResponse(rsp) } -// Status returns HTTPResponse.Status -func (r CreateWalletResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) CreateWatcherWithResponse(ctx context.Context, channelId openapi_types.UUID, body CreateWatcherJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWatcherResponse, error) { + rsp, err := c.CreateWatcher(ctx, channelId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreateWatcherResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r CreateWalletResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetWatcherWithResponse request returning *GetWatcherResponse +func (c *ClientWithResponses) GetWatcherWithResponse(ctx context.Context, channelId openapi_types.UUID, watcherId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWatcherResponse, error) { + rsp, err := c.GetWatcher(ctx, channelId, watcherId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetWatcherResponse(rsp) } -type GetWalletResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Wallet - JSON401 *OrganizationNotFound - JSON403 *PermissionDenied - JSON404 *ApplicationError - JSON500 *ApplicationError +// UpdateWatcherWithBodyWithResponse request with arbitrary body returning *UpdateWatcherResponse +func (c *ClientWithResponses) UpdateWatcherWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, watcherId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWatcherResponse, error) { + rsp, err := c.UpdateWatcherWithBody(ctx, channelId, watcherId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateWatcherResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetWalletResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) UpdateWatcherWithResponse(ctx context.Context, channelId openapi_types.UUID, watcherId openapi_types.UUID, body UpdateWatcherJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWatcherResponse, error) { + rsp, err := c.UpdateWatcher(ctx, channelId, watcherId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdateWatcherResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetWalletResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetHealthCheckWithResponse request returning *GetHealthCheckResponse +func (c *ClientWithResponses) GetHealthCheckWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthCheckResponse, error) { + rsp, err := c.GetHealthCheck(ctx, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetHealthCheckResponse(rsp) } -type UpdateWalletResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Wallet - JSON400 *ApplicationError - JSON401 *OrganizationNotFound - JSON403 *PermissionDenied - JSON404 *ApplicationError - JSON409 *ApplicationError - JSON500 *ApplicationError +// ListNetworksWithResponse request returning *ListNetworksResponse +func (c *ClientWithResponses) ListNetworksWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListNetworksResponse, error) { + rsp, err := c.ListNetworks(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseListNetworksResponse(rsp) } -// Status returns HTTPResponse.Status -func (r UpdateWalletResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ListWalletTypeVersionsWithResponse request returning *ListWalletTypeVersionsResponse +func (c *ClientWithResponses) ListWalletTypeVersionsWithResponse(ctx context.Context, walletType WalletType, params *ListWalletTypeVersionsParams, reqEditors ...RequestEditorFn) (*ListWalletTypeVersionsResponse, error) { + rsp, err := c.ListWalletTypeVersions(ctx, walletType, params, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseListWalletTypeVersionsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateWalletResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetWalletTypeVersionWithResponse request returning *GetWalletTypeVersionResponse +func (c *ClientWithResponses) GetWalletTypeVersionWithResponse(ctx context.Context, walletType WalletType, implementationVersion string, reqEditors ...RequestEditorFn) (*GetWalletTypeVersionResponse, error) { + rsp, err := c.GetWalletTypeVersion(ctx, walletType, implementationVersion, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetWalletTypeVersionResponse(rsp) } -// ListChannelsWithResponse request returning *ListChannelsResponse -func (c *ClientWithResponses) ListChannelsWithResponse(ctx context.Context, params *ListChannelsParams, reqEditors ...RequestEditorFn) (*ListChannelsResponse, error) { - rsp, err := c.ListChannels(ctx, params, reqEditors...) +// ListWalletsWithResponse request returning *ListWalletsResponse +func (c *ClientWithResponses) ListWalletsWithResponse(ctx context.Context, params *ListWalletsParams, reqEditors ...RequestEditorFn) (*ListWalletsResponse, error) { + rsp, err := c.ListWallets(ctx, params, reqEditors...) if err != nil { return nil, err } - return ParseListChannelsResponse(rsp) + return ParseListWalletsResponse(rsp) } -// CreateChannelWithBodyWithResponse request with arbitrary body returning *CreateChannelResponse -func (c *ClientWithResponses) CreateChannelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) { - rsp, err := c.CreateChannelWithBody(ctx, contentType, body, reqEditors...) +// CreateWalletWithBodyWithResponse request with arbitrary body returning *CreateWalletResponse +func (c *ClientWithResponses) CreateWalletWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWalletResponse, error) { + rsp, err := c.CreateWalletWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateChannelResponse(rsp) + return ParseCreateWalletResponse(rsp) } -func (c *ClientWithResponses) CreateChannelWithResponse(ctx context.Context, body CreateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateChannelResponse, error) { - rsp, err := c.CreateChannel(ctx, body, reqEditors...) +func (c *ClientWithResponses) CreateWalletWithResponse(ctx context.Context, body CreateWalletJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWalletResponse, error) { + rsp, err := c.CreateWallet(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateChannelResponse(rsp) + return ParseCreateWalletResponse(rsp) } -// GetChannelWithResponse request returning *GetChannelResponse -func (c *ClientWithResponses) GetChannelWithResponse(ctx context.Context, channelId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetChannelResponse, error) { - rsp, err := c.GetChannel(ctx, channelId, reqEditors...) +// GetWalletWithResponse request returning *GetWalletResponse +func (c *ClientWithResponses) GetWalletWithResponse(ctx context.Context, walletId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWalletResponse, error) { + rsp, err := c.GetWallet(ctx, walletId, reqEditors...) if err != nil { return nil, err } - return ParseGetChannelResponse(rsp) + return ParseGetWalletResponse(rsp) } -// UpdateChannelWithBodyWithResponse request with arbitrary body returning *UpdateChannelResponse -func (c *ClientWithResponses) UpdateChannelWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) { - rsp, err := c.UpdateChannelWithBody(ctx, channelId, contentType, body, reqEditors...) +// UpdateWalletWithBodyWithResponse request with arbitrary body returning *UpdateWalletResponse +func (c *ClientWithResponses) UpdateWalletWithBodyWithResponse(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWalletResponse, error) { + rsp, err := c.UpdateWalletWithBody(ctx, walletId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateWalletResponse(rsp) +} + +func (c *ClientWithResponses) UpdateWalletWithResponse(ctx context.Context, walletId openapi_types.UUID, body UpdateWalletJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWalletResponse, error) { + rsp, err := c.UpdateWallet(ctx, walletId, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateChannelResponse(rsp) + return ParseUpdateWalletResponse(rsp) } -func (c *ClientWithResponses) UpdateChannelWithResponse(ctx context.Context, channelId openapi_types.UUID, body UpdateChannelJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateChannelResponse, error) { - rsp, err := c.UpdateChannel(ctx, channelId, body, reqEditors...) +// ListWalletAdminOperationsWithResponse request returning *ListWalletAdminOperationsResponse +func (c *ClientWithResponses) ListWalletAdminOperationsWithResponse(ctx context.Context, walletId openapi_types.UUID, params *ListWalletAdminOperationsParams, reqEditors ...RequestEditorFn) (*ListWalletAdminOperationsResponse, error) { + rsp, err := c.ListWalletAdminOperations(ctx, walletId, params, reqEditors...) if err != nil { return nil, err } - return ParseUpdateChannelResponse(rsp) + return ParseListWalletAdminOperationsResponse(rsp) } -// ListChannelEventsWithResponse request returning *ListChannelEventsResponse -func (c *ClientWithResponses) ListChannelEventsWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListChannelEventsParams, reqEditors ...RequestEditorFn) (*ListChannelEventsResponse, error) { - rsp, err := c.ListChannelEvents(ctx, channelId, params, reqEditors...) +// CreateWalletAdminOperationWithBodyWithResponse request with arbitrary body returning *CreateWalletAdminOperationResponse +func (c *ClientWithResponses) CreateWalletAdminOperationWithBodyWithResponse(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWalletAdminOperationResponse, error) { + rsp, err := c.CreateWalletAdminOperationWithBody(ctx, walletId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseListChannelEventsResponse(rsp) + return ParseCreateWalletAdminOperationResponse(rsp) } -// SearchChannelEventsWithResponse request returning *SearchChannelEventsResponse -func (c *ClientWithResponses) SearchChannelEventsWithResponse(ctx context.Context, channelId openapi_types.UUID, params *SearchChannelEventsParams, reqEditors ...RequestEditorFn) (*SearchChannelEventsResponse, error) { - rsp, err := c.SearchChannelEvents(ctx, channelId, params, reqEditors...) +func (c *ClientWithResponses) CreateWalletAdminOperationWithResponse(ctx context.Context, walletId openapi_types.UUID, body CreateWalletAdminOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWalletAdminOperationResponse, error) { + rsp, err := c.CreateWalletAdminOperation(ctx, walletId, body, reqEditors...) if err != nil { return nil, err } - return ParseSearchChannelEventsResponse(rsp) + return ParseCreateWalletAdminOperationResponse(rsp) } -// GetChannelEventWithResponse request returning *GetChannelEventResponse -func (c *ClientWithResponses) GetChannelEventWithResponse(ctx context.Context, channelId openapi_types.UUID, eventId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetChannelEventResponse, error) { - rsp, err := c.GetChannelEvent(ctx, channelId, eventId, reqEditors...) +// GetWalletAdminOperationWithResponse request returning *GetWalletAdminOperationResponse +func (c *ClientWithResponses) GetWalletAdminOperationWithResponse(ctx context.Context, walletId openapi_types.UUID, adminOperationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWalletAdminOperationResponse, error) { + rsp, err := c.GetWalletAdminOperation(ctx, walletId, adminOperationId, reqEditors...) if err != nil { return nil, err } - return ParseGetChannelEventResponse(rsp) + return ParseGetWalletAdminOperationResponse(rsp) } -// ListOperationsWithResponse request returning *ListOperationsResponse -func (c *ClientWithResponses) ListOperationsWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListOperationsParams, reqEditors ...RequestEditorFn) (*ListOperationsResponse, error) { - rsp, err := c.ListOperations(ctx, channelId, params, reqEditors...) +// ListWalletUpgradesWithResponse request returning *ListWalletUpgradesResponse +func (c *ClientWithResponses) ListWalletUpgradesWithResponse(ctx context.Context, walletId openapi_types.UUID, params *ListWalletUpgradesParams, reqEditors ...RequestEditorFn) (*ListWalletUpgradesResponse, error) { + rsp, err := c.ListWalletUpgrades(ctx, walletId, params, reqEditors...) if err != nil { return nil, err } - return ParseListOperationsResponse(rsp) + return ParseListWalletUpgradesResponse(rsp) } -// CreateOperationWithBodyWithResponse request with arbitrary body returning *CreateOperationResponse -func (c *ClientWithResponses) CreateOperationWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateOperationResponse, error) { - rsp, err := c.CreateOperationWithBody(ctx, channelId, contentType, body, reqEditors...) +// CreateWalletUpgradeWithBodyWithResponse request with arbitrary body returning *CreateWalletUpgradeResponse +func (c *ClientWithResponses) CreateWalletUpgradeWithBodyWithResponse(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWalletUpgradeResponse, error) { + rsp, err := c.CreateWalletUpgradeWithBody(ctx, walletId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateOperationResponse(rsp) + return ParseCreateWalletUpgradeResponse(rsp) } -func (c *ClientWithResponses) CreateOperationWithResponse(ctx context.Context, channelId openapi_types.UUID, body CreateOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateOperationResponse, error) { - rsp, err := c.CreateOperation(ctx, channelId, body, reqEditors...) +func (c *ClientWithResponses) CreateWalletUpgradeWithResponse(ctx context.Context, walletId openapi_types.UUID, body CreateWalletUpgradeJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWalletUpgradeResponse, error) { + rsp, err := c.CreateWalletUpgrade(ctx, walletId, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateOperationResponse(rsp) + return ParseCreateWalletUpgradeResponse(rsp) } -// GetOperationWithResponse request returning *GetOperationResponse -func (c *ClientWithResponses) GetOperationWithResponse(ctx context.Context, channelId openapi_types.UUID, operationId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetOperationResponse, error) { - rsp, err := c.GetOperation(ctx, channelId, operationId, reqEditors...) +// GetWalletUpgradeWithResponse request returning *GetWalletUpgradeResponse +func (c *ClientWithResponses) GetWalletUpgradeWithResponse(ctx context.Context, walletId openapi_types.UUID, upgradeId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWalletUpgradeResponse, error) { + rsp, err := c.GetWalletUpgrade(ctx, walletId, upgradeId, reqEditors...) if err != nil { return nil, err } - return ParseGetOperationResponse(rsp) + return ParseGetWalletUpgradeResponse(rsp) } -// FinalizeOrCancelOperationWithBodyWithResponse request with arbitrary body returning *FinalizeOrCancelOperationResponse -func (c *ClientWithResponses) FinalizeOrCancelOperationWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, operationId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinalizeOrCancelOperationResponse, error) { - rsp, err := c.FinalizeOrCancelOperationWithBody(ctx, channelId, operationId, contentType, body, reqEditors...) +// ParseListChannelsResponse parses an HTTP response from a ListChannelsWithResponse call +func ParseListChannelsResponse(rsp *http.Response) (*ListChannelsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseFinalizeOrCancelOperationResponse(rsp) + + response := &ListChannelsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ChannelList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OrganizationNotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest PermissionDenied + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil } -func (c *ClientWithResponses) FinalizeOrCancelOperationWithResponse(ctx context.Context, channelId openapi_types.UUID, operationId openapi_types.UUID, body FinalizeOrCancelOperationJSONRequestBody, reqEditors ...RequestEditorFn) (*FinalizeOrCancelOperationResponse, error) { - rsp, err := c.FinalizeOrCancelOperation(ctx, channelId, operationId, body, reqEditors...) +// ParseCreateChannelResponse parses an HTTP response from a CreateChannelWithResponse call +func ParseCreateChannelResponse(rsp *http.Response) (*CreateChannelResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseFinalizeOrCancelOperationResponse(rsp) + + response := &CreateChannelResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Channel + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OrganizationNotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest PermissionDenied + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil } -// ListQueriesWithResponse request returning *ListQueriesResponse -func (c *ClientWithResponses) ListQueriesWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListQueriesParams, reqEditors ...RequestEditorFn) (*ListQueriesResponse, error) { - rsp, err := c.ListQueries(ctx, channelId, params, reqEditors...) +// ParseGetChannelResponse parses an HTTP response from a GetChannelWithResponse call +func ParseGetChannelResponse(rsp *http.Response) (*GetChannelResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseListQueriesResponse(rsp) + + response := &GetChannelResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Channel + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OrganizationNotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest PermissionDenied + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil } -// CreateQueryWithBodyWithResponse request with arbitrary body returning *CreateQueryResponse -func (c *ClientWithResponses) CreateQueryWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateQueryResponse, error) { - rsp, err := c.CreateQueryWithBody(ctx, channelId, contentType, body, reqEditors...) +// ParseUpdateChannelResponse parses an HTTP response from a UpdateChannelWithResponse call +func ParseUpdateChannelResponse(rsp *http.Response) (*UpdateChannelResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseCreateQueryResponse(rsp) -} -func (c *ClientWithResponses) CreateQueryWithResponse(ctx context.Context, channelId openapi_types.UUID, body CreateQueryJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateQueryResponse, error) { - rsp, err := c.CreateQuery(ctx, channelId, body, reqEditors...) - if err != nil { - return nil, err + response := &UpdateChannelResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Channel + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OrganizationNotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest PermissionDenied + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseCreateQueryResponse(rsp) -} -// GetQueryWithResponse request returning *GetQueryResponse -func (c *ClientWithResponses) GetQueryWithResponse(ctx context.Context, channelId openapi_types.UUID, queryId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetQueryResponse, error) { - rsp, err := c.GetQuery(ctx, channelId, queryId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetQueryResponse(rsp) + return response, nil } -// ListWatchersWithResponse request returning *ListWatchersResponse -func (c *ClientWithResponses) ListWatchersWithResponse(ctx context.Context, channelId openapi_types.UUID, params *ListWatchersParams, reqEditors ...RequestEditorFn) (*ListWatchersResponse, error) { - rsp, err := c.ListWatchers(ctx, channelId, params, reqEditors...) +// ParseListChannelEventsResponse parses an HTTP response from a ListChannelEventsWithResponse call +func ParseListChannelEventsResponse(rsp *http.Response) (*ListChannelEventsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseListWatchersResponse(rsp) -} -// CreateWatcherWithBodyWithResponse request with arbitrary body returning *CreateWatcherResponse -func (c *ClientWithResponses) CreateWatcherWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWatcherResponse, error) { - rsp, err := c.CreateWatcherWithBody(ctx, channelId, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &ListChannelEventsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseCreateWatcherResponse(rsp) -} -func (c *ClientWithResponses) CreateWatcherWithResponse(ctx context.Context, channelId openapi_types.UUID, body CreateWatcherJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWatcherResponse, error) { - rsp, err := c.CreateWatcher(ctx, channelId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseCreateWatcherResponse(rsp) -} + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest EventList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest -// GetWatcherWithResponse request returning *GetWatcherResponse -func (c *ClientWithResponses) GetWatcherWithResponse(ctx context.Context, channelId openapi_types.UUID, watcherId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWatcherResponse, error) { - rsp, err := c.GetWatcher(ctx, channelId, watcherId, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetWatcherResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest -// UpdateWatcherWithBodyWithResponse request with arbitrary body returning *UpdateWatcherResponse -func (c *ClientWithResponses) UpdateWatcherWithBodyWithResponse(ctx context.Context, channelId openapi_types.UUID, watcherId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWatcherResponse, error) { - rsp, err := c.UpdateWatcherWithBody(ctx, channelId, watcherId, contentType, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateWatcherResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OrganizationNotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest -func (c *ClientWithResponses) UpdateWatcherWithResponse(ctx context.Context, channelId openapi_types.UUID, watcherId openapi_types.UUID, body UpdateWatcherJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWatcherResponse, error) { - rsp, err := c.UpdateWatcher(ctx, channelId, watcherId, body, reqEditors...) - if err != nil { - return nil, err - } - return ParseUpdateWatcherResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest PermissionDenied + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest -// GetHealthCheckWithResponse request returning *GetHealthCheckResponse -func (c *ClientWithResponses) GetHealthCheckWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthCheckResponse, error) { - rsp, err := c.GetHealthCheck(ctx, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetHealthCheckResponse(rsp) -} + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest -// ListNetworksWithResponse request returning *ListNetworksResponse -func (c *ClientWithResponses) ListNetworksWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListNetworksResponse, error) { - rsp, err := c.ListNetworks(ctx, reqEditors...) - if err != nil { - return nil, err } - return ParseListNetworksResponse(rsp) + + return response, nil } -// ListWalletsWithResponse request returning *ListWalletsResponse -func (c *ClientWithResponses) ListWalletsWithResponse(ctx context.Context, params *ListWalletsParams, reqEditors ...RequestEditorFn) (*ListWalletsResponse, error) { - rsp, err := c.ListWallets(ctx, params, reqEditors...) +// ParseSearchChannelEventsResponse parses an HTTP response from a SearchChannelEventsWithResponse call +func ParseSearchChannelEventsResponse(rsp *http.Response) (*SearchChannelEventsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseListWalletsResponse(rsp) -} -// CreateWalletWithBodyWithResponse request with arbitrary body returning *CreateWalletResponse -func (c *ClientWithResponses) CreateWalletWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateWalletResponse, error) { - rsp, err := c.CreateWalletWithBody(ctx, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &SearchChannelEventsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseCreateWalletResponse(rsp) -} -func (c *ClientWithResponses) CreateWalletWithResponse(ctx context.Context, body CreateWalletJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateWalletResponse, error) { - rsp, err := c.CreateWallet(ctx, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest EventList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OrganizationNotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest PermissionDenied + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseCreateWalletResponse(rsp) + + return response, nil } -// GetWalletWithResponse request returning *GetWalletResponse -func (c *ClientWithResponses) GetWalletWithResponse(ctx context.Context, walletId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetWalletResponse, error) { - rsp, err := c.GetWallet(ctx, walletId, reqEditors...) +// ParseGetChannelEventResponse parses an HTTP response from a GetChannelEventWithResponse call +func ParseGetChannelEventResponse(rsp *http.Response) (*GetChannelEventResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetWalletResponse(rsp) -} -// UpdateWalletWithBodyWithResponse request with arbitrary body returning *UpdateWalletResponse -func (c *ClientWithResponses) UpdateWalletWithBodyWithResponse(ctx context.Context, walletId openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateWalletResponse, error) { - rsp, err := c.UpdateWalletWithBody(ctx, walletId, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &GetChannelEventResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdateWalletResponse(rsp) -} -func (c *ClientWithResponses) UpdateWalletWithResponse(ctx context.Context, walletId openapi_types.UUID, body UpdateWalletJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateWalletResponse, error) { - rsp, err := c.UpdateWallet(ctx, walletId, body, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Event + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OrganizationNotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest PermissionDenied + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + } - return ParseUpdateWalletResponse(rsp) + + return response, nil } -// ParseListChannelsResponse parses an HTTP response from a ListChannelsWithResponse call -func ParseListChannelsResponse(rsp *http.Response) (*ListChannelsResponse, error) { +// ParseListOperationsResponse parses an HTTP response from a ListOperationsWithResponse call +func ParseListOperationsResponse(rsp *http.Response) (*ListOperationsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListChannelsResponse{ + response := &ListOperationsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ChannelList + var dest OperationList if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -5590,6 +7251,13 @@ func ParseListChannelsResponse(rsp *http.Response) (*ListChannelsResponse, error } response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5602,22 +7270,22 @@ func ParseListChannelsResponse(rsp *http.Response) (*ListChannelsResponse, error return response, nil } -// ParseCreateChannelResponse parses an HTTP response from a CreateChannelWithResponse call -func ParseCreateChannelResponse(rsp *http.Response) (*CreateChannelResponse, error) { +// ParseCreateOperationResponse parses an HTTP response from a CreateOperationWithResponse call +func ParseCreateOperationResponse(rsp *http.Response) (*CreateOperationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateChannelResponse{ + response := &CreateOperationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Channel + var dest OperationResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -5644,6 +7312,13 @@ func ParseCreateChannelResponse(rsp *http.Response) (*CreateChannelResponse, err } response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5663,22 +7338,22 @@ func ParseCreateChannelResponse(rsp *http.Response) (*CreateChannelResponse, err return response, nil } -// ParseGetChannelResponse parses an HTTP response from a GetChannelWithResponse call -func ParseGetChannelResponse(rsp *http.Response) (*GetChannelResponse, error) { +// ParseGetOperationResponse parses an HTTP response from a GetOperationWithResponse call +func ParseGetOperationResponse(rsp *http.Response) (*GetOperationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetChannelResponse{ + response := &GetOperationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Channel + var dest Operation if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -5717,22 +7392,22 @@ func ParseGetChannelResponse(rsp *http.Response) (*GetChannelResponse, error) { return response, nil } -// ParseUpdateChannelResponse parses an HTTP response from a UpdateChannelWithResponse call -func ParseUpdateChannelResponse(rsp *http.Response) (*UpdateChannelResponse, error) { +// ParseFinalizeOrCancelOperationResponse parses an HTTP response from a FinalizeOrCancelOperationWithResponse call +func ParseFinalizeOrCancelOperationResponse(rsp *http.Response) (*FinalizeOrCancelOperationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateChannelResponse{ + response := &FinalizeOrCancelOperationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Channel + var dest Operation if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -5773,6 +7448,53 @@ func ParseUpdateChannelResponse(rsp *http.Response) (*UpdateChannelResponse, err } response.JSON409 = &dest + } + + return response, nil +} + +// ParseListQueriesResponse parses an HTTP response from a ListQueriesWithResponse call +func ParseListQueriesResponse(rsp *http.Response) (*ListQueriesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListQueriesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest QueryList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OrganizationNotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest PermissionDenied + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5785,26 +7507,26 @@ func ParseUpdateChannelResponse(rsp *http.Response) (*UpdateChannelResponse, err return response, nil } -// ParseListChannelEventsResponse parses an HTTP response from a ListChannelEventsWithResponse call -func ParseListChannelEventsResponse(rsp *http.Response) (*ListChannelEventsResponse, error) { +// ParseCreateQueryResponse parses an HTTP response from a CreateQueryWithResponse call +func ParseCreateQueryResponse(rsp *http.Response) (*CreateQueryResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListChannelEventsResponse{ + response := &CreateQueryResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest EventList + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest QueryAcceptedResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON202 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest ApplicationError @@ -5834,6 +7556,20 @@ func ParseListChannelEventsResponse(rsp *http.Response) (*ListChannelEventsRespo } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5846,33 +7582,80 @@ func ParseListChannelEventsResponse(rsp *http.Response) (*ListChannelEventsRespo return response, nil } -// ParseSearchChannelEventsResponse parses an HTTP response from a SearchChannelEventsWithResponse call -func ParseSearchChannelEventsResponse(rsp *http.Response) (*SearchChannelEventsResponse, error) { +// ParseGetQueryResponse parses an HTTP response from a GetQueryWithResponse call +func ParseGetQueryResponse(rsp *http.Response) (*GetQueryResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &SearchChannelEventsResponse{ + response := &GetQueryResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest EventList + var dest Query if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest OrganizationNotFound + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON401 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest PermissionDenied + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseListWatchersResponse parses an HTTP response from a ListWatchersWithResponse call +func ParseListWatchersResponse(rsp *http.Response) (*ListWatchersResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListWatchersResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest WatcherList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OrganizationNotFound @@ -5907,26 +7690,33 @@ func ParseSearchChannelEventsResponse(rsp *http.Response) (*SearchChannelEventsR return response, nil } -// ParseGetChannelEventResponse parses an HTTP response from a GetChannelEventWithResponse call -func ParseGetChannelEventResponse(rsp *http.Response) (*GetChannelEventResponse, error) { +// ParseCreateWatcherResponse parses an HTTP response from a CreateWatcherWithResponse call +func ParseCreateWatcherResponse(rsp *http.Response) (*CreateWatcherResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetChannelEventResponse{ + response := &CreateWatcherResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Event + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Watcher if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OrganizationNotFound @@ -5949,6 +7739,13 @@ func ParseGetChannelEventResponse(rsp *http.Response) (*GetChannelEventResponse, } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON409 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5961,22 +7758,22 @@ func ParseGetChannelEventResponse(rsp *http.Response) (*GetChannelEventResponse, return response, nil } -// ParseListOperationsResponse parses an HTTP response from a ListOperationsWithResponse call -func ParseListOperationsResponse(rsp *http.Response) (*ListOperationsResponse, error) { +// ParseGetWatcherResponse parses an HTTP response from a GetWatcherWithResponse call +func ParseGetWatcherResponse(rsp *http.Response) (*GetWatcherResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListOperationsResponse{ + response := &GetWatcherResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest OperationList + var dest Watcher if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6015,26 +7812,33 @@ func ParseListOperationsResponse(rsp *http.Response) (*ListOperationsResponse, e return response, nil } -// ParseCreateOperationResponse parses an HTTP response from a CreateOperationWithResponse call -func ParseCreateOperationResponse(rsp *http.Response) (*CreateOperationResponse, error) { +// ParseUpdateWatcherResponse parses an HTTP response from a UpdateWatcherWithResponse call +func ParseUpdateWatcherResponse(rsp *http.Response) (*UpdateWatcherResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateOperationResponse{ + response := &UpdateWatcherResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest OperationResponse + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Watcher if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest Watcher + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON202 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest ApplicationError @@ -6083,22 +7887,48 @@ func ParseCreateOperationResponse(rsp *http.Response) (*CreateOperationResponse, return response, nil } -// ParseGetOperationResponse parses an HTTP response from a GetOperationWithResponse call -func ParseGetOperationResponse(rsp *http.Response) (*GetOperationResponse, error) { +// ParseGetHealthCheckResponse parses an HTTP response from a GetHealthCheckWithResponse call +func ParseGetHealthCheckResponse(rsp *http.Response) (*GetHealthCheckResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetOperationResponse{ + response := &GetHealthCheckResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest HealthCheck + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseListNetworksResponse parses an HTTP response from a ListNetworksWithResponse call +func ParseListNetworksResponse(rsp *http.Response) (*ListNetworksResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListNetworksResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Operation + var dest NetworkList if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6118,13 +7948,6 @@ func ParseGetOperationResponse(rsp *http.Response) (*GetOperationResponse, error } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest ApplicationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6137,34 +7960,27 @@ func ParseGetOperationResponse(rsp *http.Response) (*GetOperationResponse, error return response, nil } -// ParseFinalizeOrCancelOperationResponse parses an HTTP response from a FinalizeOrCancelOperationWithResponse call -func ParseFinalizeOrCancelOperationResponse(rsp *http.Response) (*FinalizeOrCancelOperationResponse, error) { +// ParseListWalletTypeVersionsResponse parses an HTTP response from a ListWalletTypeVersionsWithResponse call +func ParseListWalletTypeVersionsResponse(rsp *http.Response) (*ListWalletTypeVersionsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &FinalizeOrCancelOperationResponse{ + response := &ListWalletTypeVersionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Operation + var dest WalletTypeVersionList if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest ApplicationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OrganizationNotFound if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6186,34 +8002,34 @@ func ParseFinalizeOrCancelOperationResponse(rsp *http.Response) (*FinalizeOrCanc } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON409 = &dest + response.JSON500 = &dest } return response, nil } -// ParseListQueriesResponse parses an HTTP response from a ListQueriesWithResponse call -func ParseListQueriesResponse(rsp *http.Response) (*ListQueriesResponse, error) { +// ParseGetWalletTypeVersionResponse parses an HTTP response from a GetWalletTypeVersionWithResponse call +func ParseGetWalletTypeVersionResponse(rsp *http.Response) (*GetWalletTypeVersionResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListQueriesResponse{ + response := &GetWalletTypeVersionResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest QueryList + var dest WalletTypeVersion if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6252,33 +8068,26 @@ func ParseListQueriesResponse(rsp *http.Response) (*ListQueriesResponse, error) return response, nil } -// ParseCreateQueryResponse parses an HTTP response from a CreateQueryWithResponse call -func ParseCreateQueryResponse(rsp *http.Response) (*CreateQueryResponse, error) { +// ParseListWalletsResponse parses an HTTP response from a ListWalletsWithResponse call +func ParseListWalletsResponse(rsp *http.Response) (*ListWalletsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateQueryResponse{ + response := &ListWalletsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest QueryAcceptedResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON202 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest ApplicationError + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest WalletList if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON400 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OrganizationNotFound @@ -6294,27 +8103,6 @@ func ParseCreateQueryResponse(rsp *http.Response) (*CreateQueryResponse, error) } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: - var dest ApplicationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON404 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest ApplicationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON409 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: - var dest ApplicationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON429 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6327,26 +8115,33 @@ func ParseCreateQueryResponse(rsp *http.Response) (*CreateQueryResponse, error) return response, nil } -// ParseGetQueryResponse parses an HTTP response from a GetQueryWithResponse call -func ParseGetQueryResponse(rsp *http.Response) (*GetQueryResponse, error) { +// ParseCreateWalletResponse parses an HTTP response from a CreateWalletWithResponse call +func ParseCreateWalletResponse(rsp *http.Response) (*CreateWalletResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetQueryResponse{ + response := &CreateWalletResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Query + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest Wallet if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON201 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OrganizationNotFound @@ -6362,12 +8157,12 @@ func ParseGetQueryResponse(rsp *http.Response) (*GetQueryResponse, error) { } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON409 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest ApplicationError @@ -6381,22 +8176,22 @@ func ParseGetQueryResponse(rsp *http.Response) (*GetQueryResponse, error) { return response, nil } -// ParseListWatchersResponse parses an HTTP response from a ListWatchersWithResponse call -func ParseListWatchersResponse(rsp *http.Response) (*ListWatchersResponse, error) { +// ParseGetWalletResponse parses an HTTP response from a GetWalletWithResponse call +func ParseGetWalletResponse(rsp *http.Response) (*GetWalletResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListWatchersResponse{ + response := &GetWalletResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest WatcherList + var dest Wallet if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6435,26 +8230,26 @@ func ParseListWatchersResponse(rsp *http.Response) (*ListWatchersResponse, error return response, nil } -// ParseCreateWatcherResponse parses an HTTP response from a CreateWatcherWithResponse call -func ParseCreateWatcherResponse(rsp *http.Response) (*CreateWatcherResponse, error) { +// ParseUpdateWalletResponse parses an HTTP response from a UpdateWalletWithResponse call +func ParseUpdateWalletResponse(rsp *http.Response) (*UpdateWalletResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateWatcherResponse{ + response := &UpdateWalletResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Watcher + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Wallet if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest ApplicationError @@ -6503,22 +8298,22 @@ func ParseCreateWatcherResponse(rsp *http.Response) (*CreateWatcherResponse, err return response, nil } -// ParseGetWatcherResponse parses an HTTP response from a GetWatcherWithResponse call -func ParseGetWatcherResponse(rsp *http.Response) (*GetWatcherResponse, error) { +// ParseListWalletAdminOperationsResponse parses an HTTP response from a ListWalletAdminOperationsWithResponse call +func ParseListWalletAdminOperationsResponse(rsp *http.Response) (*ListWalletAdminOperationsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetWatcherResponse{ + response := &ListWalletAdminOperationsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Watcher + var dest WalletAdminOperationList if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6557,29 +8352,22 @@ func ParseGetWatcherResponse(rsp *http.Response) (*GetWatcherResponse, error) { return response, nil } -// ParseUpdateWatcherResponse parses an HTTP response from a UpdateWatcherWithResponse call -func ParseUpdateWatcherResponse(rsp *http.Response) (*UpdateWatcherResponse, error) { +// ParseCreateWalletAdminOperationResponse parses an HTTP response from a CreateWalletAdminOperationWithResponse call +func ParseCreateWalletAdminOperationResponse(rsp *http.Response) (*CreateWalletAdminOperationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateWatcherResponse{ + response := &CreateWalletAdminOperationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Watcher - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest Watcher + var dest WalletAdminOperation if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6632,48 +8420,22 @@ func ParseUpdateWatcherResponse(rsp *http.Response) (*UpdateWatcherResponse, err return response, nil } -// ParseGetHealthCheckResponse parses an HTTP response from a GetHealthCheckWithResponse call -func ParseGetHealthCheckResponse(rsp *http.Response) (*GetHealthCheckResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetHealthCheckResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest HealthCheck - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - - return response, nil -} - -// ParseListNetworksResponse parses an HTTP response from a ListNetworksWithResponse call -func ParseListNetworksResponse(rsp *http.Response) (*ListNetworksResponse, error) { +// ParseGetWalletAdminOperationResponse parses an HTTP response from a GetWalletAdminOperationWithResponse call +func ParseGetWalletAdminOperationResponse(rsp *http.Response) (*GetWalletAdminOperationResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListNetworksResponse{ + response := &GetWalletAdminOperationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest NetworkList + var dest WalletAdminOperation if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6693,6 +8455,13 @@ func ParseListNetworksResponse(rsp *http.Response) (*ListNetworksResponse, error } response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6705,22 +8474,22 @@ func ParseListNetworksResponse(rsp *http.Response) (*ListNetworksResponse, error return response, nil } -// ParseListWalletsResponse parses an HTTP response from a ListWalletsWithResponse call -func ParseListWalletsResponse(rsp *http.Response) (*ListWalletsResponse, error) { +// ParseListWalletUpgradesResponse parses an HTTP response from a ListWalletUpgradesWithResponse call +func ParseListWalletUpgradesResponse(rsp *http.Response) (*ListWalletUpgradesResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListWalletsResponse{ + response := &ListWalletUpgradesResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest WalletList + var dest WalletUpgradeList if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -6740,6 +8509,13 @@ func ParseListWalletsResponse(rsp *http.Response) (*ListWalletsResponse, error) } response.JSON403 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest ApplicationError + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6752,26 +8528,26 @@ func ParseListWalletsResponse(rsp *http.Response) (*ListWalletsResponse, error) return response, nil } -// ParseCreateWalletResponse parses an HTTP response from a CreateWalletWithResponse call -func ParseCreateWalletResponse(rsp *http.Response) (*CreateWalletResponse, error) { +// ParseCreateWalletUpgradeResponse parses an HTTP response from a CreateWalletUpgradeWithResponse call +func ParseCreateWalletUpgradeResponse(rsp *http.Response) (*CreateWalletUpgradeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateWalletResponse{ + response := &CreateWalletUpgradeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: - var dest Wallet + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest WalletUpgrade if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON202 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: var dest ApplicationError @@ -6794,66 +8570,19 @@ func ParseCreateWalletResponse(rsp *http.Response) (*CreateWalletResponse, error } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest ApplicationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON409 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON500 = &dest - - } - - return response, nil -} - -// ParseGetWalletResponse parses an HTTP response from a GetWalletWithResponse call -func ParseGetWalletResponse(rsp *http.Response) (*GetWalletResponse, error) { - bodyBytes, err := io.ReadAll(rsp.Body) - defer func() { _ = rsp.Body.Close() }() - if err != nil { - return nil, err - } - - response := &GetWalletResponse{ - Body: bodyBytes, - HTTPResponse: rsp, - } - - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Wallet - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest OrganizationNotFound - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON401 = &dest - - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest PermissionDenied - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest + response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON404 = &dest + response.JSON409 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest ApplicationError @@ -6867,34 +8596,27 @@ func ParseGetWalletResponse(rsp *http.Response) (*GetWalletResponse, error) { return response, nil } -// ParseUpdateWalletResponse parses an HTTP response from a UpdateWalletWithResponse call -func ParseUpdateWalletResponse(rsp *http.Response) (*UpdateWalletResponse, error) { +// ParseGetWalletUpgradeResponse parses an HTTP response from a GetWalletUpgradeWithResponse call +func ParseGetWalletUpgradeResponse(rsp *http.Response) (*GetWalletUpgradeResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateWalletResponse{ + response := &GetWalletUpgradeResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Wallet + var dest WalletUpgrade if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest ApplicationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest OrganizationNotFound if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6916,13 +8638,6 @@ func ParseUpdateWalletResponse(rsp *http.Response) (*UpdateWalletResponse, error } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409: - var dest ApplicationError - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON409 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest ApplicationError if err := json.Unmarshal(bodyBytes, &dest); err != nil { diff --git a/ginserver/ginserver.gen.go b/ginserver/ginserver.gen.go index 8c79ea7..4f7677d 100644 --- a/ginserver/ginserver.gen.go +++ b/ginserver/ginserver.gen.go @@ -32,23 +32,36 @@ const ( // Defines values for ApplicationErrorCode. const ( - ApplicationErrorCodeChainUnavailable ApplicationErrorCode = "CHAIN_UNAVAILABLE" - ApplicationErrorCodeChannelAlreadyExists ApplicationErrorCode = "CHANNEL_ALREADY_EXISTS" - ApplicationErrorCodeChannelArchived ApplicationErrorCode = "CHANNEL_ARCHIVED" - ApplicationErrorCodeChannelNotFound ApplicationErrorCode = "CHANNEL_NOT_FOUND" - ApplicationErrorCodeIdempotencyKeyMismatch ApplicationErrorCode = "IDEMPOTENCY_KEY_MISMATCH" - ApplicationErrorCodeOperationDeadlineElapsed ApplicationErrorCode = "OPERATION_DEADLINE_ELAPSED" - ApplicationErrorCodeOperationNotCancellable ApplicationErrorCode = "OPERATION_NOT_CANCELLABLE" - ApplicationErrorCodeOperationNotFinalizable ApplicationErrorCode = "OPERATION_NOT_FINALIZABLE" - ApplicationErrorCodeOperationNotFound ApplicationErrorCode = "OPERATION_NOT_FOUND" - ApplicationErrorCodeQueryNotFound ApplicationErrorCode = "QUERY_NOT_FOUND" - ApplicationErrorCodeResourceVersionConflict ApplicationErrorCode = "RESOURCE_VERSION_CONFLICT" - ApplicationErrorCodeWalletAlreadyArchived ApplicationErrorCode = "WALLET_ALREADY_ARCHIVED" - ApplicationErrorCodeWalletAlreadyExists ApplicationErrorCode = "WALLET_ALREADY_EXISTS" - ApplicationErrorCodeWalletNotFound ApplicationErrorCode = "WALLET_NOT_FOUND" - ApplicationErrorCodeWalletNotReady ApplicationErrorCode = "WALLET_NOT_READY" - ApplicationErrorCodeWatcherAlreadyExists ApplicationErrorCode = "WATCHER_ALREADY_EXISTS" - ApplicationErrorCodeWatcherNotFound ApplicationErrorCode = "WATCHER_NOT_FOUND" + ApplicationErrorCodeChainUnavailable ApplicationErrorCode = "CHAIN_UNAVAILABLE" + ApplicationErrorCodeChannelAlreadyExists ApplicationErrorCode = "CHANNEL_ALREADY_EXISTS" + ApplicationErrorCodeChannelArchived ApplicationErrorCode = "CHANNEL_ARCHIVED" + ApplicationErrorCodeChannelNotFound ApplicationErrorCode = "CHANNEL_NOT_FOUND" + ApplicationErrorCodeEntryPointNotRecognized ApplicationErrorCode = "ENTRY_POINT_NOT_RECOGNIZED" + ApplicationErrorCodeIdempotencyKeyMismatch ApplicationErrorCode = "IDEMPOTENCY_KEY_MISMATCH" + ApplicationErrorCodeOperationDeadlineElapsed ApplicationErrorCode = "OPERATION_DEADLINE_ELAPSED" + ApplicationErrorCodeOperationNotCancellable ApplicationErrorCode = "OPERATION_NOT_CANCELLABLE" + ApplicationErrorCodeOperationNotFinalizable ApplicationErrorCode = "OPERATION_NOT_FINALIZABLE" + ApplicationErrorCodeOperationNotFound ApplicationErrorCode = "OPERATION_NOT_FOUND" + ApplicationErrorCodeQueryNotFound ApplicationErrorCode = "QUERY_NOT_FOUND" + ApplicationErrorCodeResourceVersionConflict ApplicationErrorCode = "RESOURCE_VERSION_CONFLICT" + ApplicationErrorCodeWalletAdminOperationNotFound ApplicationErrorCode = "WALLET_ADMIN_OPERATION_NOT_FOUND" + ApplicationErrorCodeWalletAdminOperationPayloadMismatch ApplicationErrorCode = "WALLET_ADMIN_OPERATION_PAYLOAD_MISMATCH" + ApplicationErrorCodeWalletAlreadyArchived ApplicationErrorCode = "WALLET_ALREADY_ARCHIVED" + ApplicationErrorCodeWalletAlreadyExists ApplicationErrorCode = "WALLET_ALREADY_EXISTS" + ApplicationErrorCodeWalletCapabilityNotSupported ApplicationErrorCode = "WALLET_CAPABILITY_NOT_SUPPORTED" + ApplicationErrorCodeWalletNotFound ApplicationErrorCode = "WALLET_NOT_FOUND" + ApplicationErrorCodeWalletNotReady ApplicationErrorCode = "WALLET_NOT_READY" + ApplicationErrorCodeWalletNotUpgradeable ApplicationErrorCode = "WALLET_NOT_UPGRADEABLE" + ApplicationErrorCodeWalletTypeVersionDeprecated ApplicationErrorCode = "WALLET_TYPE_VERSION_DEPRECATED" + ApplicationErrorCodeWalletTypeVersionNotDeployed ApplicationErrorCode = "WALLET_TYPE_VERSION_NOT_DEPLOYED" + ApplicationErrorCodeWalletTypeVersionNotFound ApplicationErrorCode = "WALLET_TYPE_VERSION_NOT_FOUND" + ApplicationErrorCodeWalletUpgradeInProgress ApplicationErrorCode = "WALLET_UPGRADE_IN_PROGRESS" + ApplicationErrorCodeWalletUpgradeNotFound ApplicationErrorCode = "WALLET_UPGRADE_NOT_FOUND" + ApplicationErrorCodeWalletUpgradePayloadMismatch ApplicationErrorCode = "WALLET_UPGRADE_PAYLOAD_MISMATCH" + ApplicationErrorCodeWalletUpgradeTargetAlreadyRecorded ApplicationErrorCode = "WALLET_UPGRADE_TARGET_ALREADY_RECORDED" + ApplicationErrorCodeWalletUpgradeTypeMismatch ApplicationErrorCode = "WALLET_UPGRADE_TYPE_MISMATCH" + ApplicationErrorCodeWatcherAlreadyExists ApplicationErrorCode = "WATCHER_ALREADY_EXISTS" + ApplicationErrorCodeWatcherNotFound ApplicationErrorCode = "WATCHER_NOT_FOUND" ) // Defines values for BlockNumberBlockSelectionType. @@ -146,6 +159,7 @@ const ( WalletStatusDeploying WalletStatus = "deploying" WalletStatusFailed WalletStatus = "failed" WalletStatusPending WalletStatus = "pending" + WalletStatusUpgrading WalletStatus = "upgrading" ) // Defines values for WalletType. @@ -156,6 +170,26 @@ const ( WalletTypeRSA WalletType = "rsa" ) +// Defines values for WalletTypeVersionStatus. +const ( + WalletTypeVersionStatusActive WalletTypeVersionStatus = "active" + WalletTypeVersionStatusDeprecated WalletTypeVersionStatus = "deprecated" +) + +// Defines values for WalletUpgradeOutcome. +const ( + WalletUpgradeOutcomeExpired WalletUpgradeOutcome = "expired" + WalletUpgradeOutcomeFailed WalletUpgradeOutcome = "failed" + WalletUpgradeOutcomePending WalletUpgradeOutcome = "pending" + WalletUpgradeOutcomeSucceeded WalletUpgradeOutcome = "succeeded" +) + +// Defines values for WalletVersionChangeSource. +const ( + WalletVersionChangeSourceCRECUpgrade WalletVersionChangeSource = "crec_upgrade" + WalletVersionChangeSourceOperatorCorrection WalletVersionChangeSource = "operator_correction" +) + // Defines values for WatcherStatus. const ( WatcherStatusActive WatcherStatus = "active" @@ -168,6 +202,18 @@ const ( // Actor Resource attribution actor — ":" for a user, "api:" for an API key. type Actor = string +// AdminAuthorization Owner signature over an administrative capability's pinned EIP-712 struct. +type AdminAuthorization struct { + // Deadline Unix timestamp deadline for the authorization. Zero is rejected. + Deadline int64 `json:"deadline"` + + // Signature The owner's EIP-712 signature over the capability's pinned struct. + Signature OperationSignature `json:"signature"` + + // WalletOperationId The authorization's own identifier in the wallet's executed-operation namespace. Must differ from the enclosing operation's. + WalletOperationId WalletOperationId `json:"wallet_operation_id"` +} + // ApplicationError Standard error response body. type ApplicationError struct { // Code Machine-readable error code for classified tenant error responses. @@ -335,6 +381,36 @@ type CreateWallet struct { WalletType WalletType `json:"wallet_type"` } +// CreateWalletAdminOperation Request body for submitting a signed administrative wallet operation. +type CreateWalletAdminOperation struct { + // Arguments Values keyed by parameter name, canonically encoded: integers as decimal strings, addresses lowercase hex, absent distinguished from null. + Arguments map[string]interface{} `json:"arguments"` + + // Authorization Owner signature over an administrative capability's pinned EIP-712 struct. + Authorization AdminAuthorization `json:"authorization"` + + // Capability A name the wallet's version row publishes. An unpublished name is rejected. + Capability string `json:"capability"` + + // Operation Request body for creating a signed operation or a draft when the signature is omitted. + Operation CreateOperation `json:"operation"` +} + +// CreateWalletUpgrade Request body for submitting a client-signed wallet upgrade. +type CreateWalletUpgrade struct { + // Authorization Owner signature over an administrative capability's pinned EIP-712 struct. + Authorization AdminAuthorization `json:"authorization"` + + // ImplementationAddress What the authorization commits to. Must equal the catalog's address for target_version on the wallet's network, both as declared and as decoded from the packed calldata. + ImplementationAddress EthereumAddress `json:"implementation_address"` + + // Operation Request body for creating a signed operation or a draft when the signature is omitted. + Operation CreateOperation `json:"operation"` + + // TargetVersion A label the wallet type's catalog publishes. + TargetVersion string `json:"target_version"` +} + // CreateWatcher Request body for creating a new watcher (service-based or ABI-based). type CreateWatcher struct { union json.RawMessage @@ -986,12 +1062,24 @@ type Wallet struct { // CreatedBy Actor that created the resource. Null when there is no attributable subject (e.g. background job). CreatedBy *Actor `json:"created_by"` + // DefaultVersion The wallet type's default version, the one new wallets of this type deploy at. + DefaultVersion *string `json:"default_version"` + // Description Description of the wallet Description *string `json:"description,omitempty"` + // ImplementationVersion Operator-assigned implementation version label the wallet is recorded on. Opaque, never ordered or parsed. Null where no version is recorded. + ImplementationVersion *string `json:"implementation_version"` + + // IsUpgradeable Whether the wallet's recorded version can be upgraded through CREC. False while the wallet cannot be upgraded through CREC. + IsUpgradeable *bool `json:"is_upgradeable,omitempty"` + // Name Name of the wallet Name string `json:"name"` + // OnDefaultVersion True when the wallet's recorded version is the type's default. + OnDefaultVersion *bool `json:"on_default_version,omitempty"` + // Status Status of a wallet entity Status WalletStatus `json:"status"` @@ -1014,6 +1102,62 @@ type Wallet struct { WalletType WalletType `json:"wallet_type"` } +// WalletAdminOperation A signature-authorized administrative wallet operation. +type WalletAdminOperation struct { + // AdminOperationId The internal operation's identifier + AdminOperationId openapi_types.UUID `json:"admin_operation_id"` + + // Arguments As submitted, canonically encoded + Arguments map[string]interface{} `json:"arguments"` + + // AuthorizedKey 42-character hex Ethereum address + AuthorizedKey EthereumAddress `json:"authorized_key"` + + // Capability The capability the operation exercises + Capability string `json:"capability"` + + // CreatedAt Unix timestamp in seconds + CreatedAt Timestamp `json:"created_at"` + + // FailureReason The onchain revert reason, verbatim. + FailureReason *string `json:"failure_reason,omitempty"` + + // OperationStatus The underlying lifecycle status while the operation is in flight. + OperationStatus *OperationStatus `json:"operation_status,omitempty"` + + // Outcome Outcome of a wallet upgrade or administrative operation. + Outcome WalletUpgradeOutcome `json:"outcome"` + + // RequestedBy Subject used to describe who initiated, signed, or cancelled an operation. `subject_name` is informational; `subject_id` remains the stable identifier for filtering and equality. + RequestedBy Subject `json:"requested_by"` + + // UpdatedAt Unix timestamp in seconds + UpdatedAt Timestamp `json:"updated_at"` + + // WalletId Unique identifier for the wallet + WalletId openapi_types.UUID `json:"wallet_id"` +} + +// WalletAdminOperationList Paginated list of administrative wallet operations. +type WalletAdminOperationList struct { + Data []WalletAdminOperation `json:"data"` + + // HasMore True if there are more administrative operations to fetch + HasMore bool `json:"has_more"` +} + +// WalletCapabilityDescriptor A non-upgrade administrative capability a wallet type implementation version publishes. +type WalletCapabilityDescriptor struct { + // AbiFragment Full ABI function object with parameter names and types. The packed result includes the 4-byte selector. + AbiFragment map[string]interface{} `json:"abi_fragment"` + + // Eip712Type The pinned EIP-712 type string for this capability's signed struct. + Eip712Type string `json:"eip712_type"` + + // Name The capability name an administrative operation submission names. + Name string `json:"name"` +} + // WalletConfiguration Type-specific wallet configuration. The structure depends on the accompanying wallet_type and is validated by the server at wallet-creation time, not by this schema - this allows wallet types unknown to this spec (e.g. third-party types registered directly in the courier) to carry their own configuration shape. type WalletConfiguration map[string]interface{} @@ -1039,6 +1183,9 @@ type WalletStatusPayload struct { // ChainSelector Chain selector identifier for the blockchain network ChainSelector string `json:"chain_selector"` + // ImplementationVersion Implementation version recorded for the wallet after the status change. An upgrade's outcome arrives on this field. + ImplementationVersion *string `json:"implementation_version"` + // Status Status of a wallet entity Status WalletStatus `json:"status"` @@ -1055,6 +1202,115 @@ type WalletStatusPayload struct { // WalletType Type of wallet type WalletType string +// WalletTypeVersion A published implementation version of a wallet type. +type WalletTypeVersion struct { + // Capabilities The non-upgrade administrative capabilities this implementation publishes. Empty on backfilled legacy rows. + Capabilities []WalletCapabilityDescriptor `json:"capabilities"` + + // Changelog Release notes for the version. + Changelog *string `json:"changelog,omitempty"` + + // CreatedAt Unix timestamp in seconds + CreatedAt Timestamp `json:"created_at"` + + // Deployments Per-network implementation addresses. Filtered to chain_selector when the query parameter is present. + Deployments []WalletTypeVersionDeployment `json:"deployments"` + + // ImplementationVersion Operator-assigned label, unique per wallet type. Opaque, never ordered or parsed. + ImplementationVersion string `json:"implementation_version"` + + // IsDefault The version new wallets of this type deploy at. Exactly one per wallet type. + IsDefault bool `json:"is_default"` + + // IsUpgradeable Whether a wallet recorded on this version can be upgraded through CREC. False on backfilled legacy rows. + IsUpgradeable bool `json:"is_upgradeable"` + + // Status Support state of a wallet type implementation version. A deprecated version is not a supported upgrade target. + Status WalletTypeVersionStatus `json:"status"` + + // WalletType Type of wallet + WalletType WalletType `json:"wallet_type"` +} + +// WalletTypeVersionDeployment One network's implementation address for a wallet type version. +type WalletTypeVersionDeployment struct { + // ChainSelector Chain selector identifier for the blockchain network + ChainSelector ChainSelector `json:"chain_selector"` + + // ImplementationAddress Implementation address for the version on the network. Lowercase hex. + ImplementationAddress EthereumAddress `json:"implementation_address"` +} + +// WalletTypeVersionList List of published implementation versions for a wallet type. +type WalletTypeVersionList struct { + Data []WalletTypeVersion `json:"data"` + + // HasMore True if there are more versions to fetch + HasMore bool `json:"has_more"` +} + +// WalletTypeVersionStatus Support state of a wallet type implementation version. A deprecated version is not a supported upgrade target. +type WalletTypeVersionStatus string + +// WalletUpgrade A wallet implementation version change. +type WalletUpgrade struct { + // AuthorizedKey The owner key that signed. Null on a correction. + AuthorizedKey *EthereumAddress `json:"authorized_key"` + + // CreatedAt Unix timestamp in seconds + CreatedAt Timestamp `json:"created_at"` + + // FailureReason The onchain revert reason, verbatim. + FailureReason *string `json:"failure_reason,omitempty"` + + // FromVersion The version recorded when the event began. Null where none was recorded. + FromVersion *string `json:"from_version"` + + // ImplementationAddress The implementation address the authorization commits to. Null on a correction. + ImplementationAddress *EthereumAddress `json:"implementation_address"` + + // OperationId The internal operation. Null on a correction. + OperationId *openapi_types.UUID `json:"operation_id"` + + // OperationStatus The underlying lifecycle status while the upgrade is in flight. + OperationStatus *OperationStatus `json:"operation_status,omitempty"` + + // Outcome Outcome of a wallet upgrade or administrative operation. + Outcome WalletUpgradeOutcome `json:"outcome"` + + // RequestedBy Subject used to describe who initiated, signed, or cancelled an operation. `subject_name` is informational; `subject_id` remains the stable identifier for filtering and equality. + RequestedBy Subject `json:"requested_by"` + + // Source Writer of a wallet's recorded implementation version. + Source WalletVersionChangeSource `json:"source"` + + // ToVersion The version the wallet is recorded on after the event. + ToVersion string `json:"to_version"` + + // UpdatedAt Unix timestamp in seconds + UpdatedAt Timestamp `json:"updated_at"` + + // UpgradeId Unique identifier for the upgrade + UpgradeId openapi_types.UUID `json:"upgrade_id"` + + // WalletId Unique identifier for the wallet + WalletId openapi_types.UUID `json:"wallet_id"` +} + +// WalletUpgradeList Paginated list of wallet implementation version changes. +type WalletUpgradeList struct { + Data []WalletUpgrade `json:"data"` + + // HasMore True if there are more upgrades to fetch + HasMore bool `json:"has_more"` +} + +// WalletUpgradeOutcome Outcome of a wallet upgrade or administrative operation. +type WalletUpgradeOutcome string + +// WalletVersionChangeSource Writer of a wallet's recorded implementation version. +type WalletVersionChangeSource string + // Watcher A watcher resource. type Watcher struct { // Abi ABI definitions for the events (if not using service-based events) @@ -1387,6 +1643,15 @@ type ListWatchersParams struct { EventName *string `form:"event_name,omitempty" json:"event_name,omitempty"` } +// ListWalletTypeVersionsParams defines parameters for ListWalletTypeVersions. +type ListWalletTypeVersionsParams struct { + // ChainSelector Filter deployments to a chain selector. Versions with no deployment on that chain are still returned. + ChainSelector *ChainSelector `form:"chain_selector,omitempty" json:"chain_selector,omitempty"` + + // Status Filter versions by support state. + Status *WalletTypeVersionStatus `form:"status,omitempty" json:"status,omitempty"` +} + // ListWalletsParams defines parameters for ListWallets. type ListWalletsParams struct { // Name Filter wallets by name (case-insensitive partial match) @@ -1407,6 +1672,9 @@ type ListWalletsParams struct { // Status Filter wallets by status. Multiple values allowed. Archived wallets are excluded by default when no status filter is specified. Status *[]WalletStatus `form:"status,omitempty" json:"status,omitempty"` + // ImplementationVersion Filter wallets by recorded implementation version + ImplementationVersion *string `form:"implementation_version,omitempty" json:"implementation_version,omitempty"` + // ChainEnvironment Filter wallets by chain environment (mainnet or testnet). If omitted, returns all chain environments. ChainEnvironment *ChainEnvironment `form:"chain_environment,omitempty" json:"chain_environment,omitempty"` @@ -1417,6 +1685,30 @@ type ListWalletsParams struct { Offset *int64 `form:"offset,omitempty" json:"offset,omitempty"` } +// ListWalletAdminOperationsParams defines parameters for ListWalletAdminOperations. +type ListWalletAdminOperationsParams struct { + // Limit Maximum number of administrative operations to return + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Number of administrative operations to skip for pagination + Offset *int64 `form:"offset,omitempty" json:"offset,omitempty"` +} + +// ListWalletUpgradesParams defines parameters for ListWalletUpgrades. +type ListWalletUpgradesParams struct { + // Limit Maximum number of upgrades to return + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Number of upgrades to skip for pagination + Offset *int64 `form:"offset,omitempty" json:"offset,omitempty"` + + // Source Filter upgrades by source + Source *WalletVersionChangeSource `form:"source,omitempty" json:"source,omitempty"` + + // Outcome Filter upgrades by outcome + Outcome *WalletUpgradeOutcome `form:"outcome,omitempty" json:"outcome,omitempty"` +} + // CreateChannelJSONRequestBody defines body for CreateChannel for application/json ContentType. type CreateChannelJSONRequestBody = CreateChannel @@ -1444,6 +1736,12 @@ type CreateWalletJSONRequestBody = CreateWallet // UpdateWalletJSONRequestBody defines body for UpdateWallet for application/json ContentType. type UpdateWalletJSONRequestBody = UpdateWallet +// CreateWalletAdminOperationJSONRequestBody defines body for CreateWalletAdminOperation for application/json ContentType. +type CreateWalletAdminOperationJSONRequestBody = CreateWalletAdminOperation + +// CreateWalletUpgradeJSONRequestBody defines body for CreateWalletUpgrade for application/json ContentType. +type CreateWalletUpgradeJSONRequestBody = CreateWalletUpgrade + // Getter for additional properties for GenericProofObject. Returns the specified // element and whether it was found func (a GenericProofObject) Get(fieldName string) (value interface{}, found bool) { @@ -2046,6 +2344,12 @@ type ServerInterface interface { // Retrieves available networks. // (GET /networks) ListNetworks(c *gin.Context) + // Retrieves published implementation versions for a wallet type. + // (GET /wallet-types/{wallet_type}/versions) + ListWalletTypeVersions(c *gin.Context, walletType WalletType, params ListWalletTypeVersionsParams) + // Retrieves one published implementation version for a wallet type. + // (GET /wallet-types/{wallet_type}/versions/{implementation_version}) + GetWalletTypeVersion(c *gin.Context, walletType WalletType, implementationVersion string) // Retrieves wallets for the organization. // (GET /wallets) ListWallets(c *gin.Context, params ListWalletsParams) @@ -2058,6 +2362,24 @@ type ServerInterface interface { // Updates a wallet name. // (PATCH /wallets/{wallet_id}) UpdateWallet(c *gin.Context, walletId openapi_types.UUID) + // Retrieves administrative operations for a wallet. + // (GET /wallets/{wallet_id}/admin-operations) + ListWalletAdminOperations(c *gin.Context, walletId openapi_types.UUID, params ListWalletAdminOperationsParams) + // Submits a signed administrative wallet operation. + // (POST /wallets/{wallet_id}/admin-operations) + CreateWalletAdminOperation(c *gin.Context, walletId openapi_types.UUID) + // Retrieves one administrative wallet operation. + // (GET /wallets/{wallet_id}/admin-operations/{admin_operation_id}) + GetWalletAdminOperation(c *gin.Context, walletId openapi_types.UUID, adminOperationId openapi_types.UUID) + // Retrieves the implementation version history for a wallet. + // (GET /wallets/{wallet_id}/upgrades) + ListWalletUpgrades(c *gin.Context, walletId openapi_types.UUID, params ListWalletUpgradesParams) + // Submits a client-signed wallet upgrade. + // (POST /wallets/{wallet_id}/upgrades) + CreateWalletUpgrade(c *gin.Context, walletId openapi_types.UUID) + // Retrieves one wallet upgrade. + // (GET /wallets/{wallet_id}/upgrades/{upgrade_id}) + GetWalletUpgrade(c *gin.Context, walletId openapi_types.UUID, upgradeId openapi_types.UUID) } // ServerInterfaceWrapper converts contexts to parameters. @@ -3035,6 +3357,86 @@ func (siw *ServerInterfaceWrapper) ListNetworks(c *gin.Context) { siw.Handler.ListNetworks(c) } +// ListWalletTypeVersions operation middleware +func (siw *ServerInterfaceWrapper) ListWalletTypeVersions(c *gin.Context) { + + var err error + + // ------------- Path parameter "wallet_type" ------------- + var walletType WalletType + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_type", c.Param("wallet_type"), &walletType, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter wallet_type: %w", err), http.StatusBadRequest) + return + } + + c.Set(ApiKeyAuthScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params ListWalletTypeVersionsParams + + // ------------- Optional query parameter "chain_selector" ------------- + + err = runtime.BindQueryParameter("form", true, false, "chain_selector", c.Request.URL.Query(), ¶ms.ChainSelector) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter chain_selector: %w", err), http.StatusBadRequest) + return + } + + // ------------- Optional query parameter "status" ------------- + + err = runtime.BindQueryParameter("form", true, false, "status", c.Request.URL.Query(), ¶ms.Status) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter status: %w", err), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.ListWalletTypeVersions(c, walletType, params) +} + +// GetWalletTypeVersion operation middleware +func (siw *ServerInterfaceWrapper) GetWalletTypeVersion(c *gin.Context) { + + var err error + + // ------------- Path parameter "wallet_type" ------------- + var walletType WalletType + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_type", c.Param("wallet_type"), &walletType, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter wallet_type: %w", err), http.StatusBadRequest) + return + } + + // ------------- Path parameter "implementation_version" ------------- + var implementationVersion string + + err = runtime.BindStyledParameterWithOptions("simple", "implementation_version", c.Param("implementation_version"), &implementationVersion, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter implementation_version: %w", err), http.StatusBadRequest) + return + } + + c.Set(ApiKeyAuthScopes, []string{}) + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.GetWalletTypeVersion(c, walletType, implementationVersion) +} + // ListWallets operation middleware func (siw *ServerInterfaceWrapper) ListWallets(c *gin.Context) { @@ -3093,6 +3495,14 @@ func (siw *ServerInterfaceWrapper) ListWallets(c *gin.Context) { return } + // ------------- Optional query parameter "implementation_version" ------------- + + err = runtime.BindQueryParameter("form", true, false, "implementation_version", c.Request.URL.Query(), ¶ms.ImplementationVersion) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter implementation_version: %w", err), http.StatusBadRequest) + return + } + // ------------- Optional query parameter "chain_environment" ------------- err = runtime.BindQueryParameter("form", true, false, "chain_environment", c.Request.URL.Query(), ¶ms.ChainEnvironment) @@ -3194,66 +3604,302 @@ func (siw *ServerInterfaceWrapper) UpdateWallet(c *gin.Context) { siw.Handler.UpdateWallet(c, walletId) } -// GinServerOptions provides options for the Gin server. -type GinServerOptions struct { - BaseURL string - Middlewares []MiddlewareFunc - ErrorHandler func(*gin.Context, error, int) -} +// ListWalletAdminOperations operation middleware +func (siw *ServerInterfaceWrapper) ListWalletAdminOperations(c *gin.Context) { -// RegisterHandlers creates http.Handler with routing matching OpenAPI spec. -func RegisterHandlers(router gin.IRouter, si ServerInterface) { - RegisterHandlersWithOptions(router, si, GinServerOptions{}) -} + var err error -// RegisterHandlersWithOptions creates http.Handler with additional options -func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions) { - errorHandler := options.ErrorHandler - if errorHandler == nil { - errorHandler = func(c *gin.Context, err error, statusCode int) { - c.JSON(statusCode, gin.H{"msg": err.Error()}) - } - } + // ------------- Path parameter "wallet_id" ------------- + var walletId openapi_types.UUID - wrapper := ServerInterfaceWrapper{ - Handler: si, - HandlerMiddlewares: options.Middlewares, - ErrorHandler: errorHandler, + err = runtime.BindStyledParameterWithOptions("simple", "wallet_id", c.Param("wallet_id"), &walletId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter wallet_id: %w", err), http.StatusBadRequest) + return } - router.GET(options.BaseURL+"/channels", wrapper.ListChannels) - router.POST(options.BaseURL+"/channels", wrapper.CreateChannel) - router.GET(options.BaseURL+"/channels/:channel_id", wrapper.GetChannel) - router.PATCH(options.BaseURL+"/channels/:channel_id", wrapper.UpdateChannel) - router.GET(options.BaseURL+"/channels/:channel_id/events", wrapper.ListChannelEvents) - router.GET(options.BaseURL+"/channels/:channel_id/events/search", wrapper.SearchChannelEvents) - router.GET(options.BaseURL+"/channels/:channel_id/events/search/:event_id", wrapper.GetChannelEvent) - router.GET(options.BaseURL+"/channels/:channel_id/operations", wrapper.ListOperations) - router.POST(options.BaseURL+"/channels/:channel_id/operations", wrapper.CreateOperation) - router.GET(options.BaseURL+"/channels/:channel_id/operations/:operation_id", wrapper.GetOperation) - router.PATCH(options.BaseURL+"/channels/:channel_id/operations/:operation_id", wrapper.FinalizeOrCancelOperation) - router.GET(options.BaseURL+"/channels/:channel_id/queries", wrapper.ListQueries) - router.POST(options.BaseURL+"/channels/:channel_id/queries", wrapper.CreateQuery) - router.GET(options.BaseURL+"/channels/:channel_id/queries/:query_id", wrapper.GetQuery) - router.GET(options.BaseURL+"/channels/:channel_id/watchers", wrapper.ListWatchers) - router.POST(options.BaseURL+"/channels/:channel_id/watchers", wrapper.CreateWatcher) - router.GET(options.BaseURL+"/channels/:channel_id/watchers/:watcher_id", wrapper.GetWatcher) - router.PATCH(options.BaseURL+"/channels/:channel_id/watchers/:watcher_id", wrapper.UpdateWatcher) - router.GET(options.BaseURL+"/health-check", wrapper.GetHealthCheck) - router.GET(options.BaseURL+"/networks", wrapper.ListNetworks) - router.GET(options.BaseURL+"/wallets", wrapper.ListWallets) - router.POST(options.BaseURL+"/wallets", wrapper.CreateWallet) - router.GET(options.BaseURL+"/wallets/:wallet_id", wrapper.GetWallet) - router.PATCH(options.BaseURL+"/wallets/:wallet_id", wrapper.UpdateWallet) -} - -type OrganizationNotFoundJSONResponse ApplicationError + c.Set(ApiKeyAuthScopes, []string{}) -type PermissionDeniedJSONResponse ApplicationError + // Parameter object where we will unmarshal all parameters from the context + var params ListWalletAdminOperationsParams -type ListChannelsRequestObject struct { - Params ListChannelsParams -} + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameter("form", true, false, "limit", c.Request.URL.Query(), ¶ms.Limit) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter limit: %w", err), http.StatusBadRequest) + return + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameter("form", true, false, "offset", c.Request.URL.Query(), ¶ms.Offset) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter offset: %w", err), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.ListWalletAdminOperations(c, walletId, params) +} + +// CreateWalletAdminOperation operation middleware +func (siw *ServerInterfaceWrapper) CreateWalletAdminOperation(c *gin.Context) { + + var err error + + // ------------- Path parameter "wallet_id" ------------- + var walletId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_id", c.Param("wallet_id"), &walletId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter wallet_id: %w", err), http.StatusBadRequest) + return + } + + c.Set(ApiKeyAuthScopes, []string{}) + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.CreateWalletAdminOperation(c, walletId) +} + +// GetWalletAdminOperation operation middleware +func (siw *ServerInterfaceWrapper) GetWalletAdminOperation(c *gin.Context) { + + var err error + + // ------------- Path parameter "wallet_id" ------------- + var walletId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_id", c.Param("wallet_id"), &walletId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter wallet_id: %w", err), http.StatusBadRequest) + return + } + + // ------------- Path parameter "admin_operation_id" ------------- + var adminOperationId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "admin_operation_id", c.Param("admin_operation_id"), &adminOperationId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter admin_operation_id: %w", err), http.StatusBadRequest) + return + } + + c.Set(ApiKeyAuthScopes, []string{}) + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.GetWalletAdminOperation(c, walletId, adminOperationId) +} + +// ListWalletUpgrades operation middleware +func (siw *ServerInterfaceWrapper) ListWalletUpgrades(c *gin.Context) { + + var err error + + // ------------- Path parameter "wallet_id" ------------- + var walletId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_id", c.Param("wallet_id"), &walletId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter wallet_id: %w", err), http.StatusBadRequest) + return + } + + c.Set(ApiKeyAuthScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params ListWalletUpgradesParams + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameter("form", true, false, "limit", c.Request.URL.Query(), ¶ms.Limit) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter limit: %w", err), http.StatusBadRequest) + return + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameter("form", true, false, "offset", c.Request.URL.Query(), ¶ms.Offset) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter offset: %w", err), http.StatusBadRequest) + return + } + + // ------------- Optional query parameter "source" ------------- + + err = runtime.BindQueryParameter("form", true, false, "source", c.Request.URL.Query(), ¶ms.Source) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter source: %w", err), http.StatusBadRequest) + return + } + + // ------------- Optional query parameter "outcome" ------------- + + err = runtime.BindQueryParameter("form", true, false, "outcome", c.Request.URL.Query(), ¶ms.Outcome) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter outcome: %w", err), http.StatusBadRequest) + return + } + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.ListWalletUpgrades(c, walletId, params) +} + +// CreateWalletUpgrade operation middleware +func (siw *ServerInterfaceWrapper) CreateWalletUpgrade(c *gin.Context) { + + var err error + + // ------------- Path parameter "wallet_id" ------------- + var walletId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_id", c.Param("wallet_id"), &walletId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter wallet_id: %w", err), http.StatusBadRequest) + return + } + + c.Set(ApiKeyAuthScopes, []string{}) + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.CreateWalletUpgrade(c, walletId) +} + +// GetWalletUpgrade operation middleware +func (siw *ServerInterfaceWrapper) GetWalletUpgrade(c *gin.Context) { + + var err error + + // ------------- Path parameter "wallet_id" ------------- + var walletId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_id", c.Param("wallet_id"), &walletId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter wallet_id: %w", err), http.StatusBadRequest) + return + } + + // ------------- Path parameter "upgrade_id" ------------- + var upgradeId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "upgrade_id", c.Param("upgrade_id"), &upgradeId, runtime.BindStyledParameterOptions{Explode: false, Required: true}) + if err != nil { + siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter upgrade_id: %w", err), http.StatusBadRequest) + return + } + + c.Set(ApiKeyAuthScopes, []string{}) + + for _, middleware := range siw.HandlerMiddlewares { + middleware(c) + if c.IsAborted() { + return + } + } + + siw.Handler.GetWalletUpgrade(c, walletId, upgradeId) +} + +// GinServerOptions provides options for the Gin server. +type GinServerOptions struct { + BaseURL string + Middlewares []MiddlewareFunc + ErrorHandler func(*gin.Context, error, int) +} + +// RegisterHandlers creates http.Handler with routing matching OpenAPI spec. +func RegisterHandlers(router gin.IRouter, si ServerInterface) { + RegisterHandlersWithOptions(router, si, GinServerOptions{}) +} + +// RegisterHandlersWithOptions creates http.Handler with additional options +func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions) { + errorHandler := options.ErrorHandler + if errorHandler == nil { + errorHandler = func(c *gin.Context, err error, statusCode int) { + c.JSON(statusCode, gin.H{"msg": err.Error()}) + } + } + + wrapper := ServerInterfaceWrapper{ + Handler: si, + HandlerMiddlewares: options.Middlewares, + ErrorHandler: errorHandler, + } + + router.GET(options.BaseURL+"/channels", wrapper.ListChannels) + router.POST(options.BaseURL+"/channels", wrapper.CreateChannel) + router.GET(options.BaseURL+"/channels/:channel_id", wrapper.GetChannel) + router.PATCH(options.BaseURL+"/channels/:channel_id", wrapper.UpdateChannel) + router.GET(options.BaseURL+"/channels/:channel_id/events", wrapper.ListChannelEvents) + router.GET(options.BaseURL+"/channels/:channel_id/events/search", wrapper.SearchChannelEvents) + router.GET(options.BaseURL+"/channels/:channel_id/events/search/:event_id", wrapper.GetChannelEvent) + router.GET(options.BaseURL+"/channels/:channel_id/operations", wrapper.ListOperations) + router.POST(options.BaseURL+"/channels/:channel_id/operations", wrapper.CreateOperation) + router.GET(options.BaseURL+"/channels/:channel_id/operations/:operation_id", wrapper.GetOperation) + router.PATCH(options.BaseURL+"/channels/:channel_id/operations/:operation_id", wrapper.FinalizeOrCancelOperation) + router.GET(options.BaseURL+"/channels/:channel_id/queries", wrapper.ListQueries) + router.POST(options.BaseURL+"/channels/:channel_id/queries", wrapper.CreateQuery) + router.GET(options.BaseURL+"/channels/:channel_id/queries/:query_id", wrapper.GetQuery) + router.GET(options.BaseURL+"/channels/:channel_id/watchers", wrapper.ListWatchers) + router.POST(options.BaseURL+"/channels/:channel_id/watchers", wrapper.CreateWatcher) + router.GET(options.BaseURL+"/channels/:channel_id/watchers/:watcher_id", wrapper.GetWatcher) + router.PATCH(options.BaseURL+"/channels/:channel_id/watchers/:watcher_id", wrapper.UpdateWatcher) + router.GET(options.BaseURL+"/health-check", wrapper.GetHealthCheck) + router.GET(options.BaseURL+"/networks", wrapper.ListNetworks) + router.GET(options.BaseURL+"/wallet-types/:wallet_type/versions", wrapper.ListWalletTypeVersions) + router.GET(options.BaseURL+"/wallet-types/:wallet_type/versions/:implementation_version", wrapper.GetWalletTypeVersion) + router.GET(options.BaseURL+"/wallets", wrapper.ListWallets) + router.POST(options.BaseURL+"/wallets", wrapper.CreateWallet) + router.GET(options.BaseURL+"/wallets/:wallet_id", wrapper.GetWallet) + router.PATCH(options.BaseURL+"/wallets/:wallet_id", wrapper.UpdateWallet) + router.GET(options.BaseURL+"/wallets/:wallet_id/admin-operations", wrapper.ListWalletAdminOperations) + router.POST(options.BaseURL+"/wallets/:wallet_id/admin-operations", wrapper.CreateWalletAdminOperation) + router.GET(options.BaseURL+"/wallets/:wallet_id/admin-operations/:admin_operation_id", wrapper.GetWalletAdminOperation) + router.GET(options.BaseURL+"/wallets/:wallet_id/upgrades", wrapper.ListWalletUpgrades) + router.POST(options.BaseURL+"/wallets/:wallet_id/upgrades", wrapper.CreateWalletUpgrade) + router.GET(options.BaseURL+"/wallets/:wallet_id/upgrades/:upgrade_id", wrapper.GetWalletUpgrade) +} + +type OrganizationNotFoundJSONResponse ApplicationError + +type PermissionDeniedJSONResponse ApplicationError + +type ListChannelsRequestObject struct { + Params ListChannelsParams +} type ListChannelsResponseObject interface { VisitListChannelsResponse(w http.ResponseWriter) error @@ -4454,57 +5100,169 @@ func (response ListNetworks500JSONResponse) VisitListNetworksResponse(w http.Res return json.NewEncoder(w).Encode(response) } -type ListWalletsRequestObject struct { - Params ListWalletsParams +type ListWalletTypeVersionsRequestObject struct { + WalletType WalletType `json:"wallet_type"` + Params ListWalletTypeVersionsParams } -type ListWalletsResponseObject interface { - VisitListWalletsResponse(w http.ResponseWriter) error +type ListWalletTypeVersionsResponseObject interface { + VisitListWalletTypeVersionsResponse(w http.ResponseWriter) error } -type ListWallets200JSONResponse WalletList +type ListWalletTypeVersions200JSONResponse WalletTypeVersionList -func (response ListWallets200JSONResponse) VisitListWalletsResponse(w http.ResponseWriter) error { +func (response ListWalletTypeVersions200JSONResponse) VisitListWalletTypeVersionsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type ListWallets401JSONResponse struct { +type ListWalletTypeVersions401JSONResponse struct { OrganizationNotFoundJSONResponse } -func (response ListWallets401JSONResponse) VisitListWalletsResponse(w http.ResponseWriter) error { +func (response ListWalletTypeVersions401JSONResponse) VisitListWalletTypeVersionsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(401) return json.NewEncoder(w).Encode(response) } -type ListWallets403JSONResponse struct{ PermissionDeniedJSONResponse } +type ListWalletTypeVersions403JSONResponse struct{ PermissionDeniedJSONResponse } -func (response ListWallets403JSONResponse) VisitListWalletsResponse(w http.ResponseWriter) error { +func (response ListWalletTypeVersions403JSONResponse) VisitListWalletTypeVersionsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(403) return json.NewEncoder(w).Encode(response) } -type ListWallets500JSONResponse ApplicationError +type ListWalletTypeVersions404JSONResponse ApplicationError -func (response ListWallets500JSONResponse) VisitListWalletsResponse(w http.ResponseWriter) error { +func (response ListWalletTypeVersions404JSONResponse) VisitListWalletTypeVersionsResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") - w.WriteHeader(500) + w.WriteHeader(404) return json.NewEncoder(w).Encode(response) } -type CreateWalletRequestObject struct { - Body *CreateWalletJSONRequestBody -} +type ListWalletTypeVersions500JSONResponse ApplicationError -type CreateWalletResponseObject interface { +func (response ListWalletTypeVersions500JSONResponse) VisitListWalletTypeVersionsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(500) + + return json.NewEncoder(w).Encode(response) +} + +type GetWalletTypeVersionRequestObject struct { + WalletType WalletType `json:"wallet_type"` + ImplementationVersion string `json:"implementation_version"` +} + +type GetWalletTypeVersionResponseObject interface { + VisitGetWalletTypeVersionResponse(w http.ResponseWriter) error +} + +type GetWalletTypeVersion200JSONResponse WalletTypeVersion + +func (response GetWalletTypeVersion200JSONResponse) VisitGetWalletTypeVersionResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetWalletTypeVersion401JSONResponse struct { + OrganizationNotFoundJSONResponse +} + +func (response GetWalletTypeVersion401JSONResponse) VisitGetWalletTypeVersionResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(401) + + return json.NewEncoder(w).Encode(response) +} + +type GetWalletTypeVersion403JSONResponse struct{ PermissionDeniedJSONResponse } + +func (response GetWalletTypeVersion403JSONResponse) VisitGetWalletTypeVersionResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(403) + + return json.NewEncoder(w).Encode(response) +} + +type GetWalletTypeVersion404JSONResponse ApplicationError + +func (response GetWalletTypeVersion404JSONResponse) VisitGetWalletTypeVersionResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(404) + + return json.NewEncoder(w).Encode(response) +} + +type GetWalletTypeVersion500JSONResponse ApplicationError + +func (response GetWalletTypeVersion500JSONResponse) VisitGetWalletTypeVersionResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(500) + + return json.NewEncoder(w).Encode(response) +} + +type ListWalletsRequestObject struct { + Params ListWalletsParams +} + +type ListWalletsResponseObject interface { + VisitListWalletsResponse(w http.ResponseWriter) error +} + +type ListWallets200JSONResponse WalletList + +func (response ListWallets200JSONResponse) VisitListWalletsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type ListWallets401JSONResponse struct { + OrganizationNotFoundJSONResponse +} + +func (response ListWallets401JSONResponse) VisitListWalletsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(401) + + return json.NewEncoder(w).Encode(response) +} + +type ListWallets403JSONResponse struct{ PermissionDeniedJSONResponse } + +func (response ListWallets403JSONResponse) VisitListWalletsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(403) + + return json.NewEncoder(w).Encode(response) +} + +type ListWallets500JSONResponse ApplicationError + +func (response ListWallets500JSONResponse) VisitListWalletsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(500) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWalletRequestObject struct { + Body *CreateWalletJSONRequestBody +} + +type CreateWalletResponseObject interface { VisitCreateWalletResponse(w http.ResponseWriter) error } @@ -4517,176 +5275,548 @@ func (response CreateWallet201JSONResponse) VisitCreateWalletResponse(w http.Res return json.NewEncoder(w).Encode(response) } -type CreateWallet400JSONResponse ApplicationError +type CreateWallet400JSONResponse ApplicationError + +func (response CreateWallet400JSONResponse) VisitCreateWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(400) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWallet401JSONResponse struct { + OrganizationNotFoundJSONResponse +} + +func (response CreateWallet401JSONResponse) VisitCreateWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(401) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWallet403JSONResponse struct{ PermissionDeniedJSONResponse } + +func (response CreateWallet403JSONResponse) VisitCreateWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(403) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWallet409JSONResponse ApplicationError + +func (response CreateWallet409JSONResponse) VisitCreateWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(409) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWallet500JSONResponse ApplicationError + +func (response CreateWallet500JSONResponse) VisitCreateWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(500) + + return json.NewEncoder(w).Encode(response) +} + +type GetWalletRequestObject struct { + WalletId openapi_types.UUID `json:"wallet_id"` +} + +type GetWalletResponseObject interface { + VisitGetWalletResponse(w http.ResponseWriter) error +} + +type GetWallet200JSONResponse Wallet + +func (response GetWallet200JSONResponse) VisitGetWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetWallet401JSONResponse struct { + OrganizationNotFoundJSONResponse +} + +func (response GetWallet401JSONResponse) VisitGetWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(401) + + return json.NewEncoder(w).Encode(response) +} + +type GetWallet403JSONResponse struct{ PermissionDeniedJSONResponse } + +func (response GetWallet403JSONResponse) VisitGetWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(403) + + return json.NewEncoder(w).Encode(response) +} + +type GetWallet404JSONResponse ApplicationError + +func (response GetWallet404JSONResponse) VisitGetWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(404) + + return json.NewEncoder(w).Encode(response) +} + +type GetWallet500JSONResponse ApplicationError + +func (response GetWallet500JSONResponse) VisitGetWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(500) + + return json.NewEncoder(w).Encode(response) +} + +type UpdateWalletRequestObject struct { + WalletId openapi_types.UUID `json:"wallet_id"` + Body *UpdateWalletJSONRequestBody +} + +type UpdateWalletResponseObject interface { + VisitUpdateWalletResponse(w http.ResponseWriter) error +} + +type UpdateWallet200JSONResponse Wallet + +func (response UpdateWallet200JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type UpdateWallet400JSONResponse ApplicationError + +func (response UpdateWallet400JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(400) + + return json.NewEncoder(w).Encode(response) +} + +type UpdateWallet401JSONResponse struct { + OrganizationNotFoundJSONResponse +} + +func (response UpdateWallet401JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(401) + + return json.NewEncoder(w).Encode(response) +} + +type UpdateWallet403JSONResponse struct{ PermissionDeniedJSONResponse } + +func (response UpdateWallet403JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(403) + + return json.NewEncoder(w).Encode(response) +} + +type UpdateWallet404JSONResponse ApplicationError + +func (response UpdateWallet404JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(404) + + return json.NewEncoder(w).Encode(response) +} + +type UpdateWallet409JSONResponse ApplicationError + +func (response UpdateWallet409JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(409) + + return json.NewEncoder(w).Encode(response) +} + +type UpdateWallet500JSONResponse ApplicationError + +func (response UpdateWallet500JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(500) + + return json.NewEncoder(w).Encode(response) +} + +type ListWalletAdminOperationsRequestObject struct { + WalletId openapi_types.UUID `json:"wallet_id"` + Params ListWalletAdminOperationsParams +} + +type ListWalletAdminOperationsResponseObject interface { + VisitListWalletAdminOperationsResponse(w http.ResponseWriter) error +} + +type ListWalletAdminOperations200JSONResponse WalletAdminOperationList + +func (response ListWalletAdminOperations200JSONResponse) VisitListWalletAdminOperationsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type ListWalletAdminOperations401JSONResponse struct { + OrganizationNotFoundJSONResponse +} + +func (response ListWalletAdminOperations401JSONResponse) VisitListWalletAdminOperationsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(401) + + return json.NewEncoder(w).Encode(response) +} + +type ListWalletAdminOperations403JSONResponse struct{ PermissionDeniedJSONResponse } + +func (response ListWalletAdminOperations403JSONResponse) VisitListWalletAdminOperationsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(403) + + return json.NewEncoder(w).Encode(response) +} + +type ListWalletAdminOperations404JSONResponse ApplicationError + +func (response ListWalletAdminOperations404JSONResponse) VisitListWalletAdminOperationsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(404) + + return json.NewEncoder(w).Encode(response) +} + +type ListWalletAdminOperations500JSONResponse ApplicationError + +func (response ListWalletAdminOperations500JSONResponse) VisitListWalletAdminOperationsResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(500) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWalletAdminOperationRequestObject struct { + WalletId openapi_types.UUID `json:"wallet_id"` + Body *CreateWalletAdminOperationJSONRequestBody +} + +type CreateWalletAdminOperationResponseObject interface { + VisitCreateWalletAdminOperationResponse(w http.ResponseWriter) error +} + +type CreateWalletAdminOperation202JSONResponse WalletAdminOperation + +func (response CreateWalletAdminOperation202JSONResponse) VisitCreateWalletAdminOperationResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(202) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWalletAdminOperation400JSONResponse ApplicationError + +func (response CreateWalletAdminOperation400JSONResponse) VisitCreateWalletAdminOperationResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(400) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWalletAdminOperation401JSONResponse struct { + OrganizationNotFoundJSONResponse +} + +func (response CreateWalletAdminOperation401JSONResponse) VisitCreateWalletAdminOperationResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(401) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWalletAdminOperation403JSONResponse struct{ PermissionDeniedJSONResponse } + +func (response CreateWalletAdminOperation403JSONResponse) VisitCreateWalletAdminOperationResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(403) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWalletAdminOperation404JSONResponse ApplicationError + +func (response CreateWalletAdminOperation404JSONResponse) VisitCreateWalletAdminOperationResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(404) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWalletAdminOperation409JSONResponse ApplicationError + +func (response CreateWalletAdminOperation409JSONResponse) VisitCreateWalletAdminOperationResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(409) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWalletAdminOperation500JSONResponse ApplicationError + +func (response CreateWalletAdminOperation500JSONResponse) VisitCreateWalletAdminOperationResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(500) + + return json.NewEncoder(w).Encode(response) +} + +type GetWalletAdminOperationRequestObject struct { + WalletId openapi_types.UUID `json:"wallet_id"` + AdminOperationId openapi_types.UUID `json:"admin_operation_id"` +} + +type GetWalletAdminOperationResponseObject interface { + VisitGetWalletAdminOperationResponse(w http.ResponseWriter) error +} + +type GetWalletAdminOperation200JSONResponse WalletAdminOperation + +func (response GetWalletAdminOperation200JSONResponse) VisitGetWalletAdminOperationResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(200) + + return json.NewEncoder(w).Encode(response) +} + +type GetWalletAdminOperation401JSONResponse struct { + OrganizationNotFoundJSONResponse +} + +func (response GetWalletAdminOperation401JSONResponse) VisitGetWalletAdminOperationResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(401) + + return json.NewEncoder(w).Encode(response) +} + +type GetWalletAdminOperation403JSONResponse struct{ PermissionDeniedJSONResponse } + +func (response GetWalletAdminOperation403JSONResponse) VisitGetWalletAdminOperationResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(403) + + return json.NewEncoder(w).Encode(response) +} + +type GetWalletAdminOperation404JSONResponse ApplicationError + +func (response GetWalletAdminOperation404JSONResponse) VisitGetWalletAdminOperationResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(404) + + return json.NewEncoder(w).Encode(response) +} + +type GetWalletAdminOperation500JSONResponse ApplicationError + +func (response GetWalletAdminOperation500JSONResponse) VisitGetWalletAdminOperationResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(500) + + return json.NewEncoder(w).Encode(response) +} + +type ListWalletUpgradesRequestObject struct { + WalletId openapi_types.UUID `json:"wallet_id"` + Params ListWalletUpgradesParams +} -func (response CreateWallet400JSONResponse) VisitCreateWalletResponse(w http.ResponseWriter) error { +type ListWalletUpgradesResponseObject interface { + VisitListWalletUpgradesResponse(w http.ResponseWriter) error +} + +type ListWalletUpgrades200JSONResponse WalletUpgradeList + +func (response ListWalletUpgrades200JSONResponse) VisitListWalletUpgradesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") - w.WriteHeader(400) + w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type CreateWallet401JSONResponse struct { +type ListWalletUpgrades401JSONResponse struct { OrganizationNotFoundJSONResponse } -func (response CreateWallet401JSONResponse) VisitCreateWalletResponse(w http.ResponseWriter) error { +func (response ListWalletUpgrades401JSONResponse) VisitListWalletUpgradesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(401) return json.NewEncoder(w).Encode(response) } -type CreateWallet403JSONResponse struct{ PermissionDeniedJSONResponse } +type ListWalletUpgrades403JSONResponse struct{ PermissionDeniedJSONResponse } -func (response CreateWallet403JSONResponse) VisitCreateWalletResponse(w http.ResponseWriter) error { +func (response ListWalletUpgrades403JSONResponse) VisitListWalletUpgradesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(403) return json.NewEncoder(w).Encode(response) } -type CreateWallet409JSONResponse ApplicationError +type ListWalletUpgrades404JSONResponse ApplicationError -func (response CreateWallet409JSONResponse) VisitCreateWalletResponse(w http.ResponseWriter) error { +func (response ListWalletUpgrades404JSONResponse) VisitListWalletUpgradesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") - w.WriteHeader(409) + w.WriteHeader(404) return json.NewEncoder(w).Encode(response) } -type CreateWallet500JSONResponse ApplicationError +type ListWalletUpgrades500JSONResponse ApplicationError -func (response CreateWallet500JSONResponse) VisitCreateWalletResponse(w http.ResponseWriter) error { +func (response ListWalletUpgrades500JSONResponse) VisitListWalletUpgradesResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(500) return json.NewEncoder(w).Encode(response) } -type GetWalletRequestObject struct { +type CreateWalletUpgradeRequestObject struct { WalletId openapi_types.UUID `json:"wallet_id"` + Body *CreateWalletUpgradeJSONRequestBody } -type GetWalletResponseObject interface { - VisitGetWalletResponse(w http.ResponseWriter) error +type CreateWalletUpgradeResponseObject interface { + VisitCreateWalletUpgradeResponse(w http.ResponseWriter) error } -type GetWallet200JSONResponse Wallet +type CreateWalletUpgrade202JSONResponse WalletUpgrade -func (response GetWallet200JSONResponse) VisitGetWalletResponse(w http.ResponseWriter) error { +func (response CreateWalletUpgrade202JSONResponse) VisitCreateWalletUpgradeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + w.WriteHeader(202) return json.NewEncoder(w).Encode(response) } -type GetWallet401JSONResponse struct { +type CreateWalletUpgrade400JSONResponse ApplicationError + +func (response CreateWalletUpgrade400JSONResponse) VisitCreateWalletUpgradeResponse(w http.ResponseWriter) error { + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(400) + + return json.NewEncoder(w).Encode(response) +} + +type CreateWalletUpgrade401JSONResponse struct { OrganizationNotFoundJSONResponse } -func (response GetWallet401JSONResponse) VisitGetWalletResponse(w http.ResponseWriter) error { +func (response CreateWalletUpgrade401JSONResponse) VisitCreateWalletUpgradeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(401) return json.NewEncoder(w).Encode(response) } -type GetWallet403JSONResponse struct{ PermissionDeniedJSONResponse } +type CreateWalletUpgrade403JSONResponse struct{ PermissionDeniedJSONResponse } -func (response GetWallet403JSONResponse) VisitGetWalletResponse(w http.ResponseWriter) error { +func (response CreateWalletUpgrade403JSONResponse) VisitCreateWalletUpgradeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(403) return json.NewEncoder(w).Encode(response) } -type GetWallet404JSONResponse ApplicationError +type CreateWalletUpgrade404JSONResponse ApplicationError -func (response GetWallet404JSONResponse) VisitGetWalletResponse(w http.ResponseWriter) error { +func (response CreateWalletUpgrade404JSONResponse) VisitCreateWalletUpgradeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(404) return json.NewEncoder(w).Encode(response) } -type GetWallet500JSONResponse ApplicationError +type CreateWalletUpgrade409JSONResponse ApplicationError -func (response GetWallet500JSONResponse) VisitGetWalletResponse(w http.ResponseWriter) error { +func (response CreateWalletUpgrade409JSONResponse) VisitCreateWalletUpgradeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") - w.WriteHeader(500) + w.WriteHeader(409) return json.NewEncoder(w).Encode(response) } -type UpdateWalletRequestObject struct { - WalletId openapi_types.UUID `json:"wallet_id"` - Body *UpdateWalletJSONRequestBody -} - -type UpdateWalletResponseObject interface { - VisitUpdateWalletResponse(w http.ResponseWriter) error -} - -type UpdateWallet200JSONResponse Wallet +type CreateWalletUpgrade500JSONResponse ApplicationError -func (response UpdateWallet200JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { +func (response CreateWalletUpgrade500JSONResponse) VisitCreateWalletUpgradeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") - w.WriteHeader(200) + w.WriteHeader(500) return json.NewEncoder(w).Encode(response) } -type UpdateWallet400JSONResponse ApplicationError +type GetWalletUpgradeRequestObject struct { + WalletId openapi_types.UUID `json:"wallet_id"` + UpgradeId openapi_types.UUID `json:"upgrade_id"` +} -func (response UpdateWallet400JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { +type GetWalletUpgradeResponseObject interface { + VisitGetWalletUpgradeResponse(w http.ResponseWriter) error +} + +type GetWalletUpgrade200JSONResponse WalletUpgrade + +func (response GetWalletUpgrade200JSONResponse) VisitGetWalletUpgradeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") - w.WriteHeader(400) + w.WriteHeader(200) return json.NewEncoder(w).Encode(response) } -type UpdateWallet401JSONResponse struct { +type GetWalletUpgrade401JSONResponse struct { OrganizationNotFoundJSONResponse } -func (response UpdateWallet401JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { +func (response GetWalletUpgrade401JSONResponse) VisitGetWalletUpgradeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(401) return json.NewEncoder(w).Encode(response) } -type UpdateWallet403JSONResponse struct{ PermissionDeniedJSONResponse } +type GetWalletUpgrade403JSONResponse struct{ PermissionDeniedJSONResponse } -func (response UpdateWallet403JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { +func (response GetWalletUpgrade403JSONResponse) VisitGetWalletUpgradeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(403) return json.NewEncoder(w).Encode(response) } -type UpdateWallet404JSONResponse ApplicationError +type GetWalletUpgrade404JSONResponse ApplicationError -func (response UpdateWallet404JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { +func (response GetWalletUpgrade404JSONResponse) VisitGetWalletUpgradeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(404) return json.NewEncoder(w).Encode(response) } -type UpdateWallet409JSONResponse ApplicationError - -func (response UpdateWallet409JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(409) - - return json.NewEncoder(w).Encode(response) -} - -type UpdateWallet500JSONResponse ApplicationError +type GetWalletUpgrade500JSONResponse ApplicationError -func (response UpdateWallet500JSONResponse) VisitUpdateWalletResponse(w http.ResponseWriter) error { +func (response GetWalletUpgrade500JSONResponse) VisitGetWalletUpgradeResponse(w http.ResponseWriter) error { w.Header().Set("Content-Type", "application/json") w.WriteHeader(500) @@ -4755,6 +5885,12 @@ type StrictServerInterface interface { // Retrieves available networks. // (GET /networks) ListNetworks(ctx context.Context, request ListNetworksRequestObject) (ListNetworksResponseObject, error) + // Retrieves published implementation versions for a wallet type. + // (GET /wallet-types/{wallet_type}/versions) + ListWalletTypeVersions(ctx context.Context, request ListWalletTypeVersionsRequestObject) (ListWalletTypeVersionsResponseObject, error) + // Retrieves one published implementation version for a wallet type. + // (GET /wallet-types/{wallet_type}/versions/{implementation_version}) + GetWalletTypeVersion(ctx context.Context, request GetWalletTypeVersionRequestObject) (GetWalletTypeVersionResponseObject, error) // Retrieves wallets for the organization. // (GET /wallets) ListWallets(ctx context.Context, request ListWalletsRequestObject) (ListWalletsResponseObject, error) @@ -4767,6 +5903,24 @@ type StrictServerInterface interface { // Updates a wallet name. // (PATCH /wallets/{wallet_id}) UpdateWallet(ctx context.Context, request UpdateWalletRequestObject) (UpdateWalletResponseObject, error) + // Retrieves administrative operations for a wallet. + // (GET /wallets/{wallet_id}/admin-operations) + ListWalletAdminOperations(ctx context.Context, request ListWalletAdminOperationsRequestObject) (ListWalletAdminOperationsResponseObject, error) + // Submits a signed administrative wallet operation. + // (POST /wallets/{wallet_id}/admin-operations) + CreateWalletAdminOperation(ctx context.Context, request CreateWalletAdminOperationRequestObject) (CreateWalletAdminOperationResponseObject, error) + // Retrieves one administrative wallet operation. + // (GET /wallets/{wallet_id}/admin-operations/{admin_operation_id}) + GetWalletAdminOperation(ctx context.Context, request GetWalletAdminOperationRequestObject) (GetWalletAdminOperationResponseObject, error) + // Retrieves the implementation version history for a wallet. + // (GET /wallets/{wallet_id}/upgrades) + ListWalletUpgrades(ctx context.Context, request ListWalletUpgradesRequestObject) (ListWalletUpgradesResponseObject, error) + // Submits a client-signed wallet upgrade. + // (POST /wallets/{wallet_id}/upgrades) + CreateWalletUpgrade(ctx context.Context, request CreateWalletUpgradeRequestObject) (CreateWalletUpgradeResponseObject, error) + // Retrieves one wallet upgrade. + // (GET /wallets/{wallet_id}/upgrades/{upgrade_id}) + GetWalletUpgrade(ctx context.Context, request GetWalletUpgradeRequestObject) (GetWalletUpgradeResponseObject, error) } type StrictHandlerFunc = strictgin.StrictGinHandlerFunc @@ -5382,6 +6536,62 @@ func (sh *strictHandler) ListNetworks(ctx *gin.Context) { } } +// ListWalletTypeVersions operation middleware +func (sh *strictHandler) ListWalletTypeVersions(ctx *gin.Context, walletType WalletType, params ListWalletTypeVersionsParams) { + var request ListWalletTypeVersionsRequestObject + + request.WalletType = walletType + request.Params = params + + handler := func(ctx *gin.Context, request interface{}) (interface{}, error) { + return sh.ssi.ListWalletTypeVersions(ctx, request.(ListWalletTypeVersionsRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "ListWalletTypeVersions") + } + + response, err := handler(ctx, request) + + if err != nil { + ctx.Error(err) + ctx.Status(http.StatusInternalServerError) + } else if validResponse, ok := response.(ListWalletTypeVersionsResponseObject); ok { + if err := validResponse.VisitListWalletTypeVersionsResponse(ctx.Writer); err != nil { + ctx.Error(err) + } + } else if response != nil { + ctx.Error(fmt.Errorf("unexpected response type: %T", response)) + } +} + +// GetWalletTypeVersion operation middleware +func (sh *strictHandler) GetWalletTypeVersion(ctx *gin.Context, walletType WalletType, implementationVersion string) { + var request GetWalletTypeVersionRequestObject + + request.WalletType = walletType + request.ImplementationVersion = implementationVersion + + handler := func(ctx *gin.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetWalletTypeVersion(ctx, request.(GetWalletTypeVersionRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetWalletTypeVersion") + } + + response, err := handler(ctx, request) + + if err != nil { + ctx.Error(err) + ctx.Status(http.StatusInternalServerError) + } else if validResponse, ok := response.(GetWalletTypeVersionResponseObject); ok { + if err := validResponse.VisitGetWalletTypeVersionResponse(ctx.Writer); err != nil { + ctx.Error(err) + } + } else if response != nil { + ctx.Error(fmt.Errorf("unexpected response type: %T", response)) + } +} + // ListWallets operation middleware func (sh *strictHandler) ListWallets(ctx *gin.Context, params ListWalletsParams) { var request ListWalletsRequestObject @@ -5503,3 +6713,185 @@ func (sh *strictHandler) UpdateWallet(ctx *gin.Context, walletId openapi_types.U ctx.Error(fmt.Errorf("unexpected response type: %T", response)) } } + +// ListWalletAdminOperations operation middleware +func (sh *strictHandler) ListWalletAdminOperations(ctx *gin.Context, walletId openapi_types.UUID, params ListWalletAdminOperationsParams) { + var request ListWalletAdminOperationsRequestObject + + request.WalletId = walletId + request.Params = params + + handler := func(ctx *gin.Context, request interface{}) (interface{}, error) { + return sh.ssi.ListWalletAdminOperations(ctx, request.(ListWalletAdminOperationsRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "ListWalletAdminOperations") + } + + response, err := handler(ctx, request) + + if err != nil { + ctx.Error(err) + ctx.Status(http.StatusInternalServerError) + } else if validResponse, ok := response.(ListWalletAdminOperationsResponseObject); ok { + if err := validResponse.VisitListWalletAdminOperationsResponse(ctx.Writer); err != nil { + ctx.Error(err) + } + } else if response != nil { + ctx.Error(fmt.Errorf("unexpected response type: %T", response)) + } +} + +// CreateWalletAdminOperation operation middleware +func (sh *strictHandler) CreateWalletAdminOperation(ctx *gin.Context, walletId openapi_types.UUID) { + var request CreateWalletAdminOperationRequestObject + + request.WalletId = walletId + + var body CreateWalletAdminOperationJSONRequestBody + if err := ctx.ShouldBindJSON(&body); err != nil { + ctx.Status(http.StatusBadRequest) + ctx.Error(err) + return + } + request.Body = &body + + handler := func(ctx *gin.Context, request interface{}) (interface{}, error) { + return sh.ssi.CreateWalletAdminOperation(ctx, request.(CreateWalletAdminOperationRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "CreateWalletAdminOperation") + } + + response, err := handler(ctx, request) + + if err != nil { + ctx.Error(err) + ctx.Status(http.StatusInternalServerError) + } else if validResponse, ok := response.(CreateWalletAdminOperationResponseObject); ok { + if err := validResponse.VisitCreateWalletAdminOperationResponse(ctx.Writer); err != nil { + ctx.Error(err) + } + } else if response != nil { + ctx.Error(fmt.Errorf("unexpected response type: %T", response)) + } +} + +// GetWalletAdminOperation operation middleware +func (sh *strictHandler) GetWalletAdminOperation(ctx *gin.Context, walletId openapi_types.UUID, adminOperationId openapi_types.UUID) { + var request GetWalletAdminOperationRequestObject + + request.WalletId = walletId + request.AdminOperationId = adminOperationId + + handler := func(ctx *gin.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetWalletAdminOperation(ctx, request.(GetWalletAdminOperationRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetWalletAdminOperation") + } + + response, err := handler(ctx, request) + + if err != nil { + ctx.Error(err) + ctx.Status(http.StatusInternalServerError) + } else if validResponse, ok := response.(GetWalletAdminOperationResponseObject); ok { + if err := validResponse.VisitGetWalletAdminOperationResponse(ctx.Writer); err != nil { + ctx.Error(err) + } + } else if response != nil { + ctx.Error(fmt.Errorf("unexpected response type: %T", response)) + } +} + +// ListWalletUpgrades operation middleware +func (sh *strictHandler) ListWalletUpgrades(ctx *gin.Context, walletId openapi_types.UUID, params ListWalletUpgradesParams) { + var request ListWalletUpgradesRequestObject + + request.WalletId = walletId + request.Params = params + + handler := func(ctx *gin.Context, request interface{}) (interface{}, error) { + return sh.ssi.ListWalletUpgrades(ctx, request.(ListWalletUpgradesRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "ListWalletUpgrades") + } + + response, err := handler(ctx, request) + + if err != nil { + ctx.Error(err) + ctx.Status(http.StatusInternalServerError) + } else if validResponse, ok := response.(ListWalletUpgradesResponseObject); ok { + if err := validResponse.VisitListWalletUpgradesResponse(ctx.Writer); err != nil { + ctx.Error(err) + } + } else if response != nil { + ctx.Error(fmt.Errorf("unexpected response type: %T", response)) + } +} + +// CreateWalletUpgrade operation middleware +func (sh *strictHandler) CreateWalletUpgrade(ctx *gin.Context, walletId openapi_types.UUID) { + var request CreateWalletUpgradeRequestObject + + request.WalletId = walletId + + var body CreateWalletUpgradeJSONRequestBody + if err := ctx.ShouldBindJSON(&body); err != nil { + ctx.Status(http.StatusBadRequest) + ctx.Error(err) + return + } + request.Body = &body + + handler := func(ctx *gin.Context, request interface{}) (interface{}, error) { + return sh.ssi.CreateWalletUpgrade(ctx, request.(CreateWalletUpgradeRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "CreateWalletUpgrade") + } + + response, err := handler(ctx, request) + + if err != nil { + ctx.Error(err) + ctx.Status(http.StatusInternalServerError) + } else if validResponse, ok := response.(CreateWalletUpgradeResponseObject); ok { + if err := validResponse.VisitCreateWalletUpgradeResponse(ctx.Writer); err != nil { + ctx.Error(err) + } + } else if response != nil { + ctx.Error(fmt.Errorf("unexpected response type: %T", response)) + } +} + +// GetWalletUpgrade operation middleware +func (sh *strictHandler) GetWalletUpgrade(ctx *gin.Context, walletId openapi_types.UUID, upgradeId openapi_types.UUID) { + var request GetWalletUpgradeRequestObject + + request.WalletId = walletId + request.UpgradeId = upgradeId + + handler := func(ctx *gin.Context, request interface{}) (interface{}, error) { + return sh.ssi.GetWalletUpgrade(ctx, request.(GetWalletUpgradeRequestObject)) + } + for _, middleware := range sh.middlewares { + handler = middleware(handler, "GetWalletUpgrade") + } + + response, err := handler(ctx, request) + + if err != nil { + ctx.Error(err) + ctx.Status(http.StatusInternalServerError) + } else if validResponse, ok := response.(GetWalletUpgradeResponseObject); ok { + if err := validResponse.VisitGetWalletUpgradeResponse(ctx.Writer); err != nil { + ctx.Error(err) + } + } else if response != nil { + ctx.Error(fmt.Errorf("unexpected response type: %T", response)) + } +} diff --git a/stdserver/stdserver.gen.go b/stdserver/stdserver.gen.go index 7570361..819fc41 100644 --- a/stdserver/stdserver.gen.go +++ b/stdserver/stdserver.gen.go @@ -32,23 +32,36 @@ const ( // Defines values for ApplicationErrorCode. const ( - ApplicationErrorCodeChainUnavailable ApplicationErrorCode = "CHAIN_UNAVAILABLE" - ApplicationErrorCodeChannelAlreadyExists ApplicationErrorCode = "CHANNEL_ALREADY_EXISTS" - ApplicationErrorCodeChannelArchived ApplicationErrorCode = "CHANNEL_ARCHIVED" - ApplicationErrorCodeChannelNotFound ApplicationErrorCode = "CHANNEL_NOT_FOUND" - ApplicationErrorCodeIdempotencyKeyMismatch ApplicationErrorCode = "IDEMPOTENCY_KEY_MISMATCH" - ApplicationErrorCodeOperationDeadlineElapsed ApplicationErrorCode = "OPERATION_DEADLINE_ELAPSED" - ApplicationErrorCodeOperationNotCancellable ApplicationErrorCode = "OPERATION_NOT_CANCELLABLE" - ApplicationErrorCodeOperationNotFinalizable ApplicationErrorCode = "OPERATION_NOT_FINALIZABLE" - ApplicationErrorCodeOperationNotFound ApplicationErrorCode = "OPERATION_NOT_FOUND" - ApplicationErrorCodeQueryNotFound ApplicationErrorCode = "QUERY_NOT_FOUND" - ApplicationErrorCodeResourceVersionConflict ApplicationErrorCode = "RESOURCE_VERSION_CONFLICT" - ApplicationErrorCodeWalletAlreadyArchived ApplicationErrorCode = "WALLET_ALREADY_ARCHIVED" - ApplicationErrorCodeWalletAlreadyExists ApplicationErrorCode = "WALLET_ALREADY_EXISTS" - ApplicationErrorCodeWalletNotFound ApplicationErrorCode = "WALLET_NOT_FOUND" - ApplicationErrorCodeWalletNotReady ApplicationErrorCode = "WALLET_NOT_READY" - ApplicationErrorCodeWatcherAlreadyExists ApplicationErrorCode = "WATCHER_ALREADY_EXISTS" - ApplicationErrorCodeWatcherNotFound ApplicationErrorCode = "WATCHER_NOT_FOUND" + ApplicationErrorCodeChainUnavailable ApplicationErrorCode = "CHAIN_UNAVAILABLE" + ApplicationErrorCodeChannelAlreadyExists ApplicationErrorCode = "CHANNEL_ALREADY_EXISTS" + ApplicationErrorCodeChannelArchived ApplicationErrorCode = "CHANNEL_ARCHIVED" + ApplicationErrorCodeChannelNotFound ApplicationErrorCode = "CHANNEL_NOT_FOUND" + ApplicationErrorCodeEntryPointNotRecognized ApplicationErrorCode = "ENTRY_POINT_NOT_RECOGNIZED" + ApplicationErrorCodeIdempotencyKeyMismatch ApplicationErrorCode = "IDEMPOTENCY_KEY_MISMATCH" + ApplicationErrorCodeOperationDeadlineElapsed ApplicationErrorCode = "OPERATION_DEADLINE_ELAPSED" + ApplicationErrorCodeOperationNotCancellable ApplicationErrorCode = "OPERATION_NOT_CANCELLABLE" + ApplicationErrorCodeOperationNotFinalizable ApplicationErrorCode = "OPERATION_NOT_FINALIZABLE" + ApplicationErrorCodeOperationNotFound ApplicationErrorCode = "OPERATION_NOT_FOUND" + ApplicationErrorCodeQueryNotFound ApplicationErrorCode = "QUERY_NOT_FOUND" + ApplicationErrorCodeResourceVersionConflict ApplicationErrorCode = "RESOURCE_VERSION_CONFLICT" + ApplicationErrorCodeWalletAdminOperationNotFound ApplicationErrorCode = "WALLET_ADMIN_OPERATION_NOT_FOUND" + ApplicationErrorCodeWalletAdminOperationPayloadMismatch ApplicationErrorCode = "WALLET_ADMIN_OPERATION_PAYLOAD_MISMATCH" + ApplicationErrorCodeWalletAlreadyArchived ApplicationErrorCode = "WALLET_ALREADY_ARCHIVED" + ApplicationErrorCodeWalletAlreadyExists ApplicationErrorCode = "WALLET_ALREADY_EXISTS" + ApplicationErrorCodeWalletCapabilityNotSupported ApplicationErrorCode = "WALLET_CAPABILITY_NOT_SUPPORTED" + ApplicationErrorCodeWalletNotFound ApplicationErrorCode = "WALLET_NOT_FOUND" + ApplicationErrorCodeWalletNotReady ApplicationErrorCode = "WALLET_NOT_READY" + ApplicationErrorCodeWalletNotUpgradeable ApplicationErrorCode = "WALLET_NOT_UPGRADEABLE" + ApplicationErrorCodeWalletTypeVersionDeprecated ApplicationErrorCode = "WALLET_TYPE_VERSION_DEPRECATED" + ApplicationErrorCodeWalletTypeVersionNotDeployed ApplicationErrorCode = "WALLET_TYPE_VERSION_NOT_DEPLOYED" + ApplicationErrorCodeWalletTypeVersionNotFound ApplicationErrorCode = "WALLET_TYPE_VERSION_NOT_FOUND" + ApplicationErrorCodeWalletUpgradeInProgress ApplicationErrorCode = "WALLET_UPGRADE_IN_PROGRESS" + ApplicationErrorCodeWalletUpgradeNotFound ApplicationErrorCode = "WALLET_UPGRADE_NOT_FOUND" + ApplicationErrorCodeWalletUpgradePayloadMismatch ApplicationErrorCode = "WALLET_UPGRADE_PAYLOAD_MISMATCH" + ApplicationErrorCodeWalletUpgradeTargetAlreadyRecorded ApplicationErrorCode = "WALLET_UPGRADE_TARGET_ALREADY_RECORDED" + ApplicationErrorCodeWalletUpgradeTypeMismatch ApplicationErrorCode = "WALLET_UPGRADE_TYPE_MISMATCH" + ApplicationErrorCodeWatcherAlreadyExists ApplicationErrorCode = "WATCHER_ALREADY_EXISTS" + ApplicationErrorCodeWatcherNotFound ApplicationErrorCode = "WATCHER_NOT_FOUND" ) // Defines values for BlockNumberBlockSelectionType. @@ -146,6 +159,7 @@ const ( WalletStatusDeploying WalletStatus = "deploying" WalletStatusFailed WalletStatus = "failed" WalletStatusPending WalletStatus = "pending" + WalletStatusUpgrading WalletStatus = "upgrading" ) // Defines values for WalletType. @@ -156,6 +170,26 @@ const ( WalletTypeRSA WalletType = "rsa" ) +// Defines values for WalletTypeVersionStatus. +const ( + WalletTypeVersionStatusActive WalletTypeVersionStatus = "active" + WalletTypeVersionStatusDeprecated WalletTypeVersionStatus = "deprecated" +) + +// Defines values for WalletUpgradeOutcome. +const ( + WalletUpgradeOutcomeExpired WalletUpgradeOutcome = "expired" + WalletUpgradeOutcomeFailed WalletUpgradeOutcome = "failed" + WalletUpgradeOutcomePending WalletUpgradeOutcome = "pending" + WalletUpgradeOutcomeSucceeded WalletUpgradeOutcome = "succeeded" +) + +// Defines values for WalletVersionChangeSource. +const ( + WalletVersionChangeSourceCRECUpgrade WalletVersionChangeSource = "crec_upgrade" + WalletVersionChangeSourceOperatorCorrection WalletVersionChangeSource = "operator_correction" +) + // Defines values for WatcherStatus. const ( WatcherStatusActive WatcherStatus = "active" @@ -168,6 +202,18 @@ const ( // Actor Resource attribution actor — ":" for a user, "api:" for an API key. type Actor = string +// AdminAuthorization Owner signature over an administrative capability's pinned EIP-712 struct. +type AdminAuthorization struct { + // Deadline Unix timestamp deadline for the authorization. Zero is rejected. + Deadline int64 `json:"deadline"` + + // Signature The owner's EIP-712 signature over the capability's pinned struct. + Signature OperationSignature `json:"signature"` + + // WalletOperationId The authorization's own identifier in the wallet's executed-operation namespace. Must differ from the enclosing operation's. + WalletOperationId WalletOperationId `json:"wallet_operation_id"` +} + // ApplicationError Standard error response body. type ApplicationError struct { // Code Machine-readable error code for classified tenant error responses. @@ -335,6 +381,36 @@ type CreateWallet struct { WalletType WalletType `json:"wallet_type"` } +// CreateWalletAdminOperation Request body for submitting a signed administrative wallet operation. +type CreateWalletAdminOperation struct { + // Arguments Values keyed by parameter name, canonically encoded: integers as decimal strings, addresses lowercase hex, absent distinguished from null. + Arguments map[string]interface{} `json:"arguments"` + + // Authorization Owner signature over an administrative capability's pinned EIP-712 struct. + Authorization AdminAuthorization `json:"authorization"` + + // Capability A name the wallet's version row publishes. An unpublished name is rejected. + Capability string `json:"capability"` + + // Operation Request body for creating a signed operation or a draft when the signature is omitted. + Operation CreateOperation `json:"operation"` +} + +// CreateWalletUpgrade Request body for submitting a client-signed wallet upgrade. +type CreateWalletUpgrade struct { + // Authorization Owner signature over an administrative capability's pinned EIP-712 struct. + Authorization AdminAuthorization `json:"authorization"` + + // ImplementationAddress What the authorization commits to. Must equal the catalog's address for target_version on the wallet's network, both as declared and as decoded from the packed calldata. + ImplementationAddress EthereumAddress `json:"implementation_address"` + + // Operation Request body for creating a signed operation or a draft when the signature is omitted. + Operation CreateOperation `json:"operation"` + + // TargetVersion A label the wallet type's catalog publishes. + TargetVersion string `json:"target_version"` +} + // CreateWatcher Request body for creating a new watcher (service-based or ABI-based). type CreateWatcher struct { union json.RawMessage @@ -986,12 +1062,24 @@ type Wallet struct { // CreatedBy Actor that created the resource. Null when there is no attributable subject (e.g. background job). CreatedBy *Actor `json:"created_by"` + // DefaultVersion The wallet type's default version, the one new wallets of this type deploy at. + DefaultVersion *string `json:"default_version"` + // Description Description of the wallet Description *string `json:"description,omitempty"` + // ImplementationVersion Operator-assigned implementation version label the wallet is recorded on. Opaque, never ordered or parsed. Null where no version is recorded. + ImplementationVersion *string `json:"implementation_version"` + + // IsUpgradeable Whether the wallet's recorded version can be upgraded through CREC. False while the wallet cannot be upgraded through CREC. + IsUpgradeable *bool `json:"is_upgradeable,omitempty"` + // Name Name of the wallet Name string `json:"name"` + // OnDefaultVersion True when the wallet's recorded version is the type's default. + OnDefaultVersion *bool `json:"on_default_version,omitempty"` + // Status Status of a wallet entity Status WalletStatus `json:"status"` @@ -1014,6 +1102,62 @@ type Wallet struct { WalletType WalletType `json:"wallet_type"` } +// WalletAdminOperation A signature-authorized administrative wallet operation. +type WalletAdminOperation struct { + // AdminOperationId The internal operation's identifier + AdminOperationId openapi_types.UUID `json:"admin_operation_id"` + + // Arguments As submitted, canonically encoded + Arguments map[string]interface{} `json:"arguments"` + + // AuthorizedKey 42-character hex Ethereum address + AuthorizedKey EthereumAddress `json:"authorized_key"` + + // Capability The capability the operation exercises + Capability string `json:"capability"` + + // CreatedAt Unix timestamp in seconds + CreatedAt Timestamp `json:"created_at"` + + // FailureReason The onchain revert reason, verbatim. + FailureReason *string `json:"failure_reason,omitempty"` + + // OperationStatus The underlying lifecycle status while the operation is in flight. + OperationStatus *OperationStatus `json:"operation_status,omitempty"` + + // Outcome Outcome of a wallet upgrade or administrative operation. + Outcome WalletUpgradeOutcome `json:"outcome"` + + // RequestedBy Subject used to describe who initiated, signed, or cancelled an operation. `subject_name` is informational; `subject_id` remains the stable identifier for filtering and equality. + RequestedBy Subject `json:"requested_by"` + + // UpdatedAt Unix timestamp in seconds + UpdatedAt Timestamp `json:"updated_at"` + + // WalletId Unique identifier for the wallet + WalletId openapi_types.UUID `json:"wallet_id"` +} + +// WalletAdminOperationList Paginated list of administrative wallet operations. +type WalletAdminOperationList struct { + Data []WalletAdminOperation `json:"data"` + + // HasMore True if there are more administrative operations to fetch + HasMore bool `json:"has_more"` +} + +// WalletCapabilityDescriptor A non-upgrade administrative capability a wallet type implementation version publishes. +type WalletCapabilityDescriptor struct { + // AbiFragment Full ABI function object with parameter names and types. The packed result includes the 4-byte selector. + AbiFragment map[string]interface{} `json:"abi_fragment"` + + // Eip712Type The pinned EIP-712 type string for this capability's signed struct. + Eip712Type string `json:"eip712_type"` + + // Name The capability name an administrative operation submission names. + Name string `json:"name"` +} + // WalletConfiguration Type-specific wallet configuration. The structure depends on the accompanying wallet_type and is validated by the server at wallet-creation time, not by this schema - this allows wallet types unknown to this spec (e.g. third-party types registered directly in the courier) to carry their own configuration shape. type WalletConfiguration map[string]interface{} @@ -1039,6 +1183,9 @@ type WalletStatusPayload struct { // ChainSelector Chain selector identifier for the blockchain network ChainSelector string `json:"chain_selector"` + // ImplementationVersion Implementation version recorded for the wallet after the status change. An upgrade's outcome arrives on this field. + ImplementationVersion *string `json:"implementation_version"` + // Status Status of a wallet entity Status WalletStatus `json:"status"` @@ -1055,6 +1202,115 @@ type WalletStatusPayload struct { // WalletType Type of wallet type WalletType string +// WalletTypeVersion A published implementation version of a wallet type. +type WalletTypeVersion struct { + // Capabilities The non-upgrade administrative capabilities this implementation publishes. Empty on backfilled legacy rows. + Capabilities []WalletCapabilityDescriptor `json:"capabilities"` + + // Changelog Release notes for the version. + Changelog *string `json:"changelog,omitempty"` + + // CreatedAt Unix timestamp in seconds + CreatedAt Timestamp `json:"created_at"` + + // Deployments Per-network implementation addresses. Filtered to chain_selector when the query parameter is present. + Deployments []WalletTypeVersionDeployment `json:"deployments"` + + // ImplementationVersion Operator-assigned label, unique per wallet type. Opaque, never ordered or parsed. + ImplementationVersion string `json:"implementation_version"` + + // IsDefault The version new wallets of this type deploy at. Exactly one per wallet type. + IsDefault bool `json:"is_default"` + + // IsUpgradeable Whether a wallet recorded on this version can be upgraded through CREC. False on backfilled legacy rows. + IsUpgradeable bool `json:"is_upgradeable"` + + // Status Support state of a wallet type implementation version. A deprecated version is not a supported upgrade target. + Status WalletTypeVersionStatus `json:"status"` + + // WalletType Type of wallet + WalletType WalletType `json:"wallet_type"` +} + +// WalletTypeVersionDeployment One network's implementation address for a wallet type version. +type WalletTypeVersionDeployment struct { + // ChainSelector Chain selector identifier for the blockchain network + ChainSelector ChainSelector `json:"chain_selector"` + + // ImplementationAddress Implementation address for the version on the network. Lowercase hex. + ImplementationAddress EthereumAddress `json:"implementation_address"` +} + +// WalletTypeVersionList List of published implementation versions for a wallet type. +type WalletTypeVersionList struct { + Data []WalletTypeVersion `json:"data"` + + // HasMore True if there are more versions to fetch + HasMore bool `json:"has_more"` +} + +// WalletTypeVersionStatus Support state of a wallet type implementation version. A deprecated version is not a supported upgrade target. +type WalletTypeVersionStatus string + +// WalletUpgrade A wallet implementation version change. +type WalletUpgrade struct { + // AuthorizedKey The owner key that signed. Null on a correction. + AuthorizedKey *EthereumAddress `json:"authorized_key"` + + // CreatedAt Unix timestamp in seconds + CreatedAt Timestamp `json:"created_at"` + + // FailureReason The onchain revert reason, verbatim. + FailureReason *string `json:"failure_reason,omitempty"` + + // FromVersion The version recorded when the event began. Null where none was recorded. + FromVersion *string `json:"from_version"` + + // ImplementationAddress The implementation address the authorization commits to. Null on a correction. + ImplementationAddress *EthereumAddress `json:"implementation_address"` + + // OperationId The internal operation. Null on a correction. + OperationId *openapi_types.UUID `json:"operation_id"` + + // OperationStatus The underlying lifecycle status while the upgrade is in flight. + OperationStatus *OperationStatus `json:"operation_status,omitempty"` + + // Outcome Outcome of a wallet upgrade or administrative operation. + Outcome WalletUpgradeOutcome `json:"outcome"` + + // RequestedBy Subject used to describe who initiated, signed, or cancelled an operation. `subject_name` is informational; `subject_id` remains the stable identifier for filtering and equality. + RequestedBy Subject `json:"requested_by"` + + // Source Writer of a wallet's recorded implementation version. + Source WalletVersionChangeSource `json:"source"` + + // ToVersion The version the wallet is recorded on after the event. + ToVersion string `json:"to_version"` + + // UpdatedAt Unix timestamp in seconds + UpdatedAt Timestamp `json:"updated_at"` + + // UpgradeId Unique identifier for the upgrade + UpgradeId openapi_types.UUID `json:"upgrade_id"` + + // WalletId Unique identifier for the wallet + WalletId openapi_types.UUID `json:"wallet_id"` +} + +// WalletUpgradeList Paginated list of wallet implementation version changes. +type WalletUpgradeList struct { + Data []WalletUpgrade `json:"data"` + + // HasMore True if there are more upgrades to fetch + HasMore bool `json:"has_more"` +} + +// WalletUpgradeOutcome Outcome of a wallet upgrade or administrative operation. +type WalletUpgradeOutcome string + +// WalletVersionChangeSource Writer of a wallet's recorded implementation version. +type WalletVersionChangeSource string + // Watcher A watcher resource. type Watcher struct { // Abi ABI definitions for the events (if not using service-based events) @@ -1387,6 +1643,15 @@ type ListWatchersParams struct { EventName *string `form:"event_name,omitempty" json:"event_name,omitempty"` } +// ListWalletTypeVersionsParams defines parameters for ListWalletTypeVersions. +type ListWalletTypeVersionsParams struct { + // ChainSelector Filter deployments to a chain selector. Versions with no deployment on that chain are still returned. + ChainSelector *ChainSelector `form:"chain_selector,omitempty" json:"chain_selector,omitempty"` + + // Status Filter versions by support state. + Status *WalletTypeVersionStatus `form:"status,omitempty" json:"status,omitempty"` +} + // ListWalletsParams defines parameters for ListWallets. type ListWalletsParams struct { // Name Filter wallets by name (case-insensitive partial match) @@ -1407,6 +1672,9 @@ type ListWalletsParams struct { // Status Filter wallets by status. Multiple values allowed. Archived wallets are excluded by default when no status filter is specified. Status *[]WalletStatus `form:"status,omitempty" json:"status,omitempty"` + // ImplementationVersion Filter wallets by recorded implementation version + ImplementationVersion *string `form:"implementation_version,omitempty" json:"implementation_version,omitempty"` + // ChainEnvironment Filter wallets by chain environment (mainnet or testnet). If omitted, returns all chain environments. ChainEnvironment *ChainEnvironment `form:"chain_environment,omitempty" json:"chain_environment,omitempty"` @@ -1417,6 +1685,30 @@ type ListWalletsParams struct { Offset *int64 `form:"offset,omitempty" json:"offset,omitempty"` } +// ListWalletAdminOperationsParams defines parameters for ListWalletAdminOperations. +type ListWalletAdminOperationsParams struct { + // Limit Maximum number of administrative operations to return + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Number of administrative operations to skip for pagination + Offset *int64 `form:"offset,omitempty" json:"offset,omitempty"` +} + +// ListWalletUpgradesParams defines parameters for ListWalletUpgrades. +type ListWalletUpgradesParams struct { + // Limit Maximum number of upgrades to return + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Number of upgrades to skip for pagination + Offset *int64 `form:"offset,omitempty" json:"offset,omitempty"` + + // Source Filter upgrades by source + Source *WalletVersionChangeSource `form:"source,omitempty" json:"source,omitempty"` + + // Outcome Filter upgrades by outcome + Outcome *WalletUpgradeOutcome `form:"outcome,omitempty" json:"outcome,omitempty"` +} + // CreateChannelJSONRequestBody defines body for CreateChannel for application/json ContentType. type CreateChannelJSONRequestBody = CreateChannel @@ -1444,6 +1736,12 @@ type CreateWalletJSONRequestBody = CreateWallet // UpdateWalletJSONRequestBody defines body for UpdateWallet for application/json ContentType. type UpdateWalletJSONRequestBody = UpdateWallet +// CreateWalletAdminOperationJSONRequestBody defines body for CreateWalletAdminOperation for application/json ContentType. +type CreateWalletAdminOperationJSONRequestBody = CreateWalletAdminOperation + +// CreateWalletUpgradeJSONRequestBody defines body for CreateWalletUpgrade for application/json ContentType. +type CreateWalletUpgradeJSONRequestBody = CreateWalletUpgrade + // Getter for additional properties for GenericProofObject. Returns the specified // element and whether it was found func (a GenericProofObject) Get(fieldName string) (value interface{}, found bool) { @@ -2046,6 +2344,12 @@ type ServerInterface interface { // Retrieves available networks. // (GET /networks) ListNetworks(w http.ResponseWriter, r *http.Request) + // Retrieves published implementation versions for a wallet type. + // (GET /wallet-types/{wallet_type}/versions) + ListWalletTypeVersions(w http.ResponseWriter, r *http.Request, walletType WalletType, params ListWalletTypeVersionsParams) + // Retrieves one published implementation version for a wallet type. + // (GET /wallet-types/{wallet_type}/versions/{implementation_version}) + GetWalletTypeVersion(w http.ResponseWriter, r *http.Request, walletType WalletType, implementationVersion string) // Retrieves wallets for the organization. // (GET /wallets) ListWallets(w http.ResponseWriter, r *http.Request, params ListWalletsParams) @@ -2058,6 +2362,24 @@ type ServerInterface interface { // Updates a wallet name. // (PATCH /wallets/{wallet_id}) UpdateWallet(w http.ResponseWriter, r *http.Request, walletId openapi_types.UUID) + // Retrieves administrative operations for a wallet. + // (GET /wallets/{wallet_id}/admin-operations) + ListWalletAdminOperations(w http.ResponseWriter, r *http.Request, walletId openapi_types.UUID, params ListWalletAdminOperationsParams) + // Submits a signed administrative wallet operation. + // (POST /wallets/{wallet_id}/admin-operations) + CreateWalletAdminOperation(w http.ResponseWriter, r *http.Request, walletId openapi_types.UUID) + // Retrieves one administrative wallet operation. + // (GET /wallets/{wallet_id}/admin-operations/{admin_operation_id}) + GetWalletAdminOperation(w http.ResponseWriter, r *http.Request, walletId openapi_types.UUID, adminOperationId openapi_types.UUID) + // Retrieves the implementation version history for a wallet. + // (GET /wallets/{wallet_id}/upgrades) + ListWalletUpgrades(w http.ResponseWriter, r *http.Request, walletId openapi_types.UUID, params ListWalletUpgradesParams) + // Submits a client-signed wallet upgrade. + // (POST /wallets/{wallet_id}/upgrades) + CreateWalletUpgrade(w http.ResponseWriter, r *http.Request, walletId openapi_types.UUID) + // Retrieves one wallet upgrade. + // (GET /wallets/{wallet_id}/upgrades/{upgrade_id}) + GetWalletUpgrade(w http.ResponseWriter, r *http.Request, walletId openapi_types.UUID, upgradeId openapi_types.UUID) } // ServerInterfaceWrapper converts contexts to parameters. @@ -3135,6 +3457,96 @@ func (siw *ServerInterfaceWrapper) ListNetworks(w http.ResponseWriter, r *http.R handler.ServeHTTP(w, r) } +// ListWalletTypeVersions operation middleware +func (siw *ServerInterfaceWrapper) ListWalletTypeVersions(w http.ResponseWriter, r *http.Request) { + + var err error + + // ------------- Path parameter "wallet_type" ------------- + var walletType WalletType + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_type", r.PathValue("wallet_type"), &walletType, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "wallet_type", Err: err}) + return + } + + ctx := r.Context() + + ctx = context.WithValue(ctx, ApiKeyAuthScopes, []string{}) + + r = r.WithContext(ctx) + + // Parameter object where we will unmarshal all parameters from the context + var params ListWalletTypeVersionsParams + + // ------------- Optional query parameter "chain_selector" ------------- + + err = runtime.BindQueryParameter("form", true, false, "chain_selector", r.URL.Query(), ¶ms.ChainSelector) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "chain_selector", Err: err}) + return + } + + // ------------- Optional query parameter "status" ------------- + + err = runtime.BindQueryParameter("form", true, false, "status", r.URL.Query(), ¶ms.Status) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "status", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ListWalletTypeVersions(w, r, walletType, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r) +} + +// GetWalletTypeVersion operation middleware +func (siw *ServerInterfaceWrapper) GetWalletTypeVersion(w http.ResponseWriter, r *http.Request) { + + var err error + + // ------------- Path parameter "wallet_type" ------------- + var walletType WalletType + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_type", r.PathValue("wallet_type"), &walletType, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "wallet_type", Err: err}) + return + } + + // ------------- Path parameter "implementation_version" ------------- + var implementationVersion string + + err = runtime.BindStyledParameterWithOptions("simple", "implementation_version", r.PathValue("implementation_version"), &implementationVersion, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "implementation_version", Err: err}) + return + } + + ctx := r.Context() + + ctx = context.WithValue(ctx, ApiKeyAuthScopes, []string{}) + + r = r.WithContext(ctx) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetWalletTypeVersion(w, r, walletType, implementationVersion) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r) +} + // ListWallets operation middleware func (siw *ServerInterfaceWrapper) ListWallets(w http.ResponseWriter, r *http.Request) { @@ -3197,6 +3609,14 @@ func (siw *ServerInterfaceWrapper) ListWallets(w http.ResponseWriter, r *http.Re return } + // ------------- Optional query parameter "implementation_version" ------------- + + err = runtime.BindQueryParameter("form", true, false, "implementation_version", r.URL.Query(), ¶ms.ImplementationVersion) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "implementation_version", Err: err}) + return + } + // ------------- Optional query parameter "chain_environment" ------------- err = runtime.BindQueryParameter("form", true, false, "chain_environment", r.URL.Query(), ¶ms.ChainEnvironment) @@ -3314,6 +3734,264 @@ func (siw *ServerInterfaceWrapper) UpdateWallet(w http.ResponseWriter, r *http.R handler.ServeHTTP(w, r) } +// ListWalletAdminOperations operation middleware +func (siw *ServerInterfaceWrapper) ListWalletAdminOperations(w http.ResponseWriter, r *http.Request) { + + var err error + + // ------------- Path parameter "wallet_id" ------------- + var walletId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_id", r.PathValue("wallet_id"), &walletId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "wallet_id", Err: err}) + return + } + + ctx := r.Context() + + ctx = context.WithValue(ctx, ApiKeyAuthScopes, []string{}) + + r = r.WithContext(ctx) + + // Parameter object where we will unmarshal all parameters from the context + var params ListWalletAdminOperationsParams + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err}) + return + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameter("form", true, false, "offset", r.URL.Query(), ¶ms.Offset) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "offset", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ListWalletAdminOperations(w, r, walletId, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r) +} + +// CreateWalletAdminOperation operation middleware +func (siw *ServerInterfaceWrapper) CreateWalletAdminOperation(w http.ResponseWriter, r *http.Request) { + + var err error + + // ------------- Path parameter "wallet_id" ------------- + var walletId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_id", r.PathValue("wallet_id"), &walletId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "wallet_id", Err: err}) + return + } + + ctx := r.Context() + + ctx = context.WithValue(ctx, ApiKeyAuthScopes, []string{}) + + r = r.WithContext(ctx) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.CreateWalletAdminOperation(w, r, walletId) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r) +} + +// GetWalletAdminOperation operation middleware +func (siw *ServerInterfaceWrapper) GetWalletAdminOperation(w http.ResponseWriter, r *http.Request) { + + var err error + + // ------------- Path parameter "wallet_id" ------------- + var walletId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_id", r.PathValue("wallet_id"), &walletId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "wallet_id", Err: err}) + return + } + + // ------------- Path parameter "admin_operation_id" ------------- + var adminOperationId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "admin_operation_id", r.PathValue("admin_operation_id"), &adminOperationId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "admin_operation_id", Err: err}) + return + } + + ctx := r.Context() + + ctx = context.WithValue(ctx, ApiKeyAuthScopes, []string{}) + + r = r.WithContext(ctx) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetWalletAdminOperation(w, r, walletId, adminOperationId) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r) +} + +// ListWalletUpgrades operation middleware +func (siw *ServerInterfaceWrapper) ListWalletUpgrades(w http.ResponseWriter, r *http.Request) { + + var err error + + // ------------- Path parameter "wallet_id" ------------- + var walletId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_id", r.PathValue("wallet_id"), &walletId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "wallet_id", Err: err}) + return + } + + ctx := r.Context() + + ctx = context.WithValue(ctx, ApiKeyAuthScopes, []string{}) + + r = r.WithContext(ctx) + + // Parameter object where we will unmarshal all parameters from the context + var params ListWalletUpgradesParams + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameter("form", true, false, "limit", r.URL.Query(), ¶ms.Limit) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "limit", Err: err}) + return + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameter("form", true, false, "offset", r.URL.Query(), ¶ms.Offset) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "offset", Err: err}) + return + } + + // ------------- Optional query parameter "source" ------------- + + err = runtime.BindQueryParameter("form", true, false, "source", r.URL.Query(), ¶ms.Source) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "source", Err: err}) + return + } + + // ------------- Optional query parameter "outcome" ------------- + + err = runtime.BindQueryParameter("form", true, false, "outcome", r.URL.Query(), ¶ms.Outcome) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "outcome", Err: err}) + return + } + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.ListWalletUpgrades(w, r, walletId, params) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r) +} + +// CreateWalletUpgrade operation middleware +func (siw *ServerInterfaceWrapper) CreateWalletUpgrade(w http.ResponseWriter, r *http.Request) { + + var err error + + // ------------- Path parameter "wallet_id" ------------- + var walletId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_id", r.PathValue("wallet_id"), &walletId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "wallet_id", Err: err}) + return + } + + ctx := r.Context() + + ctx = context.WithValue(ctx, ApiKeyAuthScopes, []string{}) + + r = r.WithContext(ctx) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.CreateWalletUpgrade(w, r, walletId) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r) +} + +// GetWalletUpgrade operation middleware +func (siw *ServerInterfaceWrapper) GetWalletUpgrade(w http.ResponseWriter, r *http.Request) { + + var err error + + // ------------- Path parameter "wallet_id" ------------- + var walletId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "wallet_id", r.PathValue("wallet_id"), &walletId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "wallet_id", Err: err}) + return + } + + // ------------- Path parameter "upgrade_id" ------------- + var upgradeId openapi_types.UUID + + err = runtime.BindStyledParameterWithOptions("simple", "upgrade_id", r.PathValue("upgrade_id"), &upgradeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + siw.ErrorHandlerFunc(w, r, &InvalidParamFormatError{ParamName: "upgrade_id", Err: err}) + return + } + + ctx := r.Context() + + ctx = context.WithValue(ctx, ApiKeyAuthScopes, []string{}) + + r = r.WithContext(ctx) + + handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + siw.Handler.GetWalletUpgrade(w, r, walletId, upgradeId) + })) + + for _, middleware := range siw.HandlerMiddlewares { + handler = middleware(handler) + } + + handler.ServeHTTP(w, r) +} + type UnescapedCookieParamError struct { ParamName string Err error @@ -3454,10 +4132,18 @@ func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.H m.HandleFunc("PATCH "+options.BaseURL+"/channels/{channel_id}/watchers/{watcher_id}", wrapper.UpdateWatcher) m.HandleFunc("GET "+options.BaseURL+"/health-check", wrapper.GetHealthCheck) m.HandleFunc("GET "+options.BaseURL+"/networks", wrapper.ListNetworks) + m.HandleFunc("GET "+options.BaseURL+"/wallet-types/{wallet_type}/versions", wrapper.ListWalletTypeVersions) + m.HandleFunc("GET "+options.BaseURL+"/wallet-types/{wallet_type}/versions/{implementation_version}", wrapper.GetWalletTypeVersion) m.HandleFunc("GET "+options.BaseURL+"/wallets", wrapper.ListWallets) m.HandleFunc("POST "+options.BaseURL+"/wallets", wrapper.CreateWallet) m.HandleFunc("GET "+options.BaseURL+"/wallets/{wallet_id}", wrapper.GetWallet) m.HandleFunc("PATCH "+options.BaseURL+"/wallets/{wallet_id}", wrapper.UpdateWallet) + m.HandleFunc("GET "+options.BaseURL+"/wallets/{wallet_id}/admin-operations", wrapper.ListWalletAdminOperations) + m.HandleFunc("POST "+options.BaseURL+"/wallets/{wallet_id}/admin-operations", wrapper.CreateWalletAdminOperation) + m.HandleFunc("GET "+options.BaseURL+"/wallets/{wallet_id}/admin-operations/{admin_operation_id}", wrapper.GetWalletAdminOperation) + m.HandleFunc("GET "+options.BaseURL+"/wallets/{wallet_id}/upgrades", wrapper.ListWalletUpgrades) + m.HandleFunc("POST "+options.BaseURL+"/wallets/{wallet_id}/upgrades", wrapper.CreateWalletUpgrade) + m.HandleFunc("GET "+options.BaseURL+"/wallets/{wallet_id}/upgrades/{upgrade_id}", wrapper.GetWalletUpgrade) return m }