-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use crate::{rpc, Result}; | ||
use clap::Args; | ||
use serde_json::json; | ||
|
||
pub fn paywall_get_add_element_comment_quote() -> Result<()> { | ||
rpc::call("paywall_get_add_element_comment_quote", json!({}))?.print() | ||
} | ||
|
||
#[derive(Args)] | ||
pub struct PaywallAddElementCommentArgs { | ||
pub element_id: String, | ||
pub comment: String, | ||
} | ||
|
||
pub fn paywall_add_element_comment(args: &PaywallAddElementCommentArgs) -> Result<()> { | ||
rpc::call( | ||
"paywall_add_element_comment", | ||
json!({"element_id": args.element_id,"comment": args.comment}), | ||
)? | ||
.print() | ||
} | ||
|
||
pub fn paywall_get_boost_element_quote() -> Result<()> { | ||
rpc::call("paywall_get_boost_element_quote", json!({}))?.print() | ||
} | ||
|
||
#[derive(Args)] | ||
pub struct PaywallBoostElementArgs { | ||
pub element_id: String, | ||
pub days: i64, | ||
} | ||
|
||
pub fn paywall_boost_element(args: &PaywallBoostElementArgs) -> Result<()> { | ||
rpc::call( | ||
"paywall_boost_element", | ||
json!({"element_id": args.element_id, "days": args.days}), | ||
)? | ||
.print() | ||
} |