Skip to content

Commit 36d1566

Browse files
committed
adjust the uint64 to int64 since the mps sdk updating the type
1 parent dde0fb5 commit 36d1566

9 files changed

+170
-88
lines changed

.changelog/2163.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
tencentcloud_mps_withdraws_watermark_operation
3+
```

tencentcloud/provider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,7 @@ Media Processing Service(MPS)
15671567
tencentcloud_mps_ai_analysis_template
15681568
tencentcloud_mps_adaptive_dynamic_streaming_template
15691569
tencentcloud_mps_person_sample
1570+
tencentcloud_mps_withdraws_watermark_operation
15701571
15711572
Cloud HDFS(CHDFS)
15721573
Data Source
@@ -3029,6 +3030,7 @@ func Provider() *schema.Provider {
30293030
"tencentcloud_mps_ai_analysis_template": resourceTencentCloudMpsAiAnalysisTemplate(),
30303031
"tencentcloud_mps_adaptive_dynamic_streaming_template": resourceTencentCloudMpsAdaptiveDynamicStreamingTemplate(),
30313032
"tencentcloud_mps_person_sample": resourceTencentCloudMpsPersonSample(),
3033+
"tencentcloud_mps_withdraws_watermark_operation": resourceTencentCloudMpsWithdrawsWatermarkOperation(),
30323034
"tencentcloud_cbs_disk_backup": resourceTencentCloudCbsDiskBackup(),
30333035
"tencentcloud_cbs_snapshot_share_permission": resourceTencentCloudCbsSnapshotSharePermission(),
30343036
"tencentcloud_cbs_disk_backup_rollback_operation": resourceTencentCloudCbsDiskBackupRollbackOperation(),

tencentcloud/resource_tc_mps_adaptive_dynamic_streaming_template.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ func resourceTencentCloudMpsAdaptiveDynamicStreamingTemplateCreate(d *schema.Res
254254
videoTemplateInfo.Codec = helper.String(v.(string))
255255
}
256256
if v, ok := videoMap["fps"]; ok {
257-
videoTemplateInfo.Fps = helper.IntUint64(v.(int))
257+
videoTemplateInfo.Fps = helper.IntInt64(v.(int))
258258
}
259259
if v, ok := videoMap["bitrate"]; ok {
260-
videoTemplateInfo.Bitrate = helper.IntUint64(v.(int))
260+
videoTemplateInfo.Bitrate = helper.IntInt64(v.(int))
261261
}
262262
if v, ok := videoMap["resolution_adaptive"]; ok {
263263
videoTemplateInfo.ResolutionAdaptive = helper.String(v.(string))
@@ -285,7 +285,7 @@ func resourceTencentCloudMpsAdaptiveDynamicStreamingTemplateCreate(d *schema.Res
285285
audioTemplateInfo.Codec = helper.String(v.(string))
286286
}
287287
if v, ok := audioMap["bitrate"]; ok {
288-
audioTemplateInfo.Bitrate = helper.IntUint64(v.(int))
288+
audioTemplateInfo.Bitrate = helper.IntInt64(v.(int))
289289
}
290290
if v, ok := audioMap["sample_rate"]; ok {
291291
audioTemplateInfo.SampleRate = helper.IntUint64(v.(int))
@@ -511,10 +511,10 @@ func resourceTencentCloudMpsAdaptiveDynamicStreamingTemplateUpdate(d *schema.Res
511511
videoTemplateInfo.Codec = helper.String(v.(string))
512512
}
513513
if v, ok := videoMap["fps"]; ok {
514-
videoTemplateInfo.Fps = helper.IntUint64(v.(int))
514+
videoTemplateInfo.Fps = helper.IntInt64(v.(int))
515515
}
516516
if v, ok := videoMap["bitrate"]; ok {
517-
videoTemplateInfo.Bitrate = helper.IntUint64(v.(int))
517+
videoTemplateInfo.Bitrate = helper.IntInt64(v.(int))
518518
}
519519
if v, ok := videoMap["resolution_adaptive"]; ok {
520520
videoTemplateInfo.ResolutionAdaptive = helper.String(v.(string))
@@ -542,7 +542,7 @@ func resourceTencentCloudMpsAdaptiveDynamicStreamingTemplateUpdate(d *schema.Res
542542
audioTemplateInfo.Codec = helper.String(v.(string))
543543
}
544544
if v, ok := audioMap["bitrate"]; ok {
545-
audioTemplateInfo.Bitrate = helper.IntUint64(v.(int))
545+
audioTemplateInfo.Bitrate = helper.IntInt64(v.(int))
546546
}
547547
if v, ok := audioMap["sample_rate"]; ok {
548548
audioTemplateInfo.SampleRate = helper.IntUint64(v.(int))

tencentcloud/resource_tc_mps_transcode_template.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,10 @@ func resourceTencentCloudMpsTranscodeTemplateCreate(d *schema.ResourceData, meta
485485
videoTemplateInfo.Codec = helper.String(v.(string))
486486
}
487487
if v, ok := dMap["fps"]; ok {
488-
videoTemplateInfo.Fps = helper.IntUint64(v.(int))
488+
videoTemplateInfo.Fps = helper.IntInt64(v.(int))
489489
}
490490
if v, ok := dMap["bitrate"]; ok {
491-
videoTemplateInfo.Bitrate = helper.IntUint64(v.(int))
491+
videoTemplateInfo.Bitrate = helper.IntInt64(v.(int))
492492
}
493493
if v, ok := dMap["resolution_adaptive"]; ok {
494494
videoTemplateInfo.ResolutionAdaptive = helper.String(v.(string))
@@ -517,7 +517,7 @@ func resourceTencentCloudMpsTranscodeTemplateCreate(d *schema.ResourceData, meta
517517
audioTemplateInfo.Codec = helper.String(v.(string))
518518
}
519519
if v, ok := dMap["bitrate"]; ok {
520-
audioTemplateInfo.Bitrate = helper.IntUint64(v.(int))
520+
audioTemplateInfo.Bitrate = helper.IntInt64(v.(int))
521521
}
522522
if v, ok := dMap["sample_rate"]; ok {
523523
audioTemplateInfo.SampleRate = helper.IntUint64(v.(int))
@@ -534,7 +534,7 @@ func resourceTencentCloudMpsTranscodeTemplateCreate(d *schema.ResourceData, meta
534534
tEHDConfig.Type = helper.String(v.(string))
535535
}
536536
if v, ok := dMap["max_video_bitrate"]; ok {
537-
tEHDConfig.MaxVideoBitrate = helper.IntUint64(v.(int))
537+
tEHDConfig.MaxVideoBitrate = helper.IntInt64(v.(int))
538538
}
539539
request.TEHDConfig = &tEHDConfig
540540
}
@@ -1025,10 +1025,10 @@ func resourceTencentCloudMpsTranscodeTemplateUpdate(d *schema.ResourceData, meta
10251025
videoTemplateInfo.Codec = helper.String(v.(string))
10261026
}
10271027
if v, ok := dMap["fps"]; ok {
1028-
videoTemplateInfo.Fps = helper.IntUint64(v.(int))
1028+
videoTemplateInfo.Fps = helper.IntInt64(v.(int))
10291029
}
10301030
if v, ok := dMap["bitrate"]; ok {
1031-
videoTemplateInfo.Bitrate = helper.IntUint64(v.(int))
1031+
videoTemplateInfo.Bitrate = helper.IntInt64(v.(int))
10321032
}
10331033
if v, ok := dMap["resolution_adaptive"]; ok {
10341034
videoTemplateInfo.ResolutionAdaptive = helper.String(v.(string))
@@ -1059,7 +1059,7 @@ func resourceTencentCloudMpsTranscodeTemplateUpdate(d *schema.ResourceData, meta
10591059
audioTemplateInfo.Codec = helper.String(v.(string))
10601060
}
10611061
if v, ok := dMap["bitrate"]; ok {
1062-
audioTemplateInfo.Bitrate = helper.IntUint64(v.(int))
1062+
audioTemplateInfo.Bitrate = helper.IntInt64(v.(int))
10631063
}
10641064
if v, ok := dMap["sample_rate"]; ok {
10651065
audioTemplateInfo.SampleRate = helper.IntUint64(v.(int))
@@ -1078,7 +1078,7 @@ func resourceTencentCloudMpsTranscodeTemplateUpdate(d *schema.ResourceData, meta
10781078
tEHDConfig.Type = helper.String(v.(string))
10791079
}
10801080
if v, ok := dMap["max_video_bitrate"]; ok {
1081-
tEHDConfig.MaxVideoBitrate = helper.IntUint64(v.(int))
1081+
tEHDConfig.MaxVideoBitrate = helper.IntInt64(v.(int))
10821082
}
10831083
request.TEHDConfig = &tEHDConfig
10841084
}

tencentcloud/resource_tc_mps_withdraws_watermark_operation.go

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,35 @@ Provides a resource to create a mps withdraws_watermark_operation
33
44
Example Usage
55
6-
```hcl
7-
resource "tencentcloud_mps_withdraws_watermark_operation" "withdraws_watermark_operation" {
8-
input_info {
9-
type = ""
10-
cos_input_info {
11-
bucket = ""
12-
region = ""
13-
object = ""
14-
}
15-
url_input_info {
16-
url = ""
17-
}
18-
s3_input_info {
19-
s3_bucket = ""
20-
s3_region = ""
21-
s3_object = ""
22-
s3_secret_id = ""
23-
s3_secret_key = ""
24-
}
6+
Withdraw the watermark from COS
257
26-
}
27-
task_notify_config {
28-
cmq_model = ""
29-
cmq_region = ""
30-
topic_name = ""
31-
queue_name = ""
32-
notify_mode = ""
33-
notify_type = ""
34-
notify_url = ""
35-
aws_sqs {
36-
sqs_region = ""
37-
sqs_queue_name = ""
38-
s3_secret_id = ""
39-
s3_secret_key = ""
40-
}
8+
```hcl
9+
resource "tencentcloud_cos_bucket" "example" {
10+
bucket = "tf-test-mps-wm-${local.app_id}"
11+
acl = "public-read"
12+
}
4113
42-
}
43-
session_context = ""
14+
resource "tencentcloud_cos_bucket_object" "example" {
15+
bucket = tencentcloud_cos_bucket.example.bucket
16+
key = "/test-file/test.mov"
17+
source = "/Users/luoyin/Downloads/file_example_MOV_480_700kB.mov"
4418
}
45-
```
4619
47-
Import
4820
49-
mps withdraws_watermark_operation can be imported using the id, e.g.
21+
resource "tencentcloud_mps_withdraws_watermark_operation" "operation" {
22+
input_info {
23+
type = "COS"
24+
cos_input_info {
25+
bucket = tencentcloud_cos_bucket_object.example.bucket
26+
region = "%s"
27+
object = tencentcloud_cos_bucket_object.example.key
28+
}
29+
}
5030
31+
session_context = "this is a example session context"
32+
}
5133
```
52-
terraform import tencentcloud_mps_withdraws_watermark_operation.withdraws_watermark_operation withdraws_watermark_operation_id
53-
```
34+
5435
*/
5536
package tencentcloud
5637

@@ -68,9 +49,6 @@ func resourceTencentCloudMpsWithdrawsWatermarkOperation() *schema.Resource {
6849
Create: resourceTencentCloudMpsWithdrawsWatermarkOperationCreate,
6950
Read: resourceTencentCloudMpsWithdrawsWatermarkOperationRead,
7051
Delete: resourceTencentCloudMpsWithdrawsWatermarkOperationDelete,
71-
Importer: &schema.ResourceImporter{
72-
State: schema.ImportStatePassthrough,
73-
},
7452
Schema: map[string]*schema.Schema{
7553
"input_info": {
7654
Required: true,
@@ -83,7 +61,7 @@ func resourceTencentCloudMpsWithdrawsWatermarkOperation() *schema.Resource {
8361
"type": {
8462
Type: schema.TypeString,
8563
Required: true,
86-
Description: "The input type. Valid values:<li>`COS`: A COS bucket address.</li><li> `URL`: A URL.</li><li> `AWS-S3`: An AWS S3 bucket address. Currently, this type is only supported for transcoding tasks.</li>.",
64+
Description: "The input type. Valid values: `COS`: A COS bucket address. `URL`: A URL. `AWS-S3`: An AWS S3 bucket address. Currently, this type is only supported for transcoding tasks..",
8765
},
8866
"cos_input_info": {
8967
Type: schema.TypeList,
@@ -200,7 +178,7 @@ func resourceTencentCloudMpsWithdrawsWatermarkOperation() *schema.Resource {
200178
"notify_type": {
201179
Type: schema.TypeString,
202180
Optional: true,
203-
Description: "The notification type. Valid values: <li>`CMQ`: This value is no longer used. Please use `TDMQ-CMQ` instead.</li> <li>`TDMQ-CMQ`: Message queue</li> <li>`URL`: If `NotifyType` is set to `URL`, HTTP callbacks are sent to the URL specified by `NotifyUrl`. HTTP and JSON are used for the callbacks. The packet contains the response parameters of the `ParseNotification` API.</li> <li>`SCF`: This notification type is not recommended. You need to configure it in the SCF console.</li> <li>`AWS-SQS`: AWS queue. This type is only supported for AWS tasks, and the queue must be in the same region as the AWS bucket.</li> <font color=red>Note: If you do not pass this parameter or pass in an empty string, `CMQ` will be used. To use a different notification type, specify this parameter accordingly.</font>.",
181+
Description: "The notification type. Valid values: `CMQ`: This value is no longer used. Please use `TDMQ-CMQ` instead. `TDMQ-CMQ`: Message queue `URL`: If `NotifyType` is set to `URL`, HTTP callbacks are sent to the URL specified by `NotifyUrl`. HTTP and JSON are used for the callbacks. The packet contains the response parameters of the `ParseNotification` API. `SCF`: This notification type is not recommended. You need to configure it in the SCF console. `AWS-SQS`: AWS queue. This type is only supported for AWS tasks, and the queue must be in the same region as the AWS bucket. Note: If you do not pass this parameter or pass in an empty string, `CMQ` will be used. To use a different notification type, specify this parameter accordingly.",
204182
},
205183
"notify_url": {
206184
Type: schema.TypeString,

tencentcloud/resource_tc_mps_withdraws_watermark_operation_test.go

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package tencentcloud
22

33
import (
44
"fmt"
5-
"os"
65
"testing"
76

87
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
@@ -17,23 +16,18 @@ func TestAccTencentCloudMpsWithdrawsWatermarkOperationResource_basic(t *testing.
1716
Providers: testAccProviders,
1817
Steps: []resource.TestStep{
1918
{
20-
Config: fmt.Sprintf(testAccMpsWithdrawsWatermarkOperation, os.Getenv(PROVIDER_REGION)),
19+
Config: fmt.Sprintf(testAccMpsWithdrawsWatermarkOperation, defaultRegion),
2120
Check: resource.ComposeTestCheckFunc(
2221
resource.TestCheckResourceAttrSet("tencentcloud_mps_withdraws_watermark_operation.operation", "id"),
2322
resource.TestCheckResourceAttrSet("tencentcloud_mps_withdraws_watermark_operation.operation", "input_info.#"),
24-
resource.TestCheckResourceAttr("tencentcloud_mps_withdraws_watermark_operation.operation", "input_info.0.type", "cos"),
23+
resource.TestCheckResourceAttr("tencentcloud_mps_withdraws_watermark_operation.operation", "input_info.0.type", "COS"),
2524
resource.TestCheckResourceAttrSet("tencentcloud_mps_withdraws_watermark_operation.operation", "input_info.0.cos_input_info.#"),
2625
resource.TestCheckResourceAttrSet("tencentcloud_mps_withdraws_watermark_operation.operation", "input_info.0.cos_input_info.0.bucket"),
27-
resource.TestCheckResourceAttr("tencentcloud_mps_withdraws_watermark_operation.operation", "input_info.0.cos_input_info.0.region", os.Getenv(PROVIDER_REGION)),
26+
resource.TestCheckResourceAttr("tencentcloud_mps_withdraws_watermark_operation.operation", "input_info.0.cos_input_info.0.region", defaultRegion),
2827
resource.TestCheckResourceAttr("tencentcloud_mps_withdraws_watermark_operation.operation", "input_info.0.cos_input_info.0.object", "/mps-test/test.mov"),
2928
resource.TestCheckResourceAttr("tencentcloud_mps_withdraws_watermark_operation.operation", "session_context", "this is a example session context"),
3029
),
3130
},
32-
{
33-
ResourceName: "tencentcloud_mps_withdraws_watermark_operation.operation",
34-
ImportState: true,
35-
ImportStateVerify: true,
36-
},
3731
},
3832
})
3933
}
@@ -57,11 +51,11 @@ data "tencentcloud_cos_bucket_object" "object" {
5751
5852
resource "tencentcloud_mps_withdraws_watermark_operation" "operation" {
5953
input_info {
60-
type = "cos"
54+
type = "COS"
6155
cos_input_info {
62-
bucket = data.tencentcloud_cos_bucket_object.object.0.bucket
56+
bucket = data.tencentcloud_cos_bucket_object.object.bucket
6357
region = "%s"
64-
object = data.tencentcloud_cos_bucket_object.object.0.key
58+
object = data.tencentcloud_cos_bucket_object.object.key
6559
}
6660
}
6761
// task_notify_config {

0 commit comments

Comments
 (0)