Reference documentation and code samples for the Google Cloud Secure Source Manager V1 Client class SecureSourceManagerClient.
Service Description: Secure Source Manager API
Access Secure Source Manager instances, resources, and repositories.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
Namespace
Google \ Cloud \ SecureSourceManager \ V1 \ ClientMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
options |
array
Optional. Options for configuring the service API wrapper. |
↳ apiEndpoint |
string
The address of the API remote host. May optionally include the port, formatted as "
|
↳ credentials |
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. Important: If you accept a credential configuration (credential JSON/File/Stream) from an external source for authentication to Google Cloud Platform, you must validate it before providing it to any Google API or library. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. For more information https://cloud.google.com/docs/authentication/external/externally-sourced-credentials |
↳ credentialsConfig |
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() . |
↳ disableRetries |
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to |
↳ clientConfig |
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
↳ transport |
string|TransportInterface
The transport used for executing network requests. May be either the string |
↳ transportConfig |
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options. |
↳ clientCertSource |
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
↳ logger |
false|LoggerInterface
A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
batchCreatePullRequestComments
Batch creates pull request comments. This function is used to create multiple PullRequestComments for code review. There needs to be exactly one PullRequestComment of type Review, and at most 100 PullRequestComments of type Code per request. The Postition of the code comments must be unique within the request.
The async variant is SecureSourceManagerClient::batchCreatePullRequestCommentsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\BatchCreatePullRequestCommentsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\BatchCreatePullRequestCommentsRequest;
use Google\Cloud\SecureSourceManager\V1\BatchCreatePullRequestCommentsResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\CreatePullRequestCommentRequest;
use Google\Cloud\SecureSourceManager\V1\PullRequestComment;
use Google\Rpc\Status;
/**
* @param string $formattedParent The pull request in which to create the pull request comments.
* Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
* Please see {@see SecureSourceManagerClient::pullRequestName()} for help formatting this field.
* @param string $formattedRequestsParent The pull request in which to create the pull request comment.
* Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
* Please see {@see SecureSourceManagerClient::pullRequestName()} for help formatting this field.
*/
function batch_create_pull_request_comments_sample(
string $formattedParent,
string $formattedRequestsParent
): void {
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$requestsPullRequestComment = new PullRequestComment();
$createPullRequestCommentRequest = (new CreatePullRequestCommentRequest())
->setParent($formattedRequestsParent)
->setPullRequestComment($requestsPullRequestComment);
$requests = [$createPullRequestCommentRequest,];
$request = (new BatchCreatePullRequestCommentsRequest())
->setParent($formattedParent)
->setRequests($requests);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->batchCreatePullRequestComments($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var BatchCreatePullRequestCommentsResponse $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::pullRequestName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]'
);
$formattedRequestsParent = SecureSourceManagerClient::pullRequestName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]'
);
batch_create_pull_request_comments_sample($formattedParent, $formattedRequestsParent);
}
closeIssue
Closes an issue.
The async variant is SecureSourceManagerClient::closeIssueAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CloseIssueRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\CloseIssueRequest;
use Google\Cloud\SecureSourceManager\V1\Issue;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the issue to close.
* The format is
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. Please see
* {@see SecureSourceManagerClient::issueName()} for help formatting this field.
*/
function close_issue_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new CloseIssueRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->closeIssue($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Issue $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::issueName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[ISSUE]'
);
close_issue_sample($formattedName);
}
closePullRequest
Closes a pull request without merging.
The async variant is SecureSourceManagerClient::closePullRequestAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ClosePullRequestRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\ClosePullRequestRequest;
use Google\Cloud\SecureSourceManager\V1\PullRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The pull request to close.
* Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
* Please see {@see SecureSourceManagerClient::pullRequestName()} for help formatting this field.
*/
function close_pull_request_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new ClosePullRequestRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->closePullRequest($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var PullRequest $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::pullRequestName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]'
);
close_pull_request_sample($formattedName);
}
createBranchRule
CreateBranchRule creates a branch rule in a given repository.
The async variant is SecureSourceManagerClient::createBranchRuleAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreateBranchRuleRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\BranchRule;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\CreateBranchRuleRequest;
use Google\Rpc\Status;
/**
* @param string $formattedParent Please see {@see SecureSourceManagerClient::repositoryName()} for help formatting this field.
* @param string $branchRuleId
*/
function create_branch_rule_sample(string $formattedParent, string $branchRuleId): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$branchRule = new BranchRule();
$request = (new CreateBranchRuleRequest())
->setParent($formattedParent)
->setBranchRule($branchRule)
->setBranchRuleId($branchRuleId);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->createBranchRule($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var BranchRule $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::repositoryName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]'
);
$branchRuleId = '[BRANCH_RULE_ID]';
create_branch_rule_sample($formattedParent, $branchRuleId);
}
createHook
Creates a new hook in a given repository.
The async variant is SecureSourceManagerClient::createHookAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreateHookRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\CreateHookRequest;
use Google\Cloud\SecureSourceManager\V1\Hook;
use Google\Rpc\Status;
/**
* @param string $formattedParent The repository in which to create the hook. Values are of the
* form
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
* Please see {@see SecureSourceManagerClient::repositoryName()} for help formatting this field.
* @param string $hookTargetUri The target URI to which the payloads will be delivered.
* @param string $hookId The ID to use for the hook, which will become the final component
* of the hook's resource name. This value restricts to lower-case letters,
* numbers, and hyphen, with the first character a letter, the last a letter
* or a number, and a 63 character maximum.
*/
function create_hook_sample(string $formattedParent, string $hookTargetUri, string $hookId): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$hook = (new Hook())
->setTargetUri($hookTargetUri);
$request = (new CreateHookRequest())
->setParent($formattedParent)
->setHook($hook)
->setHookId($hookId);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->createHook($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Hook $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::repositoryName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]'
);
$hookTargetUri = '[TARGET_URI]';
$hookId = '[HOOK_ID]';
create_hook_sample($formattedParent, $hookTargetUri, $hookId);
}
createInstance
Creates a new instance in a given project and location.
The async variant is SecureSourceManagerClient::createInstanceAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreateInstanceRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\CreateInstanceRequest;
use Google\Cloud\SecureSourceManager\V1\Instance;
use Google\Rpc\Status;
/**
* @param string $formattedParent Value for parent. Please see
* {@see SecureSourceManagerClient::locationName()} for help formatting this field.
* @param string $instanceId ID of the instance to be created.
*/
function create_instance_sample(string $formattedParent, string $instanceId): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$instance = new Instance();
$request = (new CreateInstanceRequest())
->setParent($formattedParent)
->setInstanceId($instanceId)
->setInstance($instance);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->createInstance($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Instance $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::locationName('[PROJECT]', '[LOCATION]');
$instanceId = '[INSTANCE_ID]';
create_instance_sample($formattedParent, $instanceId);
}
createIssue
Creates an issue.
The async variant is SecureSourceManagerClient::createIssueAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreateIssueRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\CreateIssueRequest;
use Google\Cloud\SecureSourceManager\V1\Issue;
use Google\Rpc\Status;
/**
* @param string $formattedParent The repository in which to create the issue. Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
* Please see {@see SecureSourceManagerClient::repositoryName()} for help formatting this field.
* @param string $issueTitle Issue title.
*/
function create_issue_sample(string $formattedParent, string $issueTitle): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$issue = (new Issue())
->setTitle($issueTitle);
$request = (new CreateIssueRequest())
->setParent($formattedParent)
->setIssue($issue);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->createIssue($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Issue $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::repositoryName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]'
);
$issueTitle = '[TITLE]';
create_issue_sample($formattedParent, $issueTitle);
}
createIssueComment
Creates an issue comment.
The async variant is SecureSourceManagerClient::createIssueCommentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreateIssueCommentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\CreateIssueCommentRequest;
use Google\Cloud\SecureSourceManager\V1\IssueComment;
use Google\Rpc\Status;
/**
* @param string $formattedParent The issue in which to create the issue comment. Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`
* Please see {@see SecureSourceManagerClient::issueName()} for help formatting this field.
* @param string $issueCommentBody The comment body.
*/
function create_issue_comment_sample(string $formattedParent, string $issueCommentBody): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$issueComment = (new IssueComment())
->setBody($issueCommentBody);
$request = (new CreateIssueCommentRequest())
->setParent($formattedParent)
->setIssueComment($issueComment);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->createIssueComment($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var IssueComment $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::issueName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[ISSUE]'
);
$issueCommentBody = '[BODY]';
create_issue_comment_sample($formattedParent, $issueCommentBody);
}
createPullRequest
Creates a pull request.
The async variant is SecureSourceManagerClient::createPullRequestAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreatePullRequestRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\CreatePullRequestRequest;
use Google\Cloud\SecureSourceManager\V1\PullRequest;
use Google\Cloud\SecureSourceManager\V1\PullRequest\Branch;
use Google\Rpc\Status;
/**
* @param string $formattedParent The repository that the pull request is created from. Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
* Please see {@see SecureSourceManagerClient::repositoryName()} for help formatting this field.
* @param string $pullRequestTitle The pull request title.
* @param string $pullRequestBaseRef Name of the branch.
*/
function create_pull_request_sample(
string $formattedParent,
string $pullRequestTitle,
string $pullRequestBaseRef
): void {
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$pullRequestBase = (new Branch())
->setRef($pullRequestBaseRef);
$pullRequest = (new PullRequest())
->setTitle($pullRequestTitle)
->setBase($pullRequestBase);
$request = (new CreatePullRequestRequest())
->setParent($formattedParent)
->setPullRequest($pullRequest);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->createPullRequest($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var PullRequest $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::repositoryName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]'
);
$pullRequestTitle = '[TITLE]';
$pullRequestBaseRef = '[REF]';
create_pull_request_sample($formattedParent, $pullRequestTitle, $pullRequestBaseRef);
}
createPullRequestComment
Creates a pull request comment. This function is used to create a single PullRequestComment of type Comment, or a single PullRequestComment of type Code that's replying to another PullRequestComment of type Code. Use BatchCreatePullRequestComments to create multiple PullRequestComments for code reviews.
The async variant is SecureSourceManagerClient::createPullRequestCommentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreatePullRequestCommentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\CreatePullRequestCommentRequest;
use Google\Cloud\SecureSourceManager\V1\PullRequestComment;
use Google\Rpc\Status;
/**
* @param string $formattedParent The pull request in which to create the pull request comment.
* Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
* Please see {@see SecureSourceManagerClient::pullRequestName()} for help formatting this field.
*/
function create_pull_request_comment_sample(string $formattedParent): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$pullRequestComment = new PullRequestComment();
$request = (new CreatePullRequestCommentRequest())
->setParent($formattedParent)
->setPullRequestComment($pullRequestComment);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->createPullRequestComment($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var PullRequestComment $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::pullRequestName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]'
);
create_pull_request_comment_sample($formattedParent);
}
createRepository
Creates a new repository in a given project and location.
The Repository.Instance field is required in the request body for requests using the securesourcemanager.googleapis.com endpoint.
The async variant is SecureSourceManagerClient::createRepositoryAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreateRepositoryRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\CreateRepositoryRequest;
use Google\Cloud\SecureSourceManager\V1\Repository;
use Google\Rpc\Status;
/**
* @param string $formattedParent The project in which to create the repository. Values are of the
* form `projects/{project_number}/locations/{location_id}`
* Please see {@see SecureSourceManagerClient::locationName()} for help formatting this field.
* @param string $repositoryId The ID to use for the repository, which will become the final
* component of the repository's resource name. This value should be 4-63
* characters, and valid characters are /[a-z][0-9]-/.
*/
function create_repository_sample(string $formattedParent, string $repositoryId): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$repository = new Repository();
$request = (new CreateRepositoryRequest())
->setParent($formattedParent)
->setRepository($repository)
->setRepositoryId($repositoryId);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->createRepository($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Repository $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::locationName('[PROJECT]', '[LOCATION]');
$repositoryId = '[REPOSITORY_ID]';
create_repository_sample($formattedParent, $repositoryId);
}
deleteBranchRule
DeleteBranchRule deletes a branch rule.
The async variant is SecureSourceManagerClient::deleteBranchRuleAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeleteBranchRuleRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\DeleteBranchRuleRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Please see {@see SecureSourceManagerClient::branchRuleName()} for help formatting this field.
*/
function delete_branch_rule_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new DeleteBranchRuleRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->deleteBranchRule($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::branchRuleName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[BRANCH_RULE]'
);
delete_branch_rule_sample($formattedName);
}
deleteHook
Deletes a Hook.
The async variant is SecureSourceManagerClient::deleteHookAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeleteHookRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\DeleteHookRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the hook to delete.
* The format is
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. Please see
* {@see SecureSourceManagerClient::hookName()} for help formatting this field.
*/
function delete_hook_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new DeleteHookRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->deleteHook($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::hookName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[HOOK]'
);
delete_hook_sample($formattedName);
}
deleteInstance
Deletes a single instance.
The async variant is SecureSourceManagerClient::deleteInstanceAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeleteInstanceRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\DeleteInstanceRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the resource. Please see
* {@see SecureSourceManagerClient::instanceName()} for help formatting this field.
*/
function delete_instance_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new DeleteInstanceRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->deleteInstance($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
delete_instance_sample($formattedName);
}
deleteIssue
Deletes an issue.
The async variant is SecureSourceManagerClient::deleteIssueAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeleteIssueRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\DeleteIssueRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the issue to delete.
* The format is
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. Please see
* {@see SecureSourceManagerClient::issueName()} for help formatting this field.
*/
function delete_issue_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new DeleteIssueRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->deleteIssue($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::issueName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[ISSUE]'
);
delete_issue_sample($formattedName);
}
deleteIssueComment
Deletes an issue comment.
The async variant is SecureSourceManagerClient::deleteIssueCommentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeleteIssueCommentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\DeleteIssueCommentRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the issue comment to delete.
* The format is
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}`. Please see
* {@see SecureSourceManagerClient::issueCommentName()} for help formatting this field.
*/
function delete_issue_comment_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new DeleteIssueCommentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->deleteIssueComment($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::issueCommentName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[ISSUE]',
'[COMMENT]'
);
delete_issue_comment_sample($formattedName);
}
deletePullRequestComment
Deletes a pull request comment.
The async variant is SecureSourceManagerClient::deletePullRequestCommentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeletePullRequestCommentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\DeletePullRequestCommentRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the pull request comment to delete.
* The format is
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. Please see
* {@see SecureSourceManagerClient::pullRequestCommentName()} for help formatting this field.
*/
function delete_pull_request_comment_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new DeletePullRequestCommentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->deletePullRequestComment($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::pullRequestCommentName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]',
'[COMMENT]'
);
delete_pull_request_comment_sample($formattedName);
}
deleteRepository
Deletes a Repository.
The async variant is SecureSourceManagerClient::deleteRepositoryAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeleteRepositoryRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\DeleteRepositoryRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the repository to delete.
* The format is
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. Please see
* {@see SecureSourceManagerClient::repositoryName()} for help formatting this field.
*/
function delete_repository_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new DeleteRepositoryRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->deleteRepository($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::repositoryName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]'
);
delete_repository_sample($formattedName);
}
fetchBlob
Fetches a blob from a repository.
The async variant is SecureSourceManagerClient::fetchBlobAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\FetchBlobRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\SecureSourceManager\V1\FetchBlobResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\FetchBlobRequest;
use Google\Cloud\SecureSourceManager\V1\FetchBlobResponse;
/**
* @param string $formattedRepository The format is
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
* Specifies the repository containing the blob. Please see
* {@see SecureSourceManagerClient::repositoryName()} for help formatting this field.
* @param string $sha The SHA-1 hash of the blob to retrieve.
*/
function fetch_blob_sample(string $formattedRepository, string $sha): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new FetchBlobRequest())
->setRepository($formattedRepository)
->setSha($sha);
// Call the API and handle any network failures.
try {
/** @var FetchBlobResponse $response */
$response = $secureSourceManagerClient->fetchBlob($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedRepository = SecureSourceManagerClient::repositoryName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]'
);
$sha = '[SHA]';
fetch_blob_sample($formattedRepository, $sha);
}
fetchTree
Fetches a tree from a repository.
The async variant is SecureSourceManagerClient::fetchTreeAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\FetchTreeRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\FetchTreeRequest;
use Google\Cloud\SecureSourceManager\V1\TreeEntry;
/**
* @param string $formattedRepository The format is
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`.
* Specifies the repository to fetch the tree from. Please see
* {@see SecureSourceManagerClient::repositoryName()} for help formatting this field.
*/
function fetch_tree_sample(string $formattedRepository): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new FetchTreeRequest())
->setRepository($formattedRepository);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $secureSourceManagerClient->fetchTree($request);
/** @var TreeEntry $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedRepository = SecureSourceManagerClient::repositoryName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]'
);
fetch_tree_sample($formattedRepository);
}
getBranchRule
GetBranchRule gets a branch rule.
The async variant is SecureSourceManagerClient::getBranchRuleAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetBranchRuleRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\SecureSourceManager\V1\BranchRule |
use Google\ApiCore\ApiException;
use Google\Cloud\SecureSourceManager\V1\BranchRule;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\GetBranchRuleRequest;
/**
* @param string $formattedName Name of the repository to retrieve.
* The format is
* `projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}`. Please see
* {@see SecureSourceManagerClient::branchRuleName()} for help formatting this field.
*/
function get_branch_rule_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new GetBranchRuleRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var BranchRule $response */
$response = $secureSourceManagerClient->getBranchRule($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::branchRuleName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[BRANCH_RULE]'
);
get_branch_rule_sample($formattedName);
}
getHook
Gets metadata of a hook.
The async variant is SecureSourceManagerClient::getHookAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetHookRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\SecureSourceManager\V1\Hook |
use Google\ApiCore\ApiException;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\GetHookRequest;
use Google\Cloud\SecureSourceManager\V1\Hook;
/**
* @param string $formattedName Name of the hook to retrieve.
* The format is
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}`. Please see
* {@see SecureSourceManagerClient::hookName()} for help formatting this field.
*/
function get_hook_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new GetHookRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Hook $response */
$response = $secureSourceManagerClient->getHook($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::hookName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[HOOK]'
);
get_hook_sample($formattedName);
}
getIamPolicyRepo
Get IAM policy for a repository.
The async variant is SecureSourceManagerClient::getIamPolicyRepoAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\GetIamPolicyRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
/**
* @param string $resource REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
*/
function get_iam_policy_repo_sample(string $resource): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new GetIamPolicyRequest())
->setResource($resource);
// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $secureSourceManagerClient->getIamPolicyRepo($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
get_iam_policy_repo_sample($resource);
}
getInstance
Gets details of a single instance.
The async variant is SecureSourceManagerClient::getInstanceAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetInstanceRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\SecureSourceManager\V1\Instance |
use Google\ApiCore\ApiException;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\GetInstanceRequest;
use Google\Cloud\SecureSourceManager\V1\Instance;
/**
* @param string $formattedName Name of the resource. Please see
* {@see SecureSourceManagerClient::instanceName()} for help formatting this field.
*/
function get_instance_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new GetInstanceRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Instance $response */
$response = $secureSourceManagerClient->getInstance($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]');
get_instance_sample($formattedName);
}
getIssue
Gets an issue.
The async variant is SecureSourceManagerClient::getIssueAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetIssueRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\SecureSourceManager\V1\Issue |
use Google\ApiCore\ApiException;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\GetIssueRequest;
use Google\Cloud\SecureSourceManager\V1\Issue;
/**
* @param string $formattedName Name of the issue to retrieve.
* The format is
* `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}`. Please see
* {@see SecureSourceManagerClient::issueName()} for help formatting this field.
*/
function get_issue_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new GetIssueRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Issue $response */
$response = $secureSourceManagerClient->getIssue($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::issueName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[ISSUE]'
);
get_issue_sample($formattedName);
}
getIssueComment
Gets an issue comment.
The async variant is SecureSourceManagerClient::getIssueCommentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetIssueCommentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\SecureSourceManager\V1\IssueComment |
use Google\ApiCore\ApiException;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\GetIssueCommentRequest;
use Google\Cloud\SecureSourceManager\V1\IssueComment;
/**
* @param string $formattedName Name of the issue comment to retrieve.
* The format is
* `projects/{project}/locations/{location}/repositories/{repository}/issues/{issue_id}/issueComments/{comment_id}`. Please see
* {@see SecureSourceManagerClient::issueCommentName()} for help formatting this field.
*/
function get_issue_comment_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new GetIssueCommentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var IssueComment $response */
$response = $secureSourceManagerClient->getIssueComment($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::issueCommentName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[ISSUE]',
'[COMMENT]'
);
get_issue_comment_sample($formattedName);
}
getPullRequest
Gets a pull request.
The async variant is SecureSourceManagerClient::getPullRequestAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetPullRequestRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\SecureSourceManager\V1\PullRequest |
use Google\ApiCore\ApiException;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\GetPullRequestRequest;
use Google\Cloud\SecureSourceManager\V1\PullRequest;
/**
* @param string $formattedName Name of the pull request to retrieve.
* The format is
* `projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}`. Please see
* {@see SecureSourceManagerClient::pullRequestName()} for help formatting this field.
*/
function get_pull_request_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new GetPullRequestRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var PullRequest $response */
$response = $secureSourceManagerClient->getPullRequest($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::pullRequestName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]'
);
get_pull_request_sample($formattedName);
}
getPullRequestComment
Gets a pull request comment.
The async variant is SecureSourceManagerClient::getPullRequestCommentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetPullRequestCommentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\SecureSourceManager\V1\PullRequestComment |
use Google\ApiCore\ApiException;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\GetPullRequestCommentRequest;
use Google\Cloud\SecureSourceManager\V1\PullRequestComment;
/**
* @param string $formattedName Name of the pull request comment to retrieve.
* The format is
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`. Please see
* {@see SecureSourceManagerClient::pullRequestCommentName()} for help formatting this field.
*/
function get_pull_request_comment_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new GetPullRequestCommentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var PullRequestComment $response */
$response = $secureSourceManagerClient->getPullRequestComment($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::pullRequestCommentName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]',
'[COMMENT]'
);
get_pull_request_comment_sample($formattedName);
}
getRepository
Gets metadata of a repository.
The async variant is SecureSourceManagerClient::getRepositoryAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetRepositoryRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\SecureSourceManager\V1\Repository |
use Google\ApiCore\ApiException;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\GetRepositoryRequest;
use Google\Cloud\SecureSourceManager\V1\Repository;
/**
* @param string $formattedName Name of the repository to retrieve.
* The format is
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`. Please see
* {@see SecureSourceManagerClient::repositoryName()} for help formatting this field.
*/
function get_repository_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new GetRepositoryRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Repository $response */
$response = $secureSourceManagerClient->getRepository($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::repositoryName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]'
);
get_repository_sample($formattedName);
}
listBranchRules
ListBranchRules lists branch rules in a given repository.
The async variant is SecureSourceManagerClient::listBranchRulesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListBranchRulesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecureSourceManager\V1\BranchRule;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\ListBranchRulesRequest;
/**
* @param string $formattedParent Please see {@see SecureSourceManagerClient::repositoryName()} for help formatting this field.
*/
function list_branch_rules_sample(string $formattedParent): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new ListBranchRulesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $secureSourceManagerClient->listBranchRules($request);
/** @var BranchRule $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::repositoryName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]'
);
list_branch_rules_sample($formattedParent);
}
listHooks
Lists hooks in a given repository.
The async variant is SecureSourceManagerClient::listHooksAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListHooksRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\Hook;
use Google\Cloud\SecureSourceManager\V1\ListHooksRequest;
/**
* @param string $formattedParent Parent value for ListHooksRequest. Please see
* {@see SecureSourceManagerClient::repositoryName()} for help formatting this field.
*/
function list_hooks_sample(string $formattedParent): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new ListHooksRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $secureSourceManagerClient->listHooks($request);
/** @var Hook $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::repositoryName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]'
);
list_hooks_sample($formattedParent);
}
listInstances
Lists Instances in a given project and location.
The async variant is SecureSourceManagerClient::listInstancesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListInstancesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\Instance;
use Google\Cloud\SecureSourceManager\V1\ListInstancesRequest;
/**
* @param string $formattedParent Parent value for ListInstancesRequest. Please see
* {@see SecureSourceManagerClient::locationName()} for help formatting this field.
*/
function list_instances_sample(string $formattedParent): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new ListInstancesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $secureSourceManagerClient->listInstances($request);
/** @var Instance $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::locationName('[PROJECT]', '[LOCATION]');
list_instances_sample($formattedParent);
}
listIssueComments
Lists comments in an issue.
The async variant is SecureSourceManagerClient::listIssueCommentsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListIssueCommentsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\IssueComment;
use Google\Cloud\SecureSourceManager\V1\ListIssueCommentsRequest;
/**
* @param string $formattedParent The issue in which to list the comments. Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`
* Please see {@see SecureSourceManagerClient::issueName()} for help formatting this field.
*/
function list_issue_comments_sample(string $formattedParent): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new ListIssueCommentsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $secureSourceManagerClient->listIssueComments($request);
/** @var IssueComment $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::issueName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[ISSUE]'
);
list_issue_comments_sample($formattedParent);
}
listIssues
Lists issues in a repository.
The async variant is SecureSourceManagerClient::listIssuesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListIssuesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\Issue;
use Google\Cloud\SecureSourceManager\V1\ListIssuesRequest;
/**
* @param string $formattedParent The repository in which to list issues. Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
* Please see {@see SecureSourceManagerClient::repositoryName()} for help formatting this field.
*/
function list_issues_sample(string $formattedParent): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new ListIssuesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $secureSourceManagerClient->listIssues($request);
/** @var Issue $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::repositoryName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]'
);
list_issues_sample($formattedParent);
}
listPullRequestComments
Lists pull request comments.
The async variant is SecureSourceManagerClient::listPullRequestCommentsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListPullRequestCommentsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\ListPullRequestCommentsRequest;
use Google\Cloud\SecureSourceManager\V1\PullRequestComment;
/**
* @param string $formattedParent The pull request in which to list pull request comments. Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
* Please see {@see SecureSourceManagerClient::pullRequestName()} for help formatting this field.
*/
function list_pull_request_comments_sample(string $formattedParent): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new ListPullRequestCommentsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $secureSourceManagerClient->listPullRequestComments($request);
/** @var PullRequestComment $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::pullRequestName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]'
);
list_pull_request_comments_sample($formattedParent);
}
listPullRequestFileDiffs
Lists a pull request's file diffs.
The async variant is SecureSourceManagerClient::listPullRequestFileDiffsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListPullRequestFileDiffsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\FileDiff;
use Google\Cloud\SecureSourceManager\V1\ListPullRequestFileDiffsRequest;
/**
* @param string $formattedName The pull request to list file diffs for.
* Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
* Please see {@see SecureSourceManagerClient::pullRequestName()} for help formatting this field.
*/
function list_pull_request_file_diffs_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new ListPullRequestFileDiffsRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $secureSourceManagerClient->listPullRequestFileDiffs($request);
/** @var FileDiff $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::pullRequestName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]'
);
list_pull_request_file_diffs_sample($formattedName);
}
listPullRequests
Lists pull requests in a repository.
The async variant is SecureSourceManagerClient::listPullRequestsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListPullRequestsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\ListPullRequestsRequest;
use Google\Cloud\SecureSourceManager\V1\PullRequest;
/**
* @param string $formattedParent The repository in which to list pull requests. Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}`
* Please see {@see SecureSourceManagerClient::repositoryName()} for help formatting this field.
*/
function list_pull_requests_sample(string $formattedParent): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new ListPullRequestsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $secureSourceManagerClient->listPullRequests($request);
/** @var PullRequest $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::repositoryName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]'
);
list_pull_requests_sample($formattedParent);
}
listRepositories
Lists Repositories in a given project and location.
The instance field is required in the query parameter for requests using the securesourcemanager.googleapis.com endpoint.
The async variant is SecureSourceManagerClient::listRepositoriesAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListRepositoriesRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\ListRepositoriesRequest;
use Google\Cloud\SecureSourceManager\V1\Repository;
/**
* @param string $formattedParent Parent value for ListRepositoriesRequest. Please see
* {@see SecureSourceManagerClient::locationName()} for help formatting this field.
*/
function list_repositories_sample(string $formattedParent): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new ListRepositoriesRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $secureSourceManagerClient->listRepositories($request);
/** @var Repository $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::locationName('[PROJECT]', '[LOCATION]');
list_repositories_sample($formattedParent);
}
mergePullRequest
Merges a pull request.
The async variant is SecureSourceManagerClient::mergePullRequestAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\MergePullRequestRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\MergePullRequestRequest;
use Google\Cloud\SecureSourceManager\V1\PullRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The pull request to merge.
* Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
* Please see {@see SecureSourceManagerClient::pullRequestName()} for help formatting this field.
*/
function merge_pull_request_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new MergePullRequestRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->mergePullRequest($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var PullRequest $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::pullRequestName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]'
);
merge_pull_request_sample($formattedName);
}
openIssue
Opens an issue.
The async variant is SecureSourceManagerClient::openIssueAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\OpenIssueRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\Issue;
use Google\Cloud\SecureSourceManager\V1\OpenIssueRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName Name of the issue to open.
* The format is
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}`. Please see
* {@see SecureSourceManagerClient::issueName()} for help formatting this field.
*/
function open_issue_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new OpenIssueRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->openIssue($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Issue $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::issueName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[ISSUE]'
);
open_issue_sample($formattedName);
}
openPullRequest
Opens a pull request.
The async variant is SecureSourceManagerClient::openPullRequestAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\OpenPullRequestRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\OpenPullRequestRequest;
use Google\Cloud\SecureSourceManager\V1\PullRequest;
use Google\Rpc\Status;
/**
* @param string $formattedName The pull request to open.
* Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
* Please see {@see SecureSourceManagerClient::pullRequestName()} for help formatting this field.
*/
function open_pull_request_sample(string $formattedName): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new OpenPullRequestRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->openPullRequest($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var PullRequest $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = SecureSourceManagerClient::pullRequestName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]'
);
open_pull_request_sample($formattedName);
}
resolvePullRequestComments
Resolves pull request comments. A list of PullRequestComment names must be provided. The PullRequestComment names must be in the same conversation thread. If auto_fill is set, all comments in the conversation thread will be resolved.
The async variant is SecureSourceManagerClient::resolvePullRequestCommentsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ResolvePullRequestCommentsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\ResolvePullRequestCommentsRequest;
use Google\Cloud\SecureSourceManager\V1\ResolvePullRequestCommentsResponse;
use Google\Rpc\Status;
/**
* @param string $formattedParent The pull request in which to resolve the pull request comments.
* Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
* Please see {@see SecureSourceManagerClient::pullRequestName()} for help formatting this field.
* @param string $formattedNamesElement The names of the pull request comments to resolve. Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`
* Only comments from the same threads are allowed in the same request. Please see
* {@see SecureSourceManagerClient::pullRequestCommentName()} for help formatting this field.
*/
function resolve_pull_request_comments_sample(
string $formattedParent,
string $formattedNamesElement
): void {
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$formattedNames = [$formattedNamesElement,];
$request = (new ResolvePullRequestCommentsRequest())
->setParent($formattedParent)
->setNames($formattedNames);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->resolvePullRequestComments($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var ResolvePullRequestCommentsResponse $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::pullRequestName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]'
);
$formattedNamesElement = SecureSourceManagerClient::pullRequestCommentName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]',
'[COMMENT]'
);
resolve_pull_request_comments_sample($formattedParent, $formattedNamesElement);
}
setIamPolicyRepo
Set IAM policy on a repository.
The async variant is SecureSourceManagerClient::setIamPolicyRepoAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\SetIamPolicyRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
/**
* @param string $resource REQUIRED: The resource for which the policy is being specified.
* See the operation documentation for the appropriate value for this field.
*/
function set_iam_policy_repo_sample(string $resource): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$policy = new Policy();
$request = (new SetIamPolicyRequest())
->setResource($resource)
->setPolicy($policy);
// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $secureSourceManagerClient->setIamPolicyRepo($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
set_iam_policy_repo_sample($resource);
}
testIamPermissionsRepo
Test IAM permissions on a repository.
IAM permission checks are not required on this method.
The async variant is SecureSourceManagerClient::testIamPermissionsRepoAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\TestIamPermissionsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\TestIamPermissionsResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
/**
* @param string $resource REQUIRED: The resource for which the policy detail is being requested.
* See the operation documentation for the appropriate value for this field.
* @param string $permissionsElement The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For more
* information see
* [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
*/
function test_iam_permissions_repo_sample(string $resource, string $permissionsElement): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$permissions = [$permissionsElement,];
$request = (new TestIamPermissionsRequest())
->setResource($resource)
->setPermissions($permissions);
// Call the API and handle any network failures.
try {
/** @var TestIamPermissionsResponse $response */
$response = $secureSourceManagerClient->testIamPermissionsRepo($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
$permissionsElement = '[PERMISSIONS]';
test_iam_permissions_repo_sample($resource, $permissionsElement);
}
unresolvePullRequestComments
Unresolves pull request comments. A list of PullRequestComment names must be provided. The PullRequestComment names must be in the same conversation thread. If auto_fill is set, all comments in the conversation thread will be unresolved.
The async variant is SecureSourceManagerClient::unresolvePullRequestCommentsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UnresolvePullRequestCommentsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\UnresolvePullRequestCommentsRequest;
use Google\Cloud\SecureSourceManager\V1\UnresolvePullRequestCommentsResponse;
use Google\Rpc\Status;
/**
* @param string $formattedParent The pull request in which to resolve the pull request comments.
* Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}`
* Please see {@see SecureSourceManagerClient::pullRequestName()} for help formatting this field.
* @param string $formattedNamesElement The names of the pull request comments to unresolve. Format:
* `projects/{project_number}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}`
* Only comments from the same threads are allowed in the same request. Please see
* {@see SecureSourceManagerClient::pullRequestCommentName()} for help formatting this field.
*/
function unresolve_pull_request_comments_sample(
string $formattedParent,
string $formattedNamesElement
): void {
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$formattedNames = [$formattedNamesElement,];
$request = (new UnresolvePullRequestCommentsRequest())
->setParent($formattedParent)
->setNames($formattedNames);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->unresolvePullRequestComments($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var UnresolvePullRequestCommentsResponse $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedParent = SecureSourceManagerClient::pullRequestName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]'
);
$formattedNamesElement = SecureSourceManagerClient::pullRequestCommentName(
'[PROJECT]',
'[LOCATION]',
'[REPOSITORY]',
'[PULL_REQUEST]',
'[COMMENT]'
);
unresolve_pull_request_comments_sample($formattedParent, $formattedNamesElement);
}
updateBranchRule
UpdateBranchRule updates a branch rule.
The async variant is SecureSourceManagerClient::updateBranchRuleAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdateBranchRuleRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\BranchRule;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\UpdateBranchRuleRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_branch_rule_sample(): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$branchRule = new BranchRule();
$updateMask = new FieldMask();
$request = (new UpdateBranchRuleRequest())
->setBranchRule($branchRule)
->setUpdateMask($updateMask);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->updateBranchRule($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var BranchRule $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateHook
Updates the metadata of a hook.
The async variant is SecureSourceManagerClient::updateHookAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdateHookRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\Hook;
use Google\Cloud\SecureSourceManager\V1\UpdateHookRequest;
use Google\Protobuf\FieldMask;
use Google\Rpc\Status;
/**
* @param string $hookTargetUri The target URI to which the payloads will be delivered.
*/
function update_hook_sample(string $hookTargetUri): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$updateMask = new FieldMask();
$hook = (new Hook())
->setTargetUri($hookTargetUri);
$request = (new UpdateHookRequest())
->setUpdateMask($updateMask)
->setHook($hook);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->updateHook($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Hook $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$hookTargetUri = '[TARGET_URI]';
update_hook_sample($hookTargetUri);
}
updateIssue
Updates a issue.
The async variant is SecureSourceManagerClient::updateIssueAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdateIssueRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\Issue;
use Google\Cloud\SecureSourceManager\V1\UpdateIssueRequest;
use Google\Rpc\Status;
/**
* @param string $issueTitle Issue title.
*/
function update_issue_sample(string $issueTitle): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$issue = (new Issue())
->setTitle($issueTitle);
$request = (new UpdateIssueRequest())
->setIssue($issue);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->updateIssue($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Issue $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$issueTitle = '[TITLE]';
update_issue_sample($issueTitle);
}
updateIssueComment
Updates an issue comment.
The async variant is SecureSourceManagerClient::updateIssueCommentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdateIssueCommentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\IssueComment;
use Google\Cloud\SecureSourceManager\V1\UpdateIssueCommentRequest;
use Google\Rpc\Status;
/**
* @param string $issueCommentBody The comment body.
*/
function update_issue_comment_sample(string $issueCommentBody): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$issueComment = (new IssueComment())
->setBody($issueCommentBody);
$request = (new UpdateIssueCommentRequest())
->setIssueComment($issueComment);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->updateIssueComment($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var IssueComment $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$issueCommentBody = '[BODY]';
update_issue_comment_sample($issueCommentBody);
}
updatePullRequest
Updates a pull request.
The async variant is SecureSourceManagerClient::updatePullRequestAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdatePullRequestRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\PullRequest;
use Google\Cloud\SecureSourceManager\V1\PullRequest\Branch;
use Google\Cloud\SecureSourceManager\V1\UpdatePullRequestRequest;
use Google\Rpc\Status;
/**
* @param string $pullRequestTitle The pull request title.
* @param string $pullRequestBaseRef Name of the branch.
*/
function update_pull_request_sample(string $pullRequestTitle, string $pullRequestBaseRef): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$pullRequestBase = (new Branch())
->setRef($pullRequestBaseRef);
$pullRequest = (new PullRequest())
->setTitle($pullRequestTitle)
->setBase($pullRequestBase);
$request = (new UpdatePullRequestRequest())
->setPullRequest($pullRequest);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->updatePullRequest($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var PullRequest $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$pullRequestTitle = '[TITLE]';
$pullRequestBaseRef = '[REF]';
update_pull_request_sample($pullRequestTitle, $pullRequestBaseRef);
}
updatePullRequestComment
Updates a pull request comment.
The async variant is SecureSourceManagerClient::updatePullRequestCommentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdatePullRequestCommentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\PullRequestComment;
use Google\Cloud\SecureSourceManager\V1\UpdatePullRequestCommentRequest;
use Google\Rpc\Status;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_pull_request_comment_sample(): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$pullRequestComment = new PullRequestComment();
$request = (new UpdatePullRequestCommentRequest())
->setPullRequestComment($pullRequestComment);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->updatePullRequestComment($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var PullRequestComment $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateRepository
Updates the metadata of a repository.
The async variant is SecureSourceManagerClient::updateRepositoryAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdateRepositoryRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
use Google\Cloud\SecureSourceManager\V1\Repository;
use Google\Cloud\SecureSourceManager\V1\UpdateRepositoryRequest;
use Google\Rpc\Status;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function update_repository_sample(): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$repository = new Repository();
$request = (new UpdateRepositoryRequest())
->setRepository($repository);
// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $secureSourceManagerClient->updateRepository($request);
$response->pollUntilComplete();
if ($response->operationSucceeded()) {
/** @var Repository $result */
$result = $response->getResult();
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
getIamPolicy
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
The async variant is SecureSourceManagerClient::getIamPolicyAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\GetIamPolicyRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
/**
* @param string $resource REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
*/
function get_iam_policy_sample(string $resource): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = (new GetIamPolicyRequest())
->setResource($resource);
// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $secureSourceManagerClient->getIamPolicy($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
get_iam_policy_sample($resource);
}
setIamPolicy
Sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND
, INVALID_ARGUMENT
, and PERMISSION_DENIED
errors.
The async variant is SecureSourceManagerClient::setIamPolicyAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\SetIamPolicyRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\Policy |
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
/**
* @param string $resource REQUIRED: The resource for which the policy is being specified.
* See the operation documentation for the appropriate value for this field.
*/
function set_iam_policy_sample(string $resource): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$policy = new Policy();
$request = (new SetIamPolicyRequest())
->setResource($resource)
->setPolicy($policy);
// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $secureSourceManagerClient->setIamPolicy($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
set_iam_policy_sample($resource);
}
testIamPermissions
Returns permissions that a caller has on the specified resource. If the
resource does not exist, this will return an empty set of
permissions, not a NOT_FOUND
error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
The async variant is SecureSourceManagerClient::testIamPermissionsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\TestIamPermissionsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Iam\V1\TestIamPermissionsResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
use Google\Cloud\Iam\V1\TestIamPermissionsResponse;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
/**
* @param string $resource REQUIRED: The resource for which the policy detail is being requested.
* See the operation documentation for the appropriate value for this field.
* @param string $permissionsElement The set of permissions to check for the `resource`. Permissions with
* wildcards (such as '*' or 'storage.*') are not allowed. For more
* information see
* [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
*/
function test_iam_permissions_sample(string $resource, string $permissionsElement): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$permissions = [$permissionsElement,];
$request = (new TestIamPermissionsRequest())
->setResource($resource)
->setPermissions($permissions);
// Call the API and handle any network failures.
try {
/** @var TestIamPermissionsResponse $response */
$response = $secureSourceManagerClient->testIamPermissions($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';
$permissionsElement = '[PERMISSIONS]';
test_iam_permissions_sample($resource, $permissionsElement);
}
getLocation
Gets information about a location.
The async variant is SecureSourceManagerClient::getLocationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\GetLocationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\Location\Location |
use Google\ApiCore\ApiException;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function get_location_sample(): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = new GetLocationRequest();
// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $secureSourceManagerClient->getLocation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
listLocations
Lists information about the supported locations for this service.
The async variant is SecureSourceManagerClient::listLocationsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\ListLocationsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\SecureSourceManager\V1\Client\SecureSourceManagerClient;
/**
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function list_locations_sample(): void
{
// Create a client.
$secureSourceManagerClient = new SecureSourceManagerClient();
// Prepare the request message.
$request = new ListLocationsRequest();
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $secureSourceManagerClient->listLocations($request);
/** @var Location $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
batchCreatePullRequestCommentsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\BatchCreatePullRequestCommentsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
closeIssueAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CloseIssueRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
closePullRequestAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ClosePullRequestRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createBranchRuleAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreateBranchRuleRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createHookAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreateHookRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createInstanceAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreateInstanceRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createIssueAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreateIssueRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createIssueCommentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreateIssueCommentRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createPullRequestAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreatePullRequestRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createPullRequestCommentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreatePullRequestCommentRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
createRepositoryAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\CreateRepositoryRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteBranchRuleAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeleteBranchRuleRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteHookAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeleteHookRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteInstanceAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeleteInstanceRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteIssueAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeleteIssueRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteIssueCommentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeleteIssueCommentRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deletePullRequestCommentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeletePullRequestCommentRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
deleteRepositoryAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\DeleteRepositoryRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
fetchBlobAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\FetchBlobRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\SecureSourceManager\V1\FetchBlobResponse> |
fetchTreeAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\FetchTreeRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
getBranchRuleAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetBranchRuleRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\SecureSourceManager\V1\BranchRule> |
getHookAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetHookRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\SecureSourceManager\V1\Hook> |
getIamPolicyRepoAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\GetIamPolicyRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Iam\V1\Policy> |
getInstanceAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetInstanceRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\SecureSourceManager\V1\Instance> |
getIssueAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetIssueRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\SecureSourceManager\V1\Issue> |
getIssueCommentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetIssueCommentRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\SecureSourceManager\V1\IssueComment> |
getPullRequestAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetPullRequestRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\SecureSourceManager\V1\PullRequest> |
getPullRequestCommentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetPullRequestCommentRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\SecureSourceManager\V1\PullRequestComment> |
getRepositoryAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\GetRepositoryRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\SecureSourceManager\V1\Repository> |
listBranchRulesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListBranchRulesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listHooksAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListHooksRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listInstancesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListInstancesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listIssueCommentsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListIssueCommentsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listIssuesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListIssuesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listPullRequestCommentsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListPullRequestCommentsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listPullRequestFileDiffsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListPullRequestFileDiffsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listPullRequestsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListPullRequestsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
listRepositoriesAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ListRepositoriesRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
mergePullRequestAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\MergePullRequestRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
openIssueAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\OpenIssueRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
openPullRequestAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\OpenPullRequestRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
resolvePullRequestCommentsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\ResolvePullRequestCommentsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
setIamPolicyRepoAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\SetIamPolicyRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Iam\V1\Policy> |
testIamPermissionsRepoAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\TestIamPermissionsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Iam\V1\TestIamPermissionsResponse> |
unresolvePullRequestCommentsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UnresolvePullRequestCommentsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateBranchRuleAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdateBranchRuleRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateHookAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdateHookRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateIssueAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdateIssueRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateIssueCommentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdateIssueCommentRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updatePullRequestAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdatePullRequestRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updatePullRequestCommentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdatePullRequestCommentRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
updateRepositoryAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\SecureSourceManager\V1\UpdateRepositoryRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\OperationResponse> |
getIamPolicyAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\GetIamPolicyRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Iam\V1\Policy> |
setIamPolicyAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\SetIamPolicyRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Iam\V1\Policy> |
testIamPermissionsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Iam\V1\TestIamPermissionsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Iam\V1\TestIamPermissionsResponse> |
getLocationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\GetLocationRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\Cloud\Location\Location> |
listLocationsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Location\ListLocationsRequest
|
optionalArgs |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface<Google\ApiCore\PagedListResponse> |
getOperationsClient
Return an OperationsClient object with the same endpoint as $this.
Returns | |
---|---|
Type | Description |
Google\LongRunning\Client\OperationsClient |
resumeOperation
Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.
Parameters | |
---|---|
Name | Description |
operationName |
string
The name of the long running operation |
methodName |
string
The name of the method used to start the operation |
Returns | |
---|---|
Type | Description |
Google\ApiCore\OperationResponse |
static::branchRuleName
Formats a string containing the fully-qualified path to represent a branch_rule resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
repository |
string
|
branchRule |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted branch_rule resource. |
static::caPoolName
Formats a string containing the fully-qualified path to represent a ca_pool resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
caPool |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted ca_pool resource. |
static::cryptoKeyName
Formats a string containing the fully-qualified path to represent a crypto_key resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
keyRing |
string
|
cryptoKey |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted crypto_key resource. |
static::hookName
Formats a string containing the fully-qualified path to represent a hook resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
repository |
string
|
hook |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted hook resource. |
static::instanceName
Formats a string containing the fully-qualified path to represent a instance resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
instance |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted instance resource. |
static::issueName
Formats a string containing the fully-qualified path to represent a issue resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
repository |
string
|
issue |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted issue resource. |
static::issueCommentName
Formats a string containing the fully-qualified path to represent a issue_comment resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
repository |
string
|
issue |
string
|
comment |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted issue_comment resource. |
static::locationName
Formats a string containing the fully-qualified path to represent a location resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted location resource. |
static::pullRequestName
Formats a string containing the fully-qualified path to represent a pull_request resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
repository |
string
|
pullRequest |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted pull_request resource. |
static::pullRequestCommentName
Formats a string containing the fully-qualified path to represent a pull_request_comment resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
repository |
string
|
pullRequest |
string
|
comment |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted pull_request_comment resource. |
static::repositoryName
Formats a string containing the fully-qualified path to represent a repository resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
repository |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted repository resource. |
static::serviceAttachmentName
Formats a string containing the fully-qualified path to represent a service_attachment resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
region |
string
|
serviceAttachment |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted service_attachment resource. |
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- branchRule: projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}
- caPool: projects/{project}/locations/{location}/caPools/{ca_pool}
- cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}
- hook: projects/{project}/locations/{location}/repositories/{repository}/hooks/{hook}
- instance: projects/{project}/locations/{location}/instances/{instance}
- issue: projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}
- issueComment: projects/{project}/locations/{location}/repositories/{repository}/issues/{issue}/issueComments/{comment}
- location: projects/{project}/locations/{location}
- pullRequest: projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}
- pullRequestComment: projects/{project}/locations/{location}/repositories/{repository}/pullRequests/{pull_request}/pullRequestComments/{comment}
- repository: projects/{project}/locations/{location}/repositories/{repository}
- serviceAttachment: projects/{project}/regions/{region}/serviceAttachments/{service_attachment}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
Parameters | |
---|---|
Name | Description |
formattedName |
string
The formatted name string |
template |
?string
Optional name of template to match |
Returns | |
---|---|
Type | Description |
array |
An associative array from name component IDs to component values. |