Skip to content

Commit

Permalink
refactor: replace namespace with id, bump version to 0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wangeguo committed Jan 15, 2024
1 parent d9345e8 commit 5f36b79
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "amp-client"
description = "The Amphitheatre API client for Rust"
version = "0.7.0"
version = "0.7.1"
edition = "2021"
license = "Apache-2.0"
homepage = "https://amphitheatre.app"
Expand All @@ -11,7 +11,7 @@ readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
amp-common = { git = "https://github.com/amphitheatre-app/common", tag = "v0.7.0" }
amp-common = { git = "https://github.com/amphitheatre-app/common", tag = "v0.7.1" }
futures = "0.3"
reqwest-eventsource = "0.5.0"
serde = { version = "1.0", features = ["derive"] }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ content-type: application/json
content-length: 1012
date: Sun, 14 Jan 2024 10:20:36 GMT

{"title":"Untitled","description":"","namespace":"amp-a82abba3-df2f-4608-b1a5-9e058ff80468","preface":{"name":"amp-example-go","manifest":{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}},"characters":[{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}]}
{"title":"Untitled","description":"","id":"a82abba3-df2f-4608-b1a5-9e058ff80468","preface":{"name":"amp-example-go","manifest":{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}},"characters":[{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}]}
2 changes: 1 addition & 1 deletion tests/fixtures/v1/api/playbooks/get-playbook-success.http
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ content-type: application/json
content-length: 1012
date: Sun, 14 Jan 2024 10:20:36 GMT

{"title":"Untitled","description":"","namespace":"amp-a82abba3-df2f-4608-b1a5-9e058ff80468","preface":{"name":"amp-example-go","manifest":{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}},"characters":[{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}]}
{"title":"Untitled","description":"","id":"a82abba3-df2f-4608-b1a5-9e058ff80468","preface":{"name":"amp-example-go","manifest":{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}},"characters":[{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}]}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ content-type: application/json
content-length: 1014
date: Sun, 14 Jan 2024 10:19:55 GMT

[{"title":"Untitled","description":"","namespace":"amp-a82abba3-df2f-4608-b1a5-9e058ff80468","preface":{"name":"amp-example-go","manifest":{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}},"characters":[{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}]}]
[{"title":"Untitled","description":"","id":"a82abba3-df2f-4608-b1a5-9e058ff80468","preface":{"name":"amp-example-go","manifest":{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}},"characters":[{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}]}]
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ content-type: application/json
content-length: 1012
date: Sun, 14 Jan 2024 10:20:36 GMT

{"title":"Untitled","description":"","namespace":"amp-a82abba3-df2f-4608-b1a5-9e058ff80468","preface":{"name":"amp-example-go","manifest":{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}},"characters":[{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}]}
{"title":"Untitled","description":"","id":"a82abba3-df2f-4608-b1a5-9e058ff80468","preface":{"name":"amp-example-go","manifest":{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}},"characters":[{"meta":{"name":"amp-example-go","version":"0.0.3","authors":["Eguo Wang <[email protected]>"],"description":"A simple Golang example app","readme":"README.md","homepage":"https://github.com/amphitheatre-app/amp-example-go","repository":"https://github.com/amphitheatre-app/amp-example-go","license":"Apache-2.0","keywords":["example","golang","getting-started"],"categories":["example"]},"partners":{},"live":true,"once":true}]}
32 changes: 16 additions & 16 deletions tests/playbooks_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn list_playbooks_test() {

let playbook = playbooks.first().unwrap();

assert_eq!("amp-a82abba3-df2f-4608-b1a5-9e058ff80468", playbook.id());
assert_eq!("a82abba3-df2f-4608-b1a5-9e058ff80468", playbook.id);
assert_eq!("Untitled", playbook.title);
assert_eq!(Some("".into()), playbook.description);
// assert_eq!("2016-01-19T20:50:26Z", playbook.created_at);
Expand All @@ -48,7 +48,7 @@ fn create_playbook_test() {

let playbook = client.playbooks().create(payload).unwrap();

assert_eq!("amp-a82abba3-df2f-4608-b1a5-9e058ff80468", playbook.id());
assert_eq!("a82abba3-df2f-4608-b1a5-9e058ff80468", playbook.id);
assert_eq!("Untitled", playbook.title);
assert_eq!(Some("".into()), playbook.description);
// assert_eq!("2016-01-19T20:50:26Z", playbook.created_at);
Expand All @@ -58,16 +58,16 @@ fn create_playbook_test() {
#[test]
fn get_playbook_test() {
let setup = setup_mock_for(
"/playbooks/amp-a82abba3-df2f-4608-b1a5-9e058ff80468",
"/playbooks/a82abba3-df2f-4608-b1a5-9e058ff80468",
"playbooks/get-playbook-success",
"GET",
);
let client = setup.0;
let playbook_id = "amp-a82abba3-df2f-4608-b1a5-9e058ff80468";
let playbook_id = "a82abba3-df2f-4608-b1a5-9e058ff80468";

let playbook = client.playbooks().get(playbook_id).unwrap();

assert_eq!("amp-a82abba3-df2f-4608-b1a5-9e058ff80468", playbook.id());
assert_eq!("a82abba3-df2f-4608-b1a5-9e058ff80468", playbook.id);
assert_eq!("Untitled", playbook.title);
assert_eq!(Some("".into()), playbook.description);
// assert_eq!("2016-01-19T20:50:26Z", playbook.created_at);
Expand All @@ -77,12 +77,12 @@ fn get_playbook_test() {
#[test]
fn update_playbook_test() {
let setup = setup_mock_for(
"/playbooks/amp-a82abba3-df2f-4608-b1a5-9e058ff80468",
"/playbooks/a82abba3-df2f-4608-b1a5-9e058ff80468",
"playbooks/update-playbook-success",
"PATCH",
);
let client = setup.0;
let playbook_id = "amp-a82abba3-df2f-4608-b1a5-9e058ff80468";
let playbook_id = "a82abba3-df2f-4608-b1a5-9e058ff80468";

let payload = PlaybookPayload {
title: String::from("Untitled"),
Expand All @@ -92,7 +92,7 @@ fn update_playbook_test() {

let playbook = client.playbooks().update(playbook_id, payload).unwrap();

assert_eq!("amp-a82abba3-df2f-4608-b1a5-9e058ff80468", playbook.id());
assert_eq!("a82abba3-df2f-4608-b1a5-9e058ff80468", playbook.id);
assert_eq!("Untitled", playbook.title);
assert_eq!(Some("".into()), playbook.description);
// assert_eq!("2016-01-19T20:50:26Z", playbook.created_at);
Expand All @@ -102,12 +102,12 @@ fn update_playbook_test() {
#[test]
fn delete_playbook_test() {
let setup = setup_mock_for(
"/playbooks/amp-a82abba3-df2f-4608-b1a5-9e058ff80468",
"/playbooks/a82abba3-df2f-4608-b1a5-9e058ff80468",
"playbooks/delete-playbook-success",
"DELETE",
);
let client = setup.0;
let playbook_id = "amp-a82abba3-df2f-4608-b1a5-9e058ff80468";
let playbook_id = "a82abba3-df2f-4608-b1a5-9e058ff80468";

let response = client.playbooks().delete(playbook_id);

Expand All @@ -118,12 +118,12 @@ fn delete_playbook_test() {
#[test]
fn get_playbook_events() {
let setup = setup_mock_for(
"/playbooks/amp-a82abba3-df2f-4608-b1a5-9e058ff80468/events",
"/playbooks/a82abba3-df2f-4608-b1a5-9e058ff80468/events",
"playbooks/get-playbook-events-success",
"GET",
);
let client = setup.0;
let playbook_id = "amp-a82abba3-df2f-4608-b1a5-9e058ff80468";
let playbook_id = "a82abba3-df2f-4608-b1a5-9e058ff80468";

let response = client.playbooks().events(playbook_id);

Expand All @@ -133,12 +133,12 @@ fn get_playbook_events() {
#[test]
fn start_playbook_test() {
let setup = setup_mock_for(
"/playbooks/amp-a82abba3-df2f-4608-b1a5-9e058ff80468/actions/start",
"/playbooks/a82abba3-df2f-4608-b1a5-9e058ff80468/actions/start",
"playbooks/start-playbook-success",
"POST",
);
let client = setup.0;
let playbook_id = "amp-a82abba3-df2f-4608-b1a5-9e058ff80468";
let playbook_id = "a82abba3-df2f-4608-b1a5-9e058ff80468";

let response = client.playbooks().start(playbook_id);

Expand All @@ -149,12 +149,12 @@ fn start_playbook_test() {
#[test]
fn stop_playbook_test() {
let setup = setup_mock_for(
"/playbooks/amp-a82abba3-df2f-4608-b1a5-9e058ff80468/actions/stop",
"/playbooks/a82abba3-df2f-4608-b1a5-9e058ff80468/actions/stop",
"playbooks/stop-playbook-success",
"POST",
);
let client = setup.0;
let playbook_id = "amp-a82abba3-df2f-4608-b1a5-9e058ff80468";
let playbook_id = "a82abba3-df2f-4608-b1a5-9e058ff80468";

let response = client.playbooks().stop(playbook_id);

Expand Down

0 comments on commit 5f36b79

Please sign in to comment.