Class: Google::Apis::AccesscontextmanagerV1::AccessPolicy

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/accesscontextmanager_v1/classes.rb,
lib/google/apis/accesscontextmanager_v1/representations.rb,
lib/google/apis/accesscontextmanager_v1/representations.rb

Overview

AccessPolicy is a container for AccessLevels (which define the necessary attributes to use Google Cloud services) and ServicePerimeters (which define regions of services able to freely pass data within a perimeter). An access policy is globally visible within an organization, and the restrictions it specifies apply to all projects within an organization.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ AccessPolicy

Returns a new instance of AccessPolicy.



136
137
138
# File 'lib/google/apis/accesscontextmanager_v1/classes.rb', line 136

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#etagString

Output only. An opaque identifier for the current version of the AccessPolicy . This will always be a strongly validated etag, meaning that two Access Policies will be identical if and only if their etags are identical. Clients should not expect this to be in any specific format. Corresponds to the JSON property etag

Returns:

  • (String)


103
104
105
# File 'lib/google/apis/accesscontextmanager_v1/classes.rb', line 103

def etag
  @etag
end

#nameString

Output only. Identifier. Resource name of the AccessPolicy. Format: accessPolicies/access_policy` Corresponds to the JSON propertyname`

Returns:

  • (String)


109
110
111
# File 'lib/google/apis/accesscontextmanager_v1/classes.rb', line 109

def name
  @name
end

#parentString

Required. The parent of this AccessPolicy in the Cloud Resource Hierarchy. Currently immutable once created. Format: organizations/organization_id` Corresponds to the JSON propertyparent`

Returns:

  • (String)


115
116
117
# File 'lib/google/apis/accesscontextmanager_v1/classes.rb', line 115

def parent
  @parent
end

#scopesArray<String>

The scopes of the AccessPolicy. Scopes define which resources a policy can restrict and where its resources can be referenced. For example, policy A with scopes=["folders/123"] has the following behavior: - ServicePerimeter can only restrict projects within folders/123. - ServicePerimeter within policy A can only reference access levels defined within policy A. - Only one policy can include a given scope; thus, attempting to create a second policy which includes folders/123 will result in an error. If no scopes are provided, then any resource within the organization can be restricted. Scopes cannot be modified after a policy is created. Policies can only have a single scope. Format: list of folders/folder_numberor `projects/`project_number Corresponds to the JSON property scopes

Returns:

  • (Array<String>)


129
130
131
# File 'lib/google/apis/accesscontextmanager_v1/classes.rb', line 129

def scopes
  @scopes
end

#titleString

Required. Human readable title. Does not affect behavior. Corresponds to the JSON property title

Returns:

  • (String)


134
135
136
# File 'lib/google/apis/accesscontextmanager_v1/classes.rb', line 134

def title
  @title
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



141
142
143
144
145
146
147
# File 'lib/google/apis/accesscontextmanager_v1/classes.rb', line 141

def update!(**args)
  @etag = args[:etag] if args.key?(:etag)
  @name = args[:name] if args.key?(:name)
  @parent = args[:parent] if args.key?(:parent)
  @scopes = args[:scopes] if args.key?(:scopes)
  @title = args[:title] if args.key?(:title)
end