|
39 | 39 | * |
40 | 40 | * Use it with AuthTokenMiddleware to authorize http requests: |
41 | 41 | * |
42 | | - * use Google\Auth\Credentials\ServiceAccountCredentials; |
43 | | - * use Google\Auth\Middleware\AuthTokenMiddleware; |
44 | | - * use GuzzleHttp\Client; |
45 | | - * use GuzzleHttp\HandlerStack; |
| 42 | + * ``` |
| 43 | + * use Google\Auth\Credentials\ServiceAccountCredentials; |
| 44 | + * use Google\Auth\Middleware\AuthTokenMiddleware; |
| 45 | + * use GuzzleHttp\Client; |
| 46 | + * use GuzzleHttp\HandlerStack; |
46 | 47 | * |
47 | | - * $sa = new ServiceAccountCredentials( |
48 | | - * 'https://www.googleapis.com/auth/taskqueue', |
49 | | - * '/path/to/your/json/key_file.json' |
50 | | - * ); |
51 | | - * $middleware = new AuthTokenMiddleware($sa); |
52 | | - * $stack = HandlerStack::create(); |
53 | | - * $stack->push($middleware); |
| 48 | + * $sa = new ServiceAccountCredentials( |
| 49 | + * 'https://www.googleapis.com/auth/taskqueue', |
| 50 | + * '/path/to/your/json/key_file.json' |
| 51 | + * ); |
| 52 | + * $middleware = new AuthTokenMiddleware($sa); |
| 53 | + * $stack = HandlerStack::create(); |
| 54 | + * $stack->push($middleware); |
54 | 55 | * |
55 | | - * $client = new Client([ |
56 | | - * 'handler' => $stack, |
57 | | - * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', |
58 | | - * 'auth' => 'google_auth' // authorize all requests |
59 | | - * ]); |
| 56 | + * $client = new Client([ |
| 57 | + * 'handler' => $stack, |
| 58 | + * 'base_uri' => 'https://www.googleapis.com/taskqueue/v1beta2/projects/', |
| 59 | + * 'auth' => 'google_auth' // authorize all requests |
| 60 | + * ]); |
60 | 61 | * |
61 | | - * $res = $client->get('myproject/taskqueues/myqueue'); |
| 62 | + * $res = $client->get('myproject/taskqueues/myqueue'); |
| 63 | + * ``` |
62 | 64 | */ |
63 | 65 | class ServiceAccountCredentials extends CredentialsLoader implements |
64 | 66 | GetQuotaProjectInterface, |
|
0 commit comments