From 03ffb7a3665ff1c8559c0404ebc35f01d597f202 Mon Sep 17 00:00:00 2001 From: The Magician Date: Mon, 9 Dec 2024 09:36:05 -0800 Subject: [PATCH] Enhanced documentation and property dependency for `quota` in `google_identity_platform_config` (#12315) (#8869) [upstream:0b617ed01a5c89bc49592999607ef0141d63043b] Signed-off-by: Modular Magician --- .changelog/12315.txt | 3 +++ .../resource_identity_platform_config.go | 23 +++++++++++-------- .../r/identity_platform_config.html.markdown | 6 ++--- 3 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 .changelog/12315.txt diff --git a/.changelog/12315.txt b/.changelog/12315.txt new file mode 100644 index 0000000000..37cc805a07 --- /dev/null +++ b/.changelog/12315.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +identityplatform: marked `quota.0.sign_up_quota_config` subfields conditionally required in `google_identity_platform_config` to move errors from apply time up to plan time, and clarified the rule in documentation +``` \ No newline at end of file diff --git a/google-beta/services/identityplatform/resource_identity_platform_config.go b/google-beta/services/identityplatform/resource_identity_platform_config.go index b70ba3a174..bd77bd2e4a 100644 --- a/google-beta/services/identityplatform/resource_identity_platform_config.go +++ b/google-beta/services/identityplatform/resource_identity_platform_config.go @@ -286,24 +286,27 @@ If the value is not set, the tenant will be created under the same organization "sign_up_quota_config": { Type: schema.TypeList, Optional: true, - Description: `Quota for the Signup endpoint, if overwritten. Signup quota is measured in sign ups per project per hour per IP.`, + Description: `Quota for the Signup endpoint, if overwritten. Signup quota is measured in sign ups per project per hour per IP. None of quota, startTime, or quotaDuration can be skipped.`, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "quota": { - Type: schema.TypeInt, - Optional: true, - Description: `A sign up APIs quota that customers can override temporarily.`, + Type: schema.TypeInt, + Optional: true, + Description: `A sign up APIs quota that customers can override temporarily. Value can be in between 1 and 1000.`, + RequiredWith: []string{"quota.0.sign_up_quota_config.0.start_time", "quota.0.sign_up_quota_config.0.quota_duration"}, }, "quota_duration": { - Type: schema.TypeString, - Optional: true, - Description: `How long this quota will be active for. It is measurred in seconds, e.g., Example: "9.615s".`, + Type: schema.TypeString, + Optional: true, + Description: `How long this quota will be active for. It is measurred in seconds, e.g., Example: "9.615s".`, + RequiredWith: []string{"quota.0.sign_up_quota_config.0.start_time", "quota.0.sign_up_quota_config.0.quota"}, }, "start_time": { - Type: schema.TypeString, - Optional: true, - Description: `When this quota will take affect.`, + Type: schema.TypeString, + Optional: true, + Description: `When this quota will take affect.`, + RequiredWith: []string{"quota.0.sign_up_quota_config.0.quota", "quota.0.sign_up_quota_config.0.quota_duration"}, }, }, }, diff --git a/website/docs/r/identity_platform_config.html.markdown b/website/docs/r/identity_platform_config.html.markdown index 910f078afe..7139714a38 100644 --- a/website/docs/r/identity_platform_config.html.markdown +++ b/website/docs/r/identity_platform_config.html.markdown @@ -100,7 +100,7 @@ resource "google_identity_platform_config" "default" { quota { sign_up_quota_config { quota = 1000 - start_time = "" + start_time = "2014-10-02T15:01:23Z" quota_duration = "7200s" } } @@ -293,7 +293,7 @@ The following arguments are supported: * `sign_up_quota_config` - (Optional) - Quota for the Signup endpoint, if overwritten. Signup quota is measured in sign ups per project per hour per IP. + Quota for the Signup endpoint, if overwritten. Signup quota is measured in sign ups per project per hour per IP. None of quota, startTime, or quotaDuration can be skipped. Structure is [documented below](#nested_sign_up_quota_config). @@ -301,7 +301,7 @@ The following arguments are supported: * `quota` - (Optional) - A sign up APIs quota that customers can override temporarily. + A sign up APIs quota that customers can override temporarily. Value can be in between 1 and 1000. * `start_time` - (Optional)