diff --git a/.changelog/2239.txt b/.changelog/2239.txt new file mode 100644 index 0000000000..aa2e441b13 --- /dev/null +++ b/.changelog/2239.txt @@ -0,0 +1,36 @@ +```release-note:new-data-source +tencentcloud_bi_project +``` + +```release-note:new-data-source +tencentcloud_bi_user_project +``` + +```release-note:new-resource +tencentcloud_bi_project +``` + +```release-note:new-resource +tencentcloud_bi_user_role +``` + +```release-note:new-resource +tencentcloud_bi_project_user_role +``` + +```release-note:new-resource +tencentcloud_bi_datasource +``` + +```release-note:new-resource +tencentcloud_bi_datasource_cloud +``` + +```release-note:new-resource +tencentcloud_bi_embed_token_apply +``` + +```release-note:new-resource +tencentcloud_bi_embed_interval_apply +``` + diff --git a/go.mod b/go.mod index be6eee518a..28f6549344 100644 --- a/go.mod +++ b/go.mod @@ -31,6 +31,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway v1.0.763 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm v1.0.624 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.756 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi v1.0.770 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.760 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat v1.0.760 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs v1.0.591 diff --git a/go.sum b/go.sum index 43cd04274e..540c683020 100644 --- a/go.sum +++ b/go.sum @@ -784,6 +784,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm v1.0.624 h1:AXDRZPP github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm v1.0.624/go.mod h1:ONtHJxQQsy6nuRdsnGj6X9G5/+a+EJdt1EtckvyVIS4= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.756 h1:dx4aBdOWIqAUDQw9A6lU10EAaLpLwI2WRPVbuQgxzck= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.756/go.mod h1:lwWeh6aHg6GlttTMp+VIVtpZOtmpP6DQnnYWpyYW37Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi v1.0.770 h1:5FWt9F+ajshQEEQFfbvTe+n5lJai0eHbEsGDqYmJu5o= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi v1.0.770/go.mod h1:zuWcAJVIXbHbOR7i6SKK0wNlvPLt5Su4ijOZGMJbUi8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.760 h1:Ky9dRsTL2HXKWUrTFpQFZWQ1TrM+o+P35kczR7thalo= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.760/go.mod h1:AAfdrxknvUedvigxbbzKQLxN+1EG5NPbytpiqmfuFvU= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat v1.0.760 h1:oGY4IigfIw0iQKh3/cOY29KBeEeFbvJft69e0beyfdI= diff --git a/tencentcloud/connectivity/client.go b/tencentcloud/connectivity/client.go index c60bc7e928..70b4957c7b 100644 --- a/tencentcloud/connectivity/client.go +++ b/tencentcloud/connectivity/client.go @@ -31,6 +31,7 @@ import ( apigateway "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apigateway/v20180808" apm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm/v20210622" as "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as/v20180419" + bi "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105" cam "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116" cat "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cat/v20180409" cbs "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cbs/v20170312" @@ -186,6 +187,7 @@ type TencentCloudClient struct { wafConn *waf.Client cfwConn *cfw.Client trocketConn *trocket.Client + biConn *bi.Client } // NewClientProfile returns a new ClientProfile @@ -1307,6 +1309,20 @@ func (me *TencentCloudClient) UseTrocketClient() *trocket.Client { return me.trocketConn } +// UseBiClient returns bi client for service +func (me *TencentCloudClient) UseBiClient() *bi.Client { + if me.biConn != nil { + return me.biConn + } + + cpf := me.NewClientProfile(300) + cpf.Language = "zh-CN" + me.biConn, _ = bi.NewClient(me.Credential, me.Region, cpf) + me.biConn.WithHttpTransport(&LogRoundTripper{}) + + return me.biConn +} + func getEnvDefault(key string, defVal int) int { val, ex := os.LookupEnv(key) if !ex { diff --git a/tencentcloud/data_source_tc_bi_project.go b/tencentcloud/data_source_tc_bi_project.go new file mode 100644 index 0000000000..4a351a67dc --- /dev/null +++ b/tencentcloud/data_source_tc_bi_project.go @@ -0,0 +1,406 @@ +/* +Use this data source to query detailed information of bi project + +Example Usage + +```hcl +data "tencentcloud_bi_project" "project" { + page_no = 1 + keyword = "abc" + all_page = true + module_collection = "sys_common_user" +} +``` +*/ +package tencentcloud + +import ( + "context" + "strconv" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bi "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func dataSourceTencentCloudBiProject() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudBiProjectRead, + Schema: map[string]*schema.Schema{ + "page_no": { + Optional: true, + Type: schema.TypeInt, + Description: "Page number.", + }, + + "keyword": { + Optional: true, + Type: schema.TypeString, + Description: "Retrieve fuzzy fields.", + }, + + "all_page": { + Optional: true, + Type: schema.TypeBool, + Description: "Whether to display all, if true, ignore paging.", + }, + + "module_collection": { + Optional: true, + Type: schema.TypeString, + Description: "Role information, can be ignored.", + }, + + "extra": { + Computed: true, + Type: schema.TypeString, + Description: "Additional information(Note: This field may return null, indicating that no valid value can be obtained).", + }, + + "msg": { + Computed: true, + Type: schema.TypeString, + Description: "Interface information(Note: This field may return null, indicating that no valid value can be obtained).", + }, + + "list": { + Type: schema.TypeList, + Computed: true, + Description: "Array(Note: This field may return null, indicating that no valid value can be obtained).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Computed: true, + Description: "Project id.", + }, + "logo": { + Type: schema.TypeString, + Computed: true, + Description: "Project logo(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Project name(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "color_code": { + Type: schema.TypeString, + Computed: true, + Description: "Logo colour(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "created_user": { + Type: schema.TypeString, + Computed: true, + Description: "Created by(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "Created at(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "member_count": { + Type: schema.TypeInt, + Computed: true, + Description: "Member count(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "page_count": { + Type: schema.TypeInt, + Computed: true, + Description: "Page count(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "last_modify_name": { + Type: schema.TypeString, + Computed: true, + Description: "Last modified report and presentation names(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "source": { + Type: schema.TypeString, + Computed: true, + Description: "Interface call source(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "apply": { + Type: schema.TypeBool, + Computed: true, + Description: "Apply(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "updated_user": { + Type: schema.TypeString, + Computed: true, + Description: "Updated by(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "Updated by(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "corp_id": { + Type: schema.TypeString, + Computed: true, + Description: "Enterprise id(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "mark": { + Type: schema.TypeString, + Computed: true, + Description: "Remark(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "seed": { + Type: schema.TypeString, + Computed: true, + Description: "Obfuscated field(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "auth_list": { + Type: schema.TypeSet, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + Computed: true, + Description: "List of permissions within the project(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "panel_scope": { + Type: schema.TypeString, + Computed: true, + Description: "Default kanban(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "is_external_manage": { + Type: schema.TypeBool, + Computed: true, + Description: "Determine whether it is hosted(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "manage_platform": { + Type: schema.TypeString, + Computed: true, + Description: "Hosting platform name(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "config_list": { + Type: schema.TypeList, + Computed: true, + Description: "Customized parameters, this parameter can be ignored(Note: This field may return null, indicating that no valid value can be obtained).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "module_group": { + Type: schema.TypeString, + Computed: true, + Description: "Module group(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "components": { + Type: schema.TypeList, + Computed: true, + Description: "Components(Note: This field may return null, indicating that no valid value can be obtained).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "module_id": { + Type: schema.TypeString, + Computed: true, + Description: "Module id(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "include_type": { + Type: schema.TypeString, + Computed: true, + Description: "Include type(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "params": { + Type: schema.TypeString, + Computed: true, + Description: "Extra parameters(Note: This field may return null, indicating that no valid value can be obtained).", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudBiProjectRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("data_source.tencentcloud_bi_project.read")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOkExists("page_no"); ok { + paramMap["PageNo"] = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("keyword"); ok { + paramMap["Keyword"] = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("all_page"); ok { + paramMap["AllPage"] = helper.Bool(v.(bool)) + } + + if v, ok := d.GetOk("module_collection"); ok { + paramMap["ModuleCollection"] = helper.String(v.(string)) + } + + service := BiService{client: meta.(*TencentCloudClient).apiV3Conn} + + var project []*bi.Project + err := resource.Retry(readRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeBiProjectByFilter(ctx, paramMap) + if e != nil { + return retryError(e) + } + project = result + return nil + }) + if err != nil { + return err + } + + ids := make([]string, 0, len(project)) + listList := []interface{}{} + if project != nil { + for _, list := range project { + listMap := map[string]interface{}{} + + if list.Id != nil { + listMap["id"] = list.Id + } + + if list.Logo != nil { + listMap["logo"] = list.Logo + } + + if list.Name != nil { + listMap["name"] = list.Name + } + + if list.ColorCode != nil { + listMap["color_code"] = list.ColorCode + } + + if list.CreatedUser != nil { + listMap["created_user"] = list.CreatedUser + } + + if list.CreatedAt != nil { + listMap["created_at"] = list.CreatedAt + } + + if list.MemberCount != nil { + listMap["member_count"] = list.MemberCount + } + + if list.PageCount != nil { + listMap["page_count"] = list.PageCount + } + + if list.LastModifyName != nil { + listMap["last_modify_name"] = list.LastModifyName + } + + if list.Source != nil { + listMap["source"] = list.Source + } + + if list.Apply != nil { + listMap["apply"] = list.Apply + } + + if list.UpdatedUser != nil { + listMap["updated_user"] = list.UpdatedUser + } + + if list.UpdatedAt != nil { + listMap["updated_at"] = list.UpdatedAt + } + + if list.CorpId != nil { + listMap["corp_id"] = list.CorpId + } + + if list.Mark != nil { + listMap["mark"] = list.Mark + } + + if list.Seed != nil { + listMap["seed"] = list.Seed + } + + if list.AuthList != nil { + listMap["auth_list"] = list.AuthList + } + + if list.PanelScope != nil { + listMap["panel_scope"] = list.PanelScope + } + + if list.IsExternalManage != nil { + listMap["is_external_manage"] = list.IsExternalManage + } + + if list.ManagePlatform != nil { + listMap["manage_platform"] = list.ManagePlatform + } + + if list.ConfigList != nil { + configListList := []interface{}{} + for _, configList := range list.ConfigList { + configListMap := map[string]interface{}{} + + if configList.ModuleGroup != nil { + configListMap["module_group"] = configList.ModuleGroup + } + + if configList.Components != nil { + componentsList := []interface{}{} + for _, components := range configList.Components { + componentsMap := map[string]interface{}{} + + if components.ModuleId != nil { + componentsMap["module_id"] = components.ModuleId + } + + if components.IncludeType != nil { + componentsMap["include_type"] = components.IncludeType + } + + if components.Params != nil { + componentsMap["params"] = components.Params + } + + componentsList = append(componentsList, componentsMap) + } + + configListMap["components"] = componentsList + } + + configListList = append(configListList, configListMap) + } + + listMap["config_list"] = configListList + } + + listList = append(listList, listMap) + ids = append(ids, strconv.FormatUint(*list.Id, 10)) + } + + _ = d.Set("list", listList) + } + + d.SetId(helper.DataResourceIdsHash(ids)) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := writeToFile(output.(string), listList); e != nil { + return e + } + } + return nil +} diff --git a/tencentcloud/data_source_tc_bi_project_test.go b/tencentcloud/data_source_tc_bi_project_test.go new file mode 100644 index 0000000000..fa4b5c04be --- /dev/null +++ b/tencentcloud/data_source_tc_bi_project_test.go @@ -0,0 +1,49 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +// go test -test.run TestAccTencentCloudBiProjectDataSource_basic -v +func TestAccTencentCloudBiProjectDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBiProjectDataSource, + Check: resource.ComposeTestCheckFunc( + testAccCheckTencentCloudDataSourceID("data.tencentcloud_bi_project.project"), + resource.TestCheckResourceAttr("data.tencentcloud_bi_project.project", "list.#", "1"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.apply"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.auth_list.#"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.color_code"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.corp_id"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.created_at"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.created_user"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.is_external_manage"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.member_count"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.name"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.page_count"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.seed"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.updated_at"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_project.project", "list.0.updated_user"), + ), + }, + }, + }) +} + +const testAccBiProjectDataSource = ` + +data "tencentcloud_bi_project" "project" { + keyword = "keep" + all_page = true +} + +` diff --git a/tencentcloud/data_source_tc_bi_user_project.go b/tencentcloud/data_source_tc_bi_user_project.go new file mode 100644 index 0000000000..55c32fa410 --- /dev/null +++ b/tencentcloud/data_source_tc_bi_user_project.go @@ -0,0 +1,245 @@ +/* +Use this data source to query detailed information of bi user_project + +Example Usage + +```hcl +data "tencentcloud_bi_user_project" "user_project" { + project_id = 123 + all_page = true +} +``` +*/ +package tencentcloud + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bi "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func dataSourceTencentCloudBiUserProject() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudBiUserProjectRead, + Schema: map[string]*schema.Schema{ + "project_id": { + Optional: true, + Type: schema.TypeInt, + Description: "Project id.", + }, + + "all_page": { + Optional: true, + Type: schema.TypeBool, + Description: "Whether to display all, if true, ignore paging.", + }, + + "list": { + Type: schema.TypeList, + Computed: true, + Description: "Array(Note: This field may return null, indicating that no valid value can be obtained).", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "user_id": { + Type: schema.TypeString, + Computed: true, + Description: "User id.", + }, + "user_name": { + Type: schema.TypeString, + Computed: true, + Description: "Username.", + }, + "corp_id": { + Type: schema.TypeString, + Computed: true, + Description: "Enterprise id(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "email": { + Type: schema.TypeString, + Computed: true, + Description: "E-mail(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "last_login": { + Type: schema.TypeString, + Computed: true, + Description: "Last login time, public cloud unrelated fields(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "status": { + Type: schema.TypeInt, + Computed: true, + Description: "Disabled state(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "first_modify": { + Type: schema.TypeInt, + Computed: true, + Description: "First login to change password, public cloud unrelated fields(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "phone_number": { + Type: schema.TypeString, + Computed: true, + Description: "Phone number(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "area_code": { + Type: schema.TypeString, + Computed: true, + Description: "Mobile area code(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "created_user": { + Type: schema.TypeString, + Computed: true, + Description: "Created by(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "created_at": { + Type: schema.TypeString, + Computed: true, + Description: "Created at(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "updated_user": { + Type: schema.TypeString, + Computed: true, + Description: "Updated by(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "updated_at": { + Type: schema.TypeString, + Computed: true, + Description: "Updated at(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "global_user_name": { + Type: schema.TypeString, + Computed: true, + Description: "Global role name(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "mobile": { + Type: schema.TypeString, + Computed: true, + Description: "Mobile number, public cloud unrelated fields(Note: This field may return null, indicating that no valid value can be obtained).", + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudBiUserProjectRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("data_source.tencentcloud_bi_user_project.read")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOkExists("project_id"); ok { + paramMap["ProjectId"] = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("all_page"); ok { + paramMap["AllPage"] = helper.Bool(v.(bool)) + } + + service := BiService{client: meta.(*TencentCloudClient).apiV3Conn} + + var data []*bi.UserIdAndUserName + err := resource.Retry(readRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeBiUserProjectByFilter(ctx, paramMap) + if e != nil { + return retryError(e) + } + data = result + return nil + }) + if err != nil { + return err + } + + ids := make([]string, 0, len(data)) + dataList := []interface{}{} + if data != nil { + for _, list := range data { + listMap := map[string]interface{}{} + + if list.UserId != nil { + listMap["user_id"] = list.UserId + } + + if list.UserName != nil { + listMap["user_name"] = list.UserName + } + + if list.CorpId != nil { + listMap["corp_id"] = list.CorpId + } + + if list.Email != nil { + listMap["email"] = list.Email + } + + if list.LastLogin != nil { + listMap["last_login"] = list.LastLogin + } + + if list.Status != nil { + listMap["status"] = list.Status + } + + if list.FirstModify != nil { + listMap["first_modify"] = list.FirstModify + } + + if list.PhoneNumber != nil { + listMap["phone_number"] = list.PhoneNumber + } + + if list.AreaCode != nil { + listMap["area_code"] = list.AreaCode + } + + if list.CreatedUser != nil { + listMap["created_user"] = list.CreatedUser + } + + if list.CreatedAt != nil { + listMap["created_at"] = list.CreatedAt + } + + if list.UpdatedUser != nil { + listMap["updated_user"] = list.UpdatedUser + } + + if list.UpdatedAt != nil { + listMap["updated_at"] = list.UpdatedAt + } + + if list.GlobalUserName != nil { + listMap["global_user_name"] = list.GlobalUserName + } + + if list.Mobile != nil { + listMap["mobile"] = list.Mobile + } + + dataList = append(dataList, listMap) + } + _ = d.Set("list", dataList) + } + + d.SetId(helper.DataResourceIdsHash(ids)) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := writeToFile(output.(string), dataList); e != nil { + return e + } + } + return nil +} diff --git a/tencentcloud/data_source_tc_bi_user_project_test.go b/tencentcloud/data_source_tc_bi_user_project_test.go new file mode 100644 index 0000000000..307e71b80c --- /dev/null +++ b/tencentcloud/data_source_tc_bi_user_project_test.go @@ -0,0 +1,48 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +// go test -test.run TestAccTencentCloudBiUserProjectDataSource_basic -v +func TestAccTencentCloudBiUserProjectDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBiUserProjectDataSource, + Check: resource.ComposeTestCheckFunc( + testAccCheckTencentCloudDataSourceID("data.tencentcloud_bi_user_project.user_project"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.#"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.0.area_code"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.0.corp_id"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.0.created_at"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.0.created_user"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.0.first_modify"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.0.global_user_name"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.0.phone_number"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.0.status"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.0.updated_at"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.0.updated_user"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.0.user_id"), + resource.TestCheckResourceAttrSet("data.tencentcloud_bi_user_project.user_project", "list.0.user_name"), + ), + }, + }, + }) +} + +const testAccBiUserProjectDataSource = ` + +data "tencentcloud_bi_user_project" "user_project" { + project_id = 11015030 + all_page = true +} + +` diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index dc9f01745c..03e9081fc2 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -1898,6 +1898,20 @@ Cwp Resource tencentcloud_cwp_license_order tencentcloud_cwp_license_bind_attachment + +Business Intelligence(BI) + Data Source + tencentcloud_bi_project + tencentcloud_bi_user_project + + Resource + tencentcloud_bi_project + tencentcloud_bi_user_role + tencentcloud_bi_project_user_role + tencentcloud_bi_datasource + tencentcloud_bi_datasource_cloud + tencentcloud_bi_embed_token_apply + tencentcloud_bi_embed_interval_apply */ package tencentcloud @@ -2681,6 +2695,8 @@ func Provider() *schema.Provider { "tencentcloud_dlc_describe_user_type": dataSourceTencentCloudDlcDescribeUserType(), "tencentcloud_dlc_describe_user_info": dataSourceTencentCloudDlcDescribeUserInfo(), "tencentcloud_dlc_describe_user_roles": dataSourceTencentCloudDlcDescribeUserRoles(), + "tencentcloud_bi_project": dataSourceTencentCloudBiProject(), + "tencentcloud_bi_user_project": dataSourceTencentCloudBiUserProject(), }, ResourcesMap: map[string]*schema.Resource{ @@ -3522,6 +3538,13 @@ func Provider() *schema.Provider { "tencentcloud_ssl_update_certificate_record_retry_operation": resourceTencentCloudSslUpdateCertificateRecordRetryOperation(), "tencentcloud_ssl_update_certificate_record_rollback_operation": resourceTencentCloudSslUpdateCertificateRecordRollbackOperation(), "tencentcloud_ssl_upload_revoke_letter_operation": resourceTencentCloudSslUploadRevokeLetterOperation(), + "tencentcloud_bi_project": resourceTencentCloudBiProject(), + "tencentcloud_bi_user_role": resourceTencentCloudBiUserRole(), + "tencentcloud_bi_project_user_role": resourceTencentCloudBiProjectUserRole(), + "tencentcloud_bi_datasource": resourceTencentCloudBiDatasource(), + "tencentcloud_bi_datasource_cloud": resourceTencentCloudBiDatasourceCloud(), + "tencentcloud_bi_embed_token_apply": resourceTencentCloudBiEmbedTokenApply(), + "tencentcloud_bi_embed_interval_apply": resourceTencentCloudBiEmbedIntervalApply(), }, ConfigureFunc: providerConfigure, diff --git a/tencentcloud/resource_tc_bi_datasource.go b/tencentcloud/resource_tc_bi_datasource.go new file mode 100644 index 0000000000..f89a45dabe --- /dev/null +++ b/tencentcloud/resource_tc_bi_datasource.go @@ -0,0 +1,473 @@ +/* +Provides a resource to create a bi datasource + +Example Usage + +```hcl +resource "tencentcloud_bi_datasource" "datasource" { + charset = "utf8" + db_host = "bj-cdb-1lxqg5r6.sql.tencentcdb.com" + db_name = "tf-test" + db_port = 63694 + db_type = "MYSQL" + db_pwd = "ABc123,,," + db_user = "root" + project_id = 11015030 + source_name = "tf-source-name" +} +``` + +Import + +bi datasource can be imported using the id, e.g. + +``` +terraform import tencentcloud_bi_datasource.datasource datasource_id +``` +*/ +package tencentcloud + +import ( + "context" + "fmt" + "log" + "strconv" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bi "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func resourceTencentCloudBiDatasource() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBiDatasourceCreate, + Read: resourceTencentCloudBiDatasourceRead, + Update: resourceTencentCloudBiDatasourceUpdate, + Delete: resourceTencentCloudBiDatasourceDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "db_host": { + Required: true, + Type: schema.TypeString, + Description: "Host.", + }, + + "db_port": { + Required: true, + Type: schema.TypeInt, + Description: "Port.", + }, + + "db_type": { + Required: true, + Type: schema.TypeString, + Description: "`MYSQL`, `MSSQL`, `POSTGRE`, `ORACLE`, `CLICKHOUSE`, `TIDB`, `HIVE`, `PRESTO`.", + }, + + "charset": { + Required: true, + Type: schema.TypeString, + Description: "Charset.", + }, + + "db_user": { + Required: true, + Type: schema.TypeString, + Description: "User name.", + }, + + "db_pwd": { + Required: true, + Sensitive: true, + Type: schema.TypeString, + Description: "Password.", + }, + + "db_name": { + Required: true, + Type: schema.TypeString, + Description: "Database name.", + }, + + "source_name": { + Required: true, + Type: schema.TypeString, + Description: "Datasource name in BI.", + }, + + "project_id": { + Required: true, + Type: schema.TypeInt, + Description: "Project id.", + }, + + "service_type": { + Optional: true, + Default: "{\"Type\":\"Own\"}", + Type: schema.TypeString, + Description: "Own or Cloud, default: `Own`.", + }, + + "catalog": { + Optional: true, + Type: schema.TypeString, + Description: "Catalog.", + }, + + "data_origin": { + Optional: true, + Type: schema.TypeString, + Description: "Third-party datasource identification, this parameter can be ignored.", + }, + + "data_origin_project_id": { + Optional: true, + Type: schema.TypeString, + Description: "Third-party datasource project id, this parameter can be ignored.", + }, + + "data_origin_datasource_id": { + Optional: true, + Type: schema.TypeString, + Description: "Third-party datasource project id, this parameter can be ignored.", + }, + + "uniq_vpc_id": { + Optional: true, + Type: schema.TypeString, + Description: "Tencent cloud private network unified identity.", + }, + + "vpc_id": { + Optional: true, + Type: schema.TypeString, + Description: "Tencent cloud private network identity.", + }, + }, + } +} + +func resourceTencentCloudBiDatasourceCreate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_datasource.create")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + var ( + request = bi.NewCreateDatasourceRequest() + response = bi.NewCreateDatasourceResponse() + projectId int + id int64 + ) + if v, ok := d.GetOk("db_host"); ok { + request.DbHost = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("db_port"); ok { + request.DbPort = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("service_type"); ok { + request.ServiceType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_type"); ok { + request.DbType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("charset"); ok { + request.Charset = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_user"); ok { + request.DbUser = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_pwd"); ok { + request.DbPwd = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_name"); ok { + request.DbName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("source_name"); ok { + request.SourceName = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("project_id"); ok { + projectId = v.(int) + request.ProjectId = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("catalog"); ok { + request.Catalog = helper.String(v.(string)) + } + + if v, ok := d.GetOk("data_origin"); ok { + request.DataOrigin = helper.String(v.(string)) + } + + if v, ok := d.GetOk("data_origin_project_id"); ok { + request.DataOriginProjectId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("data_origin_datasource_id"); ok { + request.DataOriginDatasourceId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("uniq_vpc_id"); ok { + request.UniqVpcId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("vpc_id"); ok { + request.VpcId = helper.String(v.(string)) + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseBiClient().CreateDatasource(request) + if e != nil { + return retryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + response = result + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s create bi datasource failed, reason:%+v", logId, err) + return err + } + + id = *response.Response.Data.Id + d.SetId(strings.Join([]string{helper.Int64ToStr(int64(projectId)), helper.Int64ToStr(id)}, FILED_SP)) + + return resourceTencentCloudBiDatasourceRead(d, meta) +} + +func resourceTencentCloudBiDatasourceRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_datasource.read")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := BiService{client: meta.(*TencentCloudClient).apiV3Conn} + + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + projectId := idSplit[0] + projectIdInt, _ := strconv.ParseInt(projectId, 10, 64) + id := idSplit[1] + idInt, _ := strconv.ParseInt(id, 10, 64) + + datasource, err := service.DescribeBiDatasourceById(ctx, uint64(projectIdInt), uint64(idInt)) + if err != nil { + return err + } + + if datasource == nil { + d.SetId("") + log.Printf("[WARN]%s resource `BiDatasource` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + return nil + } + + if datasource.DbHost != nil { + _ = d.Set("db_host", datasource.DbHost) + } + + if datasource.DbPort != nil { + _ = d.Set("db_port", datasource.DbPort) + } + + if datasource.ServiceType != nil { + _ = d.Set("service_type", datasource.ServiceType) + } + + if datasource.DbType != nil { + _ = d.Set("db_type", datasource.DbType) + } + + if datasource.Charset != nil { + _ = d.Set("charset", datasource.Charset) + } + + if datasource.DbUser != nil { + _ = d.Set("db_user", datasource.DbUser) + } + + // if datasource.DbPwd != nil { + // _ = d.Set("db_pwd", datasource.DbPwd) + // } + + if datasource.DbName != nil { + _ = d.Set("db_name", datasource.DbName) + } + + if datasource.SourceName != nil { + _ = d.Set("source_name", datasource.SourceName) + } + + if datasource.ProjectId != nil { + projectIdInt, err := strconv.ParseInt(*datasource.ProjectId, 10, 64) + if err != nil { + return err + } + _ = d.Set("project_id", projectIdInt) + } + + if datasource.Catalog != nil { + _ = d.Set("catalog", datasource.Catalog) + } + + if datasource.DataOrigin != nil { + _ = d.Set("data_origin", datasource.DataOrigin) + } + + if datasource.DataOriginProjectId != nil { + _ = d.Set("data_origin_project_id", datasource.DataOriginProjectId) + } + + if datasource.DataOriginDatasourceId != nil { + _ = d.Set("data_origin_datasource_id", datasource.DataOriginDatasourceId) + } + + if datasource.UniqVpcId != nil { + _ = d.Set("uniq_vpc_id", datasource.UniqVpcId) + } + + if datasource.VpcId != nil { + _ = d.Set("vpc_id", datasource.VpcId) + } + + return nil +} + +func resourceTencentCloudBiDatasourceUpdate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_datasource.update")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + request := bi.NewModifyDatasourceRequest() + + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + projectId := idSplit[0] + projectIdInt, _ := strconv.ParseInt(projectId, 10, 64) + id := idSplit[1] + idInt, _ := strconv.ParseInt(id, 10, 64) + idUint := uint64(projectIdInt) + + request.ProjectId = &idUint + request.Id = &idInt + + if v, ok := d.GetOk("db_host"); ok { + request.DbHost = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("db_port"); ok { + request.DbPort = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("service_type"); ok { + request.ServiceType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_type"); ok { + request.DbType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("charset"); ok { + request.Charset = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_user"); ok { + request.DbUser = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_pwd"); ok { + request.DbPwd = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_name"); ok { + request.DbName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("source_name"); ok { + request.SourceName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("catalog"); ok { + request.Catalog = helper.String(v.(string)) + } + + if v, ok := d.GetOk("data_origin"); ok { + request.DataOrigin = helper.String(v.(string)) + } + + if v, ok := d.GetOk("data_origin_project_id"); ok { + request.DataOriginProjectId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("data_origin_datasource_id"); ok { + request.DataOriginDatasourceId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("uniq_vpc_id"); ok { + request.UniqVpcId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("vpc_id"); ok { + request.VpcId = helper.String(v.(string)) + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseBiClient().ModifyDatasource(request) + if e != nil { + return retryError(e) + } 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 bi datasource failed, reason:%+v", logId, err) + return err + } + + return resourceTencentCloudBiDatasourceRead(d, meta) +} + +func resourceTencentCloudBiDatasourceDelete(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_datasource.delete")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := BiService{client: meta.(*TencentCloudClient).apiV3Conn} + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + projectId := idSplit[0] + projectIdInt, _ := strconv.ParseInt(projectId, 10, 64) + id := idSplit[1] + idInt, _ := strconv.ParseInt(id, 10, 64) + + if err := service.DeleteBiDatasourceById(ctx, uint64(projectIdInt), uint64(idInt)); err != nil { + return err + } + + return nil +} diff --git a/tencentcloud/resource_tc_bi_datasource_cloud.go b/tencentcloud/resource_tc_bi_datasource_cloud.go new file mode 100644 index 0000000000..387f79043a --- /dev/null +++ b/tencentcloud/resource_tc_bi_datasource_cloud.go @@ -0,0 +1,523 @@ +/* +Provides a resource to create a bi datasource_cloud + +Example Usage + +```hcl +resource "tencentcloud_bi_datasource_cloud" "datasource_cloud" { + charset = "utf8" + db_name = "bi_dev" + db_type = "MYSQL" + db_user = "root" + project_id = "11015056" + db_pwd = "xxxxxx" + service_type { + instance_id = "cdb-12viotu5" + region = "ap-guangzhou" + type = "Cloud" + } + source_name = "tf-test1" + vip = "10.0.0.4" + vport = "3306" + region_id = "gz" + vpc_id = 5292713 +} +``` +*/ +package tencentcloud + +import ( + "context" + "fmt" + "log" + "strconv" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bi "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func resourceTencentCloudBiDatasourceCloud() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBiDatasourceCloudCreate, + Read: resourceTencentCloudBiDatasourceCloudRead, + Update: resourceTencentCloudBiDatasourceCloudUpdate, + Delete: resourceTencentCloudBiDatasourceCloudDelete, + + Schema: map[string]*schema.Schema{ + "service_type": { + Required: true, + Type: schema.TypeList, + MaxItems: 1, + Description: "Service type, Own or Cloud.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Required: true, + Description: "Service type, Cloud.", + }, + "instance_id": { + Type: schema.TypeString, + Required: true, + Description: "Instance Id.", + }, + "region": { + Type: schema.TypeString, + Required: true, + Description: "Region.", + }, + }, + }, + }, + + "db_type": { + Required: true, + Type: schema.TypeString, + Description: "`MYSQL`, `TDSQL-C_MYSQL`, `TDSQL_MYSQL`, `MSSQL`, `POSTGRESQL`, `MARIADB`.", + }, + + "charset": { + Required: true, + Type: schema.TypeString, + Description: "Charset.", + }, + + "db_user": { + Required: true, + Type: schema.TypeString, + Description: "User name.", + }, + + "db_pwd": { + Required: true, + Sensitive: true, + Type: schema.TypeString, + Description: "Password.", + }, + + "db_name": { + Required: true, + Type: schema.TypeString, + Description: "Database name.", + }, + + "source_name": { + Required: true, + Type: schema.TypeString, + Description: "Datasource name in BI.", + }, + + "project_id": { + Required: true, + Type: schema.TypeString, + Description: "Project id.", + }, + + "vip": { + Optional: true, + Type: schema.TypeString, + Description: "Public cloud intranet ip.", + }, + + "vport": { + Optional: true, + Type: schema.TypeString, + Description: "Public cloud intranet port.", + }, + + "vpc_id": { + Required: true, + Type: schema.TypeString, + Description: "Vpc identification.", + }, + + "uniq_vpc_id": { + Optional: true, + Type: schema.TypeString, + Description: "Unified vpc identification.", + }, + + "region_id": { + Optional: true, + Type: schema.TypeString, + Description: "Region identifier.", + }, + + "extra_param": { + Optional: true, + Computed: true, + Type: schema.TypeString, + Description: "Extended parameters.", + }, + + "data_origin": { + Optional: true, + Type: schema.TypeString, + Description: "Third-party datasource identification, this parameter can be ignored.", + }, + + "data_origin_project_id": { + Optional: true, + Type: schema.TypeString, + Description: "Third-party datasource project id, this parameter can be ignored.", + }, + + "data_origin_datasource_id": { + Optional: true, + Type: schema.TypeString, + Description: "Third-party datasource project id, this parameter can be ignored.", + }, + }, + } +} + +func resourceTencentCloudBiDatasourceCloudCreate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_datasource_cloud.create")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + var ( + request = bi.NewCreateDatasourceCloudRequest() + response = bi.NewCreateDatasourceCloudResponse() + projectId string + id int64 + ) + + if dMap, ok := helper.InterfacesHeadMap(d, "service_type"); ok { + v, o := helper.MapToString(dMap) + if !o { + return fmt.Errorf("ServiceType `%s` format error", dMap) + } + request.ServiceType = &v + } + + if v, ok := d.GetOk("db_type"); ok { + request.DbType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("charset"); ok { + request.Charset = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_user"); ok { + request.DbUser = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_pwd"); ok { + request.DbPwd = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_name"); ok { + request.DbName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("source_name"); ok { + request.SourceName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("project_id"); ok { + projectId = v.(string) + request.ProjectId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("vip"); ok { + request.Vip = helper.String(v.(string)) + } + + if v, ok := d.GetOk("vport"); ok { + request.Vport = helper.String(v.(string)) + } + + if v, ok := d.GetOk("vpc_id"); ok { + request.VpcId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("uniq_vpc_id"); ok { + request.UniqVpcId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("region_id"); ok { + request.RegionId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("extra_param"); ok { + request.ExtraParam = helper.String(v.(string)) + } + + if v, ok := d.GetOk("data_origin"); ok { + request.DataOrigin = helper.String(v.(string)) + } + + if v, ok := d.GetOk("data_origin_project_id"); ok { + request.DataOriginProjectId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("data_origin_datasource_id"); ok { + request.DataOriginDatasourceId = helper.String(v.(string)) + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseBiClient().CreateDatasourceCloud(request) + if e != nil { + return retryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + response = result + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s create bi datasourceCloud failed, reason:%+v", logId, err) + return err + } + + id = *response.Response.Data.Id + d.SetId(strings.Join([]string{projectId, strconv.FormatInt(id, 10)}, FILED_SP)) + + return resourceTencentCloudBiDatasourceCloudRead(d, meta) +} + +func resourceTencentCloudBiDatasourceCloudRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_datasource_cloud.read")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := BiService{client: meta.(*TencentCloudClient).apiV3Conn} + + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + projectId := idSplit[0] + projectIdInt, _ := strconv.ParseInt(projectId, 10, 64) + id := idSplit[1] + idInt, _ := strconv.ParseInt(id, 10, 64) + + datasourceCloud, err := service.DescribeBiDatasourceCloudById(ctx, uint64(projectIdInt), uint64(idInt)) + if err != nil { + return err + } + + if datasourceCloud == nil { + d.SetId("") + log.Printf("[WARN]%s resource `BiDatasourceCloud` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + return nil + } + + if datasourceCloud.ServiceType != nil { + v, err := helper.JsonToMap(*datasourceCloud.ServiceType) + if err != nil { + return fmt.Errorf("ServiceType `%v` format error", *datasourceCloud.ServiceType) + } + + _ = d.Set("service_type", []interface{}{v}) + } + + if datasourceCloud.DbType != nil { + _ = d.Set("db_type", datasourceCloud.DbType) + } + + if datasourceCloud.Charset != nil { + _ = d.Set("charset", datasourceCloud.Charset) + } + + if datasourceCloud.DbUser != nil { + _ = d.Set("db_user", datasourceCloud.DbUser) + } + + if datasourceCloud.DbName != nil { + _ = d.Set("db_name", datasourceCloud.DbName) + } + + if datasourceCloud.SourceName != nil { + _ = d.Set("source_name", datasourceCloud.SourceName) + } + + if datasourceCloud.ProjectId != nil { + _ = d.Set("project_id", datasourceCloud.ProjectId) + } + + // if datasourceCloud.Vip != nil { + // _ = d.Set("vip", datasourceCloud.Vip) + // } + + // if datasourceCloud.Vport != nil { + // _ = d.Set("vport", datasourceCloud.Vport) + // } + + if datasourceCloud.VpcId != nil { + _ = d.Set("vpc_id", datasourceCloud.VpcId) + } + + if datasourceCloud.UniqVpcId != nil { + _ = d.Set("uniq_vpc_id", datasourceCloud.UniqVpcId) + } + + if datasourceCloud.RegionId != nil { + _ = d.Set("region_id", datasourceCloud.RegionId) + } + + if datasourceCloud.ExtraParam != nil { + _ = d.Set("extra_param", datasourceCloud.ExtraParam) + } + + if datasourceCloud.DataOrigin != nil { + _ = d.Set("data_origin", datasourceCloud.DataOrigin) + } + + if datasourceCloud.DataOriginProjectId != nil { + _ = d.Set("data_origin_project_id", datasourceCloud.DataOriginProjectId) + } + + if datasourceCloud.DataOriginDatasourceId != nil { + _ = d.Set("data_origin_datasource_id", datasourceCloud.DataOriginDatasourceId) + } + + return nil +} + +func resourceTencentCloudBiDatasourceCloudUpdate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_datasource_cloud.update")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + request := bi.NewModifyDatasourceCloudRequest() + + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + projectId := idSplit[0] + id := idSplit[1] + idInt, _ := strconv.ParseInt(id, 10, 64) + idUint64 := uint64(idInt) + + request.Id = &idUint64 + request.ProjectId = &projectId + + if dMap, ok := helper.InterfacesHeadMap(d, "service_type"); ok { + v, o := helper.MapToString(dMap) + if !o { + return fmt.Errorf("ServiceType `%s` format error", dMap) + } + request.ServiceType = &v + } + + if v, ok := d.GetOk("db_type"); ok { + request.DbType = helper.String(v.(string)) + } + + if v, ok := d.GetOk("charset"); ok { + request.Charset = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_user"); ok { + request.DbUser = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_pwd"); ok { + request.DbPwd = helper.String(v.(string)) + } + + if v, ok := d.GetOk("db_name"); ok { + request.DbName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("source_name"); ok { + request.SourceName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("vip"); ok { + request.Vip = helper.String(v.(string)) + } + + if v, ok := d.GetOk("vport"); ok { + request.Vport = helper.String(v.(string)) + } + + if v, ok := d.GetOk("region_id"); ok { + request.RegionId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("vpc_id"); ok { + request.VpcId = helper.String(v.(string)) + } + + if d.HasChange("uniq_vpc_id") { + if v, ok := d.GetOk("uniq_vpc_id"); ok { + request.UniqVpcId = helper.String(v.(string)) + } + } + + if d.HasChange("extra_param") { + if v, ok := d.GetOk("extra_param"); ok { + request.ExtraParam = helper.String(v.(string)) + } + } + + if d.HasChange("data_origin") { + if v, ok := d.GetOk("data_origin"); ok { + request.DataOrigin = helper.String(v.(string)) + } + } + + if d.HasChange("data_origin_project_id") { + if v, ok := d.GetOk("data_origin_project_id"); ok { + request.DataOriginProjectId = helper.String(v.(string)) + } + } + + if d.HasChange("data_origin_datasource_id") { + if v, ok := d.GetOk("data_origin_datasource_id"); ok { + request.DataOriginDatasourceId = helper.String(v.(string)) + } + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseBiClient().ModifyDatasourceCloud(request) + if e != nil { + return retryError(e) + } 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 bi datasourceCloud failed, reason:%+v", logId, err) + return err + } + + return resourceTencentCloudBiDatasourceCloudRead(d, meta) +} + +func resourceTencentCloudBiDatasourceCloudDelete(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_datasource_cloud.delete")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := BiService{client: meta.(*TencentCloudClient).apiV3Conn} + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + projectId := idSplit[0] + projectIdInt, _ := strconv.ParseInt(projectId, 10, 64) + id := idSplit[1] + idInt, _ := strconv.ParseInt(id, 10, 64) + + if err := service.DeleteBiDatasourceCloudById(ctx, uint64(projectIdInt), uint64(idInt)); err != nil { + return err + } + + return nil +} diff --git a/tencentcloud/resource_tc_bi_datasource_cloud_test.go b/tencentcloud/resource_tc_bi_datasource_cloud_test.go new file mode 100644 index 0000000000..254e99b7c5 --- /dev/null +++ b/tencentcloud/resource_tc_bi_datasource_cloud_test.go @@ -0,0 +1,47 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccTencentCloudNeedFixBiDatasourceCloudResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBiDatasourceCloud, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bi_datasource_cloud.datasource_cloud", "id"), + ), + }, + }, + }) +} + +const testAccBiDatasourceCloud = ` + +resource "tencentcloud_bi_datasource_cloud" "datasource_cloud" { + charset = "utf8" + db_name = "bi_dev" + db_type = "MYSQL" + db_user = "root" + project_id = "11015056" + db_pwd = "xxxxxx" + service_type { + instance_id = "cdb-12viotu5" + region = "ap-guangzhou" + type = "Cloud" + } + source_name = "tf-test1" + vip = "10.0.0.4" + vport = "3306" + region_id = "gz" + vpc_id = 5292713 +} +` diff --git a/tencentcloud/resource_tc_bi_datasource_test.go b/tencentcloud/resource_tc_bi_datasource_test.go new file mode 100644 index 0000000000..c919c273d6 --- /dev/null +++ b/tencentcloud/resource_tc_bi_datasource_test.go @@ -0,0 +1,56 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccTencentCloudNeedFixBiDatasourceResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBiDatasource, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bi_datasource.datasource", "id"), + resource.TestCheckResourceAttr("tencentcloud_bi_datasource.datasource", "charset", "utf8"), + resource.TestCheckResourceAttr("tencentcloud_bi_datasource.datasource", "db_host", "bj-cdb-1lxqg5r6.sql.tencentcdb.com"), + resource.TestCheckResourceAttr("tencentcloud_bi_datasource.datasource", "db_name", "tf-test"), + resource.TestCheckResourceAttr("tencentcloud_bi_datasource.datasource", "db_port", "63694"), + resource.TestCheckResourceAttr("tencentcloud_bi_datasource.datasource", "db_type", "MYSQL"), + resource.TestCheckResourceAttr("tencentcloud_bi_datasource.datasource", "db_pwd", "ABc123,,,"), + resource.TestCheckResourceAttr("tencentcloud_bi_datasource.datasource", "db_user", "root"), + resource.TestCheckResourceAttr("tencentcloud_bi_datasource.datasource", "project_id", "11015030"), + resource.TestCheckResourceAttr("tencentcloud_bi_datasource.datasource", "source_name", "tf-source-name"), + ), + }, + { + ResourceName: "tencentcloud_bi_datasource.datasource", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"db_pwd"}, + }, + }, + }) +} + +const testAccBiDatasource = ` + +resource "tencentcloud_bi_datasource" "datasource" { + charset = "utf8" + db_host = "bj-cdb-1lxqg5r6.sql.tencentcdb.com" + db_name = "tf-test" + db_port = 63694 + db_type = "MYSQL" + db_pwd = "ABc123,,," + db_user = "root" + project_id = 11015030 + source_name = "tf-source-name" +} + +` diff --git a/tencentcloud/resource_tc_bi_embed_interval_apply.go b/tencentcloud/resource_tc_bi_embed_interval_apply.go new file mode 100644 index 0000000000..9b61543c3a --- /dev/null +++ b/tencentcloud/resource_tc_bi_embed_interval_apply.go @@ -0,0 +1,129 @@ +/* +Provides a resource to create a bi embed_interval + +Example Usage + +```hcl +resource "tencentcloud_bi_embed_interval_apply" "embed_interval" { + project_id = 11015030 + page_id = 10520483 + bi_token = "4192d65b-d674-4117-9a59-xxxxxxxxx" + scope = "page" +} +``` +*/ +package tencentcloud + +import ( + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bi "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func resourceTencentCloudBiEmbedIntervalApply() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBiEmbedIntervalApplyCreate, + Read: resourceTencentCloudBiEmbedIntervalApplyRead, + Delete: resourceTencentCloudBiEmbedIntervalApplyDelete, + + Schema: map[string]*schema.Schema{ + "project_id": { + Optional: true, + ForceNew: true, + Type: schema.TypeInt, + Description: "Sharing project id, required.", + }, + + "page_id": { + Optional: true, + ForceNew: true, + Type: schema.TypeInt, + Description: "Sharing page id, this is empty value 0 when embedding the board.", + }, + + "bi_token": { + Optional: true, + ForceNew: true, + Type: schema.TypeString, + Description: "Token that needs to be applied for extension.", + }, + + "scope": { + Optional: true, + ForceNew: true, + Type: schema.TypeString, + Description: "Choose panel or page.", + }, + }, + } +} + +func resourceTencentCloudBiEmbedIntervalApplyCreate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_embed_interval_apply.create")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + var ( + request = bi.NewApplyEmbedIntervalRequest() + response = bi.NewApplyEmbedIntervalResponse() + biToken string + ) + if v, ok := d.GetOkExists("project_id"); ok { + request.ProjectId = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOkExists("page_id"); ok { + request.PageId = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("bi_token"); ok { + biToken = v.(string) + request.BIToken = helper.String(v.(string)) + } + + if v, ok := d.GetOk("scope"); ok { + request.Scope = helper.String(v.(string)) + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseBiClient().ApplyEmbedInterval(request) + if e != nil { + return retryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + response = result + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s operate bi embedInterval failed, reason:%+v", logId, err) + return err + } + + if !*response.Response.Data.Result { + return fmt.Errorf("There was an error in token application, err: %v", response.Response.Msg) + } + + d.SetId(biToken) + + return resourceTencentCloudBiEmbedIntervalApplyRead(d, meta) +} + +func resourceTencentCloudBiEmbedIntervalApplyRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_embed_interval_apply.read")() + defer inconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudBiEmbedIntervalApplyDelete(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_embed_interval_apply.delete")() + defer inconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/resource_tc_bi_embed_interval_apply_test.go b/tencentcloud/resource_tc_bi_embed_interval_apply_test.go new file mode 100644 index 0000000000..7dca9a5989 --- /dev/null +++ b/tencentcloud/resource_tc_bi_embed_interval_apply_test.go @@ -0,0 +1,34 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccTencentCloudNeedFixBiEmbedIntervalApplyResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBiEmbedInterval, + Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_bi_embed_interval_apply.embed_interval", "id")), + }, + }, + }) +} + +const testAccBiEmbedInterval = testAccBiEmbedToken + ` + +resource "tencentcloud_bi_embed_interval_apply" "embed_interval" { + project_id = 11015030 + page_id = 10520483 + bi_token = tencentcloud_bi_embed_token_apply.embed_token.bi_token + scope = "page" +} + +` diff --git a/tencentcloud/resource_tc_bi_embed_token_apply.go b/tencentcloud/resource_tc_bi_embed_token_apply.go new file mode 100644 index 0000000000..dab8697cfd --- /dev/null +++ b/tencentcloud/resource_tc_bi_embed_token_apply.go @@ -0,0 +1,181 @@ +/* +Provides a resource to create a bi embed_token + +Example Usage + +```hcl +resource "tencentcloud_bi_embed_token_apply" "embed_token" { + project_id = 11015030 + page_id = 10520483 + scope = "page" + expire_time = "240" + user_corp_id = "100022975249" + user_id = "100024664626" +} +``` +*/ +package tencentcloud + +import ( + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bi "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func resourceTencentCloudBiEmbedTokenApply() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBiEmbedTokenApplyCreate, + Read: resourceTencentCloudBiEmbedTokenApplyRead, + Delete: resourceTencentCloudBiEmbedTokenApplyDelete, + + Schema: map[string]*schema.Schema{ + "project_id": { + Optional: true, + ForceNew: true, + Type: schema.TypeInt, + Description: "Share project id.", + }, + + "page_id": { + Optional: true, + ForceNew: true, + Type: schema.TypeInt, + Description: "Sharing page id, this is empty value 0 when embedding the board.", + }, + + "scope": { + Optional: true, + ForceNew: true, + Type: schema.TypeString, + Description: "Page means embedding the page, and panel means embedding the entire board.", + }, + + "expire_time": { + Optional: true, + ForceNew: true, + Type: schema.TypeString, + Description: "Expiration. Unit: Minutes Maximum value: 240. i.e. 4 hours Default: 240.", + }, + + "user_corp_id": { + Optional: true, + ForceNew: true, + Type: schema.TypeString, + Description: "User enterprise ID (for multi-user only).", + }, + + "user_id": { + Optional: true, + ForceNew: true, + Type: schema.TypeString, + Description: "UserId (for multi-user only).", + }, + + "bi_token": { + Computed: true, + Type: schema.TypeString, + Description: "Create the generated token.", + }, + + "create_at": { + Computed: true, + Type: schema.TypeString, + Description: "Create time.", + }, + + "udpate_at": { + Computed: true, + Type: schema.TypeString, + Description: "Upadte time.", + }, + }, + } +} + +func resourceTencentCloudBiEmbedTokenApplyCreate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_embed_token_apply.create")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + var ( + request = bi.NewCreateEmbedTokenRequest() + response = bi.NewCreateEmbedTokenResponse() + pageId int + ) + if v, ok := d.GetOkExists("project_id"); ok { + request.ProjectId = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOkExists("page_id"); ok { + pageId = v.(int) + request.PageId = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("scope"); ok { + request.Scope = helper.String(v.(string)) + } + + if v, ok := d.GetOk("expire_time"); ok { + request.ExpireTime = helper.String(v.(string)) + } + + if v, ok := d.GetOk("user_corp_id"); ok { + request.UserCorpId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("user_id"); ok { + request.UserId = helper.String(v.(string)) + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseBiClient().CreateEmbedToken(request) + if e != nil { + return retryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + response = result + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s operate bi embedToken failed, reason:%+v", logId, err) + return err + } + + d.SetId(helper.Int64ToStr(int64(pageId))) + + if response.Response.Data != nil { + token := response.Response.Data + if token.BIToken != nil { + _ = d.Set("bi_token", token.BIToken) + } + + if token.CreatedAt != nil { + _ = d.Set("create_at", token.CreatedAt) + } + + if token.UpdatedAt != nil { + _ = d.Set("udpate_at", token.UpdatedAt) + } + } + + return resourceTencentCloudBiEmbedTokenApplyRead(d, meta) +} + +func resourceTencentCloudBiEmbedTokenApplyRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_embed_token_apply.read")() + defer inconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudBiEmbedTokenApplyDelete(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_embed_token_apply.delete")() + defer inconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/resource_tc_bi_embed_token_apply_test.go b/tencentcloud/resource_tc_bi_embed_token_apply_test.go new file mode 100644 index 0000000000..b39fc5ee52 --- /dev/null +++ b/tencentcloud/resource_tc_bi_embed_token_apply_test.go @@ -0,0 +1,36 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccTencentCloudNeedFixBiEmbedTokenApplyResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBiEmbedToken, + Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_bi_embed_token_apply.embed_token", "id")), + }, + }, + }) +} + +const testAccBiEmbedToken = ` + +resource "tencentcloud_bi_embed_token_apply" "embed_token" { + project_id = 11015030 + page_id = 10520483 + scope = "page" + expire_time = "240" + user_corp_id = "" + user_id = "" +} + +` diff --git a/tencentcloud/resource_tc_bi_project.go b/tencentcloud/resource_tc_bi_project.go new file mode 100644 index 0000000000..41982f48f1 --- /dev/null +++ b/tencentcloud/resource_tc_bi_project.go @@ -0,0 +1,231 @@ +/* +Provides a resource to create a bi project + +Example Usage + +```hcl +resource "tencentcloud_bi_project" "project" { + name = "terraform_test" + color_code = "#7BD936" + logo = "TF-test" + mark = "project mark" +} +``` + +Import + +bi project can be imported using the id, e.g. + +``` +terraform import tencentcloud_bi_project.project project_id +``` +*/ +package tencentcloud + +import ( + "context" + "log" + "strconv" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bi "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func resourceTencentCloudBiProject() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBiProjectCreate, + Read: resourceTencentCloudBiProjectRead, + Update: resourceTencentCloudBiProjectUpdate, + Delete: resourceTencentCloudBiProjectDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "name": { + Required: true, + Type: schema.TypeString, + Description: "Project name.", + }, + + "color_code": { + Required: true, + Type: schema.TypeString, + Description: "Logo background color.", + }, + + "logo": { + Optional: true, + Type: schema.TypeString, + Description: "Project logo.", + }, + + "mark": { + Optional: true, + Type: schema.TypeString, + Description: "Remark.", + }, + }, + } +} + +func resourceTencentCloudBiProjectCreate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_project.create")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + var ( + request = bi.NewCreateProjectRequest() + response = bi.NewCreateProjectResponse() + projectId int64 + ) + if v, ok := d.GetOk("name"); ok { + request.Name = helper.String(v.(string)) + } + + if v, ok := d.GetOk("color_code"); ok { + request.ColorCode = helper.String(v.(string)) + } + + if v, ok := d.GetOk("logo"); ok { + request.Logo = helper.String(v.(string)) + } + + if v, ok := d.GetOk("mark"); ok { + request.Mark = helper.String(v.(string)) + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseBiClient().CreateProject(request) + if e != nil { + return retryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + response = result + return nil + }) + if err != nil { + log.Printf("[CRITAL]%s create bi project failed, reason:%+v", logId, err) + return err + } + + projectId = *response.Response.Data.Id + d.SetId(strconv.FormatInt(projectId, 10)) + + return resourceTencentCloudBiProjectRead(d, meta) +} + +func resourceTencentCloudBiProjectRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_project.read")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := BiService{client: meta.(*TencentCloudClient).apiV3Conn} + + projectId := d.Id() + idint, _ := strconv.Atoi(projectId) + + project, err := service.DescribeBiProjectById(ctx, uint64(idint)) + if err != nil { + return err + } + + if project == nil { + d.SetId("") + log.Printf("[WARN]%s resource `BiProject` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + return nil + } + + if project.Name != nil { + _ = d.Set("name", project.Name) + } + + if project.ColorCode != nil { + _ = d.Set("color_code", project.ColorCode) + } + + if project.Logo != nil { + _ = d.Set("logo", project.Logo) + } + + if project.Mark != nil { + _ = d.Set("mark", project.Mark) + } + + return nil +} + +func resourceTencentCloudBiProjectUpdate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_project.update")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + request := bi.NewModifyProjectRequest() + + projectId := d.Id() + idint, _ := strconv.Atoi(projectId) + idUint64 := uint64(idint) + + request.Id = &idUint64 + + if v, ok := d.GetOk("name"); ok { + request.Name = helper.String(v.(string)) + } + + if v, ok := d.GetOk("color_code"); ok { + request.ColorCode = helper.String(v.(string)) + } + + if d.HasChange("logo") { + if v, ok := d.GetOk("logo"); ok { + request.Logo = helper.String(v.(string)) + } + } + + if d.HasChange("mark") { + if v, ok := d.GetOk("mark"); ok { + request.Mark = helper.String(v.(string)) + } + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseBiClient().ModifyProject(request) + if e != nil { + return retryError(e) + } 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 bi project failed, reason:%+v", logId, err) + return err + } + + return resourceTencentCloudBiProjectRead(d, meta) +} + +func resourceTencentCloudBiProjectDelete(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_project.delete")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := BiService{client: meta.(*TencentCloudClient).apiV3Conn} + projectId := d.Id() + idint, _ := strconv.Atoi(projectId) + + if err := service.DeleteBiProjectById(ctx, uint64(idint)); err != nil { + return err + } + + return nil +} diff --git a/tencentcloud/resource_tc_bi_project_test.go b/tencentcloud/resource_tc_bi_project_test.go new file mode 100644 index 0000000000..5f81322010 --- /dev/null +++ b/tencentcloud/resource_tc_bi_project_test.go @@ -0,0 +1,67 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +// go test -test.run TestAccTencentCloudBiProjectResource_basic -v +func TestAccTencentCloudBiProjectResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBiProject, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bi_project.project", "id"), + resource.TestCheckResourceAttr("tencentcloud_bi_project.project", "name", "terraform_test"), + resource.TestCheckResourceAttr("tencentcloud_bi_project.project", "color_code", "#7BD936"), + resource.TestCheckResourceAttr("tencentcloud_bi_project.project", "logo", "TF-test"), + resource.TestCheckResourceAttr("tencentcloud_bi_project.project", "mark", "project mark"), + ), + }, + { + ResourceName: "tencentcloud_bi_project.project", + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccBiProjectUp, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bi_project.project", "id"), + resource.TestCheckResourceAttr("tencentcloud_bi_project.project", "name", "terraform_test1"), + resource.TestCheckResourceAttr("tencentcloud_bi_project.project", "color_code", "#066EFF"), + resource.TestCheckResourceAttr("tencentcloud_bi_project.project", "logo", "TF-test1"), + resource.TestCheckResourceAttr("tencentcloud_bi_project.project", "mark", "project mark1"), + ), + }, + }, + }) +} + +const testAccBiProject = ` + +resource "tencentcloud_bi_project" "project" { + name = "terraform_test" + color_code = "#7BD936" + logo = "TF-test" + mark = "project mark" +} + +` + +const testAccBiProjectUp = ` + +resource "tencentcloud_bi_project" "project" { + name = "terraform_test1" + color_code = "#066EFF" + logo = "TF-test1" + mark = "project mark1" +} + +` diff --git a/tencentcloud/resource_tc_bi_project_user_role.go b/tencentcloud/resource_tc_bi_project_user_role.go new file mode 100644 index 0000000000..0a79b474b0 --- /dev/null +++ b/tencentcloud/resource_tc_bi_project_user_role.go @@ -0,0 +1,304 @@ +/* +Provides a resource to create a bi project_user_role + +~> **NOTE:** You cannot use `tencentcloud_bi_user_role` and `tencentcloud_bi_project_user_role` at the same time to modify the `phone_number` and `email` of the same user. + +Example Usage + +```hcl +resource "tencentcloud_bi_project_user_role" "project_user_role" { + area_code = "+86" + project_id = 11015030 + role_id_list = [10629453] + email = "123456@qq.com" + phone_number = "13130001000" + user_id = "100024664626" + user_name = "keep-cam-user" +} +``` + +Import + +bi project_user_role can be imported using the id, e.g. + +``` +terraform import tencentcloud_bi_project_user_role.project_user_role projectId#userId +``` +*/ +package tencentcloud + +import ( + "context" + "fmt" + "log" + "strconv" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bi "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func resourceTencentCloudBiProjectUserRole() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBiProjectUserRoleCreate, + Read: resourceTencentCloudBiProjectUserRoleRead, + Update: resourceTencentCloudBiProjectUserRoleUpdate, + Delete: resourceTencentCloudBiProjectUserRoleDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "project_id": { + Optional: true, + Type: schema.TypeInt, + Description: "Project id.", + }, + + "role_id_list": { + Optional: true, + Type: schema.TypeSet, + Elem: &schema.Schema{ + Type: schema.TypeInt, + }, + Description: "Role id list.", + }, + "user_id": { + Type: schema.TypeString, + Required: true, + Description: "User id.", + }, + "user_name": { + Type: schema.TypeString, + Required: true, + Description: "Username.", + }, + "email": { + Type: schema.TypeString, + Required: true, + Description: "E-mail(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "phone_number": { + Type: schema.TypeString, + Required: true, + Description: "Phone number(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "area_code": { + Type: schema.TypeString, + Required: true, + Description: "Mobile area code(Note: This field may return null, indicating that no valid value can be obtained).", + }, + }, + } +} + +func resourceTencentCloudBiProjectUserRoleCreate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_project_user_role.create")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + var ( + request = bi.NewCreateUserRoleProjectRequest() + projectId int + userId string + ) + if v, ok := d.GetOkExists("project_id"); ok { + projectId = v.(int) + request.ProjectId = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("role_id_list"); ok { + roleIdListSet := v.(*schema.Set).List() + for i := range roleIdListSet { + roleIdList := roleIdListSet[i].(int) + request.RoleIdList = append(request.RoleIdList, helper.IntInt64(roleIdList)) + } + } + + var userInfo bi.UserInfo + if v, ok := d.GetOk("user_id"); ok { + userId = v.(string) + userInfo.UserId = helper.String(v.(string)) + } + if v, ok := d.GetOk("user_name"); ok { + userInfo.UserName = helper.String(v.(string)) + } + if v, ok := d.GetOk("email"); ok { + userInfo.Email = helper.String(v.(string)) + } + if v, ok := d.GetOk("phone_number"); ok { + userInfo.PhoneNumber = helper.String(v.(string)) + } + if v, ok := d.GetOk("area_code"); ok { + userInfo.AreaCode = helper.String(v.(string)) + } + request.UserInfoList = append(request.UserInfoList, &userInfo) + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseBiClient().CreateUserRoleProject(request) + if e != nil { + return retryError(e) + } 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 create bi projectUserRole failed, reason:%+v", logId, err) + return err + } + + d.SetId(strings.Join([]string{strconv.Itoa(projectId), userId}, FILED_SP)) + + return resourceTencentCloudBiProjectUserRoleRead(d, meta) +} + +func resourceTencentCloudBiProjectUserRoleRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_project_user_role.read")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := BiService{client: meta.(*TencentCloudClient).apiV3Conn} + + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + projectId := idSplit[0] + projectIdInt, _ := strconv.ParseInt(projectId, 10, 64) + userId := idSplit[1] + + userRole, err := service.DescribeBiProjectUserRoleById(ctx, projectIdInt, userId) + if err != nil { + return err + } + + if userRole == nil { + d.SetId("") + log.Printf("[WARN]%s resource `BiProjectUserRole` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + return nil + } + + _ = d.Set("project_id", projectIdInt) + + if userRole.RoleList != nil { + var roles []*int64 + for _, v := range userRole.RoleList { + roles = append(roles, v.RoleId) + } + _ = d.Set("role_id_list", roles) + } + + if userRole.UserId != nil { + _ = d.Set("user_id", userRole.UserId) + } + + if userRole.UserName != nil { + _ = d.Set("user_name", userRole.UserName) + } + + if userRole.Email != nil { + _ = d.Set("email", userRole.Email) + } + + if userRole.PhoneNumber != nil { + _ = d.Set("phone_number", userRole.PhoneNumber) + } + + if userRole.AreaCode != nil { + _ = d.Set("area_code", userRole.AreaCode) + } + + return nil +} + +func resourceTencentCloudBiProjectUserRoleUpdate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_project_user_role.update")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + request := bi.NewModifyUserRoleProjectRequest() + + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + projectId := idSplit[0] + projectIdInt, _ := strconv.ParseInt(projectId, 10, 64) + userId := idSplit[1] + + request.UserId = &userId + request.ProjectId = &projectIdInt + + immutableArgs := []string{"area_code", "phone_number"} + for _, v := range immutableArgs { + if d.HasChange(v) { + return fmt.Errorf("argument `%s` cannot be changed", v) + } + } + + if v, ok := d.GetOk("user_name"); ok { + request.UserName = helper.String(v.(string)) + } + + if d.HasChange("role_id_list") { + if v, ok := d.GetOk("role_id_list"); ok { + roleIdListSet := v.(*schema.Set).List() + for i := range roleIdListSet { + roleIdList := roleIdListSet[i].(int) + request.RoleIdList = append(request.RoleIdList, helper.IntInt64(roleIdList)) + } + } + } + + if d.HasChange("email") { + if v, ok := d.GetOk("email"); ok { + request.Email = helper.String(v.(string)) + } + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseBiClient().ModifyUserRoleProject(request) + if e != nil { + return retryError(e) + } 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 bi projectUserRole failed, reason:%+v", logId, err) + return err + } + + return resourceTencentCloudBiProjectUserRoleRead(d, meta) +} + +func resourceTencentCloudBiProjectUserRoleDelete(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_project_user_role.delete")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := BiService{client: meta.(*TencentCloudClient).apiV3Conn} + idSplit := strings.Split(d.Id(), FILED_SP) + if len(idSplit) != 2 { + return fmt.Errorf("id is broken,%s", d.Id()) + } + projectId := idSplit[0] + projectIdInt, _ := strconv.ParseInt(projectId, 10, 64) + userId := idSplit[1] + + if err := service.DeleteBiProjectUserRoleById(ctx, projectIdInt, userId); err != nil { + return err + } + + return nil +} diff --git a/tencentcloud/resource_tc_bi_project_user_role_test.go b/tencentcloud/resource_tc_bi_project_user_role_test.go new file mode 100644 index 0000000000..184bebd132 --- /dev/null +++ b/tencentcloud/resource_tc_bi_project_user_role_test.go @@ -0,0 +1,92 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +// go test -test.run TestAccTencentCloudBiProjectUserRoleResource_basic -v +func TestAccTencentCloudBiProjectUserRoleResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBiProjectUserRole, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bi_project_user_role.project_user_role", "id"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "area_code", "+86"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "project_id", "11015030"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "role_id_list.#", "1"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "email", "123456@qq.com"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "phone_number", "13130001000"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "user_id", "100024664626"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "user_name", "keep-cam-user"), + ), + }, + { + ResourceName: "tencentcloud_bi_project_user_role.project_user_role", + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccBiProjectUserRoleUp, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bi_project_user_role.project_user_role", "id"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "area_code", "+86"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "project_id", "11015030"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "role_id_list.#", "1"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "email", "1234567@qq.com"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "phone_number", "13130001000"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "user_id", "100024664626"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "user_name", "keep-cam-user"), + ), + }, + { + Config: testAccBiProjectUserRole, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bi_project_user_role.project_user_role", "id"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "area_code", "+86"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "project_id", "11015030"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "role_id_list.#", "1"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "email", "123456@qq.com"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "phone_number", "13130001000"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "user_id", "100024664626"), + resource.TestCheckResourceAttr("tencentcloud_bi_project_user_role.project_user_role", "user_name", "keep-cam-user"), + ), + }, + }, + }) +} + +const testAccBiProjectUserRole = ` + +resource "tencentcloud_bi_project_user_role" "project_user_role" { + area_code = "+86" + project_id = 11015030 + role_id_list = [10629453] + email = "123456@qq.com" + phone_number = "13130001000" + user_id = "100024664626" + user_name = "keep-cam-user" +} + +` + +const testAccBiProjectUserRoleUp = ` + +resource "tencentcloud_bi_project_user_role" "project_user_role" { + area_code = "+86" + project_id = 11015030 + role_id_list = [10629455] + email = "1234567@qq.com" + phone_number = "13130001000" + user_id = "100024664626" + user_name = "keep-cam-user" +} + +` diff --git a/tencentcloud/resource_tc_bi_user_role.go b/tencentcloud/resource_tc_bi_user_role.go new file mode 100644 index 0000000000..f53543f830 --- /dev/null +++ b/tencentcloud/resource_tc_bi_user_role.go @@ -0,0 +1,267 @@ +/* +Provides a resource to create a bi user_role + +Example Usage + +```hcl +resource "tencentcloud_bi_user_role" "user_role" { + area_code = "+83" + email = "1055000000@qq.com" + phone_number = "13470010000" + role_id_list = [ + 10629359, + ] + user_id = "100032767426" + user_name = "keep-iac-test" +} +``` + +Import + +bi user_role can be imported using the id, e.g. + +``` +terraform import tencentcloud_bi_user_role.user_role user_id +``` +*/ +package tencentcloud + +import ( + "context" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bi "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func resourceTencentCloudBiUserRole() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBiUserRoleCreate, + Read: resourceTencentCloudBiUserRoleRead, + Update: resourceTencentCloudBiUserRoleUpdate, + Delete: resourceTencentCloudBiUserRoleDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "role_id_list": { + Required: true, + Type: schema.TypeSet, + Elem: &schema.Schema{ + Type: schema.TypeInt, + }, + Description: "Role id list.", + }, + + "user_id": { + Type: schema.TypeString, + Required: true, + Description: "User id.", + }, + "user_name": { + Type: schema.TypeString, + Required: true, + Description: "Username.", + }, + "email": { + Type: schema.TypeString, + Required: true, + Description: "E-mail(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "phone_number": { + Type: schema.TypeString, + Required: true, + Description: "Phone number(Note: This field may return null, indicating that no valid value can be obtained).", + }, + "area_code": { + Type: schema.TypeString, + Required: true, + Description: "Mobile area code(Note: This field may return null, indicating that no valid value can be obtained).", + }, + }, + } +} + +func resourceTencentCloudBiUserRoleCreate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_user_role.create")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + var ( + request = bi.NewCreateUserRoleRequest() + userId string + ) + if v, ok := d.GetOk("role_id_list"); ok { + roleIdListSet := v.(*schema.Set).List() + for i := range roleIdListSet { + roleIdList := roleIdListSet[i].(int) + request.RoleIdList = append(request.RoleIdList, helper.IntInt64(roleIdList)) + } + } + + var userInfo bi.UserInfo + if v, ok := d.GetOk("user_id"); ok { + userId = v.(string) + userInfo.UserId = helper.String(v.(string)) + } + if v, ok := d.GetOk("user_name"); ok { + userInfo.UserName = helper.String(v.(string)) + } + if v, ok := d.GetOk("email"); ok { + userInfo.Email = helper.String(v.(string)) + } + if v, ok := d.GetOk("phone_number"); ok { + userInfo.PhoneNumber = helper.String(v.(string)) + } + if v, ok := d.GetOk("area_code"); ok { + userInfo.AreaCode = helper.String(v.(string)) + } + request.UserInfoList = append(request.UserInfoList, &userInfo) + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseBiClient().CreateUserRole(request) + if e != nil { + return retryError(e) + } 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 create bi userRole failed, reason:%+v", logId, err) + return err + } + + d.SetId(userId) + + return resourceTencentCloudBiUserRoleRead(d, meta) +} + +func resourceTencentCloudBiUserRoleRead(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_user_role.read")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := BiService{client: meta.(*TencentCloudClient).apiV3Conn} + + userId := d.Id() + userRole, err := service.DescribeBiUserRoleById(ctx, userId) + if err != nil { + return err + } + + if userRole == nil { + d.SetId("") + log.Printf("[WARN]%s resource `BiUserRole` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + return nil + } + + if userRole.RoleIdList != nil { + _ = d.Set("role_id_list", userRole.RoleIdList) + } + + if userRole.UserId != nil { + _ = d.Set("user_id", userRole.UserId) + } + + if userRole.UserName != nil { + _ = d.Set("user_name", userRole.UserName) + } + + if userRole.Email != nil { + _ = d.Set("email", userRole.Email) + } + + if userRole.PhoneNumber != nil { + _ = d.Set("phone_number", userRole.PhoneNumber) + } + + if userRole.AreaCode != nil { + _ = d.Set("area_code", userRole.AreaCode) + } + + return nil +} + +func resourceTencentCloudBiUserRoleUpdate(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_user_role.update")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + + request := bi.NewModifyUserRoleRequest() + + userId := d.Id() + request.UserId = &userId + + if v, ok := d.GetOk("user_name"); ok { + request.UserName = helper.String(v.(string)) + } + + if d.HasChange("role_id_list") { + if v, ok := d.GetOk("role_id_list"); ok { + roleIdListSet := v.(*schema.Set).List() + for i := range roleIdListSet { + roleIdList := roleIdListSet[i].(int) + request.RoleIdList = append(request.RoleIdList, helper.IntInt64(roleIdList)) + } + } + } + + if d.HasChange("email") { + if v, ok := d.GetOk("email"); ok { + request.Email = helper.String(v.(string)) + } + } + + if d.HasChange("phone_number") { + if v, ok := d.GetOk("phone_number"); ok { + request.PhoneNumber = helper.String(v.(string)) + } + } + + if d.HasChange("area_code") { + if v, ok := d.GetOk("area_code"); ok { + request.AreaCode = helper.String(v.(string)) + } + } + + err := resource.Retry(writeRetryTimeout, func() *resource.RetryError { + result, e := meta.(*TencentCloudClient).apiV3Conn.UseBiClient().ModifyUserRole(request) + if e != nil { + return retryError(e) + } 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 bi userRole failed, reason:%+v", logId, err) + return err + } + + return resourceTencentCloudBiUserRoleRead(d, meta) +} + +func resourceTencentCloudBiUserRoleDelete(d *schema.ResourceData, meta interface{}) error { + defer logElapsed("resource.tencentcloud_bi_user_role.delete")() + defer inconsistentCheck(d, meta)() + + logId := getLogId(contextNil) + ctx := context.WithValue(context.TODO(), logIdKey, logId) + + service := BiService{client: meta.(*TencentCloudClient).apiV3Conn} + userId := d.Id() + + if err := service.DeleteBiUserRoleById(ctx, userId); err != nil { + return err + } + + return nil +} diff --git a/tencentcloud/resource_tc_bi_user_role_test.go b/tencentcloud/resource_tc_bi_user_role_test.go new file mode 100644 index 0000000000..c2be23dd3d --- /dev/null +++ b/tencentcloud/resource_tc_bi_user_role_test.go @@ -0,0 +1,79 @@ +package tencentcloud + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +// go test -test.run TestAccTencentCloudBiUserRoleResource_basic -v +func TestAccTencentCloudBiUserRoleResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBiUserRole, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bi_user_role.user_role", "id"), + resource.TestCheckResourceAttr("tencentcloud_bi_user_role.user_role", "area_code", "+86"), + resource.TestCheckResourceAttr("tencentcloud_bi_user_role.user_role", "email", "1055000000@qq.com"), + resource.TestCheckResourceAttr("tencentcloud_bi_user_role.user_role", "phone_number", "13470010000"), + resource.TestCheckResourceAttr("tencentcloud_bi_user_role.user_role", "role_id_list.#", "1"), + resource.TestCheckResourceAttr("tencentcloud_bi_user_role.user_role", "user_id", "100032767426"), + resource.TestCheckResourceAttr("tencentcloud_bi_user_role.user_role", "user_name", "keep-iac-test"), + ), + }, + { + ResourceName: "tencentcloud_bi_user_role.user_role", + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccBiUserRoleUp, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bi_user_role.user_role", "id"), + resource.TestCheckResourceAttr("tencentcloud_bi_user_role.user_role", "area_code", "+86"), + resource.TestCheckResourceAttr("tencentcloud_bi_user_role.user_role", "email", "1055000001@qq.com"), + resource.TestCheckResourceAttr("tencentcloud_bi_user_role.user_role", "phone_number", "13470010001"), + resource.TestCheckResourceAttr("tencentcloud_bi_user_role.user_role", "role_id_list.#", "2"), + resource.TestCheckResourceAttr("tencentcloud_bi_user_role.user_role", "user_id", "100032767426"), + resource.TestCheckResourceAttr("tencentcloud_bi_user_role.user_role", "user_name", "keep-iac-test"), + ), + }, + }, + }) +} + +const testAccBiUserRole = ` + +resource "tencentcloud_bi_user_role" "user_role" { + area_code = "+86" + email = "1055000000@qq.com" + phone_number = "13470010000" + role_id_list = [ + 10629359, + ] + user_id = "100032767426" + user_name = "keep-iac-test" +} + +` + +const testAccBiUserRoleUp = ` + +resource "tencentcloud_bi_user_role" "user_role" { + area_code = "+86" + email = "1055000001@qq.com" + phone_number = "13470010001" + role_id_list = [ + 10629360, 10629453, + ] + user_id = "100032767426" + user_name = "keep-iac-test" +} + +` diff --git a/tencentcloud/service_tencentcloud_bi.go b/tencentcloud/service_tencentcloud_bi.go new file mode 100644 index 0000000000..ba45888ff7 --- /dev/null +++ b/tencentcloud/service_tencentcloud_bi.go @@ -0,0 +1,457 @@ +package tencentcloud + +import ( + "context" + "log" + + bi "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/connectivity" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit" +) + +type BiService struct { + client *connectivity.TencentCloudClient +} + +func (me *BiService) DescribeBiDatasourceCloudById(ctx context.Context, projectId, id uint64) (datasourceCloud *bi.DatasourceInfo, errRet error) { + logId := getLogId(ctx) + + request := bi.NewDescribeDatasourceListRequest() + request.ProjectId = &projectId + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + ratelimit.Check(request.GetAction()) + + var ( + offset int64 = 0 + limit int64 = 20 + ) + for { + request.PageNo = &offset + request.PageSize = &limit + response, err := me.client.UseBiClient().DescribeDatasourceList(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + if response == nil || len(response.Response.Data.List) < 1 { + break + } + for _, v := range response.Response.Data.List { + if *v.Id == id { + datasourceCloud = v + return + } + } + if len(response.Response.Data.List) < int(limit) { + break + } + + offset += limit + } + + return +} + +func (me *BiService) DeleteBiDatasourceCloudById(ctx context.Context, projectId, id uint64) (errRet error) { + logId := getLogId(ctx) + + request := bi.NewDeleteDatasourceRequest() + request.ProjectId = &projectId + request.Id = &id + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + ratelimit.Check(request.GetAction()) + + response, err := me.client.UseBiClient().DeleteDatasource(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} + +func (me *BiService) DescribeBiProjectById(ctx context.Context, projectId uint64) (project *bi.Project, errRet error) { + logId := getLogId(ctx) + + request := bi.NewDescribeProjectInfoRequest() + request.Id = &projectId + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + ratelimit.Check(request.GetAction()) + + response, err := me.client.UseBiClient().DescribeProjectInfo(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + project = response.Response.Data + return +} + +func (me *BiService) DeleteBiProjectById(ctx context.Context, projectId uint64) (errRet error) { + logId := getLogId(ctx) + + request := bi.NewDeleteProjectRequest() + request.Id = &projectId + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + ratelimit.Check(request.GetAction()) + + response, err := me.client.UseBiClient().DeleteProject(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} + +func (me *BiService) DescribeBiUserRoleById(ctx context.Context, userId string) (userRole *bi.UserRoleListDataUserRoleInfo, errRet error) { + logId := getLogId(ctx) + + request := bi.NewDescribeUserRoleListRequest() + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + ratelimit.Check(request.GetAction()) + + var ( + offset int64 = 0 + limit int64 = 20 + ) + for { + request.PageNo = &offset + request.PageSize = &limit + response, err := me.client.UseBiClient().DescribeUserRoleList(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + if response == nil || len(response.Response.Data.List) < 1 { + break + } + for _, v := range response.Response.Data.List { + if *v.UserId == userId { + userRole = v + return + } + } + if len(response.Response.Data.List) < int(limit) { + break + } + + offset += limit + } + + return +} + +func (me *BiService) DeleteBiUserRoleById(ctx context.Context, userId string) (errRet error) { + logId := getLogId(ctx) + + request := bi.NewDeleteUserRoleRequest() + request.UserId = &userId + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + ratelimit.Check(request.GetAction()) + + response, err := me.client.UseBiClient().DeleteUserRole(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} + +func (me *BiService) DescribeBiProjectUserRoleById(ctx context.Context, projectId int64, userId string) (projectUserRole *bi.UserRoleListDataUserRoleInfo, errRet error) { + logId := getLogId(ctx) + + request := bi.NewDescribeUserRoleProjectListRequest() + request.ProjectId = &projectId + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + ratelimit.Check(request.GetAction()) + + var ( + offset int64 = 0 + limit int64 = 20 + ) + for { + request.PageNo = &offset + request.PageSize = &limit + response, err := me.client.UseBiClient().DescribeUserRoleProjectList(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + if response == nil || len(response.Response.Data.List) < 1 { + break + } + for _, v := range response.Response.Data.List { + if *v.UserId == userId { + projectUserRole = v + return + } + } + if len(response.Response.Data.List) < int(limit) { + break + } + + offset += limit + } + + return +} + +func (me *BiService) DeleteBiProjectUserRoleById(ctx context.Context, projectId int64, userId string) (errRet error) { + logId := getLogId(ctx) + + request := bi.NewDeleteUserRoleProjectRequest() + request.ProjectId = &projectId + request.UserId = &userId + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + ratelimit.Check(request.GetAction()) + + response, err := me.client.UseBiClient().DeleteUserRoleProject(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} + +func (me *BiService) DescribeBiProjectByFilter(ctx context.Context, param map[string]interface{}) (project []*bi.Project, errRet error) { + var ( + logId = getLogId(ctx) + request = bi.NewDescribeProjectListRequest() + ) + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + for k, v := range param { + if k == "PageNo" { + request.PageNo = v.(*uint64) + } + if k == "Keyword" { + request.Keyword = v.(*string) + } + if k == "AllPage" { + request.AllPage = v.(*bool) + } + if k == "ModuleCollection" { + request.ModuleCollection = v.(*string) + } + } + + ratelimit.Check(request.GetAction()) + + var ( + offset uint64 = 0 + limit uint64 = 20 + ) + for { + request.PageNo = &offset + request.PageSize = &limit + response, err := me.client.UseBiClient().DescribeProjectList(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + if response == nil || len(response.Response.Data.List) < 1 { + break + } + project = append(project, response.Response.Data.List...) + if len(response.Response.Data.List) < int(limit) { + break + } + + offset += limit + } + + return +} + +func (me *BiService) DescribeBiDatasourceById(ctx context.Context, projectId uint64, id uint64) (datasource *bi.DatasourceInfo, errRet error) { + logId := getLogId(ctx) + + request := bi.NewDescribeDatasourceListRequest() + request.ProjectId = &projectId + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + ratelimit.Check(request.GetAction()) + + var ( + offset int64 = 0 + limit int64 = 20 + ) + for { + request.PageNo = &offset + request.PageSize = &limit + response, err := me.client.UseBiClient().DescribeDatasourceList(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + if response == nil || len(response.Response.Data.List) < 1 { + break + } + for _, v := range response.Response.Data.List { + if *v.Id == id { + datasource = v + return + } + } + if len(response.Response.Data.List) < int(limit) { + break + } + + offset += limit + } + + return +} + +func (me *BiService) DeleteBiDatasourceById(ctx context.Context, projectId uint64, id uint64) (errRet error) { + logId := getLogId(ctx) + + request := bi.NewDeleteDatasourceRequest() + request.ProjectId = &projectId + request.Id = &id + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + ratelimit.Check(request.GetAction()) + + response, err := me.client.UseBiClient().DeleteDatasource(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + return +} + +func (me *BiService) DescribeBiUserProjectByFilter(ctx context.Context, param map[string]interface{}) (userProject []*bi.UserIdAndUserName, errRet error) { + var ( + logId = getLogId(ctx) + request = bi.NewDescribeUserProjectListRequest() + ) + + defer func() { + if errRet != nil { + log.Printf("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n", logId, request.GetAction(), request.ToJsonString(), errRet.Error()) + } + }() + + for k, v := range param { + if k == "ProjectId" { + request.ProjectId = v.(*int64) + } + if k == "AllPage" { + request.AllPage = v.(*bool) + } + } + + ratelimit.Check(request.GetAction()) + + var ( + offset int64 = 0 + limit int64 = 20 + ) + for { + request.PageNo = &offset + request.PageSize = &limit + response, err := me.client.UseBiClient().DescribeUserProjectList(request) + if err != nil { + errRet = err + return + } + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), response.ToJsonString()) + + if response == nil || len(response.Response.Data.List) < 1 { + break + } + userProject = append(userProject, response.Response.Data.List...) + if len(response.Response.Data.List) < int(limit) { + break + } + + offset += limit + } + + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/LICENSE b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/LICENSE new file mode 100644 index 0000000000..efc75a2253 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) 2017-2018 Tencent Ltd. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105/client.go new file mode 100644 index 0000000000..34d6f2c280 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105/client.go @@ -0,0 +1,1454 @@ +// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v20220105 + +import ( + "context" + "errors" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" + tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" +) + +const APIVersion = "2022-01-05" + +type Client struct { + common.Client +} + +// Deprecated +func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) { + cpf := profile.NewClientProfile() + client = &Client{} + client.Init(region).WithSecretId(secretId, secretKey).WithProfile(cpf) + return +} + +func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error) { + client = &Client{} + client.Init(region). + WithCredential(credential). + WithProfile(clientProfile) + return +} + + +func NewApplyEmbedIntervalRequest() (request *ApplyEmbedIntervalRequest) { + request = &ApplyEmbedIntervalRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "ApplyEmbedInterval") + + + return +} + +func NewApplyEmbedIntervalResponse() (response *ApplyEmbedIntervalResponse) { + response = &ApplyEmbedIntervalResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ApplyEmbedInterval +// 申请延长Token可用时间接口-强鉴权 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_EMBED = "InvalidParameter.Embed" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) ApplyEmbedInterval(request *ApplyEmbedIntervalRequest) (response *ApplyEmbedIntervalResponse, err error) { + return c.ApplyEmbedIntervalWithContext(context.Background(), request) +} + +// ApplyEmbedInterval +// 申请延长Token可用时间接口-强鉴权 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_EMBED = "InvalidParameter.Embed" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) ApplyEmbedIntervalWithContext(ctx context.Context, request *ApplyEmbedIntervalRequest) (response *ApplyEmbedIntervalResponse, err error) { + if request == nil { + request = NewApplyEmbedIntervalRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ApplyEmbedInterval require credential") + } + + request.SetContext(ctx) + + response = NewApplyEmbedIntervalResponse() + err = c.Send(request, response) + return +} + +func NewCreateDatasourceRequest() (request *CreateDatasourceRequest) { + request = &CreateDatasourceRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "CreateDatasource") + + + return +} + +func NewCreateDatasourceResponse() (response *CreateDatasourceResponse) { + response = &CreateDatasourceResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateDatasource +// 创建数据源 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) CreateDatasource(request *CreateDatasourceRequest) (response *CreateDatasourceResponse, err error) { + return c.CreateDatasourceWithContext(context.Background(), request) +} + +// CreateDatasource +// 创建数据源 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) CreateDatasourceWithContext(ctx context.Context, request *CreateDatasourceRequest) (response *CreateDatasourceResponse, err error) { + if request == nil { + request = NewCreateDatasourceRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreateDatasource require credential") + } + + request.SetContext(ctx) + + response = NewCreateDatasourceResponse() + err = c.Send(request, response) + return +} + +func NewCreateDatasourceCloudRequest() (request *CreateDatasourceCloudRequest) { + request = &CreateDatasourceCloudRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "CreateDatasourceCloud") + + + return +} + +func NewCreateDatasourceCloudResponse() (response *CreateDatasourceCloudResponse) { + response = &CreateDatasourceCloudResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateDatasourceCloud +// 创建云数据库 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) CreateDatasourceCloud(request *CreateDatasourceCloudRequest) (response *CreateDatasourceCloudResponse, err error) { + return c.CreateDatasourceCloudWithContext(context.Background(), request) +} + +// CreateDatasourceCloud +// 创建云数据库 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) CreateDatasourceCloudWithContext(ctx context.Context, request *CreateDatasourceCloudRequest) (response *CreateDatasourceCloudResponse, err error) { + if request == nil { + request = NewCreateDatasourceCloudRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreateDatasourceCloud require credential") + } + + request.SetContext(ctx) + + response = NewCreateDatasourceCloudResponse() + err = c.Send(request, response) + return +} + +func NewCreateEmbedTokenRequest() (request *CreateEmbedTokenRequest) { + request = &CreateEmbedTokenRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "CreateEmbedToken") + + + return +} + +func NewCreateEmbedTokenResponse() (response *CreateEmbedTokenResponse) { + response = &CreateEmbedTokenResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateEmbedToken +// 创建嵌出报表-强鉴权 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_EMBED = "InvalidParameter.Embed" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) CreateEmbedToken(request *CreateEmbedTokenRequest) (response *CreateEmbedTokenResponse, err error) { + return c.CreateEmbedTokenWithContext(context.Background(), request) +} + +// CreateEmbedToken +// 创建嵌出报表-强鉴权 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_EMBED = "InvalidParameter.Embed" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) CreateEmbedTokenWithContext(ctx context.Context, request *CreateEmbedTokenRequest) (response *CreateEmbedTokenResponse, err error) { + if request == nil { + request = NewCreateEmbedTokenRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreateEmbedToken require credential") + } + + request.SetContext(ctx) + + response = NewCreateEmbedTokenResponse() + err = c.Send(request, response) + return +} + +func NewCreateProjectRequest() (request *CreateProjectRequest) { + request = &CreateProjectRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "CreateProject") + + + return +} + +func NewCreateProjectResponse() (response *CreateProjectResponse) { + response = &CreateProjectResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateProject +// 创建项目 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateProject(request *CreateProjectRequest) (response *CreateProjectResponse, err error) { + return c.CreateProjectWithContext(context.Background(), request) +} + +// CreateProject +// 创建项目 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateProjectWithContext(ctx context.Context, request *CreateProjectRequest) (response *CreateProjectResponse, err error) { + if request == nil { + request = NewCreateProjectRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreateProject require credential") + } + + request.SetContext(ctx) + + response = NewCreateProjectResponse() + err = c.Send(request, response) + return +} + +func NewCreateUserRoleRequest() (request *CreateUserRoleRequest) { + request = &CreateUserRoleRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "CreateUserRole") + + + return +} + +func NewCreateUserRoleResponse() (response *CreateUserRoleResponse) { + response = &CreateUserRoleResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateUserRole +// 创建用户角色 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +func (c *Client) CreateUserRole(request *CreateUserRoleRequest) (response *CreateUserRoleResponse, err error) { + return c.CreateUserRoleWithContext(context.Background(), request) +} + +// CreateUserRole +// 创建用户角色 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +func (c *Client) CreateUserRoleWithContext(ctx context.Context, request *CreateUserRoleRequest) (response *CreateUserRoleResponse, err error) { + if request == nil { + request = NewCreateUserRoleRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreateUserRole require credential") + } + + request.SetContext(ctx) + + response = NewCreateUserRoleResponse() + err = c.Send(request, response) + return +} + +func NewCreateUserRoleProjectRequest() (request *CreateUserRoleProjectRequest) { + request = &CreateUserRoleProjectRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "CreateUserRoleProject") + + + return +} + +func NewCreateUserRoleProjectResponse() (response *CreateUserRoleProjectResponse) { + response = &CreateUserRoleProjectResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateUserRoleProject +// 项目内-创建用户角色 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" +func (c *Client) CreateUserRoleProject(request *CreateUserRoleProjectRequest) (response *CreateUserRoleProjectResponse, err error) { + return c.CreateUserRoleProjectWithContext(context.Background(), request) +} + +// CreateUserRoleProject +// 项目内-创建用户角色 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" +func (c *Client) CreateUserRoleProjectWithContext(ctx context.Context, request *CreateUserRoleProjectRequest) (response *CreateUserRoleProjectResponse, err error) { + if request == nil { + request = NewCreateUserRoleProjectRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("CreateUserRoleProject require credential") + } + + request.SetContext(ctx) + + response = NewCreateUserRoleProjectResponse() + err = c.Send(request, response) + return +} + +func NewDeleteDatasourceRequest() (request *DeleteDatasourceRequest) { + request = &DeleteDatasourceRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "DeleteDatasource") + + + return +} + +func NewDeleteDatasourceResponse() (response *DeleteDatasourceResponse) { + response = &DeleteDatasourceResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteDatasource +// 删除数据源 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) DeleteDatasource(request *DeleteDatasourceRequest) (response *DeleteDatasourceResponse, err error) { + return c.DeleteDatasourceWithContext(context.Background(), request) +} + +// DeleteDatasource +// 删除数据源 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) DeleteDatasourceWithContext(ctx context.Context, request *DeleteDatasourceRequest) (response *DeleteDatasourceResponse, err error) { + if request == nil { + request = NewDeleteDatasourceRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DeleteDatasource require credential") + } + + request.SetContext(ctx) + + response = NewDeleteDatasourceResponse() + err = c.Send(request, response) + return +} + +func NewDeleteProjectRequest() (request *DeleteProjectRequest) { + request = &DeleteProjectRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "DeleteProject") + + + return +} + +func NewDeleteProjectResponse() (response *DeleteProjectResponse) { + response = &DeleteProjectResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteProject +// 删除项目 +// +// 可能返回的错误码: +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +func (c *Client) DeleteProject(request *DeleteProjectRequest) (response *DeleteProjectResponse, err error) { + return c.DeleteProjectWithContext(context.Background(), request) +} + +// DeleteProject +// 删除项目 +// +// 可能返回的错误码: +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +func (c *Client) DeleteProjectWithContext(ctx context.Context, request *DeleteProjectRequest) (response *DeleteProjectResponse, err error) { + if request == nil { + request = NewDeleteProjectRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DeleteProject require credential") + } + + request.SetContext(ctx) + + response = NewDeleteProjectResponse() + err = c.Send(request, response) + return +} + +func NewDeleteUserRoleRequest() (request *DeleteUserRoleRequest) { + request = &DeleteUserRoleRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "DeleteUserRole") + + + return +} + +func NewDeleteUserRoleResponse() (response *DeleteUserRoleResponse) { + response = &DeleteUserRoleResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteUserRole +// 删除用户角色,会删除用户 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +func (c *Client) DeleteUserRole(request *DeleteUserRoleRequest) (response *DeleteUserRoleResponse, err error) { + return c.DeleteUserRoleWithContext(context.Background(), request) +} + +// DeleteUserRole +// 删除用户角色,会删除用户 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +func (c *Client) DeleteUserRoleWithContext(ctx context.Context, request *DeleteUserRoleRequest) (response *DeleteUserRoleResponse, err error) { + if request == nil { + request = NewDeleteUserRoleRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DeleteUserRole require credential") + } + + request.SetContext(ctx) + + response = NewDeleteUserRoleResponse() + err = c.Send(request, response) + return +} + +func NewDeleteUserRoleProjectRequest() (request *DeleteUserRoleProjectRequest) { + request = &DeleteUserRoleProjectRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "DeleteUserRoleProject") + + + return +} + +func NewDeleteUserRoleProjectResponse() (response *DeleteUserRoleProjectResponse) { + response = &DeleteUserRoleProjectResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteUserRoleProject +// 项目内-删除用户角色 +// +// 可能返回的错误码: +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +func (c *Client) DeleteUserRoleProject(request *DeleteUserRoleProjectRequest) (response *DeleteUserRoleProjectResponse, err error) { + return c.DeleteUserRoleProjectWithContext(context.Background(), request) +} + +// DeleteUserRoleProject +// 项目内-删除用户角色 +// +// 可能返回的错误码: +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +func (c *Client) DeleteUserRoleProjectWithContext(ctx context.Context, request *DeleteUserRoleProjectRequest) (response *DeleteUserRoleProjectResponse, err error) { + if request == nil { + request = NewDeleteUserRoleProjectRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DeleteUserRoleProject require credential") + } + + request.SetContext(ctx) + + response = NewDeleteUserRoleProjectResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDatasourceListRequest() (request *DescribeDatasourceListRequest) { + request = &DescribeDatasourceListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "DescribeDatasourceList") + + + return +} + +func NewDescribeDatasourceListResponse() (response *DescribeDatasourceListResponse) { + response = &DescribeDatasourceListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDatasourceList +// 查询数据源列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) DescribeDatasourceList(request *DescribeDatasourceListRequest) (response *DescribeDatasourceListResponse, err error) { + return c.DescribeDatasourceListWithContext(context.Background(), request) +} + +// DescribeDatasourceList +// 查询数据源列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) DescribeDatasourceListWithContext(ctx context.Context, request *DescribeDatasourceListRequest) (response *DescribeDatasourceListResponse, err error) { + if request == nil { + request = NewDescribeDatasourceListRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDatasourceList require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDatasourceListResponse() + err = c.Send(request, response) + return +} + +func NewDescribeProjectInfoRequest() (request *DescribeProjectInfoRequest) { + request = &DescribeProjectInfoRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "DescribeProjectInfo") + + + return +} + +func NewDescribeProjectInfoResponse() (response *DescribeProjectInfoResponse) { + response = &DescribeProjectInfoResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeProjectInfo +// 项目详情接口 +// +// 可能返回的错误码: +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) DescribeProjectInfo(request *DescribeProjectInfoRequest) (response *DescribeProjectInfoResponse, err error) { + return c.DescribeProjectInfoWithContext(context.Background(), request) +} + +// DescribeProjectInfo +// 项目详情接口 +// +// 可能返回的错误码: +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) DescribeProjectInfoWithContext(ctx context.Context, request *DescribeProjectInfoRequest) (response *DescribeProjectInfoResponse, err error) { + if request == nil { + request = NewDescribeProjectInfoRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeProjectInfo require credential") + } + + request.SetContext(ctx) + + response = NewDescribeProjectInfoResponse() + err = c.Send(request, response) + return +} + +func NewDescribeProjectListRequest() (request *DescribeProjectListRequest) { + request = &DescribeProjectListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "DescribeProjectList") + + + return +} + +func NewDescribeProjectListResponse() (response *DescribeProjectListResponse) { + response = &DescribeProjectListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeProjectList +// 项目信息 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +func (c *Client) DescribeProjectList(request *DescribeProjectListRequest) (response *DescribeProjectListResponse, err error) { + return c.DescribeProjectListWithContext(context.Background(), request) +} + +// DescribeProjectList +// 项目信息 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +func (c *Client) DescribeProjectListWithContext(ctx context.Context, request *DescribeProjectListRequest) (response *DescribeProjectListResponse, err error) { + if request == nil { + request = NewDescribeProjectListRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeProjectList require credential") + } + + request.SetContext(ctx) + + response = NewDescribeProjectListResponse() + err = c.Send(request, response) + return +} + +func NewDescribeUserProjectListRequest() (request *DescribeUserProjectListRequest) { + request = &DescribeUserProjectListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "DescribeUserProjectList") + + + return +} + +func NewDescribeUserProjectListResponse() (response *DescribeUserProjectListResponse) { + response = &DescribeUserProjectListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeUserProjectList +// 项目内-用户接口 +// +// 可能返回的错误码: +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) DescribeUserProjectList(request *DescribeUserProjectListRequest) (response *DescribeUserProjectListResponse, err error) { + return c.DescribeUserProjectListWithContext(context.Background(), request) +} + +// DescribeUserProjectList +// 项目内-用户接口 +// +// 可能返回的错误码: +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) DescribeUserProjectListWithContext(ctx context.Context, request *DescribeUserProjectListRequest) (response *DescribeUserProjectListResponse, err error) { + if request == nil { + request = NewDescribeUserProjectListRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeUserProjectList require credential") + } + + request.SetContext(ctx) + + response = NewDescribeUserProjectListResponse() + err = c.Send(request, response) + return +} + +func NewDescribeUserRoleListRequest() (request *DescribeUserRoleListRequest) { + request = &DescribeUserRoleListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "DescribeUserRoleList") + + + return +} + +func NewDescribeUserRoleListResponse() (response *DescribeUserRoleListResponse) { + response = &DescribeUserRoleListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeUserRoleList +// 用户角色列表 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) DescribeUserRoleList(request *DescribeUserRoleListRequest) (response *DescribeUserRoleListResponse, err error) { + return c.DescribeUserRoleListWithContext(context.Background(), request) +} + +// DescribeUserRoleList +// 用户角色列表 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) DescribeUserRoleListWithContext(ctx context.Context, request *DescribeUserRoleListRequest) (response *DescribeUserRoleListResponse, err error) { + if request == nil { + request = NewDescribeUserRoleListRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeUserRoleList require credential") + } + + request.SetContext(ctx) + + response = NewDescribeUserRoleListResponse() + err = c.Send(request, response) + return +} + +func NewDescribeUserRoleProjectListRequest() (request *DescribeUserRoleProjectListRequest) { + request = &DescribeUserRoleProjectListRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "DescribeUserRoleProjectList") + + + return +} + +func NewDescribeUserRoleProjectListResponse() (response *DescribeUserRoleProjectListResponse) { + response = &DescribeUserRoleProjectListResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeUserRoleProjectList +// 项目内-用户角色列表 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) DescribeUserRoleProjectList(request *DescribeUserRoleProjectListRequest) (response *DescribeUserRoleProjectListResponse, err error) { + return c.DescribeUserRoleProjectListWithContext(context.Background(), request) +} + +// DescribeUserRoleProjectList +// 项目内-用户角色列表 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" +// UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) DescribeUserRoleProjectListWithContext(ctx context.Context, request *DescribeUserRoleProjectListRequest) (response *DescribeUserRoleProjectListResponse, err error) { + if request == nil { + request = NewDescribeUserRoleProjectListRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("DescribeUserRoleProjectList require credential") + } + + request.SetContext(ctx) + + response = NewDescribeUserRoleProjectListResponse() + err = c.Send(request, response) + return +} + +func NewModifyDatasourceRequest() (request *ModifyDatasourceRequest) { + request = &ModifyDatasourceRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "ModifyDatasource") + + + return +} + +func NewModifyDatasourceResponse() (response *ModifyDatasourceResponse) { + response = &ModifyDatasourceResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyDatasource +// 更新数据源 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) ModifyDatasource(request *ModifyDatasourceRequest) (response *ModifyDatasourceResponse, err error) { + return c.ModifyDatasourceWithContext(context.Background(), request) +} + +// ModifyDatasource +// 更新数据源 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) ModifyDatasourceWithContext(ctx context.Context, request *ModifyDatasourceRequest) (response *ModifyDatasourceResponse, err error) { + if request == nil { + request = NewModifyDatasourceRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifyDatasource require credential") + } + + request.SetContext(ctx) + + response = NewModifyDatasourceResponse() + err = c.Send(request, response) + return +} + +func NewModifyDatasourceCloudRequest() (request *ModifyDatasourceCloudRequest) { + request = &ModifyDatasourceCloudRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "ModifyDatasourceCloud") + + + return +} + +func NewModifyDatasourceCloudResponse() (response *ModifyDatasourceCloudResponse) { + response = &ModifyDatasourceCloudResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyDatasourceCloud +// 更新云数据库 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) ModifyDatasourceCloud(request *ModifyDatasourceCloudRequest) (response *ModifyDatasourceCloudResponse, err error) { + return c.ModifyDatasourceCloudWithContext(context.Background(), request) +} + +// ModifyDatasourceCloud +// 更新云数据库 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// OPERATIONDENIED = "OperationDenied" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +func (c *Client) ModifyDatasourceCloudWithContext(ctx context.Context, request *ModifyDatasourceCloudRequest) (response *ModifyDatasourceCloudResponse, err error) { + if request == nil { + request = NewModifyDatasourceCloudRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifyDatasourceCloud require credential") + } + + request.SetContext(ctx) + + response = NewModifyDatasourceCloudResponse() + err = c.Send(request, response) + return +} + +func NewModifyProjectRequest() (request *ModifyProjectRequest) { + request = &ModifyProjectRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "ModifyProject") + + + return +} + +func NewModifyProjectResponse() (response *ModifyProjectResponse) { + response = &ModifyProjectResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyProject +// 修改项目信息 +// +// 可能返回的错误码: +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +func (c *Client) ModifyProject(request *ModifyProjectRequest) (response *ModifyProjectResponse, err error) { + return c.ModifyProjectWithContext(context.Background(), request) +} + +// ModifyProject +// 修改项目信息 +// +// 可能返回的错误码: +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +func (c *Client) ModifyProjectWithContext(ctx context.Context, request *ModifyProjectRequest) (response *ModifyProjectResponse, err error) { + if request == nil { + request = NewModifyProjectRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifyProject require credential") + } + + request.SetContext(ctx) + + response = NewModifyProjectResponse() + err = c.Send(request, response) + return +} + +func NewModifyUserRoleRequest() (request *ModifyUserRoleRequest) { + request = &ModifyUserRoleRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "ModifyUserRole") + + + return +} + +func NewModifyUserRoleResponse() (response *ModifyUserRoleResponse) { + response = &ModifyUserRoleResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyUserRole +// 修改用户角色信息 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +func (c *Client) ModifyUserRole(request *ModifyUserRoleRequest) (response *ModifyUserRoleResponse, err error) { + return c.ModifyUserRoleWithContext(context.Background(), request) +} + +// ModifyUserRole +// 修改用户角色信息 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +func (c *Client) ModifyUserRoleWithContext(ctx context.Context, request *ModifyUserRoleRequest) (response *ModifyUserRoleResponse, err error) { + if request == nil { + request = NewModifyUserRoleRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifyUserRole require credential") + } + + request.SetContext(ctx) + + response = NewModifyUserRoleResponse() + err = c.Send(request, response) + return +} + +func NewModifyUserRoleProjectRequest() (request *ModifyUserRoleProjectRequest) { + request = &ModifyUserRoleProjectRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bi", APIVersion, "ModifyUserRoleProject") + + + return +} + +func NewModifyUserRoleProjectResponse() (response *ModifyUserRoleProjectResponse) { + response = &ModifyUserRoleProjectResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyUserRoleProject +// 项目-修改用户角色信息 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +func (c *Client) ModifyUserRoleProject(request *ModifyUserRoleProjectRequest) (response *ModifyUserRoleProjectResponse, err error) { + return c.ModifyUserRoleProjectWithContext(context.Background(), request) +} + +// ModifyUserRoleProject +// 项目-修改用户角色信息 +// +// 可能返回的错误码: +// INTERNALERROR_INTERNAL = "InternalError.Internal" +// MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" +// UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" +func (c *Client) ModifyUserRoleProjectWithContext(ctx context.Context, request *ModifyUserRoleProjectRequest) (response *ModifyUserRoleProjectResponse, err error) { + if request == nil { + request = NewModifyUserRoleProjectRequest() + } + + if c.GetCredential() == nil { + return nil, errors.New("ModifyUserRoleProject require credential") + } + + request.SetContext(ctx) + + response = NewModifyUserRoleProjectResponse() + err = c.Send(request, response) + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105/errors.go new file mode 100644 index 0000000000..178773ea30 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105/errors.go @@ -0,0 +1,76 @@ +// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v20220105 + +const ( + // 此产品的特有错误码 + + // CAM签名/鉴权错误。 + AUTHFAILURE = "AuthFailure" + + // 操作失败。 + FAILEDOPERATION = "FailedOperation" + + // 内部错误。 + INTERNALERROR = "InternalError" + + // 内部错误。 + INTERNALERROR_INTERNAL = "InternalError.Internal" + + // 参数错误。 + INVALIDPARAMETER = "InvalidParameter" + + // 报表嵌出类错误。 + INVALIDPARAMETER_EMBED = "InvalidParameter.Embed" + + // 参数取值错误。 + INVALIDPARAMETERVALUE = "InvalidParameterValue" + + // 超过配额限制。 + LIMITEXCEEDED = "LimitExceeded" + + // 缺少参数错误。 + MISSINGPARAMETER = "MissingParameter" + + // 必填参数缺失。 + MISSINGPARAMETER_MISSINGPARAM = "MissingParameter.MissingParam" + + // 操作被拒绝。 + OPERATIONDENIED = "OperationDenied" + + // 请求的次数超过了频率限制。 + REQUESTLIMITEXCEEDED = "RequestLimitExceeded" + + // 未授权操作。 + UNAUTHORIZEDOPERATION = "UnauthorizedOperation" + + // 权限错误。 + UNAUTHORIZEDOPERATION_AUTHORIZE = "UnauthorizedOperation.Authorize" + + // 用户未启用。 + UNAUTHORIZEDOPERATION_INACTIVE = "UnauthorizedOperation.Inactive" + + // 用户不存在。 + UNAUTHORIZEDOPERATION_USERNOTEXIST = "UnauthorizedOperation.UserNotExist" + + // 未知参数错误。 + UNKNOWNPARAMETER = "UnknownParameter" + + // 操作不支持。 + UNSUPPORTEDOPERATION = "UnsupportedOperation" + + // 默认业务异常。 + UNSUPPORTEDOPERATION_BIERROR = "UnsupportedOperation.BIError" +) diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105/models.go new file mode 100644 index 0000000000..f4c0807a7c --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105/models.go @@ -0,0 +1,3051 @@ +// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v20220105 + +import ( + tcerr "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" + tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" + "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/json" +) + +// Predefined struct for user +type ApplyEmbedIntervalRequestParams struct { + // 分享项目id,必选 + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 分享页面id,嵌出看板时此为空值0 + PageId *uint64 `json:"PageId,omitnil" name:"PageId"` + + // 需要申请延期的Token + BIToken *string `json:"BIToken,omitnil" name:"BIToken"` + + // 备用字段 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // panel,看板;page,页面 + Scope *string `json:"Scope,omitnil" name:"Scope"` +} + +type ApplyEmbedIntervalRequest struct { + *tchttp.BaseRequest + + // 分享项目id,必选 + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 分享页面id,嵌出看板时此为空值0 + PageId *uint64 `json:"PageId,omitnil" name:"PageId"` + + // 需要申请延期的Token + BIToken *string `json:"BIToken,omitnil" name:"BIToken"` + + // 备用字段 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // panel,看板;page,页面 + Scope *string `json:"Scope,omitnil" name:"Scope"` +} + +func (r *ApplyEmbedIntervalRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ApplyEmbedIntervalRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ProjectId") + delete(f, "PageId") + delete(f, "BIToken") + delete(f, "ExtraParam") + delete(f, "Scope") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ApplyEmbedIntervalRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ApplyEmbedIntervalResponseParams struct { + // 额外参数 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 结果数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *ApplyEmbedTokenInfo `json:"Data,omitnil" name:"Data"` + + // 结果描述 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type ApplyEmbedIntervalResponse struct { + *tchttp.BaseResponse + Response *ApplyEmbedIntervalResponseParams `json:"Response"` +} + +func (r *ApplyEmbedIntervalResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ApplyEmbedIntervalResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type ApplyEmbedTokenInfo struct { + // 申请结果 + // 注意:此字段可能返回 null,表示取不到有效值。 + Result *bool `json:"Result,omitnil" name:"Result"` +} + +type BaseStateAction struct { + // 编辑是否可见 + // 注意:此字段可能返回 null,表示取不到有效值。 + ShowEdit *bool `json:"ShowEdit,omitnil" name:"ShowEdit"` + + // 编辑是否可点击 + // 注意:此字段可能返回 null,表示取不到有效值。 + IsEdit *bool `json:"IsEdit,omitnil" name:"IsEdit"` + + // 编辑按钮的文本 + // 注意:此字段可能返回 null,表示取不到有效值。 + EditText *string `json:"EditText,omitnil" name:"EditText"` + + // 编辑不可用时的提示文本 + // 注意:此字段可能返回 null,表示取不到有效值。 + EditTips *string `json:"EditTips,omitnil" name:"EditTips"` + + // 删除是否可见 + // 注意:此字段可能返回 null,表示取不到有效值。 + ShowDel *bool `json:"ShowDel,omitnil" name:"ShowDel"` + + // 删除是否可点击 + // 注意:此字段可能返回 null,表示取不到有效值。 + IsDel *bool `json:"IsDel,omitnil" name:"IsDel"` + + // 删除按钮的文本 + // 注意:此字段可能返回 null,表示取不到有效值。 + DelText *string `json:"DelText,omitnil" name:"DelText"` + + // 删除不可用时的提示文本 + // 注意:此字段可能返回 null,表示取不到有效值。 + DelTips *string `json:"DelTips,omitnil" name:"DelTips"` + + // 复制是否可见 + // 注意:此字段可能返回 null,表示取不到有效值。 + ShowCopy *bool `json:"ShowCopy,omitnil" name:"ShowCopy"` + + // 是否可见 + // 注意:此字段可能返回 null,表示取不到有效值。 + ShowView *bool `json:"ShowView,omitnil" name:"ShowView"` + + // 是否可重命名 + // 注意:此字段可能返回 null,表示取不到有效值。 + ShowRename *bool `json:"ShowRename,omitnil" name:"ShowRename"` +} + +type CorpUserListData struct { + // 列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + List []*UserIdAndUserName `json:"List,omitnil" name:"List"` + + // 总数 + Total *int64 `json:"Total,omitnil" name:"Total"` + + // 页数 + TotalPages *int64 `json:"TotalPages,omitnil" name:"TotalPages"` +} + +// Predefined struct for user +type CreateDatasourceCloudRequestParams struct { + // 后端提供字典:域类型,1、腾讯云,2、本地 + ServiceType *string `json:"ServiceType,omitnil" name:"ServiceType"` + + // 驱动 + DbType *string `json:"DbType,omitnil" name:"DbType"` + + // 数据库编码 + Charset *string `json:"Charset,omitnil" name:"Charset"` + + // 用户名 + DbUser *string `json:"DbUser,omitnil" name:"DbUser"` + + // 密码 + DbPwd *string `json:"DbPwd,omitnil" name:"DbPwd"` + + // 数据库名称 + DbName *string `json:"DbName,omitnil" name:"DbName"` + + // 数据库别名 + SourceName *string `json:"SourceName,omitnil" name:"SourceName"` + + // 项目ID + ProjectId *string `json:"ProjectId,omitnil" name:"ProjectId"` + + // 公有云内网ip + Vip *string `json:"Vip,omitnil" name:"Vip"` + + // 公有云内网端口 + Vport *string `json:"Vport,omitnil" name:"Vport"` + + // vpc标识 + VpcId *string `json:"VpcId,omitnil" name:"VpcId"` + + // 统一vpc标识 + UniqVpcId *string `json:"UniqVpcId,omitnil" name:"UniqVpcId"` + + // 区域标识(gz,bj) + RegionId *string `json:"RegionId,omitnil" name:"RegionId"` + + // 扩展参数 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // 实例Id + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 数据源产品名 + ProdDbName *string `json:"ProdDbName,omitnil" name:"ProdDbName"` + + // 第三方数据源标识 + DataOrigin *string `json:"DataOrigin,omitnil" name:"DataOrigin"` + + // 第三方项目id + DataOriginProjectId *string `json:"DataOriginProjectId,omitnil" name:"DataOriginProjectId"` + + // 第三方数据源id + DataOriginDatasourceId *string `json:"DataOriginDatasourceId,omitnil" name:"DataOriginDatasourceId"` +} + +type CreateDatasourceCloudRequest struct { + *tchttp.BaseRequest + + // 后端提供字典:域类型,1、腾讯云,2、本地 + ServiceType *string `json:"ServiceType,omitnil" name:"ServiceType"` + + // 驱动 + DbType *string `json:"DbType,omitnil" name:"DbType"` + + // 数据库编码 + Charset *string `json:"Charset,omitnil" name:"Charset"` + + // 用户名 + DbUser *string `json:"DbUser,omitnil" name:"DbUser"` + + // 密码 + DbPwd *string `json:"DbPwd,omitnil" name:"DbPwd"` + + // 数据库名称 + DbName *string `json:"DbName,omitnil" name:"DbName"` + + // 数据库别名 + SourceName *string `json:"SourceName,omitnil" name:"SourceName"` + + // 项目ID + ProjectId *string `json:"ProjectId,omitnil" name:"ProjectId"` + + // 公有云内网ip + Vip *string `json:"Vip,omitnil" name:"Vip"` + + // 公有云内网端口 + Vport *string `json:"Vport,omitnil" name:"Vport"` + + // vpc标识 + VpcId *string `json:"VpcId,omitnil" name:"VpcId"` + + // 统一vpc标识 + UniqVpcId *string `json:"UniqVpcId,omitnil" name:"UniqVpcId"` + + // 区域标识(gz,bj) + RegionId *string `json:"RegionId,omitnil" name:"RegionId"` + + // 扩展参数 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // 实例Id + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 数据源产品名 + ProdDbName *string `json:"ProdDbName,omitnil" name:"ProdDbName"` + + // 第三方数据源标识 + DataOrigin *string `json:"DataOrigin,omitnil" name:"DataOrigin"` + + // 第三方项目id + DataOriginProjectId *string `json:"DataOriginProjectId,omitnil" name:"DataOriginProjectId"` + + // 第三方数据源id + DataOriginDatasourceId *string `json:"DataOriginDatasourceId,omitnil" name:"DataOriginDatasourceId"` +} + +func (r *CreateDatasourceCloudRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDatasourceCloudRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ServiceType") + delete(f, "DbType") + delete(f, "Charset") + delete(f, "DbUser") + delete(f, "DbPwd") + delete(f, "DbName") + delete(f, "SourceName") + delete(f, "ProjectId") + delete(f, "Vip") + delete(f, "Vport") + delete(f, "VpcId") + delete(f, "UniqVpcId") + delete(f, "RegionId") + delete(f, "ExtraParam") + delete(f, "InstanceId") + delete(f, "ProdDbName") + delete(f, "DataOrigin") + delete(f, "DataOriginProjectId") + delete(f, "DataOriginDatasourceId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDatasourceCloudRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateDatasourceCloudResponseParams struct { + // 成功无 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *IdDTO `json:"Data,omitnil" name:"Data"` + + // 额外信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 提示 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type CreateDatasourceCloudResponse struct { + *tchttp.BaseResponse + Response *CreateDatasourceCloudResponseParams `json:"Response"` +} + +func (r *CreateDatasourceCloudResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDatasourceCloudResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateDatasourceRequestParams struct { + // HOST + DbHost *string `json:"DbHost,omitnil" name:"DbHost"` + + // 端口 + DbPort *uint64 `json:"DbPort,omitnil" name:"DbPort"` + + // 后端提供字典:域类型,1、腾讯云,2、本地 + ServiceType *string `json:"ServiceType,omitnil" name:"ServiceType"` + + // 驱动 + DbType *string `json:"DbType,omitnil" name:"DbType"` + + // 数据库编码 + Charset *string `json:"Charset,omitnil" name:"Charset"` + + // 用户名 + DbUser *string `json:"DbUser,omitnil" name:"DbUser"` + + // 密码 + DbPwd *string `json:"DbPwd,omitnil" name:"DbPwd"` + + // 数据库名称 + DbName *string `json:"DbName,omitnil" name:"DbName"` + + // 数据库别名 + SourceName *string `json:"SourceName,omitnil" name:"SourceName"` + + // 项目id + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // catalog值 + Catalog *string `json:"Catalog,omitnil" name:"Catalog"` + + // 第三方数据源标识 + DataOrigin *string `json:"DataOrigin,omitnil" name:"DataOrigin"` + + // 第三方项目id + DataOriginProjectId *string `json:"DataOriginProjectId,omitnil" name:"DataOriginProjectId"` + + // 第三方数据源id + DataOriginDatasourceId *string `json:"DataOriginDatasourceId,omitnil" name:"DataOriginDatasourceId"` + + // 扩展参数 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // 腾讯云私有网络统一标识 + UniqVpcId *string `json:"UniqVpcId,omitnil" name:"UniqVpcId"` + + // 私有网络ip + Vip *string `json:"Vip,omitnil" name:"Vip"` + + // 私有网络端口 + Vport *string `json:"Vport,omitnil" name:"Vport"` + + // 腾讯云私有网络标识 + VpcId *string `json:"VpcId,omitnil" name:"VpcId"` +} + +type CreateDatasourceRequest struct { + *tchttp.BaseRequest + + // HOST + DbHost *string `json:"DbHost,omitnil" name:"DbHost"` + + // 端口 + DbPort *uint64 `json:"DbPort,omitnil" name:"DbPort"` + + // 后端提供字典:域类型,1、腾讯云,2、本地 + ServiceType *string `json:"ServiceType,omitnil" name:"ServiceType"` + + // 驱动 + DbType *string `json:"DbType,omitnil" name:"DbType"` + + // 数据库编码 + Charset *string `json:"Charset,omitnil" name:"Charset"` + + // 用户名 + DbUser *string `json:"DbUser,omitnil" name:"DbUser"` + + // 密码 + DbPwd *string `json:"DbPwd,omitnil" name:"DbPwd"` + + // 数据库名称 + DbName *string `json:"DbName,omitnil" name:"DbName"` + + // 数据库别名 + SourceName *string `json:"SourceName,omitnil" name:"SourceName"` + + // 项目id + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // catalog值 + Catalog *string `json:"Catalog,omitnil" name:"Catalog"` + + // 第三方数据源标识 + DataOrigin *string `json:"DataOrigin,omitnil" name:"DataOrigin"` + + // 第三方项目id + DataOriginProjectId *string `json:"DataOriginProjectId,omitnil" name:"DataOriginProjectId"` + + // 第三方数据源id + DataOriginDatasourceId *string `json:"DataOriginDatasourceId,omitnil" name:"DataOriginDatasourceId"` + + // 扩展参数 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // 腾讯云私有网络统一标识 + UniqVpcId *string `json:"UniqVpcId,omitnil" name:"UniqVpcId"` + + // 私有网络ip + Vip *string `json:"Vip,omitnil" name:"Vip"` + + // 私有网络端口 + Vport *string `json:"Vport,omitnil" name:"Vport"` + + // 腾讯云私有网络标识 + VpcId *string `json:"VpcId,omitnil" name:"VpcId"` +} + +func (r *CreateDatasourceRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDatasourceRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DbHost") + delete(f, "DbPort") + delete(f, "ServiceType") + delete(f, "DbType") + delete(f, "Charset") + delete(f, "DbUser") + delete(f, "DbPwd") + delete(f, "DbName") + delete(f, "SourceName") + delete(f, "ProjectId") + delete(f, "Catalog") + delete(f, "DataOrigin") + delete(f, "DataOriginProjectId") + delete(f, "DataOriginDatasourceId") + delete(f, "ExtraParam") + delete(f, "UniqVpcId") + delete(f, "Vip") + delete(f, "Vport") + delete(f, "VpcId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDatasourceRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateDatasourceResponseParams struct { + // 数据源id + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *IdDTO `json:"Data,omitnil" name:"Data"` + + // 额外信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 提示 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type CreateDatasourceResponse struct { + *tchttp.BaseResponse + Response *CreateDatasourceResponseParams `json:"Response"` +} + +func (r *CreateDatasourceResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateDatasourceResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateEmbedTokenRequestParams struct { + // 分享项目id + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 分享页面id,嵌出看板时此为空值0 + PageId *uint64 `json:"PageId,omitnil" name:"PageId"` + + // page表示嵌出页面,panel表嵌出整个看板 + Scope *string `json:"Scope,omitnil" name:"Scope"` + + // 过期时间。 单位:分钟 最大值:240。即,4小时 默认值:240 + ExpireTime *string `json:"ExpireTime,omitnil" name:"ExpireTime"` + + // 备用字段 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // 使用者企业Id(仅用于多用户) + UserCorpId *string `json:"UserCorpId,omitnil" name:"UserCorpId"` + + // 使用者Id(仅用于多用户) + UserId *string `json:"UserId,omitnil" name:"UserId"` +} + +type CreateEmbedTokenRequest struct { + *tchttp.BaseRequest + + // 分享项目id + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 分享页面id,嵌出看板时此为空值0 + PageId *uint64 `json:"PageId,omitnil" name:"PageId"` + + // page表示嵌出页面,panel表嵌出整个看板 + Scope *string `json:"Scope,omitnil" name:"Scope"` + + // 过期时间。 单位:分钟 最大值:240。即,4小时 默认值:240 + ExpireTime *string `json:"ExpireTime,omitnil" name:"ExpireTime"` + + // 备用字段 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // 使用者企业Id(仅用于多用户) + UserCorpId *string `json:"UserCorpId,omitnil" name:"UserCorpId"` + + // 使用者Id(仅用于多用户) + UserId *string `json:"UserId,omitnil" name:"UserId"` +} + +func (r *CreateEmbedTokenRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateEmbedTokenRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ProjectId") + delete(f, "PageId") + delete(f, "Scope") + delete(f, "ExpireTime") + delete(f, "ExtraParam") + delete(f, "UserCorpId") + delete(f, "UserId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateEmbedTokenRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateEmbedTokenResponseParams struct { + // 额外信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *EmbedTokenInfo `json:"Data,omitnil" name:"Data"` + + // 结果描述 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type CreateEmbedTokenResponse struct { + *tchttp.BaseResponse + Response *CreateEmbedTokenResponseParams `json:"Response"` +} + +func (r *CreateEmbedTokenResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateEmbedTokenResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateProjectRequestParams struct { + // 项目名称 + Name *string `json:"Name,omitnil" name:"Name"` + + // logo底色 + ColorCode *string `json:"ColorCode,omitnil" name:"ColorCode"` + + // 项目Logo + Logo *string `json:"Logo,omitnil" name:"Logo"` + + // 备注 + Mark *string `json:"Mark,omitnil" name:"Mark"` + + // 是否允许用户申请 + IsApply *bool `json:"IsApply,omitnil" name:"IsApply"` + + // 默认看板 + DefaultPanelType *int64 `json:"DefaultPanelType,omitnil" name:"DefaultPanelType"` +} + +type CreateProjectRequest struct { + *tchttp.BaseRequest + + // 项目名称 + Name *string `json:"Name,omitnil" name:"Name"` + + // logo底色 + ColorCode *string `json:"ColorCode,omitnil" name:"ColorCode"` + + // 项目Logo + Logo *string `json:"Logo,omitnil" name:"Logo"` + + // 备注 + Mark *string `json:"Mark,omitnil" name:"Mark"` + + // 是否允许用户申请 + IsApply *bool `json:"IsApply,omitnil" name:"IsApply"` + + // 默认看板 + DefaultPanelType *int64 `json:"DefaultPanelType,omitnil" name:"DefaultPanelType"` +} + +func (r *CreateProjectRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateProjectRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Name") + delete(f, "ColorCode") + delete(f, "Logo") + delete(f, "Mark") + delete(f, "IsApply") + delete(f, "DefaultPanelType") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateProjectRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateProjectResponseParams struct { + // 额外数据 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 数据 + Data *Data `json:"Data,omitnil" name:"Data"` + + // 返回信息 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type CreateProjectResponse struct { + *tchttp.BaseResponse + Response *CreateProjectResponseParams `json:"Response"` +} + +func (r *CreateProjectResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateProjectResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateUserRoleProjectRequestParams struct { + // 项目ID + ProjectId *int64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 角色ID列表 + RoleIdList []*int64 `json:"RoleIdList,omitnil" name:"RoleIdList"` + + // 用户列表(废弃) + UserList []*UserIdAndUserName `json:"UserList,omitnil" name:"UserList"` + + // 用户列表(新) + UserInfoList []*UserInfo `json:"UserInfoList,omitnil" name:"UserInfoList"` +} + +type CreateUserRoleProjectRequest struct { + *tchttp.BaseRequest + + // 项目ID + ProjectId *int64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 角色ID列表 + RoleIdList []*int64 `json:"RoleIdList,omitnil" name:"RoleIdList"` + + // 用户列表(废弃) + UserList []*UserIdAndUserName `json:"UserList,omitnil" name:"UserList"` + + // 用户列表(新) + UserInfoList []*UserInfo `json:"UserInfoList,omitnil" name:"UserInfoList"` +} + +func (r *CreateUserRoleProjectRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateUserRoleProjectRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ProjectId") + delete(f, "RoleIdList") + delete(f, "UserList") + delete(f, "UserInfoList") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateUserRoleProjectRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateUserRoleProjectResponseParams struct { + // 扩展 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *DataId `json:"Data,omitnil" name:"Data"` + + // 消息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type CreateUserRoleProjectResponse struct { + *tchttp.BaseResponse + Response *CreateUserRoleProjectResponseParams `json:"Response"` +} + +func (r *CreateUserRoleProjectResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateUserRoleProjectResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateUserRoleRequestParams struct { + // 角色ID列表 + RoleIdList []*int64 `json:"RoleIdList,omitnil" name:"RoleIdList"` + + // 用户列表(废弃) + UserList []*UserIdAndUserName `json:"UserList,omitnil" name:"UserList"` + + // 用户列表(新) + UserInfoList []*UserInfo `json:"UserInfoList,omitnil" name:"UserInfoList"` +} + +type CreateUserRoleRequest struct { + *tchttp.BaseRequest + + // 角色ID列表 + RoleIdList []*int64 `json:"RoleIdList,omitnil" name:"RoleIdList"` + + // 用户列表(废弃) + UserList []*UserIdAndUserName `json:"UserList,omitnil" name:"UserList"` + + // 用户列表(新) + UserInfoList []*UserInfo `json:"UserInfoList,omitnil" name:"UserInfoList"` +} + +func (r *CreateUserRoleRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateUserRoleRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "RoleIdList") + delete(f, "UserList") + delete(f, "UserInfoList") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateUserRoleRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateUserRoleResponseParams struct { + // 扩展 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *DataId `json:"Data,omitnil" name:"Data"` + + // 消息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type CreateUserRoleResponse struct { + *tchttp.BaseResponse + Response *CreateUserRoleResponseParams `json:"Response"` +} + +func (r *CreateUserRoleResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *CreateUserRoleResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type Data struct { + // 项目Id + Id *int64 `json:"Id,omitnil" name:"Id"` +} + +type DataId struct { + // 数据id + // 注意:此字段可能返回 null,表示取不到有效值。 + Id *int64 `json:"Id,omitnil" name:"Id"` +} + +type DatasourceInfo struct { + // 数据库ID + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 数据库名称 + DbName *string `json:"DbName,omitnil" name:"DbName"` + + // 域类型,1、腾讯云,2、本地 + // 注意:此字段可能返回 null,表示取不到有效值。 + ServiceType *string `json:"ServiceType,omitnil" name:"ServiceType"` + + // 数据库别名 + SourceName *string `json:"SourceName,omitnil" name:"SourceName"` + + // 数据库驱动 + DbType *string `json:"DbType,omitnil" name:"DbType"` + + // HOST + DbHost *string `json:"DbHost,omitnil" name:"DbHost"` + + // 端口 + DbPort *uint64 `json:"DbPort,omitnil" name:"DbPort"` + + // 用户名 + DbUser *string `json:"DbUser,omitnil" name:"DbUser"` + + // 数据库编码 + Charset *string `json:"Charset,omitnil" name:"Charset"` + + // 创建时间 + CreatedAt *string `json:"CreatedAt,omitnil" name:"CreatedAt"` + + // 修改时间 + UpdatedAt *string `json:"UpdatedAt,omitnil" name:"UpdatedAt"` + + // 创建人 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreatedUser *string `json:"CreatedUser,omitnil" name:"CreatedUser"` + + // catalog值 + // 注意:此字段可能返回 null,表示取不到有效值。 + Catalog *string `json:"Catalog,omitnil" name:"Catalog"` + + // 连接类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + ConnectType *string `json:"ConnectType,omitnil" name:"ConnectType"` + + // 项目id + // 注意:此字段可能返回 null,表示取不到有效值。 + ProjectId *string `json:"ProjectId,omitnil" name:"ProjectId"` + + // 数据源描述 + // 注意:此字段可能返回 null,表示取不到有效值。 + Desc *string `json:"Desc,omitnil" name:"Desc"` + + // 数据源状态 + // 注意:此字段可能返回 null,表示取不到有效值。 + Status *string `json:"Status,omitnil" name:"Status"` + + // 来源平台 + // 注意:此字段可能返回 null,表示取不到有效值。 + SourcePlat *string `json:"SourcePlat,omitnil" name:"SourcePlat"` + + // 扩展参数 + // 注意:此字段可能返回 null,表示取不到有效值。 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // 额外信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + AddInfo *string `json:"AddInfo,omitnil" name:"AddInfo"` + + // 项目名字 + // 注意:此字段可能返回 null,表示取不到有效值。 + ProjectName *string `json:"ProjectName,omitnil" name:"ProjectName"` + + // 引擎类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + EngineType *string `json:"EngineType,omitnil" name:"EngineType"` + + // 数据源负责人 + // 注意:此字段可能返回 null,表示取不到有效值。 + Manager *string `json:"Manager,omitnil" name:"Manager"` + + // 特定操作人员白名单 + // 注意:此字段可能返回 null,表示取不到有效值。 + OperatorWhitelist *string `json:"OperatorWhitelist,omitnil" name:"OperatorWhitelist"` + + // 数据源的vpc信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + VpcId *string `json:"VpcId,omitnil" name:"VpcId"` + + // 数据源的uniqVpc信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + UniqVpcId *string `json:"UniqVpcId,omitnil" name:"UniqVpcId"` + + // 数据源的地域信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + RegionId *string `json:"RegionId,omitnil" name:"RegionId"` + + // 操作属性 + // 注意:此字段可能返回 null,表示取不到有效值。 + StateAction *BaseStateAction `json:"StateAction,omitnil" name:"StateAction"` + + // 更新人 + // 注意:此字段可能返回 null,表示取不到有效值。 + UpdatedUser *string `json:"UpdatedUser,omitnil" name:"UpdatedUser"` + + // 权限列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + PermissionList []*PermissionGroup `json:"PermissionList,omitnil" name:"PermissionList"` + + // 权限值列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + AuthList []*string `json:"AuthList,omitnil" name:"AuthList"` + + // 第三方数据源标识 + // 注意:此字段可能返回 null,表示取不到有效值。 + DataOrigin *string `json:"DataOrigin,omitnil" name:"DataOrigin"` + + // 第三方项目id + // 注意:此字段可能返回 null,表示取不到有效值。 + DataOriginProjectId *string `json:"DataOriginProjectId,omitnil" name:"DataOriginProjectId"` + + // 第三方数据源id + // 注意:此字段可能返回 null,表示取不到有效值。 + DataOriginDatasourceId *string `json:"DataOriginDatasourceId,omitnil" name:"DataOriginDatasourceId"` +} + +type DatasourceInfoData struct { + // 数据源详情列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + List []*DatasourceInfo `json:"List,omitnil" name:"List"` + + // 总数 + // 注意:此字段可能返回 null,表示取不到有效值。 + Total *int64 `json:"Total,omitnil" name:"Total"` + + // 总页数 + // 注意:此字段可能返回 null,表示取不到有效值。 + TotalPages *int64 `json:"TotalPages,omitnil" name:"TotalPages"` +} + +// Predefined struct for user +type DeleteDatasourceRequestParams struct { + // 数据源id + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 项目id + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` +} + +type DeleteDatasourceRequest struct { + *tchttp.BaseRequest + + // 数据源id + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 项目id + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` +} + +func (r *DeleteDatasourceRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteDatasourceRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Id") + delete(f, "ProjectId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDatasourceRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteDatasourceResponseParams struct { + // 数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *string `json:"Data,omitnil" name:"Data"` + + // 扩展 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 信息 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DeleteDatasourceResponse struct { + *tchttp.BaseResponse + Response *DeleteDatasourceResponseParams `json:"Response"` +} + +func (r *DeleteDatasourceResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteDatasourceResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteProjectRequestParams struct { + // 项目ID + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 随机数 + Seed *string `json:"Seed,omitnil" name:"Seed"` + + // 默认看板 + DefaultPanelType *int64 `json:"DefaultPanelType,omitnil" name:"DefaultPanelType"` +} + +type DeleteProjectRequest struct { + *tchttp.BaseRequest + + // 项目ID + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 随机数 + Seed *string `json:"Seed,omitnil" name:"Seed"` + + // 默认看板 + DefaultPanelType *int64 `json:"DefaultPanelType,omitnil" name:"DefaultPanelType"` +} + +func (r *DeleteProjectRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteProjectRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Id") + delete(f, "Seed") + delete(f, "DefaultPanelType") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteProjectRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteProjectResponseParams struct { + // ”“ + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // "" + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *string `json:"Data,omitnil" name:"Data"` + + // "" + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DeleteProjectResponse struct { + *tchttp.BaseResponse + Response *DeleteProjectResponseParams `json:"Response"` +} + +func (r *DeleteProjectResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteProjectResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteUserRoleProjectRequestParams struct { + // 项目ID + ProjectId *int64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 用户ID + UserId *string `json:"UserId,omitnil" name:"UserId"` +} + +type DeleteUserRoleProjectRequest struct { + *tchttp.BaseRequest + + // 项目ID + ProjectId *int64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 用户ID + UserId *string `json:"UserId,omitnil" name:"UserId"` +} + +func (r *DeleteUserRoleProjectRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteUserRoleProjectRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ProjectId") + delete(f, "UserId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteUserRoleProjectRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteUserRoleProjectResponseParams struct { + // 扩展 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *string `json:"Data,omitnil" name:"Data"` + + // 消息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DeleteUserRoleProjectResponse struct { + *tchttp.BaseResponse + Response *DeleteUserRoleProjectResponseParams `json:"Response"` +} + +func (r *DeleteUserRoleProjectResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteUserRoleProjectResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteUserRoleRequestParams struct { + // 用户ID + UserId *string `json:"UserId,omitnil" name:"UserId"` +} + +type DeleteUserRoleRequest struct { + *tchttp.BaseRequest + + // 用户ID + UserId *string `json:"UserId,omitnil" name:"UserId"` +} + +func (r *DeleteUserRoleRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteUserRoleRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "UserId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteUserRoleRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteUserRoleResponseParams struct { + // 扩展 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *string `json:"Data,omitnil" name:"Data"` + + // 消息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DeleteUserRoleResponse struct { + *tchttp.BaseResponse + Response *DeleteUserRoleResponseParams `json:"Response"` +} + +func (r *DeleteUserRoleResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DeleteUserRoleResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDatasourceListRequestParams struct { + // 无 + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 返回所有页面,默认false + AllPage *bool `json:"AllPage,omitnil" name:"AllPage"` + + // 数据库名称检索 + DbName *string `json:"DbName,omitnil" name:"DbName"` + + // 无 + PageNo *int64 `json:"PageNo,omitnil" name:"PageNo"` + + // 无 + PageSize *int64 `json:"PageSize,omitnil" name:"PageSize"` + + // 搜索关键词 + Keyword *string `json:"Keyword,omitnil" name:"Keyword"` + + // 过滤无权限列表的参数(0 全量,1 使用权限,2 编辑权限) + PermissionType *int64 `json:"PermissionType,omitnil" name:"PermissionType"` +} + +type DescribeDatasourceListRequest struct { + *tchttp.BaseRequest + + // 无 + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 返回所有页面,默认false + AllPage *bool `json:"AllPage,omitnil" name:"AllPage"` + + // 数据库名称检索 + DbName *string `json:"DbName,omitnil" name:"DbName"` + + // 无 + PageNo *int64 `json:"PageNo,omitnil" name:"PageNo"` + + // 无 + PageSize *int64 `json:"PageSize,omitnil" name:"PageSize"` + + // 搜索关键词 + Keyword *string `json:"Keyword,omitnil" name:"Keyword"` + + // 过滤无权限列表的参数(0 全量,1 使用权限,2 编辑权限) + PermissionType *int64 `json:"PermissionType,omitnil" name:"PermissionType"` +} + +func (r *DescribeDatasourceListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeDatasourceListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ProjectId") + delete(f, "AllPage") + delete(f, "DbName") + delete(f, "PageNo") + delete(f, "PageSize") + delete(f, "Keyword") + delete(f, "PermissionType") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDatasourceListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDatasourceListResponseParams struct { + // 列表详情 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *DatasourceInfoData `json:"Data,omitnil" name:"Data"` + + // 信息 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 信息 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DescribeDatasourceListResponse struct { + *tchttp.BaseResponse + Response *DescribeDatasourceListResponseParams `json:"Response"` +} + +func (r *DescribeDatasourceListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeDatasourceListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeProjectInfoRequestParams struct { + // 项目Id + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 默认看板 + DefaultPanelType *int64 `json:"DefaultPanelType,omitnil" name:"DefaultPanelType"` +} + +type DescribeProjectInfoRequest struct { + *tchttp.BaseRequest + + // 项目Id + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 默认看板 + DefaultPanelType *int64 `json:"DefaultPanelType,omitnil" name:"DefaultPanelType"` +} + +func (r *DescribeProjectInfoRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeProjectInfoRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Id") + delete(f, "DefaultPanelType") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeProjectInfoRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeProjectInfoResponseParams struct { + // "" + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // "" + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 项目详情 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *Project `json:"Data,omitnil" name:"Data"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DescribeProjectInfoResponse struct { + *tchttp.BaseResponse + Response *DescribeProjectInfoResponseParams `json:"Response"` +} + +func (r *DescribeProjectInfoResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeProjectInfoResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeProjectListRequestParams struct { + // 页容,初版默认20,将来可能根据屏幕宽度动态变化 + PageSize *uint64 `json:"PageSize,omitnil" name:"PageSize"` + + // 页标 + PageNo *uint64 `json:"PageNo,omitnil" name:"PageNo"` + + // 检索模糊字段 + Keyword *string `json:"Keyword,omitnil" name:"Keyword"` + + // 是否全部展示,如果是ture,则忽略分页 + AllPage *bool `json:"AllPage,omitnil" name:"AllPage"` + + // 角色信息 + ModuleCollection *string `json:"ModuleCollection,omitnil" name:"ModuleCollection"` +} + +type DescribeProjectListRequest struct { + *tchttp.BaseRequest + + // 页容,初版默认20,将来可能根据屏幕宽度动态变化 + PageSize *uint64 `json:"PageSize,omitnil" name:"PageSize"` + + // 页标 + PageNo *uint64 `json:"PageNo,omitnil" name:"PageNo"` + + // 检索模糊字段 + Keyword *string `json:"Keyword,omitnil" name:"Keyword"` + + // 是否全部展示,如果是ture,则忽略分页 + AllPage *bool `json:"AllPage,omitnil" name:"AllPage"` + + // 角色信息 + ModuleCollection *string `json:"ModuleCollection,omitnil" name:"ModuleCollection"` +} + +func (r *DescribeProjectListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeProjectListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "PageSize") + delete(f, "PageNo") + delete(f, "Keyword") + delete(f, "AllPage") + delete(f, "ModuleCollection") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeProjectListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeProjectListResponseParams struct { + // 额外信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 接口信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *ProjectListData `json:"Data,omitnil" name:"Data"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DescribeProjectListResponse struct { + *tchttp.BaseResponse + Response *DescribeProjectListResponseParams `json:"Response"` +} + +func (r *DescribeProjectListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeProjectListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserProjectListRequestParams struct { + // 项目ID + ProjectId *int64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 无 + AllPage *bool `json:"AllPage,omitnil" name:"AllPage"` + + // 无 + PageNo *int64 `json:"PageNo,omitnil" name:"PageNo"` + + // 无 + PageSize *int64 `json:"PageSize,omitnil" name:"PageSize"` +} + +type DescribeUserProjectListRequest struct { + *tchttp.BaseRequest + + // 项目ID + ProjectId *int64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 无 + AllPage *bool `json:"AllPage,omitnil" name:"AllPage"` + + // 无 + PageNo *int64 `json:"PageNo,omitnil" name:"PageNo"` + + // 无 + PageSize *int64 `json:"PageSize,omitnil" name:"PageSize"` +} + +func (r *DescribeUserProjectListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeUserProjectListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ProjectId") + delete(f, "AllPage") + delete(f, "PageNo") + delete(f, "PageSize") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeUserProjectListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserProjectListResponseParams struct { + // 数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *CorpUserListData `json:"Data,omitnil" name:"Data"` + + // 扩展 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 消息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DescribeUserProjectListResponse struct { + *tchttp.BaseResponse + Response *DescribeUserProjectListResponseParams `json:"Response"` +} + +func (r *DescribeUserProjectListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeUserProjectListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserRoleListRequestParams struct { + // 页码 + PageNo *int64 `json:"PageNo,omitnil" name:"PageNo"` + + // 页数 + PageSize *int64 `json:"PageSize,omitnil" name:"PageSize"` + + // 全部页码 + AllPage *bool `json:"AllPage,omitnil" name:"AllPage"` + + // 0 企业用户 1 访客 不填表示所有用户 + UserType *string `json:"UserType,omitnil" name:"UserType"` + + // 模糊搜索的关键字 + Keyword *string `json:"Keyword,omitnil" name:"Keyword"` + + // 项目id + ProjectId *string `json:"ProjectId,omitnil" name:"ProjectId"` +} + +type DescribeUserRoleListRequest struct { + *tchttp.BaseRequest + + // 页码 + PageNo *int64 `json:"PageNo,omitnil" name:"PageNo"` + + // 页数 + PageSize *int64 `json:"PageSize,omitnil" name:"PageSize"` + + // 全部页码 + AllPage *bool `json:"AllPage,omitnil" name:"AllPage"` + + // 0 企业用户 1 访客 不填表示所有用户 + UserType *string `json:"UserType,omitnil" name:"UserType"` + + // 模糊搜索的关键字 + Keyword *string `json:"Keyword,omitnil" name:"Keyword"` + + // 项目id + ProjectId *string `json:"ProjectId,omitnil" name:"ProjectId"` +} + +func (r *DescribeUserRoleListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeUserRoleListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "PageNo") + delete(f, "PageSize") + delete(f, "AllPage") + delete(f, "UserType") + delete(f, "Keyword") + delete(f, "ProjectId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeUserRoleListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserRoleListResponseParams struct { + // 扩展 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *UserRoleListData `json:"Data,omitnil" name:"Data"` + + // 消息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DescribeUserRoleListResponse struct { + *tchttp.BaseResponse + Response *DescribeUserRoleListResponseParams `json:"Response"` +} + +func (r *DescribeUserRoleListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeUserRoleListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserRoleProjectListRequestParams struct { + // 页码 + PageNo *int64 `json:"PageNo,omitnil" name:"PageNo"` + + // 页数 + PageSize *int64 `json:"PageSize,omitnil" name:"PageSize"` + + // 项目ID + ProjectId *int64 `json:"ProjectId,omitnil" name:"ProjectId"` +} + +type DescribeUserRoleProjectListRequest struct { + *tchttp.BaseRequest + + // 页码 + PageNo *int64 `json:"PageNo,omitnil" name:"PageNo"` + + // 页数 + PageSize *int64 `json:"PageSize,omitnil" name:"PageSize"` + + // 项目ID + ProjectId *int64 `json:"ProjectId,omitnil" name:"ProjectId"` +} + +func (r *DescribeUserRoleProjectListRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeUserRoleProjectListRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "PageNo") + delete(f, "PageSize") + delete(f, "ProjectId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeUserRoleProjectListRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserRoleProjectListResponseParams struct { + // 扩展 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *UserRoleListData `json:"Data,omitnil" name:"Data"` + + // 消息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type DescribeUserRoleProjectListResponse struct { + *tchttp.BaseResponse + Response *DescribeUserRoleProjectListResponseParams `json:"Response"` +} + +func (r *DescribeUserRoleProjectListResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *DescribeUserRoleProjectListResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type EmbedTokenInfo struct { + // 信息标识 + // 注意:此字段可能返回 null,表示取不到有效值。 + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 令牌 + // 注意:此字段可能返回 null,表示取不到有效值。 + BIToken *string `json:"BIToken,omitnil" name:"BIToken"` + + // 项目Id + // 注意:此字段可能返回 null,表示取不到有效值。 + ProjectId *string `json:"ProjectId,omitnil" name:"ProjectId"` + + // 创建人 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreatedUser *string `json:"CreatedUser,omitnil" name:"CreatedUser"` + + // 创建时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreatedAt *string `json:"CreatedAt,omitnil" name:"CreatedAt"` + + // 更新人 + // 注意:此字段可能返回 null,表示取不到有效值。 + UpdatedUser *string `json:"UpdatedUser,omitnil" name:"UpdatedUser"` + + // 更新时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + UpdatedAt *string `json:"UpdatedAt,omitnil" name:"UpdatedAt"` + + // 页面Id + // 注意:此字段可能返回 null,表示取不到有效值。 + PageId *string `json:"PageId,omitnil" name:"PageId"` + + // 备用 + // 注意:此字段可能返回 null,表示取不到有效值。 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // 嵌出类型 + // 注意:此字段可能返回 null,表示取不到有效值。 + Scope *string `json:"Scope,omitnil" name:"Scope"` + + // 过期时间,分钟为单位,最大240 + // 注意:此字段可能返回 null,表示取不到有效值。 + ExpireTime *uint64 `json:"ExpireTime,omitnil" name:"ExpireTime"` + + // 使用者企业Id(仅用于多用户) + // 注意:此字段可能返回 null,表示取不到有效值。 + UserCorpId *string `json:"UserCorpId,omitnil" name:"UserCorpId"` + + // 使用者Id(仅用于多用户) + // 注意:此字段可能返回 null,表示取不到有效值。 + UserId *string `json:"UserId,omitnil" name:"UserId"` +} + +type IdDTO struct { + // 请求id + // 注意:此字段可能返回 null,表示取不到有效值。 + Id *int64 `json:"Id,omitnil" name:"Id"` + + // key + // 注意:此字段可能返回 null,表示取不到有效值。 + AccessKey *string `json:"AccessKey,omitnil" name:"AccessKey"` + + // id + // 注意:此字段可能返回 null,表示取不到有效值。 + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 事务id + // 注意:此字段可能返回 null,表示取不到有效值。 + TranId *string `json:"TranId,omitnil" name:"TranId"` + + // 事务状态 + // 注意:此字段可能返回 null,表示取不到有效值。 + TranStatus *int64 `json:"TranStatus,omitnil" name:"TranStatus"` +} + +// Predefined struct for user +type ModifyDatasourceCloudRequestParams struct { + // 后端提供字典:域类型,1、腾讯云,2、本地 + ServiceType *string `json:"ServiceType,omitnil" name:"ServiceType"` + + // 驱动 + DbType *string `json:"DbType,omitnil" name:"DbType"` + + // 数据库编码 + Charset *string `json:"Charset,omitnil" name:"Charset"` + + // 用户名 + DbUser *string `json:"DbUser,omitnil" name:"DbUser"` + + // 密码 + DbPwd *string `json:"DbPwd,omitnil" name:"DbPwd"` + + // 数据库名称 + DbName *string `json:"DbName,omitnil" name:"DbName"` + + // 数据库别名 + SourceName *string `json:"SourceName,omitnil" name:"SourceName"` + + // 项目ID + ProjectId *string `json:"ProjectId,omitnil" name:"ProjectId"` + + // 住键 + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 公有云内网ip + Vip *string `json:"Vip,omitnil" name:"Vip"` + + // 公有云内网端口 + Vport *string `json:"Vport,omitnil" name:"Vport"` + + // vpc标识 + VpcId *string `json:"VpcId,omitnil" name:"VpcId"` + + // 统一vpc标识 + UniqVpcId *string `json:"UniqVpcId,omitnil" name:"UniqVpcId"` + + // 区域标识(gz,bj) + RegionId *string `json:"RegionId,omitnil" name:"RegionId"` + + // 扩展参数 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // 实例id + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 数据源产品名 + ProdDbName *string `json:"ProdDbName,omitnil" name:"ProdDbName"` + + // 第三方数据源标识 + DataOrigin *string `json:"DataOrigin,omitnil" name:"DataOrigin"` + + // 第三方项目id + DataOriginProjectId *string `json:"DataOriginProjectId,omitnil" name:"DataOriginProjectId"` + + // 第三方数据源id + DataOriginDatasourceId *string `json:"DataOriginDatasourceId,omitnil" name:"DataOriginDatasourceId"` +} + +type ModifyDatasourceCloudRequest struct { + *tchttp.BaseRequest + + // 后端提供字典:域类型,1、腾讯云,2、本地 + ServiceType *string `json:"ServiceType,omitnil" name:"ServiceType"` + + // 驱动 + DbType *string `json:"DbType,omitnil" name:"DbType"` + + // 数据库编码 + Charset *string `json:"Charset,omitnil" name:"Charset"` + + // 用户名 + DbUser *string `json:"DbUser,omitnil" name:"DbUser"` + + // 密码 + DbPwd *string `json:"DbPwd,omitnil" name:"DbPwd"` + + // 数据库名称 + DbName *string `json:"DbName,omitnil" name:"DbName"` + + // 数据库别名 + SourceName *string `json:"SourceName,omitnil" name:"SourceName"` + + // 项目ID + ProjectId *string `json:"ProjectId,omitnil" name:"ProjectId"` + + // 住键 + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 公有云内网ip + Vip *string `json:"Vip,omitnil" name:"Vip"` + + // 公有云内网端口 + Vport *string `json:"Vport,omitnil" name:"Vport"` + + // vpc标识 + VpcId *string `json:"VpcId,omitnil" name:"VpcId"` + + // 统一vpc标识 + UniqVpcId *string `json:"UniqVpcId,omitnil" name:"UniqVpcId"` + + // 区域标识(gz,bj) + RegionId *string `json:"RegionId,omitnil" name:"RegionId"` + + // 扩展参数 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // 实例id + InstanceId *string `json:"InstanceId,omitnil" name:"InstanceId"` + + // 数据源产品名 + ProdDbName *string `json:"ProdDbName,omitnil" name:"ProdDbName"` + + // 第三方数据源标识 + DataOrigin *string `json:"DataOrigin,omitnil" name:"DataOrigin"` + + // 第三方项目id + DataOriginProjectId *string `json:"DataOriginProjectId,omitnil" name:"DataOriginProjectId"` + + // 第三方数据源id + DataOriginDatasourceId *string `json:"DataOriginDatasourceId,omitnil" name:"DataOriginDatasourceId"` +} + +func (r *ModifyDatasourceCloudRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyDatasourceCloudRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ServiceType") + delete(f, "DbType") + delete(f, "Charset") + delete(f, "DbUser") + delete(f, "DbPwd") + delete(f, "DbName") + delete(f, "SourceName") + delete(f, "ProjectId") + delete(f, "Id") + delete(f, "Vip") + delete(f, "Vport") + delete(f, "VpcId") + delete(f, "UniqVpcId") + delete(f, "RegionId") + delete(f, "ExtraParam") + delete(f, "InstanceId") + delete(f, "ProdDbName") + delete(f, "DataOrigin") + delete(f, "DataOriginProjectId") + delete(f, "DataOriginDatasourceId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyDatasourceCloudRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyDatasourceCloudResponseParams struct { + // 成功无 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *string `json:"Data,omitnil" name:"Data"` + + // 额外信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 提示 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type ModifyDatasourceCloudResponse struct { + *tchttp.BaseResponse + Response *ModifyDatasourceCloudResponseParams `json:"Response"` +} + +func (r *ModifyDatasourceCloudResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyDatasourceCloudResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyDatasourceRequestParams struct { + // HOST + DbHost *string `json:"DbHost,omitnil" name:"DbHost"` + + // 端口 + DbPort *uint64 `json:"DbPort,omitnil" name:"DbPort"` + + // 后端提供字典:域类型,1、腾讯云,2、本地 + ServiceType *string `json:"ServiceType,omitnil" name:"ServiceType"` + + // 驱动 + DbType *string `json:"DbType,omitnil" name:"DbType"` + + // 数据库编码 + Charset *string `json:"Charset,omitnil" name:"Charset"` + + // 用户名 + DbUser *string `json:"DbUser,omitnil" name:"DbUser"` + + // 密码 + DbPwd *string `json:"DbPwd,omitnil" name:"DbPwd"` + + // 数据库名称 + DbName *string `json:"DbName,omitnil" name:"DbName"` + + // 数据库别名 + SourceName *string `json:"SourceName,omitnil" name:"SourceName"` + + // 数据源id + Id *int64 `json:"Id,omitnil" name:"Id"` + + // 项目ID + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // catalog值 + Catalog *string `json:"Catalog,omitnil" name:"Catalog"` + + // 第三方数据源标识 + DataOrigin *string `json:"DataOrigin,omitnil" name:"DataOrigin"` + + // 第三方项目id + DataOriginProjectId *string `json:"DataOriginProjectId,omitnil" name:"DataOriginProjectId"` + + // 第三方数据源id + DataOriginDatasourceId *string `json:"DataOriginDatasourceId,omitnil" name:"DataOriginDatasourceId"` + + // 扩展参数 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // 腾讯云私有网络统一标识 + UniqVpcId *string `json:"UniqVpcId,omitnil" name:"UniqVpcId"` + + // 私有网络ip + Vip *string `json:"Vip,omitnil" name:"Vip"` + + // 私有网络端口 + Vport *string `json:"Vport,omitnil" name:"Vport"` + + // 腾讯云私有网络标识 + VpcId *string `json:"VpcId,omitnil" name:"VpcId"` +} + +type ModifyDatasourceRequest struct { + *tchttp.BaseRequest + + // HOST + DbHost *string `json:"DbHost,omitnil" name:"DbHost"` + + // 端口 + DbPort *uint64 `json:"DbPort,omitnil" name:"DbPort"` + + // 后端提供字典:域类型,1、腾讯云,2、本地 + ServiceType *string `json:"ServiceType,omitnil" name:"ServiceType"` + + // 驱动 + DbType *string `json:"DbType,omitnil" name:"DbType"` + + // 数据库编码 + Charset *string `json:"Charset,omitnil" name:"Charset"` + + // 用户名 + DbUser *string `json:"DbUser,omitnil" name:"DbUser"` + + // 密码 + DbPwd *string `json:"DbPwd,omitnil" name:"DbPwd"` + + // 数据库名称 + DbName *string `json:"DbName,omitnil" name:"DbName"` + + // 数据库别名 + SourceName *string `json:"SourceName,omitnil" name:"SourceName"` + + // 数据源id + Id *int64 `json:"Id,omitnil" name:"Id"` + + // 项目ID + ProjectId *uint64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // catalog值 + Catalog *string `json:"Catalog,omitnil" name:"Catalog"` + + // 第三方数据源标识 + DataOrigin *string `json:"DataOrigin,omitnil" name:"DataOrigin"` + + // 第三方项目id + DataOriginProjectId *string `json:"DataOriginProjectId,omitnil" name:"DataOriginProjectId"` + + // 第三方数据源id + DataOriginDatasourceId *string `json:"DataOriginDatasourceId,omitnil" name:"DataOriginDatasourceId"` + + // 扩展参数 + ExtraParam *string `json:"ExtraParam,omitnil" name:"ExtraParam"` + + // 腾讯云私有网络统一标识 + UniqVpcId *string `json:"UniqVpcId,omitnil" name:"UniqVpcId"` + + // 私有网络ip + Vip *string `json:"Vip,omitnil" name:"Vip"` + + // 私有网络端口 + Vport *string `json:"Vport,omitnil" name:"Vport"` + + // 腾讯云私有网络标识 + VpcId *string `json:"VpcId,omitnil" name:"VpcId"` +} + +func (r *ModifyDatasourceRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyDatasourceRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DbHost") + delete(f, "DbPort") + delete(f, "ServiceType") + delete(f, "DbType") + delete(f, "Charset") + delete(f, "DbUser") + delete(f, "DbPwd") + delete(f, "DbName") + delete(f, "SourceName") + delete(f, "Id") + delete(f, "ProjectId") + delete(f, "Catalog") + delete(f, "DataOrigin") + delete(f, "DataOriginProjectId") + delete(f, "DataOriginDatasourceId") + delete(f, "ExtraParam") + delete(f, "UniqVpcId") + delete(f, "Vip") + delete(f, "Vport") + delete(f, "VpcId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyDatasourceRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyDatasourceResponseParams struct { + // 无 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *string `json:"Data,omitnil" name:"Data"` + + // 额外信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 提示 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type ModifyDatasourceResponse struct { + *tchttp.BaseResponse + Response *ModifyDatasourceResponseParams `json:"Response"` +} + +func (r *ModifyDatasourceResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyDatasourceResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyProjectRequestParams struct { + // 项目Id + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 名字 + Name *string `json:"Name,omitnil" name:"Name"` + + // 颜色值 + ColorCode *string `json:"ColorCode,omitnil" name:"ColorCode"` + + // 图标 + Logo *string `json:"Logo,omitnil" name:"Logo"` + + // 备注 + Mark *string `json:"Mark,omitnil" name:"Mark"` + + // 可申请 + IsApply *bool `json:"IsApply,omitnil" name:"IsApply"` + + // 种子 + Seed *string `json:"Seed,omitnil" name:"Seed"` + + // 默认看板 + DefaultPanelType *int64 `json:"DefaultPanelType,omitnil" name:"DefaultPanelType"` + + // 2 + PanelScope *string `json:"PanelScope,omitnil" name:"PanelScope"` +} + +type ModifyProjectRequest struct { + *tchttp.BaseRequest + + // 项目Id + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 名字 + Name *string `json:"Name,omitnil" name:"Name"` + + // 颜色值 + ColorCode *string `json:"ColorCode,omitnil" name:"ColorCode"` + + // 图标 + Logo *string `json:"Logo,omitnil" name:"Logo"` + + // 备注 + Mark *string `json:"Mark,omitnil" name:"Mark"` + + // 可申请 + IsApply *bool `json:"IsApply,omitnil" name:"IsApply"` + + // 种子 + Seed *string `json:"Seed,omitnil" name:"Seed"` + + // 默认看板 + DefaultPanelType *int64 `json:"DefaultPanelType,omitnil" name:"DefaultPanelType"` + + // 2 + PanelScope *string `json:"PanelScope,omitnil" name:"PanelScope"` +} + +func (r *ModifyProjectRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyProjectRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Id") + delete(f, "Name") + delete(f, "ColorCode") + delete(f, "Logo") + delete(f, "Mark") + delete(f, "IsApply") + delete(f, "Seed") + delete(f, "DefaultPanelType") + delete(f, "PanelScope") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyProjectRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyProjectResponseParams struct { + // 额外信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 返回数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *string `json:"Data,omitnil" name:"Data"` + + // 结果 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type ModifyProjectResponse struct { + *tchttp.BaseResponse + Response *ModifyProjectResponseParams `json:"Response"` +} + +func (r *ModifyProjectResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyProjectResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyUserRoleProjectRequestParams struct { + // 项目ID + ProjectId *int64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 用户ID + UserId *string `json:"UserId,omitnil" name:"UserId"` + + // 角色ID 列表 + RoleIdList []*int64 `json:"RoleIdList,omitnil" name:"RoleIdList"` + + // 邮箱 + Email *string `json:"Email,omitnil" name:"Email"` + + // 用户名 + UserName *string `json:"UserName,omitnil" name:"UserName"` +} + +type ModifyUserRoleProjectRequest struct { + *tchttp.BaseRequest + + // 项目ID + ProjectId *int64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 用户ID + UserId *string `json:"UserId,omitnil" name:"UserId"` + + // 角色ID 列表 + RoleIdList []*int64 `json:"RoleIdList,omitnil" name:"RoleIdList"` + + // 邮箱 + Email *string `json:"Email,omitnil" name:"Email"` + + // 用户名 + UserName *string `json:"UserName,omitnil" name:"UserName"` +} + +func (r *ModifyUserRoleProjectRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyUserRoleProjectRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ProjectId") + delete(f, "UserId") + delete(f, "RoleIdList") + delete(f, "Email") + delete(f, "UserName") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyUserRoleProjectRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyUserRoleProjectResponseParams struct { + // 扩展 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 消息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *string `json:"Data,omitnil" name:"Data"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type ModifyUserRoleProjectResponse struct { + *tchttp.BaseResponse + Response *ModifyUserRoleProjectResponseParams `json:"Response"` +} + +func (r *ModifyUserRoleProjectResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyUserRoleProjectResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyUserRoleRequestParams struct { + // 用户ID + UserId *string `json:"UserId,omitnil" name:"UserId"` + + // 角色ID 列表 + RoleIdList []*int64 `json:"RoleIdList,omitnil" name:"RoleIdList"` + + // 邮箱 + Email *string `json:"Email,omitnil" name:"Email"` + + // 用户名 + UserName *string `json:"UserName,omitnil" name:"UserName"` + + // 手机号 + PhoneNumber *string `json:"PhoneNumber,omitnil" name:"PhoneNumber"` + + // 手机区号 + AreaCode *string `json:"AreaCode,omitnil" name:"AreaCode"` +} + +type ModifyUserRoleRequest struct { + *tchttp.BaseRequest + + // 用户ID + UserId *string `json:"UserId,omitnil" name:"UserId"` + + // 角色ID 列表 + RoleIdList []*int64 `json:"RoleIdList,omitnil" name:"RoleIdList"` + + // 邮箱 + Email *string `json:"Email,omitnil" name:"Email"` + + // 用户名 + UserName *string `json:"UserName,omitnil" name:"UserName"` + + // 手机号 + PhoneNumber *string `json:"PhoneNumber,omitnil" name:"PhoneNumber"` + + // 手机区号 + AreaCode *string `json:"AreaCode,omitnil" name:"AreaCode"` +} + +func (r *ModifyUserRoleRequest) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyUserRoleRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "UserId") + delete(f, "RoleIdList") + delete(f, "Email") + delete(f, "UserName") + delete(f, "PhoneNumber") + delete(f, "AreaCode") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyUserRoleRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyUserRoleResponseParams struct { + // 扩展 + // 注意:此字段可能返回 null,表示取不到有效值。 + Extra *string `json:"Extra,omitnil" name:"Extra"` + + // 消息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Msg *string `json:"Msg,omitnil" name:"Msg"` + + // 数据 + // 注意:此字段可能返回 null,表示取不到有效值。 + Data *string `json:"Data,omitnil" name:"Data"` + + // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil" name:"RequestId"` +} + +type ModifyUserRoleResponse struct { + *tchttp.BaseResponse + Response *ModifyUserRoleResponseParams `json:"Response"` +} + +func (r *ModifyUserRoleResponse) ToJsonString() string { + b, _ := json.Marshal(r) + return string(b) +} + +// FromJsonString It is highly **NOT** recommended to use this function +// because it has no param check, nor strict type check +func (r *ModifyUserRoleResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type PermissionComponent struct { + // 权限值 + // 注意:此字段可能返回 null,表示取不到有效值。 + ModuleId *string `json:"ModuleId,omitnil" name:"ModuleId"` + + // 可见/可用 + // 注意:此字段可能返回 null,表示取不到有效值。 + IncludeType *string `json:"IncludeType,omitnil" name:"IncludeType"` + + // 目标升级版本 + // 注意:此字段可能返回 null,表示取不到有效值。 + UpgradeVersionType *string `json:"UpgradeVersionType,omitnil" name:"UpgradeVersionType"` + + // 补充信息 + // 注意:此字段可能返回 null,表示取不到有效值。 + Tips *string `json:"Tips,omitnil" name:"Tips"` + + // 补充信息的key值 + // 注意:此字段可能返回 null,表示取不到有效值。 + TipsKey *string `json:"TipsKey,omitnil" name:"TipsKey"` +} + +type PermissionGroup struct { + // 分组名 + // 注意:此字段可能返回 null,表示取不到有效值。 + ModuleGroup *string `json:"ModuleGroup,omitnil" name:"ModuleGroup"` + + // 权限列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + Components []*PermissionComponent `json:"Components,omitnil" name:"Components"` +} + +type Project struct { + // 项目ID + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 项目Logo + // 注意:此字段可能返回 null,表示取不到有效值。 + Logo *string `json:"Logo,omitnil" name:"Logo"` + + // 项目名称 + // 注意:此字段可能返回 null,表示取不到有效值。 + Name *string `json:"Name,omitnil" name:"Name"` + + // logo底色 + // 注意:此字段可能返回 null,表示取不到有效值。 + ColorCode *string `json:"ColorCode,omitnil" name:"ColorCode"` + + // 创建人 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreatedUser *string `json:"CreatedUser,omitnil" name:"CreatedUser"` + + // 创建时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreatedAt *string `json:"CreatedAt,omitnil" name:"CreatedAt"` + + // 成员个数 + // 注意:此字段可能返回 null,表示取不到有效值。 + MemberCount *int64 `json:"MemberCount,omitnil" name:"MemberCount"` + + // 页面个数 + // 注意:此字段可能返回 null,表示取不到有效值。 + PageCount *int64 `json:"PageCount,omitnil" name:"PageCount"` + + // 最后修改报表、简报名称 + // 注意:此字段可能返回 null,表示取不到有效值。 + LastModifyName *string `json:"LastModifyName,omitnil" name:"LastModifyName"` + + // "" + // 注意:此字段可能返回 null,表示取不到有效值。 + Source *string `json:"Source,omitnil" name:"Source"` + + // "" + // 注意:此字段可能返回 null,表示取不到有效值。 + Apply *bool `json:"Apply,omitnil" name:"Apply"` + + // "" + // 注意:此字段可能返回 null,表示取不到有效值。 + UpdatedUser *string `json:"UpdatedUser,omitnil" name:"UpdatedUser"` + + // "" + // 注意:此字段可能返回 null,表示取不到有效值。 + UpdatedAt *string `json:"UpdatedAt,omitnil" name:"UpdatedAt"` + + // "" + // 注意:此字段可能返回 null,表示取不到有效值。 + CorpId *string `json:"CorpId,omitnil" name:"CorpId"` + + // "" + // 注意:此字段可能返回 null,表示取不到有效值。 + Mark *string `json:"Mark,omitnil" name:"Mark"` + + // "" + // 注意:此字段可能返回 null,表示取不到有效值。 + Seed *string `json:"Seed,omitnil" name:"Seed"` + + // 项目内权限列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + AuthList []*string `json:"AuthList,omitnil" name:"AuthList"` + + // 默认看板 + // 注意:此字段可能返回 null,表示取不到有效值。 + PanelScope *string `json:"PanelScope,omitnil" name:"PanelScope"` + + // 是否被托管 + // 注意:此字段可能返回 null,表示取不到有效值。 + IsExternalManage *bool `json:"IsExternalManage,omitnil" name:"IsExternalManage"` + + // 托管平台名称 + // 注意:此字段可能返回 null,表示取不到有效值。 + ManagePlatform *string `json:"ManagePlatform,omitnil" name:"ManagePlatform"` + + // 定制化参数 + // 注意:此字段可能返回 null,表示取不到有效值。 + ConfigList []*ProjectConfigList `json:"ConfigList,omitnil" name:"ConfigList"` +} + +type ProjectConfigList struct { + // 模块组 + // 注意:此字段可能返回 null,表示取不到有效值。 + ModuleGroup *string `json:"ModuleGroup,omitnil" name:"ModuleGroup"` + + // 内容 + // 注意:此字段可能返回 null,表示取不到有效值。 + Components []*ProjectConfigResult `json:"Components,omitnil" name:"Components"` +} + +type ProjectConfigResult struct { + // 配置名称 + // 注意:此字段可能返回 null,表示取不到有效值。 + ModuleId *string `json:"ModuleId,omitnil" name:"ModuleId"` + + // 配置方式 + // 注意:此字段可能返回 null,表示取不到有效值。 + IncludeType *string `json:"IncludeType,omitnil" name:"IncludeType"` + + // 额外参数 + // 注意:此字段可能返回 null,表示取不到有效值。 + Params *string `json:"Params,omitnil" name:"Params"` +} + +type ProjectListData struct { + // 数组 + // 注意:此字段可能返回 null,表示取不到有效值。 + List []*Project `json:"List,omitnil" name:"List"` + + // 总数 + // 注意:此字段可能返回 null,表示取不到有效值。 + Total *uint64 `json:"Total,omitnil" name:"Total"` + + // 1 + // 注意:此字段可能返回 null,表示取不到有效值。 + TotalPages *uint64 `json:"TotalPages,omitnil" name:"TotalPages"` +} + +type UserIdAndUserName struct { + // 用户ID + UserId *string `json:"UserId,omitnil" name:"UserId"` + + // 用户名 + UserName *string `json:"UserName,omitnil" name:"UserName"` + + // 企业ID + // 注意:此字段可能返回 null,表示取不到有效值。 + CorpId *string `json:"CorpId,omitnil" name:"CorpId"` + + // 电子邮箱 + // 注意:此字段可能返回 null,表示取不到有效值。 + Email *string `json:"Email,omitnil" name:"Email"` + + // 最后一次登录时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + LastLogin *string `json:"LastLogin,omitnil" name:"LastLogin"` + + // 停启用状态 + // 注意:此字段可能返回 null,表示取不到有效值。 + Status *int64 `json:"Status,omitnil" name:"Status"` + + // 首次登陆是否修改密码 + // 注意:此字段可能返回 null,表示取不到有效值。 + FirstModify *int64 `json:"FirstModify,omitnil" name:"FirstModify"` + + // 手机号码 + // 注意:此字段可能返回 null,表示取不到有效值。 + PhoneNumber *string `json:"PhoneNumber,omitnil" name:"PhoneNumber"` + + // 手机区号 + // 注意:此字段可能返回 null,表示取不到有效值。 + AreaCode *string `json:"AreaCode,omitnil" name:"AreaCode"` + + // 创建人 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreatedUser *string `json:"CreatedUser,omitnil" name:"CreatedUser"` + + // 创建时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreatedAt *string `json:"CreatedAt,omitnil" name:"CreatedAt"` + + // 更改人 + // 注意:此字段可能返回 null,表示取不到有效值。 + UpdatedUser *string `json:"UpdatedUser,omitnil" name:"UpdatedUser"` + + // 更改时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + UpdatedAt *string `json:"UpdatedAt,omitnil" name:"UpdatedAt"` + + // 全局角色 + // 注意:此字段可能返回 null,表示取不到有效值。 + GlobalUserName *string `json:"GlobalUserName,omitnil" name:"GlobalUserName"` + + // 手机号 + // 注意:此字段可能返回 null,表示取不到有效值。 + Mobile *string `json:"Mobile,omitnil" name:"Mobile"` +} + +type UserInfo struct { + // 用户ID + UserId *string `json:"UserId,omitnil" name:"UserId"` + + // 用户名 + UserName *string `json:"UserName,omitnil" name:"UserName"` + + // 邮箱 + // 注意:此字段可能返回 null,表示取不到有效值。 + Email *string `json:"Email,omitnil" name:"Email"` + + // 手机号 + // 注意:此字段可能返回 null,表示取不到有效值。 + PhoneNumber *string `json:"PhoneNumber,omitnil" name:"PhoneNumber"` + + // 手机号区号 + // 注意:此字段可能返回 null,表示取不到有效值。 + AreaCode *string `json:"AreaCode,omitnil" name:"AreaCode"` +} + +type UserRoleListData struct { + // 总数 + // 注意:此字段可能返回 null,表示取不到有效值。 + Total *int64 `json:"Total,omitnil" name:"Total"` + + // 总页数 + // 注意:此字段可能返回 null,表示取不到有效值。 + TotalPages *int64 `json:"TotalPages,omitnil" name:"TotalPages"` + + // 列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + List []*UserRoleListDataUserRoleInfo `json:"List,omitnil" name:"List"` +} + +type UserRoleListDataRoleInfo struct { + // 角色名字 + // 注意:此字段可能返回 null,表示取不到有效值。 + RoleName *string `json:"RoleName,omitnil" name:"RoleName"` + + // 角色ID + // 注意:此字段可能返回 null,表示取不到有效值。 + RoleId *int64 `json:"RoleId,omitnil" name:"RoleId"` + + // 项目ID + // 注意:此字段可能返回 null,表示取不到有效值。 + ProjectId *int64 `json:"ProjectId,omitnil" name:"ProjectId"` + + // 项目名字 + // 注意:此字段可能返回 null,表示取不到有效值。 + ProjectName *string `json:"ProjectName,omitnil" name:"ProjectName"` + + // 是否为全局角色(0 不是 1 是) + // 注意:此字段可能返回 null,表示取不到有效值。 + ScopeType *int64 `json:"ScopeType,omitnil" name:"ScopeType"` + + // 角色key + // 注意:此字段可能返回 null,表示取不到有效值。 + ModuleCollection *string `json:"ModuleCollection,omitnil" name:"ModuleCollection"` +} + +type UserRoleListDataUserRoleInfo struct { + // 业务ID + Id *uint64 `json:"Id,omitnil" name:"Id"` + + // 角色列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + RoleList []*UserRoleListDataRoleInfo `json:"RoleList,omitnil" name:"RoleList"` + + // 角色ID列表 + // 注意:此字段可能返回 null,表示取不到有效值。 + RoleIdList []*uint64 `json:"RoleIdList,omitnil" name:"RoleIdList"` + + // 用户ID + UserId *string `json:"UserId,omitnil" name:"UserId"` + + // 用户名 + UserName *string `json:"UserName,omitnil" name:"UserName"` + + // 企业ID + CorpId *string `json:"CorpId,omitnil" name:"CorpId"` + + // 邮箱 + // 注意:此字段可能返回 null,表示取不到有效值。 + Email *string `json:"Email,omitnil" name:"Email"` + + // 创建人 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreatedUser *string `json:"CreatedUser,omitnil" name:"CreatedUser"` + + // 创建时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + CreatedAt *string `json:"CreatedAt,omitnil" name:"CreatedAt"` + + // 更新人 + // 注意:此字段可能返回 null,表示取不到有效值。 + UpdatedUser *string `json:"UpdatedUser,omitnil" name:"UpdatedUser"` + + // 更新时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + UpdatedAt *string `json:"UpdatedAt,omitnil" name:"UpdatedAt"` + + // 最后一次登录时间 + // 注意:此字段可能返回 null,表示取不到有效值。 + LastLogin *string `json:"LastLogin,omitnil" name:"LastLogin"` + + // 账号状态 + // 注意:此字段可能返回 null,表示取不到有效值。 + Status *int64 `json:"Status,omitnil" name:"Status"` + + // 手机号码 + // 注意:此字段可能返回 null,表示取不到有效值。 + PhoneNumber *string `json:"PhoneNumber,omitnil" name:"PhoneNumber"` + + // 手机号区号 + // 注意:此字段可能返回 null,表示取不到有效值。 + AreaCode *string `json:"AreaCode,omitnil" name:"AreaCode"` + + // 是否为主账号 + // 注意:此字段可能返回 null,表示取不到有效值。 + RootAccount *bool `json:"RootAccount,omitnil" name:"RootAccount"` + + // 是否为企业管理员 + // 注意:此字段可能返回 null,表示取不到有效值。 + CorpAdmin *bool `json:"CorpAdmin,omitnil" name:"CorpAdmin"` +} \ No newline at end of file diff --git a/vendor/modules.txt b/vendor/modules.txt index 3991f29a46..292642728d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1089,6 +1089,9 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm/v20210622 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.0.756 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as/v20180419 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi v1.0.770 +## explicit; go 1.14 +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam v1.0.760 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116 diff --git a/website/docs/d/bi_project.html.markdown b/website/docs/d/bi_project.html.markdown new file mode 100644 index 0000000000..4db195ffef --- /dev/null +++ b/website/docs/d/bi_project.html.markdown @@ -0,0 +1,69 @@ +--- +subcategory: "Business Intelligence(BI)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bi_project" +sidebar_current: "docs-tencentcloud-datasource-bi_project" +description: |- + Use this data source to query detailed information of bi project +--- + +# tencentcloud_bi_project + +Use this data source to query detailed information of bi project + +## Example Usage + +```hcl +data "tencentcloud_bi_project" "project" { + page_no = 1 + keyword = "abc" + all_page = true + module_collection = "sys_common_user" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `all_page` - (Optional, Bool) Whether to display all, if true, ignore paging. +* `keyword` - (Optional, String) Retrieve fuzzy fields. +* `module_collection` - (Optional, String) Role information, can be ignored. +* `page_no` - (Optional, Int) Page number. +* `result_output_file` - (Optional, String) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `extra` - Additional information(Note: This field may return null, indicating that no valid value can be obtained). +* `list` - Array(Note: This field may return null, indicating that no valid value can be obtained). + * `apply` - Apply(Note: This field may return null, indicating that no valid value can be obtained). + * `auth_list` - List of permissions within the project(Note: This field may return null, indicating that no valid value can be obtained). + * `color_code` - Logo colour(Note: This field may return null, indicating that no valid value can be obtained). + * `config_list` - Customized parameters, this parameter can be ignored(Note: This field may return null, indicating that no valid value can be obtained). + * `components` - Components(Note: This field may return null, indicating that no valid value can be obtained). + * `include_type` - Include type(Note: This field may return null, indicating that no valid value can be obtained). + * `module_id` - Module id(Note: This field may return null, indicating that no valid value can be obtained). + * `params` - Extra parameters(Note: This field may return null, indicating that no valid value can be obtained). + * `module_group` - Module group(Note: This field may return null, indicating that no valid value can be obtained). + * `corp_id` - Enterprise id(Note: This field may return null, indicating that no valid value can be obtained). + * `created_at` - Created at(Note: This field may return null, indicating that no valid value can be obtained). + * `created_user` - Created by(Note: This field may return null, indicating that no valid value can be obtained). + * `id` - Project id. + * `is_external_manage` - Determine whether it is hosted(Note: This field may return null, indicating that no valid value can be obtained). + * `last_modify_name` - Last modified report and presentation names(Note: This field may return null, indicating that no valid value can be obtained). + * `logo` - Project logo(Note: This field may return null, indicating that no valid value can be obtained). + * `manage_platform` - Hosting platform name(Note: This field may return null, indicating that no valid value can be obtained). + * `mark` - Remark(Note: This field may return null, indicating that no valid value can be obtained). + * `member_count` - Member count(Note: This field may return null, indicating that no valid value can be obtained). + * `name` - Project name(Note: This field may return null, indicating that no valid value can be obtained). + * `page_count` - Page count(Note: This field may return null, indicating that no valid value can be obtained). + * `panel_scope` - Default kanban(Note: This field may return null, indicating that no valid value can be obtained). + * `seed` - Obfuscated field(Note: This field may return null, indicating that no valid value can be obtained). + * `source` - Interface call source(Note: This field may return null, indicating that no valid value can be obtained). + * `updated_at` - Updated by(Note: This field may return null, indicating that no valid value can be obtained). + * `updated_user` - Updated by(Note: This field may return null, indicating that no valid value can be obtained). +* `msg` - Interface information(Note: This field may return null, indicating that no valid value can be obtained). + + diff --git a/website/docs/d/bi_user_project.html.markdown b/website/docs/d/bi_user_project.html.markdown new file mode 100644 index 0000000000..60f3d06cf0 --- /dev/null +++ b/website/docs/d/bi_user_project.html.markdown @@ -0,0 +1,52 @@ +--- +subcategory: "Business Intelligence(BI)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bi_user_project" +sidebar_current: "docs-tencentcloud-datasource-bi_user_project" +description: |- + Use this data source to query detailed information of bi user_project +--- + +# tencentcloud_bi_user_project + +Use this data source to query detailed information of bi user_project + +## Example Usage + +```hcl +data "tencentcloud_bi_user_project" "user_project" { + project_id = 123 + all_page = true +} +``` + +## Argument Reference + +The following arguments are supported: + +* `all_page` - (Optional, Bool) Whether to display all, if true, ignore paging. +* `project_id` - (Optional, Int) Project id. +* `result_output_file` - (Optional, String) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `list` - Array(Note: This field may return null, indicating that no valid value can be obtained). + * `area_code` - Mobile area code(Note: This field may return null, indicating that no valid value can be obtained). + * `corp_id` - Enterprise id(Note: This field may return null, indicating that no valid value can be obtained). + * `created_at` - Created at(Note: This field may return null, indicating that no valid value can be obtained). + * `created_user` - Created by(Note: This field may return null, indicating that no valid value can be obtained). + * `email` - E-mail(Note: This field may return null, indicating that no valid value can be obtained). + * `first_modify` - First login to change password, public cloud unrelated fields(Note: This field may return null, indicating that no valid value can be obtained). + * `global_user_name` - Global role name(Note: This field may return null, indicating that no valid value can be obtained). + * `last_login` - Last login time, public cloud unrelated fields(Note: This field may return null, indicating that no valid value can be obtained). + * `mobile` - Mobile number, public cloud unrelated fields(Note: This field may return null, indicating that no valid value can be obtained). + * `phone_number` - Phone number(Note: This field may return null, indicating that no valid value can be obtained). + * `status` - Disabled state(Note: This field may return null, indicating that no valid value can be obtained). + * `updated_at` - Updated at(Note: This field may return null, indicating that no valid value can be obtained). + * `updated_user` - Updated by(Note: This field may return null, indicating that no valid value can be obtained). + * `user_id` - User id. + * `user_name` - Username. + + diff --git a/website/docs/r/bi_datasource.html.markdown b/website/docs/r/bi_datasource.html.markdown new file mode 100644 index 0000000000..f9ec21140e --- /dev/null +++ b/website/docs/r/bi_datasource.html.markdown @@ -0,0 +1,66 @@ +--- +subcategory: "Business Intelligence(BI)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bi_datasource" +sidebar_current: "docs-tencentcloud-resource-bi_datasource" +description: |- + Provides a resource to create a bi datasource +--- + +# tencentcloud_bi_datasource + +Provides a resource to create a bi datasource + +## Example Usage + +```hcl +resource "tencentcloud_bi_datasource" "datasource" { + charset = "utf8" + db_host = "bj-cdb-1lxqg5r6.sql.tencentcdb.com" + db_name = "tf-test" + db_port = 63694 + db_type = "MYSQL" + db_pwd = "ABc123,,," + db_user = "root" + project_id = 11015030 + source_name = "tf-source-name" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `charset` - (Required, String) Charset. +* `db_host` - (Required, String) Host. +* `db_name` - (Required, String) Database name. +* `db_port` - (Required, Int) Port. +* `db_pwd` - (Required, String) Password. +* `db_type` - (Required, String) `MYSQL`, `MSSQL`, `POSTGRE`, `ORACLE`, `CLICKHOUSE`, `TIDB`, `HIVE`, `PRESTO`. +* `db_user` - (Required, String) User name. +* `project_id` - (Required, Int) Project id. +* `source_name` - (Required, String) Datasource name in BI. +* `catalog` - (Optional, String) Catalog. +* `data_origin_datasource_id` - (Optional, String) Third-party datasource project id, this parameter can be ignored. +* `data_origin_project_id` - (Optional, String) Third-party datasource project id, this parameter can be ignored. +* `data_origin` - (Optional, String) Third-party datasource identification, this parameter can be ignored. +* `service_type` - (Optional, String) Own or Cloud, default: `Own`. +* `uniq_vpc_id` - (Optional, String) Tencent cloud private network unified identity. +* `vpc_id` - (Optional, String) Tencent cloud private network identity. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +bi datasource can be imported using the id, e.g. + +``` +terraform import tencentcloud_bi_datasource.datasource datasource_id +``` + diff --git a/website/docs/r/bi_datasource_cloud.html.markdown b/website/docs/r/bi_datasource_cloud.html.markdown new file mode 100644 index 0000000000..112cc2bbbb --- /dev/null +++ b/website/docs/r/bi_datasource_cloud.html.markdown @@ -0,0 +1,72 @@ +--- +subcategory: "Business Intelligence(BI)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bi_datasource_cloud" +sidebar_current: "docs-tencentcloud-resource-bi_datasource_cloud" +description: |- + Provides a resource to create a bi datasource_cloud +--- + +# tencentcloud_bi_datasource_cloud + +Provides a resource to create a bi datasource_cloud + +## Example Usage + +```hcl +resource "tencentcloud_bi_datasource_cloud" "datasource_cloud" { + charset = "utf8" + db_name = "bi_dev" + db_type = "MYSQL" + db_user = "root" + project_id = "11015056" + db_pwd = "xxxxxx" + service_type { + instance_id = "cdb-12viotu5" + region = "ap-guangzhou" + type = "Cloud" + } + source_name = "tf-test1" + vip = "10.0.0.4" + vport = "3306" + region_id = "gz" + vpc_id = 5292713 +} +``` + +## Argument Reference + +The following arguments are supported: + +* `charset` - (Required, String) Charset. +* `db_name` - (Required, String) Database name. +* `db_pwd` - (Required, String) Password. +* `db_type` - (Required, String) `MYSQL`, `TDSQL-C_MYSQL`, `TDSQL_MYSQL`, `MSSQL`, `POSTGRESQL`, `MARIADB`. +* `db_user` - (Required, String) User name. +* `project_id` - (Required, String) Project id. +* `service_type` - (Required, List) Service type, Own or Cloud. +* `source_name` - (Required, String) Datasource name in BI. +* `vpc_id` - (Required, String) Vpc identification. +* `data_origin_datasource_id` - (Optional, String) Third-party datasource project id, this parameter can be ignored. +* `data_origin_project_id` - (Optional, String) Third-party datasource project id, this parameter can be ignored. +* `data_origin` - (Optional, String) Third-party datasource identification, this parameter can be ignored. +* `extra_param` - (Optional, String) Extended parameters. +* `region_id` - (Optional, String) Region identifier. +* `uniq_vpc_id` - (Optional, String) Unified vpc identification. +* `vip` - (Optional, String) Public cloud intranet ip. +* `vport` - (Optional, String) Public cloud intranet port. + +The `service_type` object supports the following: + +* `instance_id` - (Required, String) Instance Id. +* `region` - (Required, String) Region. +* `type` - (Required, String) Service type, Cloud. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/docs/r/bi_project.html.markdown b/website/docs/r/bi_project.html.markdown new file mode 100644 index 0000000000..4bf7306c1a --- /dev/null +++ b/website/docs/r/bi_project.html.markdown @@ -0,0 +1,49 @@ +--- +subcategory: "Business Intelligence(BI)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bi_project" +sidebar_current: "docs-tencentcloud-resource-bi_project" +description: |- + Provides a resource to create a bi project +--- + +# tencentcloud_bi_project + +Provides a resource to create a bi project + +## Example Usage + +```hcl +resource "tencentcloud_bi_project" "project" { + name = "terraform_test" + color_code = "#7BD936" + logo = "TF-test" + mark = "project mark" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `color_code` - (Required, String) Logo background color. +* `name` - (Required, String) Project name. +* `logo` - (Optional, String) Project logo. +* `mark` - (Optional, String) Remark. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +bi project can be imported using the id, e.g. + +``` +terraform import tencentcloud_bi_project.project project_id +``` + diff --git a/website/docs/r/bi_project_user_role.html.markdown b/website/docs/r/bi_project_user_role.html.markdown new file mode 100644 index 0000000000..07c06b6d0e --- /dev/null +++ b/website/docs/r/bi_project_user_role.html.markdown @@ -0,0 +1,57 @@ +--- +subcategory: "Business Intelligence(BI)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bi_project_user_role" +sidebar_current: "docs-tencentcloud-resource-bi_project_user_role" +description: |- + Provides a resource to create a bi project_user_role +--- + +# tencentcloud_bi_project_user_role + +Provides a resource to create a bi project_user_role + +~> **NOTE:** You cannot use `tencentcloud_bi_user_role` and `tencentcloud_bi_project_user_role` at the same time to modify the `phone_number` and `email` of the same user. + +## Example Usage + +```hcl +resource "tencentcloud_bi_project_user_role" "project_user_role" { + area_code = "+86" + project_id = 11015030 + role_id_list = [10629453] + email = "123456@qq.com" + phone_number = "13130001000" + user_id = "100024664626" + user_name = "keep-cam-user" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `area_code` - (Required, String) Mobile area code(Note: This field may return null, indicating that no valid value can be obtained). +* `email` - (Required, String) E-mail(Note: This field may return null, indicating that no valid value can be obtained). +* `phone_number` - (Required, String) Phone number(Note: This field may return null, indicating that no valid value can be obtained). +* `user_id` - (Required, String) User id. +* `user_name` - (Required, String) Username. +* `project_id` - (Optional, Int) Project id. +* `role_id_list` - (Optional, Set: [`Int`]) Role id list. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +bi project_user_role can be imported using the id, e.g. + +``` +terraform import tencentcloud_bi_project_user_role.project_user_role projectId#userId +``` + diff --git a/website/docs/r/bi_user_role.html.markdown b/website/docs/r/bi_user_role.html.markdown new file mode 100644 index 0000000000..4c5a2e3fc5 --- /dev/null +++ b/website/docs/r/bi_user_role.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: "Business Intelligence(BI)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bi_user_role" +sidebar_current: "docs-tencentcloud-resource-bi_user_role" +description: |- + Provides a resource to create a bi user_role +--- + +# tencentcloud_bi_user_role + +Provides a resource to create a bi user_role + +## Example Usage + +```hcl +resource "tencentcloud_bi_user_role" "user_role" { + area_code = "+83" + email = "1055000000@qq.com" + phone_number = "13470010000" + role_id_list = [ + 10629359, + ] + user_id = "100032767426" + user_name = "keep-iac-test" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `area_code` - (Required, String) Mobile area code(Note: This field may return null, indicating that no valid value can be obtained). +* `email` - (Required, String) E-mail(Note: This field may return null, indicating that no valid value can be obtained). +* `phone_number` - (Required, String) Phone number(Note: This field may return null, indicating that no valid value can be obtained). +* `role_id_list` - (Required, Set: [`Int`]) Role id list. +* `user_id` - (Required, String) User id. +* `user_name` - (Required, String) Username. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +bi user_role can be imported using the id, e.g. + +``` +terraform import tencentcloud_bi_user_role.user_role user_id +``` + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index b159598d4f..891d49cd18 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -350,6 +350,48 @@ +
  • + Business Intelligence(BI) + +
  • CVM Dedicated Host(CDH)