From ff3e07c4fb5b990bb243beb4ed0e633d2a759777 Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Tue, 21 Jan 2025 14:50:10 +0800 Subject: [PATCH 1/4] add --- ...source_tc_organization_org_member_email.go | 29 +++++++------------ ...source_tc_organization_org_member_email.md | 16 +++++----- ...rganization_org_member_email.html.markdown | 16 +++++----- 3 files changed, 26 insertions(+), 35 deletions(-) diff --git a/tencentcloud/services/tco/resource_tc_organization_org_member_email.go b/tencentcloud/services/tco/resource_tc_organization_org_member_email.go index 087e19c539..fdb5e4812f 100644 --- a/tencentcloud/services/tco/resource_tc_organization_org_member_email.go +++ b/tencentcloud/services/tco/resource_tc_organization_org_member_email.go @@ -222,8 +222,6 @@ func resourceTencentCloudOrganizationOrgMemberEmailUpdate(d *schema.ResourceData memberUin := idSplit[0] bindId := idSplit[1] - request.MemberUin = helper.StrToInt64Point(memberUin) - request.BindId = helper.StrToInt64Point(bindId) immutableArgs := []string{"member_uin", "bind_id", "apply_time", "bind_status", "bind_time", "description", "phone_bind"} for _, v := range immutableArgs { @@ -232,28 +230,19 @@ func resourceTencentCloudOrganizationOrgMemberEmailUpdate(d *schema.ResourceData } } - if d.HasChange("member_uin") { - if v, ok := d.GetOkExists("member_uin"); ok { - request.MemberUin = helper.IntInt64(v.(int)) - } - } + request.MemberUin = helper.StrToInt64Point(memberUin) + request.BindId = helper.StrToInt64Point(bindId) - if d.HasChange("email") { - if v, ok := d.GetOk("email"); ok { - request.Email = helper.String(v.(string)) - } + if v, ok := d.GetOk("email"); ok { + request.Email = helper.String(v.(string)) } - if d.HasChange("country_code") { - if v, ok := d.GetOk("country_code"); ok { - request.CountryCode = helper.String(v.(string)) - } + if v, ok := d.GetOk("country_code"); ok { + request.CountryCode = helper.String(v.(string)) } - if d.HasChange("phone") { - if v, ok := d.GetOk("phone"); ok { - request.Phone = helper.String(v.(string)) - } + if v, ok := d.GetOk("phone"); ok { + request.Phone = helper.String(v.(string)) } err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { @@ -263,8 +252,10 @@ func resourceTencentCloudOrganizationOrgMemberEmailUpdate(d *schema.ResourceData } else { log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) } + return nil }) + if err != nil { log.Printf("[CRITAL]%s update organization orgMemberEmail failed, reason:%+v", logId, err) return err diff --git a/tencentcloud/services/tco/resource_tc_organization_org_member_email.md b/tencentcloud/services/tco/resource_tc_organization_org_member_email.md index c16777c78f..60ce9fd0a7 100644 --- a/tencentcloud/services/tco/resource_tc_organization_org_member_email.md +++ b/tencentcloud/services/tco/resource_tc_organization_org_member_email.md @@ -1,20 +1,20 @@ -Provides a resource to create a organization org_member_email +Provides a resource to create a organization member email Example Usage ```hcl -resource "tencentcloud_organization_org_member_email" "org_member_email" { - member_uin = 100033704327 - email = "iac-example@qq.com" +resource "tencentcloud_organization_org_member_email" "example" { + member_uin = 100033118139 + email = "example@tencent.com" country_code = "86" - phone = "12345678901" - } + phone = "18611111111" +} ``` Import -organization org_member_email can be imported using the id, e.g. +organization member email can be imported using the id, e.g. ``` -terraform import tencentcloud_organization_org_member_email.org_member_email org_member_email_id +terraform import tencentcloud_organization_org_member_email.example 100037718139#132 ``` \ No newline at end of file diff --git a/website/docs/r/organization_org_member_email.html.markdown b/website/docs/r/organization_org_member_email.html.markdown index 69a2e923b7..b0334869bf 100644 --- a/website/docs/r/organization_org_member_email.html.markdown +++ b/website/docs/r/organization_org_member_email.html.markdown @@ -4,21 +4,21 @@ layout: "tencentcloud" page_title: "TencentCloud: tencentcloud_organization_org_member_email" sidebar_current: "docs-tencentcloud-resource-organization_org_member_email" description: |- - Provides a resource to create a organization org_member_email + Provides a resource to create a organization member email --- # tencentcloud_organization_org_member_email -Provides a resource to create a organization org_member_email +Provides a resource to create a organization member email ## Example Usage ```hcl -resource "tencentcloud_organization_org_member_email" "org_member_email" { - member_uin = 100033704327 - email = "iac-example@qq.com" +resource "tencentcloud_organization_org_member_email" "example" { + member_uin = 100033118139 + email = "example@tencent.com" country_code = "86" - phone = "12345678901" + phone = "18611111111" } ``` @@ -46,9 +46,9 @@ In addition to all arguments above, the following attributes are exported: ## Import -organization org_member_email can be imported using the id, e.g. +organization member email can be imported using the id, e.g. ``` -terraform import tencentcloud_organization_org_member_email.org_member_email org_member_email_id +terraform import tencentcloud_organization_org_member_email.example 100037718139#132 ``` From a63cf7495e250828a15679759d001d29618a174b Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Tue, 21 Jan 2025 14:51:28 +0800 Subject: [PATCH 2/4] add --- .changelog/3095.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/3095.txt diff --git a/.changelog/3095.txt b/.changelog/3095.txt new file mode 100644 index 0000000000..8bed60b0cd --- /dev/null +++ b/.changelog/3095.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_organization_org_member_email: update code +``` From 7d841744ba6117e033d4161255e77619094f5231 Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Tue, 21 Jan 2025 14:52:23 +0800 Subject: [PATCH 3/4] add --- .../services/tco/resource_tc_organization_org_member_email.md | 2 +- website/docs/r/organization_org_member_email.html.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tencentcloud/services/tco/resource_tc_organization_org_member_email.md b/tencentcloud/services/tco/resource_tc_organization_org_member_email.md index 60ce9fd0a7..e73cebd333 100644 --- a/tencentcloud/services/tco/resource_tc_organization_org_member_email.md +++ b/tencentcloud/services/tco/resource_tc_organization_org_member_email.md @@ -16,5 +16,5 @@ Import organization member email can be imported using the id, e.g. ``` -terraform import tencentcloud_organization_org_member_email.example 100037718139#132 +terraform import tencentcloud_organization_org_member_email.example 100033118139#132 ``` \ No newline at end of file diff --git a/website/docs/r/organization_org_member_email.html.markdown b/website/docs/r/organization_org_member_email.html.markdown index b0334869bf..b926710561 100644 --- a/website/docs/r/organization_org_member_email.html.markdown +++ b/website/docs/r/organization_org_member_email.html.markdown @@ -49,6 +49,6 @@ In addition to all arguments above, the following attributes are exported: organization member email can be imported using the id, e.g. ``` -terraform import tencentcloud_organization_org_member_email.example 100037718139#132 +terraform import tencentcloud_organization_org_member_email.example 100033118139#132 ``` From 3151bdc606405dab41ed015672bd3567d1f51ffd Mon Sep 17 00:00:00 2001 From: SevenEarth <391613297@qq.com> Date: Tue, 21 Jan 2025 15:09:39 +0800 Subject: [PATCH 4/4] add --- .changelog/3095.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/3095.txt b/.changelog/3095.txt index 8bed60b0cd..7faf7cae26 100644 --- a/.changelog/3095.txt +++ b/.changelog/3095.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/tencentcloud_organization_org_member_email: update code +resource/tencentcloud_organization_org_member_email: fix the issue of update function execution failure ```