Skip to content

fix(dasb): [117762490] update param phone Adapter country area code #2734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/2734.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_dasb_user: update param phone Adapter country area code
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ require (
github.com/hashicorp/go-uuid v1.0.3
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwpg v1.0.772
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip v1.0.860
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.798
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.964
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/oceanus v1.0.831
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/region v1.0.920
github.com/wI2L/jsondiff v0.3.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.692 h1:lD4
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.692/go.mod h1:nH1mCLxOm21eqEYORMJ5pifOfHoupCIx8YwMOu9YW2c=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.798 h1:8FQbCEPIL0dL+sTdQBZxqqwdLxmJEfkyu17w6r7ZrQg=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.798/go.mod h1:ch3pOoPfIs0i+l8qV5yO+Tpk45ubgdltYF/0MfDk4YA=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.964 h1:GLUcK8t83ay4+W90gWCl4mMDcwbWiF8VHw7iOhzQ1ZM=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dasb v1.0.964/go.mod h1:EErTkW1DHjRtNTlhBmXm+y3plwYreiwoi9o/YEAUNXc=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.335 h1:D8qrelkK5udv8RzJJIABMzItGIyaZoYnxEVeIsYqiNw=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dayu v1.0.335/go.mod h1:pz4s3nOhoB9cY0+uWzifuwr7lfh/Gvi1rv0ADxpPzD4=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dbbrain v1.0.652 h1:agjXNi5342DaL0TzRx1FjFlT+9VU2l6aN0yERmxiLLc=
Expand Down
10 changes: 7 additions & 3 deletions tencentcloud/services/bh/resource_tc_dasb_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"log"
"strconv"
"strings"

tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"

Expand Down Expand Up @@ -38,12 +39,12 @@ func ResourceTencentCloudDasbUser() *schema.Resource {
"phone": {
Optional: true,
Type: schema.TypeString,
Description: "Fill in the mainland mobile phone number directly. If it is a number from other countries or regions, enter it in the format of country area code|mobile phone number. For example: +852|xxxxxxxx.",
Description: "Enter it in the format of country area code|mobile phone number. For example: +86|***********, +852|xxxxxxxx. Please provide at least one of `phone` or `email`.",
},
"email": {
Optional: true,
Type: schema.TypeString,
Description: "Email.",
Description: "Email. Please provide at least one of `phone` or `email`.",
},
"validate_from": {
Optional: true,
Expand Down Expand Up @@ -198,7 +199,10 @@ func resourceTencentCloudDasbUserRead(d *schema.ResourceData, meta interface{})
}

if user.Phone != nil {
_ = d.Set("phone", user.Phone)
parts := strings.Split(*user.Phone, "|")
if len(parts) == 2 && parts[1] != "" {
_ = d.Set("phone", user.Phone)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这儿加了没用啊,其它情况就不去set了么

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其他情况不做set,不然就会set了一个'+86|'或者'+852|' 的单国区数据

}
}

if user.Email != nil {
Expand Down
Loading
Loading