Skip to content

Commit be0b165

Browse files
committed
add
1 parent 20c6eed commit be0b165

4 files changed

+126
-90
lines changed

tencentcloud/connectivity/client.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ type TencentCloudClient struct {
214214
omitNilConn *common.Client
215215
emrv20190103Conn *emr.Client
216216
teov20220901Conn *teo.Client
217+
sslv20191205Conn *sslCertificate.Client
217218
}
218219

219220
// NewClientProfile returns a new ClientProfile
@@ -1844,3 +1845,16 @@ func (me *TencentCloudClient) UseTeoV20220901Client() *teo.Client {
18441845

18451846
return me.teov20220901Conn
18461847
}
1848+
1849+
// UseSslV20191205Client return SSL client for service
1850+
func (me *TencentCloudClient) UseSslV20191205Client() *sslCertificate.Client {
1851+
if me.sslv20191205Conn != nil {
1852+
return me.sslv20191205Conn
1853+
}
1854+
cpf := me.NewClientProfile(300)
1855+
cpf.Language = "zh-CN"
1856+
me.sslv20191205Conn, _ = sslCertificate.NewClient(me.Credential, me.Region, cpf)
1857+
me.sslv20191205Conn.WithHttpTransport(&LogRoundTripper{})
1858+
1859+
return me.sslv20191205Conn
1860+
}

tencentcloud/services/ssl/resource_tc_ssl_check_certificate_domain_verification_operation.go

Lines changed: 38 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package ssl
2+
3+
import (
4+
"context"
5+
tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
6+
7+
sslv20191205 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl/v20191205"
8+
)
9+
10+
func resourceTencentCloudSslCheckCertificateDomainVerificationOperationCreatePreHandleResponse0(ctx context.Context, resp *sslv20191205.CheckCertificateDomainVerificationResponse) error {
11+
d := tccommon.ResourceDataFromContext(ctx)
12+
13+
response := resp.Response.VerificationResults
14+
tmpList := make([]map[string]interface{}, 0, len(response))
15+
for _, item := range response {
16+
tmpObject := make(map[string]interface{})
17+
if item.Domain != nil {
18+
tmpObject["domain"] = item.Domain
19+
}
20+
21+
if item.VerifyType != nil {
22+
tmpObject["verify_type"] = item.VerifyType
23+
}
24+
25+
if item.LocalCheck != nil {
26+
tmpObject["local_check"] = item.LocalCheck
27+
}
28+
29+
if item.CaCheck != nil {
30+
tmpObject["ca_check"] = item.CaCheck
31+
}
32+
33+
if item.LocalCheckFailReason != nil {
34+
tmpObject["local_check_fail_reason"] = item.LocalCheckFailReason
35+
}
36+
37+
if item.CheckValue != nil {
38+
tmpValueList := make([]string, 0, len(item.CheckValue))
39+
for _, v := range item.CheckValue {
40+
tmpValueList = append(tmpValueList, *v)
41+
}
42+
43+
tmpObject["check_value"] = tmpValueList
44+
}
45+
46+
if item.Frequently != nil {
47+
tmpObject["frequently"] = item.Frequently
48+
}
49+
50+
if item.Issued != nil {
51+
tmpObject["issued"] = item.Issued
52+
}
53+
54+
tmpList = append(tmpList, tmpObject)
55+
}
56+
57+
_ = d.Set("verification_results", tmpList)
58+
59+
return nil
60+
}
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
1-
package ssl_test
1+
package ssl
22

33
import (
44
"testing"
55

6-
tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest"
7-
86
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
7+
8+
tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest"
99
)
1010

11-
// go test -i; go test -test.run TestAccTencentCloudSslCheckCertificateDomainVerificationOperationResource_basic -v
1211
func TestAccTencentCloudSslCheckCertificateDomainVerificationOperationResource_basic(t *testing.T) {
1312
t.Parallel()
1413
resource.Test(t, resource.TestCase{
1514
PreCheck: func() {
1615
tcacctest.AccPreCheck(t)
1716
},
1817
Providers: tcacctest.AccProviders,
19-
Steps: []resource.TestStep{
20-
{
21-
Config: testAccSslCheckCertificateDomainVerification,
22-
Check: resource.ComposeTestCheckFunc(
23-
resource.TestCheckResourceAttrSet("tencentcloud_ssl_check_certificate_domain_verification_operation.example", "id"),
24-
resource.TestCheckResourceAttrSet("tencentcloud_ssl_check_certificate_domain_verification_operation.example", "certificate_id"),
25-
),
26-
},
27-
},
18+
Steps: []resource.TestStep{{
19+
Config: testAccSslCheckCertificateDomainVerificationOperation,
20+
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_ssl_check_certificate_domain_verification_operation.ssl_check_certificate_domain_verification_operation", "id")),
21+
}, {
22+
ResourceName: "tencentcloud_ssl_check_certificate_domain_verification_operation.ssl_check_certificate_domain_verification_operation",
23+
ImportState: true,
24+
ImportStateVerify: true,
25+
}},
2826
})
2927
}
3028

31-
const testAccSslCheckCertificateDomainVerification = `
32-
resource "tencentcloud_ssl_check_certificate_domain_verification_operation" "example" {
33-
certificate_id = "6BE701Jx"
29+
const testAccSslCheckCertificateDomainVerificationOperation = `
30+
31+
resource "tencentcloud_ssl_check_certificate_domain_verification_operation" "ssl_check_certificate_domain_verification_operation" {
3432
}
3533
`

0 commit comments

Comments
 (0)