ic_radix_rs/models/programmatic_scrypto_sbor_value_bytes.rs
1/*
2 * Radix Gateway API - Babylon
3 *
4 * This API is exposed by the Babylon Radix Gateway to enable clients to efficiently query current and historic state on the RadixDLT ledger, and intelligently handle transaction submission. It is designed for use by wallets and explorers, and for light queries from front-end dApps. For exchange/asset integrations, back-end dApp integrations, or simple use cases, you should consider using the Core API on a Node. A Gateway is only needed for reading historic snapshots of ledger states or a more robust set-up. The Gateway API is implemented by the [Network Gateway](https://github.com/radixdlt/babylon-gateway), which is configured to read from [full node(s)](https://github.com/radixdlt/babylon-node) to extract and index data from the network. This document is an API reference documentation, visit [User Guide](https://docs.radixdlt.com/) to learn more about how to run a Gateway of your own. ## Migration guide Please see [the latest release notes](https://github.com/radixdlt/babylon-gateway/releases). ## Integration and forward compatibility guarantees All responses may have additional fields added at any release, so clients are advised to use JSON parsers which ignore unknown fields on JSON objects. When the Radix protocol is updated, new functionality may be added, and so discriminated unions returned by the API may need to be updated to have new variants added, corresponding to the updated data. Clients may need to update in advance to be able to handle these new variants when a protocol update comes out. On the very rare occasions we need to make breaking changes to the API, these will be warned in advance with deprecation notices on previous versions. These deprecation notices will include a safe migration path. Deprecation notes or breaking changes will be flagged clearly in release notes for new versions of the Gateway. The Gateway DB schema is not subject to any compatibility guarantees, and may be changed at any release. DB changes will be flagged in the release notes so clients doing custom DB integrations can prepare.
5 *
6 * The version of the OpenAPI document: v1.5.2
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, candid::CandidType)]
14pub struct ProgrammaticScryptoSborValueBytes {
15 #[serde(rename = "kind")]
16 pub kind: models::ProgrammaticScryptoSborValueKind,
17 /// The name of the type of this value. This is only output when a schema is present and the type has a name. This property is ignored when the value is used as an input to the API.
18 #[serde(rename = "type_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19 pub type_name: Option<Option<String>>,
20 /// The name of the field which hosts this value. This property is only included if this value is a child of a `Tuple` or `Enum` with named fields. This property is ignored when the value is used as an input to the API.
21 #[serde(rename = "field_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22 pub field_name: Option<Option<String>>,
23 #[serde(rename = "element_kind")]
24 pub element_kind: models::ProgrammaticScryptoSborValueKind,
25 #[serde(rename = "element_type_name", skip_serializing_if = "Option::is_none")]
26 pub element_type_name: Option<String>,
27 /// Hex-encoded binary blob.
28 #[serde(rename = "hex")]
29 pub hex: String,
30}
31
32impl ProgrammaticScryptoSborValueBytes {
33 pub fn new(kind: models::ProgrammaticScryptoSborValueKind, element_kind: models::ProgrammaticScryptoSborValueKind, hex: String) -> ProgrammaticScryptoSborValueBytes {
34 ProgrammaticScryptoSborValueBytes {
35 kind,
36 type_name: None,
37 field_name: None,
38 element_kind,
39 element_type_name: None,
40 hex,
41 }
42 }
43}
44