Skip to content

Commit

Permalink
Regenerate SDK (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyav authored Jul 1, 2024
1 parent cd7e3b8 commit be9d724
Show file tree
Hide file tree
Showing 18 changed files with 89 additions and 44 deletions.
1 change: 1 addition & 0 deletions lightspark/src/objects/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,7 @@ impl Account {
id
}
withdrawal_request_idempotency_key: idempotency_key
withdrawal_request_initiator: initiator
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions lightspark/src/objects/account_to_nodes_connection.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
use crate::objects::connection::Connection;
use crate::objects::lightspark_node::LightsparkNodeEnum;
use crate::objects::page_info::PageInfo;
use serde::{Deserialize, Serialize};

use std::vec::Vec;

use crate::objects::connection::Connection;

/// A connection between an account and the nodes it manages.
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct AccountToNodesConnection {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
use crate::objects::page_info::PageInfo;
use crate::objects::payment_request::PaymentRequestEnum;
use serde::{Deserialize, Serialize};

use crate::objects::connection::Connection;
use crate::objects::page_info::PageInfo;
use std::vec::Vec;

#[derive(Debug, Clone, Deserialize, Serialize)]
Expand Down
6 changes: 3 additions & 3 deletions lightspark/src/objects/account_to_transactions_connection.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
use serde::{Deserialize, Serialize};

use crate::objects::connection::Connection;
use crate::objects::currency_amount::CurrencyAmount;
use crate::objects::page_info::PageInfo;
use crate::objects::transaction::TransactionEnum;
use serde::{Deserialize, Serialize};

use crate::objects::connection::Connection;
use std::vec::Vec;

#[derive(Debug, Clone, Deserialize, Serialize)]
Expand Down
3 changes: 3 additions & 0 deletions lightspark/src/objects/create_lnurl_invoice_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ pub struct CreateLnurlInvoiceInput {

/// The expiry of the invoice in seconds. Default value is 86400 (1 day).
pub expiry_secs: Option<i64>,

/// An optional, monthly-rotated, unique hashed identifier corresponding to the receiver of the payment.
pub receiver_hash: Option<String>,
}
2 changes: 2 additions & 0 deletions lightspark/src/objects/create_uma_invoice_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ pub struct CreateUmaInvoiceInput {
pub metadata_hash: String,

pub expiry_secs: Option<i64>,

pub receiver_hash: Option<String>,
}
6 changes: 3 additions & 3 deletions lightspark/src/objects/invoice_data.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
use crate::objects::bitcoin_network::BitcoinNetwork;
use crate::objects::payment_request_data::PaymentRequestData;
use serde::{Deserialize, Serialize};

use crate::objects::currency_amount::CurrencyAmount;
use crate::objects::node::NodeEnum;
use crate::objects::payment_request_data::PaymentRequestData;
use crate::types::custom_date_formats::custom_date_format;
use serde::{Deserialize, Serialize};

use chrono::{DateTime, Utc};

/// This object represents the data associated with a BOLT #11 invoice. You can retrieve this object to receive the relevant data associated with a specific invoice.
Expand Down
6 changes: 3 additions & 3 deletions lightspark/src/objects/lightspark_node.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
use super::lightspark_node_with_o_s_k::LightsparkNodeWithOSK;
use crate::objects::balances::Balances;
use crate::objects::entity::Entity;
use crate::objects::node::Node;
use serde_json::Value;

use super::lightspark_node_with_o_s_k::LightsparkNodeWithOSK;
use super::lightspark_node_with_remote_signing::LightsparkNodeWithRemoteSigning;
use crate::objects::balances::Balances;
use crate::objects::blockchain_balance::BlockchainBalance;
use crate::objects::currency_amount::CurrencyAmount;
use crate::objects::lightspark_node_status::LightsparkNodeStatus;
use crate::types::entity_wrapper::EntityWrapper;
use serde::{Deserialize, Deserializer, Serialize};
use serde_json::Value;
use std::vec::Vec;

pub trait LightsparkNode: Node + Entity {
Expand Down
22 changes: 11 additions & 11 deletions lightspark/src/objects/lightspark_node_with_o_s_k.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
use crate::error::Error;
use crate::objects::balances::Balances;
use crate::objects::bitcoin_network::BitcoinNetwork;
use crate::objects::blockchain_balance::BlockchainBalance;
use crate::objects::channel_status::ChannelStatus;
use crate::objects::currency_amount::CurrencyAmount;
use crate::objects::entity::Entity;
use crate::objects::lightning_payment_direction::LightningPaymentDirection;
use crate::objects::lightspark_node::LightsparkNode;
use crate::objects::lightspark_node_status::LightsparkNodeStatus;
use crate::objects::lightspark_node_to_channels_connection::LightsparkNodeToChannelsConnection;
use crate::objects::lightspark_node_to_daily_liquidity_forecasts_connection::LightsparkNodeToDailyLiquidityForecastsConnection;
use crate::objects::node_address_type::NodeAddressType;
use crate::objects::node_to_addresses_connection::NodeToAddressesConnection;
use crate::objects::secret::Secret;
use crate::types::custom_date_formats::custom_date_format;
use crate::types::entity_wrapper::EntityWrapper;
use crate::types::get_entity::GetEntity;
use crate::types::graphql_requester::GraphQLRequester;
use chrono::NaiveDate;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

use crate::objects::bitcoin_network::BitcoinNetwork;
use crate::objects::blockchain_balance::BlockchainBalance;
use crate::objects::currency_amount::CurrencyAmount;
use crate::objects::entity::Entity;
use crate::objects::lightspark_node_to_daily_liquidity_forecasts_connection::LightsparkNodeToDailyLiquidityForecastsConnection;
use crate::objects::node::Node;
use crate::objects::node_to_addresses_connection::NodeToAddressesConnection;
use crate::objects::secret::Secret;
use crate::types::entity_wrapper::EntityWrapper;
use serde_json::Value;
use std::collections::HashMap;
use std::vec::Vec;

use crate::error::Error;
use crate::objects::node::Node;

/// This is a Lightspark node with OSK.
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LightsparkNodeWithOSK {
Expand Down
20 changes: 10 additions & 10 deletions lightspark/src/objects/lightspark_node_with_remote_signing.rs
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
use crate::error::Error;
use crate::objects::balances::Balances;
use crate::objects::bitcoin_network::BitcoinNetwork;
use crate::objects::blockchain_balance::BlockchainBalance;
use crate::objects::channel_status::ChannelStatus;
use crate::objects::currency_amount::CurrencyAmount;
use crate::objects::entity::Entity;
use crate::objects::lightning_payment_direction::LightningPaymentDirection;
use crate::objects::lightspark_node::LightsparkNode;
use crate::objects::lightspark_node_status::LightsparkNodeStatus;
use crate::objects::lightspark_node_to_channels_connection::LightsparkNodeToChannelsConnection;
use crate::objects::lightspark_node_to_daily_liquidity_forecasts_connection::LightsparkNodeToDailyLiquidityForecastsConnection;
use crate::objects::node_address_type::NodeAddressType;
use crate::objects::node_to_addresses_connection::NodeToAddressesConnection;
use crate::types::custom_date_formats::custom_date_format;
use crate::types::entity_wrapper::EntityWrapper;
use crate::types::get_entity::GetEntity;
use crate::types::graphql_requester::GraphQLRequester;
use chrono::NaiveDate;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

use crate::objects::bitcoin_network::BitcoinNetwork;
use crate::objects::blockchain_balance::BlockchainBalance;
use crate::objects::currency_amount::CurrencyAmount;
use crate::objects::entity::Entity;
use crate::objects::lightspark_node_to_daily_liquidity_forecasts_connection::LightsparkNodeToDailyLiquidityForecastsConnection;
use crate::objects::node::Node;
use crate::objects::node_to_addresses_connection::NodeToAddressesConnection;
use crate::types::entity_wrapper::EntityWrapper;
use serde_json::Value;
use std::collections::HashMap;
use std::vec::Vec;

use crate::error::Error;
use crate::objects::node::Node;

/// This is a Lightspark node with remote signing.
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct LightsparkNodeWithRemoteSigning {
Expand Down
1 change: 1 addition & 0 deletions lightspark/src/objects/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ pub mod release_channel_per_commitment_secret_output;
pub mod release_payment_preimage_input;
pub mod release_payment_preimage_output;
pub mod remote_signing_sub_event_type;
pub mod request_initiator;
pub mod request_withdrawal_input;
pub mod request_withdrawal_output;
pub mod rich_text;
Expand Down
16 changes: 8 additions & 8 deletions lightspark/src/objects/outgoing_payment.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
use crate::objects::outgoing_payment_to_attempts_connection::OutgoingPaymentToAttemptsConnection;
use crate::types::custom_date_formats::custom_date_format_option;
use crate::types::graphql_requester::GraphQLRequester;
use serde::{Deserialize, Serialize};

use crate::error::Error;
use crate::objects::currency_amount::CurrencyAmount;
use crate::objects::entity::Entity;
use crate::objects::lightning_transaction::LightningTransaction;
use crate::objects::outgoing_payment_to_attempts_connection::OutgoingPaymentToAttemptsConnection;
use crate::objects::payment_failure_reason::PaymentFailureReason;
use crate::objects::payment_request_data::PaymentRequestDataEnum;
use crate::objects::post_transaction_data::PostTransactionData;
use crate::objects::rich_text::RichText;
use crate::objects::transaction::Transaction;
use crate::objects::transaction_status::TransactionStatus;
use crate::types::custom_date_formats::custom_date_format;
use crate::types::custom_date_formats::custom_date_format_option;
use crate::types::entity_wrapper::EntityWrapper;
use crate::types::get_entity::GetEntity;
use crate::types::graphql_requester::GraphQLRequester;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;
use std::vec::Vec;

use crate::error::Error;
use crate::objects::post_transaction_data::PostTransactionData;
use crate::objects::transaction::Transaction;

/// This object represents a Lightning Network payment sent from a Lightspark Node. You can retrieve this object to receive payment related information about any payment sent from your Lightspark Node on the Lightning Network.
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct OutgoingPayment {
Expand Down
3 changes: 3 additions & 0 deletions lightspark/src/objects/pay_uma_invoice_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ pub struct PayUmaInvoiceInput {
pub amount_msats: Option<i64>,

pub idempotency_key: Option<String>,

/// An optional, monthly-rotated, unique hashed identifier corresponding to the sender of the payment.
pub sender_hash: Option<String>,
}
28 changes: 28 additions & 0 deletions lightspark/src/objects/request_initiator.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::fmt;

#[derive(Debug, Clone, Deserialize, Serialize)]
pub enum RequestInitiator {
#[serde(rename = "CUSTOMER")]
Customer,

#[serde(rename = "LIGHTSPARK")]
Lightspark,
}

impl From<RequestInitiator> for Value {
fn from(val: RequestInitiator) -> Self {
Value::from(val.to_string())
}
}

impl fmt::Display for RequestInitiator {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::Customer => write!(f, "CUSTOMER"),
Self::Lightspark => write!(f, "LIGHTSPARK"),
}
}
}
1 change: 1 addition & 0 deletions lightspark/src/objects/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,7 @@ impl Wallet {
id
}
withdrawal_request_idempotency_key: idempotency_key
withdrawal_request_initiator: initiator
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
use crate::objects::page_info::PageInfo;
use crate::objects::payment_request::PaymentRequestEnum;
use serde::{Deserialize, Serialize};

use crate::objects::connection::Connection;
use crate::objects::page_info::PageInfo;
use std::vec::Vec;

#[derive(Debug, Clone, Deserialize, Serialize)]
Expand Down
4 changes: 2 additions & 2 deletions lightspark/src/objects/wallet_to_transactions_connection.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
use crate::objects::page_info::PageInfo;
use crate::objects::transaction::TransactionEnum;
use serde::{Deserialize, Serialize};

use crate::objects::connection::Connection;
use crate::objects::page_info::PageInfo;
use crate::objects::transaction::TransactionEnum;
use std::vec::Vec;

#[derive(Debug, Clone, Deserialize, Serialize)]
Expand Down
6 changes: 6 additions & 0 deletions lightspark/src/objects/withdrawal_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
use crate::error::Error;
use crate::objects::currency_amount::CurrencyAmount;
use crate::objects::entity::Entity;
use crate::objects::request_initiator::RequestInitiator;
use crate::objects::withdrawal_mode::WithdrawalMode;
use crate::objects::withdrawal_request_status::WithdrawalRequestStatus;
use crate::objects::withdrawal_request_to_channel_closing_transactions_connection::WithdrawalRequestToChannelClosingTransactionsConnection;
Expand Down Expand Up @@ -79,6 +80,10 @@ pub struct WithdrawalRequest {
#[serde(rename = "withdrawal_request_idempotency_key")]
pub idempotency_key: Option<String>,

/// The initiator of the withdrawal.
#[serde(rename = "withdrawal_request_initiator")]
pub initiator: RequestInitiator,

/// The typename of the object
#[serde(rename = "__typename")]
pub typename: String,
Expand Down Expand Up @@ -177,6 +182,7 @@ fragment WithdrawalRequestFragment on WithdrawalRequest {
id
}
withdrawal_request_idempotency_key: idempotency_key
withdrawal_request_initiator: initiator
}
";

Expand Down

0 comments on commit be9d724

Please sign in to comment.