From 2888f5a3caf037f2ac9b3b0d08da61ac572a7c55 Mon Sep 17 00:00:00 2001 From: Samir Anand Date: Thu, 30 Nov 2023 00:30:07 +0530 Subject: [PATCH 01/13] Automatically generated by magic modules for service: apigee and resource: Organizations__envgroups__attachment. This commit includes the following changes: - Singular Resource - Plural Resource - Documentation updates - Terraform configuration - Integration tests Signed-off-by: Samir Anand --- .../configuration/mm-attributes.yml | 22 ++++- ...apigee_organization_envgroup_attachment.md | 40 +++++++++ ...pigee_organization_envgroup_attachments.md | 31 +++++++ ...apigee_organization_envgroup_attachment.rb | 61 +++++++++++++ ...pigee_organization_envgroup_attachments.rb | 85 +++++++++++++++++++ ...apigee_organization_envgroup_attachment.rb | 42 +++++++++ ...pigee_organization_envgroup_attachments.rb | 33 +++++++ 7 files changed, 313 insertions(+), 1 deletion(-) create mode 100644 docs/resources/google_apigee_organization_envgroup_attachment.md create mode 100644 docs/resources/google_apigee_organization_envgroup_attachments.md create mode 100644 libraries/google_apigee_organization_envgroup_attachment.rb create mode 100644 libraries/google_apigee_organization_envgroup_attachments.rb create mode 100644 test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb create mode 100644 test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb diff --git a/build/inspec/test/integration/configuration/mm-attributes.yml b/build/inspec/test/integration/configuration/mm-attributes.yml index 69212b639..8f92b70e6 100644 --- a/build/inspec/test/integration/configuration/mm-attributes.yml +++ b/build/inspec/test/integration/configuration/mm-attributes.yml @@ -893,4 +893,24 @@ organization: subscription_type : "PAID" created_at : ""1698225643253" state : "ACTIVE" - analytics_region : "us-west1" \ No newline at end of file + analytics_region : "us-west1" + +vpn_gateway: + project : "value_project" + region : "value_region" + vpn_gateway : "value_vpngateway" + kind : "value_kind" + id : "value_id" + creation_timestamp : "value_creationtimestamp" + name : "value_name" + description : "value_description" + network : "value_network" + self_link : "value_selflink" + label_fingerprint : "value_labelfingerprint" + stack_type : "value_stacktype" +organization_envgroup_attachment: + name : "value_name" + parent : "value_parent" + created_at : "value_createdat" + environment : "value_environment" + environment_group_id : "value_environmentgroupid" diff --git a/docs/resources/google_apigee_organization_envgroup_attachment.md b/docs/resources/google_apigee_organization_envgroup_attachment.md new file mode 100644 index 000000000..4fc3b56da --- /dev/null +++ b/docs/resources/google_apigee_organization_envgroup_attachment.md @@ -0,0 +1,40 @@ +--- +title: About the google_apigee_organization_envgroup_attachment resource +platform: gcp +--- + +## Syntax +A `google_apigee_organization_envgroup_attachment` is used to test a Google OrganizationEnvgroupAttachment resource + +## Examples +``` +describe google_apigee_organization_envgroup_attachment(name: ' value_name') do + it { should exist } + its('created_at') { should cmp 'value_createdat' } + its('environment') { should cmp 'value_environment' } + its('environment_group_id') { should cmp 'value_environmentgroupid' } + its('name') { should cmp 'value_name' } + +end + +describe google_apigee_organization_envgroup_attachment(name: "does_not_exit") do + it { should_not exist } +end +``` + +## Properties +Properties that can be accessed from the `google_apigee_organization_envgroup_attachment` resource: + + + * `created_at`: Output only. The time at which the environment group attachment was created as milliseconds since epoch. + + * `environment`: Required. ID of the attached environment. + + * `environment_group_id`: Output only. ID of the environment group. + + * `name`: ID of the environment group attachment. + + +## GCP Permissions + +Ensure the [Apigee API](https://console.cloud.google.com/apis/library/apigee.googleapis.com/) is enabled for the current project. diff --git a/docs/resources/google_apigee_organization_envgroup_attachments.md b/docs/resources/google_apigee_organization_envgroup_attachments.md new file mode 100644 index 000000000..3b6d2ed02 --- /dev/null +++ b/docs/resources/google_apigee_organization_envgroup_attachments.md @@ -0,0 +1,31 @@ +--- +title: About the google_apigee_organization_envgroup_attachments resource +platform: gcp +--- + +## Syntax +A `google_apigee_organization_envgroup_attachments` is used to test a Google OrganizationEnvgroupAttachment resource + +## Examples +``` + describe google_apigee_organization_envgroup_attachments(parent: ' value_parent') do + it { should exist } + end +``` + +## Properties +Properties that can be accessed from the `google_apigee_organization_envgroup_attachments` resource: + +See [google_apigee_organization_envgroup_attachment.md](google_apigee_organization_envgroup_attachment.md) for more detailed information + * `created_ats`: an array of `google_apigee_organization_envgroup_attachment` created_at + * `environments`: an array of `google_apigee_organization_envgroup_attachment` environment + * `environment_group_ids`: an array of `google_apigee_organization_envgroup_attachment` environment_group_id + * `names`: an array of `google_apigee_organization_envgroup_attachment` name + +## 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 [Apigee API](https://console.cloud.google.com/apis/library/apigee.googleapis.com/) is enabled for the current project. diff --git a/libraries/google_apigee_organization_envgroup_attachment.rb b/libraries/google_apigee_organization_envgroup_attachment.rb new file mode 100644 index 000000000..705deb58f --- /dev/null +++ b/libraries/google_apigee_organization_envgroup_attachment.rb @@ -0,0 +1,61 @@ +# 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 'gcp_backend' + +# A provider to manage Apigee resources. +class ApigeeOrganizationEnvgroupAttachment < GcpResourceBase + name 'google_apigee_organization_envgroup_attachment' + desc 'OrganizationEnvgroupAttachment' + supports platform: 'gcp' + + attr_reader :params + attr_reader :created_at + attr_reader :environment + attr_reader :environment_group_id + attr_reader :name + + def initialize(params) + super(params.merge({ use_http_transport: true })) + @params = params + @fetched = @connection.fetch(product_url(params[:beta]), resource_base_url, params, 'Get') + parse unless @fetched.nil? + end + + def parse + @created_at = @fetched['createdAt'] + @environment = @fetched['environment'] + @environment_group_id = @fetched['environmentGroupId'] + @name = @fetched['name'] + end + + def exists? + !@fetched.nil? + end + + def to_s + "OrganizationEnvgroupAttachment #{@params[:name]}" + end + + private + + def product_url(_ = nil) + 'https://apigee.googleapis.com/v1/' + end + + def resource_base_url + '{{name}}' + end +end diff --git a/libraries/google_apigee_organization_envgroup_attachments.rb b/libraries/google_apigee_organization_envgroup_attachments.rb new file mode 100644 index 000000000..c8c5c3b41 --- /dev/null +++ b/libraries/google_apigee_organization_envgroup_attachments.rb @@ -0,0 +1,85 @@ +# 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 'gcp_backend' +class ApigeeOrganizationEnvgroupAttachments < GcpResourceBase + name 'google_apigee_organization_envgroup_attachments' + desc 'OrganizationEnvgroupAttachment plural resource' + supports platform: 'gcp' + + attr_reader :table + + filter_table_config = FilterTable.create + + filter_table_config.add(:created_ats, field: :created_at) + filter_table_config.add(:environments, field: :environment) + filter_table_config.add(:environment_group_ids, field: :environment_group_id) + filter_table_config.add(:names, field: :name) + + filter_table_config.connect(self, :table) + + def initialize(params = {}) + super(params.merge({ use_http_transport: true })) + @params = params + @table = fetch_wrapped_resource('organizationEnvgroupAttachments') + end + + def fetch_wrapped_resource(wrap_path) + # fetch_resource returns an array of responses (to handle pagination) + result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get') + return if result.nil? + + # Conversion of string -> object hash to symbol -> object hash that InSpec needs + converted = [] + result.each do |response| + next if response.nil? || !response.key?(wrap_path) + response[wrap_path].each do |hash| + hash_with_symbols = {} + hash.each_key do |key| + name, value = transform(key, hash) + hash_with_symbols[name] = value + end + converted.push(hash_with_symbols) + end + end + + converted + end + + def transform(key, value) + return transformers[key].call(value) if transformers.key?(key) + + [key.to_sym, value] + end + + def transformers + { + 'createdAt' => ->(obj) { return :created_at, obj['createdAt'] }, + 'environment' => ->(obj) { return :environment, obj['environment'] }, + 'environmentGroupId' => ->(obj) { return :environment_group_id, obj['environmentGroupId'] }, + 'name' => ->(obj) { return :name, obj['name'] }, + } + end + + private + + def product_url(_ = nil) + 'https://apigee.googleapis.com/v1/' + end + + def resource_base_url + '{{parent}}/attachments' + end +end diff --git a/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb b/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb new file mode 100644 index 000000000..8ca838d60 --- /dev/null +++ b/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb @@ -0,0 +1,42 @@ +# ---------------------------------------------------------------------------- +# +# *** 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. +# +# ---------------------------------------------------------------------------- + +title 'Test GCP google_apigee_organization_envgroup_attachment resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') + + organization_envgroup_attachment = input('organization_envgroup_attachment', value: { + "name": "value_name", + "parent": "value_parent", + "created_at": "value_createdat", + "environment": "value_environment", + "environment_group_id": "value_environmentgroupid" +}, description: 'organization_envgroup_attachment description') +control 'google_apigee_organization_envgroup_attachment-1.0' do + impact 1.0 + title 'google_apigee_organization_envgroup_attachment resource test' + + describe google_apigee_organization_envgroup_attachment(name: organization_envgroup_attachment['name']) do + it { should exist } + its('created_at') { should cmp organization_envgroup_attachment['created_at'] } + its('environment') { should cmp organization_envgroup_attachment['environment'] } + its('environment_group_id') { should cmp organization_envgroup_attachment['environment_group_id'] } + its('name') { should cmp organization_envgroup_attachment['name'] } + + end + + describe google_apigee_organization_envgroup_attachment(name: "does_not_exit") do + it { should_not exist } + end +end diff --git a/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb b/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb new file mode 100644 index 000000000..331e1e067 --- /dev/null +++ b/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb @@ -0,0 +1,33 @@ +# ---------------------------------------------------------------------------- +# +# *** 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. +# +# ---------------------------------------------------------------------------- + +title 'Test GCP google_apigee_organization_envgroup_attachments resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') + + organization_envgroup_attachment = input('organization_envgroup_attachment', value: { + "name": "value_name", + "parent": "value_parent", + "created_at": "value_createdat", + "environment": "value_environment", + "environment_group_id": "value_environmentgroupid" +}, description: 'organization_envgroup_attachment description') +control 'google_apigee_organization_envgroup_attachments-1.0' do + impact 1.0 + title 'google_apigee_organization_envgroup_attachments resource test' + + describe google_apigee_organization_envgroup_attachments(parent: organization_envgroup_attachment['parent']) do + it { should exist } + end +end From 211afbaa00eaacc36ffdd09fa72e159cf99dc165 Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Tue, 5 Dec 2023 18:44:46 +0530 Subject: [PATCH 02/13] Updates the apigee organization envgroup attachments plural resource to use correct key to fetch the data list API Signed-off-by: Vasu1105 --- libraries/google_apigee_organization_envgroup_attachments.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/google_apigee_organization_envgroup_attachments.rb b/libraries/google_apigee_organization_envgroup_attachments.rb index c8c5c3b41..7678bfae7 100644 --- a/libraries/google_apigee_organization_envgroup_attachments.rb +++ b/libraries/google_apigee_organization_envgroup_attachments.rb @@ -33,7 +33,7 @@ class ApigeeOrganizationEnvgroupAttachments < GcpResourceBase def initialize(params = {}) super(params.merge({ use_http_transport: true })) @params = params - @table = fetch_wrapped_resource('organizationEnvgroupAttachments') + @table = fetch_wrapped_resource('environmentGroupAttachments') end def fetch_wrapped_resource(wrap_path) From b3f9e1fc1c372fa658b2d35fcbf3d79f840b29de Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Tue, 5 Dec 2023 18:46:07 +0530 Subject: [PATCH 03/13] Updates test for apigee organization envgrop attachment singular and plural resource Signed-off-by: Vasu1105 --- ...apigee_organization_envgroup_attachment.rb | 18 ++++++------- ...pigee_organization_envgroup_attachments.rb | 27 +++++++++++-------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb b/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb index 8ca838d60..1d0117ab4 100644 --- a/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb +++ b/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb @@ -14,26 +14,24 @@ title 'Test GCP google_apigee_organization_envgroup_attachment resource.' -gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') - - organization_envgroup_attachment = input('organization_envgroup_attachment', value: { - "name": "value_name", - "parent": "value_parent", - "created_at": "value_createdat", - "environment": "value_environment", - "environment_group_id": "value_environmentgroupid" +organization_envgroup_attachment = input('organization_envgroup_attachment', value: { + "name": "6741d6ad-1307-4f03-b02a-9fb4562c0ff3", + "parent": "organizations/ppradhan/envgroups/test-env-group/attachments", + "created_at": "1698227493793", + "environment": "test-env", + "environment_group_id": "test-env-group" }, description: 'organization_envgroup_attachment description') + control 'google_apigee_organization_envgroup_attachment-1.0' do impact 1.0 title 'google_apigee_organization_envgroup_attachment resource test' - describe google_apigee_organization_envgroup_attachment(name: organization_envgroup_attachment['name']) do + describe google_apigee_organization_envgroup_attachment(name: "#{organization_envgroup_attachment['parent']}/#{organization_envgroup_attachment['name']}") do it { should exist } its('created_at') { should cmp organization_envgroup_attachment['created_at'] } its('environment') { should cmp organization_envgroup_attachment['environment'] } its('environment_group_id') { should cmp organization_envgroup_attachment['environment_group_id'] } its('name') { should cmp organization_envgroup_attachment['name'] } - end describe google_apigee_organization_envgroup_attachment(name: "does_not_exit") do diff --git a/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb b/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb index 331e1e067..2c3a380c6 100644 --- a/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb +++ b/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb @@ -14,20 +14,25 @@ title 'Test GCP google_apigee_organization_envgroup_attachments resource.' -gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') - - organization_envgroup_attachment = input('organization_envgroup_attachment', value: { - "name": "value_name", - "parent": "value_parent", - "created_at": "value_createdat", - "environment": "value_environment", - "environment_group_id": "value_environmentgroupid" +organization_envgroup_attachment = input('organization_envgroup_attachment', value: { + "name": "6741d6ad-1307-4f03-b02a-9fb4562c0ff3", + "parent": "organizations/ppradhan/envgroups/test-env-group", + "created_at": "1698227493793", + "environment": "test-env", + "environment_group_id": "test-env-group" }, description: 'organization_envgroup_attachment description') + control 'google_apigee_organization_envgroup_attachments-1.0' do impact 1.0 title 'google_apigee_organization_envgroup_attachments resource test' - describe google_apigee_organization_envgroup_attachments(parent: organization_envgroup_attachment['parent']) do - it { should exist } - end + describe google_apigee_organization_envgroup_attachments(parent: organization_envgroup_attachment['parent']) do + it { should exist } + end + + describe google_apigee_organization_envgroup_attachments(parent: organization_envgroup_attachment['parent']).where(name: organization_envgroup_attachment['name']) do + it { should exist } + its("environment_group_ids") { should include organization_envgroup_attachment['environment_group_id'] } + its("environments") { should include organization_envgroup_attachment['environment'] } + end end From 12f061edc33c991ec05ca0e2db65bd3d94654037 Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Tue, 5 Dec 2023 18:46:29 +0530 Subject: [PATCH 04/13] Updates docs Signed-off-by: Vasu1105 --- .../google_apigee_organization_envgroup_attachment.md | 9 ++++++--- .../google_apigee_organization_envgroup_attachments.md | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/resources/google_apigee_organization_envgroup_attachment.md b/docs/resources/google_apigee_organization_envgroup_attachment.md index 4fc3b56da..2269b54d0 100644 --- a/docs/resources/google_apigee_organization_envgroup_attachment.md +++ b/docs/resources/google_apigee_organization_envgroup_attachment.md @@ -4,9 +4,11 @@ platform: gcp --- ## Syntax + A `google_apigee_organization_envgroup_attachment` is used to test a Google OrganizationEnvgroupAttachment resource ## Examples + ``` describe google_apigee_organization_envgroup_attachment(name: ' value_name') do it { should exist } @@ -23,14 +25,15 @@ end ``` ## Properties + Properties that can be accessed from the `google_apigee_organization_envgroup_attachment` resource: - * `created_at`: Output only. The time at which the environment group attachment was created as milliseconds since epoch. + * `created_at`: The time at which the environment group attachment was created as milliseconds since epoch. - * `environment`: Required. ID of the attached environment. + * `environment`: ID of the attached environment. - * `environment_group_id`: Output only. ID of the environment group. + * `environment_group_id`: ID of the environment group. * `name`: ID of the environment group attachment. diff --git a/docs/resources/google_apigee_organization_envgroup_attachments.md b/docs/resources/google_apigee_organization_envgroup_attachments.md index 3b6d2ed02..283d0132a 100644 --- a/docs/resources/google_apigee_organization_envgroup_attachments.md +++ b/docs/resources/google_apigee_organization_envgroup_attachments.md @@ -4,9 +4,11 @@ platform: gcp --- ## Syntax + A `google_apigee_organization_envgroup_attachments` is used to test a Google OrganizationEnvgroupAttachment resource ## Examples + ``` describe google_apigee_organization_envgroup_attachments(parent: ' value_parent') do it { should exist } @@ -14,6 +16,7 @@ A `google_apigee_organization_envgroup_attachments` is used to test a Google Org ``` ## Properties + Properties that can be accessed from the `google_apigee_organization_envgroup_attachments` resource: See [google_apigee_organization_envgroup_attachment.md](google_apigee_organization_envgroup_attachment.md) for more detailed information @@ -23,6 +26,7 @@ See [google_apigee_organization_envgroup_attachment.md](google_apigee_organizati * `names`: an array of `google_apigee_organization_envgroup_attachment` name ## 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. From a4ab1bc7a3f1a6ac51e74b5dda3a14653cff4f3e Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Tue, 5 Dec 2023 18:47:46 +0530 Subject: [PATCH 05/13] Updates values in mm-attributes.yml file for apigee organization envgroup attachment resource Signed-off-by: Vasu1105 --- .../configuration/mm-attributes.yml | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/build/inspec/test/integration/configuration/mm-attributes.yml b/build/inspec/test/integration/configuration/mm-attributes.yml index 8f92b70e6..c3b880ef9 100644 --- a/build/inspec/test/integration/configuration/mm-attributes.yml +++ b/build/inspec/test/integration/configuration/mm-attributes.yml @@ -895,22 +895,9 @@ organization: state : "ACTIVE" analytics_region : "us-west1" -vpn_gateway: - project : "value_project" - region : "value_region" - vpn_gateway : "value_vpngateway" - kind : "value_kind" - id : "value_id" - creation_timestamp : "value_creationtimestamp" - name : "value_name" - description : "value_description" - network : "value_network" - self_link : "value_selflink" - label_fingerprint : "value_labelfingerprint" - stack_type : "value_stacktype" organization_envgroup_attachment: - name : "value_name" - parent : "value_parent" - created_at : "value_createdat" - environment : "value_environment" - environment_group_id : "value_environmentgroupid" + name: "6741d6ad-1307-4f03-b02a-9fb4562c0ff3", + parent: "organizations/ppradhan/envgroups/test-env-group/attachments", + created_at: "1698227493793", + environment: "test-env", + environment_group_id: "test-env-group" \ No newline at end of file From 65b6da72f1fa78065a2aa8d36a759976a3117cc0 Mon Sep 17 00:00:00 2001 From: Samir Anand Date: Thu, 30 Nov 2023 00:30:07 +0530 Subject: [PATCH 06/13] Automatically generated by magic modules for service: apigee and resource: Organizations__envgroups__attachment. This commit includes the following changes: - Singular Resource - Plural Resource - Documentation updates - Terraform configuration - Integration tests Signed-off-by: Samir Anand --- ...apigee_organization_envgroup_attachment.md | 40 +++++++++ ...pigee_organization_envgroup_attachments.md | 31 +++++++ ...apigee_organization_envgroup_attachment.rb | 61 +++++++++++++ ...pigee_organization_envgroup_attachments.rb | 85 +++++++++++++++++++ ...apigee_organization_envgroup_attachment.rb | 42 +++++++++ ...pigee_organization_envgroup_attachments.rb | 33 +++++++ 6 files changed, 292 insertions(+) create mode 100644 docs/resources/google_apigee_organization_envgroup_attachment.md create mode 100644 docs/resources/google_apigee_organization_envgroup_attachments.md create mode 100644 libraries/google_apigee_organization_envgroup_attachment.rb create mode 100644 libraries/google_apigee_organization_envgroup_attachments.rb create mode 100644 test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb create mode 100644 test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb diff --git a/docs/resources/google_apigee_organization_envgroup_attachment.md b/docs/resources/google_apigee_organization_envgroup_attachment.md new file mode 100644 index 000000000..4fc3b56da --- /dev/null +++ b/docs/resources/google_apigee_organization_envgroup_attachment.md @@ -0,0 +1,40 @@ +--- +title: About the google_apigee_organization_envgroup_attachment resource +platform: gcp +--- + +## Syntax +A `google_apigee_organization_envgroup_attachment` is used to test a Google OrganizationEnvgroupAttachment resource + +## Examples +``` +describe google_apigee_organization_envgroup_attachment(name: ' value_name') do + it { should exist } + its('created_at') { should cmp 'value_createdat' } + its('environment') { should cmp 'value_environment' } + its('environment_group_id') { should cmp 'value_environmentgroupid' } + its('name') { should cmp 'value_name' } + +end + +describe google_apigee_organization_envgroup_attachment(name: "does_not_exit") do + it { should_not exist } +end +``` + +## Properties +Properties that can be accessed from the `google_apigee_organization_envgroup_attachment` resource: + + + * `created_at`: Output only. The time at which the environment group attachment was created as milliseconds since epoch. + + * `environment`: Required. ID of the attached environment. + + * `environment_group_id`: Output only. ID of the environment group. + + * `name`: ID of the environment group attachment. + + +## GCP Permissions + +Ensure the [Apigee API](https://console.cloud.google.com/apis/library/apigee.googleapis.com/) is enabled for the current project. diff --git a/docs/resources/google_apigee_organization_envgroup_attachments.md b/docs/resources/google_apigee_organization_envgroup_attachments.md new file mode 100644 index 000000000..3b6d2ed02 --- /dev/null +++ b/docs/resources/google_apigee_organization_envgroup_attachments.md @@ -0,0 +1,31 @@ +--- +title: About the google_apigee_organization_envgroup_attachments resource +platform: gcp +--- + +## Syntax +A `google_apigee_organization_envgroup_attachments` is used to test a Google OrganizationEnvgroupAttachment resource + +## Examples +``` + describe google_apigee_organization_envgroup_attachments(parent: ' value_parent') do + it { should exist } + end +``` + +## Properties +Properties that can be accessed from the `google_apigee_organization_envgroup_attachments` resource: + +See [google_apigee_organization_envgroup_attachment.md](google_apigee_organization_envgroup_attachment.md) for more detailed information + * `created_ats`: an array of `google_apigee_organization_envgroup_attachment` created_at + * `environments`: an array of `google_apigee_organization_envgroup_attachment` environment + * `environment_group_ids`: an array of `google_apigee_organization_envgroup_attachment` environment_group_id + * `names`: an array of `google_apigee_organization_envgroup_attachment` name + +## 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 [Apigee API](https://console.cloud.google.com/apis/library/apigee.googleapis.com/) is enabled for the current project. diff --git a/libraries/google_apigee_organization_envgroup_attachment.rb b/libraries/google_apigee_organization_envgroup_attachment.rb new file mode 100644 index 000000000..705deb58f --- /dev/null +++ b/libraries/google_apigee_organization_envgroup_attachment.rb @@ -0,0 +1,61 @@ +# 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 'gcp_backend' + +# A provider to manage Apigee resources. +class ApigeeOrganizationEnvgroupAttachment < GcpResourceBase + name 'google_apigee_organization_envgroup_attachment' + desc 'OrganizationEnvgroupAttachment' + supports platform: 'gcp' + + attr_reader :params + attr_reader :created_at + attr_reader :environment + attr_reader :environment_group_id + attr_reader :name + + def initialize(params) + super(params.merge({ use_http_transport: true })) + @params = params + @fetched = @connection.fetch(product_url(params[:beta]), resource_base_url, params, 'Get') + parse unless @fetched.nil? + end + + def parse + @created_at = @fetched['createdAt'] + @environment = @fetched['environment'] + @environment_group_id = @fetched['environmentGroupId'] + @name = @fetched['name'] + end + + def exists? + !@fetched.nil? + end + + def to_s + "OrganizationEnvgroupAttachment #{@params[:name]}" + end + + private + + def product_url(_ = nil) + 'https://apigee.googleapis.com/v1/' + end + + def resource_base_url + '{{name}}' + end +end diff --git a/libraries/google_apigee_organization_envgroup_attachments.rb b/libraries/google_apigee_organization_envgroup_attachments.rb new file mode 100644 index 000000000..c8c5c3b41 --- /dev/null +++ b/libraries/google_apigee_organization_envgroup_attachments.rb @@ -0,0 +1,85 @@ +# 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 'gcp_backend' +class ApigeeOrganizationEnvgroupAttachments < GcpResourceBase + name 'google_apigee_organization_envgroup_attachments' + desc 'OrganizationEnvgroupAttachment plural resource' + supports platform: 'gcp' + + attr_reader :table + + filter_table_config = FilterTable.create + + filter_table_config.add(:created_ats, field: :created_at) + filter_table_config.add(:environments, field: :environment) + filter_table_config.add(:environment_group_ids, field: :environment_group_id) + filter_table_config.add(:names, field: :name) + + filter_table_config.connect(self, :table) + + def initialize(params = {}) + super(params.merge({ use_http_transport: true })) + @params = params + @table = fetch_wrapped_resource('organizationEnvgroupAttachments') + end + + def fetch_wrapped_resource(wrap_path) + # fetch_resource returns an array of responses (to handle pagination) + result = @connection.fetch_all(product_url, resource_base_url, @params, 'Get') + return if result.nil? + + # Conversion of string -> object hash to symbol -> object hash that InSpec needs + converted = [] + result.each do |response| + next if response.nil? || !response.key?(wrap_path) + response[wrap_path].each do |hash| + hash_with_symbols = {} + hash.each_key do |key| + name, value = transform(key, hash) + hash_with_symbols[name] = value + end + converted.push(hash_with_symbols) + end + end + + converted + end + + def transform(key, value) + return transformers[key].call(value) if transformers.key?(key) + + [key.to_sym, value] + end + + def transformers + { + 'createdAt' => ->(obj) { return :created_at, obj['createdAt'] }, + 'environment' => ->(obj) { return :environment, obj['environment'] }, + 'environmentGroupId' => ->(obj) { return :environment_group_id, obj['environmentGroupId'] }, + 'name' => ->(obj) { return :name, obj['name'] }, + } + end + + private + + def product_url(_ = nil) + 'https://apigee.googleapis.com/v1/' + end + + def resource_base_url + '{{parent}}/attachments' + end +end diff --git a/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb b/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb new file mode 100644 index 000000000..8ca838d60 --- /dev/null +++ b/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb @@ -0,0 +1,42 @@ +# ---------------------------------------------------------------------------- +# +# *** 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. +# +# ---------------------------------------------------------------------------- + +title 'Test GCP google_apigee_organization_envgroup_attachment resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') + + organization_envgroup_attachment = input('organization_envgroup_attachment', value: { + "name": "value_name", + "parent": "value_parent", + "created_at": "value_createdat", + "environment": "value_environment", + "environment_group_id": "value_environmentgroupid" +}, description: 'organization_envgroup_attachment description') +control 'google_apigee_organization_envgroup_attachment-1.0' do + impact 1.0 + title 'google_apigee_organization_envgroup_attachment resource test' + + describe google_apigee_organization_envgroup_attachment(name: organization_envgroup_attachment['name']) do + it { should exist } + its('created_at') { should cmp organization_envgroup_attachment['created_at'] } + its('environment') { should cmp organization_envgroup_attachment['environment'] } + its('environment_group_id') { should cmp organization_envgroup_attachment['environment_group_id'] } + its('name') { should cmp organization_envgroup_attachment['name'] } + + end + + describe google_apigee_organization_envgroup_attachment(name: "does_not_exit") do + it { should_not exist } + end +end diff --git a/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb b/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb new file mode 100644 index 000000000..331e1e067 --- /dev/null +++ b/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb @@ -0,0 +1,33 @@ +# ---------------------------------------------------------------------------- +# +# *** 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. +# +# ---------------------------------------------------------------------------- + +title 'Test GCP google_apigee_organization_envgroup_attachments resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') + + organization_envgroup_attachment = input('organization_envgroup_attachment', value: { + "name": "value_name", + "parent": "value_parent", + "created_at": "value_createdat", + "environment": "value_environment", + "environment_group_id": "value_environmentgroupid" +}, description: 'organization_envgroup_attachment description') +control 'google_apigee_organization_envgroup_attachments-1.0' do + impact 1.0 + title 'google_apigee_organization_envgroup_attachments resource test' + + describe google_apigee_organization_envgroup_attachments(parent: organization_envgroup_attachment['parent']) do + it { should exist } + end +end From 2dee529f8a1c2a00b4b2560ca07a3ebe507a0e7b Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Tue, 5 Dec 2023 18:44:46 +0530 Subject: [PATCH 07/13] Updates the apigee organization envgroup attachments plural resource to use correct key to fetch the data list API Signed-off-by: Vasu1105 --- libraries/google_apigee_organization_envgroup_attachments.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/google_apigee_organization_envgroup_attachments.rb b/libraries/google_apigee_organization_envgroup_attachments.rb index c8c5c3b41..7678bfae7 100644 --- a/libraries/google_apigee_organization_envgroup_attachments.rb +++ b/libraries/google_apigee_organization_envgroup_attachments.rb @@ -33,7 +33,7 @@ class ApigeeOrganizationEnvgroupAttachments < GcpResourceBase def initialize(params = {}) super(params.merge({ use_http_transport: true })) @params = params - @table = fetch_wrapped_resource('organizationEnvgroupAttachments') + @table = fetch_wrapped_resource('environmentGroupAttachments') end def fetch_wrapped_resource(wrap_path) From 046fc548765e567bd4fcd4d8a9d6bf1160ba352f Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Tue, 5 Dec 2023 18:46:07 +0530 Subject: [PATCH 08/13] Updates test for apigee organization envgrop attachment singular and plural resource Signed-off-by: Vasu1105 --- ...apigee_organization_envgroup_attachment.rb | 18 ++++++------- ...pigee_organization_envgroup_attachments.rb | 27 +++++++++++-------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb b/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb index 8ca838d60..1d0117ab4 100644 --- a/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb +++ b/test/integration/verify/controls/google_apigee_organization_envgroup_attachment.rb @@ -14,26 +14,24 @@ title 'Test GCP google_apigee_organization_envgroup_attachment resource.' -gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') - - organization_envgroup_attachment = input('organization_envgroup_attachment', value: { - "name": "value_name", - "parent": "value_parent", - "created_at": "value_createdat", - "environment": "value_environment", - "environment_group_id": "value_environmentgroupid" +organization_envgroup_attachment = input('organization_envgroup_attachment', value: { + "name": "6741d6ad-1307-4f03-b02a-9fb4562c0ff3", + "parent": "organizations/ppradhan/envgroups/test-env-group/attachments", + "created_at": "1698227493793", + "environment": "test-env", + "environment_group_id": "test-env-group" }, description: 'organization_envgroup_attachment description') + control 'google_apigee_organization_envgroup_attachment-1.0' do impact 1.0 title 'google_apigee_organization_envgroup_attachment resource test' - describe google_apigee_organization_envgroup_attachment(name: organization_envgroup_attachment['name']) do + describe google_apigee_organization_envgroup_attachment(name: "#{organization_envgroup_attachment['parent']}/#{organization_envgroup_attachment['name']}") do it { should exist } its('created_at') { should cmp organization_envgroup_attachment['created_at'] } its('environment') { should cmp organization_envgroup_attachment['environment'] } its('environment_group_id') { should cmp organization_envgroup_attachment['environment_group_id'] } its('name') { should cmp organization_envgroup_attachment['name'] } - end describe google_apigee_organization_envgroup_attachment(name: "does_not_exit") do diff --git a/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb b/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb index 331e1e067..2c3a380c6 100644 --- a/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb +++ b/test/integration/verify/controls/google_apigee_organization_envgroup_attachments.rb @@ -14,20 +14,25 @@ title 'Test GCP google_apigee_organization_envgroup_attachments resource.' -gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') - - organization_envgroup_attachment = input('organization_envgroup_attachment', value: { - "name": "value_name", - "parent": "value_parent", - "created_at": "value_createdat", - "environment": "value_environment", - "environment_group_id": "value_environmentgroupid" +organization_envgroup_attachment = input('organization_envgroup_attachment', value: { + "name": "6741d6ad-1307-4f03-b02a-9fb4562c0ff3", + "parent": "organizations/ppradhan/envgroups/test-env-group", + "created_at": "1698227493793", + "environment": "test-env", + "environment_group_id": "test-env-group" }, description: 'organization_envgroup_attachment description') + control 'google_apigee_organization_envgroup_attachments-1.0' do impact 1.0 title 'google_apigee_organization_envgroup_attachments resource test' - describe google_apigee_organization_envgroup_attachments(parent: organization_envgroup_attachment['parent']) do - it { should exist } - end + describe google_apigee_organization_envgroup_attachments(parent: organization_envgroup_attachment['parent']) do + it { should exist } + end + + describe google_apigee_organization_envgroup_attachments(parent: organization_envgroup_attachment['parent']).where(name: organization_envgroup_attachment['name']) do + it { should exist } + its("environment_group_ids") { should include organization_envgroup_attachment['environment_group_id'] } + its("environments") { should include organization_envgroup_attachment['environment'] } + end end From 82e24b4598c811eecf36807c964d14f5e4d921c5 Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Tue, 5 Dec 2023 18:46:29 +0530 Subject: [PATCH 09/13] Updates docs Signed-off-by: Vasu1105 --- .../google_apigee_organization_envgroup_attachment.md | 9 ++++++--- .../google_apigee_organization_envgroup_attachments.md | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/resources/google_apigee_organization_envgroup_attachment.md b/docs/resources/google_apigee_organization_envgroup_attachment.md index 4fc3b56da..2269b54d0 100644 --- a/docs/resources/google_apigee_organization_envgroup_attachment.md +++ b/docs/resources/google_apigee_organization_envgroup_attachment.md @@ -4,9 +4,11 @@ platform: gcp --- ## Syntax + A `google_apigee_organization_envgroup_attachment` is used to test a Google OrganizationEnvgroupAttachment resource ## Examples + ``` describe google_apigee_organization_envgroup_attachment(name: ' value_name') do it { should exist } @@ -23,14 +25,15 @@ end ``` ## Properties + Properties that can be accessed from the `google_apigee_organization_envgroup_attachment` resource: - * `created_at`: Output only. The time at which the environment group attachment was created as milliseconds since epoch. + * `created_at`: The time at which the environment group attachment was created as milliseconds since epoch. - * `environment`: Required. ID of the attached environment. + * `environment`: ID of the attached environment. - * `environment_group_id`: Output only. ID of the environment group. + * `environment_group_id`: ID of the environment group. * `name`: ID of the environment group attachment. diff --git a/docs/resources/google_apigee_organization_envgroup_attachments.md b/docs/resources/google_apigee_organization_envgroup_attachments.md index 3b6d2ed02..283d0132a 100644 --- a/docs/resources/google_apigee_organization_envgroup_attachments.md +++ b/docs/resources/google_apigee_organization_envgroup_attachments.md @@ -4,9 +4,11 @@ platform: gcp --- ## Syntax + A `google_apigee_organization_envgroup_attachments` is used to test a Google OrganizationEnvgroupAttachment resource ## Examples + ``` describe google_apigee_organization_envgroup_attachments(parent: ' value_parent') do it { should exist } @@ -14,6 +16,7 @@ A `google_apigee_organization_envgroup_attachments` is used to test a Google Org ``` ## Properties + Properties that can be accessed from the `google_apigee_organization_envgroup_attachments` resource: See [google_apigee_organization_envgroup_attachment.md](google_apigee_organization_envgroup_attachment.md) for more detailed information @@ -23,6 +26,7 @@ See [google_apigee_organization_envgroup_attachment.md](google_apigee_organizati * `names`: an array of `google_apigee_organization_envgroup_attachment` name ## 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. From 3614542ee96f24936d5a30bb7e0d8c61f7205a2f Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Wed, 6 Dec 2023 14:28:31 +0530 Subject: [PATCH 10/13] Updates README to add docs link Signed-off-by: Vasu1105 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 825ddf82b..d8d840848 100644 --- a/README.md +++ b/README.md @@ -197,6 +197,7 @@ The following resources are available in the InSpec GCP Profile | [google_access_context_manager_access_level](docs/resources/google_access_context_manager_access_level.md) | [google_access_context_manager_access_levels](docs/resources/google_access_context_manager_access_levels.md) | | [google_access_context_manager_access_policy](docs/resources/google_access_context_manager_access_policy.md) | [google_access_context_manager_access_policies](docs/resources/google_access_context_manager_access_policies.md) | | [google_access_context_manager_service_perimeter](docs/resources/google_access_context_manager_service_perimeter.md) | [google_access_context_manager_service_perimeters](docs/resources/google_access_context_manager_service_perimeters.md) | +| [google_apigee_organization_envgroup_attachment](docs/resources/google_apigee_organization_envgroup_attachment.md) | [google_apigee_organization_envgroup_attachments](docs/resources/google_apigee_organization_envgroup_attachments.md) | | [google_appengine_standard_app_version](docs/resources/google_appengine_standard_app_version.md) | [google_appengine_standard_app_versions](docs/resources/google_appengine_standard_app_versions.md) | | [google_bigquery_dataset](docs/resources/google_bigquery_dataset.md) | [google_bigquery_datasets](docs/resources/google_bigquery_datasets.md) | | [google_bigquery_table](docs/resources/google_bigquery_table.md) | [google_bigquery_tables](docs/resources/google_bigquery_tables.md) | From 669be06a83813dd7f31006d768ce51c8b8d84618 Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Wed, 6 Dec 2023 21:25:45 +0530 Subject: [PATCH 11/13] Updates terraform scripts Signed-off-by: Vasu1105 --- test/integration/build/gcp-mm.tf | 11 ++++++++++- test/integration/configuration/mm-attributes.yml | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/test/integration/build/gcp-mm.tf b/test/integration/build/gcp-mm.tf index 02e4b7abc..60f8926e5 100644 --- a/test/integration/build/gcp-mm.tf +++ b/test/integration/build/gcp-mm.tf @@ -220,6 +220,10 @@ variable "cloud_composer_v1" { type = any } +variable "organization_envgroup_attachment" { + type = any +} + resource "google_compute_ssl_policy" "custom-ssl-policy" { name = var.ssl_policy["name"] min_tls_version = var.ssl_policy["min_tls_version"] @@ -1559,9 +1563,14 @@ resource "google_vertex_ai_index" "index" { resource "google_composer_v1_environment" "test" { name = var.cloud_composer_v1["name"] region = var.cloud_composer_v1["region"] - config { + config { software_config { image_version = var.cloud_composer_v1["image_version"] } } } + +resource "google_apigee_envgroup_attachment" "engroup_attachment" { + envgroup_id = var.organization_envgroup_attachment.envgroup_id + environment = var.organization_envgroup_attachment.environment +} diff --git a/test/integration/configuration/mm-attributes.yml b/test/integration/configuration/mm-attributes.yml index 37074e018..65b01023e 100644 --- a/test/integration/configuration/mm-attributes.yml +++ b/test/integration/configuration/mm-attributes.yml @@ -562,3 +562,7 @@ cloud_composer_v1: name : "example-composer-env" region : "us-central1" image_version : "composer-1.20.12-airflow-2.4.3" + +organization_envgroup_attachment: + envgroup_id: "organizations/ppradhan/envgroups/test-env-group" + environment: "test-env" From addc1eae9a1f5e401eb0295adbe150b28fb74dd3 Mon Sep 17 00:00:00 2001 From: Vasu1105 Date: Fri, 8 Dec 2023 14:46:15 +0530 Subject: [PATCH 12/13] Updates the terraform attributes name and variable name Signed-off-by: Vasu1105 --- test/integration/build/gcp-mm.tf | 6 +++--- test/integration/configuration/mm-attributes.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/build/gcp-mm.tf b/test/integration/build/gcp-mm.tf index 60f8926e5..1d2418975 100644 --- a/test/integration/build/gcp-mm.tf +++ b/test/integration/build/gcp-mm.tf @@ -220,7 +220,7 @@ variable "cloud_composer_v1" { type = any } -variable "organization_envgroup_attachment" { +variable "apigee_organization_envgroup_attachment" { type = any } @@ -1571,6 +1571,6 @@ resource "google_composer_v1_environment" "test" { } resource "google_apigee_envgroup_attachment" "engroup_attachment" { - envgroup_id = var.organization_envgroup_attachment.envgroup_id - environment = var.organization_envgroup_attachment.environment + envgroup_id = var.apigee_organization_envgroup_attachment.envgroup_id + environment = var.apigee_organization_envgroup_attachment.environment } diff --git a/test/integration/configuration/mm-attributes.yml b/test/integration/configuration/mm-attributes.yml index 65b01023e..d3a3e98c3 100644 --- a/test/integration/configuration/mm-attributes.yml +++ b/test/integration/configuration/mm-attributes.yml @@ -563,6 +563,6 @@ cloud_composer_v1: region : "us-central1" image_version : "composer-1.20.12-airflow-2.4.3" -organization_envgroup_attachment: +apigee_organization_envgroup_attachment: envgroup_id: "organizations/ppradhan/envgroups/test-env-group" environment: "test-env" From 4a52a6e65c758cc656814839b51560f16b86cf8d Mon Sep 17 00:00:00 2001 From: Samir Anand Date: Fri, 8 Dec 2023 17:01:43 +0530 Subject: [PATCH 13/13] Linting fix with rubocop 1.58 Signed-off-by: Samir Anand --- .../google_apigee_organization_envgroup_attachments.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/google_apigee_organization_envgroup_attachments.rb b/libraries/google_apigee_organization_envgroup_attachments.rb index 7678bfae7..d61e48d26 100644 --- a/libraries/google_apigee_organization_envgroup_attachments.rb +++ b/libraries/google_apigee_organization_envgroup_attachments.rb @@ -66,10 +66,10 @@ def transform(key, value) def transformers { - 'createdAt' => ->(obj) { return :created_at, obj['createdAt'] }, - 'environment' => ->(obj) { return :environment, obj['environment'] }, - 'environmentGroupId' => ->(obj) { return :environment_group_id, obj['environmentGroupId'] }, - 'name' => ->(obj) { return :name, obj['name'] }, + 'createdAt' => ->(obj) { [:created_at, obj['createdAt']] }, + 'environment' => ->(obj) { [:environment, obj['environment']] }, + 'environmentGroupId' => ->(obj) { [:environment_group_id, obj['environmentGroupId']] }, + 'name' => ->(obj) { [:name, obj['name']] }, } end