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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion src/CloudIdentity.php
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,21 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
'policies',
[
'methods' => [
'get' => [
'create' => [
'path' => 'v1/policies',
'httpMethod' => 'POST',
'parameters' => [],
],'delete' => [
'path' => 'v1/{+name}',
'httpMethod' => 'DELETE',
'parameters' => [
'name' => [
'location' => 'path',
'type' => 'string',
'required' => true,
],
],
],'get' => [
'path' => 'v1/{+name}',
'httpMethod' => 'GET',
'parameters' => [
Expand All @@ -1087,6 +1101,16 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
'type' => 'string',
],
],
],'patch' => [
'path' => 'v1/{+name}',
'httpMethod' => 'PATCH',
'parameters' => [
'name' => [
'location' => 'path',
'type' => 'string',
'required' => true,
],
],
],
]
]
Expand Down
47 changes: 47 additions & 0 deletions src/CloudIdentity/Resource/Policies.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
namespace Google\Service\CloudIdentity\Resource;

use Google\Service\CloudIdentity\ListPoliciesResponse;
use Google\Service\CloudIdentity\Operation;
use Google\Service\CloudIdentity\Policy;

/**
Expand All @@ -30,6 +31,35 @@
*/
class Policies extends \Google\Service\Resource
{
/**
* Create a policy. (policies.create)
*
* @param Policy $postBody
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function create(Policy $postBody, $optParams = [])
{
$params = ['postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('create', [$params], Operation::class);
}
/**
* Delete a policy. (policies.delete)
*
* @param string $name Required. The name of the policy to delete. Format:
* `policies/{policy}`.
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function delete($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], Operation::class);
}
/**
* Get a policy. (policies.get)
*
Expand Down Expand Up @@ -81,6 +111,23 @@ public function listPolicies($optParams = [])
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListPoliciesResponse::class);
}
/**
* Update a policy. (policies.patch)
*
* @param string $name Output only. Identifier. The [resource
* name](https://cloud.google.com/apis/design/resource_names) of the Policy.
* Format: policies/{policy}.
* @param Policy $postBody
* @param array $optParams Optional parameters.
* @return Operation
* @throws \Google\Service\Exception
*/
public function patch($name, Policy $postBody, $optParams = [])
{
$params = ['name' => $name, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('patch', [$params], Operation::class);
}
}

// Adding a class alias for backwards compatibility with the previous class name.
Expand Down
Loading