add
This commit is contained in:
parent
0db9ee3dd8
commit
2866ed2fad
41
.github/workflows/ci.yaml
vendored
Normal file
41
.github/workflows/ci.yaml
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch: { }
|
||||||
|
push: { }
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
- uses: Swatinem/rust-cache@v1
|
||||||
|
- run: cargo install just
|
||||||
|
- run: just test
|
||||||
|
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
if: >-
|
||||||
|
((github.event_name == 'workflow_dispatch') || (github.event_name == 'push')) &&
|
||||||
|
startsWith(github.ref, 'refs/tags/v')
|
||||||
|
needs: [ "test" ]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
- uses: katyo/publish-crates@v1
|
||||||
|
with:
|
||||||
|
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Cargo.lock
|
||||||
|
target
|
63
CODE_OF_CONDUCT.md
Normal file
63
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
In the interest of fostering an open and welcoming environment, we as
|
||||||
|
contributors and maintainers pledge to make participation in our project and
|
||||||
|
our community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||||
|
level of experience, education, socio-economic status, nationality, personal
|
||||||
|
appearance, race, religion, or sexual identity and orientation.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to creating a positive environment
|
||||||
|
include:
|
||||||
|
|
||||||
|
* Using welcoming and inclusive language
|
||||||
|
* Being respectful of differing viewpoints and experiences
|
||||||
|
* Gracefully accepting constructive criticism
|
||||||
|
* Focusing on what is best for the community
|
||||||
|
* Showing empathy towards other community members
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
|
advances
|
||||||
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or electronic
|
||||||
|
address, without explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Our Responsibilities
|
||||||
|
|
||||||
|
Project maintainers are responsible for clarifying the standards of acceptable
|
||||||
|
behavior and are expected to take appropriate and fair corrective action in
|
||||||
|
response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or
|
||||||
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||||
|
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||||
|
permanently any contributor for other behaviors that they deem inappropriate,
|
||||||
|
threatening, offensive, or harmful.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all project spaces, and it also applies when
|
||||||
|
an individual is representing the project or its community in public spaces.
|
||||||
|
Examples of representing a project or community include using an official
|
||||||
|
project e-mail address, posting via an official social media account, or acting
|
||||||
|
as an appointed representative at an online or offline event. Representation of
|
||||||
|
a project may be further defined and clarified by project maintainers.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||||
|
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see
|
||||||
|
https://www.contributor-covenant.org/faq
|
21
Cargo.toml
Normal file
21
Cargo.toml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
[package]
|
||||||
|
name = "atproto"
|
||||||
|
edition = "2021"
|
||||||
|
version = "0.0.1"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
futures = "0.3.25"
|
||||||
|
httpclient = "0.20.2"
|
||||||
|
serde_json = "1.0.81"
|
||||||
|
|
||||||
|
[dependencies.chrono]
|
||||||
|
version = "0.4.26"
|
||||||
|
features = ["serde"]
|
||||||
|
|
||||||
|
[dependencies.serde]
|
||||||
|
version = "1.0.137"
|
||||||
|
features = ["derive"]
|
||||||
|
|
||||||
|
[dev-dependencies.tokio]
|
||||||
|
version = "1.18.2"
|
||||||
|
features = ["full"]
|
58
Justfile
Normal file
58
Justfile
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
set dotenv-load := true
|
||||||
|
|
||||||
|
help:
|
||||||
|
@just --list --unsorted
|
||||||
|
|
||||||
|
build:
|
||||||
|
cargo build
|
||||||
|
alias b := build
|
||||||
|
|
||||||
|
run *args:
|
||||||
|
cargo run {{args}}
|
||||||
|
alias r := run
|
||||||
|
|
||||||
|
release:
|
||||||
|
cargo build --release
|
||||||
|
|
||||||
|
install:
|
||||||
|
cargo install --path .
|
||||||
|
|
||||||
|
bootstrap:
|
||||||
|
cargo install cargo-edit
|
||||||
|
|
||||||
|
test *args:
|
||||||
|
cargo test {{args}}
|
||||||
|
|
||||||
|
check:
|
||||||
|
cargo check
|
||||||
|
alias c := check
|
||||||
|
|
||||||
|
fix:
|
||||||
|
cargo clippy --fix
|
||||||
|
|
||||||
|
# Bump version. level=major,minor,patch
|
||||||
|
version level:
|
||||||
|
git diff-index --exit-code HEAD > /dev/null || ! echo You have untracked changes. Commit your changes before bumping the version.
|
||||||
|
cargo set-version --bump {{level}}
|
||||||
|
cargo update # This bumps Cargo.lock
|
||||||
|
VERSION=$(rg "version = \"([0-9.]+)\"" -or '$1' Cargo.toml | head -n1) && \
|
||||||
|
git commit -am "Bump version {{level}} to $VERSION" && \
|
||||||
|
git tag v$VERSION && \
|
||||||
|
git push origin v$VERSION
|
||||||
|
git push
|
||||||
|
|
||||||
|
publish:
|
||||||
|
cargo publish
|
||||||
|
|
||||||
|
patch: test
|
||||||
|
just version patch
|
||||||
|
just publish
|
||||||
|
|
||||||
|
doc:
|
||||||
|
cargo doc --no-deps --open
|
||||||
|
|
||||||
|
test-full:
|
||||||
|
#!/usr/bin/env bash -euxo pipefail
|
||||||
|
for file in $(ls examples); do
|
||||||
|
cargo run --example "$(basename "$file" .rs)"
|
||||||
|
done
|
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2024 syui (http://syui.ai)
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
9
examples/app_bsky_actor_get_preferences.rs
Normal file
9
examples/app_bsky_actor_get_preferences.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.app_bsky_actor_get_preferences().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/app_bsky_actor_get_profile.rs
Normal file
10
examples/app_bsky_actor_get_profile.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let actor = "your actor";
|
||||||
|
let response = client.app_bsky_actor_get_profile(actor).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/app_bsky_actor_get_profiles.rs
Normal file
10
examples/app_bsky_actor_get_profiles.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let actors = &["your actors"];
|
||||||
|
let response = client.app_bsky_actor_get_profiles(actors).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/app_bsky_actor_get_suggestions.rs
Normal file
14
examples/app_bsky_actor_get_suggestions.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_actor_get_suggestions()
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/app_bsky_actor_put_preferences.rs
Normal file
10
examples/app_bsky_actor_put_preferences.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let preferences = AppBskyActorDefsPreferences(vec![serde_json::json!({})]);
|
||||||
|
let response = client.app_bsky_actor_put_preferences(preferences).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
16
examples/app_bsky_actor_search_actors.rs
Normal file
16
examples/app_bsky_actor_search_actors.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_actor_search_actors()
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.q("your q")
|
||||||
|
.term("your term")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_actor_search_actors_typeahead.rs
Normal file
15
examples/app_bsky_actor_search_actors_typeahead.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_actor_search_actors_typeahead()
|
||||||
|
.limit(1)
|
||||||
|
.q("your q")
|
||||||
|
.term("your term")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_feed_get_actor_feeds.rs
Normal file
15
examples/app_bsky_feed_get_actor_feeds.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let actor = "your actor";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_feed_get_actor_feeds(actor)
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_feed_get_actor_likes.rs
Normal file
15
examples/app_bsky_feed_get_actor_likes.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let actor = "your actor";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_feed_get_actor_likes(actor)
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
16
examples/app_bsky_feed_get_author_feed.rs
Normal file
16
examples/app_bsky_feed_get_author_feed.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let actor = "your actor";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_feed_get_author_feed(actor)
|
||||||
|
.cursor("your cursor")
|
||||||
|
.filter("your filter")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_feed_get_feed.rs
Normal file
15
examples/app_bsky_feed_get_feed.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let feed = "your feed";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_feed_get_feed(feed)
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/app_bsky_feed_get_feed_generator.rs
Normal file
10
examples/app_bsky_feed_get_feed_generator.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let feed = "your feed";
|
||||||
|
let response = client.app_bsky_feed_get_feed_generator(feed).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/app_bsky_feed_get_feed_generators.rs
Normal file
10
examples/app_bsky_feed_get_feed_generators.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let feeds = &["your feeds"];
|
||||||
|
let response = client.app_bsky_feed_get_feed_generators(feeds).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
16
examples/app_bsky_feed_get_likes.rs
Normal file
16
examples/app_bsky_feed_get_likes.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let uri = "your uri";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_feed_get_likes(uri)
|
||||||
|
.cid("your cid")
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_feed_get_list_feed.rs
Normal file
15
examples/app_bsky_feed_get_list_feed.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let list = "your list";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_feed_get_list_feed(list)
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_feed_get_post_thread.rs
Normal file
15
examples/app_bsky_feed_get_post_thread.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let uri = "your uri";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_feed_get_post_thread(uri)
|
||||||
|
.depth(1)
|
||||||
|
.parent_height(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/app_bsky_feed_get_posts.rs
Normal file
10
examples/app_bsky_feed_get_posts.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let uris = &["your uris"];
|
||||||
|
let response = client.app_bsky_feed_get_posts(uris).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
16
examples/app_bsky_feed_get_reposted_by.rs
Normal file
16
examples/app_bsky_feed_get_reposted_by.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let uri = "your uri";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_feed_get_reposted_by(uri)
|
||||||
|
.cid("your cid")
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/app_bsky_feed_get_suggested_feeds.rs
Normal file
14
examples/app_bsky_feed_get_suggested_feeds.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_feed_get_suggested_feeds()
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_feed_get_timeline.rs
Normal file
15
examples/app_bsky_feed_get_timeline.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_feed_get_timeline()
|
||||||
|
.algorithm("your algorithm")
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_feed_search_posts.rs
Normal file
15
examples/app_bsky_feed_search_posts.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let q = "your q";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_feed_search_posts(q)
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/app_bsky_graph_get_blocks.rs
Normal file
14
examples/app_bsky_graph_get_blocks.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_graph_get_blocks()
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_graph_get_followers.rs
Normal file
15
examples/app_bsky_graph_get_followers.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let actor = "your actor";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_graph_get_followers(actor)
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_graph_get_follows.rs
Normal file
15
examples/app_bsky_graph_get_follows.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let actor = "your actor";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_graph_get_follows(actor)
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_graph_get_list.rs
Normal file
15
examples/app_bsky_graph_get_list.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let list = "your list";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_graph_get_list(list)
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/app_bsky_graph_get_list_blocks.rs
Normal file
14
examples/app_bsky_graph_get_list_blocks.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_graph_get_list_blocks()
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/app_bsky_graph_get_list_mutes.rs
Normal file
14
examples/app_bsky_graph_get_list_mutes.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_graph_get_list_mutes()
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_graph_get_lists.rs
Normal file
15
examples/app_bsky_graph_get_lists.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let actor = "your actor";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_graph_get_lists(actor)
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/app_bsky_graph_get_mutes.rs
Normal file
14
examples/app_bsky_graph_get_mutes.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_graph_get_mutes()
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
13
examples/app_bsky_graph_get_suggested_follows_by_actor.rs
Normal file
13
examples/app_bsky_graph_get_suggested_follows_by_actor.rs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let actor = "your actor";
|
||||||
|
let response = client
|
||||||
|
.app_bsky_graph_get_suggested_follows_by_actor(actor)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/app_bsky_graph_mute_actor.rs
Normal file
10
examples/app_bsky_graph_mute_actor.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let actor = "your actor";
|
||||||
|
let response = client.app_bsky_graph_mute_actor(actor).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/app_bsky_graph_mute_actor_list.rs
Normal file
10
examples/app_bsky_graph_mute_actor_list.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let list = "your list";
|
||||||
|
let response = client.app_bsky_graph_mute_actor_list(list).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/app_bsky_graph_unmute_actor.rs
Normal file
10
examples/app_bsky_graph_unmute_actor.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let actor = "your actor";
|
||||||
|
let response = client.app_bsky_graph_unmute_actor(actor).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/app_bsky_graph_unmute_actor_list.rs
Normal file
10
examples/app_bsky_graph_unmute_actor_list.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let list = "your list";
|
||||||
|
let response = client.app_bsky_graph_unmute_actor_list(list).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/app_bsky_labeler_get_services.rs
Normal file
14
examples/app_bsky_labeler_get_services.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let dids = &["your dids"];
|
||||||
|
let response = client
|
||||||
|
.app_bsky_labeler_get_services(dids)
|
||||||
|
.detailed(true)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
13
examples/app_bsky_notification_get_unread_count.rs
Normal file
13
examples/app_bsky_notification_get_unread_count.rs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_notification_get_unread_count()
|
||||||
|
.seen_at(chrono::Utc::now())
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_notification_list_notifications.rs
Normal file
15
examples/app_bsky_notification_list_notifications.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_notification_list_notifications()
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.seen_at(chrono::Utc::now())
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
16
examples/app_bsky_notification_register_push.rs
Normal file
16
examples/app_bsky_notification_register_push.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
use atproto::request::AppBskyNotificationRegisterPushRequired;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let args = AppBskyNotificationRegisterPushRequired {
|
||||||
|
app_id: "your app id",
|
||||||
|
platform: "your platform",
|
||||||
|
service_did: "your service did",
|
||||||
|
token: "your token",
|
||||||
|
};
|
||||||
|
let response = client.app_bsky_notification_register_push(args).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/app_bsky_notification_update_seen.rs
Normal file
10
examples/app_bsky_notification_update_seen.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let seen_at = chrono::Utc::now();
|
||||||
|
let response = client.app_bsky_notification_update_seen(seen_at).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_unspecced_apply_labels.rs
Normal file
15
examples/app_bsky_unspecced_apply_labels.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let labels = vec![
|
||||||
|
ComAtprotoLabelDefsLabel { cid : Some("your cid".to_owned()), cts :
|
||||||
|
chrono::Utc::now(), exp : Some(chrono::Utc::now()), neg : Some(true), sig :
|
||||||
|
Some("your sig".to_owned()), src : "your src".to_owned(), uri : "your uri"
|
||||||
|
.to_owned(), val : "your val".to_owned(), ver : Some(1) }
|
||||||
|
];
|
||||||
|
let response = client.app_bsky_unspecced_apply_labels(labels).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_unspecced_get_popular.rs
Normal file
15
examples/app_bsky_unspecced_get_popular.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_unspecced_get_popular()
|
||||||
|
.cursor("your cursor")
|
||||||
|
.include_nsfw(true)
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/app_bsky_unspecced_get_popular_feed_generators.rs
Normal file
15
examples/app_bsky_unspecced_get_popular_feed_generators.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.app_bsky_unspecced_get_popular_feed_generators()
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.query("your query")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
9
examples/app_bsky_unspecced_get_tagged_suggestions.rs
Normal file
9
examples/app_bsky_unspecced_get_tagged_suggestions.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.app_bsky_unspecced_get_tagged_suggestions().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.com_atproto_identity_get_recommended_did_credentials()
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.com_atproto_identity_request_plc_operation_signature()
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/com_atproto_identity_resolve_handle.rs
Normal file
10
examples/com_atproto_identity_resolve_handle.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let handle = "your handle";
|
||||||
|
let response = client.com_atproto_identity_resolve_handle(handle).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
17
examples/com_atproto_identity_sign_plc_operation.rs
Normal file
17
examples/com_atproto_identity_sign_plc_operation.rs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.com_atproto_identity_sign_plc_operation()
|
||||||
|
.also_known_as(&["your also known as"])
|
||||||
|
.rotation_keys(&["your rotation keys"])
|
||||||
|
.services(serde_json::json!({}))
|
||||||
|
.token("your token")
|
||||||
|
.verification_methods(serde_json::json!({}))
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
13
examples/com_atproto_identity_submit_plc_operation.rs
Normal file
13
examples/com_atproto_identity_submit_plc_operation.rs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let operation = serde_json::json!({});
|
||||||
|
let response = client
|
||||||
|
.com_atproto_identity_submit_plc_operation(operation)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/com_atproto_identity_update_handle.rs
Normal file
10
examples/com_atproto_identity_update_handle.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let handle = "your handle";
|
||||||
|
let response = client.com_atproto_identity_update_handle(handle).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/com_atproto_moderation_create_report.rs
Normal file
15
examples/com_atproto_moderation_create_report.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let reason_type = ComAtprotoModerationDefsReasonType(serde_json::json!({}));
|
||||||
|
let subject = serde_json::json!({});
|
||||||
|
let response = client
|
||||||
|
.com_atproto_moderation_create_report(reason_type, subject)
|
||||||
|
.reason("your reason")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
16
examples/com_atproto_repo_apply_writes.rs
Normal file
16
examples/com_atproto_repo_apply_writes.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let repo = "your repo";
|
||||||
|
let writes = vec![serde_json::json!({})];
|
||||||
|
let response = client
|
||||||
|
.com_atproto_repo_apply_writes(repo, writes)
|
||||||
|
.swap_commit("your swap commit")
|
||||||
|
.validate(true)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
18
examples/com_atproto_repo_create_record.rs
Normal file
18
examples/com_atproto_repo_create_record.rs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let collection = "your collection";
|
||||||
|
let record = serde_json::json!({});
|
||||||
|
let repo = "your repo";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_repo_create_record(collection, record, repo)
|
||||||
|
.rkey("your rkey")
|
||||||
|
.swap_commit("your swap commit")
|
||||||
|
.validate(true)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
17
examples/com_atproto_repo_delete_record.rs
Normal file
17
examples/com_atproto_repo_delete_record.rs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let collection = "your collection";
|
||||||
|
let repo = "your repo";
|
||||||
|
let rkey = "your rkey";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_repo_delete_record(collection, repo, rkey)
|
||||||
|
.swap_commit("your swap commit")
|
||||||
|
.swap_record("your swap record")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/com_atproto_repo_describe_repo.rs
Normal file
10
examples/com_atproto_repo_describe_repo.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let repo = "your repo";
|
||||||
|
let response = client.com_atproto_repo_describe_repo(repo).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
16
examples/com_atproto_repo_get_record.rs
Normal file
16
examples/com_atproto_repo_get_record.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let collection = "your collection";
|
||||||
|
let repo = "your repo";
|
||||||
|
let rkey = "your rkey";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_repo_get_record(collection, repo, rkey)
|
||||||
|
.cid("your cid")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
9
examples/com_atproto_repo_import_repo.rs
Normal file
9
examples/com_atproto_repo_import_repo.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.com_atproto_repo_import_repo().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/com_atproto_repo_list_missing_blobs.rs
Normal file
14
examples/com_atproto_repo_list_missing_blobs.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.com_atproto_repo_list_missing_blobs()
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
19
examples/com_atproto_repo_list_records.rs
Normal file
19
examples/com_atproto_repo_list_records.rs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let collection = "your collection";
|
||||||
|
let repo = "your repo";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_repo_list_records(collection, repo)
|
||||||
|
.cursor("your cursor")
|
||||||
|
.limit(1)
|
||||||
|
.reverse(true)
|
||||||
|
.rkey_end("your rkey end")
|
||||||
|
.rkey_start("your rkey start")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
22
examples/com_atproto_repo_put_record.rs
Normal file
22
examples/com_atproto_repo_put_record.rs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
use atproto::request::ComAtprotoRepoPutRecordRequired;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let args = ComAtprotoRepoPutRecordRequired {
|
||||||
|
collection: "your collection",
|
||||||
|
record: serde_json::json!({}),
|
||||||
|
repo: "your repo",
|
||||||
|
rkey: "your rkey",
|
||||||
|
};
|
||||||
|
let response = client
|
||||||
|
.com_atproto_repo_put_record(args)
|
||||||
|
.swap_commit("your swap commit")
|
||||||
|
.swap_record("your swap record")
|
||||||
|
.validate(true)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/com_atproto_repo_rebase_repo.rs
Normal file
14
examples/com_atproto_repo_rebase_repo.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let repo = "your repo";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_repo_rebase_repo(repo)
|
||||||
|
.swap_commit("your swap commit")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
9
examples/com_atproto_repo_upload_blob.rs
Normal file
9
examples/com_atproto_repo_upload_blob.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.com_atproto_repo_upload_blob().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
9
examples/com_atproto_server_activate_account.rs
Normal file
9
examples/com_atproto_server_activate_account.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.com_atproto_server_activate_account().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
9
examples/com_atproto_server_check_account_status.rs
Normal file
9
examples/com_atproto_server_check_account_status.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.com_atproto_server_check_account_status().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
11
examples/com_atproto_server_confirm_email.rs
Normal file
11
examples/com_atproto_server_confirm_email.rs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let email = "your email";
|
||||||
|
let token = "your token";
|
||||||
|
let response = client.com_atproto_server_confirm_email(email, token).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
21
examples/com_atproto_server_create_account.rs
Normal file
21
examples/com_atproto_server_create_account.rs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let handle = "your handle";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_server_create_account(handle)
|
||||||
|
.did("your did")
|
||||||
|
.email("your email")
|
||||||
|
.invite_code("your invite code")
|
||||||
|
.password("your password")
|
||||||
|
.plc_op(serde_json::json!({}))
|
||||||
|
.recovery_key("your recovery key")
|
||||||
|
.verification_code("your verification code")
|
||||||
|
.verification_phone("your verification phone")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/com_atproto_server_create_app_password.rs
Normal file
10
examples/com_atproto_server_create_app_password.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let name = "your name";
|
||||||
|
let response = client.com_atproto_server_create_app_password(name).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/com_atproto_server_create_invite_code.rs
Normal file
14
examples/com_atproto_server_create_invite_code.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let use_count = 1;
|
||||||
|
let response = client
|
||||||
|
.com_atproto_server_create_invite_code(use_count)
|
||||||
|
.for_account("your for account")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/com_atproto_server_create_invite_codes.rs
Normal file
15
examples/com_atproto_server_create_invite_codes.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let code_count = 1;
|
||||||
|
let use_count = 1;
|
||||||
|
let response = client
|
||||||
|
.com_atproto_server_create_invite_codes(code_count, use_count)
|
||||||
|
.for_accounts(&["your for accounts"])
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/com_atproto_server_create_session.rs
Normal file
14
examples/com_atproto_server_create_session.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let identifier = "your identifier";
|
||||||
|
let password = "your password";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_server_create_session(identifier, password)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
13
examples/com_atproto_server_deactivate_account.rs
Normal file
13
examples/com_atproto_server_deactivate_account.rs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.com_atproto_server_deactivate_account()
|
||||||
|
.delete_after(chrono::Utc::now())
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/com_atproto_server_delete_account.rs
Normal file
15
examples/com_atproto_server_delete_account.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let did = "your did";
|
||||||
|
let password = "your password";
|
||||||
|
let token = "your token";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_server_delete_account(did, password, token)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
9
examples/com_atproto_server_delete_session.rs
Normal file
9
examples/com_atproto_server_delete_session.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.com_atproto_server_delete_session().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
9
examples/com_atproto_server_describe_server.rs
Normal file
9
examples/com_atproto_server_describe_server.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.com_atproto_server_describe_server().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/com_atproto_server_get_account_invite_codes.rs
Normal file
14
examples/com_atproto_server_get_account_invite_codes.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.com_atproto_server_get_account_invite_codes()
|
||||||
|
.create_available(true)
|
||||||
|
.include_used(true)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/com_atproto_server_get_service_auth.rs
Normal file
10
examples/com_atproto_server_get_service_auth.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let aud = "your aud";
|
||||||
|
let response = client.com_atproto_server_get_service_auth(aud).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
9
examples/com_atproto_server_get_session.rs
Normal file
9
examples/com_atproto_server_get_session.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.com_atproto_server_get_session().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
9
examples/com_atproto_server_list_app_passwords.rs
Normal file
9
examples/com_atproto_server_list_app_passwords.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.com_atproto_server_list_app_passwords().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
9
examples/com_atproto_server_refresh_session.rs
Normal file
9
examples/com_atproto_server_refresh_session.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.com_atproto_server_refresh_session().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
9
examples/com_atproto_server_request_account_delete.rs
Normal file
9
examples/com_atproto_server_request_account_delete.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.com_atproto_server_request_account_delete().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.com_atproto_server_request_email_confirmation().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
9
examples/com_atproto_server_request_email_update.rs
Normal file
9
examples/com_atproto_server_request_email_update.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client.com_atproto_server_request_email_update().await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
13
examples/com_atproto_server_request_password_reset.rs
Normal file
13
examples/com_atproto_server_request_password_reset.rs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let email = "your email";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_server_request_password_reset(email)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
13
examples/com_atproto_server_reserve_signing_key.rs
Normal file
13
examples/com_atproto_server_reserve_signing_key.rs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let response = client
|
||||||
|
.com_atproto_server_reserve_signing_key()
|
||||||
|
.did("your did")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/com_atproto_server_reset_password.rs
Normal file
14
examples/com_atproto_server_reset_password.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let password = "your password";
|
||||||
|
let token = "your token";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_server_reset_password(password, token)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/com_atproto_server_revoke_app_password.rs
Normal file
10
examples/com_atproto_server_revoke_app_password.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let name = "your name";
|
||||||
|
let response = client.com_atproto_server_revoke_app_password(name).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
14
examples/com_atproto_server_update_email.rs
Normal file
14
examples/com_atproto_server_update_email.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let email = "your email";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_server_update_email(email)
|
||||||
|
.token("your token")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
11
examples/com_atproto_sync_get_blob.rs
Normal file
11
examples/com_atproto_sync_get_blob.rs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let cid = "your cid";
|
||||||
|
let did = "your did";
|
||||||
|
let response = client.com_atproto_sync_get_blob(cid, did).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
11
examples/com_atproto_sync_get_blocks.rs
Normal file
11
examples/com_atproto_sync_get_blocks.rs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let cids = &["your cids"];
|
||||||
|
let did = "your did";
|
||||||
|
let response = client.com_atproto_sync_get_blocks(cids, did).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/com_atproto_sync_get_checkout.rs
Normal file
10
examples/com_atproto_sync_get_checkout.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let did = "your did";
|
||||||
|
let response = client.com_atproto_sync_get_checkout(did).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
15
examples/com_atproto_sync_get_commit_path.rs
Normal file
15
examples/com_atproto_sync_get_commit_path.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let did = "your did";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_sync_get_commit_path(did)
|
||||||
|
.earliest("your earliest")
|
||||||
|
.latest("your latest")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/com_atproto_sync_get_head.rs
Normal file
10
examples/com_atproto_sync_get_head.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let did = "your did";
|
||||||
|
let response = client.com_atproto_sync_get_head(did).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
10
examples/com_atproto_sync_get_latest_commit.rs
Normal file
10
examples/com_atproto_sync_get_latest_commit.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let did = "your did";
|
||||||
|
let response = client.com_atproto_sync_get_latest_commit(did).await.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
16
examples/com_atproto_sync_get_record.rs
Normal file
16
examples/com_atproto_sync_get_record.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#![allow(unused_imports)]
|
||||||
|
use atproto::AtprotoClient;
|
||||||
|
use atproto::model::*;
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let client = AtprotoClient::from_env();
|
||||||
|
let collection = "your collection";
|
||||||
|
let did = "your did";
|
||||||
|
let rkey = "your rkey";
|
||||||
|
let response = client
|
||||||
|
.com_atproto_sync_get_record(collection, did, rkey)
|
||||||
|
.commit("your commit")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
println!("{:#?}", response);
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user