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
22 changes: 8 additions & 14 deletions Core/src/ServiceBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
use Google\Cloud\Speech\SpeechClient as DeprecatedSpeechClient;
use Google\Cloud\Speech\V2\Client\SpeechClient;
use Google\Cloud\Storage\StorageClient;
use Google\Cloud\Trace\TraceClient;
use Google\Cloud\Trace\V2\Client\TraceServiceClient;
use Google\Cloud\Translate\V2\TranslateClient as DeprecatedTranslateClient;
use Google\Cloud\Translate\V3\Client\TranslationServiceClient;
use Google\Cloud\Vision\V1\Client\ImageAnnotatorClient;
Expand Down Expand Up @@ -311,22 +311,16 @@ public function storage(array $config = [])
}

/**
* Google Stackdriver Trace allows you to collect latency data from your applications
* and display it in the Google Cloud Platform Console. Find more information at
* [Stackdriver Trace API docs](https://cloud.google.com/trace/docs/).
*
* Example:
* ```
* $trace = $cloud->trace();
* ```
*
* @param array $config [optional] Configuration options. See
* {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the available options.
* @return TraceClient
* @deprecated
* @see TraceServiceClient
* @throws \BadMethodCallException
*/
public function trace(array $config = [])
{
return $this->createClient(TraceClient::class, 'trace', $config);
throw new \BadMethodCallException(sprintf(
'This method is no longer supported, create %s directly instead.',
TraceServiceClient::class
));
}

/**
Expand Down
3 changes: 0 additions & 3 deletions Core/tests/Snippet/ServiceBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@

use Google\Cloud\BigQuery\BigQueryClient;
use Google\Cloud\Core\ServiceBuilder;
use Google\Cloud\Datastore\DatastoreClient;
use Google\Cloud\Core\Testing\Snippet\SnippetTestCase;
use Google\Cloud\Firestore\FirestoreClient;
use Google\Cloud\Language\LanguageClient;
use Google\Cloud\Logging\LoggingClient;
use Google\Cloud\PubSub\PubSubClient;
use Google\Cloud\Spanner\SpannerClient;
use Google\Cloud\Storage\StorageClient;
use Google\Cloud\Trace\TraceClient;

/**
* @group root
Expand Down Expand Up @@ -57,7 +55,6 @@ public function serviceBuilderMethods()
['pubsub', PubSubClient::class, 'pubsub'],
['spanner', SpannerClient::class, 'spanner', true],
['storage', StorageClient::class, 'storage'],
['trace', TraceClient::class, 'trace'],
];
}

Expand Down
2 changes: 0 additions & 2 deletions Core/tests/Unit/ServicesNotFoundTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ private static function getApis()
"PubSub",
"Spanner",
"Storage",
"Trace",
"VideoIntelligence",
];
}
Expand All @@ -89,7 +88,6 @@ public function serviceBuilderMethods()
['pubsub'],
['spanner'],
['storage'],
['trace'],
];
}

Expand Down
92 changes: 0 additions & 92 deletions Trace/metadata/V1/Trace.php

This file was deleted.

59 changes: 8 additions & 51 deletions Trace/owlbot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,59 +32,16 @@

php.owlbot_main(src=src, dest=dest)

# Change the wording for the deprecation warning.
s.replace(
'src/*/*_*.php',
r'will be removed in the next major release',
'will be removed in a future release')

# Use new namespace in the doc sample. See
# https://github.com/googleapis/gapic-generator/issues/2141
s.replace(
'src/V2/Gapic/TraceServiceGapicClient.php',
r'@type Span_',
r'@type ')

s.replace(
'src/V2/Gapic/TraceServiceGapicClient.php',
r'Span_',
r'Span\\')

### [START] protoc backwards compatibility fixes

# roll back to private properties.
s.replace(
"src/**/V*/**/*.php",
r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$",
r"""Generated from protobuf field \1
*/
private $""")

# Replace "Unwrapped" with "Value" for method names.
s.replace(
"src/**/V*/**/*.php",
r"public function ([s|g]\w{3,})Unwrapped",
r"public function \1Value"
)

### [END] protoc backwards compatibility fixes

# fix relative cloud.google.com links
s.replace(
"src/**/V*/**/*.php",
r"(.{0,})\]\((/.{0,})\)",
r"\1](https://cloud.google.com\2)"
)

# format generated clients
subprocess.run([
'npx',
'-y',
'-p',
'@prettier/plugin-php@^0.19',
'npm',
'exec',
'--yes',
'--package=@prettier/plugin-php@^0.19',
'--',
'prettier',
'**/Gapic/*',
'**/Client/*',
'--write',
'--parser=php',
'--single-quote',
'--print-width=80'])
'--print-width=120'])
16 changes: 0 additions & 16 deletions Trace/phpunit-snippets.xml.dist

This file was deleted.

87 changes: 0 additions & 87 deletions Trace/src/Annotation.php

This file was deleted.

Loading
Loading