Skip to content

Commit 1053050

Browse files
authored
fix(tco): [137234675] tencentcloud_organization_org_member_email fix the issue of update function execution failure (#3095)
* add * add * add * add
1 parent e873b3e commit 1053050

File tree

4 files changed

+29
-35
lines changed

4 files changed

+29
-35
lines changed

.changelog/3095.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_organization_org_member_email: fix the issue of update function execution failure
3+
```

tencentcloud/services/tco/resource_tc_organization_org_member_email.go

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,6 @@ func resourceTencentCloudOrganizationOrgMemberEmailUpdate(d *schema.ResourceData
222222
memberUin := idSplit[0]
223223
bindId := idSplit[1]
224224

225-
request.MemberUin = helper.StrToInt64Point(memberUin)
226-
request.BindId = helper.StrToInt64Point(bindId)
227225
immutableArgs := []string{"member_uin", "bind_id", "apply_time", "bind_status", "bind_time", "description", "phone_bind"}
228226

229227
for _, v := range immutableArgs {
@@ -232,28 +230,19 @@ func resourceTencentCloudOrganizationOrgMemberEmailUpdate(d *schema.ResourceData
232230
}
233231
}
234232

235-
if d.HasChange("member_uin") {
236-
if v, ok := d.GetOkExists("member_uin"); ok {
237-
request.MemberUin = helper.IntInt64(v.(int))
238-
}
239-
}
233+
request.MemberUin = helper.StrToInt64Point(memberUin)
234+
request.BindId = helper.StrToInt64Point(bindId)
240235

241-
if d.HasChange("email") {
242-
if v, ok := d.GetOk("email"); ok {
243-
request.Email = helper.String(v.(string))
244-
}
236+
if v, ok := d.GetOk("email"); ok {
237+
request.Email = helper.String(v.(string))
245238
}
246239

247-
if d.HasChange("country_code") {
248-
if v, ok := d.GetOk("country_code"); ok {
249-
request.CountryCode = helper.String(v.(string))
250-
}
240+
if v, ok := d.GetOk("country_code"); ok {
241+
request.CountryCode = helper.String(v.(string))
251242
}
252243

253-
if d.HasChange("phone") {
254-
if v, ok := d.GetOk("phone"); ok {
255-
request.Phone = helper.String(v.(string))
256-
}
244+
if v, ok := d.GetOk("phone"); ok {
245+
request.Phone = helper.String(v.(string))
257246
}
258247

259248
err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
@@ -263,8 +252,10 @@ func resourceTencentCloudOrganizationOrgMemberEmailUpdate(d *schema.ResourceData
263252
} else {
264253
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString())
265254
}
255+
266256
return nil
267257
})
258+
268259
if err != nil {
269260
log.Printf("[CRITAL]%s update organization orgMemberEmail failed, reason:%+v", logId, err)
270261
return err
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
Provides a resource to create a organization org_member_email
1+
Provides a resource to create a organization member email
22

33
Example Usage
44

55
```hcl
6-
resource "tencentcloud_organization_org_member_email" "org_member_email" {
7-
member_uin = 100033704327
8-
email = "iac-example@qq.com"
6+
resource "tencentcloud_organization_org_member_email" "example" {
7+
member_uin = 100033118139
8+
email = "example@tencent.com"
99
country_code = "86"
10-
phone = "12345678901"
11-
}
10+
phone = "18611111111"
11+
}
1212
```
1313

1414
Import
1515

16-
organization org_member_email can be imported using the id, e.g.
16+
organization member email can be imported using the id, e.g.
1717

1818
```
19-
terraform import tencentcloud_organization_org_member_email.org_member_email org_member_email_id
19+
terraform import tencentcloud_organization_org_member_email.example 100033118139#132
2020
```

website/docs/r/organization_org_member_email.html.markdown

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ layout: "tencentcloud"
44
page_title: "TencentCloud: tencentcloud_organization_org_member_email"
55
sidebar_current: "docs-tencentcloud-resource-organization_org_member_email"
66
description: |-
7-
Provides a resource to create a organization org_member_email
7+
Provides a resource to create a organization member email
88
---
99

1010
# tencentcloud_organization_org_member_email
1111

12-
Provides a resource to create a organization org_member_email
12+
Provides a resource to create a organization member email
1313

1414
## Example Usage
1515

1616
```hcl
17-
resource "tencentcloud_organization_org_member_email" "org_member_email" {
18-
member_uin = 100033704327
19-
email = "iac-example@qq.com"
17+
resource "tencentcloud_organization_org_member_email" "example" {
18+
member_uin = 100033118139
19+
email = "example@tencent.com"
2020
country_code = "86"
21-
phone = "12345678901"
21+
phone = "18611111111"
2222
}
2323
```
2424

@@ -46,9 +46,9 @@ In addition to all arguments above, the following attributes are exported:
4646

4747
## Import
4848

49-
organization org_member_email can be imported using the id, e.g.
49+
organization member email can be imported using the id, e.g.
5050

5151
```
52-
terraform import tencentcloud_organization_org_member_email.org_member_email org_member_email_id
52+
terraform import tencentcloud_organization_org_member_email.example 100033118139#132
5353
```
5454

0 commit comments

Comments
 (0)