Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddda-MAGIC-MODULE-orgpolicy-Projects__policy - Resource Implementation #552

Closed
Closed
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
1,553 changes: 1,553 additions & 0 deletions build/inspec/test/integration/build/gcp-mm.tf

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
939 changes: 939 additions & 0 deletions build/inspec/test/integration/configuration/mm-attributes.yml

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions docs/resources/google_orgpolicy_project_policies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: About the google_orgpolicy_project_policies resource
platform: gcp
---

## Syntax
A `google_orgpolicy_project_policies` is used to test a Google ProjectPolicy resource

## Examples
```
describe google_orgpolicy_project_policies(parent: ' value_parent') do
it { should exist }
end
```

## Properties
Properties that can be accessed from the `google_orgpolicy_project_policies` resource:

See [google_orgpolicy_project_policy.md](google_orgpolicy_project_policy.md) for more detailed information
* `dry_run_specs`: an array of `google_orgpolicy_project_policy` dry_run_spec
* `specs`: an array of `google_orgpolicy_project_policy` spec
* `names`: an array of `google_orgpolicy_project_policy` name
* `alternates`: an array of `google_orgpolicy_project_policy` alternate

## Filter Criteria
This resource supports all of the above properties as filter criteria, which can be used
with `where` as a block or a method.

## GCP Permissions

Ensure the [None](https://console.cloud.google.com/apis/library/orgpolicy.googleapis.com/) is enabled for the current project.
136 changes: 136 additions & 0 deletions docs/resources/google_orgpolicy_project_policy.md

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions libraries/google/orgpolicy/property/projectpolicy_alternate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/orgpolicy/property/projectpolicy_alternate_spec'
require 'google/orgpolicy/property/projectpolicy_alternate_spec_rules'
module GoogleInSpec
module Orgpolicy
module Property
class ProjectPolicyAlternate
attr_reader :launch

attr_reader :spec

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@launch = args['launch']
@spec = GoogleInSpec::Orgpolicy::Property::ProjectPolicyAlternateSpec.new(args['spec'], to_s)
end

def to_s
"#{@parent_identifier} ProjectPolicyAlternate"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/orgpolicy/property/projectpolicy_alternate_spec_rules'
module GoogleInSpec
module Orgpolicy
module Property
class ProjectPolicyAlternateSpec
attr_reader :update_time

attr_reader :rules

attr_reader :etag

attr_reader :reset

attr_reader :inherit_from_parent

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@update_time = args['updateTime']
@rules = GoogleInSpec::Orgpolicy::Property::ProjectPolicyAlternateSpecRulesArray.parse(args['rules'], to_s)
@etag = args['etag']
@reset = args['reset']
@inherit_from_parent = args['inheritFromParent']
end

def to_s
"#{@parent_identifier} ProjectPolicyAlternateSpec"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/orgpolicy/property/projectpolicy_alternate_spec_rules_condition'
require 'google/orgpolicy/property/projectpolicy_alternate_spec_rules_values'
module GoogleInSpec
module Orgpolicy
module Property
class ProjectPolicyAlternateSpecRules
attr_reader :condition

attr_reader :deny_all

attr_reader :allow_all

attr_reader :enforce

attr_reader :values

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@condition = GoogleInSpec::Orgpolicy::Property::ProjectPolicyAlternateSpecRulesCondition.new(args['condition'], to_s)
@deny_all = args['denyAll']
@allow_all = args['allowAll']
@enforce = args['enforce']
@values = GoogleInSpec::Orgpolicy::Property::ProjectPolicyAlternateSpecRulesValues.new(args['values'], to_s)
end

def to_s
"#{@parent_identifier} ProjectPolicyAlternateSpecRules"
end
end

class ProjectPolicyAlternateSpecRulesArray
def self.parse(value, parent_identifier)
return if value.nil?
return ProjectPolicyAlternateSpecRules.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| ProjectPolicyAlternateSpecRules.new(v, parent_identifier) }
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Orgpolicy
module Property
class ProjectPolicyAlternateSpecRulesCondition
attr_reader :title

attr_reader :location

attr_reader :expression

attr_reader :description

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@title = args['title']
@location = args['location']
@expression = args['expression']
@description = args['description']
end

def to_s
"#{@parent_identifier} ProjectPolicyAlternateSpecRulesCondition"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Orgpolicy
module Property
class ProjectPolicyAlternateSpecRulesValues
attr_reader :denied_values

attr_reader :allowed_values

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@denied_values = args['deniedValues']
@allowed_values = args['allowedValues']
end

def to_s
"#{@parent_identifier} ProjectPolicyAlternateSpecRulesValues"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/orgpolicy/property/projectpolicy_dry_run_spec_rules'
module GoogleInSpec
module Orgpolicy
module Property
class ProjectPolicyDryRunSpec
attr_reader :update_time

attr_reader :rules

attr_reader :etag

attr_reader :reset

attr_reader :inherit_from_parent

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@update_time = args['updateTime']
@rules = GoogleInSpec::Orgpolicy::Property::ProjectPolicyDryRunSpecRulesArray.parse(args['rules'], to_s)
@etag = args['etag']
@reset = args['reset']
@inherit_from_parent = args['inheritFromParent']
end

def to_s
"#{@parent_identifier} ProjectPolicyDryRunSpec"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in README.md and
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/orgpolicy/property/projectpolicy_dry_run_spec_rules_condition'
require 'google/orgpolicy/property/projectpolicy_dry_run_spec_rules_values'
module GoogleInSpec
module Orgpolicy
module Property
class ProjectPolicyDryRunSpecRules
attr_reader :condition

attr_reader :deny_all

attr_reader :allow_all

attr_reader :enforce

attr_reader :values

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@condition = GoogleInSpec::Orgpolicy::Property::ProjectPolicyDryRunSpecRulesCondition.new(args['condition'], to_s)
@deny_all = args['denyAll']
@allow_all = args['allowAll']
@enforce = args['enforce']
@values = GoogleInSpec::Orgpolicy::Property::ProjectPolicyDryRunSpecRulesValues.new(args['values'], to_s)
end

def to_s
"#{@parent_identifier} ProjectPolicyDryRunSpecRules"
end
end

class ProjectPolicyDryRunSpecRulesArray
def self.parse(value, parent_identifier)
return if value.nil?
return ProjectPolicyDryRunSpecRules.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| ProjectPolicyDryRunSpecRules.new(v, parent_identifier) }
end
end
end
end
end
Loading