Class: Google::Apis::CloudassetV1::GoogleCloudAssetV1CustomConstraint

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

Overview

The definition of a custom constraint.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudAssetV1CustomConstraint

Returns a new instance of GoogleCloudAssetV1CustomConstraint.



1843
1844
1845
# File 'lib/google/apis/cloudasset_v1/classes.rb', line 1843

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

Instance Attribute Details

#action_typeString

Allow or deny type. Corresponds to the JSON property actionType

Returns:

  • (String)


1805
1806
1807
# File 'lib/google/apis/cloudasset_v1/classes.rb', line 1805

def action_type
  @action_type
end

#conditionString

Organization Policy condition/expression. For example: resource.instanceName. matches("[production|test]_.*_(\d)+")' or, resource.management.auto_upgrade = = true Corresponds to the JSON property condition

Returns:

  • (String)


1812
1813
1814
# File 'lib/google/apis/cloudasset_v1/classes.rb', line 1812

def condition
  @condition
end

#descriptionString

Detailed information about this custom policy constraint. Corresponds to the JSON property description

Returns:

  • (String)


1817
1818
1819
# File 'lib/google/apis/cloudasset_v1/classes.rb', line 1817

def description
  @description
end

#display_nameString

One line display name for the UI. Corresponds to the JSON property displayName

Returns:

  • (String)


1822
1823
1824
# File 'lib/google/apis/cloudasset_v1/classes.rb', line 1822

def display_name
  @display_name
end

#method_typesArray<String>

All the operations being applied for this constraint. Corresponds to the JSON property methodTypes

Returns:

  • (Array<String>)


1827
1828
1829
# File 'lib/google/apis/cloudasset_v1/classes.rb', line 1827

def method_types
  @method_types
end

#nameString

Name of the constraint. This is unique within the organization. Format of the name should be * organizations/organization_id/customConstraints/ custom_constraint_id`Example : "organizations/123/customConstraints/custom. createOnlyE2TypeVms" Corresponds to the JSON propertyname`

Returns:

  • (String)


1835
1836
1837
# File 'lib/google/apis/cloudasset_v1/classes.rb', line 1835

def name
  @name
end

#resource_typesArray<String>

The Resource Instance type on which this policy applies to. Format will be of the form : "/" Example: * compute.googleapis.com/Instance. Corresponds to the JSON property resourceTypes

Returns:

  • (Array<String>)


1841
1842
1843
# File 'lib/google/apis/cloudasset_v1/classes.rb', line 1841

def resource_types
  @resource_types
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1848
1849
1850
1851
1852
1853
1854
1855
1856
# File 'lib/google/apis/cloudasset_v1/classes.rb', line 1848

def update!(**args)
  @action_type = args[:action_type] if args.key?(:action_type)
  @condition = args[:condition] if args.key?(:condition)
  @description = args[:description] if args.key?(:description)
  @display_name = args[:display_name] if args.key?(:display_name)
  @method_types = args[:method_types] if args.key?(:method_types)
  @name = args[:name] if args.key?(:name)
  @resource_types = args[:resource_types] if args.key?(:resource_types)
end