Skip to content

Commit

Permalink
Inspec nested refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
slevenick authored and Stuart Paterson committed Feb 19, 2019
1 parent bbce817 commit f698037
Show file tree
Hide file tree
Showing 76 changed files with 964 additions and 150 deletions.
9 changes: 0 additions & 9 deletions docs/resources/google_bigquery_dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ describe google_bigquery_dataset(project: 'chef-gcp-inspec', name: 'inspec_gcp_d
its('default_table_expiration_ms') { should cmp '3600000' }
end
describe.one do
google_bigquery_dataset(project: 'chef-gcp-inspec', name: 'inspec_gcp_dataset').access.each do |dataset_access|
describe dataset_access do
its('role') { should eq 'READER' }
its('domain') { should eq 'example.com' }
end
end
end
describe.one do
google_bigquery_dataset(project: 'chef-gcp-inspec', name: 'inspec_gcp_dataset').access.each do |dataset_access|
describe dataset_access do
Expand Down
4 changes: 2 additions & 2 deletions libraries/google/bigquery/property/dataset_access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/bigquery/property/dataset_view'
require 'google/bigquery/property/dataset_access_view'
module GoogleInSpec
module BigQuery
module Property
Expand All @@ -37,7 +37,7 @@ def initialize(args = nil)
@role = args['role']
@special_group = args['specialGroup']
@user_by_email = args['userByEmail']
@view = GoogleInSpec::BigQuery::Property::DatasetView.new(args['view'])
@view = GoogleInSpec::BigQuery::Property::DatasetAccessView.new(args['view'])
end
end

Expand Down
35 changes: 35 additions & 0 deletions libraries/google/bigquery/property/dataset_access_view.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# 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 BigQuery
module Property
class DatasetAccessView
attr_reader :dataset_id

attr_reader :project_id

attr_reader :table_id

def initialize(args = nil)
return if args.nil?
@dataset_id = args['datasetId']
@project_id = args['projectId']
@table_id = args['tableId']
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
module GoogleInSpec
module BigQuery
module Property
class DatasetDatasetreference
class DatasetDatasetReference
attr_reader :dataset_id

attr_reader :project_id
Expand Down
4 changes: 2 additions & 2 deletions libraries/google/cloudbuild/property/trigger_build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/cloudbuild/property/trigger_steps'
require 'google/cloudbuild/property/trigger_build_steps'
module GoogleInSpec
module CloudBuild
module Property
Expand All @@ -28,7 +28,7 @@ def initialize(args = nil)
return if args.nil?
@tags = args['tags']
@images = args['images']
@steps = GoogleInSpec::CloudBuild::Property::TriggerStepsArray.parse(args['steps'])
@steps = GoogleInSpec::CloudBuild::Property::TriggerBuildStepsArray.parse(args['steps'])
end
end
end
Expand Down
40 changes: 40 additions & 0 deletions libraries/google/cloudbuild/property/trigger_build_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# 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 CloudBuild
module Property
class TriggerBuildSteps
attr_reader :name

attr_reader :args

def initialize(args = nil)
return if args.nil?
@name = args['name']
@args = args['args']
end
end

class TriggerBuildStepsArray
def self.parse(value)
return if value.nil?
return TriggerBuildSteps.new(value) unless value.is_a?(::Array)
value.map { |v| TriggerBuildSteps.new(v) }
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
module GoogleInSpec
module CloudBuild
module Property
class TriggerTriggertemplate
class TriggerTriggerTemplate
attr_reader :project_id

attr_reader :repo_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/compute/property/autoscaler_cpu_utilization'
require 'google/compute/property/autoscaler_custom_metric_utilizations'
require 'google/compute/property/autoscaler_load_balancing_utilization'
require 'google/compute/property/autoscaler_autoscaling_policy_cpu_utilization'
require 'google/compute/property/autoscaler_autoscaling_policy_custom_metric_utilizations'
require 'google/compute/property/autoscaler_autoscaling_policy_load_balancing_utilization'
module GoogleInSpec
module Compute
module Property
class AutoscalerAutoscalingpolicy
class AutoscalerAutoscalingPolicy
attr_reader :min_num_replicas

attr_reader :max_num_replicas
Expand All @@ -37,9 +37,9 @@ def initialize(args = nil)
@min_num_replicas = args['minNumReplicas']
@max_num_replicas = args['maxNumReplicas']
@cool_down_period_sec = args['coolDownPeriodSec']
@cpu_utilization = GoogleInSpec::Compute::Property::AutoscalerCpuutilization.new(args['cpuUtilization'])
@custom_metric_utilizations = GoogleInSpec::Compute::Property::AutoscalerCustommetricutilizationsArray.parse(args['customMetricUtilizations'])
@load_balancing_utilization = GoogleInSpec::Compute::Property::AutoscalerLoadbalancingutilization.new(args['loadBalancingUtilization'])
@cpu_utilization = GoogleInSpec::Compute::Property::AutoscalerAutoscalingPolicyCpuUtilization.new(args['cpuUtilization'])
@custom_metric_utilizations = GoogleInSpec::Compute::Property::AutoscalerAutoscalingPolicyCustomMetricUtilizationsArray.parse(args['customMetricUtilizations'])
@load_balancing_utilization = GoogleInSpec::Compute::Property::AutoscalerAutoscalingPolicyLoadBalancingUtilization.new(args['loadBalancingUtilization'])
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# 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 Compute
module Property
class AutoscalerAutoscalingPolicyCpuUtilization
attr_reader :utilization_target

def initialize(args = nil)
return if args.nil?
@utilization_target = args['utilizationTarget']
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 *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# 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 Compute
module Property
class AutoscalerAutoscalingPolicyCustomMetricUtilizations
attr_reader :metric

attr_reader :utilization_target

attr_reader :utilization_target_type

def initialize(args = nil)
return if args.nil?
@metric = args['metric']
@utilization_target = args['utilizationTarget']
@utilization_target_type = args['utilizationTargetType']
end
end

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

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# 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 Compute
module Property
class AutoscalerAutoscalingPolicyLoadBalancingUtilization
attr_reader :utilization_target

def initialize(args = nil)
return if args.nil?
@utilization_target = args['utilizationTarget']
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
# CONTRIBUTING.md located at the root of this package.
#
# ----------------------------------------------------------------------------
require 'google/compute/property/backendservice_cache_key_policy'
require 'google/compute/property/backendservice_cdn_policy_cache_key_policy'
module GoogleInSpec
module Compute
module Property
class BackendServiceCdnpolicy
class BackendServiceCdnPolicy
attr_reader :cache_key_policy

def initialize(args = nil)
return if args.nil?
@cache_key_policy = GoogleInSpec::Compute::Property::BackendServiceCachekeypolicy.new(args['cacheKeyPolicy'])
@cache_key_policy = GoogleInSpec::Compute::Property::BackendServiceCdnPolicyCacheKeyPolicy.new(args['cacheKeyPolicy'])
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# 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 Compute
module Property
class BackendServiceCdnPolicyCacheKeyPolicy
attr_reader :include_host

attr_reader :include_protocol

attr_reader :include_query_string

attr_reader :query_string_blacklist

attr_reader :query_string_whitelist

def initialize(args = nil)
return if args.nil?
@include_host = args['includeHost']
@include_protocol = args['includeProtocol']
@include_query_string = args['includeQueryString']
@query_string_blacklist = args['queryStringBlacklist']
@query_string_whitelist = args['queryStringWhitelist']
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
module GoogleInSpec
module Compute
module Property
class BackendServiceConnectiondraining
class BackendServiceConnectionDraining
attr_reader :draining_timeout_sec

def initialize(args = nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
module GoogleInSpec
module Compute
module Property
class DiskDiskencryptionkey
class DiskDiskEncryptionKey
attr_reader :raw_key

attr_reader :sha256
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
module GoogleInSpec
module Compute
module Property
class DiskSourceimageencryptionkey
class DiskSourceImageEncryptionKey
attr_reader :raw_key

attr_reader :sha256
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
module GoogleInSpec
module Compute
module Property
class DiskSourcesnapshotencryptionkey
class DiskSourceSnapshotEncryptionKey
attr_reader :raw_key

attr_reader :kms_key_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
module GoogleInSpec
module Compute
module Property
class HealthCheckHttphealthcheck
class HealthCheckHttpHealthCheck
attr_reader :host

attr_reader :request_path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
module GoogleInSpec
module Compute
module Property
class HealthCheckHttpshealthcheck
class HealthCheckHttpsHealthCheck
attr_reader :host

attr_reader :request_path
Expand Down
Loading

0 comments on commit f698037

Please sign in to comment.