diff --git a/mmv1/products/gemini/ReleaseChannelSetting.yaml b/mmv1/products/gemini/ReleaseChannelSetting.yaml new file mode 100644 index 000000000000..4c1a83daa2e6 --- /dev/null +++ b/mmv1/products/gemini/ReleaseChannelSetting.yaml @@ -0,0 +1,75 @@ +# Copyright 2025 Google Inc. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +name: ReleaseChannelSetting +description: The resource for managing ReleaseChannel settings for Admin Control. +min_version: 'beta' +base_url: projects/{{project}}/locations/{{location}}/releaseChannelSettings +update_mask: true +self_link: projects/{{project}}/locations/{{location}}/releaseChannelSettings/{{release_channel_setting_id}} +create_url: projects/{{project}}/locations/{{location}}/releaseChannelSettings?releaseChannelSettingId={{release_channel_setting_id}} +update_verb: PATCH +id_format: projects/{{project}}/locations/{{location}}/releaseChannelSettings/{{release_channel_setting_id}} +import_format: + - projects/{{project}}/locations/{{location}}/releaseChannelSettings/{{release_channel_setting_id}} +mutex: projects/{{project}}/locations/{{location}}/releaseChannelSettings/{{release_channel_setting_id}} +examples: + - name: gemini_release_channel_setting_basic + min_version: 'beta' + primary_resource_id: example + vars: + release_channel_setting_id: ls1-tf +autogen_async: false +autogen_status: UmVsZWFzZUNoYW5uZWxTZXR0aW5n +parameters: + - name: location + type: String + description: Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. + immutable: true + url_param_only: true + required: true + - name: releaseChannelSettingId + type: String + description: |- + Required. Id of the requesting object. + If auto-generating Id server-side, remove this field and + release_channel_setting_id from the method_signature of Create RPC + immutable: true + url_param_only: true + required: true +properties: + - name: createTime + type: String + description: Output only. [Output only] Create time stamp. + output: true + - name: updateTime + type: String + description: Output only. [Output only] Update time stamp. + output: true + - name: labels + type: KeyValueLabels + description: Optional. Labels as key value pairs. + - name: releaseChannel + type: String + description: |- + Optional. Release channel to be used. + Possible values: + STABLE + EXPERIMENTAL + - name: name + type: String + description: |- + Identifier. Name of the resource. + Format:projects/{project}/locations/{location}/releaseChannelSettings/{releaseChannelSetting} + output: true diff --git a/mmv1/templates/terraform/examples/gemini_release_channel_setting_basic.tf.tmpl b/mmv1/templates/terraform/examples/gemini_release_channel_setting_basic.tf.tmpl new file mode 100644 index 000000000000..19fb92829f8e --- /dev/null +++ b/mmv1/templates/terraform/examples/gemini_release_channel_setting_basic.tf.tmpl @@ -0,0 +1,6 @@ +resource "google_gemini_release_channel_setting" "{{$.PrimaryResourceId}}" { + provider = google-beta + release_channel_setting_id = "{{index $.Vars "release_channel_setting_id"}}" + location = "global" + release_channel = "EXPERIMENTAL" +} diff --git a/mmv1/third_party/terraform/services/gemini/resource_gemini_release_channel_setting_test.go.tmpl b/mmv1/third_party/terraform/services/gemini/resource_gemini_release_channel_setting_test.go.tmpl new file mode 100644 index 000000000000..d269fde20f38 --- /dev/null +++ b/mmv1/third_party/terraform/services/gemini/resource_gemini_release_channel_setting_test.go.tmpl @@ -0,0 +1,67 @@ +package gemini_test +{{- if ne $.TargetVersionName "ga" }} + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/plancheck" + "github.com/hashicorp/terraform-provider-google/google/acctest" +) + +func TestAccGeminiReleaseChannelSetting_geminiReleaseChannelSettingBasicExample_update(t *testing.T) { + t.Parallel() + context := map[string]interface{}{ + "setting_id": "ls-tf1", + } + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), + Steps: []resource.TestStep{ + { + Config: testAccGeminiReleaseChannelSetting_geminiReleaseChannelSettingBasicExample_basic(context), + }, + { + ResourceName: "google_gemini_release_channel_setting.example", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"labels", "location", "release_channel_setting_id", "terraform_labels"}, + }, + { + Config: testAccGeminiReleaseChannelSetting_geminiReleaseChannelSettingBasicExample_update(context), + ConfigPlanChecks: resource.ConfigPlanChecks{ + PreApply: []plancheck.PlanCheck{ + plancheck.ExpectResourceAction("google_gemini_release_channel_setting.example", plancheck.ResourceActionUpdate), + }, + }, + }, + { + ResourceName: "google_gemini_release_channel_setting.example", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"labels", "location", "release_channel_setting_id", "terraform_labels"}, + }, + }, + }) +} +func testAccGeminiReleaseChannelSetting_geminiReleaseChannelSettingBasicExample_basic(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_gemini_release_channel_setting" "example" { + provider = google-beta + release_channel_setting_id = "%{setting_id}" + location = "global" + release_channel = "EXPERIMENTAL" +} +`, context) +} +func testAccGeminiReleaseChannelSetting_geminiReleaseChannelSettingBasicExample_update(context map[string]interface{}) string { + return acctest.Nprintf(` +resource "google_gemini_release_channel_setting" "example" { + provider = google-beta + release_channel_setting_id = "%{setting_id}" + location = "global" + release_channel = "STABLE" +} +`, context) +} +{{ end }}