Skip to content

Commit

Permalink
Actually execute the request
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera committed Mar 25, 2019
1 parent c46f7fd commit 9e6d05e
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/Console/AsmpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use ASMP\Client\Model\RollbackRequest;
use ASMP\WordPressIntegration\ASMP;
use GuzzleHttp\Client;
use Throwable;
use WP_CLI;

final class AsmpCommand {
Expand All @@ -43,7 +44,13 @@ public function check( array $args, array $assoc_args ): void {

$apiInstance = new CheckApi( new Client(), $this->config );
$body = new CheckRequest();
var_dump( $body );

try {
$response = $apiInstance->check( $body );
print_r( $response );
} catch ( Throwable $exception ) {
WP_CLI::error( "Exception when calling CheckApi->change: {$exception->getMessage()}" );
}
}

/**
Expand All @@ -57,7 +64,13 @@ public function change( array $args = [], array $assoc_args = [] ): void {

$apiInstance = new ChangeApi( new Client(), $this->config );
$body = new ChangeRequest();
var_dump( $body );

try {
$response = $apiInstance->change( $body );
print_r( $response );
} catch ( Throwable $exception ) {
WP_CLI::error( "Exception when calling ChangeApi->change: {$exception->getMessage()}" );
}
}

/**
Expand All @@ -71,7 +84,13 @@ public function rollback( array $args = [], array $assoc_args = [] ): void {

$apiInstance = new RollbackApi( new Client(), $this->config );
$body = new RollbackRequest();
var_dump( $body );

try {
$response = $apiInstance->rollback( $body );
print_r( $response );
} catch ( Throwable $exception ) {
WP_CLI::error( "Exception when calling RollbackApi->change: {$exception->getMessage()}" );
}
}

/**
Expand Down

0 comments on commit 9e6d05e

Please sign in to comment.