Show / Hide Table of Contents

Class PoliciesResource

The "policies" collection of methods.

Inheritance
object
PoliciesResource
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.Iam.v2
Assembly: Google.Apis.Iam.v2.dll
Syntax
public class PoliciesResource

Constructors

PoliciesResource(IClientService)

Constructs a new resource.

Declaration
public PoliciesResource(IClientService service)
Parameters
Type Name Description
IClientService service

Properties

Operations

Gets the Operations resource.

Declaration
public virtual PoliciesResource.OperationsResource Operations { get; }
Property Value
Type Description
PoliciesResource.OperationsResource

Methods

CreatePolicy(GoogleIamV2Policy, string)

Creates a policy.

Declaration
public virtual PoliciesResource.CreatePolicyRequest CreatePolicy(GoogleIamV2Policy body, string parent)
Parameters
Type Name Description
GoogleIamV2Policy body

The body of the request.

string parent

Required. The resource that the policy is attached to, along with the kind of policy to create. Format: policies/{attachment_point}/denypolicies The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies. For organizations and folders, use the numeric ID in the full resource name. For projects, you can use the alphanumeric or the numeric ID.

Returns
Type Description
PoliciesResource.CreatePolicyRequest

Delete(string)

Deletes a policy. This action is permanent.

Declaration
public virtual PoliciesResource.DeleteRequest Delete(string name)
Parameters
Type Name Description
string name

Required. The resource name of the policy to delete. Format: policies/{attachment_point}/denypolicies/{policy_id} Use the URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy. For organizations and folders, use the numeric ID in the full resource name. For projects, you can use the alphanumeric or the numeric ID.

Returns
Type Description
PoliciesResource.DeleteRequest

Get(string)

Gets a policy.

Declaration
public virtual PoliciesResource.GetRequest Get(string name)
Parameters
Type Name Description
string name

Required. The resource name of the policy to retrieve. Format: policies/{attachment_point}/denypolicies/{policy_id} Use the URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy. For organizations and folders, use the numeric ID in the full resource name. For projects, you can use the alphanumeric or the numeric ID.

Returns
Type Description
PoliciesResource.GetRequest

ListPolicies(string)

Retrieves the policies of the specified kind that are attached to a resource. The response lists only policy metadata. In particular, policy rules are omitted.

Declaration
public virtual PoliciesResource.ListPoliciesRequest ListPolicies(string parent)
Parameters
Type Name Description
string parent

Required. The resource that the policy is attached to, along with the kind of policy to list. Format: policies/{attachment_point}/denypolicies The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies. For organizations and folders, use the numeric ID in the full resource name. For projects, you can use the alphanumeric or the numeric ID.

Returns
Type Description
PoliciesResource.ListPoliciesRequest

Update(GoogleIamV2Policy, string)

Updates the specified policy. You can update only the rules and the display name for the policy. To update a policy, you should use a read-modify-write loop: 1. Use GetPolicy to read the current version of the policy. 2. Modify the policy as needed. 3. Use UpdatePolicy to write the updated policy. This pattern helps prevent conflicts between concurrent updates.

Declaration
public virtual PoliciesResource.UpdateRequest Update(GoogleIamV2Policy body, string name)
Parameters
Type Name Description
GoogleIamV2Policy body

The body of the request.

string name

Immutable. The resource name of the Policy, which must be unique. Format: policies/{attachment_point}/denypolicies/{policy_id} The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, /, must be written as %2F. For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy. For organizations and folders, use the numeric ID in the full resource name. For projects, requests can use the alphanumeric or the numeric ID. Responses always contain the numeric ID.

Returns
Type Description
PoliciesResource.UpdateRequest
In this article
Back to top Generated by DocFX