Skip to content

Commit

Permalink
add auth/access token parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Cytraen committed Jun 10, 2022
1 parent e404d52 commit c385e34
Show file tree
Hide file tree
Showing 4 changed files with 357 additions and 294 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

A Bungie.net API client.

All requests that don't require authorization *should* work.
All requests *should* work.
Requests that are part of the OAuth flow are not yet implemented.


## Example
Expand All @@ -14,9 +15,18 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.with_api_key("YOUR_API_KEY_HERE".to_string())
.build();

let manifest_resp = client.destiny2_get_destiny_manifest().await;
let manifest_response = client.destiny2_get_destiny_manifest(None).await;
println!("{:#?}", manifest_response.version.unwrap());

println!("{:#?}", manifest_resp.version.unwrap());
let search_response = client.destiny2_search_destiny_player_by_bungie_name(
rustgie_types::BungieMembershipType::All,
rustgie_types::user::ExactSearchRequest {
display_name: Some("Cytraen".parse().unwrap()),
display_name_code: 2213
}, None).await;
println!("{:#?}", search_response[0].display_name.as_ref().unwrap());

Ok(())
}
```

Expand Down
2 changes: 1 addition & 1 deletion rustgie/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords = ["bungie", "destiny", "destiny2"]
categories = ["api-bindings"]

[dependencies]
rustgie_types = { path = "../rustgie_types" }
rustgie_types = { path = "../rustgie_types", version = "0.0.1" }
reqwest = { version = "0.11.10", features = ["json", "gzip", "deflate", "brotli", "cookies"] }
serde = { version = "1.0.137" }
time = { version = "0.3.9", features = ["serde", "serde-well-known"] }
16 changes: 13 additions & 3 deletions rustgie/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

A Bungie.net API client.

All requests that don't require authorization *should* work.
All requests *should* work.
Requests that are part of the OAuth flow are not yet implemented.


## Example
Expand All @@ -14,9 +15,18 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.with_api_key("YOUR_API_KEY_HERE".to_string())
.build();

let manifest_resp = client.destiny2_get_destiny_manifest().await;
let manifest_response = client.destiny2_get_destiny_manifest(None).await;
println!("{:#?}", manifest_response.version.unwrap());

println!("{:#?}", manifest_resp.version.unwrap());
let search_response = client.destiny2_search_destiny_player_by_bungie_name(
rustgie_types::BungieMembershipType::All,
rustgie_types::user::ExactSearchRequest {
display_name: Some("Cytraen".parse().unwrap()),
display_name_code: 2213
}, None).await;
println!("{:#?}", search_response[0].display_name.as_ref().unwrap());

Ok(())
}
```

Expand Down
Loading

0 comments on commit c385e34

Please sign in to comment.