Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions AccessApproval/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,30 @@ Please see our [Authentication guide](https://github.com/googleapis/google-cloud
on authenticating your client. Once authenticated, you'll be ready to start making requests.


### Sample

```php
use Google\ApiCore\ApiException;
use Google\Cloud\AccessApproval\V1\AccessApprovalServiceAccount;
use Google\Cloud\AccessApproval\V1\Client\AccessApprovalClient;
use Google\Cloud\AccessApproval\V1\GetAccessApprovalServiceAccountMessage;

// Create a client.
$accessApprovalClient = new AccessApprovalClient();

// Prepare the request message.
$request = new GetAccessApprovalServiceAccountMessage();

// Call the API and handle any network failures.
try {
/** @var AccessApprovalServiceAccount $response */
$response = $accessApprovalClient->getAccessApprovalServiceAccount($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
```

### Debugging

Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md)
Expand Down
25 changes: 25 additions & 0 deletions AccessContextManager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,31 @@ please see our [gRPC installation guide](https://cloud.google.com/php/grpc).
Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information
on authenticating your client. Once authenticated, you'll be ready to start making requests.

### Sample

```php
use Google\ApiCore\ApiException;
use Google\Identity\AccessContextManager\V1\AccessLevel;
use Google\Identity\AccessContextManager\V1\Client\AccessContextManagerClient;
use Google\Identity\AccessContextManager\V1\GetAccessLevelRequest;

// Create a client.
$accessContextManagerClient = new AccessContextManagerClient();

// Prepare the request message.
$request = (new GetAccessLevelRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var AccessLevel $response */
$response = $accessContextManagerClient->getAccessLevel($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
```

### Debugging

Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md)
Expand Down
16 changes: 8 additions & 8 deletions AdsAdManager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ on authenticating your client. Once authenticated, you'll be ready to start maki
### Sample

```php
Google\Ads\AdManager\V1\AdUnit;
Google\Ads\AdManager\V1\Client\AdUnitServiceClient;
Google\Ads\AdManager\V1\GetAdUnitRequest;
Google\ApiCore\ApiException;
use Google\Ads\AdManager\V1\AdBreak;
use Google\Ads\AdManager\V1\Client\AdBreakServiceClient;
use Google\Ads\AdManager\V1\GetAdBreakRequest;
use Google\ApiCore\ApiException;

// Create a client.
$adUnitServiceClient = new AdUnitServiceClient();
$adBreakServiceClient = new AdBreakServiceClient();

// Prepare the request message.
$request = (new GetAdUnitRequest())
$request = (new GetAdBreakRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var AdUnit $response */
$response = $adUnitServiceClient->getAdUnit($request);
/** @var AdBreak $response */
$response = $adBreakServiceClient->getAdBreak($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
Expand Down
8 changes: 4 additions & 4 deletions AdsMarketingPlatformAdmin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ on authenticating your client. Once authenticated, you'll be ready to start maki
### Sample

```php
Google\Ads\MarketingPlatform\Admin\V1alpha\Client\MarketingplatformAdminServiceClient;
Google\Ads\MarketingPlatform\Admin\V1alpha\GetOrganizationRequest;
Google\Ads\MarketingPlatform\Admin\V1alpha\Organization;
Google\ApiCore\ApiException;
use Google\Ads\MarketingPlatform\Admin\V1alpha\Client\MarketingplatformAdminServiceClient;
use Google\Ads\MarketingPlatform\Admin\V1alpha\GetOrganizationRequest;
use Google\Ads\MarketingPlatform\Admin\V1alpha\Organization;
use Google\ApiCore\ApiException;

// Create a client.
$marketingplatformAdminServiceClient = new MarketingplatformAdminServiceClient();
Expand Down
8 changes: 4 additions & 4 deletions AdvisoryNotifications/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ on authenticating your client. Once authenticated, you'll be ready to start maki
### Sample

```php
Google\ApiCore\ApiException;
Google\Cloud\AdvisoryNotifications\V1\Client\AdvisoryNotificationsServiceClient;
Google\Cloud\AdvisoryNotifications\V1\GetNotificationRequest;
Google\Cloud\AdvisoryNotifications\V1\Notification;
use Google\ApiCore\ApiException;
use Google\Cloud\AdvisoryNotifications\V1\Client\AdvisoryNotificationsServiceClient;
use Google\Cloud\AdvisoryNotifications\V1\GetNotificationRequest;
use Google\Cloud\AdvisoryNotifications\V1\Notification;

// Create a client.
$advisoryNotificationsServiceClient = new AdvisoryNotificationsServiceClient();
Expand Down
24 changes: 24 additions & 0 deletions AiPlatform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,30 @@ please see our [gRPC installation guide](https://cloud.google.com/php/grpc).
Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information
on authenticating your client. Once authenticated, you'll be ready to start making requests.

### Sample

```php
use Google\ApiCore\ApiException;
use Google\Cloud\AIPlatform\V1\Client\DataFoundryServiceClient;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;

// Create a client.
$dataFoundryServiceClient = new DataFoundryServiceClient();

// Prepare the request message.
$request = new GetLocationRequest();

// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $dataFoundryServiceClient->getLocation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
```

### Debugging

Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md)
Expand Down
8 changes: 4 additions & 4 deletions AlloyDb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ on authenticating your client. Once authenticated, you'll be ready to start maki
### Sample

```php
Google\ApiCore\ApiException;
Google\Cloud\AlloyDb\V1\Backup;
Google\Cloud\AlloyDb\V1\Client\AlloyDBAdminClient;
Google\Cloud\AlloyDb\V1\GetBackupRequest;
use Google\ApiCore\ApiException;
use Google\Cloud\AlloyDb\V1\Backup;
use Google\Cloud\AlloyDb\V1\Client\AlloyDBAdminClient;
use Google\Cloud\AlloyDb\V1\GetBackupRequest;

// Create a client.
$alloyDBAdminClient = new AlloyDBAdminClient();
Expand Down
29 changes: 18 additions & 11 deletions AnalyticsAdmin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,25 @@ on authenticating your client. Once authenticated, you'll be ready to start maki
### Sample

```php
require 'vendor/autoload.php';

use Google\Analytics\Admin\V1beta\Account;
use Google\Analytics\Admin\V1beta\Client\AnalyticsAdminServiceClient;
use Google\Analytics\Admin\V1beta\ListAccountsRequest;

$client = new AnalyticsAdminServiceClient();

$request = new ListAccountsRequest();
$accounts = $client->listAccounts($request);

foreach ($accounts as $account) {
print 'Found account: ' . $account->getName() . PHP_EOL;
use Google\Analytics\Admin\V1beta\GetAccountRequest;
use Google\ApiCore\ApiException;

// Create a client.
$analyticsAdminServiceClient = new AnalyticsAdminServiceClient();

// Prepare the request message.
$request = (new GetAccountRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var Account $response */
$response = $analyticsAdminServiceClient->getAccount($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
```

Expand Down
33 changes: 18 additions & 15 deletions AnalyticsData/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,25 @@ on authenticating your client. Once authenticated, you'll be ready to start maki
### Sample

```php
require 'vendor/autoload.php';

use Google\Analytics\Data\V1beta\AudienceExport;
use Google\Analytics\Data\V1beta\Client\BetaAnalyticsDataClient;
use Google\Analytics\Data\V1beta\RunReportRequest;

$client = new BetaAnalyticsDataClient();

$request = new RunReportRequest([
'property' => 'properties/[YOUR_PROPERTY_ID]'
]);
$response = $client->runReport($request);

foreach ($response->getRows() as $row) {
foreach ($row->getDimensionValues() as $dimensionValue) {
print 'Dimension Value: ' . $dimensionValue->getValue() . PHP_EOL;
}
use Google\Analytics\Data\V1beta\GetAudienceExportRequest;
use Google\ApiCore\ApiException;

// Create a client.
$betaAnalyticsDataClient = new BetaAnalyticsDataClient();

// Prepare the request message.
$request = (new GetAudienceExportRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var AudienceExport $response */
$response = $betaAnalyticsDataClient->getAudienceExport($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
```

Expand Down
25 changes: 25 additions & 0 deletions ApiGateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,31 @@ Please see our [Authentication guide](https://github.com/googleapis/google-cloud
on authenticating your client. Once authenticated, you'll be ready to start making requests.


### Sample

```php
use Google\ApiCore\ApiException;
use Google\Cloud\ApiGateway\V1\Api;
use Google\Cloud\ApiGateway\V1\Client\ApiGatewayServiceClient;
use Google\Cloud\ApiGateway\V1\GetApiRequest;

// Create a client.
$apiGatewayServiceClient = new ApiGatewayServiceClient();

// Prepare the request message.
$request = (new GetApiRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var Api $response */
$response = $apiGatewayServiceClient->getApi($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
```

### Debugging

Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md)
Expand Down
8 changes: 4 additions & 4 deletions ApiHub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ on authenticating your client. Once authenticated, you'll be ready to start maki
### Sample

```php
Google\ApiCore\ApiException;
Google\Cloud\ApiHub\V1\Api;
Google\Cloud\ApiHub\V1\Client\ApiHubClient;
Google\Cloud\ApiHub\V1\GetApiRequest;
use Google\ApiCore\ApiException;
use Google\Cloud\ApiHub\V1\Api;
use Google\Cloud\ApiHub\V1\Client\ApiHubClient;
use Google\Cloud\ApiHub\V1\GetApiRequest;

// Create a client.
$apiHubClient = new ApiHubClient();
Expand Down
25 changes: 25 additions & 0 deletions ApiKeys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,31 @@ please see our [gRPC installation guide](https://cloud.google.com/php/grpc).
Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information
on authenticating your client. Once authenticated, you'll be ready to start making requests.

### Sample

```php
use Google\ApiCore\ApiException;
use Google\Cloud\ApiKeys\V2\Client\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\GetKeyRequest;
use Google\Cloud\ApiKeys\V2\Key;

// Create a client.
$apiKeysClient = new ApiKeysClient();

// Prepare the request message.
$request = (new GetKeyRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var Key $response */
$response = $apiKeysClient->getKey($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
```

### Debugging

Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md)
Expand Down
30 changes: 30 additions & 0 deletions ApigeeConnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,36 @@ Please see our [Authentication guide](https://github.com/googleapis/google-cloud
on authenticating your client. Once authenticated, you'll be ready to start making requests.


### Sample

```php
use Google\ApiCore\ApiException;
use Google\ApiCore\BidiStream;
use Google\Cloud\ApigeeConnect\V1\Client\TetherClient;
use Google\Cloud\ApigeeConnect\V1\EgressRequest;
use Google\Cloud\ApigeeConnect\V1\EgressResponse;

// Create a client.
$tetherClient = new TetherClient();

// Prepare the request message.
$request = new EgressResponse();

// Call the API and handle any network failures.
try {
/** @var BidiStream $stream */
$stream = $tetherClient->egress();
$stream->writeAll([$request,]);

/** @var EgressRequest $element */
foreach ($stream->closeWriteAndReadAll() as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
```

### Debugging

Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md)
Expand Down
25 changes: 25 additions & 0 deletions ApigeeRegistry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,31 @@ please see our [gRPC installation guide](https://cloud.google.com/php/grpc).
Please see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information
on authenticating your client. Once authenticated, you'll be ready to start making requests.

### Sample

```php
use Google\ApiCore\ApiException;
use Google\Cloud\ApigeeRegistry\V1\Client\ProvisioningClient;
use Google\Cloud\ApigeeRegistry\V1\GetInstanceRequest;
use Google\Cloud\ApigeeRegistry\V1\Instance;

// Create a client.
$provisioningClient = new ProvisioningClient();

// Prepare the request message.
$request = (new GetInstanceRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var Instance $response */
$response = $provisioningClient->getInstance($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
```

### Debugging

Please see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md)
Expand Down
Loading
Loading