diff --git a/.changelog/3654.txt b/.changelog/3654.txt new file mode 100644 index 0000000000..cfcb5049e5 --- /dev/null +++ b/.changelog/3654.txt @@ -0,0 +1,55 @@ +```release-note:new-data-source +tencentcloud_bh_account_groups +``` + +```release-note:new-data-source +tencentcloud_bh_source_types +``` + +```release-note:new-resource +tencentcloud_bh_access_white_list_rule +``` + +```release-note:new-resource +tencentcloud_bh_access_white_list_config +``` + +```release-note:new-resource +tencentcloud_bh_device +``` + +```release-note:new-resource +tencentcloud_bh_asset_sync_job_operation +``` + +```release-note:new-resource +tencentcloud_bh_asset_sync_flag_config +``` + +```release-note:new-resource +tencentcloud_bh_resource +``` + +```release-note:new-resource +tencentcloud_bh_reconnection_setting_config +``` + +```release-note:new-resource +tencentcloud_bh_user +``` + +```release-note:new-resource +tencentcloud_bh_user_group +``` + +```release-note:new-resource +tencentcloud_bh_user_directory +``` + +```release-note:new-resource +tencentcloud_bh_user_sync_task_operation +``` + +```release-note:new-resource +tencentcloud_bh_sync_devices_to_ioa_operation +``` diff --git a/go.mod b/go.mod index 450eed24ea..fc3c2cb41b 100644 --- a/go.mod +++ b/go.mod @@ -107,6 +107,7 @@ require ( require ( github.com/hashicorp/go-uuid v1.0.3 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh v1.3.7 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/billing v1.1.31 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdc v1.0.1149 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdwdoris v1.0.993 diff --git a/go.sum b/go.sum index e5e383902b..50e92da2d0 100644 --- a/go.sum +++ b/go.sum @@ -829,6 +829,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm v1.2.2 h1:/BlN5LD/r github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm v1.2.2/go.mod h1:XIggn8QQknIzb+1lnsOiKbTQ0fjRe1uV6P+1N0L2ccI= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.3.4 h1:hTOxj4qB+UX6MflqmIYT4cPbfEqtiJEfi9tR58DxkIw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.3.4/go.mod h1:q7fZk23gy6BkZGcNw9NXFSj26R44tiJZKGxLFfOrMo0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh v1.3.7 h1:EmqV7a3kxOzI+oPR9o8npRupCGfzgRRgIfF7KHAa1cs= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh v1.3.7/go.mod h1:jOm6mEGQbEzxX8hkRSoBfZRvCRqHtUG2jQ0gmyT8w68= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi v1.0.824 h1:DVKvZ6h+qd7tadUrCjVAkCCmE3TsbK2ZmwGd3AJcpWc= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi v1.0.824/go.mod h1:DvBpDX/qdJG4KKLeULmRvhAjPYiw8za0HeTSu2y/lFw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/billing v1.1.31 h1:teA14cAcXuGxas6+5YANQ5KCoPaQBKIb2Q8+sk08Mu0= diff --git a/tencentcloud/connectivity/client.go b/tencentcloud/connectivity/client.go index cd91ff8209..142353a993 100644 --- a/tencentcloud/connectivity/client.go +++ b/tencentcloud/connectivity/client.go @@ -23,6 +23,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" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" bi "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105" billing "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/billing/v20180709" cam "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cam/v20190116" @@ -243,6 +244,7 @@ type TencentCloudClient struct { gwlbv20240906Conn *gwlb.Client billingv20180709Conn *billing.Client igtmv20231024Conn *igtmv20231024.Client + bhv20230418Conn *bhv20230418.Client } // NewClientProfile returns a new ClientProfile @@ -1709,6 +1711,19 @@ func (me *TencentCloudClient) UseDasbClient() *dasb.Client { return me.dasbConn } +// UseBhV20230418Client return BH client for service +func (me *TencentCloudClient) UseBhV20230418Client() *bhv20230418.Client { + if me.bhv20230418Conn != nil { + return me.bhv20230418Conn + } + + cpf := me.NewClientProfile(300) + me.bhv20230418Conn, _ = bhv20230418.NewClient(me.Credential, me.Region, cpf) + me.bhv20230418Conn.WithHttpTransport(&LogRoundTripper{}) + + return me.bhv20230418Conn +} + // UseTrocketClient returns trocket client for service func (me *TencentCloudClient) UseTrocketClient() *trocket.Client { if me.trocketConn != nil { diff --git a/tencentcloud/provider.go b/tencentcloud/provider.go index 0cac0e5305..20f5fe13f1 100644 --- a/tencentcloud/provider.go +++ b/tencentcloud/provider.go @@ -1226,6 +1226,8 @@ func Provider() *schema.Provider { "tencentcloud_cfw_nat_fw_switches": cfw.DataSourceTencentCloudCfwNatFwSwitches(), "tencentcloud_cfw_vpc_fw_switches": cfw.DataSourceTencentCloudCfwVpcFwSwitches(), "tencentcloud_cfw_edge_fw_switches": cfw.DataSourceTencentCloudCfwEdgeFwSwitches(), + "tencentcloud_bh_account_groups": bh.DataSourceTencentCloudBhAccountGroups(), + "tencentcloud_bh_source_types": bh.DataSourceTencentCloudBhSourceTypes(), "tencentcloud_cwp_machines_simple": cwp.DataSourceTencentCloudCwpMachinesSimple(), "tencentcloud_ses_receivers": ses.DataSourceTencentCloudSesReceivers(), "tencentcloud_ses_send_tasks": ses.DataSourceTencentCloudSesSendTasks(), @@ -2401,6 +2403,18 @@ func Provider() *schema.Provider { "tencentcloud_cfw_vpc_firewall_switch": cfw.ResourceTencentCloudCfwVpcFirewallSwitch(), "tencentcloud_cfw_edge_firewall_switch": cfw.ResourceTencentCloudCfwEdgeFirewallSwitch(), "tencentcloud_sg_rule": cfw.ResourceTencentCloudSgRule(), + "tencentcloud_bh_access_white_list_rule": bh.ResourceTencentCloudBhAccessWhiteListRule(), + "tencentcloud_bh_access_white_list_config": bh.ResourceTencentCloudBhAccessWhiteListConfig(), + "tencentcloud_bh_device": bh.ResourceTencentCloudBhDevice(), + "tencentcloud_bh_asset_sync_job_operation": bh.ResourceTencentCloudBhAssetSyncJobOperation(), + "tencentcloud_bh_asset_sync_flag_config": bh.ResourceTencentCloudBhAssetSyncFlagConfig(), + "tencentcloud_bh_resource": bh.ResourceTencentCloudBhResource(), + "tencentcloud_bh_reconnection_setting_config": bh.ResourceTencentCloudBhReconnectionSettingConfig(), + "tencentcloud_bh_user": bh.ResourceTencentCloudBhUser(), + "tencentcloud_bh_user_group": bh.ResourceTencentCloudBhUserGroup(), + "tencentcloud_bh_user_directory": bh.ResourceTencentCloudBhUserDirectory(), + "tencentcloud_bh_user_sync_task_operation": bh.ResourceTencentCloudBhUserSyncTaskOperation(), + "tencentcloud_bh_sync_devices_to_ioa_operation": bh.ResourceTencentCloudBhSyncDevicesToIoaOperation(), "tencentcloud_dasb_acl": bh.ResourceTencentCloudDasbAcl(), "tencentcloud_dasb_cmd_template": bh.ResourceTencentCloudDasbCmdTemplate(), "tencentcloud_dasb_device_group": bh.ResourceTencentCloudDasbDeviceGroup(), diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md index 4a169580b9..b1a296c899 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -2341,7 +2341,22 @@ tencentcloud_cfw_edge_firewall_switch tencentcloud_sg_rule Bastion Host(BH) -Resource +Data Source +tencentcloud_bh_account_groups +tencentcloud_bh_source_types +Resource +tencentcloud_bh_access_white_list_rule +tencentcloud_bh_access_white_list_config +tencentcloud_bh_device +tencentcloud_bh_asset_sync_job_operation +tencentcloud_bh_asset_sync_flag_config +tencentcloud_bh_resource +tencentcloud_bh_reconnection_setting_config +tencentcloud_bh_user +tencentcloud_bh_user_group +tencentcloud_bh_user_directory +tencentcloud_bh_user_sync_task_operation +tencentcloud_bh_sync_devices_to_ioa_operation tencentcloud_dasb_resource tencentcloud_dasb_acl tencentcloud_dasb_cmd_template diff --git a/tencentcloud/services/bh/data_source_tc_bh_account_groups.go b/tencentcloud/services/bh/data_source_tc_bh_account_groups.go new file mode 100644 index 0000000000..a4f445463e --- /dev/null +++ b/tencentcloud/services/bh/data_source_tc_bh_account_groups.go @@ -0,0 +1,239 @@ +package bh + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudBhAccountGroups() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudBhAccountGroupsRead, + Schema: map[string]*schema.Schema{ + "deep_in": { + Type: schema.TypeInt, + Optional: true, + Description: "Whether to recursively query, 0 for non-recursive, 1 for recursive.", + }, + + "parent_id": { + Type: schema.TypeInt, + Optional: true, + Description: "Parent account group ID, default 0, query all groups under the root account group.", + }, + + "group_name": { + Type: schema.TypeString, + Optional: true, + Description: "Account group name, fuzzy query.", + }, + + "page_num": { + Type: schema.TypeInt, + Optional: true, + Description: "Get data from which page.", + }, + + "account_group_set": { + Type: schema.TypeList, + Computed: true, + Description: "Account group information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeInt, + Computed: true, + Description: "Account group ID.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Account group name.", + }, + "id_path": { + Type: schema.TypeString, + Computed: true, + Description: "Account group ID path.", + }, + "name_path": { + Type: schema.TypeString, + Computed: true, + Description: "Account group name path.", + }, + "parent_id": { + Type: schema.TypeInt, + Computed: true, + Description: "Parent account group ID.", + }, + "source": { + Type: schema.TypeInt, + Computed: true, + Description: "Account group source.", + }, + "user_total": { + Type: schema.TypeInt, + Computed: true, + Description: "Total number of users under the account group.", + }, + "is_leaf": { + Type: schema.TypeBool, + Computed: true, + Description: "Whether it is a leaf node.", + }, + "import_type": { + Type: schema.TypeString, + Computed: true, + Description: "Account group import type.", + }, + "description": { + Type: schema.TypeString, + Computed: true, + Description: "Account group description.", + }, + "parent_org_id": { + Type: schema.TypeString, + Computed: true, + Description: "Parent source account organization ID. When using third-party import user sources, record the group ID of this group in the source organization structure.", + }, + "org_id": { + Type: schema.TypeString, + Computed: true, + Description: "Source account organization ID. When using third-party import user sources, record the group ID of this group in the source organization structure.", + }, + "status": { + Type: schema.TypeInt, + Computed: true, + Description: "Whether the account group has been connected, 0 means not connected, 1 means connected.", + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudBhAccountGroupsRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_bh_account_groups.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = BhService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + ) + + paramMap := make(map[string]interface{}) + if v, ok := d.GetOkExists("deep_in"); ok { + paramMap["DeepIn"] = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("parent_id"); ok { + paramMap["ParentId"] = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("group_name"); ok { + paramMap["GroupName"] = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("page_num"); ok { + paramMap["PageNum"] = helper.IntInt64(v.(int)) + } + + var respData []*bhv20230418.AccountGroup + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeBhAccountGroupsByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + accountGroupSetList := make([]map[string]interface{}, 0, len(respData)) + if respData != nil { + for _, accountGroupSet := range respData { + accountGroupSetMap := map[string]interface{}{} + if accountGroupSet.Id != nil { + accountGroupSetMap["id"] = accountGroupSet.Id + } + + if accountGroupSet.Name != nil { + accountGroupSetMap["name"] = accountGroupSet.Name + } + + if accountGroupSet.IdPath != nil { + accountGroupSetMap["id_path"] = accountGroupSet.IdPath + } + + if accountGroupSet.NamePath != nil { + accountGroupSetMap["name_path"] = accountGroupSet.NamePath + } + + if accountGroupSet.ParentId != nil { + accountGroupSetMap["parent_id"] = accountGroupSet.ParentId + } + + if accountGroupSet.Source != nil { + accountGroupSetMap["source"] = accountGroupSet.Source + } + + if accountGroupSet.UserTotal != nil { + accountGroupSetMap["user_total"] = accountGroupSet.UserTotal + } + + if accountGroupSet.IsLeaf != nil { + accountGroupSetMap["is_leaf"] = accountGroupSet.IsLeaf + } + + if accountGroupSet.ImportType != nil { + accountGroupSetMap["import_type"] = accountGroupSet.ImportType + } + + if accountGroupSet.Description != nil { + accountGroupSetMap["description"] = accountGroupSet.Description + } + + if accountGroupSet.ParentOrgId != nil { + accountGroupSetMap["parent_org_id"] = accountGroupSet.ParentOrgId + } + + if accountGroupSet.OrgId != nil { + accountGroupSetMap["org_id"] = accountGroupSet.OrgId + } + + if accountGroupSet.Status != nil { + accountGroupSetMap["status"] = accountGroupSet.Status + } + + accountGroupSetList = append(accountGroupSetList, accountGroupSetMap) + } + + _ = d.Set("account_group_set", accountGroupSetList) + } + + d.SetId(helper.BuildToken()) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), accountGroupSetList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/bh/data_source_tc_bh_account_groups.md b/tencentcloud/services/bh/data_source_tc_bh_account_groups.md new file mode 100644 index 0000000000..fbd0ab1534 --- /dev/null +++ b/tencentcloud/services/bh/data_source_tc_bh_account_groups.md @@ -0,0 +1,19 @@ +Use this data source to query detailed information of BH account groups + +Example Usage + +Query all bh account groups + +```hcl +data "tencentcloud_bh_account_groups" "example" {} +``` + +Query bh account groups by filter + +```hcl +data "tencentcloud_bh_account_groups" "example" { + deep_in = 1 + parent_id = 819729 + group_name = "tf-example" +} +``` diff --git a/tencentcloud/services/bh/data_source_tc_bh_account_groups_test.go b/tencentcloud/services/bh/data_source_tc_bh_account_groups_test.go new file mode 100644 index 0000000000..9872a63659 --- /dev/null +++ b/tencentcloud/services/bh/data_source_tc_bh_account_groups_test.go @@ -0,0 +1,29 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhAccountGroupsDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccBhAccountGroupsDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_bh_account_groups.example"), + ), + }}, + }) +} + +const testAccBhAccountGroupsDataSource = ` +data "tencentcloud_bh_account_groups" "example" {} +` diff --git a/tencentcloud/services/bh/data_source_tc_bh_source_types.go b/tencentcloud/services/bh/data_source_tc_bh_source_types.go new file mode 100644 index 0000000000..bbd1f7335f --- /dev/null +++ b/tencentcloud/services/bh/data_source_tc_bh_source_types.go @@ -0,0 +1,118 @@ +package bh + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func DataSourceTencentCloudBhSourceTypes() *schema.Resource { + return &schema.Resource{ + Read: dataSourceTencentCloudBhSourceTypesRead, + Schema: map[string]*schema.Schema{ + "source_type_set": { + Type: schema.TypeList, + Computed: true, + Description: "Authentication source information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "source": { + Type: schema.TypeInt, + Computed: true, + Description: "Account group source.", + }, + "type": { + Type: schema.TypeString, + Computed: true, + Description: "Account group source type.", + }, + "name": { + Type: schema.TypeString, + Computed: true, + Description: "Account group source name.", + }, + "target": { + Type: schema.TypeString, + Computed: true, + Description: "Distinguish between ioa original and iam-mini.", + }, + }, + }, + }, + + "result_output_file": { + Type: schema.TypeString, + Optional: true, + Description: "Used to save results.", + }, + }, + } +} + +func dataSourceTencentCloudBhSourceTypesRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("data_source.tencentcloud_bh_source_types.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(nil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = BhService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + ) + + paramMap := make(map[string]interface{}) + var respData []*bhv20230418.SourceType + reqErr := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + result, e := service.DescribeBhSourceTypesByFilter(ctx, paramMap) + if e != nil { + return tccommon.RetryError(e) + } + + respData = result + return nil + }) + + if reqErr != nil { + return reqErr + } + + sourceTypeSetList := make([]map[string]interface{}, 0, len(respData)) + if respData != nil { + for _, sourceTypeSet := range respData { + sourceTypeSetMap := map[string]interface{}{} + if sourceTypeSet.Source != nil { + sourceTypeSetMap["source"] = sourceTypeSet.Source + } + + if sourceTypeSet.Type != nil { + sourceTypeSetMap["type"] = sourceTypeSet.Type + } + + if sourceTypeSet.Name != nil { + sourceTypeSetMap["name"] = sourceTypeSet.Name + } + + if sourceTypeSet.Target != nil { + sourceTypeSetMap["target"] = sourceTypeSet.Target + } + + sourceTypeSetList = append(sourceTypeSetList, sourceTypeSetMap) + } + + _ = d.Set("source_type_set", sourceTypeSetList) + } + + d.SetId(helper.BuildToken()) + output, ok := d.GetOk("result_output_file") + if ok && output.(string) != "" { + if e := tccommon.WriteToFile(output.(string), sourceTypeSetList); e != nil { + return e + } + } + + return nil +} diff --git a/tencentcloud/services/bh/data_source_tc_bh_source_types.md b/tencentcloud/services/bh/data_source_tc_bh_source_types.md new file mode 100644 index 0000000000..d7934ac6ae --- /dev/null +++ b/tencentcloud/services/bh/data_source_tc_bh_source_types.md @@ -0,0 +1,7 @@ +Use this data source to query detailed information of BH source types + +Example Usage + +```hcl +data "tencentcloud_bh_source_types" "example" {} +``` diff --git a/tencentcloud/services/bh/data_source_tc_bh_source_types_test.go b/tencentcloud/services/bh/data_source_tc_bh_source_types_test.go new file mode 100644 index 0000000000..4a40c613bc --- /dev/null +++ b/tencentcloud/services/bh/data_source_tc_bh_source_types_test.go @@ -0,0 +1,29 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhSourceTypesDataSource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccBhSourceTypesDataSource, + Check: resource.ComposeTestCheckFunc( + tcacctest.AccCheckTencentCloudDataSourceID("data.tencentcloud_bh_source_types.example"), + ), + }}, + }) +} + +const testAccBhSourceTypesDataSource = ` +data "tencentcloud_bh_source_types" "example" {} +` diff --git a/tencentcloud/services/bh/resource_tc_bh_access_white_list_config.go b/tencentcloud/services/bh/resource_tc_bh_access_white_list_config.go new file mode 100644 index 0000000000..9fbaea37f6 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_access_white_list_config.go @@ -0,0 +1,146 @@ +package bh + +import ( + "context" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudBhAccessWhiteListConfig() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBhAccessWhiteListConfigCreate, + Read: resourceTencentCloudBhAccessWhiteListConfigRead, + Update: resourceTencentCloudBhAccessWhiteListConfigUpdate, + Delete: resourceTencentCloudBhAccessWhiteListConfigDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "allow_any": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "true: allow all source IPs; false: do not allow all source IPs.", + }, + + "allow_auto": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + Description: "true: allow automatically added IPs; false: do not allow automatically added IPs.", + }, + }, + } +} + +func resourceTencentCloudBhAccessWhiteListConfigCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_access_white_list_config.create")() + defer tccommon.InconsistentCheck(d, meta)() + + d.SetId(helper.BuildToken()) + + return resourceTencentCloudBhAccessWhiteListConfigUpdate(d, meta) +} + +func resourceTencentCloudBhAccessWhiteListConfigRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_access_white_list_config.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = BhService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + ) + + respData, err := service.DescribeBhAccessWhiteListConfigById(ctx) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `bh_access_white_list_config` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.AllowAny != nil { + _ = d.Set("allow_any", respData.AllowAny) + } + + if respData.AllowAuto != nil { + _ = d.Set("allow_auto", respData.AllowAuto) + } + + return nil +} + +func resourceTencentCloudBhAccessWhiteListConfigUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_access_white_list_config.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + ) + + if d.HasChange("allow_any") { + request := bhv20230418.NewModifyAccessWhiteListStatusRequest() + if v, ok := d.GetOkExists("allow_any"); ok { + request.AllowAny = helper.Bool(v.(bool)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().ModifyAccessWhiteListStatusWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s update bh access white list config failed, reason:%+v", logId, reqErr) + return reqErr + } + } + + if d.HasChange("allow_auto") { + request := bhv20230418.NewModifyAccessWhiteListAutoStatusRequest() + if v, ok := d.GetOkExists("allow_auto"); ok { + request.AllowAuto = helper.Bool(v.(bool)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().ModifyAccessWhiteListAutoStatusWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s update bh access white list config failed, reason:%+v", logId, reqErr) + return reqErr + } + } + + return resourceTencentCloudBhAccessWhiteListConfigRead(d, meta) +} + +func resourceTencentCloudBhAccessWhiteListConfigDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_access_white_list_config.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/bh/resource_tc_bh_access_white_list_config.md b/tencentcloud/services/bh/resource_tc_bh_access_white_list_config.md new file mode 100644 index 0000000000..9fdb63e3b5 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_access_white_list_config.md @@ -0,0 +1,18 @@ +Provides a resource to create a BH access white list config + +Example Usage + +```hcl +resource "tencentcloud_bh_access_white_list_config" "example" { + allow_any = false + allow_auto = false +} +``` + +Import + +BH access white list config can be imported using the customId(like uuid or base64 string), e.g. + +``` +terraform import tencentcloud_bh_access_white_list_config.example zDxkr768TFYadnFdX1fusQ== +``` diff --git a/tencentcloud/services/bh/resource_tc_bh_access_white_list_config_test.go b/tencentcloud/services/bh/resource_tc_bh_access_white_list_config_test.go new file mode 100644 index 0000000000..abeca1d3f0 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_access_white_list_config_test.go @@ -0,0 +1,56 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhAccessWhiteListConfigResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBhAccessWhiteListConfig, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_access_white_list_config.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_bh_access_white_list_config.example", "allow_any"), + resource.TestCheckResourceAttrSet("tencentcloud_bh_access_white_list_config.example", "allow_auto"), + ), + }, + { + Config: testAccBhAccessWhiteListConfigUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_access_white_list_config.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_bh_access_white_list_config.example", "allow_any"), + resource.TestCheckResourceAttrSet("tencentcloud_bh_access_white_list_config.example", "allow_auto"), + ), + }, + { + ResourceName: "tencentcloud_bh_access_white_list_config.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccBhAccessWhiteListConfig = ` +resource "tencentcloud_bh_access_white_list_config" "example" { + allow_any = false + allow_auto = false +} +` + +const testAccBhAccessWhiteListConfigUpdate = ` +resource "tencentcloud_bh_access_white_list_config" "example" { + allow_any = true + allow_auto = true +} +` diff --git a/tencentcloud/services/bh/resource_tc_bh_access_white_list_rule.go b/tencentcloud/services/bh/resource_tc_bh_access_white_list_rule.go new file mode 100644 index 0000000000..0171da72b4 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_access_white_list_rule.go @@ -0,0 +1,214 @@ +package bh + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudBhAccessWhiteListRule() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBhAccessWhiteListRuleCreate, + Read: resourceTencentCloudBhAccessWhiteListRuleRead, + Update: resourceTencentCloudBhAccessWhiteListRuleUpdate, + Delete: resourceTencentCloudBhAccessWhiteListRuleDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "source": { + Type: schema.TypeString, + Required: true, + Description: "IP address 10.10.10.1 or network segment 10.10.10.0/24, minimum length 4 bytes, maximum length 40 bytes.", + }, + + "remark": { + Type: schema.TypeString, + Optional: true, + Description: "Remark information, minimum length 0 characters, maximum length 40 characters.", + }, + + // computed + "rule_id": { + Type: schema.TypeInt, + Computed: true, + Description: "ID of the access white list rule.", + }, + }, + } +} + +func resourceTencentCloudBhAccessWhiteListRuleCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_access_white_list_rule.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewCreateAccessWhiteListRuleRequest() + response = bhv20230418.NewCreateAccessWhiteListRuleResponse() + ruleId string + ) + + if v, ok := d.GetOk("source"); ok { + request.Source = helper.String(v.(string)) + } + + if v, ok := d.GetOk("remark"); ok { + request.Remark = helper.String(v.(string)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().CreateAccessWhiteListRuleWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Create bh access white list rule failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create bh access white list rule failed, reason:%+v", logId, reqErr) + return reqErr + } + + if response.Response.Id == nil { + return fmt.Errorf("Id is nil.") + } + + ruleId = helper.UInt64ToStr(*response.Response.Id) + d.SetId(ruleId) + return resourceTencentCloudBhAccessWhiteListRuleRead(d, meta) +} + +func resourceTencentCloudBhAccessWhiteListRuleRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_access_white_list_rule.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = BhService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + ruleId = d.Id() + ) + + respData, err := service.DescribeBhAccessWhiteListRuleById(ctx, ruleId) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_bh_access_white_list_rule` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.Source != nil { + _ = d.Set("source", respData.Source) + } + + if respData.Remark != nil { + _ = d.Set("remark", respData.Remark) + } + + if respData.Id != nil { + _ = d.Set("rule_id", respData.Id) + } + + return nil +} + +func resourceTencentCloudBhAccessWhiteListRuleUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_access_white_list_rule.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + ruleId = d.Id() + ) + + needChange := false + mutableArgs := []string{"source", "remark"} + for _, v := range mutableArgs { + if d.HasChange(v) { + needChange = true + break + } + } + + if needChange { + request := bhv20230418.NewModifyAccessWhiteListRuleRequest() + if v, ok := d.GetOk("source"); ok { + request.Source = helper.String(v.(string)) + } + + if v, ok := d.GetOk("remark"); ok { + request.Remark = helper.String(v.(string)) + } + + request.Id = helper.StrToUint64Point(ruleId) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().ModifyAccessWhiteListRuleWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s update bh access white list rule failed, reason:%+v", logId, reqErr) + return reqErr + } + } + + return resourceTencentCloudBhAccessWhiteListRuleRead(d, meta) +} + +func resourceTencentCloudBhAccessWhiteListRuleDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_access_white_list_rule.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewDeleteAccessWhiteListRulesRequest() + ruleId = d.Id() + ) + + request.IdSet = append(request.IdSet, helper.StrToUint64Point(ruleId)) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DeleteAccessWhiteListRulesWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s delete bh access white list rule failed, reason:%+v", logId, reqErr) + return reqErr + } + + return nil +} diff --git a/tencentcloud/services/bh/resource_tc_bh_access_white_list_rule.md b/tencentcloud/services/bh/resource_tc_bh_access_white_list_rule.md new file mode 100644 index 0000000000..d602e3c2c6 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_access_white_list_rule.md @@ -0,0 +1,18 @@ +Provides a resource to create a BH access white list rule + +Example Usage + +```hcl +resource "tencentcloud_bh_access_white_list_rule" "example" { + source = "1.1.1.1" + remark = "remark." +} +``` + +Import + +BH access white list rule can be imported using the id, e.g. + +``` +terraform import tencentcloud_bh_access_white_list_rule.example 1235 +``` diff --git a/tencentcloud/services/bh/resource_tc_bh_access_white_list_rule_test.go b/tencentcloud/services/bh/resource_tc_bh_access_white_list_rule_test.go new file mode 100644 index 0000000000..f400d9a8ba --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_access_white_list_rule_test.go @@ -0,0 +1,56 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhAccessWhiteListRuleResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBhAccessWhiteListRule, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_access_white_list_rule.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_bh_access_white_list_rule.example", "source"), + resource.TestCheckResourceAttrSet("tencentcloud_bh_access_white_list_rule.example", "remark"), + ), + }, + { + Config: testAccBhAccessWhiteListRuleUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_access_white_list_rule.example", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_bh_access_white_list_rule.example", "source"), + resource.TestCheckResourceAttrSet("tencentcloud_bh_access_white_list_rule.example", "remark"), + ), + }, + { + ResourceName: "tencentcloud_bh_access_white_list_rule.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccBhAccessWhiteListRule = ` +resource "tencentcloud_bh_access_white_list_rule" "example" { + source = "1.1.1.1" + remark = "remark." +} +` + +const testAccBhAccessWhiteListRuleUpdate = ` +resource "tencentcloud_bh_access_white_list_rule" "example" { + source = "2.2.2.2" + remark = "remark update." +} +` diff --git a/tencentcloud/services/bh/resource_tc_bh_asset_sync_flag_config.go b/tencentcloud/services/bh/resource_tc_bh_asset_sync_flag_config.go new file mode 100644 index 0000000000..30c38828bd --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_asset_sync_flag_config.go @@ -0,0 +1,120 @@ +package bh + +import ( + "context" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudBhAssetSyncFlagConfig() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBhAssetSyncFlagConfigCreate, + Read: resourceTencentCloudBhAssetSyncFlagConfigRead, + Update: resourceTencentCloudBhAssetSyncFlagConfigUpdate, + Delete: resourceTencentCloudBhAssetSyncFlagConfigDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "auto_sync": { + Type: schema.TypeBool, + Required: true, + Description: "Whether to enable asset auto-sync, false - disabled, true - enabled.", + }, + + // computed + "role_granted": { + Type: schema.TypeBool, + Computed: true, + Description: "Whether the role has been authorized, false - not authorized, true - authorized.", + }, + }, + } +} + +func resourceTencentCloudBhAssetSyncFlagConfigCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_asset_sync_flag_config.create")() + defer tccommon.InconsistentCheck(d, meta)() + + d.SetId(helper.BuildToken()) + + return resourceTencentCloudBhAssetSyncFlagConfigUpdate(d, meta) +} + +func resourceTencentCloudBhAssetSyncFlagConfigRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_asset_sync_flag_config.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = BhService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + ) + + respData, err := service.DescribeBhAssetSyncFlagConfigById(ctx) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_bh_asset_sync_flag_config` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.AutoSync != nil { + _ = d.Set("auto_sync", respData.AutoSync) + } + + if respData.RoleGranted != nil { + _ = d.Set("role_granted", respData.RoleGranted) + } + + return nil +} + +func resourceTencentCloudBhAssetSyncFlagConfigUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_asset_sync_flag_config.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewModifyAssetSyncFlagRequest() + ) + + if v, ok := d.GetOkExists("auto_sync"); ok { + request.AutoSync = helper.Bool(v.(bool)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().ModifyAssetSyncFlagWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s update bh asset sync flag config failed, reason:%+v", logId, reqErr) + return reqErr + } + + return resourceTencentCloudBhAssetSyncFlagConfigRead(d, meta) +} + +func resourceTencentCloudBhAssetSyncFlagConfigDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_asset_sync_flag_config.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/bh/resource_tc_bh_asset_sync_flag_config.md b/tencentcloud/services/bh/resource_tc_bh_asset_sync_flag_config.md new file mode 100644 index 0000000000..5de86a3ce7 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_asset_sync_flag_config.md @@ -0,0 +1,17 @@ +Provides a resource to create a BH asset sync flag config + +Example Usage + +```hcl +resource "tencentcloud_bh_asset_sync_flag_config" "example" { + auto_sync = true +} +``` + +Import + +BH asset sync flag config can be imported using the customId(like uuid or base64 string), e.g. + +``` +terraform import tencentcloud_bh_asset_sync_flag_config.example yci5a1o76a5HzCaqJM2bQA== +``` diff --git a/tencentcloud/services/bh/resource_tc_bh_asset_sync_flag_config_test.go b/tencentcloud/services/bh/resource_tc_bh_asset_sync_flag_config_test.go new file mode 100644 index 0000000000..22f01ccac3 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_asset_sync_flag_config_test.go @@ -0,0 +1,50 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhAssetSyncFlagConfigResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBhAssetSyncFlagConfig, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_asset_sync_flag_config.example", "id"), + ), + }, + { + Config: testAccBhAssetSyncFlagConfigUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_asset_sync_flag_config.example", "id"), + ), + }, + { + ResourceName: "tencentcloud_bh_asset_sync_flag_config.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccBhAssetSyncFlagConfig = ` +resource "tencentcloud_bh_asset_sync_flag_config" "example" { + auto_sync = true +} +` + +const testAccBhAssetSyncFlagConfigUpdate = ` +resource "tencentcloud_bh_asset_sync_flag_config" "example" { + auto_sync = false +} +` diff --git a/tencentcloud/services/bh/resource_tc_bh_asset_sync_job_operation.go b/tencentcloud/services/bh/resource_tc_bh_asset_sync_job_operation.go new file mode 100644 index 0000000000..781ca962b2 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_asset_sync_job_operation.go @@ -0,0 +1,112 @@ +package bh + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudBhAssetSyncJobOperation() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBhAssetSyncJobOperationCreate, + Read: resourceTencentCloudBhAssetSyncJobOperationRead, + Delete: resourceTencentCloudBhAssetSyncJobOperationDelete, + Schema: map[string]*schema.Schema{ + "category": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + ValidateFunc: tccommon.ValidateAllowedIntValue([]int{1, 2}), + Description: "Asset synchronization category, 1 - host assets, 2 - database assets.", + }, + }, + } +} + +func resourceTencentCloudBhAssetSyncJobOperationCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_asset_sync_job_operation.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewCreateAssetSyncJobRequest() + category string + ) + + if v, ok := d.GetOkExists("category"); ok { + request.Category = helper.IntUint64(v.(int)) + category = helper.IntToStr(v.(int)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().CreateAssetSyncJobWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s create bh asset sync job operation failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(category) + + // wait + waitReq := bhv20230418.NewDescribeAssetSyncStatusRequest() + if v, ok := d.GetOkExists("category"); ok { + waitReq.Category = helper.IntUint64(v.(int)) + } + + reqErr = resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DescribeAssetSyncStatusWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, waitReq.GetAction(), waitReq.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.Status == nil || result.Response.Status.InProcess == nil { + return resource.NonRetryableError(fmt.Errorf("Describe bh asset sync status failed, Response is nil.")) + } + + if !*result.Response.Status.InProcess { + return nil + } + + return resource.RetryableError(fmt.Errorf("Asset sync status is still running...")) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s describe bh asset sync status failed, reason:%+v", logId, reqErr) + return reqErr + } + + return resourceTencentCloudBhAssetSyncJobOperationRead(d, meta) +} + +func resourceTencentCloudBhAssetSyncJobOperationRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_asset_sync_job_operation.read")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudBhAssetSyncJobOperationDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_asset_sync_job_operation.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/bh/resource_tc_bh_asset_sync_job_operation.md b/tencentcloud/services/bh/resource_tc_bh_asset_sync_job_operation.md new file mode 100644 index 0000000000..0c01207449 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_asset_sync_job_operation.md @@ -0,0 +1,9 @@ +Provides a resource to create a BH asset sync job operation + +Example Usage + +```hcl +resource "tencentcloud_bh_asset_sync_job_operation" "example" { + category = 1 +} +``` diff --git a/tencentcloud/services/bh/resource_tc_bh_asset_sync_job_operation_test.go b/tencentcloud/services/bh/resource_tc_bh_asset_sync_job_operation_test.go new file mode 100644 index 0000000000..53fbcf3e4e --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_asset_sync_job_operation_test.go @@ -0,0 +1,31 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhAssetSyncJobOperationResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccBhAssetSyncJobOperation, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_asset_sync_job_operation.example", "id"), + ), + }}, + }) +} + +const testAccBhAssetSyncJobOperation = ` +resource "tencentcloud_bh_asset_sync_job_operation" "example" { + category = 1 +} +` diff --git a/tencentcloud/services/bh/resource_tc_bh_device.go b/tencentcloud/services/bh/resource_tc_bh_device.go new file mode 100644 index 0000000000..7550623c5b --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_device.go @@ -0,0 +1,436 @@ +package bh + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudBhDevice() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBhDeviceCreate, + Read: resourceTencentCloudBhDeviceRead, + Update: resourceTencentCloudBhDeviceUpdate, + Delete: resourceTencentCloudBhDeviceDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "device_set": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Description: "Asset parameter list.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "os_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Operating system name, can only be Linux, Windows or MySQL.", + }, + "ip": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "IP address.", + }, + "port": { + Type: schema.TypeInt, + Required: true, + Description: "Management port.", + }, + "name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Host name, can be empty.", + }, + "department_id": { + Type: schema.TypeString, + Optional: true, + Description: "Department ID to which the asset belongs.", + }, + "ip_port_set": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + ForceNew: true, + Description: "Asset multi-node: IP and port fields.", + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "enable_ssl": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ForceNew: true, + Description: "Whether to enable SSL, 1: enable, 0: disable, only supports Redis assets.", + }, + "ssl_cert": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "SSL certificate, required when EnableSSL is enabled.", + }, + "ssl_cert_name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "SSL certificate name, required when EnableSSL is enabled.", + }, + "instance_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + Description: "Asset instance ID.", + }, + "ap_code": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + Description: "Region to which the asset belongs.", + }, + "ap_name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Region name.", + }, + "vpc_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "VPC to which the asset belongs.", + }, + "subnet_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Subnet to which the asset belongs.", + }, + "public_ip": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Description: "Public IP.", + }, + }, + }, + }, + + "account_id": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Description: "Cloud account ID to which the asset belongs.", + }, + + // computed + "device_id": { + Type: schema.TypeInt, + Computed: true, + Description: "ID of the device.", + }, + }, + } +} + +func resourceTencentCloudBhDeviceCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_device.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewImportExternalDeviceRequest() + response = bhv20230418.NewImportExternalDeviceResponse() + deviceId string + ) + + if v, ok := d.GetOk("device_set"); ok { + for _, item := range v.([]interface{}) { + deviceSetMap := item.(map[string]interface{}) + externalDevice := bhv20230418.ExternalDevice{} + if v, ok := deviceSetMap["os_name"].(string); ok && v != "" { + externalDevice.OsName = helper.String(v) + } + + if v, ok := deviceSetMap["ip"].(string); ok && v != "" { + externalDevice.Ip = helper.String(v) + } + + if v, ok := deviceSetMap["port"].(int); ok { + externalDevice.Port = helper.IntUint64(v) + } + + if v, ok := deviceSetMap["name"].(string); ok && v != "" { + externalDevice.Name = helper.String(v) + } + + if v, ok := deviceSetMap["department_id"].(string); ok && v != "" { + externalDevice.DepartmentId = helper.String(v) + } + + if v, ok := deviceSetMap["ip_port_set"]; ok { + ipPortSetSet := v.(*schema.Set).List() + for i := range ipPortSetSet { + ipPortSet := ipPortSetSet[i].(string) + externalDevice.IpPortSet = append(externalDevice.IpPortSet, helper.String(ipPortSet)) + } + } + + if v, ok := deviceSetMap["enable_ssl"].(int); ok { + externalDevice.EnableSSL = helper.IntInt64(v) + } + + if v, ok := deviceSetMap["ssl_cert"].(string); ok && v != "" { + externalDevice.SSLCert = helper.String(v) + } + + if v, ok := deviceSetMap["ssl_cert_name"].(string); ok && v != "" { + externalDevice.SSLCertName = helper.String(v) + } + + if v, ok := deviceSetMap["instance_id"].(string); ok && v != "" { + externalDevice.InstanceId = helper.String(v) + } + + if v, ok := deviceSetMap["ap_code"].(string); ok && v != "" { + externalDevice.ApCode = helper.String(v) + } + + if v, ok := deviceSetMap["ap_name"].(string); ok && v != "" { + externalDevice.ApName = helper.String(v) + } + + if v, ok := deviceSetMap["vpc_id"].(string); ok && v != "" { + externalDevice.VpcId = helper.String(v) + } + + if v, ok := deviceSetMap["subnet_id"].(string); ok && v != "" { + externalDevice.SubnetId = helper.String(v) + } + + if v, ok := deviceSetMap["public_ip"].(string); ok && v != "" { + externalDevice.PublicIp = helper.String(v) + } + + request.DeviceSet = append(request.DeviceSet, &externalDevice) + } + } + + if v, ok := d.GetOkExists("account_id"); ok { + request.AccountId = helper.IntUint64(v.(int)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().ImportExternalDeviceWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Import external device failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create bh device failed, reason:%+v", logId, reqErr) + return reqErr + } + + if response.Response.DeviceIdSet == nil || len(response.Response.DeviceIdSet) == 0 { + return fmt.Errorf("DeviceIdSet is nil.") + } + + deviceId = helper.UInt64ToStr(*response.Response.DeviceIdSet[0]) + d.SetId(deviceId) + return resourceTencentCloudBhDeviceRead(d, meta) +} + +func resourceTencentCloudBhDeviceRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_device.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = BhService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + deviceId = d.Id() + ) + + respData, err := service.DescribeBhDeviceById(ctx, deviceId) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_bh_device` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + dMap := make(map[string]interface{}, 0) + if respData.OsName != nil { + dMap["os_name"] = respData.OsName + } + + if respData.PrivateIp != nil { + dMap["ip"] = respData.PrivateIp + } + + if respData.Port != nil { + dMap["port"] = respData.Port + } + + if respData.Name != nil { + dMap["name"] = respData.Name + } + + if respData.Department != nil { + if respData.Department.Id != nil { + dMap["department_id"] = respData.Department.Id + } + } + + if respData.IpPortSet != nil { + dMap["ip_port_set"] = respData.IpPortSet + } + + if respData.EnableSSL != nil { + dMap["enable_ssl"] = respData.EnableSSL + } + + if respData.SSLCertName != nil { + dMap["ssl_cert_name"] = respData.SSLCertName + } + + if respData.InstanceId != nil { + dMap["instance_id"] = respData.InstanceId + } + + if respData.ApCode != nil { + dMap["ap_code"] = respData.ApCode + } + + if respData.ApName != nil { + dMap["ap_name"] = respData.ApName + } + + if respData.VpcId != nil { + dMap["vpc_id"] = respData.VpcId + } + + if respData.SubnetId != nil { + dMap["subnet_id"] = respData.SubnetId + } + + if respData.PublicIp != nil { + dMap["public_ip"] = respData.PublicIp + } + + _ = d.Set("device_set", []interface{}{dMap}) + + if respData.CloudAccountId != nil { + _ = d.Set("account_id", respData.CloudAccountId) + } + + return nil +} + +func resourceTencentCloudBhDeviceUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_device.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + deviceId = d.Id() + ) + + needChange := false + mutableArgs := []string{"device_set.0.port", "device_set.0.department_id"} + for _, v := range mutableArgs { + if d.HasChange(v) { + needChange = true + break + } + } + + if needChange { + request := bhv20230418.NewModifyDeviceRequest() + if v, ok := d.GetOkExists("device_set.0.port"); ok { + request.Port = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("device_set.0.department_id"); ok { + request.DepartmentId = helper.String(v.(string)) + } + + request.Id = helper.StrToUint64Point(deviceId) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().ModifyDeviceWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s update bh device failed, reason:%+v", logId, reqErr) + return reqErr + } + } + + return resourceTencentCloudBhDeviceRead(d, meta) +} + +func resourceTencentCloudBhDeviceDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_device.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewDeleteDevicesRequest() + deviceId = d.Id() + ) + + request.IdSet = append(request.IdSet, helper.StrToUint64Point(deviceId)) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DeleteDevicesWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s delete bh device failed, reason:%+v", logId, reqErr) + return reqErr + } + + return nil +} diff --git a/tencentcloud/services/bh/resource_tc_bh_device.md b/tencentcloud/services/bh/resource_tc_bh_device.md new file mode 100644 index 0000000000..5830734b6f --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_device.md @@ -0,0 +1,22 @@ +Provides a resource to create a BH device + +Example Usage + +```hcl +resource "tencentcloud_bh_device" "example" { + device_set { + os_name = "Linux" + ip = "1.1.1.1" + port = 22 + name = "tf-example" + } +} +``` + +Import + +BH device can be imported using the id, e.g. + +``` +terraform import tencentcloud_bh_device.example 1875 +``` diff --git a/tencentcloud/services/bh/resource_tc_bh_device_test.go b/tencentcloud/services/bh/resource_tc_bh_device_test.go new file mode 100644 index 0000000000..36f54f3ae9 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_device_test.go @@ -0,0 +1,60 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhDeviceResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBhDevice, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_device.example", "id"), + ), + }, + { + Config: testAccBhDeviceUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_device.example", "id"), + ), + }, + { + ResourceName: "tencentcloud_bh_device.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccBhDevice = ` +resource "tencentcloud_bh_device" "example" { + device_set { + os_name = "Linux" + ip = "1.1.1.1" + port = 22 + name = "tf-example" + } +} +` + +const testAccBhDeviceUpdate = ` +resource "tencentcloud_bh_device" "example" { + device_set { + os_name = "Linux" + ip = "1.1.1.1" + port = 44 + name = "tf-example" + } +} +` diff --git a/tencentcloud/services/bh/resource_tc_bh_reconnection_setting_config.go b/tencentcloud/services/bh/resource_tc_bh_reconnection_setting_config.go new file mode 100644 index 0000000000..b3abb99ea7 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_reconnection_setting_config.go @@ -0,0 +1,125 @@ +package bh + +import ( + "context" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudBhReconnectionSettingConfig() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBhReconnectionSettingConfigCreate, + Read: resourceTencentCloudBhReconnectionSettingConfigRead, + Update: resourceTencentCloudBhReconnectionSettingConfigUpdate, + Delete: resourceTencentCloudBhReconnectionSettingConfigDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "reconnection_max_count": { + Type: schema.TypeInt, + Required: true, + Description: "Retry count, value range: 0-20.", + }, + + "enable": { + Type: schema.TypeBool, + Required: true, + Description: "true: limit reconnection count, false: do not limit reconnection count.", + }, + }, + } +} + +func resourceTencentCloudBhReconnectionSettingConfigCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_reconnection_setting_config.create")() + defer tccommon.InconsistentCheck(d, meta)() + + d.SetId(helper.BuildToken()) + + return resourceTencentCloudBhReconnectionSettingConfigUpdate(d, meta) +} + +func resourceTencentCloudBhReconnectionSettingConfigRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_reconnection_setting_config.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = BhService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + ) + + respData, err := service.DescribeBhReconnectionSettingConfigById(ctx) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_bh_reconnection_setting_config` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.Reconnection != nil { + if respData.Reconnection.ReconnectionMaxCount != nil { + _ = d.Set("reconnection_max_count", respData.Reconnection.ReconnectionMaxCount) + } + + if respData.Reconnection.Enable != nil { + _ = d.Set("enable", respData.Reconnection.Enable) + } + } + + return nil +} + +func resourceTencentCloudBhReconnectionSettingConfigUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_reconnection_setting_config.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewModifyReconnectionSettingRequest() + ) + + if v, ok := d.GetOkExists("reconnection_max_count"); ok { + request.ReconnectionMaxCount = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOkExists("enable"); ok { + request.Enable = helper.Bool(v.(bool)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().ModifyReconnectionSettingWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s update bh reconnection setting config failed, reason:%+v", logId, reqErr) + return reqErr + } + + return resourceTencentCloudBhReconnectionSettingConfigRead(d, meta) +} + +func resourceTencentCloudBhReconnectionSettingConfigDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_reconnection_setting_config.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/bh/resource_tc_bh_reconnection_setting_config.md b/tencentcloud/services/bh/resource_tc_bh_reconnection_setting_config.md new file mode 100644 index 0000000000..0caef06cd1 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_reconnection_setting_config.md @@ -0,0 +1,18 @@ +Provides a resource to create a BH reconnection setting config + +Example Usage + +```hcl +resource "tencentcloud_bh_reconnection_setting_config" "example" { + reconnection_max_count = 5 + enable = true +} +``` + +Import + +BH reconnection setting config can be imported using the customId(like uuid or base64 string), e.g. + +``` +terraform import tencentcloud_bh_reconnection_setting_config.example gO1Ew6OEgLcQun164XiWmw== +``` diff --git a/tencentcloud/services/bh/resource_tc_bh_reconnection_setting_config_test.go b/tencentcloud/services/bh/resource_tc_bh_reconnection_setting_config_test.go new file mode 100644 index 0000000000..ad3dac01c0 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_reconnection_setting_config_test.go @@ -0,0 +1,52 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhReconnectionSettingConfigResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBhReconnectionSettingConfig, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_reconnection_setting_config.example", "id"), + ), + }, + { + Config: testAccBhReconnectionSettingConfigUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_reconnection_setting_config.example", "id"), + ), + }, + { + ResourceName: "tencentcloud_bh_reconnection_setting_config.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccBhReconnectionSettingConfig = ` +resource "tencentcloud_bh_reconnection_setting_config" "example" { + reconnection_max_count = 5 + enable = false +} +` + +const testAccBhReconnectionSettingConfigUpdate = ` +resource "tencentcloud_bh_reconnection_setting_config" "example" { + reconnection_max_count = 3 + enable = true +} +` diff --git a/tencentcloud/services/bh/resource_tc_bh_resource.go b/tencentcloud/services/bh/resource_tc_bh_resource.go new file mode 100644 index 0000000000..1d26599b56 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_resource.go @@ -0,0 +1,748 @@ +package bh + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudBhResource() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBhResourceCreate, + Read: resourceTencentCloudBhResourceRead, + Update: resourceTencentCloudBhResourceUpdate, + Delete: resourceTencentCloudBhResourceDelete, + Schema: map[string]*schema.Schema{ + "deploy_region": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Deployment region.", + }, + + "vpc_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "VPC ID for deploying the bastion host.", + }, + + "subnet_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Subnet ID for deploying the bastion host.", + }, + + "resource_edition": { + Type: schema.TypeString, + Required: true, + Description: "Resource type. Values: standard/pro.", + }, + + "resource_node": { + Type: schema.TypeInt, + Required: true, + Description: "Number of resource nodes.", + }, + + "time_unit": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Billing cycle.", + }, + + "time_span": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + Description: "Billing duration.", + }, + + "pay_mode": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + Description: "Billing mode, 1 for prepaid.", + }, + + "auto_renew_flag": { + Type: schema.TypeInt, + Required: true, + Description: "Auto-renewal.", + }, + + "deploy_zone": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Deployment zone.", + }, + + "trial": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ForceNew: true, + Description: "0 for non-trial version, 1 for trial version.", + }, + + "share_clb": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ForceNew: true, + Description: "Whether to share CLB, 0: not shared, 1: shared.", + }, + + // deploy params + "cidr_block": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "CIDR block of the bastion host.", + }, + + "vpc_cidr_block": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "The network segment corresponding to the VPC that needs to activate the service.", + }, + + "web_access": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ForceNew: true, + Description: "0 - Disable web access bastion host; 1 - Enable web access bastion host.", + }, + + "client_access": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ForceNew: true, + Description: "0 - Disable client access to the bastion host; 1 - Enable client access to the bastion host.", + }, + + "intranet_access": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "0 - Disable internal network access bastion host; 1 - Enable internal network access bastion host.", + }, + + "external_access": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "0 - Disable public network access to the bastion host; 1 - Enable public network access to the bastion host.", + }, + + // computed + "resource_id": { + Type: schema.TypeString, + Computed: true, + Description: "Resource instance ID.", + }, + }, + } +} + +func resourceTencentCloudBhResourceCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_resource.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewCreateResourceRequest() + response = bhv20230418.NewCreateResourceResponse() + resourceId string + ) + + if v, ok := d.GetOk("deploy_region"); ok { + request.DeployRegion = helper.String(v.(string)) + } + + if v, ok := d.GetOk("vpc_id"); ok { + request.VpcId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("subnet_id"); ok { + request.SubnetId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("resource_edition"); ok { + request.ResourceEdition = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("resource_node"); ok { + request.ResourceNode = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("time_unit"); ok { + request.TimeUnit = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("time_span"); ok { + request.TimeSpan = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("pay_mode"); ok { + request.PayMode = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("auto_renew_flag"); ok { + request.AutoRenewFlag = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOk("deploy_zone"); ok { + request.DeployZone = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("trial"); ok { + request.Trial = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOkExists("share_clb"); ok { + request.ShareClb = helper.IntUint64(v.(int)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().CreateResourceWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Create bh resource failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + + if response.Response.ResourceId == nil { + return fmt.Errorf("ResourceId is nil.") + } + + resourceId = *response.Response.ResourceId + d.SetId(resourceId) + + // deploy + deployReq := bhv20230418.NewDeployResourceRequest() + if v, ok := d.GetOk("deploy_region"); ok { + deployReq.ApCode = helper.String(v.(string)) + } + + if v, ok := d.GetOk("deploy_zone"); ok { + deployReq.Zone = helper.String(v.(string)) + } + + if v, ok := d.GetOk("vpc_id"); ok { + deployReq.VpcId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("subnet_id"); ok { + deployReq.SubnetId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("cidr_block"); ok { + deployReq.CidrBlock = helper.String(v.(string)) + } + + if v, ok := d.GetOk("vpc_cidr_block"); ok { + deployReq.VpcCidrBlock = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("web_access"); ok { + deployReq.WebAccess = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOkExists("client_access"); ok { + deployReq.ClientAccess = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOkExists("intranet_access"); ok { + deployReq.IntranetAccess = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOkExists("external_access"); ok { + deployReq.ExternalAccess = helper.IntUint64(v.(int)) + } + + deployReq.ResourceId = &resourceId + reqErr = resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DeployResourceWithContext(ctx, deployReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, deployReq.GetAction(), deployReq.ToJsonString(), result.ToJsonString()) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s deploy bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + + // wait + waitReq := bhv20230418.NewDescribeResourcesRequest() + waitReq.ResourceIds = []*string{&resourceId} + reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DescribeResourcesWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, waitReq.GetAction(), waitReq.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.ResourceSet == nil || len(result.Response.ResourceSet) == 0 { + return resource.NonRetryableError(fmt.Errorf("Describe bh resource failed, Response is nil.")) + } + + resourceStatus := result.Response.ResourceSet[0].Status + if resourceStatus == nil { + return resource.NonRetryableError(fmt.Errorf("Status is nil.")) + } + + if *resourceStatus == 1 { + return nil + } + + return resource.RetryableError(fmt.Errorf("Resource is still deploying...Status is %d", *resourceStatus)) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s deploy bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + + return resourceTencentCloudBhResourceRead(d, meta) +} + +func resourceTencentCloudBhResourceRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_resource.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = BhService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + resourceId = d.Id() + ) + + respData, err := service.DescribeBhResourceById(ctx, resourceId) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_bh_resource` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.ApCode != nil { + _ = d.Set("deploy_region", respData.ApCode) + } + + if respData.VpcId != nil { + _ = d.Set("vpc_id", respData.VpcId) + } + + if respData.SubnetId != nil { + _ = d.Set("subnet_id", respData.SubnetId) + } + + if respData.Nodes != nil { + _ = d.Set("resource_node", respData.Nodes) + } + + if respData.RenewFlag != nil { + _ = d.Set("auto_renew_flag", respData.RenewFlag) + } + + if respData.Zone != nil { + _ = d.Set("deploy_zone", respData.Zone) + } + + if respData.Trial != nil { + _ = d.Set("trial", respData.Trial) + } + + if respData.ShareClb != nil { + if *respData.ShareClb { + _ = d.Set("share_clb", 1) + } else { + _ = d.Set("share_clb", 0) + } + } + + if respData.CidrBlock != nil { + _ = d.Set("cidr_block", respData.CidrBlock) + } + + if respData.VpcCidrBlock != nil { + _ = d.Set("vpc_cidr_block", respData.VpcCidrBlock) + } + + if respData.WebAccess != nil { + _ = d.Set("web_access", respData.WebAccess) + } + + if respData.WebAccess != nil { + _ = d.Set("web_access", respData.WebAccess) + } + + if respData.ClientAccess != nil { + _ = d.Set("client_access", respData.ClientAccess) + } + + if respData.IntranetAccess != nil { + _ = d.Set("intranet_access", respData.IntranetAccess) + } + + if respData.ExternalAccess != nil { + _ = d.Set("external_access", respData.ExternalAccess) + } + + return nil +} + +func resourceTencentCloudBhResourceUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_resource.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + resourceId = d.Id() + ) + + needChange := false + mutableArgs := []string{"resource_edition", "resource_node", "auto_renew_flag"} + for _, v := range mutableArgs { + if d.HasChange(v) { + needChange = true + break + } + } + + if needChange { + request := bhv20230418.NewModifyResourceRequest() + if v, ok := d.GetOk("resource_edition"); ok { + request.ResourceEdition = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("resource_node"); ok { + request.ResourceNode = helper.IntInt64(v.(int)) + } + + if v, ok := d.GetOkExists("auto_renew_flag"); ok { + request.AutoRenewFlag = helper.IntInt64(v.(int)) + } + + request.ResourceId = helper.String(resourceId) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().ModifyResourceWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s update bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + + // wait + waitReq := bhv20230418.NewDescribeResourcesRequest() + waitReq.ResourceIds = []*string{&resourceId} + reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DescribeResourcesWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, waitReq.GetAction(), waitReq.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.ResourceSet == nil || len(result.Response.ResourceSet) == 0 { + return resource.NonRetryableError(fmt.Errorf("Describe bh resource failed, Response is nil.")) + } + + resourceStatus := result.Response.ResourceSet[0].Status + if resourceStatus == nil { + return resource.NonRetryableError(fmt.Errorf("Status is nil.")) + } + + if *resourceStatus == 1 { + return nil + } + + return resource.RetryableError(fmt.Errorf("Resource is still deploying...Status is %d", *resourceStatus)) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s deploy bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + } + + if d.HasChange("intranet_access") { + if v, ok := d.GetOkExists("intranet_access"); ok { + if v.(int) == 1 { + request := bhv20230418.NewEnableIntranetAccessRequest() + if v, ok := d.GetOk("vpc_id"); ok { + request.VpcId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("subnet_id"); ok { + request.SubnetId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("vpc_cidr_block"); ok { + request.VpcCidrBlock = helper.String(v.(string)) + } + + request.ResourceId = helper.String(resourceId) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().EnableIntranetAccessWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s enable intranet access bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + + // wait + waitReq := bhv20230418.NewDescribeResourcesRequest() + waitReq.ResourceIds = []*string{&resourceId} + reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DescribeResourcesWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, waitReq.GetAction(), waitReq.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.ResourceSet == nil || len(result.Response.ResourceSet) == 0 { + return resource.NonRetryableError(fmt.Errorf("Describe bh resource failed, Response is nil.")) + } + + intranetAccess := result.Response.ResourceSet[0].IntranetAccess + if intranetAccess == nil { + return resource.NonRetryableError(fmt.Errorf("IntranetAccess is nil.")) + } + + if *intranetAccess == 1 { + return nil + } + + return resource.RetryableError(fmt.Errorf("Enable intranet access is still running...Intranet access is %d", *intranetAccess)) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s enable intranet access bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + } else { + request := bhv20230418.NewDisableIntranetAccessRequest() + request.ResourceId = helper.String(resourceId) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DisableIntranetAccessWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s disable intranet access bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + + // wait + waitReq := bhv20230418.NewDescribeResourcesRequest() + waitReq.ResourceIds = []*string{&resourceId} + reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DescribeResourcesWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, waitReq.GetAction(), waitReq.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.ResourceSet == nil || len(result.Response.ResourceSet) == 0 { + return resource.NonRetryableError(fmt.Errorf("Describe bh resource failed, Response is nil.")) + } + + intranetAccess := result.Response.ResourceSet[0].IntranetAccess + if intranetAccess == nil { + return resource.NonRetryableError(fmt.Errorf("IntranetAccess is nil.")) + } + + if *intranetAccess == 0 { + return nil + } + + return resource.RetryableError(fmt.Errorf("Disable intranet access is still running...Intranet access is %d", *intranetAccess)) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s disable intranet access bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + } + } + + } + + if d.HasChange("external_access") { + if v, ok := d.GetOkExists("external_access"); ok { + if v.(int) == 1 { + request := bhv20230418.NewEnableExternalAccessRequest() + request.ResourceId = helper.String(resourceId) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().EnableExternalAccessWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s disable external access bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + + // wait + waitReq := bhv20230418.NewDescribeResourcesRequest() + waitReq.ResourceIds = []*string{&resourceId} + reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DescribeResourcesWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, waitReq.GetAction(), waitReq.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.ResourceSet == nil || len(result.Response.ResourceSet) == 0 { + return resource.NonRetryableError(fmt.Errorf("Describe bh resource failed, Response is nil.")) + } + + externalAccess := result.Response.ResourceSet[0].ExternalAccess + if externalAccess == nil { + return resource.NonRetryableError(fmt.Errorf("ExternalAccess is nil.")) + } + + if *externalAccess == 1 { + return nil + } + + return resource.RetryableError(fmt.Errorf("Enable external access is still running...External access is %d", *externalAccess)) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s enable external access bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + } else { + request := bhv20230418.NewDisableExternalAccessRequest() + request.ResourceId = helper.String(resourceId) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DisableExternalAccessWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s disable external access bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + + // wait + waitReq := bhv20230418.NewDescribeResourcesRequest() + waitReq.ResourceIds = []*string{&resourceId} + reqErr = resource.Retry(tccommon.ReadRetryTimeout*7, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DescribeResourcesWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, waitReq.GetAction(), waitReq.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.ResourceSet == nil || len(result.Response.ResourceSet) == 0 { + return resource.NonRetryableError(fmt.Errorf("Describe bh resource failed, Response is nil.")) + } + + externalAccess := result.Response.ResourceSet[0].ExternalAccess + if externalAccess == nil { + return resource.NonRetryableError(fmt.Errorf("ExternalAccess is nil.")) + } + + if *externalAccess == 0 { + return nil + } + + return resource.RetryableError(fmt.Errorf("Disable external access is still running...External access is %d", *externalAccess)) + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s disable external access bh resource failed, reason:%+v", logId, reqErr) + return reqErr + } + } + } + } + + return resourceTencentCloudBhResourceRead(d, meta) +} + +func resourceTencentCloudBhResourceDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_resource.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return fmt.Errorf("tencentcloud bh resource not supported delete, please contact the work order for processing") +} diff --git a/tencentcloud/services/bh/resource_tc_bh_resource.md b/tencentcloud/services/bh/resource_tc_bh_resource.md new file mode 100644 index 0000000000..07ab44df86 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_resource.md @@ -0,0 +1,22 @@ +Provides a resource to create a BH resource + +Example Usage + +```hcl +resource "tencentcloud_bh_resource" "example" { + deploy_region = "ap-guangzhou" + vpc_id = "vpc-q1of50wz" + subnet_id = "subnet-7uhvm46o" + resource_edition = "standard" + resource_node = 20 + time_unit = "m" + time_span = "1" + pay_mode = 1 + auto_renew_flag = 1 + deploy_zone = "ap-guangzhou-6" + cidr_block = "192.168.11.0/24" + vpc_cidr_block = "192.168.0.0/16" + intranet_access = 1 + external_access = 1 +} +``` diff --git a/tencentcloud/services/bh/resource_tc_bh_resource_test.go b/tencentcloud/services/bh/resource_tc_bh_resource_test.go new file mode 100644 index 0000000000..d9645765c4 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_resource_test.go @@ -0,0 +1,67 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhResourceResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBhResource, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_resource.example", "id"), + ), + }, + { + Config: testAccBhResourceUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_resource.example", "id"), + ), + }, + }, + }) +} + +const testAccBhResource = ` +resource "tencentcloud_bh_resource" "example" { + deploy_region = "ap-guangzhou" + vpc_id = "vpc-q1of50wz" + subnet_id = "subnet-7uhvm46o" + resource_edition = "standard" + resource_node = 20 + time_unit = "m" + time_span = "1" + pay_mode = 1 + auto_renew_flag = 1 + deploy_zone = "ap-guangzhou-6" + cidr_block = "192.168.11.0/24" + vpc_cidr_block = "192.168.0.0/16" +} +` + +const testAccBhResourceUpdate = ` +resource "tencentcloud_bh_resource" "example" { + deploy_region = "ap-guangzhou" + vpc_id = "vpc-q1of50wz" + subnet_id = "subnet-7uhvm46o" + resource_edition = "standard" + resource_node = 10 + time_unit = "m" + time_span = "1" + pay_mode = 1 + auto_renew_flag = 0 + deploy_zone = "ap-guangzhou-6" + cidr_block = "192.168.11.0/24" + vpc_cidr_block = "192.168.0.0/16" +} +` diff --git a/tencentcloud/services/bh/resource_tc_bh_sync_devices_to_ioa_operation.go b/tencentcloud/services/bh/resource_tc_bh_sync_devices_to_ioa_operation.go new file mode 100644 index 0000000000..6191eccd99 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_sync_devices_to_ioa_operation.go @@ -0,0 +1,86 @@ +package bh + +import ( + "context" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudBhSyncDevicesToIoaOperation() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBhSyncDevicesToIoaOperationCreate, + Read: resourceTencentCloudBhSyncDevicesToIoaOperationRead, + Delete: resourceTencentCloudBhSyncDevicesToIoaOperationDelete, + Schema: map[string]*schema.Schema{ + "device_id_set": { + Type: schema.TypeSet, + Required: true, + ForceNew: true, + Description: "Asset ID collection. Assets must be bound to bastion host instances that support IOA functionality. Maximum 200 assets can be synchronized at a time.", + Elem: &schema.Schema{ + Type: schema.TypeInt, + }, + }, + }, + } +} + +func resourceTencentCloudBhSyncDevicesToIoaOperationCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_sync_devices_to_ioa_operation.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewSyncDevicesToIOARequest() + deviceIds []string + ) + + if v, ok := d.GetOk("device_id_set"); ok { + deviceIdSetSet := v.(*schema.Set).List() + for i := range deviceIdSetSet { + deviceIdSet := deviceIdSetSet[i].(int) + request.DeviceIdSet = append(request.DeviceIdSet, helper.IntUint64(deviceIdSet)) + deviceIds = append(deviceIds, helper.IntToStr(deviceIdSet)) + } + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().SyncDevicesToIOAWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s create bh sync devices to ioa operation failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(helper.HashStrings(deviceIds)) + return resourceTencentCloudBhSyncDevicesToIoaOperationRead(d, meta) +} + +func resourceTencentCloudBhSyncDevicesToIoaOperationRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_sync_devices_to_ioa_operation.read")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudBhSyncDevicesToIoaOperationDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_sync_devices_to_ioa_operation.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/bh/resource_tc_bh_sync_devices_to_ioa_operation.md b/tencentcloud/services/bh/resource_tc_bh_sync_devices_to_ioa_operation.md new file mode 100644 index 0000000000..bbd7ff6c64 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_sync_devices_to_ioa_operation.md @@ -0,0 +1,13 @@ +Provides a resource to create a BH sync devices to ioa operation + +Example Usage + +```hcl +resource "tencentcloud_bh_sync_devices_to_ioa_operation" "example" { + device_id_set = [ + 1934, + 1964, + 1895, + ] +} +``` diff --git a/tencentcloud/services/bh/resource_tc_bh_sync_devices_to_ioa_operation_test.go b/tencentcloud/services/bh/resource_tc_bh_sync_devices_to_ioa_operation_test.go new file mode 100644 index 0000000000..8294288d6e --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_sync_devices_to_ioa_operation_test.go @@ -0,0 +1,35 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhSyncDevicesToIoaOperationResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccBhSyncDevicesToIoaOperation, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_sync_devices_to_ioa_operation.example", "id"), + ), + }}, + }) +} + +const testAccBhSyncDevicesToIoaOperation = ` +resource "tencentcloud_bh_sync_devices_to_ioa_operation" "example" { + device_id_set = [ + 1934, + 1964, + 1895, + ] +} +` diff --git a/tencentcloud/services/bh/resource_tc_bh_user.go b/tencentcloud/services/bh/resource_tc_bh_user.go new file mode 100644 index 0000000000..f7bf82882c --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_user.go @@ -0,0 +1,377 @@ +package bh + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudBhUser() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBhUserCreate, + Read: resourceTencentCloudBhUserRead, + Update: resourceTencentCloudBhUserUpdate, + Delete: resourceTencentCloudBhUserDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "user_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Username, 3-20 characters, must start with an English letter and cannot contain characters other than `letters`, `numbers`, `.`, `_`, `-`.", + }, + + "real_name": { + Type: schema.TypeString, + Required: true, + Description: "User's real name, maximum length 20 characters, cannot contain whitespace characters.", + }, + + "phone": { + Type: schema.TypeString, + Optional: true, + Description: "Input in the format of \"country code|phone number\", e.g.: \"+86|xxxxxxxx\". At least one of phone and email parameters must be provided.", + }, + + "email": { + Type: schema.TypeString, + Optional: true, + Description: "Email address. At least one of phone and email parameters must be provided.", + }, + + "validate_from": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "User effective time, e.g.: \"2021-09-22T00:00:00+00:00\". If effective and expiration times are not filled, the user will be valid permanently.", + }, + + "validate_to": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "User expiration time, e.g.: \"2021-09-23T00:00:00+00:00\". If effective and expiration times are not filled, the user will be valid permanently.", + }, + + "group_id_set": { + Type: schema.TypeSet, + Optional: true, + Description: "User group ID set to which the user belongs.", + Elem: &schema.Schema{ + Type: schema.TypeInt, + }, + }, + + "auth_type": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "Authentication method, 0 - local, 1 - LDAP, 2 - OAuth. Default is 0 if not provided.", + }, + + "validate_time": { + Type: schema.TypeString, + Optional: true, + Description: "Access time restriction, a string composed of 0 and 1 with length 168 (7 * 24), representing the time slots allowed for the user in a week. The Nth character in the string represents the Nth hour in the week, 0 - not allowed to access, 1 - allowed to access.", + }, + + "department_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Department ID to which the user belongs, e.g.: \"1.2.3\".", + }, + + // computed + "user_id": { + Type: schema.TypeInt, + Computed: true, + Description: "User ID.", + }, + }, + } +} + +func resourceTencentCloudBhUserCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewCreateUserRequest() + response = bhv20230418.NewCreateUserResponse() + userId string + ) + + if v, ok := d.GetOk("user_name"); ok { + request.UserName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("real_name"); ok { + request.RealName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("phone"); ok { + request.Phone = helper.String(v.(string)) + } + + if v, ok := d.GetOk("email"); ok { + request.Email = helper.String(v.(string)) + } + + if v, ok := d.GetOk("validate_from"); ok { + request.ValidateFrom = helper.String(v.(string)) + } + + if v, ok := d.GetOk("validate_to"); ok { + request.ValidateTo = helper.String(v.(string)) + } + + if v, ok := d.GetOk("group_id_set"); ok { + groupIdSetSet := v.(*schema.Set).List() + for i := range groupIdSetSet { + groupIdSet := groupIdSetSet[i].(int) + request.GroupIdSet = append(request.GroupIdSet, helper.IntUint64(groupIdSet)) + } + } + + if v, ok := d.GetOkExists("auth_type"); ok { + request.AuthType = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("validate_time"); ok { + request.ValidateTime = helper.String(v.(string)) + } + + if v, ok := d.GetOk("department_id"); ok { + request.DepartmentId = helper.String(v.(string)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().CreateUserWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Create bh user failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create bh user failed, reason:%+v", logId, reqErr) + return reqErr + } + + if response.Response.Id == nil { + return fmt.Errorf("Id is nil.") + } + + userId = helper.UInt64ToStr(*response.Response.Id) + d.SetId(userId) + return resourceTencentCloudBhUserRead(d, meta) +} + +func resourceTencentCloudBhUserRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = BhService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + userId = d.Id() + ) + + respData, err := service.DescribeBhUserById(ctx, userId) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_bh_user` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.UserName != nil { + _ = d.Set("user_name", respData.UserName) + } + + if respData.RealName != nil { + _ = d.Set("real_name", respData.RealName) + } + + if respData.Phone != nil { + _ = d.Set("phone", respData.Phone) + } + + if respData.Email != nil { + _ = d.Set("email", respData.Email) + } + + if respData.ValidateFrom != nil { + _ = d.Set("validate_from", respData.ValidateFrom) + } + + if respData.ValidateTo != nil { + _ = d.Set("validate_to", respData.ValidateTo) + } + + if respData.GroupSet != nil { + groupIdSetList := make([]uint64, 0, len(respData.GroupSet)) + for _, item := range respData.GroupSet { + if item.Id != nil { + groupIdSetList = append(groupIdSetList, *item.Id) + } + } + + _ = d.Set("group_id_set", groupIdSetList) + } + + if respData.AuthType != nil { + _ = d.Set("auth_type", respData.AuthType) + } + + if respData.ValidateTime != nil { + _ = d.Set("validate_time", respData.ValidateTime) + } + + if respData.DepartmentId != nil { + _ = d.Set("department_id", respData.DepartmentId) + } + + if respData.Id != nil { + _ = d.Set("user_id", respData.Id) + } + + return nil +} + +func resourceTencentCloudBhUserUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + userId = d.Id() + ) + + needChange := false + mutableArgs := []string{"real_name", "phone", "email", "validate_from", "validate_to", "group_id_set", "auth_type", "validate_time", "department_id"} + for _, v := range mutableArgs { + if d.HasChange(v) { + needChange = true + break + } + } + + if needChange { + request := bhv20230418.NewModifyUserRequest() + if v, ok := d.GetOk("real_name"); ok { + request.RealName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("phone"); ok { + request.Phone = helper.String(v.(string)) + } + + if v, ok := d.GetOk("email"); ok { + request.Email = helper.String(v.(string)) + } + + if v, ok := d.GetOk("validate_from"); ok { + request.ValidateFrom = helper.String(v.(string)) + } + + if v, ok := d.GetOk("validate_to"); ok { + request.ValidateTo = helper.String(v.(string)) + } + + if v, ok := d.GetOk("group_id_set"); ok { + groupIdSetSet := v.(*schema.Set).List() + for i := range groupIdSetSet { + groupIdSet := groupIdSetSet[i].(int) + request.GroupIdSet = append(request.GroupIdSet, helper.IntUint64(groupIdSet)) + } + } + + if v, ok := d.GetOkExists("auth_type"); ok { + request.AuthType = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("validate_time"); ok { + request.ValidateTime = helper.String(v.(string)) + } + + if v, ok := d.GetOk("department_id"); ok { + request.DepartmentId = helper.String(v.(string)) + } + + request.Id = helper.StrToUint64Point(userId) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().ModifyUserWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s update bh user failed, reason:%+v", logId, reqErr) + return reqErr + } + } + + return resourceTencentCloudBhUserRead(d, meta) +} + +func resourceTencentCloudBhUserDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewDeleteUsersRequest() + userId = d.Id() + ) + + request.IdSet = append(request.IdSet, helper.StrToUint64Point(userId)) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DeleteUsersWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s delete bh user failed, reason:%+v", logId, reqErr) + return reqErr + } + + return nil +} diff --git a/tencentcloud/services/bh/resource_tc_bh_user.md b/tencentcloud/services/bh/resource_tc_bh_user.md new file mode 100644 index 0000000000..f2beca4d33 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_user.md @@ -0,0 +1,21 @@ +Provides a resource to create a BH user + +Example Usage + +```hcl +resource "tencentcloud_bh_user" "example" { + user_name = "tf-example" + real_name = "Terraform" + phone = "+86|18991162528" + email = "demo@tencent.com" + auth_type = 0 +} +``` + +Import + +BH user can be imported using the id, e.g. + +``` +terraform import tencentcloud_bh_user.example 2322 +``` diff --git a/tencentcloud/services/bh/resource_tc_bh_user_directory.go b/tencentcloud/services/bh/resource_tc_bh_user_directory.go new file mode 100644 index 0000000000..34d311d990 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_user_directory.go @@ -0,0 +1,365 @@ +package bh + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudBhUserDirectory() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBhUserDirectoryCreate, + Read: resourceTencentCloudBhUserDirectoryRead, + Update: resourceTencentCloudBhUserDirectoryUpdate, + Delete: resourceTencentCloudBhUserDirectoryDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "dir_id": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + Description: "Directory ID.", + }, + + "dir_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "Directory name.", + }, + + "user_org_set": { + Type: schema.TypeList, + Required: true, + Description: "IOA group information.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "org_id": { + Type: schema.TypeInt, + Required: true, + Description: "IOA user organization ID.", + }, + "org_name": { + Type: schema.TypeString, + Required: true, + Description: "IOA user organization name.", + }, + "org_id_path": { + Type: schema.TypeString, + Required: true, + Description: "IOA user organization ID path.", + }, + "org_name_path": { + Type: schema.TypeString, + Required: true, + Description: "IOA user organization name path.", + }, + "user_total": { + Type: schema.TypeInt, + Optional: true, + Description: "Number of users under the IOA user organization ID.", + }, + }, + }, + }, + + "source": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + Description: "IOA associated user source type.", + }, + + "source_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Description: "IOA associated user source name.", + }, + + "user_count": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + Description: "Number of users included in the directory.", + }, + + // computed + "directory_id": { + Type: schema.TypeInt, + Computed: true, + Description: "Directory ID.", + }, + }, + } +} + +func resourceTencentCloudBhUserDirectoryCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user_directory.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewCreateUserDirectoryRequest() + response = bhv20230418.NewCreateUserDirectoryResponse() + directoryId string + ) + + if v, ok := d.GetOkExists("dir_id"); ok { + request.DirId = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("dir_name"); ok { + request.DirName = helper.String(v.(string)) + } + + if v, ok := d.GetOk("user_org_set"); ok { + for _, item := range v.([]interface{}) { + userOrgSetMap := item.(map[string]interface{}) + userOrg := bhv20230418.UserOrg{} + if v, ok := userOrgSetMap["org_id"].(int); ok { + userOrg.OrgId = helper.IntUint64(v) + } + + if v, ok := userOrgSetMap["org_name"].(string); ok && v != "" { + userOrg.OrgName = helper.String(v) + } + + if v, ok := userOrgSetMap["org_id_path"].(string); ok && v != "" { + userOrg.OrgIdPath = helper.String(v) + } + + if v, ok := userOrgSetMap["org_name_path"].(string); ok && v != "" { + userOrg.OrgNamePath = helper.String(v) + } + + if v, ok := userOrgSetMap["user_total"].(int); ok { + userOrg.UserTotal = helper.IntUint64(v) + } + + request.UserOrgSet = append(request.UserOrgSet, &userOrg) + } + } + + if v, ok := d.GetOkExists("source"); ok { + request.Source = helper.IntUint64(v.(int)) + } + + if v, ok := d.GetOk("source_name"); ok { + request.SourceName = helper.String(v.(string)) + } + + if v, ok := d.GetOkExists("user_count"); ok { + request.UserCount = helper.IntUint64(v.(int)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().CreateUserDirectoryWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Create bh user directory failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create bh user directory failed, reason:%+v", logId, reqErr) + return reqErr + } + + if response.Response.Id == nil { + return fmt.Errorf("Id is nil.") + } + + directoryId = helper.UInt64ToStr(*response.Response.Id) + d.SetId(directoryId) + return resourceTencentCloudBhUserDirectoryRead(d, meta) +} + +func resourceTencentCloudBhUserDirectoryRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user_directory.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = BhService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + directoryId = d.Id() + ) + + respData, err := service.DescribeBhUserDirectoryById(ctx, directoryId) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_bh_user_directory` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.DirId != nil { + _ = d.Set("dir_id", respData.DirId) + } + + if respData.DirName != nil { + _ = d.Set("dir_name", respData.DirName) + } + + if respData.UserOrgSet != nil { + userOrgSetList := make([]map[string]interface{}, 0, len(respData.UserOrgSet)) + for _, userOrgSet := range respData.UserOrgSet { + userOrgSetMap := map[string]interface{}{} + if userOrgSet.OrgId != nil { + userOrgSetMap["org_id"] = userOrgSet.OrgId + } + + if userOrgSet.OrgName != nil { + userOrgSetMap["org_name"] = userOrgSet.OrgName + } + + if userOrgSet.OrgIdPath != nil { + userOrgSetMap["org_id_path"] = userOrgSet.OrgIdPath + } + + if userOrgSet.OrgNamePath != nil { + userOrgSetMap["org_name_path"] = userOrgSet.OrgNamePath + } + + if userOrgSet.UserTotal != nil { + userOrgSetMap["user_total"] = userOrgSet.UserTotal + } + + userOrgSetList = append(userOrgSetList, userOrgSetMap) + } + + _ = d.Set("user_org_set", userOrgSetList) + } + + if respData.Source != nil { + _ = d.Set("source", respData.Source) + } + + if respData.SourceName != nil { + _ = d.Set("source_name", respData.SourceName) + } + + if respData.UserTotal != nil { + _ = d.Set("user_count", respData.UserTotal) + } + + if respData.Id != nil { + _ = d.Set("directory_id", respData.Id) + } + + return nil +} + +func resourceTencentCloudBhUserDirectoryUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user_directory.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + directoryId = d.Id() + ) + + if d.HasChange("user_org_set") { + request := bhv20230418.NewModifyUserDirectoryRequest() + if v, ok := d.GetOk("user_org_set"); ok { + for _, item := range v.([]interface{}) { + userOrgSetMap := item.(map[string]interface{}) + userOrg := bhv20230418.UserOrg{} + if v, ok := userOrgSetMap["org_id"].(int); ok { + userOrg.OrgId = helper.IntUint64(v) + } + + if v, ok := userOrgSetMap["org_name"].(string); ok && v != "" { + userOrg.OrgName = helper.String(v) + } + + if v, ok := userOrgSetMap["org_id_path"].(string); ok && v != "" { + userOrg.OrgIdPath = helper.String(v) + } + + if v, ok := userOrgSetMap["org_name_path"].(string); ok && v != "" { + userOrg.OrgNamePath = helper.String(v) + } + + if v, ok := userOrgSetMap["user_total"].(int); ok { + userOrg.UserTotal = helper.IntUint64(v) + } + + request.UserOrgSet = append(request.UserOrgSet, &userOrg) + } + } + + request.Id = helper.StrToUint64Point(directoryId) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().ModifyUserDirectoryWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s update bh user directory failed, reason:%+v", logId, reqErr) + return reqErr + } + } + + return resourceTencentCloudBhUserDirectoryRead(d, meta) +} + +func resourceTencentCloudBhUserDirectoryDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user_directory.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewDeleteUserDirectoryRequest() + directoryId = d.Id() + ) + + request.IdSet = append(request.IdSet, helper.StrToUint64Point(directoryId)) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DeleteUserDirectoryWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s delete bh user directory failed, reason:%+v", logId, reqErr) + return reqErr + } + + return nil +} diff --git a/tencentcloud/services/bh/resource_tc_bh_user_directory.md b/tencentcloud/services/bh/resource_tc_bh_user_directory.md new file mode 100644 index 0000000000..bd957548e1 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_user_directory.md @@ -0,0 +1,36 @@ +Provides a resource to create a BH user directory + +Example Usage + +```hcl +resource "tencentcloud_bh_user_directory" "example" { + dir_id = 895784 + dir_name = "tf-example" + user_org_set { + org_id = 1576799 + org_name = "orgName1" + org_id_path = "819729.895784" + org_name_path = "Root.demo1" + user_total = 0 + } + + user_org_set { + org_id = 896536 + org_name = "orgName2" + org_id_path = "819729.895784.896536" + org_name_path = "Root.demo2.demo3" + user_total = 1 + } + source = 0 + source_name = "sourceName" + user_count = 3 +} +``` + +Import + +BH user directory can be imported using the id, e.g. + +``` +terraform import tencentcloud_bh_user_directory.example 32 +``` diff --git a/tencentcloud/services/bh/resource_tc_bh_user_directory_test.go b/tencentcloud/services/bh/resource_tc_bh_user_directory_test.go new file mode 100644 index 0000000000..5e8681122d --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_user_directory_test.go @@ -0,0 +1,72 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhUserDirectoryResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBhUserDirectory, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_user_directory.example", "id"), + ), + }, + { + Config: testAccBhUserDirectoryUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_user_directory.example", "id"), + ), + }, + { + ResourceName: "tencentcloud_bh_user_directory.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccBhUserDirectory = ` +resource "tencentcloud_bh_user_directory" "example" { + dir_id = 895784 + dir_name = "tf-example" + user_org_set { + org_id = 1576799 + org_name = "orgName" + org_id_path = "819729.895784" + org_name_path = "Root.demo" + user_total = 0 + } + source = 0 + source_name = "sourceName" + user_count = 3 +} +` + +const testAccBhUserDirectoryUpdate = ` +resource "tencentcloud_bh_user_directory" "example" { + dir_id = 895784 + dir_name = "tf-example" + user_org_set { + org_id = 1576799 + org_name = "orgName" + org_id_path = "819729.895784" + org_name_path = "Root.demo" + user_total = 0 + } + source = 0 + source_name = "sourceName" + user_count = 3 +} +` diff --git a/tencentcloud/services/bh/resource_tc_bh_user_group.go b/tencentcloud/services/bh/resource_tc_bh_user_group.go new file mode 100644 index 0000000000..0ac3d59291 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_user_group.go @@ -0,0 +1,217 @@ +package bh + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudBhUserGroup() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBhUserGroupCreate, + Read: resourceTencentCloudBhUserGroupRead, + Update: resourceTencentCloudBhUserGroupUpdate, + Delete: resourceTencentCloudBhUserGroupDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + Description: "User group name, maximum length 32 characters.", + }, + + "department_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "Department ID to which the user group belongs, e.g.: 1.2.3.", + }, + + // computed + "user_group_id": { + Type: schema.TypeInt, + Computed: true, + Description: "User group ID.", + }, + }, + } +} + +func resourceTencentCloudBhUserGroupCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user_group.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewCreateUserGroupRequest() + response = bhv20230418.NewCreateUserGroupResponse() + userGroupId string + ) + + if v, ok := d.GetOk("name"); ok { + request.Name = helper.String(v.(string)) + } + + if v, ok := d.GetOk("department_id"); ok { + request.DepartmentId = helper.String(v.(string)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().CreateUserGroupWithContext(ctx, request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Create bh user group failed, Response is nil.")) + } + + response = result + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s create bh user group failed, reason:%+v", logId, reqErr) + return reqErr + } + + if response.Response.Id == nil { + return fmt.Errorf("Id is nil.") + } + + userGroupId = helper.UInt64ToStr(*response.Response.Id) + d.SetId(userGroupId) + return resourceTencentCloudBhUserGroupRead(d, meta) +} + +func resourceTencentCloudBhUserGroupRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user_group.read")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + service = BhService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()} + userGroupId = d.Id() + ) + + respData, err := service.DescribeBhUserGroupById(ctx, userGroupId) + if err != nil { + return err + } + + if respData == nil { + log.Printf("[WARN]%s resource `tencentcloud_bh_user_group` [%s] not found, please check if it has been deleted.\n", logId, d.Id()) + d.SetId("") + return nil + } + + if respData.Name != nil { + _ = d.Set("name", respData.Name) + } + + if respData.Department != nil { + if respData.Department.Id != nil { + _ = d.Set("department_id", respData.Department.Id) + } + } + + if respData.Id != nil { + _ = d.Set("user_group_id", respData.Id) + } + + return nil +} + +func resourceTencentCloudBhUserGroupUpdate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user_group.update")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + userGroupId = d.Id() + ) + + needChange := false + mutableArgs := []string{"name", "department_id"} + for _, v := range mutableArgs { + if d.HasChange(v) { + needChange = true + break + } + } + + if needChange { + request := bhv20230418.NewModifyUserGroupRequest() + if v, ok := d.GetOk("name"); ok { + request.Name = helper.String(v.(string)) + } + + if v, ok := d.GetOk("department_id"); ok { + request.DepartmentId = helper.String(v.(string)) + } + + request.Id = helper.StrToUint64Point(userGroupId) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().ModifyUserGroupWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s update bh user group failed, reason:%+v", logId, reqErr) + return reqErr + } + } + + return resourceTencentCloudBhUserGroupRead(d, meta) +} + +func resourceTencentCloudBhUserGroupDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user_group.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewDeleteUserGroupsRequest() + userGroupId = d.Id() + ) + + request.IdSet = append(request.IdSet, helper.StrToUint64Point(userGroupId)) + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DeleteUserGroupsWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s delete bh user group failed, reason:%+v", logId, reqErr) + return reqErr + } + + return nil +} diff --git a/tencentcloud/services/bh/resource_tc_bh_user_group.md b/tencentcloud/services/bh/resource_tc_bh_user_group.md new file mode 100644 index 0000000000..57366537a2 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_user_group.md @@ -0,0 +1,17 @@ +Provides a resource to create a BH user group + +Example Usage + +```hcl +resource "tencentcloud_bh_user_group" "example" { + name = "tf-example" +} +``` + +Import + +BH user group can be imported using the id, e.g. + +``` +terraform import tencentcloud_bh_user_group.example 92 +``` diff --git a/tencentcloud/services/bh/resource_tc_bh_user_group_test.go b/tencentcloud/services/bh/resource_tc_bh_user_group_test.go new file mode 100644 index 0000000000..9078954778 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_user_group_test.go @@ -0,0 +1,49 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhUserGroupResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBhUserGroup, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_user_group.example", "id"), + ), + }, + { + Config: testAccBhUserGroupUpdate, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_user_group.example", "id"), + ), + }, + { + ResourceName: "tencentcloud_bh_user_group.example", + ImportState: true, + ImportStateVerify: true, + }}, + }) +} + +const testAccBhUserGroup = ` +resource "tencentcloud_bh_user_group" "example" { + name = "tf-example" +} +` + +const testAccBhUserGroupUpdate = ` +resource "tencentcloud_bh_user_group" "example" { + name = "tf-example-updated" +} +` diff --git a/tencentcloud/services/bh/resource_tc_bh_user_sync_task_operation.go b/tencentcloud/services/bh/resource_tc_bh_user_sync_task_operation.go new file mode 100644 index 0000000000..6afbbd4e46 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_user_sync_task_operation.go @@ -0,0 +1,102 @@ +package bh + +import ( + "context" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" +) + +func ResourceTencentCloudBhUserSyncTaskOperation() *schema.Resource { + return &schema.Resource{ + Create: resourceTencentCloudBhUserSyncTaskOperationCreate, + Read: resourceTencentCloudBhUserSyncTaskOperationRead, + Delete: resourceTencentCloudBhUserSyncTaskOperationDelete, + Schema: map[string]*schema.Schema{ + "user_kind": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + Description: "Synchronized user type, 1-synchronize IOA users.", + }, + }, + } +} + +func resourceTencentCloudBhUserSyncTaskOperationCreate(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user_sync_task_operation.create")() + defer tccommon.InconsistentCheck(d, meta)() + + var ( + logId = tccommon.GetLogId(tccommon.ContextNil) + ctx = tccommon.NewResourceLifeCycleHandleFuncContext(context.Background(), logId, d, meta) + request = bhv20230418.NewCreateSyncUserTaskRequest() + userKind string + ) + + if v, ok := d.GetOkExists("user_kind"); ok { + request.UserKind = helper.IntUint64(v.(int)) + userKind = helper.IntToStr(v.(int)) + } + + reqErr := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().CreateSyncUserTaskWithContext(ctx, request) + if e != nil { + return tccommon.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 reqErr != nil { + log.Printf("[CRITAL]%s create bh user sync task failed, reason:%+v", logId, reqErr) + return reqErr + } + + d.SetId(userKind) + + // wait + waitReq := bhv20230418.NewDescribeUserSyncStatusRequest() + if v, ok := d.GetOkExists("user_kind"); ok { + waitReq.UserKind = helper.IntUint64(v.(int)) + } + + reqErr = resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { + result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseBhV20230418Client().DescribeUserSyncStatusWithContext(ctx, waitReq) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, waitReq.GetAction(), waitReq.ToJsonString(), result.ToJsonString()) + } + + return nil + }) + + if reqErr != nil { + log.Printf("[CRITAL]%s describe bh user sync task failed, reason:%+v", logId, reqErr) + return reqErr + } + + return resourceTencentCloudBhUserSyncTaskOperationRead(d, meta) +} + +func resourceTencentCloudBhUserSyncTaskOperationRead(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user_sync_task_operation.read")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} + +func resourceTencentCloudBhUserSyncTaskOperationDelete(d *schema.ResourceData, meta interface{}) error { + defer tccommon.LogElapsed("resource.tencentcloud_bh_user_sync_task_operation.delete")() + defer tccommon.InconsistentCheck(d, meta)() + + return nil +} diff --git a/tencentcloud/services/bh/resource_tc_bh_user_sync_task_operation.md b/tencentcloud/services/bh/resource_tc_bh_user_sync_task_operation.md new file mode 100644 index 0000000000..58de57caab --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_user_sync_task_operation.md @@ -0,0 +1,9 @@ +Provides a resource to create a BH user sync task operation + +Example Usage + +```hcl +resource "tencentcloud_bh_user_sync_task_operation" "example" { + user_kind = 1 +} +``` diff --git a/tencentcloud/services/bh/resource_tc_bh_user_sync_task_operation_test.go b/tencentcloud/services/bh/resource_tc_bh_user_sync_task_operation_test.go new file mode 100644 index 0000000000..29fffe601c --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_user_sync_task_operation_test.go @@ -0,0 +1,31 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhUserSyncTaskOperationResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{{ + Config: testAccBhUserSyncTaskOperation, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("tencentcloud_bh_user_sync_task_operation.example", "id"), + ), + }}, + }) +} + +const testAccBhUserSyncTaskOperation = ` +resource "tencentcloud_bh_user_sync_task_operation" "example" { + user_kind = 1 +} +` diff --git a/tencentcloud/services/bh/resource_tc_bh_user_test.go b/tencentcloud/services/bh/resource_tc_bh_user_test.go new file mode 100644 index 0000000000..0dac47a026 --- /dev/null +++ b/tencentcloud/services/bh/resource_tc_bh_user_test.go @@ -0,0 +1,52 @@ +package bh_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" +) + +func TestAccTencentCloudBhUserResource_basic(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccBhUser, + Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_bh_user.example", "id")), + }, + { + Config: testAccBhUserUpdate, + Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_bh_user.example", "id")), + }, + { + ResourceName: "tencentcloud_bh_user.example", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +const testAccBhUser = ` +resource "tencentcloud_bh_user" "example" { + user_name = "tf-example" + real_name = "Terraform" + phone = "+86|18991162528" + email = "demo@tencent.com" +} +` + +const testAccBhUserUpdate = ` +resource "tencentcloud_bh_user" "example" { + user_name = "tf-example" + real_name = "Terraform-updated" + phone = "+86|18991162528" + email = "demo@tencent.com" +} +` diff --git a/tencentcloud/services/bh/resource_tc_dasb_user.go b/tencentcloud/services/bh/resource_tc_dasb_user.go index ffc440369b..601863b563 100644 --- a/tencentcloud/services/bh/resource_tc_dasb_user.go +++ b/tencentcloud/services/bh/resource_tc_dasb_user.go @@ -29,7 +29,7 @@ func ResourceTencentCloudDasbUser() *schema.Resource { "user_name": { Required: true, Type: schema.TypeString, - Description: "Username, 3-20 characters, must start with an English letter and cannot contain characters other than letters, numbers, '.', '_', '-'.", + Description: "Username, 3-20 characters, must start with an English letter and cannot contain characters other than `letters`, `numbers`, `.`, `_`, `-`.", }, "real_name": { Required: true, diff --git a/tencentcloud/services/bh/service_tencentcloud_bh.go b/tencentcloud/services/bh/service_tencentcloud_bh.go new file mode 100644 index 0000000000..891578eb25 --- /dev/null +++ b/tencentcloud/services/bh/service_tencentcloud_bh.go @@ -0,0 +1,508 @@ +package bh + +import ( + "context" + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + bhv20230418 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418" + + tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/connectivity" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper" + "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit" +) + +func NewBhService(client *connectivity.TencentCloudClient) BhService { + return BhService{client: client} +} + +type BhService struct { + client *connectivity.TencentCloudClient +} + +func (me *BhService) DescribeBhAccountGroupsByFilter(ctx context.Context, param map[string]interface{}) (ret []*bhv20230418.AccountGroup, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = bhv20230418.NewDescribeAccountGroupsRequest() + response = bhv20230418.NewDescribeAccountGroupsResponse() + ) + + 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 == "DeepIn" { + request.DeepIn = v.(*int64) + } + if k == "ParentId" { + request.ParentId = v.(*int64) + } + if k == "GroupName" { + request.GroupName = v.(*string) + } + if k == "PageNum" { + request.PageNum = v.(*int64) + } + } + + var ( + pageNum int64 = 0 + pageSize int64 = 100 + ) + + for { + request.PageNum = &pageNum + request.PageSize = &pageSize + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseBhV20230418Client().DescribeAccountGroups(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.AccountGroupSet == nil { + return resource.NonRetryableError(fmt.Errorf("Describe account groups failed, Response is nil.")) + } + + response = result + return nil + }) + + if err != nil { + errRet = err + return + } + + if len(response.Response.AccountGroupSet) < 1 { + break + } + + ret = append(ret, response.Response.AccountGroupSet...) + if len(response.Response.AccountGroupSet) < int(pageSize) { + break + } + + pageNum += pageSize + } + + return +} + +func (me *BhService) DescribeBhSourceTypesByFilter(ctx context.Context, param map[string]interface{}) (ret []*bhv20230418.SourceType, errRet error) { + var ( + logId = tccommon.GetLogId(ctx) + request = bhv20230418.NewDescribeSourceTypesRequest() + response = bhv20230418.NewDescribeSourceTypesResponse() + ) + + 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()) + } + }() + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseBhV20230418Client().DescribeSourceTypes(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.SourceTypeSet == nil { + return resource.NonRetryableError(fmt.Errorf("Describe source types failed, Response is nil.")) + } + + response = result + return nil + }) + + if err != nil { + errRet = err + return + } + + ret = response.Response.SourceTypeSet + return +} + +func (me *BhService) DescribeBhAccessWhiteListRuleById(ctx context.Context, ruleId string) (ret *bhv20230418.AccessWhiteListRule, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := bhv20230418.NewDescribeAccessWhiteListRulesRequest() + response := bhv20230418.NewDescribeAccessWhiteListRulesResponse() + request.IdSet = []*uint64{helper.StrToUint64Point(ruleId)} + + 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()) + } + }() + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseBhV20230418Client().DescribeAccessWhiteListRules(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.AccessWhiteListRuleSet == nil || len(result.Response.AccessWhiteListRuleSet) == 0 { + return resource.NonRetryableError(fmt.Errorf("Describe access white list rules failed, Response is nil.")) + } + + response = result + return nil + }) + + if err != nil { + errRet = err + return + } + + ret = response.Response.AccessWhiteListRuleSet[0] + return +} + +func (me *BhService) DescribeBhAccessWhiteListConfigById(ctx context.Context) (ret *bhv20230418.DescribeAccessWhiteListRulesResponseParams, errRet error) { + logId := tccommon.GetLogId(ctx) + request := bhv20230418.NewDescribeAccessWhiteListRulesRequest() + response := bhv20230418.NewDescribeAccessWhiteListRulesResponse() + + 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()) + } + }() + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseBhV20230418Client().DescribeAccessWhiteListRules(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil { + return resource.NonRetryableError(fmt.Errorf("Describe access white list rules failed, Response is nil.")) + } + + response = result + return nil + }) + + if err != nil { + errRet = err + return + } + + ret = response.Response + return +} + +func (me *BhService) DescribeBhDeviceById(ctx context.Context, deviceId string) (ret *bhv20230418.Device, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := bhv20230418.NewDescribeDevicesRequest() + response := bhv20230418.NewDescribeDevicesResponse() + request.IdSet = []*uint64{helper.StrToUint64Point(deviceId)} + + 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()) + } + }() + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseBhV20230418Client().DescribeDevices(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.DeviceSet == nil || len(result.Response.DeviceSet) == 0 { + return resource.NonRetryableError(fmt.Errorf("Describe device failed, Response is nil.")) + } + + response = result + return nil + }) + + if err != nil { + errRet = err + return + } + + ret = response.Response.DeviceSet[0] + return +} + +func (me *BhService) DescribeBhAssetSyncFlagConfigById(ctx context.Context) (ret *bhv20230418.AssetSyncFlags, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := bhv20230418.NewDescribeAssetSyncFlagRequest() + response := bhv20230418.NewDescribeAssetSyncFlagResponse() + + 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()) + } + }() + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseBhV20230418Client().DescribeAssetSyncFlag(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.AssetSyncFlags == nil { + return resource.NonRetryableError(fmt.Errorf("Describe asset sync flag failed, Response is nil.")) + } + + response = result + return nil + }) + + if err != nil { + errRet = err + return + } + + ret = response.Response.AssetSyncFlags + return +} + +func (me *BhService) DescribeBhResourceById(ctx context.Context, resourceId string) (ret *bhv20230418.Resource, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := bhv20230418.NewDescribeResourcesRequest() + response := bhv20230418.NewDescribeResourcesResponse() + request.ResourceIds = []*string{&resourceId} + + 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()) + } + }() + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseBhV20230418Client().DescribeResources(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.ResourceSet == nil || len(result.Response.ResourceSet) == 0 { + return resource.NonRetryableError(fmt.Errorf("Describe resource failed, Response is nil.")) + } + + response = result + return nil + }) + + if err != nil { + errRet = err + return + } + + ret = response.Response.ResourceSet[0] + return +} + +func (me *BhService) DescribeBhReconnectionSettingConfigById(ctx context.Context) (ret *bhv20230418.SecuritySetting, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := bhv20230418.NewDescribeSecuritySettingRequest() + response := bhv20230418.NewDescribeSecuritySettingResponse() + + 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()) + } + }() + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseBhV20230418Client().DescribeSecuritySetting(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.SecuritySetting == nil { + return resource.NonRetryableError(fmt.Errorf("Describe security setting failed, Response is nil.")) + } + + response = result + return nil + }) + + if err != nil { + errRet = err + return + } + + ret = response.Response.SecuritySetting + return +} + +func (me *BhService) DescribeBhUserById(ctx context.Context, userId string) (ret *bhv20230418.User, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := bhv20230418.NewDescribeUsersRequest() + response := bhv20230418.NewDescribeUsersResponse() + request.IdSet = []*uint64{helper.StrToUint64Point(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()) + } + }() + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseBhV20230418Client().DescribeUsers(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.UserSet == nil || len(result.Response.UserSet) == 0 { + return resource.NonRetryableError(fmt.Errorf("Describe users failed, Response is nil.")) + } + + response = result + return nil + }) + + if err != nil { + errRet = err + return + } + + ret = response.Response.UserSet[0] + return +} + +func (me *BhService) DescribeBhUserGroupById(ctx context.Context, userGroupId string) (ret *bhv20230418.Group, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := bhv20230418.NewDescribeUserGroupsRequest() + response := bhv20230418.NewDescribeUserGroupsResponse() + request.IdSet = []*uint64{helper.StrToUint64Point(userGroupId)} + + 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()) + } + }() + + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseBhV20230418Client().DescribeUserGroups(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.GroupSet == nil || len(result.Response.GroupSet) == 0 { + return resource.NonRetryableError(fmt.Errorf("Describe user groups failed, Response is nil.")) + } + + response = result + return nil + }) + + if err != nil { + errRet = err + return + } + + ret = response.Response.GroupSet[0] + return +} + +func (me *BhService) DescribeBhUserDirectoryById(ctx context.Context, directoryId string) (ret *bhv20230418.UserDirectory, errRet error) { + logId := tccommon.GetLogId(ctx) + + request := bhv20230418.NewDescribeUserDirectoryRequest() + response := bhv20230418.NewDescribeUserDirectoryResponse() + + 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()) + } + }() + + var ( + offset uint64 = 0 + limit uint64 = 100 + directoryList []*bhv20230418.UserDirectory + ) + + for { + request.Offset = &offset + request.Limit = &limit + err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { + ratelimit.Check(request.GetAction()) + result, e := me.client.UseBhV20230418Client().DescribeUserDirectory(request) + if e != nil { + return tccommon.RetryError(e) + } else { + log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString()) + } + + if result == nil || result.Response == nil || result.Response.UserDirSet == nil { + return resource.NonRetryableError(fmt.Errorf("Describe user directory failed, Response is nil.")) + } + + response = result + return nil + }) + + if err != nil { + errRet = err + return + } + + if len(response.Response.UserDirSet) < 1 { + break + } + + directoryList = append(directoryList, response.Response.UserDirSet...) + if len(response.Response.UserDirSet) < int(limit) { + break + } + + offset += limit + } + + for _, item := range directoryList { + if item.Id != nil && helper.UInt64ToStr(*item.Id) == directoryId { + ret = item + return + } + } + + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/LICENSE b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/LICENSE new file mode 100644 index 0000000000..efc75a2253 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/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/bh/v20230418/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418/client.go new file mode 100644 index 0000000000..82a24baa36 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418/client.go @@ -0,0 +1,6554 @@ +// Copyright (c) 2017-2025 Tencent. 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 v20230418 + +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 = "2023-04-18" + +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 NewAccessDevicesRequest() (request *AccessDevicesRequest) { + request = &AccessDevicesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "AccessDevices") + + + return +} + +func NewAccessDevicesResponse() (response *AccessDevicesResponse) { + response = &AccessDevicesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// AccessDevices +// 外部客户访问资产 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) AccessDevices(request *AccessDevicesRequest) (response *AccessDevicesResponse, err error) { + return c.AccessDevicesWithContext(context.Background(), request) +} + +// AccessDevices +// 外部客户访问资产 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) AccessDevicesWithContext(ctx context.Context, request *AccessDevicesRequest) (response *AccessDevicesResponse, err error) { + if request == nil { + request = NewAccessDevicesRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "AccessDevices") + + if c.GetCredential() == nil { + return nil, errors.New("AccessDevices require credential") + } + + request.SetContext(ctx) + + response = NewAccessDevicesResponse() + err = c.Send(request, response) + return +} + +func NewAddDeviceGroupMembersRequest() (request *AddDeviceGroupMembersRequest) { + request = &AddDeviceGroupMembersRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "AddDeviceGroupMembers") + + + return +} + +func NewAddDeviceGroupMembersResponse() (response *AddDeviceGroupMembersResponse) { + response = &AddDeviceGroupMembersResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// AddDeviceGroupMembers +// 添加资产组成员 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) AddDeviceGroupMembers(request *AddDeviceGroupMembersRequest) (response *AddDeviceGroupMembersResponse, err error) { + return c.AddDeviceGroupMembersWithContext(context.Background(), request) +} + +// AddDeviceGroupMembers +// 添加资产组成员 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) AddDeviceGroupMembersWithContext(ctx context.Context, request *AddDeviceGroupMembersRequest) (response *AddDeviceGroupMembersResponse, err error) { + if request == nil { + request = NewAddDeviceGroupMembersRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "AddDeviceGroupMembers") + + if c.GetCredential() == nil { + return nil, errors.New("AddDeviceGroupMembers require credential") + } + + request.SetContext(ctx) + + response = NewAddDeviceGroupMembersResponse() + err = c.Send(request, response) + return +} + +func NewAddUserGroupMembersRequest() (request *AddUserGroupMembersRequest) { + request = &AddUserGroupMembersRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "AddUserGroupMembers") + + + return +} + +func NewAddUserGroupMembersResponse() (response *AddUserGroupMembersResponse) { + response = &AddUserGroupMembersResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// AddUserGroupMembers +// 添加用户组成员 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) AddUserGroupMembers(request *AddUserGroupMembersRequest) (response *AddUserGroupMembersResponse, err error) { + return c.AddUserGroupMembersWithContext(context.Background(), request) +} + +// AddUserGroupMembers +// 添加用户组成员 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) AddUserGroupMembersWithContext(ctx context.Context, request *AddUserGroupMembersRequest) (response *AddUserGroupMembersResponse, err error) { + if request == nil { + request = NewAddUserGroupMembersRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "AddUserGroupMembers") + + if c.GetCredential() == nil { + return nil, errors.New("AddUserGroupMembers require credential") + } + + request.SetContext(ctx) + + response = NewAddUserGroupMembersResponse() + err = c.Send(request, response) + return +} + +func NewBindDeviceAccountPasswordRequest() (request *BindDeviceAccountPasswordRequest) { + request = &BindDeviceAccountPasswordRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "BindDeviceAccountPassword") + + + return +} + +func NewBindDeviceAccountPasswordResponse() (response *BindDeviceAccountPasswordResponse) { + response = &BindDeviceAccountPasswordResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// BindDeviceAccountPassword +// 绑定主机账号密码 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) BindDeviceAccountPassword(request *BindDeviceAccountPasswordRequest) (response *BindDeviceAccountPasswordResponse, err error) { + return c.BindDeviceAccountPasswordWithContext(context.Background(), request) +} + +// BindDeviceAccountPassword +// 绑定主机账号密码 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) BindDeviceAccountPasswordWithContext(ctx context.Context, request *BindDeviceAccountPasswordRequest) (response *BindDeviceAccountPasswordResponse, err error) { + if request == nil { + request = NewBindDeviceAccountPasswordRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "BindDeviceAccountPassword") + + if c.GetCredential() == nil { + return nil, errors.New("BindDeviceAccountPassword require credential") + } + + request.SetContext(ctx) + + response = NewBindDeviceAccountPasswordResponse() + err = c.Send(request, response) + return +} + +func NewBindDeviceAccountPrivateKeyRequest() (request *BindDeviceAccountPrivateKeyRequest) { + request = &BindDeviceAccountPrivateKeyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "BindDeviceAccountPrivateKey") + + + return +} + +func NewBindDeviceAccountPrivateKeyResponse() (response *BindDeviceAccountPrivateKeyResponse) { + response = &BindDeviceAccountPrivateKeyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// BindDeviceAccountPrivateKey +// 绑定主机账号私钥 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) BindDeviceAccountPrivateKey(request *BindDeviceAccountPrivateKeyRequest) (response *BindDeviceAccountPrivateKeyResponse, err error) { + return c.BindDeviceAccountPrivateKeyWithContext(context.Background(), request) +} + +// BindDeviceAccountPrivateKey +// 绑定主机账号私钥 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) BindDeviceAccountPrivateKeyWithContext(ctx context.Context, request *BindDeviceAccountPrivateKeyRequest) (response *BindDeviceAccountPrivateKeyResponse, err error) { + if request == nil { + request = NewBindDeviceAccountPrivateKeyRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "BindDeviceAccountPrivateKey") + + if c.GetCredential() == nil { + return nil, errors.New("BindDeviceAccountPrivateKey require credential") + } + + request.SetContext(ctx) + + response = NewBindDeviceAccountPrivateKeyResponse() + err = c.Send(request, response) + return +} + +func NewBindDeviceResourceRequest() (request *BindDeviceResourceRequest) { + request = &BindDeviceResourceRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "BindDeviceResource") + + + return +} + +func NewBindDeviceResourceResponse() (response *BindDeviceResourceResponse) { + response = &BindDeviceResourceResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// BindDeviceResource +// 修改资产绑定的堡垒机服务 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) BindDeviceResource(request *BindDeviceResourceRequest) (response *BindDeviceResourceResponse, err error) { + return c.BindDeviceResourceWithContext(context.Background(), request) +} + +// BindDeviceResource +// 修改资产绑定的堡垒机服务 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) BindDeviceResourceWithContext(ctx context.Context, request *BindDeviceResourceRequest) (response *BindDeviceResourceResponse, err error) { + if request == nil { + request = NewBindDeviceResourceRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "BindDeviceResource") + + if c.GetCredential() == nil { + return nil, errors.New("BindDeviceResource require credential") + } + + request.SetContext(ctx) + + response = NewBindDeviceResourceResponse() + err = c.Send(request, response) + return +} + +func NewCheckLDAPConnectionRequest() (request *CheckLDAPConnectionRequest) { + request = &CheckLDAPConnectionRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CheckLDAPConnection") + + + return +} + +func NewCheckLDAPConnectionResponse() (response *CheckLDAPConnectionResponse) { + response = &CheckLDAPConnectionResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CheckLDAPConnection +// 测试LDAP连接 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_AUTHFAILED = "FailedOperation.AuthFailed" +// FAILEDOPERATION_CONNECTIONFAILED = "FailedOperation.ConnectionFailed" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CheckLDAPConnection(request *CheckLDAPConnectionRequest) (response *CheckLDAPConnectionResponse, err error) { + return c.CheckLDAPConnectionWithContext(context.Background(), request) +} + +// CheckLDAPConnection +// 测试LDAP连接 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_AUTHFAILED = "FailedOperation.AuthFailed" +// FAILEDOPERATION_CONNECTIONFAILED = "FailedOperation.ConnectionFailed" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CheckLDAPConnectionWithContext(ctx context.Context, request *CheckLDAPConnectionRequest) (response *CheckLDAPConnectionResponse, err error) { + if request == nil { + request = NewCheckLDAPConnectionRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CheckLDAPConnection") + + if c.GetCredential() == nil { + return nil, errors.New("CheckLDAPConnection require credential") + } + + request.SetContext(ctx) + + response = NewCheckLDAPConnectionResponse() + err = c.Send(request, response) + return +} + +func NewCreateAccessWhiteListRuleRequest() (request *CreateAccessWhiteListRuleRequest) { + request = &CreateAccessWhiteListRuleRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateAccessWhiteListRule") + + + return +} + +func NewCreateAccessWhiteListRuleResponse() (response *CreateAccessWhiteListRuleResponse) { + response = &CreateAccessWhiteListRuleResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateAccessWhiteListRule +// 添加访问白名单规则 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateAccessWhiteListRule(request *CreateAccessWhiteListRuleRequest) (response *CreateAccessWhiteListRuleResponse, err error) { + return c.CreateAccessWhiteListRuleWithContext(context.Background(), request) +} + +// CreateAccessWhiteListRule +// 添加访问白名单规则 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateAccessWhiteListRuleWithContext(ctx context.Context, request *CreateAccessWhiteListRuleRequest) (response *CreateAccessWhiteListRuleResponse, err error) { + if request == nil { + request = NewCreateAccessWhiteListRuleRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateAccessWhiteListRule") + + if c.GetCredential() == nil { + return nil, errors.New("CreateAccessWhiteListRule require credential") + } + + request.SetContext(ctx) + + response = NewCreateAccessWhiteListRuleResponse() + err = c.Send(request, response) + return +} + +func NewCreateAclRequest() (request *CreateAclRequest) { + request = &CreateAclRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateAcl") + + + return +} + +func NewCreateAclResponse() (response *CreateAclResponse) { + response = &CreateAclResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateAcl +// 新建访问权限 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateAcl(request *CreateAclRequest) (response *CreateAclResponse, err error) { + return c.CreateAclWithContext(context.Background(), request) +} + +// CreateAcl +// 新建访问权限 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateAclWithContext(ctx context.Context, request *CreateAclRequest) (response *CreateAclResponse, err error) { + if request == nil { + request = NewCreateAclRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateAcl") + + if c.GetCredential() == nil { + return nil, errors.New("CreateAcl require credential") + } + + request.SetContext(ctx) + + response = NewCreateAclResponse() + err = c.Send(request, response) + return +} + +func NewCreateAssetSyncJobRequest() (request *CreateAssetSyncJobRequest) { + request = &CreateAssetSyncJobRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateAssetSyncJob") + + + return +} + +func NewCreateAssetSyncJobResponse() (response *CreateAssetSyncJobResponse) { + response = &CreateAssetSyncJobResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateAssetSyncJob +// 创建手工资产同步任务 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_AUTHFAILED = "FailedOperation.AuthFailed" +// FAILEDOPERATION_CONNECTIONFAILED = "FailedOperation.ConnectionFailed" +// FAILEDOPERATION_TOOFREQUENT = "FailedOperation.TooFrequent" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateAssetSyncJob(request *CreateAssetSyncJobRequest) (response *CreateAssetSyncJobResponse, err error) { + return c.CreateAssetSyncJobWithContext(context.Background(), request) +} + +// CreateAssetSyncJob +// 创建手工资产同步任务 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_AUTHFAILED = "FailedOperation.AuthFailed" +// FAILEDOPERATION_CONNECTIONFAILED = "FailedOperation.ConnectionFailed" +// FAILEDOPERATION_TOOFREQUENT = "FailedOperation.TooFrequent" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateAssetSyncJobWithContext(ctx context.Context, request *CreateAssetSyncJobRequest) (response *CreateAssetSyncJobResponse, err error) { + if request == nil { + request = NewCreateAssetSyncJobRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateAssetSyncJob") + + if c.GetCredential() == nil { + return nil, errors.New("CreateAssetSyncJob require credential") + } + + request.SetContext(ctx) + + response = NewCreateAssetSyncJobResponse() + err = c.Send(request, response) + return +} + +func NewCreateChangePwdTaskRequest() (request *CreateChangePwdTaskRequest) { + request = &CreateChangePwdTaskRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateChangePwdTask") + + + return +} + +func NewCreateChangePwdTaskResponse() (response *CreateChangePwdTaskResponse) { + response = &CreateChangePwdTaskResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateChangePwdTask +// 创建修改密码任务 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_AUTHFAILED = "FailedOperation.AuthFailed" +// FAILEDOPERATION_CONNECTIONFAILED = "FailedOperation.ConnectionFailed" +// FAILEDOPERATION_TOOFREQUENT = "FailedOperation.TooFrequent" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateChangePwdTask(request *CreateChangePwdTaskRequest) (response *CreateChangePwdTaskResponse, err error) { + return c.CreateChangePwdTaskWithContext(context.Background(), request) +} + +// CreateChangePwdTask +// 创建修改密码任务 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_AUTHFAILED = "FailedOperation.AuthFailed" +// FAILEDOPERATION_CONNECTIONFAILED = "FailedOperation.ConnectionFailed" +// FAILEDOPERATION_TOOFREQUENT = "FailedOperation.TooFrequent" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateChangePwdTaskWithContext(ctx context.Context, request *CreateChangePwdTaskRequest) (response *CreateChangePwdTaskResponse, err error) { + if request == nil { + request = NewCreateChangePwdTaskRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateChangePwdTask") + + if c.GetCredential() == nil { + return nil, errors.New("CreateChangePwdTask require credential") + } + + request.SetContext(ctx) + + response = NewCreateChangePwdTaskResponse() + err = c.Send(request, response) + return +} + +func NewCreateCmdTemplateRequest() (request *CreateCmdTemplateRequest) { + request = &CreateCmdTemplateRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateCmdTemplate") + + + return +} + +func NewCreateCmdTemplateResponse() (response *CreateCmdTemplateResponse) { + response = &CreateCmdTemplateResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateCmdTemplate +// 新建高危命令模板 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateCmdTemplate(request *CreateCmdTemplateRequest) (response *CreateCmdTemplateResponse, err error) { + return c.CreateCmdTemplateWithContext(context.Background(), request) +} + +// CreateCmdTemplate +// 新建高危命令模板 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateCmdTemplateWithContext(ctx context.Context, request *CreateCmdTemplateRequest) (response *CreateCmdTemplateResponse, err error) { + if request == nil { + request = NewCreateCmdTemplateRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateCmdTemplate") + + if c.GetCredential() == nil { + return nil, errors.New("CreateCmdTemplate require credential") + } + + request.SetContext(ctx) + + response = NewCreateCmdTemplateResponse() + err = c.Send(request, response) + return +} + +func NewCreateDeviceAccountRequest() (request *CreateDeviceAccountRequest) { + request = &CreateDeviceAccountRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateDeviceAccount") + + + return +} + +func NewCreateDeviceAccountResponse() (response *CreateDeviceAccountResponse) { + response = &CreateDeviceAccountResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateDeviceAccount +// 新建主机账号 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDeviceAccount(request *CreateDeviceAccountRequest) (response *CreateDeviceAccountResponse, err error) { + return c.CreateDeviceAccountWithContext(context.Background(), request) +} + +// CreateDeviceAccount +// 新建主机账号 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDeviceAccountWithContext(ctx context.Context, request *CreateDeviceAccountRequest) (response *CreateDeviceAccountResponse, err error) { + if request == nil { + request = NewCreateDeviceAccountRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateDeviceAccount") + + if c.GetCredential() == nil { + return nil, errors.New("CreateDeviceAccount require credential") + } + + request.SetContext(ctx) + + response = NewCreateDeviceAccountResponse() + err = c.Send(request, response) + return +} + +func NewCreateDeviceGroupRequest() (request *CreateDeviceGroupRequest) { + request = &CreateDeviceGroupRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateDeviceGroup") + + + return +} + +func NewCreateDeviceGroupResponse() (response *CreateDeviceGroupResponse) { + response = &CreateDeviceGroupResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateDeviceGroup +// 新建资产组 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDeviceGroup(request *CreateDeviceGroupRequest) (response *CreateDeviceGroupResponse, err error) { + return c.CreateDeviceGroupWithContext(context.Background(), request) +} + +// CreateDeviceGroup +// 新建资产组 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateDeviceGroupWithContext(ctx context.Context, request *CreateDeviceGroupRequest) (response *CreateDeviceGroupResponse, err error) { + if request == nil { + request = NewCreateDeviceGroupRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateDeviceGroup") + + if c.GetCredential() == nil { + return nil, errors.New("CreateDeviceGroup require credential") + } + + request.SetContext(ctx) + + response = NewCreateDeviceGroupResponse() + err = c.Send(request, response) + return +} + +func NewCreateOperationTaskRequest() (request *CreateOperationTaskRequest) { + request = &CreateOperationTaskRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateOperationTask") + + + return +} + +func NewCreateOperationTaskResponse() (response *CreateOperationTaskResponse) { + response = &CreateOperationTaskResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateOperationTask +// 创建运维任务 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_RESOURCENOTPRO = "FailedOperation.ResourceNotPro" +// FAILEDOPERATION_USEREXPIRED = "FailedOperation.UserExpired" +// FAILEDOPERATION_USERINVALID = "FailedOperation.UserInvalid" +// FAILEDOPERATION_USERLOCKED = "FailedOperation.UserLocked" +// FAILEDOPERATION_USERNOTEXIST = "FailedOperation.UserNotExist" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +func (c *Client) CreateOperationTask(request *CreateOperationTaskRequest) (response *CreateOperationTaskResponse, err error) { + return c.CreateOperationTaskWithContext(context.Background(), request) +} + +// CreateOperationTask +// 创建运维任务 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_RESOURCENOTPRO = "FailedOperation.ResourceNotPro" +// FAILEDOPERATION_USEREXPIRED = "FailedOperation.UserExpired" +// FAILEDOPERATION_USERINVALID = "FailedOperation.UserInvalid" +// FAILEDOPERATION_USERLOCKED = "FailedOperation.UserLocked" +// FAILEDOPERATION_USERNOTEXIST = "FailedOperation.UserNotExist" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +func (c *Client) CreateOperationTaskWithContext(ctx context.Context, request *CreateOperationTaskRequest) (response *CreateOperationTaskResponse, err error) { + if request == nil { + request = NewCreateOperationTaskRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateOperationTask") + + if c.GetCredential() == nil { + return nil, errors.New("CreateOperationTask require credential") + } + + request.SetContext(ctx) + + response = NewCreateOperationTaskResponse() + err = c.Send(request, response) + return +} + +func NewCreateResourceRequest() (request *CreateResourceRequest) { + request = &CreateResourceRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateResource") + + + return +} + +func NewCreateResourceResponse() (response *CreateResourceResponse) { + response = &CreateResourceResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateResource +// 创建堡垒机实例 +// +// 可能返回的错误码: +// OPERATIONDENIED = "OperationDenied" +func (c *Client) CreateResource(request *CreateResourceRequest) (response *CreateResourceResponse, err error) { + return c.CreateResourceWithContext(context.Background(), request) +} + +// CreateResource +// 创建堡垒机实例 +// +// 可能返回的错误码: +// OPERATIONDENIED = "OperationDenied" +func (c *Client) CreateResourceWithContext(ctx context.Context, request *CreateResourceRequest) (response *CreateResourceResponse, err error) { + if request == nil { + request = NewCreateResourceRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateResource") + + if c.GetCredential() == nil { + return nil, errors.New("CreateResource require credential") + } + + request.SetContext(ctx) + + response = NewCreateResourceResponse() + err = c.Send(request, response) + return +} + +func NewCreateSyncUserTaskRequest() (request *CreateSyncUserTaskRequest) { + request = &CreateSyncUserTaskRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateSyncUserTask") + + + return +} + +func NewCreateSyncUserTaskResponse() (response *CreateSyncUserTaskResponse) { + response = &CreateSyncUserTaskResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateSyncUserTask +// 创建用户同步任务 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +func (c *Client) CreateSyncUserTask(request *CreateSyncUserTaskRequest) (response *CreateSyncUserTaskResponse, err error) { + return c.CreateSyncUserTaskWithContext(context.Background(), request) +} + +// CreateSyncUserTask +// 创建用户同步任务 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +func (c *Client) CreateSyncUserTaskWithContext(ctx context.Context, request *CreateSyncUserTaskRequest) (response *CreateSyncUserTaskResponse, err error) { + if request == nil { + request = NewCreateSyncUserTaskRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateSyncUserTask") + + if c.GetCredential() == nil { + return nil, errors.New("CreateSyncUserTask require credential") + } + + request.SetContext(ctx) + + response = NewCreateSyncUserTaskResponse() + err = c.Send(request, response) + return +} + +func NewCreateUserRequest() (request *CreateUserRequest) { + request = &CreateUserRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateUser") + + + return +} + +func NewCreateUserResponse() (response *CreateUserResponse) { + response = &CreateUserResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateUser +// 新建用户 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateUser(request *CreateUserRequest) (response *CreateUserResponse, err error) { + return c.CreateUserWithContext(context.Background(), request) +} + +// CreateUser +// 新建用户 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateUserWithContext(ctx context.Context, request *CreateUserRequest) (response *CreateUserResponse, err error) { + if request == nil { + request = NewCreateUserRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateUser") + + if c.GetCredential() == nil { + return nil, errors.New("CreateUser require credential") + } + + request.SetContext(ctx) + + response = NewCreateUserResponse() + err = c.Send(request, response) + return +} + +func NewCreateUserDirectoryRequest() (request *CreateUserDirectoryRequest) { + request = &CreateUserDirectoryRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateUserDirectory") + + + return +} + +func NewCreateUserDirectoryResponse() (response *CreateUserDirectoryResponse) { + response = &CreateUserDirectoryResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateUserDirectory +// 创建用户目录 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateUserDirectory(request *CreateUserDirectoryRequest) (response *CreateUserDirectoryResponse, err error) { + return c.CreateUserDirectoryWithContext(context.Background(), request) +} + +// CreateUserDirectory +// 创建用户目录 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateUserDirectoryWithContext(ctx context.Context, request *CreateUserDirectoryRequest) (response *CreateUserDirectoryResponse, err error) { + if request == nil { + request = NewCreateUserDirectoryRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateUserDirectory") + + if c.GetCredential() == nil { + return nil, errors.New("CreateUserDirectory require credential") + } + + request.SetContext(ctx) + + response = NewCreateUserDirectoryResponse() + err = c.Send(request, response) + return +} + +func NewCreateUserGroupRequest() (request *CreateUserGroupRequest) { + request = &CreateUserGroupRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "CreateUserGroup") + + + return +} + +func NewCreateUserGroupResponse() (response *CreateUserGroupResponse) { + response = &CreateUserGroupResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// CreateUserGroup +// 新建用户组 +// +// 可能返回的错误码: +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateUserGroup(request *CreateUserGroupRequest) (response *CreateUserGroupResponse, err error) { + return c.CreateUserGroupWithContext(context.Background(), request) +} + +// CreateUserGroup +// 新建用户组 +// +// 可能返回的错误码: +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) CreateUserGroupWithContext(ctx context.Context, request *CreateUserGroupRequest) (response *CreateUserGroupResponse, err error) { + if request == nil { + request = NewCreateUserGroupRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "CreateUserGroup") + + if c.GetCredential() == nil { + return nil, errors.New("CreateUserGroup require credential") + } + + request.SetContext(ctx) + + response = NewCreateUserGroupResponse() + err = c.Send(request, response) + return +} + +func NewDeleteAccessWhiteListRulesRequest() (request *DeleteAccessWhiteListRulesRequest) { + request = &DeleteAccessWhiteListRulesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteAccessWhiteListRules") + + + return +} + +func NewDeleteAccessWhiteListRulesResponse() (response *DeleteAccessWhiteListRulesResponse) { + response = &DeleteAccessWhiteListRulesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteAccessWhiteListRules +// 删除访问白名单规则 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) DeleteAccessWhiteListRules(request *DeleteAccessWhiteListRulesRequest) (response *DeleteAccessWhiteListRulesResponse, err error) { + return c.DeleteAccessWhiteListRulesWithContext(context.Background(), request) +} + +// DeleteAccessWhiteListRules +// 删除访问白名单规则 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) DeleteAccessWhiteListRulesWithContext(ctx context.Context, request *DeleteAccessWhiteListRulesRequest) (response *DeleteAccessWhiteListRulesResponse, err error) { + if request == nil { + request = NewDeleteAccessWhiteListRulesRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteAccessWhiteListRules") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteAccessWhiteListRules require credential") + } + + request.SetContext(ctx) + + response = NewDeleteAccessWhiteListRulesResponse() + err = c.Send(request, response) + return +} + +func NewDeleteAclsRequest() (request *DeleteAclsRequest) { + request = &DeleteAclsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteAcls") + + + return +} + +func NewDeleteAclsResponse() (response *DeleteAclsResponse) { + response = &DeleteAclsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteAcls +// 删除访问权限 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteAcls(request *DeleteAclsRequest) (response *DeleteAclsResponse, err error) { + return c.DeleteAclsWithContext(context.Background(), request) +} + +// DeleteAcls +// 删除访问权限 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteAclsWithContext(ctx context.Context, request *DeleteAclsRequest) (response *DeleteAclsResponse, err error) { + if request == nil { + request = NewDeleteAclsRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteAcls") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteAcls require credential") + } + + request.SetContext(ctx) + + response = NewDeleteAclsResponse() + err = c.Send(request, response) + return +} + +func NewDeleteChangePwdTaskRequest() (request *DeleteChangePwdTaskRequest) { + request = &DeleteChangePwdTaskRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteChangePwdTask") + + + return +} + +func NewDeleteChangePwdTaskResponse() (response *DeleteChangePwdTaskResponse) { + response = &DeleteChangePwdTaskResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteChangePwdTask +// 删除改密任务 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +func (c *Client) DeleteChangePwdTask(request *DeleteChangePwdTaskRequest) (response *DeleteChangePwdTaskResponse, err error) { + return c.DeleteChangePwdTaskWithContext(context.Background(), request) +} + +// DeleteChangePwdTask +// 删除改密任务 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +func (c *Client) DeleteChangePwdTaskWithContext(ctx context.Context, request *DeleteChangePwdTaskRequest) (response *DeleteChangePwdTaskResponse, err error) { + if request == nil { + request = NewDeleteChangePwdTaskRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteChangePwdTask") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteChangePwdTask require credential") + } + + request.SetContext(ctx) + + response = NewDeleteChangePwdTaskResponse() + err = c.Send(request, response) + return +} + +func NewDeleteCmdTemplatesRequest() (request *DeleteCmdTemplatesRequest) { + request = &DeleteCmdTemplatesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteCmdTemplates") + + + return +} + +func NewDeleteCmdTemplatesResponse() (response *DeleteCmdTemplatesResponse) { + response = &DeleteCmdTemplatesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteCmdTemplates +// 删除高危命令模板 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteCmdTemplates(request *DeleteCmdTemplatesRequest) (response *DeleteCmdTemplatesResponse, err error) { + return c.DeleteCmdTemplatesWithContext(context.Background(), request) +} + +// DeleteCmdTemplates +// 删除高危命令模板 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteCmdTemplatesWithContext(ctx context.Context, request *DeleteCmdTemplatesRequest) (response *DeleteCmdTemplatesResponse, err error) { + if request == nil { + request = NewDeleteCmdTemplatesRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteCmdTemplates") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteCmdTemplates require credential") + } + + request.SetContext(ctx) + + response = NewDeleteCmdTemplatesResponse() + err = c.Send(request, response) + return +} + +func NewDeleteDeviceAccountsRequest() (request *DeleteDeviceAccountsRequest) { + request = &DeleteDeviceAccountsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteDeviceAccounts") + + + return +} + +func NewDeleteDeviceAccountsResponse() (response *DeleteDeviceAccountsResponse) { + response = &DeleteDeviceAccountsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteDeviceAccounts +// 删除主机账号 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDeviceAccounts(request *DeleteDeviceAccountsRequest) (response *DeleteDeviceAccountsResponse, err error) { + return c.DeleteDeviceAccountsWithContext(context.Background(), request) +} + +// DeleteDeviceAccounts +// 删除主机账号 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDeviceAccountsWithContext(ctx context.Context, request *DeleteDeviceAccountsRequest) (response *DeleteDeviceAccountsResponse, err error) { + if request == nil { + request = NewDeleteDeviceAccountsRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteDeviceAccounts") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteDeviceAccounts require credential") + } + + request.SetContext(ctx) + + response = NewDeleteDeviceAccountsResponse() + err = c.Send(request, response) + return +} + +func NewDeleteDeviceGroupMembersRequest() (request *DeleteDeviceGroupMembersRequest) { + request = &DeleteDeviceGroupMembersRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteDeviceGroupMembers") + + + return +} + +func NewDeleteDeviceGroupMembersResponse() (response *DeleteDeviceGroupMembersResponse) { + response = &DeleteDeviceGroupMembersResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteDeviceGroupMembers +// 删除资产组成员 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDeviceGroupMembers(request *DeleteDeviceGroupMembersRequest) (response *DeleteDeviceGroupMembersResponse, err error) { + return c.DeleteDeviceGroupMembersWithContext(context.Background(), request) +} + +// DeleteDeviceGroupMembers +// 删除资产组成员 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDeviceGroupMembersWithContext(ctx context.Context, request *DeleteDeviceGroupMembersRequest) (response *DeleteDeviceGroupMembersResponse, err error) { + if request == nil { + request = NewDeleteDeviceGroupMembersRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteDeviceGroupMembers") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteDeviceGroupMembers require credential") + } + + request.SetContext(ctx) + + response = NewDeleteDeviceGroupMembersResponse() + err = c.Send(request, response) + return +} + +func NewDeleteDeviceGroupsRequest() (request *DeleteDeviceGroupsRequest) { + request = &DeleteDeviceGroupsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteDeviceGroups") + + + return +} + +func NewDeleteDeviceGroupsResponse() (response *DeleteDeviceGroupsResponse) { + response = &DeleteDeviceGroupsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteDeviceGroups +// 删除资产组 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDeviceGroups(request *DeleteDeviceGroupsRequest) (response *DeleteDeviceGroupsResponse, err error) { + return c.DeleteDeviceGroupsWithContext(context.Background(), request) +} + +// DeleteDeviceGroups +// 删除资产组 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDeviceGroupsWithContext(ctx context.Context, request *DeleteDeviceGroupsRequest) (response *DeleteDeviceGroupsResponse, err error) { + if request == nil { + request = NewDeleteDeviceGroupsRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteDeviceGroups") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteDeviceGroups require credential") + } + + request.SetContext(ctx) + + response = NewDeleteDeviceGroupsResponse() + err = c.Send(request, response) + return +} + +func NewDeleteDevicesRequest() (request *DeleteDevicesRequest) { + request = &DeleteDevicesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteDevices") + + + return +} + +func NewDeleteDevicesResponse() (response *DeleteDevicesResponse) { + response = &DeleteDevicesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteDevices +// 删除主机 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDevices(request *DeleteDevicesRequest) (response *DeleteDevicesResponse, err error) { + return c.DeleteDevicesWithContext(context.Background(), request) +} + +// DeleteDevices +// 删除主机 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteDevicesWithContext(ctx context.Context, request *DeleteDevicesRequest) (response *DeleteDevicesResponse, err error) { + if request == nil { + request = NewDeleteDevicesRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteDevices") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteDevices require credential") + } + + request.SetContext(ctx) + + response = NewDeleteDevicesResponse() + err = c.Send(request, response) + return +} + +func NewDeleteOperationTasksRequest() (request *DeleteOperationTasksRequest) { + request = &DeleteOperationTasksRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteOperationTasks") + + + return +} + +func NewDeleteOperationTasksResponse() (response *DeleteOperationTasksResponse) { + response = &DeleteOperationTasksResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteOperationTasks +// 删除运维任务 +// +// 可能返回的错误码: +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// FAILEDOPERATION_USEREXPIRED = "FailedOperation.UserExpired" +// FAILEDOPERATION_USERINVALID = "FailedOperation.UserInvalid" +// FAILEDOPERATION_USERLOCKED = "FailedOperation.UserLocked" +// FAILEDOPERATION_USERNOTEXIST = "FailedOperation.UserNotExist" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +func (c *Client) DeleteOperationTasks(request *DeleteOperationTasksRequest) (response *DeleteOperationTasksResponse, err error) { + return c.DeleteOperationTasksWithContext(context.Background(), request) +} + +// DeleteOperationTasks +// 删除运维任务 +// +// 可能返回的错误码: +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// FAILEDOPERATION_USEREXPIRED = "FailedOperation.UserExpired" +// FAILEDOPERATION_USERINVALID = "FailedOperation.UserInvalid" +// FAILEDOPERATION_USERLOCKED = "FailedOperation.UserLocked" +// FAILEDOPERATION_USERNOTEXIST = "FailedOperation.UserNotExist" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +func (c *Client) DeleteOperationTasksWithContext(ctx context.Context, request *DeleteOperationTasksRequest) (response *DeleteOperationTasksResponse, err error) { + if request == nil { + request = NewDeleteOperationTasksRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteOperationTasks") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteOperationTasks require credential") + } + + request.SetContext(ctx) + + response = NewDeleteOperationTasksResponse() + err = c.Send(request, response) + return +} + +func NewDeleteUserDirectoryRequest() (request *DeleteUserDirectoryRequest) { + request = &DeleteUserDirectoryRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteUserDirectory") + + + return +} + +func NewDeleteUserDirectoryResponse() (response *DeleteUserDirectoryResponse) { + response = &DeleteUserDirectoryResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteUserDirectory +// 删除用户目录 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DeleteUserDirectory(request *DeleteUserDirectoryRequest) (response *DeleteUserDirectoryResponse, err error) { + return c.DeleteUserDirectoryWithContext(context.Background(), request) +} + +// DeleteUserDirectory +// 删除用户目录 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DeleteUserDirectoryWithContext(ctx context.Context, request *DeleteUserDirectoryRequest) (response *DeleteUserDirectoryResponse, err error) { + if request == nil { + request = NewDeleteUserDirectoryRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteUserDirectory") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteUserDirectory require credential") + } + + request.SetContext(ctx) + + response = NewDeleteUserDirectoryResponse() + err = c.Send(request, response) + return +} + +func NewDeleteUserGroupMembersRequest() (request *DeleteUserGroupMembersRequest) { + request = &DeleteUserGroupMembersRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteUserGroupMembers") + + + return +} + +func NewDeleteUserGroupMembersResponse() (response *DeleteUserGroupMembersResponse) { + response = &DeleteUserGroupMembersResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteUserGroupMembers +// 删除用户组成员 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteUserGroupMembers(request *DeleteUserGroupMembersRequest) (response *DeleteUserGroupMembersResponse, err error) { + return c.DeleteUserGroupMembersWithContext(context.Background(), request) +} + +// DeleteUserGroupMembers +// 删除用户组成员 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteUserGroupMembersWithContext(ctx context.Context, request *DeleteUserGroupMembersRequest) (response *DeleteUserGroupMembersResponse, err error) { + if request == nil { + request = NewDeleteUserGroupMembersRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteUserGroupMembers") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteUserGroupMembers require credential") + } + + request.SetContext(ctx) + + response = NewDeleteUserGroupMembersResponse() + err = c.Send(request, response) + return +} + +func NewDeleteUserGroupsRequest() (request *DeleteUserGroupsRequest) { + request = &DeleteUserGroupsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteUserGroups") + + + return +} + +func NewDeleteUserGroupsResponse() (response *DeleteUserGroupsResponse) { + response = &DeleteUserGroupsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteUserGroups +// 删除用户组 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteUserGroups(request *DeleteUserGroupsRequest) (response *DeleteUserGroupsResponse, err error) { + return c.DeleteUserGroupsWithContext(context.Background(), request) +} + +// DeleteUserGroups +// 删除用户组 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DeleteUserGroupsWithContext(ctx context.Context, request *DeleteUserGroupsRequest) (response *DeleteUserGroupsResponse, err error) { + if request == nil { + request = NewDeleteUserGroupsRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteUserGroups") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteUserGroups require credential") + } + + request.SetContext(ctx) + + response = NewDeleteUserGroupsResponse() + err = c.Send(request, response) + return +} + +func NewDeleteUsersRequest() (request *DeleteUsersRequest) { + request = &DeleteUsersRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeleteUsers") + + + return +} + +func NewDeleteUsersResponse() (response *DeleteUsersResponse) { + response = &DeleteUsersResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeleteUsers +// 删除用户 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) DeleteUsers(request *DeleteUsersRequest) (response *DeleteUsersResponse, err error) { + return c.DeleteUsersWithContext(context.Background(), request) +} + +// DeleteUsers +// 删除用户 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) DeleteUsersWithContext(ctx context.Context, request *DeleteUsersRequest) (response *DeleteUsersResponse, err error) { + if request == nil { + request = NewDeleteUsersRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeleteUsers") + + if c.GetCredential() == nil { + return nil, errors.New("DeleteUsers require credential") + } + + request.SetContext(ctx) + + response = NewDeleteUsersResponse() + err = c.Send(request, response) + return +} + +func NewDeployResourceRequest() (request *DeployResourceRequest) { + request = &DeployResourceRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DeployResource") + + + return +} + +func NewDeployResourceResponse() (response *DeployResourceResponse) { + response = &DeployResourceResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DeployResource +// 开通服务,初始化资源,只针对新购资源 +// +// 可能返回的错误码: +// FAILEDOPERATION_VPCDEPLOYED = "FailedOperation.VPCDeployed" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// OPERATIONDENIED = "OperationDenied" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) DeployResource(request *DeployResourceRequest) (response *DeployResourceResponse, err error) { + return c.DeployResourceWithContext(context.Background(), request) +} + +// DeployResource +// 开通服务,初始化资源,只针对新购资源 +// +// 可能返回的错误码: +// FAILEDOPERATION_VPCDEPLOYED = "FailedOperation.VPCDeployed" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// OPERATIONDENIED = "OperationDenied" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) DeployResourceWithContext(ctx context.Context, request *DeployResourceRequest) (response *DeployResourceResponse, err error) { + if request == nil { + request = NewDeployResourceRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DeployResource") + + if c.GetCredential() == nil { + return nil, errors.New("DeployResource require credential") + } + + request.SetContext(ctx) + + response = NewDeployResourceResponse() + err = c.Send(request, response) + return +} + +func NewDescribeAccessWhiteListRulesRequest() (request *DescribeAccessWhiteListRulesRequest) { + request = &DescribeAccessWhiteListRulesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeAccessWhiteListRules") + + + return +} + +func NewDescribeAccessWhiteListRulesResponse() (response *DescribeAccessWhiteListRulesResponse) { + response = &DescribeAccessWhiteListRulesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeAccessWhiteListRules +// 查询访问白名单规则列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeAccessWhiteListRules(request *DescribeAccessWhiteListRulesRequest) (response *DescribeAccessWhiteListRulesResponse, err error) { + return c.DescribeAccessWhiteListRulesWithContext(context.Background(), request) +} + +// DescribeAccessWhiteListRules +// 查询访问白名单规则列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeAccessWhiteListRulesWithContext(ctx context.Context, request *DescribeAccessWhiteListRulesRequest) (response *DescribeAccessWhiteListRulesResponse, err error) { + if request == nil { + request = NewDescribeAccessWhiteListRulesRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeAccessWhiteListRules") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeAccessWhiteListRules require credential") + } + + request.SetContext(ctx) + + response = NewDescribeAccessWhiteListRulesResponse() + err = c.Send(request, response) + return +} + +func NewDescribeAccountGroupsRequest() (request *DescribeAccountGroupsRequest) { + request = &DescribeAccountGroupsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeAccountGroups") + + + return +} + +func NewDescribeAccountGroupsResponse() (response *DescribeAccountGroupsResponse) { + response = &DescribeAccountGroupsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeAccountGroups +// 获取账号组信息 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeAccountGroups(request *DescribeAccountGroupsRequest) (response *DescribeAccountGroupsResponse, err error) { + return c.DescribeAccountGroupsWithContext(context.Background(), request) +} + +// DescribeAccountGroups +// 获取账号组信息 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeAccountGroupsWithContext(ctx context.Context, request *DescribeAccountGroupsRequest) (response *DescribeAccountGroupsResponse, err error) { + if request == nil { + request = NewDescribeAccountGroupsRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeAccountGroups") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeAccountGroups require credential") + } + + request.SetContext(ctx) + + response = NewDescribeAccountGroupsResponse() + err = c.Send(request, response) + return +} + +func NewDescribeAclsRequest() (request *DescribeAclsRequest) { + request = &DescribeAclsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeAcls") + + + return +} + +func NewDescribeAclsResponse() (response *DescribeAclsResponse) { + response = &DescribeAclsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeAcls +// 查询访问权限列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeAcls(request *DescribeAclsRequest) (response *DescribeAclsResponse, err error) { + return c.DescribeAclsWithContext(context.Background(), request) +} + +// DescribeAcls +// 查询访问权限列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeAclsWithContext(ctx context.Context, request *DescribeAclsRequest) (response *DescribeAclsResponse, err error) { + if request == nil { + request = NewDescribeAclsRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeAcls") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeAcls require credential") + } + + request.SetContext(ctx) + + response = NewDescribeAclsResponse() + err = c.Send(request, response) + return +} + +func NewDescribeAssetSyncFlagRequest() (request *DescribeAssetSyncFlagRequest) { + request = &DescribeAssetSyncFlagRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeAssetSyncFlag") + + + return +} + +func NewDescribeAssetSyncFlagResponse() (response *DescribeAssetSyncFlagResponse) { + response = &DescribeAssetSyncFlagResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeAssetSyncFlag +// 查询资产自动同步开关 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeAssetSyncFlag(request *DescribeAssetSyncFlagRequest) (response *DescribeAssetSyncFlagResponse, err error) { + return c.DescribeAssetSyncFlagWithContext(context.Background(), request) +} + +// DescribeAssetSyncFlag +// 查询资产自动同步开关 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeAssetSyncFlagWithContext(ctx context.Context, request *DescribeAssetSyncFlagRequest) (response *DescribeAssetSyncFlagResponse, err error) { + if request == nil { + request = NewDescribeAssetSyncFlagRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeAssetSyncFlag") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeAssetSyncFlag require credential") + } + + request.SetContext(ctx) + + response = NewDescribeAssetSyncFlagResponse() + err = c.Send(request, response) + return +} + +func NewDescribeAssetSyncStatusRequest() (request *DescribeAssetSyncStatusRequest) { + request = &DescribeAssetSyncStatusRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeAssetSyncStatus") + + + return +} + +func NewDescribeAssetSyncStatusResponse() (response *DescribeAssetSyncStatusResponse) { + response = &DescribeAssetSyncStatusResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeAssetSyncStatus +// 查询资产同步状态 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) DescribeAssetSyncStatus(request *DescribeAssetSyncStatusRequest) (response *DescribeAssetSyncStatusResponse, err error) { + return c.DescribeAssetSyncStatusWithContext(context.Background(), request) +} + +// DescribeAssetSyncStatus +// 查询资产同步状态 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) DescribeAssetSyncStatusWithContext(ctx context.Context, request *DescribeAssetSyncStatusRequest) (response *DescribeAssetSyncStatusResponse, err error) { + if request == nil { + request = NewDescribeAssetSyncStatusRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeAssetSyncStatus") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeAssetSyncStatus require credential") + } + + request.SetContext(ctx) + + response = NewDescribeAssetSyncStatusResponse() + err = c.Send(request, response) + return +} + +func NewDescribeChangePwdTaskRequest() (request *DescribeChangePwdTaskRequest) { + request = &DescribeChangePwdTaskRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeChangePwdTask") + + + return +} + +func NewDescribeChangePwdTaskResponse() (response *DescribeChangePwdTaskResponse) { + response = &DescribeChangePwdTaskResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeChangePwdTask +// 查询改密任务列表 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeChangePwdTask(request *DescribeChangePwdTaskRequest) (response *DescribeChangePwdTaskResponse, err error) { + return c.DescribeChangePwdTaskWithContext(context.Background(), request) +} + +// DescribeChangePwdTask +// 查询改密任务列表 +// +// 可能返回的错误码: +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeChangePwdTaskWithContext(ctx context.Context, request *DescribeChangePwdTaskRequest) (response *DescribeChangePwdTaskResponse, err error) { + if request == nil { + request = NewDescribeChangePwdTaskRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeChangePwdTask") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeChangePwdTask require credential") + } + + request.SetContext(ctx) + + response = NewDescribeChangePwdTaskResponse() + err = c.Send(request, response) + return +} + +func NewDescribeChangePwdTaskDetailRequest() (request *DescribeChangePwdTaskDetailRequest) { + request = &DescribeChangePwdTaskDetailRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeChangePwdTaskDetail") + + + return +} + +func NewDescribeChangePwdTaskDetailResponse() (response *DescribeChangePwdTaskDetailResponse) { + response = &DescribeChangePwdTaskDetailResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeChangePwdTaskDetail +// 查询改密任务详情 +// +// 可能返回的错误码: +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeChangePwdTaskDetail(request *DescribeChangePwdTaskDetailRequest) (response *DescribeChangePwdTaskDetailResponse, err error) { + return c.DescribeChangePwdTaskDetailWithContext(context.Background(), request) +} + +// DescribeChangePwdTaskDetail +// 查询改密任务详情 +// +// 可能返回的错误码: +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeChangePwdTaskDetailWithContext(ctx context.Context, request *DescribeChangePwdTaskDetailRequest) (response *DescribeChangePwdTaskDetailResponse, err error) { + if request == nil { + request = NewDescribeChangePwdTaskDetailRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeChangePwdTaskDetail") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeChangePwdTaskDetail require credential") + } + + request.SetContext(ctx) + + response = NewDescribeChangePwdTaskDetailResponse() + err = c.Send(request, response) + return +} + +func NewDescribeCmdTemplatesRequest() (request *DescribeCmdTemplatesRequest) { + request = &DescribeCmdTemplatesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeCmdTemplates") + + + return +} + +func NewDescribeCmdTemplatesResponse() (response *DescribeCmdTemplatesResponse) { + response = &DescribeCmdTemplatesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeCmdTemplates +// 查询命令模板列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeCmdTemplates(request *DescribeCmdTemplatesRequest) (response *DescribeCmdTemplatesResponse, err error) { + return c.DescribeCmdTemplatesWithContext(context.Background(), request) +} + +// DescribeCmdTemplates +// 查询命令模板列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeCmdTemplatesWithContext(ctx context.Context, request *DescribeCmdTemplatesRequest) (response *DescribeCmdTemplatesResponse, err error) { + if request == nil { + request = NewDescribeCmdTemplatesRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeCmdTemplates") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeCmdTemplates require credential") + } + + request.SetContext(ctx) + + response = NewDescribeCmdTemplatesResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDeviceAccountsRequest() (request *DescribeDeviceAccountsRequest) { + request = &DescribeDeviceAccountsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeDeviceAccounts") + + + return +} + +func NewDescribeDeviceAccountsResponse() (response *DescribeDeviceAccountsResponse) { + response = &DescribeDeviceAccountsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDeviceAccounts +// 查询主机账号列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeDeviceAccounts(request *DescribeDeviceAccountsRequest) (response *DescribeDeviceAccountsResponse, err error) { + return c.DescribeDeviceAccountsWithContext(context.Background(), request) +} + +// DescribeDeviceAccounts +// 查询主机账号列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeDeviceAccountsWithContext(ctx context.Context, request *DescribeDeviceAccountsRequest) (response *DescribeDeviceAccountsResponse, err error) { + if request == nil { + request = NewDescribeDeviceAccountsRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeDeviceAccounts") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDeviceAccounts require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDeviceAccountsResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDeviceGroupMembersRequest() (request *DescribeDeviceGroupMembersRequest) { + request = &DescribeDeviceGroupMembersRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeDeviceGroupMembers") + + + return +} + +func NewDescribeDeviceGroupMembersResponse() (response *DescribeDeviceGroupMembersResponse) { + response = &DescribeDeviceGroupMembersResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDeviceGroupMembers +// 查询资产组成员列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDeviceGroupMembers(request *DescribeDeviceGroupMembersRequest) (response *DescribeDeviceGroupMembersResponse, err error) { + return c.DescribeDeviceGroupMembersWithContext(context.Background(), request) +} + +// DescribeDeviceGroupMembers +// 查询资产组成员列表 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDeviceGroupMembersWithContext(ctx context.Context, request *DescribeDeviceGroupMembersRequest) (response *DescribeDeviceGroupMembersResponse, err error) { + if request == nil { + request = NewDescribeDeviceGroupMembersRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeDeviceGroupMembers") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDeviceGroupMembers require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDeviceGroupMembersResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDeviceGroupsRequest() (request *DescribeDeviceGroupsRequest) { + request = &DescribeDeviceGroupsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeDeviceGroups") + + + return +} + +func NewDescribeDeviceGroupsResponse() (response *DescribeDeviceGroupsResponse) { + response = &DescribeDeviceGroupsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDeviceGroups +// 查询资产组列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDeviceGroups(request *DescribeDeviceGroupsRequest) (response *DescribeDeviceGroupsResponse, err error) { + return c.DescribeDeviceGroupsWithContext(context.Background(), request) +} + +// DescribeDeviceGroups +// 查询资产组列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDeviceGroupsWithContext(ctx context.Context, request *DescribeDeviceGroupsRequest) (response *DescribeDeviceGroupsResponse, err error) { + if request == nil { + request = NewDescribeDeviceGroupsRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeDeviceGroups") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDeviceGroups require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDeviceGroupsResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDevicesRequest() (request *DescribeDevicesRequest) { + request = &DescribeDevicesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeDevices") + + + return +} + +func NewDescribeDevicesResponse() (response *DescribeDevicesResponse) { + response = &DescribeDevicesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDevices +// 查询资产列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDevices(request *DescribeDevicesRequest) (response *DescribeDevicesResponse, err error) { + return c.DescribeDevicesWithContext(context.Background(), request) +} + +// DescribeDevices +// 查询资产列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeDevicesWithContext(ctx context.Context, request *DescribeDevicesRequest) (response *DescribeDevicesResponse, err error) { + if request == nil { + request = NewDescribeDevicesRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeDevices") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDevices require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDevicesResponse() + err = c.Send(request, response) + return +} + +func NewDescribeDomainsRequest() (request *DescribeDomainsRequest) { + request = &DescribeDomainsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeDomains") + + + return +} + +func NewDescribeDomainsResponse() (response *DescribeDomainsResponse) { + response = &DescribeDomainsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeDomains +// 查询网络域 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDFILTER = "InvalidFilter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) DescribeDomains(request *DescribeDomainsRequest) (response *DescribeDomainsResponse, err error) { + return c.DescribeDomainsWithContext(context.Background(), request) +} + +// DescribeDomains +// 查询网络域 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDFILTER = "InvalidFilter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) DescribeDomainsWithContext(ctx context.Context, request *DescribeDomainsRequest) (response *DescribeDomainsResponse, err error) { + if request == nil { + request = NewDescribeDomainsRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeDomains") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeDomains require credential") + } + + request.SetContext(ctx) + + response = NewDescribeDomainsResponse() + err = c.Send(request, response) + return +} + +func NewDescribeLDAPUnitSetRequest() (request *DescribeLDAPUnitSetRequest) { + request = &DescribeLDAPUnitSetRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeLDAPUnitSet") + + + return +} + +func NewDescribeLDAPUnitSetResponse() (response *DescribeLDAPUnitSetResponse) { + response = &DescribeLDAPUnitSetResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeLDAPUnitSet +// 获取LDAP ou 列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_AUTHFAILED = "FailedOperation.AuthFailed" +// FAILEDOPERATION_CONNECTIONFAILED = "FailedOperation.ConnectionFailed" +// FAILEDOPERATION_SEARCHFAILED = "FailedOperation.SearchFailed" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeLDAPUnitSet(request *DescribeLDAPUnitSetRequest) (response *DescribeLDAPUnitSetResponse, err error) { + return c.DescribeLDAPUnitSetWithContext(context.Background(), request) +} + +// DescribeLDAPUnitSet +// 获取LDAP ou 列表 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_AUTHFAILED = "FailedOperation.AuthFailed" +// FAILEDOPERATION_CONNECTIONFAILED = "FailedOperation.ConnectionFailed" +// FAILEDOPERATION_SEARCHFAILED = "FailedOperation.SearchFailed" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeLDAPUnitSetWithContext(ctx context.Context, request *DescribeLDAPUnitSetRequest) (response *DescribeLDAPUnitSetResponse, err error) { + if request == nil { + request = NewDescribeLDAPUnitSetRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeLDAPUnitSet") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeLDAPUnitSet require credential") + } + + request.SetContext(ctx) + + response = NewDescribeLDAPUnitSetResponse() + err = c.Send(request, response) + return +} + +func NewDescribeLoginEventRequest() (request *DescribeLoginEventRequest) { + request = &DescribeLoginEventRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeLoginEvent") + + + return +} + +func NewDescribeLoginEventResponse() (response *DescribeLoginEventResponse) { + response = &DescribeLoginEventResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeLoginEvent +// 查询登录日志 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeLoginEvent(request *DescribeLoginEventRequest) (response *DescribeLoginEventResponse, err error) { + return c.DescribeLoginEventWithContext(context.Background(), request) +} + +// DescribeLoginEvent +// 查询登录日志 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeLoginEventWithContext(ctx context.Context, request *DescribeLoginEventRequest) (response *DescribeLoginEventResponse, err error) { + if request == nil { + request = NewDescribeLoginEventRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeLoginEvent") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeLoginEvent require credential") + } + + request.SetContext(ctx) + + response = NewDescribeLoginEventResponse() + err = c.Send(request, response) + return +} + +func NewDescribeOperationEventRequest() (request *DescribeOperationEventRequest) { + request = &DescribeOperationEventRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeOperationEvent") + + + return +} + +func NewDescribeOperationEventResponse() (response *DescribeOperationEventResponse) { + response = &DescribeOperationEventResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeOperationEvent +// 查询操作日志 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// OPERATIONDENIED = "OperationDenied" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeOperationEvent(request *DescribeOperationEventRequest) (response *DescribeOperationEventResponse, err error) { + return c.DescribeOperationEventWithContext(context.Background(), request) +} + +// DescribeOperationEvent +// 查询操作日志 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// OPERATIONDENIED = "OperationDenied" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeOperationEventWithContext(ctx context.Context, request *DescribeOperationEventRequest) (response *DescribeOperationEventResponse, err error) { + if request == nil { + request = NewDescribeOperationEventRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeOperationEvent") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeOperationEvent require credential") + } + + request.SetContext(ctx) + + response = NewDescribeOperationEventResponse() + err = c.Send(request, response) + return +} + +func NewDescribeOperationTaskRequest() (request *DescribeOperationTaskRequest) { + request = &DescribeOperationTaskRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeOperationTask") + + + return +} + +func NewDescribeOperationTaskResponse() (response *DescribeOperationTaskResponse) { + response = &DescribeOperationTaskResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeOperationTask +// 获取运维任务列表 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// FAILEDOPERATION_USEREXPIRED = "FailedOperation.UserExpired" +// FAILEDOPERATION_USERINVALID = "FailedOperation.UserInvalid" +// FAILEDOPERATION_USERLOCKED = "FailedOperation.UserLocked" +// FAILEDOPERATION_USERNOTEXIST = "FailedOperation.UserNotExist" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) DescribeOperationTask(request *DescribeOperationTaskRequest) (response *DescribeOperationTaskResponse, err error) { + return c.DescribeOperationTaskWithContext(context.Background(), request) +} + +// DescribeOperationTask +// 获取运维任务列表 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// FAILEDOPERATION_USEREXPIRED = "FailedOperation.UserExpired" +// FAILEDOPERATION_USERINVALID = "FailedOperation.UserInvalid" +// FAILEDOPERATION_USERLOCKED = "FailedOperation.UserLocked" +// FAILEDOPERATION_USERNOTEXIST = "FailedOperation.UserNotExist" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) DescribeOperationTaskWithContext(ctx context.Context, request *DescribeOperationTaskRequest) (response *DescribeOperationTaskResponse, err error) { + if request == nil { + request = NewDescribeOperationTaskRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeOperationTask") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeOperationTask require credential") + } + + request.SetContext(ctx) + + response = NewDescribeOperationTaskResponse() + err = c.Send(request, response) + return +} + +func NewDescribeResourcesRequest() (request *DescribeResourcesRequest) { + request = &DescribeResourcesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeResources") + + + return +} + +func NewDescribeResourcesResponse() (response *DescribeResourcesResponse) { + response = &DescribeResourcesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeResources +// 查询用户购买的堡垒机服务信息,包括资源ID、授权点数、VPC、过期时间等。 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) DescribeResources(request *DescribeResourcesRequest) (response *DescribeResourcesResponse, err error) { + return c.DescribeResourcesWithContext(context.Background(), request) +} + +// DescribeResources +// 查询用户购买的堡垒机服务信息,包括资源ID、授权点数、VPC、过期时间等。 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) DescribeResourcesWithContext(ctx context.Context, request *DescribeResourcesRequest) (response *DescribeResourcesResponse, err error) { + if request == nil { + request = NewDescribeResourcesRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeResources") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeResources require credential") + } + + request.SetContext(ctx) + + response = NewDescribeResourcesResponse() + err = c.Send(request, response) + return +} + +func NewDescribeSecuritySettingRequest() (request *DescribeSecuritySettingRequest) { + request = &DescribeSecuritySettingRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeSecuritySetting") + + + return +} + +func NewDescribeSecuritySettingResponse() (response *DescribeSecuritySettingResponse) { + response = &DescribeSecuritySettingResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeSecuritySetting +// 查询安全配置信息 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeSecuritySetting(request *DescribeSecuritySettingRequest) (response *DescribeSecuritySettingResponse, err error) { + return c.DescribeSecuritySettingWithContext(context.Background(), request) +} + +// DescribeSecuritySetting +// 查询安全配置信息 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeSecuritySettingWithContext(ctx context.Context, request *DescribeSecuritySettingRequest) (response *DescribeSecuritySettingResponse, err error) { + if request == nil { + request = NewDescribeSecuritySettingRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeSecuritySetting") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeSecuritySetting require credential") + } + + request.SetContext(ctx) + + response = NewDescribeSecuritySettingResponse() + err = c.Send(request, response) + return +} + +func NewDescribeSourceTypesRequest() (request *DescribeSourceTypesRequest) { + request = &DescribeSourceTypesRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeSourceTypes") + + + return +} + +func NewDescribeSourceTypesResponse() (response *DescribeSourceTypesResponse) { + response = &DescribeSourceTypesResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeSourceTypes +// 获取认证源信息 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeSourceTypes(request *DescribeSourceTypesRequest) (response *DescribeSourceTypesResponse, err error) { + return c.DescribeSourceTypesWithContext(context.Background(), request) +} + +// DescribeSourceTypes +// 获取认证源信息 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeSourceTypesWithContext(ctx context.Context, request *DescribeSourceTypesRequest) (response *DescribeSourceTypesResponse, err error) { + if request == nil { + request = NewDescribeSourceTypesRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeSourceTypes") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeSourceTypes require credential") + } + + request.SetContext(ctx) + + response = NewDescribeSourceTypesResponse() + err = c.Send(request, response) + return +} + +func NewDescribeUserDirectoryRequest() (request *DescribeUserDirectoryRequest) { + request = &DescribeUserDirectoryRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeUserDirectory") + + + return +} + +func NewDescribeUserDirectoryResponse() (response *DescribeUserDirectoryResponse) { + response = &DescribeUserDirectoryResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeUserDirectory +// 获取用户目录 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeUserDirectory(request *DescribeUserDirectoryRequest) (response *DescribeUserDirectoryResponse, err error) { + return c.DescribeUserDirectoryWithContext(context.Background(), request) +} + +// DescribeUserDirectory +// 获取用户目录 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) DescribeUserDirectoryWithContext(ctx context.Context, request *DescribeUserDirectoryRequest) (response *DescribeUserDirectoryResponse, err error) { + if request == nil { + request = NewDescribeUserDirectoryRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeUserDirectory") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeUserDirectory require credential") + } + + request.SetContext(ctx) + + response = NewDescribeUserDirectoryResponse() + err = c.Send(request, response) + return +} + +func NewDescribeUserGroupMembersRequest() (request *DescribeUserGroupMembersRequest) { + request = &DescribeUserGroupMembersRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeUserGroupMembers") + + + return +} + +func NewDescribeUserGroupMembersResponse() (response *DescribeUserGroupMembersResponse) { + response = &DescribeUserGroupMembersResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeUserGroupMembers +// 查询用户组成员列表 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeUserGroupMembers(request *DescribeUserGroupMembersRequest) (response *DescribeUserGroupMembersResponse, err error) { + return c.DescribeUserGroupMembersWithContext(context.Background(), request) +} + +// DescribeUserGroupMembers +// 查询用户组成员列表 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeUserGroupMembersWithContext(ctx context.Context, request *DescribeUserGroupMembersRequest) (response *DescribeUserGroupMembersResponse, err error) { + if request == nil { + request = NewDescribeUserGroupMembersRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeUserGroupMembers") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeUserGroupMembers require credential") + } + + request.SetContext(ctx) + + response = NewDescribeUserGroupMembersResponse() + err = c.Send(request, response) + return +} + +func NewDescribeUserGroupsRequest() (request *DescribeUserGroupsRequest) { + request = &DescribeUserGroupsRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeUserGroups") + + + return +} + +func NewDescribeUserGroupsResponse() (response *DescribeUserGroupsResponse) { + response = &DescribeUserGroupsResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeUserGroups +// 查询用户组列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeUserGroups(request *DescribeUserGroupsRequest) (response *DescribeUserGroupsResponse, err error) { + return c.DescribeUserGroupsWithContext(context.Background(), request) +} + +// DescribeUserGroups +// 查询用户组列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeUserGroupsWithContext(ctx context.Context, request *DescribeUserGroupsRequest) (response *DescribeUserGroupsResponse, err error) { + if request == nil { + request = NewDescribeUserGroupsRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeUserGroups") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeUserGroups require credential") + } + + request.SetContext(ctx) + + response = NewDescribeUserGroupsResponse() + err = c.Send(request, response) + return +} + +func NewDescribeUserSyncStatusRequest() (request *DescribeUserSyncStatusRequest) { + request = &DescribeUserSyncStatusRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeUserSyncStatus") + + + return +} + +func NewDescribeUserSyncStatusResponse() (response *DescribeUserSyncStatusResponse) { + response = &DescribeUserSyncStatusResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeUserSyncStatus +// 获取用户同步状态 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeUserSyncStatus(request *DescribeUserSyncStatusRequest) (response *DescribeUserSyncStatusResponse, err error) { + return c.DescribeUserSyncStatusWithContext(context.Background(), request) +} + +// DescribeUserSyncStatus +// 获取用户同步状态 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeUserSyncStatusWithContext(ctx context.Context, request *DescribeUserSyncStatusRequest) (response *DescribeUserSyncStatusResponse, err error) { + if request == nil { + request = NewDescribeUserSyncStatusRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeUserSyncStatus") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeUserSyncStatus require credential") + } + + request.SetContext(ctx) + + response = NewDescribeUserSyncStatusResponse() + err = c.Send(request, response) + return +} + +func NewDescribeUsersRequest() (request *DescribeUsersRequest) { + request = &DescribeUsersRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DescribeUsers") + + + return +} + +func NewDescribeUsersResponse() (response *DescribeUsersResponse) { + response = &DescribeUsersResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DescribeUsers +// 查询用户列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeUsers(request *DescribeUsersRequest) (response *DescribeUsersResponse, err error) { + return c.DescribeUsersWithContext(context.Background(), request) +} + +// DescribeUsers +// 查询用户列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) DescribeUsersWithContext(ctx context.Context, request *DescribeUsersRequest) (response *DescribeUsersResponse, err error) { + if request == nil { + request = NewDescribeUsersRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DescribeUsers") + + if c.GetCredential() == nil { + return nil, errors.New("DescribeUsers require credential") + } + + request.SetContext(ctx) + + response = NewDescribeUsersResponse() + err = c.Send(request, response) + return +} + +func NewDisableExternalAccessRequest() (request *DisableExternalAccessRequest) { + request = &DisableExternalAccessRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DisableExternalAccess") + + + return +} + +func NewDisableExternalAccessResponse() (response *DisableExternalAccessResponse) { + response = &DisableExternalAccessResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DisableExternalAccess +// 关闭公网访问堡垒机 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +func (c *Client) DisableExternalAccess(request *DisableExternalAccessRequest) (response *DisableExternalAccessResponse, err error) { + return c.DisableExternalAccessWithContext(context.Background(), request) +} + +// DisableExternalAccess +// 关闭公网访问堡垒机 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +func (c *Client) DisableExternalAccessWithContext(ctx context.Context, request *DisableExternalAccessRequest) (response *DisableExternalAccessResponse, err error) { + if request == nil { + request = NewDisableExternalAccessRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DisableExternalAccess") + + if c.GetCredential() == nil { + return nil, errors.New("DisableExternalAccess require credential") + } + + request.SetContext(ctx) + + response = NewDisableExternalAccessResponse() + err = c.Send(request, response) + return +} + +func NewDisableIntranetAccessRequest() (request *DisableIntranetAccessRequest) { + request = &DisableIntranetAccessRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "DisableIntranetAccess") + + + return +} + +func NewDisableIntranetAccessResponse() (response *DisableIntranetAccessResponse) { + response = &DisableIntranetAccessResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// DisableIntranetAccess +// 关闭内网访问 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +func (c *Client) DisableIntranetAccess(request *DisableIntranetAccessRequest) (response *DisableIntranetAccessResponse, err error) { + return c.DisableIntranetAccessWithContext(context.Background(), request) +} + +// DisableIntranetAccess +// 关闭内网访问 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +func (c *Client) DisableIntranetAccessWithContext(ctx context.Context, request *DisableIntranetAccessRequest) (response *DisableIntranetAccessResponse, err error) { + if request == nil { + request = NewDisableIntranetAccessRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "DisableIntranetAccess") + + if c.GetCredential() == nil { + return nil, errors.New("DisableIntranetAccess require credential") + } + + request.SetContext(ctx) + + response = NewDisableIntranetAccessResponse() + err = c.Send(request, response) + return +} + +func NewEnableExternalAccessRequest() (request *EnableExternalAccessRequest) { + request = &EnableExternalAccessRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "EnableExternalAccess") + + + return +} + +func NewEnableExternalAccessResponse() (response *EnableExternalAccessResponse) { + response = &EnableExternalAccessResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// EnableExternalAccess +// 开启公网访问堡垒机 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +func (c *Client) EnableExternalAccess(request *EnableExternalAccessRequest) (response *EnableExternalAccessResponse, err error) { + return c.EnableExternalAccessWithContext(context.Background(), request) +} + +// EnableExternalAccess +// 开启公网访问堡垒机 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +func (c *Client) EnableExternalAccessWithContext(ctx context.Context, request *EnableExternalAccessRequest) (response *EnableExternalAccessResponse, err error) { + if request == nil { + request = NewEnableExternalAccessRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "EnableExternalAccess") + + if c.GetCredential() == nil { + return nil, errors.New("EnableExternalAccess require credential") + } + + request.SetContext(ctx) + + response = NewEnableExternalAccessResponse() + err = c.Send(request, response) + return +} + +func NewEnableIntranetAccessRequest() (request *EnableIntranetAccessRequest) { + request = &EnableIntranetAccessRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "EnableIntranetAccess") + + + return +} + +func NewEnableIntranetAccessResponse() (response *EnableIntranetAccessResponse) { + response = &EnableIntranetAccessResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// EnableIntranetAccess +// 开通内网访问 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +func (c *Client) EnableIntranetAccess(request *EnableIntranetAccessRequest) (response *EnableIntranetAccessResponse, err error) { + return c.EnableIntranetAccessWithContext(context.Background(), request) +} + +// EnableIntranetAccess +// 开通内网访问 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +func (c *Client) EnableIntranetAccessWithContext(ctx context.Context, request *EnableIntranetAccessRequest) (response *EnableIntranetAccessResponse, err error) { + if request == nil { + request = NewEnableIntranetAccessRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "EnableIntranetAccess") + + if c.GetCredential() == nil { + return nil, errors.New("EnableIntranetAccess require credential") + } + + request.SetContext(ctx) + + response = NewEnableIntranetAccessResponse() + err = c.Send(request, response) + return +} + +func NewImportExternalDeviceRequest() (request *ImportExternalDeviceRequest) { + request = &ImportExternalDeviceRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ImportExternalDevice") + + + return +} + +func NewImportExternalDeviceResponse() (response *ImportExternalDeviceResponse) { + response = &ImportExternalDeviceResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ImportExternalDevice +// 导入外部资产信息 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ImportExternalDevice(request *ImportExternalDeviceRequest) (response *ImportExternalDeviceResponse, err error) { + return c.ImportExternalDeviceWithContext(context.Background(), request) +} + +// ImportExternalDevice +// 导入外部资产信息 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ImportExternalDeviceWithContext(ctx context.Context, request *ImportExternalDeviceRequest) (response *ImportExternalDeviceResponse, err error) { + if request == nil { + request = NewImportExternalDeviceRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ImportExternalDevice") + + if c.GetCredential() == nil { + return nil, errors.New("ImportExternalDevice require credential") + } + + request.SetContext(ctx) + + response = NewImportExternalDeviceResponse() + err = c.Send(request, response) + return +} + +func NewModifyAccessWhiteListAutoStatusRequest() (request *ModifyAccessWhiteListAutoStatusRequest) { + request = &ModifyAccessWhiteListAutoStatusRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyAccessWhiteListAutoStatus") + + + return +} + +func NewModifyAccessWhiteListAutoStatusResponse() (response *ModifyAccessWhiteListAutoStatusResponse) { + response = &ModifyAccessWhiteListAutoStatusResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyAccessWhiteListAutoStatus +// 修改访问白名单自动添加IP状态:开启或关闭自动添加IP +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyAccessWhiteListAutoStatus(request *ModifyAccessWhiteListAutoStatusRequest) (response *ModifyAccessWhiteListAutoStatusResponse, err error) { + return c.ModifyAccessWhiteListAutoStatusWithContext(context.Background(), request) +} + +// ModifyAccessWhiteListAutoStatus +// 修改访问白名单自动添加IP状态:开启或关闭自动添加IP +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyAccessWhiteListAutoStatusWithContext(ctx context.Context, request *ModifyAccessWhiteListAutoStatusRequest) (response *ModifyAccessWhiteListAutoStatusResponse, err error) { + if request == nil { + request = NewModifyAccessWhiteListAutoStatusRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyAccessWhiteListAutoStatus") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyAccessWhiteListAutoStatus require credential") + } + + request.SetContext(ctx) + + response = NewModifyAccessWhiteListAutoStatusResponse() + err = c.Send(request, response) + return +} + +func NewModifyAccessWhiteListRuleRequest() (request *ModifyAccessWhiteListRuleRequest) { + request = &ModifyAccessWhiteListRuleRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyAccessWhiteListRule") + + + return +} + +func NewModifyAccessWhiteListRuleResponse() (response *ModifyAccessWhiteListRuleResponse) { + response = &ModifyAccessWhiteListRuleResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyAccessWhiteListRule +// 修改访问白名单规则 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyAccessWhiteListRule(request *ModifyAccessWhiteListRuleRequest) (response *ModifyAccessWhiteListRuleResponse, err error) { + return c.ModifyAccessWhiteListRuleWithContext(context.Background(), request) +} + +// ModifyAccessWhiteListRule +// 修改访问白名单规则 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyAccessWhiteListRuleWithContext(ctx context.Context, request *ModifyAccessWhiteListRuleRequest) (response *ModifyAccessWhiteListRuleResponse, err error) { + if request == nil { + request = NewModifyAccessWhiteListRuleRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyAccessWhiteListRule") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyAccessWhiteListRule require credential") + } + + request.SetContext(ctx) + + response = NewModifyAccessWhiteListRuleResponse() + err = c.Send(request, response) + return +} + +func NewModifyAccessWhiteListStatusRequest() (request *ModifyAccessWhiteListStatusRequest) { + request = &ModifyAccessWhiteListStatusRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyAccessWhiteListStatus") + + + return +} + +func NewModifyAccessWhiteListStatusResponse() (response *ModifyAccessWhiteListStatusResponse) { + response = &ModifyAccessWhiteListStatusResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyAccessWhiteListStatus +// 修改访问白名单状态:开启或关闭放开全部来源IP。 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyAccessWhiteListStatus(request *ModifyAccessWhiteListStatusRequest) (response *ModifyAccessWhiteListStatusResponse, err error) { + return c.ModifyAccessWhiteListStatusWithContext(context.Background(), request) +} + +// ModifyAccessWhiteListStatus +// 修改访问白名单状态:开启或关闭放开全部来源IP。 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyAccessWhiteListStatusWithContext(ctx context.Context, request *ModifyAccessWhiteListStatusRequest) (response *ModifyAccessWhiteListStatusResponse, err error) { + if request == nil { + request = NewModifyAccessWhiteListStatusRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyAccessWhiteListStatus") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyAccessWhiteListStatus require credential") + } + + request.SetContext(ctx) + + response = NewModifyAccessWhiteListStatusResponse() + err = c.Send(request, response) + return +} + +func NewModifyAclRequest() (request *ModifyAclRequest) { + request = &ModifyAclRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyAcl") + + + return +} + +func NewModifyAclResponse() (response *ModifyAclResponse) { + response = &ModifyAclResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyAcl +// 修改访问权限 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyAcl(request *ModifyAclRequest) (response *ModifyAclResponse, err error) { + return c.ModifyAclWithContext(context.Background(), request) +} + +// ModifyAcl +// 修改访问权限 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyAclWithContext(ctx context.Context, request *ModifyAclRequest) (response *ModifyAclResponse, err error) { + if request == nil { + request = NewModifyAclRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyAcl") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyAcl require credential") + } + + request.SetContext(ctx) + + response = NewModifyAclResponse() + err = c.Send(request, response) + return +} + +func NewModifyAssetSyncFlagRequest() (request *ModifyAssetSyncFlagRequest) { + request = &ModifyAssetSyncFlagRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyAssetSyncFlag") + + + return +} + +func NewModifyAssetSyncFlagResponse() (response *ModifyAssetSyncFlagResponse) { + response = &ModifyAssetSyncFlagResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyAssetSyncFlag +// 修改资产自动同步开关 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyAssetSyncFlag(request *ModifyAssetSyncFlagRequest) (response *ModifyAssetSyncFlagResponse, err error) { + return c.ModifyAssetSyncFlagWithContext(context.Background(), request) +} + +// ModifyAssetSyncFlag +// 修改资产自动同步开关 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyAssetSyncFlagWithContext(ctx context.Context, request *ModifyAssetSyncFlagRequest) (response *ModifyAssetSyncFlagResponse, err error) { + if request == nil { + request = NewModifyAssetSyncFlagRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyAssetSyncFlag") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyAssetSyncFlag require credential") + } + + request.SetContext(ctx) + + response = NewModifyAssetSyncFlagResponse() + err = c.Send(request, response) + return +} + +func NewModifyAuthModeSettingRequest() (request *ModifyAuthModeSettingRequest) { + request = &ModifyAuthModeSettingRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyAuthModeSetting") + + + return +} + +func NewModifyAuthModeSettingResponse() (response *ModifyAuthModeSettingResponse) { + response = &ModifyAuthModeSettingResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyAuthModeSetting +// 修改认证方式配置信息 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) ModifyAuthModeSetting(request *ModifyAuthModeSettingRequest) (response *ModifyAuthModeSettingResponse, err error) { + return c.ModifyAuthModeSettingWithContext(context.Background(), request) +} + +// ModifyAuthModeSetting +// 修改认证方式配置信息 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) ModifyAuthModeSettingWithContext(ctx context.Context, request *ModifyAuthModeSettingRequest) (response *ModifyAuthModeSettingResponse, err error) { + if request == nil { + request = NewModifyAuthModeSettingRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyAuthModeSetting") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyAuthModeSetting require credential") + } + + request.SetContext(ctx) + + response = NewModifyAuthModeSettingResponse() + err = c.Send(request, response) + return +} + +func NewModifyChangePwdTaskRequest() (request *ModifyChangePwdTaskRequest) { + request = &ModifyChangePwdTaskRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyChangePwdTask") + + + return +} + +func NewModifyChangePwdTaskResponse() (response *ModifyChangePwdTaskResponse) { + response = &ModifyChangePwdTaskResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyChangePwdTask +// 更新修改密码任务 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) ModifyChangePwdTask(request *ModifyChangePwdTaskRequest) (response *ModifyChangePwdTaskResponse, err error) { + return c.ModifyChangePwdTaskWithContext(context.Background(), request) +} + +// ModifyChangePwdTask +// 更新修改密码任务 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) ModifyChangePwdTaskWithContext(ctx context.Context, request *ModifyChangePwdTaskRequest) (response *ModifyChangePwdTaskResponse, err error) { + if request == nil { + request = NewModifyChangePwdTaskRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyChangePwdTask") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyChangePwdTask require credential") + } + + request.SetContext(ctx) + + response = NewModifyChangePwdTaskResponse() + err = c.Send(request, response) + return +} + +func NewModifyCmdTemplateRequest() (request *ModifyCmdTemplateRequest) { + request = &ModifyCmdTemplateRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyCmdTemplate") + + + return +} + +func NewModifyCmdTemplateResponse() (response *ModifyCmdTemplateResponse) { + response = &ModifyCmdTemplateResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyCmdTemplate +// 修改高危命令模板 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyCmdTemplate(request *ModifyCmdTemplateRequest) (response *ModifyCmdTemplateResponse, err error) { + return c.ModifyCmdTemplateWithContext(context.Background(), request) +} + +// ModifyCmdTemplate +// 修改高危命令模板 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyCmdTemplateWithContext(ctx context.Context, request *ModifyCmdTemplateRequest) (response *ModifyCmdTemplateResponse, err error) { + if request == nil { + request = NewModifyCmdTemplateRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyCmdTemplate") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyCmdTemplate require credential") + } + + request.SetContext(ctx) + + response = NewModifyCmdTemplateResponse() + err = c.Send(request, response) + return +} + +func NewModifyDeviceRequest() (request *ModifyDeviceRequest) { + request = &ModifyDeviceRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyDevice") + + + return +} + +func NewModifyDeviceResponse() (response *ModifyDeviceResponse) { + response = &ModifyDeviceResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyDevice +// 修改资产信息 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyDevice(request *ModifyDeviceRequest) (response *ModifyDeviceResponse, err error) { + return c.ModifyDeviceWithContext(context.Background(), request) +} + +// ModifyDevice +// 修改资产信息 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyDeviceWithContext(ctx context.Context, request *ModifyDeviceRequest) (response *ModifyDeviceResponse, err error) { + if request == nil { + request = NewModifyDeviceRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyDevice") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyDevice require credential") + } + + request.SetContext(ctx) + + response = NewModifyDeviceResponse() + err = c.Send(request, response) + return +} + +func NewModifyDeviceGroupRequest() (request *ModifyDeviceGroupRequest) { + request = &ModifyDeviceGroupRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyDeviceGroup") + + + return +} + +func NewModifyDeviceGroupResponse() (response *ModifyDeviceGroupResponse) { + response = &ModifyDeviceGroupResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyDeviceGroup +// 修改资产组 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyDeviceGroup(request *ModifyDeviceGroupRequest) (response *ModifyDeviceGroupResponse, err error) { + return c.ModifyDeviceGroupWithContext(context.Background(), request) +} + +// ModifyDeviceGroup +// 修改资产组 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyDeviceGroupWithContext(ctx context.Context, request *ModifyDeviceGroupRequest) (response *ModifyDeviceGroupResponse, err error) { + if request == nil { + request = NewModifyDeviceGroupRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyDeviceGroup") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyDeviceGroup require credential") + } + + request.SetContext(ctx) + + response = NewModifyDeviceGroupResponse() + err = c.Send(request, response) + return +} + +func NewModifyLDAPSettingRequest() (request *ModifyLDAPSettingRequest) { + request = &ModifyLDAPSettingRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyLDAPSetting") + + + return +} + +func NewModifyLDAPSettingResponse() (response *ModifyLDAPSettingResponse) { + response = &ModifyLDAPSettingResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyLDAPSetting +// 修改LDAP配置信息 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyLDAPSetting(request *ModifyLDAPSettingRequest) (response *ModifyLDAPSettingResponse, err error) { + return c.ModifyLDAPSettingWithContext(context.Background(), request) +} + +// ModifyLDAPSetting +// 修改LDAP配置信息 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCEINSUFFICIENT = "ResourceInsufficient" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyLDAPSettingWithContext(ctx context.Context, request *ModifyLDAPSettingRequest) (response *ModifyLDAPSettingResponse, err error) { + if request == nil { + request = NewModifyLDAPSettingRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyLDAPSetting") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyLDAPSetting require credential") + } + + request.SetContext(ctx) + + response = NewModifyLDAPSettingResponse() + err = c.Send(request, response) + return +} + +func NewModifyOAuthSettingRequest() (request *ModifyOAuthSettingRequest) { + request = &ModifyOAuthSettingRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyOAuthSetting") + + + return +} + +func NewModifyOAuthSettingResponse() (response *ModifyOAuthSettingResponse) { + response = &ModifyOAuthSettingResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyOAuthSetting +// 设置OAuth认证参数 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// OPERATIONDENIED = "OperationDenied" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +func (c *Client) ModifyOAuthSetting(request *ModifyOAuthSettingRequest) (response *ModifyOAuthSettingResponse, err error) { + return c.ModifyOAuthSettingWithContext(context.Background(), request) +} + +// ModifyOAuthSetting +// 设置OAuth认证参数 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// OPERATIONDENIED = "OperationDenied" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +func (c *Client) ModifyOAuthSettingWithContext(ctx context.Context, request *ModifyOAuthSettingRequest) (response *ModifyOAuthSettingResponse, err error) { + if request == nil { + request = NewModifyOAuthSettingRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyOAuthSetting") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyOAuthSetting require credential") + } + + request.SetContext(ctx) + + response = NewModifyOAuthSettingResponse() + err = c.Send(request, response) + return +} + +func NewModifyOperationTaskRequest() (request *ModifyOperationTaskRequest) { + request = &ModifyOperationTaskRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyOperationTask") + + + return +} + +func NewModifyOperationTaskResponse() (response *ModifyOperationTaskResponse) { + response = &ModifyOperationTaskResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyOperationTask +// 修改运维任务 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// FAILEDOPERATION_RESOURCENOTPRO = "FailedOperation.ResourceNotPro" +// FAILEDOPERATION_USEREXPIRED = "FailedOperation.UserExpired" +// FAILEDOPERATION_USERINVALID = "FailedOperation.UserInvalid" +// FAILEDOPERATION_USERLOCKED = "FailedOperation.UserLocked" +// FAILEDOPERATION_USERNOTEXIST = "FailedOperation.UserNotExist" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) ModifyOperationTask(request *ModifyOperationTaskRequest) (response *ModifyOperationTaskResponse, err error) { + return c.ModifyOperationTaskWithContext(context.Background(), request) +} + +// ModifyOperationTask +// 修改运维任务 +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// FAILEDOPERATION_RESOURCENOTPRO = "FailedOperation.ResourceNotPro" +// FAILEDOPERATION_USEREXPIRED = "FailedOperation.UserExpired" +// FAILEDOPERATION_USERINVALID = "FailedOperation.UserInvalid" +// FAILEDOPERATION_USERLOCKED = "FailedOperation.UserLocked" +// FAILEDOPERATION_USERNOTEXIST = "FailedOperation.UserNotExist" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) ModifyOperationTaskWithContext(ctx context.Context, request *ModifyOperationTaskRequest) (response *ModifyOperationTaskResponse, err error) { + if request == nil { + request = NewModifyOperationTaskRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyOperationTask") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyOperationTask require credential") + } + + request.SetContext(ctx) + + response = NewModifyOperationTaskResponse() + err = c.Send(request, response) + return +} + +func NewModifyReconnectionSettingRequest() (request *ModifyReconnectionSettingRequest) { + request = &ModifyReconnectionSettingRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyReconnectionSetting") + + + return +} + +func NewModifyReconnectionSettingResponse() (response *ModifyReconnectionSettingResponse) { + response = &ModifyReconnectionSettingResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyReconnectionSetting +// 修改运维资产连接重连次数 +// +// 可能返回的错误码: +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// UNKNOWNPARAMETER = "UnknownParameter" +func (c *Client) ModifyReconnectionSetting(request *ModifyReconnectionSettingRequest) (response *ModifyReconnectionSettingResponse, err error) { + return c.ModifyReconnectionSettingWithContext(context.Background(), request) +} + +// ModifyReconnectionSetting +// 修改运维资产连接重连次数 +// +// 可能返回的错误码: +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// UNKNOWNPARAMETER = "UnknownParameter" +func (c *Client) ModifyReconnectionSettingWithContext(ctx context.Context, request *ModifyReconnectionSettingRequest) (response *ModifyReconnectionSettingResponse, err error) { + if request == nil { + request = NewModifyReconnectionSettingRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyReconnectionSetting") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyReconnectionSetting require credential") + } + + request.SetContext(ctx) + + response = NewModifyReconnectionSettingResponse() + err = c.Send(request, response) + return +} + +func NewModifyResourceRequest() (request *ModifyResourceRequest) { + request = &ModifyResourceRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyResource") + + + return +} + +func NewModifyResourceResponse() (response *ModifyResourceResponse) { + response = &ModifyResourceResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyResource +// 资源变配 +// +// 可能返回的错误码: +// FAILEDOPERATION_VPCDEPLOYED = "FailedOperation.VPCDeployed" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) ModifyResource(request *ModifyResourceRequest) (response *ModifyResourceResponse, err error) { + return c.ModifyResourceWithContext(context.Background(), request) +} + +// ModifyResource +// 资源变配 +// +// 可能返回的错误码: +// FAILEDOPERATION_VPCDEPLOYED = "FailedOperation.VPCDeployed" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) ModifyResourceWithContext(ctx context.Context, request *ModifyResourceRequest) (response *ModifyResourceResponse, err error) { + if request == nil { + request = NewModifyResourceRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyResource") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyResource require credential") + } + + request.SetContext(ctx) + + response = NewModifyResourceResponse() + err = c.Send(request, response) + return +} + +func NewModifyUserRequest() (request *ModifyUserRequest) { + request = &ModifyUserRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyUser") + + + return +} + +func NewModifyUserResponse() (response *ModifyUserResponse) { + response = &ModifyUserResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyUser +// 修改用户信息 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyUser(request *ModifyUserRequest) (response *ModifyUserResponse, err error) { + return c.ModifyUserWithContext(context.Background(), request) +} + +// ModifyUser +// 修改用户信息 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyUserWithContext(ctx context.Context, request *ModifyUserRequest) (response *ModifyUserResponse, err error) { + if request == nil { + request = NewModifyUserRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyUser") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyUser require credential") + } + + request.SetContext(ctx) + + response = NewModifyUserResponse() + err = c.Send(request, response) + return +} + +func NewModifyUserDirectoryRequest() (request *ModifyUserDirectoryRequest) { + request = &ModifyUserDirectoryRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyUserDirectory") + + + return +} + +func NewModifyUserDirectoryResponse() (response *ModifyUserDirectoryResponse) { + response = &ModifyUserDirectoryResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyUserDirectory +// 修改用户目录信息 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyUserDirectory(request *ModifyUserDirectoryRequest) (response *ModifyUserDirectoryResponse, err error) { + return c.ModifyUserDirectoryWithContext(context.Background(), request) +} + +// ModifyUserDirectory +// 修改用户目录信息 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCEINUSE = "ResourceInUse" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// RESOURCESSOLDOUT = "ResourcesSoldOut" +// UNAUTHORIZEDOPERATION = "UnauthorizedOperation" +// UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyUserDirectoryWithContext(ctx context.Context, request *ModifyUserDirectoryRequest) (response *ModifyUserDirectoryResponse, err error) { + if request == nil { + request = NewModifyUserDirectoryRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyUserDirectory") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyUserDirectory require credential") + } + + request.SetContext(ctx) + + response = NewModifyUserDirectoryResponse() + err = c.Send(request, response) + return +} + +func NewModifyUserGroupRequest() (request *ModifyUserGroupRequest) { + request = &ModifyUserGroupRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ModifyUserGroup") + + + return +} + +func NewModifyUserGroupResponse() (response *ModifyUserGroupResponse) { + response = &ModifyUserGroupResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ModifyUserGroup +// 修改用户组 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyUserGroup(request *ModifyUserGroupRequest) (response *ModifyUserGroupResponse, err error) { + return c.ModifyUserGroupWithContext(context.Background(), request) +} + +// ModifyUserGroup +// 修改用户组 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// OPERATIONDENIED = "OperationDenied" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ModifyUserGroupWithContext(ctx context.Context, request *ModifyUserGroupRequest) (response *ModifyUserGroupResponse, err error) { + if request == nil { + request = NewModifyUserGroupRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ModifyUserGroup") + + if c.GetCredential() == nil { + return nil, errors.New("ModifyUserGroup require credential") + } + + request.SetContext(ctx) + + response = NewModifyUserGroupResponse() + err = c.Send(request, response) + return +} + +func NewReplaySessionRequest() (request *ReplaySessionRequest) { + request = &ReplaySessionRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ReplaySession") + + + return +} + +func NewReplaySessionResponse() (response *ReplaySessionResponse) { + response = &ReplaySessionResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ReplaySession +// 会话回放 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ReplaySession(request *ReplaySessionRequest) (response *ReplaySessionResponse, err error) { + return c.ReplaySessionWithContext(context.Background(), request) +} + +// ReplaySession +// 会话回放 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) ReplaySessionWithContext(ctx context.Context, request *ReplaySessionRequest) (response *ReplaySessionResponse, err error) { + if request == nil { + request = NewReplaySessionRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ReplaySession") + + if c.GetCredential() == nil { + return nil, errors.New("ReplaySession require credential") + } + + request.SetContext(ctx) + + response = NewReplaySessionResponse() + err = c.Send(request, response) + return +} + +func NewResetDeviceAccountPasswordRequest() (request *ResetDeviceAccountPasswordRequest) { + request = &ResetDeviceAccountPasswordRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ResetDeviceAccountPassword") + + + return +} + +func NewResetDeviceAccountPasswordResponse() (response *ResetDeviceAccountPasswordResponse) { + response = &ResetDeviceAccountPasswordResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ResetDeviceAccountPassword +// 清除设备账号绑定密码 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) ResetDeviceAccountPassword(request *ResetDeviceAccountPasswordRequest) (response *ResetDeviceAccountPasswordResponse, err error) { + return c.ResetDeviceAccountPasswordWithContext(context.Background(), request) +} + +// ResetDeviceAccountPassword +// 清除设备账号绑定密码 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) ResetDeviceAccountPasswordWithContext(ctx context.Context, request *ResetDeviceAccountPasswordRequest) (response *ResetDeviceAccountPasswordResponse, err error) { + if request == nil { + request = NewResetDeviceAccountPasswordRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ResetDeviceAccountPassword") + + if c.GetCredential() == nil { + return nil, errors.New("ResetDeviceAccountPassword require credential") + } + + request.SetContext(ctx) + + response = NewResetDeviceAccountPasswordResponse() + err = c.Send(request, response) + return +} + +func NewResetDeviceAccountPrivateKeyRequest() (request *ResetDeviceAccountPrivateKeyRequest) { + request = &ResetDeviceAccountPrivateKeyRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ResetDeviceAccountPrivateKey") + + + return +} + +func NewResetDeviceAccountPrivateKeyResponse() (response *ResetDeviceAccountPrivateKeyResponse) { + response = &ResetDeviceAccountPrivateKeyResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ResetDeviceAccountPrivateKey +// 清除设备账号绑定的密钥 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) ResetDeviceAccountPrivateKey(request *ResetDeviceAccountPrivateKeyRequest) (response *ResetDeviceAccountPrivateKeyResponse, err error) { + return c.ResetDeviceAccountPrivateKeyWithContext(context.Background(), request) +} + +// ResetDeviceAccountPrivateKey +// 清除设备账号绑定的密钥 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) ResetDeviceAccountPrivateKeyWithContext(ctx context.Context, request *ResetDeviceAccountPrivateKeyRequest) (response *ResetDeviceAccountPrivateKeyResponse, err error) { + if request == nil { + request = NewResetDeviceAccountPrivateKeyRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ResetDeviceAccountPrivateKey") + + if c.GetCredential() == nil { + return nil, errors.New("ResetDeviceAccountPrivateKey require credential") + } + + request.SetContext(ctx) + + response = NewResetDeviceAccountPrivateKeyResponse() + err = c.Send(request, response) + return +} + +func NewResetUserRequest() (request *ResetUserRequest) { + request = &ResetUserRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "ResetUser") + + + return +} + +func NewResetUserResponse() (response *ResetUserResponse) { + response = &ResetUserResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// ResetUser +// 重置用户 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) ResetUser(request *ResetUserRequest) (response *ResetUserResponse, err error) { + return c.ResetUserWithContext(context.Background(), request) +} + +// ResetUser +// 重置用户 +// +// 可能返回的错误码: +// FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// RESOURCENOTFOUND = "ResourceNotFound" +func (c *Client) ResetUserWithContext(ctx context.Context, request *ResetUserRequest) (response *ResetUserResponse, err error) { + if request == nil { + request = NewResetUserRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "ResetUser") + + if c.GetCredential() == nil { + return nil, errors.New("ResetUser require credential") + } + + request.SetContext(ctx) + + response = NewResetUserResponse() + err = c.Send(request, response) + return +} + +func NewRunChangePwdTaskRequest() (request *RunChangePwdTaskRequest) { + request = &RunChangePwdTaskRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "RunChangePwdTask") + + + return +} + +func NewRunChangePwdTaskResponse() (response *RunChangePwdTaskResponse) { + response = &RunChangePwdTaskResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// RunChangePwdTask +// 执行改密任务 +// +// 可能返回的错误码: +// FAILEDOPERATION_TOOFREQUENT = "FailedOperation.TooFrequent" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) RunChangePwdTask(request *RunChangePwdTaskRequest) (response *RunChangePwdTaskResponse, err error) { + return c.RunChangePwdTaskWithContext(context.Background(), request) +} + +// RunChangePwdTask +// 执行改密任务 +// +// 可能返回的错误码: +// FAILEDOPERATION_TOOFREQUENT = "FailedOperation.TooFrequent" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) RunChangePwdTaskWithContext(ctx context.Context, request *RunChangePwdTaskRequest) (response *RunChangePwdTaskResponse, err error) { + if request == nil { + request = NewRunChangePwdTaskRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "RunChangePwdTask") + + if c.GetCredential() == nil { + return nil, errors.New("RunChangePwdTask require credential") + } + + request.SetContext(ctx) + + response = NewRunChangePwdTaskResponse() + err = c.Send(request, response) + return +} + +func NewRunOperationTaskRequest() (request *RunOperationTaskRequest) { + request = &RunOperationTaskRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "RunOperationTask") + + + return +} + +func NewRunOperationTaskResponse() (response *RunOperationTaskResponse) { + response = &RunOperationTaskResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// RunOperationTask +// 执行运维任务 +// +// 可能返回的错误码: +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// FAILEDOPERATION_USEREXPIRED = "FailedOperation.UserExpired" +// FAILEDOPERATION_USERINVALID = "FailedOperation.UserInvalid" +// FAILEDOPERATION_USERLOCKED = "FailedOperation.UserLocked" +// FAILEDOPERATION_USERNOTEXIST = "FailedOperation.UserNotExist" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +func (c *Client) RunOperationTask(request *RunOperationTaskRequest) (response *RunOperationTaskResponse, err error) { + return c.RunOperationTaskWithContext(context.Background(), request) +} + +// RunOperationTask +// 执行运维任务 +// +// 可能返回的错误码: +// FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" +// FAILEDOPERATION_USEREXPIRED = "FailedOperation.UserExpired" +// FAILEDOPERATION_USERINVALID = "FailedOperation.UserInvalid" +// FAILEDOPERATION_USERLOCKED = "FailedOperation.UserLocked" +// FAILEDOPERATION_USERNOTEXIST = "FailedOperation.UserNotExist" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// MISSINGPARAMETER = "MissingParameter" +func (c *Client) RunOperationTaskWithContext(ctx context.Context, request *RunOperationTaskRequest) (response *RunOperationTaskResponse, err error) { + if request == nil { + request = NewRunOperationTaskRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "RunOperationTask") + + if c.GetCredential() == nil { + return nil, errors.New("RunOperationTask require credential") + } + + request.SetContext(ctx) + + response = NewRunOperationTaskResponse() + err = c.Send(request, response) + return +} + +func NewSearchAuditLogRequest() (request *SearchAuditLogRequest) { + request = &SearchAuditLogRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "SearchAuditLog") + + + return +} + +func NewSearchAuditLogResponse() (response *SearchAuditLogResponse) { + response = &SearchAuditLogResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// SearchAuditLog +// 搜索审计日志 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchAuditLog(request *SearchAuditLogRequest) (response *SearchAuditLogResponse, err error) { + return c.SearchAuditLogWithContext(context.Background(), request) +} + +// SearchAuditLog +// 搜索审计日志 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchAuditLogWithContext(ctx context.Context, request *SearchAuditLogRequest) (response *SearchAuditLogResponse, err error) { + if request == nil { + request = NewSearchAuditLogRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "SearchAuditLog") + + if c.GetCredential() == nil { + return nil, errors.New("SearchAuditLog require credential") + } + + request.SetContext(ctx) + + response = NewSearchAuditLogResponse() + err = c.Send(request, response) + return +} + +func NewSearchCommandRequest() (request *SearchCommandRequest) { + request = &SearchCommandRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "SearchCommand") + + + return +} + +func NewSearchCommandResponse() (response *SearchCommandResponse) { + response = &SearchCommandResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// SearchCommand +// 命令执行检索 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchCommand(request *SearchCommandRequest) (response *SearchCommandResponse, err error) { + return c.SearchCommandWithContext(context.Background(), request) +} + +// SearchCommand +// 命令执行检索 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchCommandWithContext(ctx context.Context, request *SearchCommandRequest) (response *SearchCommandResponse, err error) { + if request == nil { + request = NewSearchCommandRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "SearchCommand") + + if c.GetCredential() == nil { + return nil, errors.New("SearchCommand require credential") + } + + request.SetContext(ctx) + + response = NewSearchCommandResponse() + err = c.Send(request, response) + return +} + +func NewSearchCommandBySidRequest() (request *SearchCommandBySidRequest) { + request = &SearchCommandBySidRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "SearchCommandBySid") + + + return +} + +func NewSearchCommandBySidResponse() (response *SearchCommandBySidResponse) { + response = &SearchCommandBySidResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// SearchCommandBySid +// 根据会话Id搜索Command +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchCommandBySid(request *SearchCommandBySidRequest) (response *SearchCommandBySidResponse, err error) { + return c.SearchCommandBySidWithContext(context.Background(), request) +} + +// SearchCommandBySid +// 根据会话Id搜索Command +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchCommandBySidWithContext(ctx context.Context, request *SearchCommandBySidRequest) (response *SearchCommandBySidResponse, err error) { + if request == nil { + request = NewSearchCommandBySidRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "SearchCommandBySid") + + if c.GetCredential() == nil { + return nil, errors.New("SearchCommandBySid require credential") + } + + request.SetContext(ctx) + + response = NewSearchCommandBySidResponse() + err = c.Send(request, response) + return +} + +func NewSearchFileRequest() (request *SearchFileRequest) { + request = &SearchFileRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "SearchFile") + + + return +} + +func NewSearchFileResponse() (response *SearchFileResponse) { + response = &SearchFileResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// SearchFile +// 文件传输检索 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchFile(request *SearchFileRequest) (response *SearchFileResponse, err error) { + return c.SearchFileWithContext(context.Background(), request) +} + +// SearchFile +// 文件传输检索 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchFileWithContext(ctx context.Context, request *SearchFileRequest) (response *SearchFileResponse, err error) { + if request == nil { + request = NewSearchFileRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "SearchFile") + + if c.GetCredential() == nil { + return nil, errors.New("SearchFile require credential") + } + + request.SetContext(ctx) + + response = NewSearchFileResponse() + err = c.Send(request, response) + return +} + +func NewSearchFileBySidRequest() (request *SearchFileBySidRequest) { + request = &SearchFileBySidRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "SearchFileBySid") + + + return +} + +func NewSearchFileBySidResponse() (response *SearchFileBySidResponse) { + response = &SearchFileBySidResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// SearchFileBySid +// 搜索文件传输会话下文件操作列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchFileBySid(request *SearchFileBySidRequest) (response *SearchFileBySidResponse, err error) { + return c.SearchFileBySidWithContext(context.Background(), request) +} + +// SearchFileBySid +// 搜索文件传输会话下文件操作列表 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchFileBySidWithContext(ctx context.Context, request *SearchFileBySidRequest) (response *SearchFileBySidResponse, err error) { + if request == nil { + request = NewSearchFileBySidRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "SearchFileBySid") + + if c.GetCredential() == nil { + return nil, errors.New("SearchFileBySid require credential") + } + + request.SetContext(ctx) + + response = NewSearchFileBySidResponse() + err = c.Send(request, response) + return +} + +func NewSearchSessionRequest() (request *SearchSessionRequest) { + request = &SearchSessionRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "SearchSession") + + + return +} + +func NewSearchSessionResponse() (response *SearchSessionResponse) { + response = &SearchSessionResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// SearchSession +// 搜索会话 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchSession(request *SearchSessionRequest) (response *SearchSessionResponse, err error) { + return c.SearchSessionWithContext(context.Background(), request) +} + +// SearchSession +// 搜索会话 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchSessionWithContext(ctx context.Context, request *SearchSessionRequest) (response *SearchSessionResponse, err error) { + if request == nil { + request = NewSearchSessionRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "SearchSession") + + if c.GetCredential() == nil { + return nil, errors.New("SearchSession require credential") + } + + request.SetContext(ctx) + + response = NewSearchSessionResponse() + err = c.Send(request, response) + return +} + +func NewSearchSessionCommandRequest() (request *SearchSessionCommandRequest) { + request = &SearchSessionCommandRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "SearchSessionCommand") + + + return +} + +func NewSearchSessionCommandResponse() (response *SearchSessionCommandResponse) { + response = &SearchSessionCommandResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// SearchSessionCommand +// 命令检索 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchSessionCommand(request *SearchSessionCommandRequest) (response *SearchSessionCommandResponse, err error) { + return c.SearchSessionCommandWithContext(context.Background(), request) +} + +// SearchSessionCommand +// 命令检索 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchSessionCommandWithContext(ctx context.Context, request *SearchSessionCommandRequest) (response *SearchSessionCommandResponse, err error) { + if request == nil { + request = NewSearchSessionCommandRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "SearchSessionCommand") + + if c.GetCredential() == nil { + return nil, errors.New("SearchSessionCommand require credential") + } + + request.SetContext(ctx) + + response = NewSearchSessionCommandResponse() + err = c.Send(request, response) + return +} + +func NewSearchSubtaskResultByIdRequest() (request *SearchSubtaskResultByIdRequest) { + request = &SearchSubtaskResultByIdRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "SearchSubtaskResultById") + + + return +} + +func NewSearchSubtaskResultByIdResponse() (response *SearchSubtaskResultByIdResponse) { + response = &SearchSubtaskResultByIdResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// SearchSubtaskResultById +// 查询运维子任务执行结果 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchSubtaskResultById(request *SearchSubtaskResultByIdRequest) (response *SearchSubtaskResultByIdResponse, err error) { + return c.SearchSubtaskResultByIdWithContext(context.Background(), request) +} + +// SearchSubtaskResultById +// 查询运维子任务执行结果 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchSubtaskResultByIdWithContext(ctx context.Context, request *SearchSubtaskResultByIdRequest) (response *SearchSubtaskResultByIdResponse, err error) { + if request == nil { + request = NewSearchSubtaskResultByIdRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "SearchSubtaskResultById") + + if c.GetCredential() == nil { + return nil, errors.New("SearchSubtaskResultById require credential") + } + + request.SetContext(ctx) + + response = NewSearchSubtaskResultByIdResponse() + err = c.Send(request, response) + return +} + +func NewSearchTaskResultRequest() (request *SearchTaskResultRequest) { + request = &SearchTaskResultRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "SearchTaskResult") + + + return +} + +func NewSearchTaskResultResponse() (response *SearchTaskResultResponse) { + response = &SearchTaskResultResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// SearchTaskResult +// 搜索运维任务执行结果 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchTaskResult(request *SearchTaskResultRequest) (response *SearchTaskResultResponse, err error) { + return c.SearchTaskResultWithContext(context.Background(), request) +} + +// SearchTaskResult +// 搜索运维任务执行结果 +// +// 可能返回的错误码: +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) SearchTaskResultWithContext(ctx context.Context, request *SearchTaskResultRequest) (response *SearchTaskResultResponse, err error) { + if request == nil { + request = NewSearchTaskResultRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "SearchTaskResult") + + if c.GetCredential() == nil { + return nil, errors.New("SearchTaskResult require credential") + } + + request.SetContext(ctx) + + response = NewSearchTaskResultResponse() + err = c.Send(request, response) + return +} + +func NewSetLDAPSyncFlagRequest() (request *SetLDAPSyncFlagRequest) { + request = &SetLDAPSyncFlagRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "SetLDAPSyncFlag") + + + return +} + +func NewSetLDAPSyncFlagResponse() (response *SetLDAPSyncFlagResponse) { + response = &SetLDAPSyncFlagResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// SetLDAPSyncFlag +// 设置LDAP 立即同步标记 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) SetLDAPSyncFlag(request *SetLDAPSyncFlagRequest) (response *SetLDAPSyncFlagResponse, err error) { + return c.SetLDAPSyncFlagWithContext(context.Background(), request) +} + +// SetLDAPSyncFlag +// 设置LDAP 立即同步标记 +// +// 可能返回的错误码: +// AUTHFAILURE = "AuthFailure" +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// MISSINGPARAMETER = "MissingParameter" +// REQUESTLIMITEXCEEDED = "RequestLimitExceeded" +// RESOURCENOTFOUND = "ResourceNotFound" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +// UNKNOWNPARAMETER = "UnknownParameter" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) SetLDAPSyncFlagWithContext(ctx context.Context, request *SetLDAPSyncFlagRequest) (response *SetLDAPSyncFlagResponse, err error) { + if request == nil { + request = NewSetLDAPSyncFlagRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "SetLDAPSyncFlag") + + if c.GetCredential() == nil { + return nil, errors.New("SetLDAPSyncFlag require credential") + } + + request.SetContext(ctx) + + response = NewSetLDAPSyncFlagResponse() + err = c.Send(request, response) + return +} + +func NewSyncDevicesToIOARequest() (request *SyncDevicesToIOARequest) { + request = &SyncDevicesToIOARequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "SyncDevicesToIOA") + + + return +} + +func NewSyncDevicesToIOAResponse() (response *SyncDevicesToIOAResponse) { + response = &SyncDevicesToIOAResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// SyncDevicesToIOA +// 同步资产到IOA +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// OPERATIONDENIED = "OperationDenied" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) SyncDevicesToIOA(request *SyncDevicesToIOARequest) (response *SyncDevicesToIOAResponse, err error) { + return c.SyncDevicesToIOAWithContext(context.Background(), request) +} + +// SyncDevicesToIOA +// 同步资产到IOA +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// OPERATIONDENIED = "OperationDenied" +// RESOURCENOTFOUND = "ResourceNotFound" +// UNSUPPORTEDOPERATION = "UnsupportedOperation" +func (c *Client) SyncDevicesToIOAWithContext(ctx context.Context, request *SyncDevicesToIOARequest) (response *SyncDevicesToIOAResponse, err error) { + if request == nil { + request = NewSyncDevicesToIOARequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "SyncDevicesToIOA") + + if c.GetCredential() == nil { + return nil, errors.New("SyncDevicesToIOA require credential") + } + + request.SetContext(ctx) + + response = NewSyncDevicesToIOAResponse() + err = c.Send(request, response) + return +} + +func NewSyncUserToIOARequest() (request *SyncUserToIOARequest) { + request = &SyncUserToIOARequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "SyncUserToIOA") + + + return +} + +func NewSyncUserToIOAResponse() (response *SyncUserToIOAResponse) { + response = &SyncUserToIOAResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// SyncUserToIOA +// 同步堡垒机本地用户到IOA +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// OPERATIONDENIED = "OperationDenied" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) SyncUserToIOA(request *SyncUserToIOARequest) (response *SyncUserToIOAResponse, err error) { + return c.SyncUserToIOAWithContext(context.Background(), request) +} + +// SyncUserToIOA +// 同步堡垒机本地用户到IOA +// +// 可能返回的错误码: +// FAILEDOPERATION = "FailedOperation" +// INTERNALERROR = "InternalError" +// INVALIDPARAMETER = "InvalidParameter" +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +// LIMITEXCEEDED = "LimitExceeded" +// OPERATIONDENIED = "OperationDenied" +// RESOURCEUNAVAILABLE = "ResourceUnavailable" +func (c *Client) SyncUserToIOAWithContext(ctx context.Context, request *SyncUserToIOARequest) (response *SyncUserToIOAResponse, err error) { + if request == nil { + request = NewSyncUserToIOARequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "SyncUserToIOA") + + if c.GetCredential() == nil { + return nil, errors.New("SyncUserToIOA require credential") + } + + request.SetContext(ctx) + + response = NewSyncUserToIOAResponse() + err = c.Send(request, response) + return +} + +func NewUnlockUserRequest() (request *UnlockUserRequest) { + request = &UnlockUserRequest{ + BaseRequest: &tchttp.BaseRequest{}, + } + + request.Init().WithApiInfo("bh", APIVersion, "UnlockUser") + + + return +} + +func NewUnlockUserResponse() (response *UnlockUserResponse) { + response = &UnlockUserResponse{ + BaseResponse: &tchttp.BaseResponse{}, + } + return + +} + +// UnlockUser +// 解锁用户 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) UnlockUser(request *UnlockUserRequest) (response *UnlockUserResponse, err error) { + return c.UnlockUserWithContext(context.Background(), request) +} + +// UnlockUser +// 解锁用户 +// +// 可能返回的错误码: +// INVALIDPARAMETERVALUE = "InvalidParameterValue" +func (c *Client) UnlockUserWithContext(ctx context.Context, request *UnlockUserRequest) (response *UnlockUserResponse, err error) { + if request == nil { + request = NewUnlockUserRequest() + } + c.InitBaseRequest(&request.BaseRequest, "bh", APIVersion, "UnlockUser") + + if c.GetCredential() == nil { + return nil, errors.New("UnlockUser require credential") + } + + request.SetContext(ctx) + + response = NewUnlockUserResponse() + err = c.Send(request, response) + return +} diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418/errors.go new file mode 100644 index 0000000000..a429700589 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418/errors.go @@ -0,0 +1,115 @@ +// Copyright (c) 2017-2025 Tencent. 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 v20230418 + +const ( + // 此产品的特有错误码 + + // CAM签名/鉴权错误。 + AUTHFAILURE = "AuthFailure" + + // 操作失败。 + FAILEDOPERATION = "FailedOperation" + + // FailedOperation.AuthFailed + FAILEDOPERATION_AUTHFAILED = "FailedOperation.AuthFailed" + + // FailedOperation.ConnectionFailed + FAILEDOPERATION_CONNECTIONFAILED = "FailedOperation.ConnectionFailed" + + // FailedOperation.DataNotFound + FAILEDOPERATION_DATANOTFOUND = "FailedOperation.DataNotFound" + + // FailedOperation.DuplicateData + FAILEDOPERATION_DUPLICATEDATA = "FailedOperation.DuplicateData" + + // 非专业版资源 + FAILEDOPERATION_RESOURCENOTPRO = "FailedOperation.ResourceNotPro" + + // FailedOperation.SearchFailed + FAILEDOPERATION_SEARCHFAILED = "FailedOperation.SearchFailed" + + // FailedOperation.TooFrequent + FAILEDOPERATION_TOOFREQUENT = "FailedOperation.TooFrequent" + + // 用户已过期 + FAILEDOPERATION_USEREXPIRED = "FailedOperation.UserExpired" + + // 用户未生效 + FAILEDOPERATION_USERINVALID = "FailedOperation.UserInvalid" + + // 用户已锁定 + FAILEDOPERATION_USERLOCKED = "FailedOperation.UserLocked" + + // 用户不存在 + FAILEDOPERATION_USERNOTEXIST = "FailedOperation.UserNotExist" + + // FailedOperation.VPCDeployed + FAILEDOPERATION_VPCDEPLOYED = "FailedOperation.VPCDeployed" + + // 内部错误。 + INTERNALERROR = "InternalError" + + // 无效的过滤器 + INVALIDFILTER = "InvalidFilter" + + // 参数错误。 + INVALIDPARAMETER = "InvalidParameter" + + // InvalidParameter.ResourceId + INVALIDPARAMETER_RESOURCEID = "InvalidParameter.ResourceId" + + // 参数取值错误。 + INVALIDPARAMETERVALUE = "InvalidParameterValue" + + // 超过配额限制。 + LIMITEXCEEDED = "LimitExceeded" + + // 缺少参数错误。 + MISSINGPARAMETER = "MissingParameter" + + // 操作被拒绝。 + OPERATIONDENIED = "OperationDenied" + + // 请求的次数超过了频率限制。 + REQUESTLIMITEXCEEDED = "RequestLimitExceeded" + + // 资源被占用。 + RESOURCEINUSE = "ResourceInUse" + + // 资源不足。 + RESOURCEINSUFFICIENT = "ResourceInsufficient" + + // 资源不存在。 + RESOURCENOTFOUND = "ResourceNotFound" + + // 资源不可用。 + RESOURCEUNAVAILABLE = "ResourceUnavailable" + + // 资源售罄。 + RESOURCESSOLDOUT = "ResourcesSoldOut" + + // 未授权操作。 + UNAUTHORIZEDOPERATION = "UnauthorizedOperation" + + // UnauthorizedOperation.NoPermission + UNAUTHORIZEDOPERATION_NOPERMISSION = "UnauthorizedOperation.NoPermission" + + // 未知参数错误。 + UNKNOWNPARAMETER = "UnknownParameter" + + // 操作不支持。 + UNSUPPORTEDOPERATION = "UnsupportedOperation" +) diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418/models.go new file mode 100644 index 0000000000..964097d959 --- /dev/null +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418/models.go @@ -0,0 +1,10363 @@ +// Copyright (c) 2017-2025 Tencent. 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 v20230418 + +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" +) + +type ACTemplate struct { + // 模板id + TemplateId *string `json:"TemplateId,omitnil,omitempty" name:"TemplateId"` + + // 模板名称 + TemplateName *string `json:"TemplateName,omitnil,omitempty" name:"TemplateName"` + + // 模板描述 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` +} + +// Predefined struct for user +type AccessDevicesRequestParams struct { + // 资产的登录账号 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 运维端登录账号 + // + // Deprecated: LoginAccount is deprecated. + LoginAccount *string `json:"LoginAccount,omitnil,omitempty" name:"LoginAccount"` + + // 运维端登录密码 + // + // Deprecated: LoginPassword is deprecated. + LoginPassword *string `json:"LoginPassword,omitnil,omitempty" name:"LoginPassword"` + + // 资产ID + DeviceId *uint64 `json:"DeviceId,omitnil,omitempty" name:"DeviceId"` + + // 资源id(优先使用DeviceId) + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 未托管密码私钥时,填入 + Password *string `json:"Password,omitnil,omitempty" name:"Password"` + + // 未托管密码私钥时,填入 + PrivateKey *string `json:"PrivateKey,omitnil,omitempty" name:"PrivateKey"` + + // 未托管密码私钥时,填入 + PrivateKeyPassword *string `json:"PrivateKeyPassword,omitnil,omitempty" name:"PrivateKeyPassword"` + + // 客户端工具 + Exe *string `json:"Exe,omitnil,omitempty" name:"Exe"` + + // RDP挂载盘符驱动(mstsc支持) + Drivers []*string `json:"Drivers,omitnil,omitempty" name:"Drivers"` + + // 窗口宽度(RDP支持) + Width *uint64 `json:"Width,omitnil,omitempty" name:"Width"` + + // 窗口高度(RDP支持) + Height *uint64 `json:"Height,omitnil,omitempty" name:"Height"` + + // 是否内网访问(默认不是) + IntranetAccess *bool `json:"IntranetAccess,omitnil,omitempty" name:"IntranetAccess"` + + // 是否自动管理访问串,删掉过期的,新建可用的(默认false) + AutoManageAccessCredential *bool `json:"AutoManageAccessCredential,omitnil,omitempty" name:"AutoManageAccessCredential"` +} + +type AccessDevicesRequest struct { + *tchttp.BaseRequest + + // 资产的登录账号 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 运维端登录账号 + LoginAccount *string `json:"LoginAccount,omitnil,omitempty" name:"LoginAccount"` + + // 运维端登录密码 + LoginPassword *string `json:"LoginPassword,omitnil,omitempty" name:"LoginPassword"` + + // 资产ID + DeviceId *uint64 `json:"DeviceId,omitnil,omitempty" name:"DeviceId"` + + // 资源id(优先使用DeviceId) + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 未托管密码私钥时,填入 + Password *string `json:"Password,omitnil,omitempty" name:"Password"` + + // 未托管密码私钥时,填入 + PrivateKey *string `json:"PrivateKey,omitnil,omitempty" name:"PrivateKey"` + + // 未托管密码私钥时,填入 + PrivateKeyPassword *string `json:"PrivateKeyPassword,omitnil,omitempty" name:"PrivateKeyPassword"` + + // 客户端工具 + Exe *string `json:"Exe,omitnil,omitempty" name:"Exe"` + + // RDP挂载盘符驱动(mstsc支持) + Drivers []*string `json:"Drivers,omitnil,omitempty" name:"Drivers"` + + // 窗口宽度(RDP支持) + Width *uint64 `json:"Width,omitnil,omitempty" name:"Width"` + + // 窗口高度(RDP支持) + Height *uint64 `json:"Height,omitnil,omitempty" name:"Height"` + + // 是否内网访问(默认不是) + IntranetAccess *bool `json:"IntranetAccess,omitnil,omitempty" name:"IntranetAccess"` + + // 是否自动管理访问串,删掉过期的,新建可用的(默认false) + AutoManageAccessCredential *bool `json:"AutoManageAccessCredential,omitnil,omitempty" name:"AutoManageAccessCredential"` +} + +func (r *AccessDevicesRequest) 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 *AccessDevicesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Account") + delete(f, "LoginAccount") + delete(f, "LoginPassword") + delete(f, "DeviceId") + delete(f, "InstanceId") + delete(f, "Password") + delete(f, "PrivateKey") + delete(f, "PrivateKeyPassword") + delete(f, "Exe") + delete(f, "Drivers") + delete(f, "Width") + delete(f, "Height") + delete(f, "IntranetAccess") + delete(f, "AutoManageAccessCredential") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AccessDevicesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type AccessDevicesResponseParams struct { + // 认证信息 + AccessInfo *AccessInfo `json:"AccessInfo,omitnil,omitempty" name:"AccessInfo"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type AccessDevicesResponse struct { + *tchttp.BaseResponse + Response *AccessDevicesResponseParams `json:"Response"` +} + +func (r *AccessDevicesResponse) 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 *AccessDevicesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type AccessInfo struct { + // 地址 + Ip *string `json:"Ip,omitnil,omitempty" name:"Ip"` + + // 端口 + Port *uint64 `json:"Port,omitnil,omitempty" name:"Port"` + + // 账号 + User *string `json:"User,omitnil,omitempty" name:"User"` + + // 密码 + Password *string `json:"Password,omitnil,omitempty" name:"Password"` + + // 唤起链接|wss链接 + AccessURL *string `json:"AccessURL,omitnil,omitempty" name:"AccessURL"` +} + +type AccessWhiteListRule struct { + // 规则ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // IP或者网段 + Source *string `json:"Source,omitnil,omitempty" name:"Source"` + + // 备注信息 + Remark *string `json:"Remark,omitnil,omitempty" name:"Remark"` + + // 修改时间 + ModifyTime *string `json:"ModifyTime,omitnil,omitempty" name:"ModifyTime"` +} + +type AccountGroup struct { + // 账号组id + Id *int64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 账号组名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 账号组id路径 + IdPath *string `json:"IdPath,omitnil,omitempty" name:"IdPath"` + + // 账号组名称路径 + NamePath *string `json:"NamePath,omitnil,omitempty" name:"NamePath"` + + // 父账号组id + ParentId *int64 `json:"ParentId,omitnil,omitempty" name:"ParentId"` + + // 账号组来源 + Source *int64 `json:"Source,omitnil,omitempty" name:"Source"` + + // 账号组下用户总数 + UserTotal *int64 `json:"UserTotal,omitnil,omitempty" name:"UserTotal"` + + // 是否叶子节点 + IsLeaf *bool `json:"IsLeaf,omitnil,omitempty" name:"IsLeaf"` + + // 账号组导入类型 + ImportType *string `json:"ImportType,omitnil,omitempty" name:"ImportType"` + + // 账号组描述 + Description *string `json:"Description,omitnil,omitempty" name:"Description"` + + // 父源账号组织ID。使用第三方导入用户源时,记录该分组在源组织架构下的分组ID + ParentOrgId *string `json:"ParentOrgId,omitnil,omitempty" name:"ParentOrgId"` + + // 源账号组织ID。使用第三方导入用户源时,记录该分组在源组织架构下的分组ID + OrgId *string `json:"OrgId,omitnil,omitempty" name:"OrgId"` + + // 账号组是否已经接入,0表示未接入,1表示接入 + Status *int64 `json:"Status,omitnil,omitempty" name:"Status"` +} + +type Acl struct { + // 访问权限ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 访问权限名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 是否开启磁盘映射 + AllowDiskRedirect *bool `json:"AllowDiskRedirect,omitnil,omitempty" name:"AllowDiskRedirect"` + + // 是否开启剪贴板文件上行 + AllowClipFileUp *bool `json:"AllowClipFileUp,omitnil,omitempty" name:"AllowClipFileUp"` + + // 是否开启剪贴板文件下行 + AllowClipFileDown *bool `json:"AllowClipFileDown,omitnil,omitempty" name:"AllowClipFileDown"` + + // 是否开启剪贴板文本(目前含图片)上行 + AllowClipTextUp *bool `json:"AllowClipTextUp,omitnil,omitempty" name:"AllowClipTextUp"` + + // 是否开启剪贴板文本(目前含图片)下行 + AllowClipTextDown *bool `json:"AllowClipTextDown,omitnil,omitempty" name:"AllowClipTextDown"` + + // 是否开启文件传输上传 + AllowFileUp *bool `json:"AllowFileUp,omitnil,omitempty" name:"AllowFileUp"` + + // 文件传输上传大小限制(预留参数,暂未启用) + MaxFileUpSize *uint64 `json:"MaxFileUpSize,omitnil,omitempty" name:"MaxFileUpSize"` + + // 是否开启文件传输下载 + AllowFileDown *bool `json:"AllowFileDown,omitnil,omitempty" name:"AllowFileDown"` + + // 文件传输下载大小限制(预留参数,暂未启用) + MaxFileDownSize *uint64 `json:"MaxFileDownSize,omitnil,omitempty" name:"MaxFileDownSize"` + + // 是否允许任意账号登录 + AllowAnyAccount *bool `json:"AllowAnyAccount,omitnil,omitempty" name:"AllowAnyAccount"` + + // 关联的用户列表 + UserSet []*User `json:"UserSet,omitnil,omitempty" name:"UserSet"` + + // 关联的用户组列表 + UserGroupSet []*Group `json:"UserGroupSet,omitnil,omitempty" name:"UserGroupSet"` + + // 关联的资产列表 + DeviceSet []*Device `json:"DeviceSet,omitnil,omitempty" name:"DeviceSet"` + + // 关联的资产组列表 + DeviceGroupSet []*Group `json:"DeviceGroupSet,omitnil,omitempty" name:"DeviceGroupSet"` + + // 关联的账号列表 + AccountSet []*string `json:"AccountSet,omitnil,omitempty" name:"AccountSet"` + + // 关联的高危命令模板列表 + CmdTemplateSet []*CmdTemplate `json:"CmdTemplateSet,omitnil,omitempty" name:"CmdTemplateSet"` + + // 是否开启 RDP 磁盘映射文件上传 + AllowDiskFileUp *bool `json:"AllowDiskFileUp,omitnil,omitempty" name:"AllowDiskFileUp"` + + // 是否开启 RDP 磁盘映射文件下载 + AllowDiskFileDown *bool `json:"AllowDiskFileDown,omitnil,omitempty" name:"AllowDiskFileDown"` + + // 是否开启 rz sz 文件上传 + AllowShellFileUp *bool `json:"AllowShellFileUp,omitnil,omitempty" name:"AllowShellFileUp"` + + // 是否开启 rz sz 文件下载 + AllowShellFileDown *bool `json:"AllowShellFileDown,omitnil,omitempty" name:"AllowShellFileDown"` + + // 是否开启 SFTP 文件删除 + AllowFileDel *bool `json:"AllowFileDel,omitnil,omitempty" name:"AllowFileDel"` + + // 访问权限生效时间,如:"2021-09-22T00:00:00+00:00" + // 生效、失效时间不填则访问权限长期有效 + ValidateFrom *string `json:"ValidateFrom,omitnil,omitempty" name:"ValidateFrom"` + + // 访问权限失效时间,如:"2021-09-23T00:00:00+00:00" + // 生效、失效时间不填则访问权限长期有效 + ValidateTo *string `json:"ValidateTo,omitnil,omitempty" name:"ValidateTo"` + + // 访问权限状态,1 - 已生效,2 - 未生效,3 - 已过期 + Status *uint64 `json:"Status,omitnil,omitempty" name:"Status"` + + // 所属部门的信息 + Department *Department `json:"Department,omitnil,omitempty" name:"Department"` + + // 是否允许使用访问串,默认允许 + AllowAccessCredential *bool `json:"AllowAccessCredential,omitnil,omitempty" name:"AllowAccessCredential"` + + // 关联的数据库高危命令列表 + ACTemplateSet []*ACTemplate `json:"ACTemplateSet,omitnil,omitempty" name:"ACTemplateSet"` + + // 关联的白命令命令 + WhiteCmds []*string `json:"WhiteCmds,omitnil,omitempty" name:"WhiteCmds"` + + // 是否允许记录键盘 + AllowKeyboardLogger *bool `json:"AllowKeyboardLogger,omitnil,omitempty" name:"AllowKeyboardLogger"` + + // 关联的应用资产列表 + AppAssetSet []*AppAsset `json:"AppAssetSet,omitnil,omitempty" name:"AppAssetSet"` + + // 权限类型 0-默认普通权限 1-工单权限,2-权限工单权限 + AclType *uint64 `json:"AclType,omitnil,omitempty" name:"AclType"` + + // 权限所属工单id + TicketId *string `json:"TicketId,omitnil,omitempty" name:"TicketId"` + + // 权限所属工单名称 + TicketName *string `json:"TicketName,omitnil,omitempty" name:"TicketName"` +} + +// Predefined struct for user +type AddDeviceGroupMembersRequestParams struct { + // 资产组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 需要添加到资产组的资产ID集合 + MemberIdSet []*uint64 `json:"MemberIdSet,omitnil,omitempty" name:"MemberIdSet"` +} + +type AddDeviceGroupMembersRequest struct { + *tchttp.BaseRequest + + // 资产组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 需要添加到资产组的资产ID集合 + MemberIdSet []*uint64 `json:"MemberIdSet,omitnil,omitempty" name:"MemberIdSet"` +} + +func (r *AddDeviceGroupMembersRequest) 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 *AddDeviceGroupMembersRequest) 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, "MemberIdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AddDeviceGroupMembersRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type AddDeviceGroupMembersResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type AddDeviceGroupMembersResponse struct { + *tchttp.BaseResponse + Response *AddDeviceGroupMembersResponseParams `json:"Response"` +} + +func (r *AddDeviceGroupMembersResponse) 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 *AddDeviceGroupMembersResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type AddUserGroupMembersRequestParams struct { + // 用户组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 成员用户ID集合 + MemberIdSet []*uint64 `json:"MemberIdSet,omitnil,omitempty" name:"MemberIdSet"` +} + +type AddUserGroupMembersRequest struct { + *tchttp.BaseRequest + + // 用户组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 成员用户ID集合 + MemberIdSet []*uint64 `json:"MemberIdSet,omitnil,omitempty" name:"MemberIdSet"` +} + +func (r *AddUserGroupMembersRequest) 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 *AddUserGroupMembersRequest) 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, "MemberIdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "AddUserGroupMembersRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type AddUserGroupMembersResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type AddUserGroupMembersResponse struct { + *tchttp.BaseResponse + Response *AddUserGroupMembersResponseParams `json:"Response"` +} + +func (r *AddUserGroupMembersResponse) 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 *AddUserGroupMembersResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type AppAsset struct { + // 应用资产id + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 实例id + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 资产名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 应用服务器id + DeviceId *uint64 `json:"DeviceId,omitnil,omitempty" name:"DeviceId"` + + // 应用服务器账号id + DeviceAccountId *uint64 `json:"DeviceAccountId,omitnil,omitempty" name:"DeviceAccountId"` + + // 应用资产类型。1-web应用 + Kind *uint64 `json:"Kind,omitnil,omitempty" name:"Kind"` + + // 客户端工具路径 + ClientAppPath *string `json:"ClientAppPath,omitnil,omitempty" name:"ClientAppPath"` + + // 客户端工具类型 + ClientAppKind *string `json:"ClientAppKind,omitnil,omitempty" name:"ClientAppKind"` + + // 应用资产url + Url *string `json:"Url,omitnil,omitempty" name:"Url"` + + // 托管状态。0-未托管,1-已托管 + BindStatus *uint64 `json:"BindStatus,omitnil,omitempty" name:"BindStatus"` + + // 应用服务器实例id + DeviceInstanceId *string `json:"DeviceInstanceId,omitnil,omitempty" name:"DeviceInstanceId"` + + // 应用服务器名称 + DeviceName *string `json:"DeviceName,omitnil,omitempty" name:"DeviceName"` + + // 应用服务器账号名称 + DeviceAccountName *string `json:"DeviceAccountName,omitnil,omitempty" name:"DeviceAccountName"` + + // 堡垒机实例id + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // 堡垒机实例信息 + Resource *Resource `json:"Resource,omitnil,omitempty" name:"Resource"` + + // 网络域id + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` + + // 网络域名称 + DomainName *string `json:"DomainName,omitnil,omitempty" name:"DomainName"` + + // 资产组信息 + GroupSet []*Group `json:"GroupSet,omitnil,omitempty" name:"GroupSet"` + + // 资产所属部门 + Department *Department `json:"Department,omitnil,omitempty" name:"Department"` +} + +type AssetSyncFlags struct { + // 是否已完成角色授权 + RoleGranted *bool `json:"RoleGranted,omitnil,omitempty" name:"RoleGranted"` + + // 是否已开启自动资产同步 + AutoSync *bool `json:"AutoSync,omitnil,omitempty" name:"AutoSync"` +} + +type AssetSyncStatus struct { + // 上一次同步完成的时间 + LastTime *string `json:"LastTime,omitnil,omitempty" name:"LastTime"` + + // 上一次同步的结果。 0 - 从未进行, 1 - 成功, 2 - 失败 + LastStatus *uint64 `json:"LastStatus,omitnil,omitempty" name:"LastStatus"` + + // 同步任务是否正在进行中 + InProcess *bool `json:"InProcess,omitnil,omitempty" name:"InProcess"` + + // 任务错误消息 + ErrMsg *string `json:"ErrMsg,omitnil,omitempty" name:"ErrMsg"` +} + +type AuthModeSetting struct { + // 双因子认证,0-不开启,1-OTP,2-短信 + AuthMode *uint64 `json:"AuthMode,omitnil,omitempty" name:"AuthMode"` +} + +// Predefined struct for user +type BindDeviceAccountPasswordRequestParams struct { + // 主机账号ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 主机账号密码 + Password *string `json:"Password,omitnil,omitempty" name:"Password"` +} + +type BindDeviceAccountPasswordRequest struct { + *tchttp.BaseRequest + + // 主机账号ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 主机账号密码 + Password *string `json:"Password,omitnil,omitempty" name:"Password"` +} + +func (r *BindDeviceAccountPasswordRequest) 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 *BindDeviceAccountPasswordRequest) 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, "Password") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "BindDeviceAccountPasswordRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type BindDeviceAccountPasswordResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type BindDeviceAccountPasswordResponse struct { + *tchttp.BaseResponse + Response *BindDeviceAccountPasswordResponseParams `json:"Response"` +} + +func (r *BindDeviceAccountPasswordResponse) 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 *BindDeviceAccountPasswordResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type BindDeviceAccountPrivateKeyRequestParams struct { + // 主机账号ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 主机账号私钥,最小长度128字节,最大长度8192字节 + PrivateKey *string `json:"PrivateKey,omitnil,omitempty" name:"PrivateKey"` + + // 主机账号私钥口令,最大长度256字节 + PrivateKeyPassword *string `json:"PrivateKeyPassword,omitnil,omitempty" name:"PrivateKeyPassword"` +} + +type BindDeviceAccountPrivateKeyRequest struct { + *tchttp.BaseRequest + + // 主机账号ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 主机账号私钥,最小长度128字节,最大长度8192字节 + PrivateKey *string `json:"PrivateKey,omitnil,omitempty" name:"PrivateKey"` + + // 主机账号私钥口令,最大长度256字节 + PrivateKeyPassword *string `json:"PrivateKeyPassword,omitnil,omitempty" name:"PrivateKeyPassword"` +} + +func (r *BindDeviceAccountPrivateKeyRequest) 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 *BindDeviceAccountPrivateKeyRequest) 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, "PrivateKey") + delete(f, "PrivateKeyPassword") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "BindDeviceAccountPrivateKeyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type BindDeviceAccountPrivateKeyResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type BindDeviceAccountPrivateKeyResponse struct { + *tchttp.BaseResponse + Response *BindDeviceAccountPrivateKeyResponseParams `json:"Response"` +} + +func (r *BindDeviceAccountPrivateKeyResponse) 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 *BindDeviceAccountPrivateKeyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type BindDeviceResourceRequestParams struct { + // 资产ID集合 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 堡垒机服务ID + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // 网络域ID + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` + + // K8S集群托管账号维度。1-集群,2-命名空间,3-工作负载 + ManageDimension *uint64 `json:"ManageDimension,omitnil,omitempty" name:"ManageDimension"` + + // K8S集群托管账号id + ManageAccountId *int64 `json:"ManageAccountId,omitnil,omitempty" name:"ManageAccountId"` + + // K8S集群托管账号名称 + ManageAccount *string `json:"ManageAccount,omitnil,omitempty" name:"ManageAccount"` + + // K8S集群托管账号凭证 + ManageKubeconfig *string `json:"ManageKubeconfig,omitnil,omitempty" name:"ManageKubeconfig"` + + // K8S集群托管的namespace + Namespace *string `json:"Namespace,omitnil,omitempty" name:"Namespace"` + + // K8S集群托管的workload + Workload *string `json:"Workload,omitnil,omitempty" name:"Workload"` +} + +type BindDeviceResourceRequest struct { + *tchttp.BaseRequest + + // 资产ID集合 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 堡垒机服务ID + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // 网络域ID + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` + + // K8S集群托管账号维度。1-集群,2-命名空间,3-工作负载 + ManageDimension *uint64 `json:"ManageDimension,omitnil,omitempty" name:"ManageDimension"` + + // K8S集群托管账号id + ManageAccountId *int64 `json:"ManageAccountId,omitnil,omitempty" name:"ManageAccountId"` + + // K8S集群托管账号名称 + ManageAccount *string `json:"ManageAccount,omitnil,omitempty" name:"ManageAccount"` + + // K8S集群托管账号凭证 + ManageKubeconfig *string `json:"ManageKubeconfig,omitnil,omitempty" name:"ManageKubeconfig"` + + // K8S集群托管的namespace + Namespace *string `json:"Namespace,omitnil,omitempty" name:"Namespace"` + + // K8S集群托管的workload + Workload *string `json:"Workload,omitnil,omitempty" name:"Workload"` +} + +func (r *BindDeviceResourceRequest) 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 *BindDeviceResourceRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DeviceIdSet") + delete(f, "ResourceId") + delete(f, "DomainId") + delete(f, "ManageDimension") + delete(f, "ManageAccountId") + delete(f, "ManageAccount") + delete(f, "ManageKubeconfig") + delete(f, "Namespace") + delete(f, "Workload") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "BindDeviceResourceRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type BindDeviceResourceResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type BindDeviceResourceResponse struct { + *tchttp.BaseResponse + Response *BindDeviceResourceResponseParams `json:"Response"` +} + +func (r *BindDeviceResourceResponse) 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 *BindDeviceResourceResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type ChangePwdTaskDetail struct { + // 资产信息 + Device *Device `json:"Device,omitnil,omitempty" name:"Device"` + + // 资产账号 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 上次改密结果。0-未改密 1-改密成功 2-改密失败 + LastChangeStatus *uint64 `json:"LastChangeStatus,omitnil,omitempty" name:"LastChangeStatus"` +} + +type ChangePwdTaskInfo struct { + // id + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 任务id + OperationId *string `json:"OperationId,omitnil,omitempty" name:"OperationId"` + + // 任务名 + TaskName *string `json:"TaskName,omitnil,omitempty" name:"TaskName"` + + // 所属部门信息 + Department *Department `json:"Department,omitnil,omitempty" name:"Department"` + + // 改密方式。1:使用执行账号。2:修改自身密码 + ChangeMethod *uint64 `json:"ChangeMethod,omitnil,omitempty" name:"ChangeMethod"` + + // 执行账号 + RunAccount *string `json:"RunAccount,omitnil,omitempty" name:"RunAccount"` + + // 密码生成策略 + AuthGenerationStrategy *uint64 `json:"AuthGenerationStrategy,omitnil,omitempty" name:"AuthGenerationStrategy"` + + // 密码长度 + PasswordLength *uint64 `json:"PasswordLength,omitnil,omitempty" name:"PasswordLength"` + + // 包含小写字母 + SmallLetter *uint64 `json:"SmallLetter,omitnil,omitempty" name:"SmallLetter"` + + // 包含大写字母 + BigLetter *uint64 `json:"BigLetter,omitnil,omitempty" name:"BigLetter"` + + // 包含数字 + Digit *uint64 `json:"Digit,omitnil,omitempty" name:"Digit"` + + // 包含的特殊字符,入参base64 + Symbol *string `json:"Symbol,omitnil,omitempty" name:"Symbol"` + + // 改密完成通知。0-通知,1-不通知 + CompleteNotify *uint64 `json:"CompleteNotify,omitnil,omitempty" name:"CompleteNotify"` + + // 通知人邮箱 + NotifyEmails []*string `json:"NotifyEmails,omitnil,omitempty" name:"NotifyEmails"` + + // 加密附件密码 + FilePassword *string `json:"FilePassword,omitnil,omitempty" name:"FilePassword"` + + // 需要改密的账户 + AccountSet []*string `json:"AccountSet,omitnil,omitempty" name:"AccountSet"` + + // 需要改密的主机 + DeviceSet []*Device `json:"DeviceSet,omitnil,omitempty" name:"DeviceSet"` + + // 任务类型:4手动,5自动 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 周期 + Period *uint64 `json:"Period,omitnil,omitempty" name:"Period"` + + // 首次执行时间 + FirstTime *string `json:"FirstTime,omitnil,omitempty" name:"FirstTime"` + + // 下次执行时间 + NextTime *string `json:"NextTime,omitnil,omitempty" name:"NextTime"` + + // 上次执行时间 + LastTime *string `json:"LastTime,omitnil,omitempty" name:"LastTime"` +} + +// Predefined struct for user +type CheckLDAPConnectionRequestParams struct { + // 是否开启LDAP认证,必须为true + Enable *bool `json:"Enable,omitnil,omitempty" name:"Enable"` + + // 服务器地址 + Ip *string `json:"Ip,omitnil,omitempty" name:"Ip"` + + // 服务端口 + Port *uint64 `json:"Port,omitnil,omitempty" name:"Port"` + + // 是否开启SSL,false-不开启,true-开启 + EnableSSL *bool `json:"EnableSSL,omitnil,omitempty" name:"EnableSSL"` + + // Base DN + BaseDN *string `json:"BaseDN,omitnil,omitempty" name:"BaseDN"` + + // 管理员账号 + AdminAccount *string `json:"AdminAccount,omitnil,omitempty" name:"AdminAccount"` + + // 管理员密码 + AdminPassword *string `json:"AdminPassword,omitnil,omitempty" name:"AdminPassword"` + + // 备用服务器地址 + IpBackup *string `json:"IpBackup,omitnil,omitempty" name:"IpBackup"` + + // 网络域id + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` + + // 用户名称映射属性 + AttributeUserName *string `json:"AttributeUserName,omitnil,omitempty" name:"AttributeUserName"` +} + +type CheckLDAPConnectionRequest struct { + *tchttp.BaseRequest + + // 是否开启LDAP认证,必须为true + Enable *bool `json:"Enable,omitnil,omitempty" name:"Enable"` + + // 服务器地址 + Ip *string `json:"Ip,omitnil,omitempty" name:"Ip"` + + // 服务端口 + Port *uint64 `json:"Port,omitnil,omitempty" name:"Port"` + + // 是否开启SSL,false-不开启,true-开启 + EnableSSL *bool `json:"EnableSSL,omitnil,omitempty" name:"EnableSSL"` + + // Base DN + BaseDN *string `json:"BaseDN,omitnil,omitempty" name:"BaseDN"` + + // 管理员账号 + AdminAccount *string `json:"AdminAccount,omitnil,omitempty" name:"AdminAccount"` + + // 管理员密码 + AdminPassword *string `json:"AdminPassword,omitnil,omitempty" name:"AdminPassword"` + + // 备用服务器地址 + IpBackup *string `json:"IpBackup,omitnil,omitempty" name:"IpBackup"` + + // 网络域id + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` + + // 用户名称映射属性 + AttributeUserName *string `json:"AttributeUserName,omitnil,omitempty" name:"AttributeUserName"` +} + +func (r *CheckLDAPConnectionRequest) 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 *CheckLDAPConnectionRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Enable") + delete(f, "Ip") + delete(f, "Port") + delete(f, "EnableSSL") + delete(f, "BaseDN") + delete(f, "AdminAccount") + delete(f, "AdminPassword") + delete(f, "IpBackup") + delete(f, "DomainId") + delete(f, "AttributeUserName") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CheckLDAPConnectionRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CheckLDAPConnectionResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CheckLDAPConnectionResponse struct { + *tchttp.BaseResponse + Response *CheckLDAPConnectionResponseParams `json:"Response"` +} + +func (r *CheckLDAPConnectionResponse) 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 *CheckLDAPConnectionResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type Clb struct { + // 负载均衡IP + ClbIp *string `json:"ClbIp,omitnil,omitempty" name:"ClbIp"` +} + +type CmdTemplate struct { + // 高危命令模板ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 高危命令模板名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 命令列表,命令之间用换行符("\n")分隔 + CmdList *string `json:"CmdList,omitnil,omitempty" name:"CmdList"` + + // 命令模板类型 1-内置 2-自定义 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` +} + +type Command struct { + // 命令 + Cmd *string `json:"Cmd,omitnil,omitempty" name:"Cmd"` + + // 命令输入的时间 + Time *string `json:"Time,omitnil,omitempty" name:"Time"` + + // 命令执行时间相对于所属会话开始时间的偏移量,单位ms + TimeOffset *uint64 `json:"TimeOffset,omitnil,omitempty" name:"TimeOffset"` + + // 命令执行情况,1--允许,2--拒绝,3--确认 + Action *int64 `json:"Action,omitnil,omitempty" name:"Action"` + + // 会话id + Sid *string `json:"Sid,omitnil,omitempty" name:"Sid"` + + // 用户名 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 设备account + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 设备ip + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // source ip + FromIp *string `json:"FromIp,omitnil,omitempty" name:"FromIp"` + + // 该命令所属会话的会话开始时间 + SessTime *string `json:"SessTime,omitnil,omitempty" name:"SessTime"` + + // 该命令所属会话的会话开始时间 + SessionTime *string `json:"SessionTime,omitnil,omitempty" name:"SessionTime"` + + // 复核时间 + ConfirmTime *string `json:"ConfirmTime,omitnil,omitempty" name:"ConfirmTime"` + + // 用户部门id + UserDepartmentId *string `json:"UserDepartmentId,omitnil,omitempty" name:"UserDepartmentId"` + + // 用户部门name + UserDepartmentName *string `json:"UserDepartmentName,omitnil,omitempty" name:"UserDepartmentName"` + + // 设备部门id + DeviceDepartmentId *string `json:"DeviceDepartmentId,omitnil,omitempty" name:"DeviceDepartmentId"` + + // 设备部门name + DeviceDepartmentName *string `json:"DeviceDepartmentName,omitnil,omitempty" name:"DeviceDepartmentName"` + + // 会话大小 + Size *uint64 `json:"Size,omitnil,omitempty" name:"Size"` + + // 签名值 + SignValue *string `json:"SignValue,omitnil,omitempty" name:"SignValue"` + + // 资产类型 + DeviceKind *string `json:"DeviceKind,omitnil,omitempty" name:"DeviceKind"` +} + +// Predefined struct for user +type CreateAccessWhiteListRuleRequestParams struct { + // ip 10.10.10.1或者网段10.10.10.0/24,最小长度4字节,最大长度40字节。 + Source *string `json:"Source,omitnil,omitempty" name:"Source"` + + // 备注信息,最小长度0字符,最大长度40字符。 + Remark *string `json:"Remark,omitnil,omitempty" name:"Remark"` +} + +type CreateAccessWhiteListRuleRequest struct { + *tchttp.BaseRequest + + // ip 10.10.10.1或者网段10.10.10.0/24,最小长度4字节,最大长度40字节。 + Source *string `json:"Source,omitnil,omitempty" name:"Source"` + + // 备注信息,最小长度0字符,最大长度40字符。 + Remark *string `json:"Remark,omitnil,omitempty" name:"Remark"` +} + +func (r *CreateAccessWhiteListRuleRequest) 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 *CreateAccessWhiteListRuleRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Source") + delete(f, "Remark") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateAccessWhiteListRuleRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateAccessWhiteListRuleResponseParams struct { + // 新建成功后返回的记录ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateAccessWhiteListRuleResponse struct { + *tchttp.BaseResponse + Response *CreateAccessWhiteListRuleResponseParams `json:"Response"` +} + +func (r *CreateAccessWhiteListRuleResponse) 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 *CreateAccessWhiteListRuleResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateAclRequestParams struct { + // 权限名称,最大32字符,不能包含空白字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 是否开启磁盘映射 + AllowDiskRedirect *bool `json:"AllowDiskRedirect,omitnil,omitempty" name:"AllowDiskRedirect"` + + // 是否允许任意账号登录 + AllowAnyAccount *bool `json:"AllowAnyAccount,omitnil,omitempty" name:"AllowAnyAccount"` + + // 是否开启剪贴板文件上行 + AllowClipFileUp *bool `json:"AllowClipFileUp,omitnil,omitempty" name:"AllowClipFileUp"` + + // 是否开启剪贴板文件下行 + AllowClipFileDown *bool `json:"AllowClipFileDown,omitnil,omitempty" name:"AllowClipFileDown"` + + // 是否开启剪贴板文本(含图片)上行 + AllowClipTextUp *bool `json:"AllowClipTextUp,omitnil,omitempty" name:"AllowClipTextUp"` + + // 是否开启剪贴板文本(含图片)下行 + AllowClipTextDown *bool `json:"AllowClipTextDown,omitnil,omitempty" name:"AllowClipTextDown"` + + // 是否开启 SFTP 文件上传 + AllowFileUp *bool `json:"AllowFileUp,omitnil,omitempty" name:"AllowFileUp"` + + // 文件传输上传大小限制(预留参数,目前暂未使用) + MaxFileUpSize *uint64 `json:"MaxFileUpSize,omitnil,omitempty" name:"MaxFileUpSize"` + + // 是否开启 SFTP 文件下载 + AllowFileDown *bool `json:"AllowFileDown,omitnil,omitempty" name:"AllowFileDown"` + + // 文件传输下载大小限制(预留参数,目前暂未使用) + MaxFileDownSize *uint64 `json:"MaxFileDownSize,omitnil,omitempty" name:"MaxFileDownSize"` + + // 关联的用户ID集合 + UserIdSet []*uint64 `json:"UserIdSet,omitnil,omitempty" name:"UserIdSet"` + + // 关联的用户组ID + UserGroupIdSet []*uint64 `json:"UserGroupIdSet,omitnil,omitempty" name:"UserGroupIdSet"` + + // 关联的资产ID集合 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 关联的应用资产ID集合 + AppAssetIdSet []*uint64 `json:"AppAssetIdSet,omitnil,omitempty" name:"AppAssetIdSet"` + + // 关联的资产组ID + DeviceGroupIdSet []*uint64 `json:"DeviceGroupIdSet,omitnil,omitempty" name:"DeviceGroupIdSet"` + + // 关联的账号 + AccountSet []*string `json:"AccountSet,omitnil,omitempty" name:"AccountSet"` + + // 关联的高危命令模板ID + CmdTemplateIdSet []*uint64 `json:"CmdTemplateIdSet,omitnil,omitempty" name:"CmdTemplateIdSet"` + + // 关联高危DB模板ID + ACTemplateIdSet []*string `json:"ACTemplateIdSet,omitnil,omitempty" name:"ACTemplateIdSet"` + + // 是否开启rdp磁盘映射文件上传 + AllowDiskFileUp *bool `json:"AllowDiskFileUp,omitnil,omitempty" name:"AllowDiskFileUp"` + + // 是否开启rdp磁盘映射文件下载 + AllowDiskFileDown *bool `json:"AllowDiskFileDown,omitnil,omitempty" name:"AllowDiskFileDown"` + + // 是否开启rz sz文件上传 + AllowShellFileUp *bool `json:"AllowShellFileUp,omitnil,omitempty" name:"AllowShellFileUp"` + + // 是否开启rz sz文件下载 + AllowShellFileDown *bool `json:"AllowShellFileDown,omitnil,omitempty" name:"AllowShellFileDown"` + + // 是否开启 SFTP 文件删除 + AllowFileDel *bool `json:"AllowFileDel,omitnil,omitempty" name:"AllowFileDel"` + + // 访问权限生效时间,如:"2021-09-22T00:00:00+00:00" + // 生效、失效时间不填则访问权限长期有效 + ValidateFrom *string `json:"ValidateFrom,omitnil,omitempty" name:"ValidateFrom"` + + // 访问权限失效时间,如:"2021-09-23T00:00:00+00:00" + // 生效、失效时间不填则访问权限长期有效 + ValidateTo *string `json:"ValidateTo,omitnil,omitempty" name:"ValidateTo"` + + // 访问权限所属部门的ID + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 是否允许使用访问串,默认允许 + AllowAccessCredential *bool `json:"AllowAccessCredential,omitnil,omitempty" name:"AllowAccessCredential"` + + // 是否允许键盘记录 + AllowKeyboardLogger *bool `json:"AllowKeyboardLogger,omitnil,omitempty" name:"AllowKeyboardLogger"` +} + +type CreateAclRequest struct { + *tchttp.BaseRequest + + // 权限名称,最大32字符,不能包含空白字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 是否开启磁盘映射 + AllowDiskRedirect *bool `json:"AllowDiskRedirect,omitnil,omitempty" name:"AllowDiskRedirect"` + + // 是否允许任意账号登录 + AllowAnyAccount *bool `json:"AllowAnyAccount,omitnil,omitempty" name:"AllowAnyAccount"` + + // 是否开启剪贴板文件上行 + AllowClipFileUp *bool `json:"AllowClipFileUp,omitnil,omitempty" name:"AllowClipFileUp"` + + // 是否开启剪贴板文件下行 + AllowClipFileDown *bool `json:"AllowClipFileDown,omitnil,omitempty" name:"AllowClipFileDown"` + + // 是否开启剪贴板文本(含图片)上行 + AllowClipTextUp *bool `json:"AllowClipTextUp,omitnil,omitempty" name:"AllowClipTextUp"` + + // 是否开启剪贴板文本(含图片)下行 + AllowClipTextDown *bool `json:"AllowClipTextDown,omitnil,omitempty" name:"AllowClipTextDown"` + + // 是否开启 SFTP 文件上传 + AllowFileUp *bool `json:"AllowFileUp,omitnil,omitempty" name:"AllowFileUp"` + + // 文件传输上传大小限制(预留参数,目前暂未使用) + MaxFileUpSize *uint64 `json:"MaxFileUpSize,omitnil,omitempty" name:"MaxFileUpSize"` + + // 是否开启 SFTP 文件下载 + AllowFileDown *bool `json:"AllowFileDown,omitnil,omitempty" name:"AllowFileDown"` + + // 文件传输下载大小限制(预留参数,目前暂未使用) + MaxFileDownSize *uint64 `json:"MaxFileDownSize,omitnil,omitempty" name:"MaxFileDownSize"` + + // 关联的用户ID集合 + UserIdSet []*uint64 `json:"UserIdSet,omitnil,omitempty" name:"UserIdSet"` + + // 关联的用户组ID + UserGroupIdSet []*uint64 `json:"UserGroupIdSet,omitnil,omitempty" name:"UserGroupIdSet"` + + // 关联的资产ID集合 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 关联的应用资产ID集合 + AppAssetIdSet []*uint64 `json:"AppAssetIdSet,omitnil,omitempty" name:"AppAssetIdSet"` + + // 关联的资产组ID + DeviceGroupIdSet []*uint64 `json:"DeviceGroupIdSet,omitnil,omitempty" name:"DeviceGroupIdSet"` + + // 关联的账号 + AccountSet []*string `json:"AccountSet,omitnil,omitempty" name:"AccountSet"` + + // 关联的高危命令模板ID + CmdTemplateIdSet []*uint64 `json:"CmdTemplateIdSet,omitnil,omitempty" name:"CmdTemplateIdSet"` + + // 关联高危DB模板ID + ACTemplateIdSet []*string `json:"ACTemplateIdSet,omitnil,omitempty" name:"ACTemplateIdSet"` + + // 是否开启rdp磁盘映射文件上传 + AllowDiskFileUp *bool `json:"AllowDiskFileUp,omitnil,omitempty" name:"AllowDiskFileUp"` + + // 是否开启rdp磁盘映射文件下载 + AllowDiskFileDown *bool `json:"AllowDiskFileDown,omitnil,omitempty" name:"AllowDiskFileDown"` + + // 是否开启rz sz文件上传 + AllowShellFileUp *bool `json:"AllowShellFileUp,omitnil,omitempty" name:"AllowShellFileUp"` + + // 是否开启rz sz文件下载 + AllowShellFileDown *bool `json:"AllowShellFileDown,omitnil,omitempty" name:"AllowShellFileDown"` + + // 是否开启 SFTP 文件删除 + AllowFileDel *bool `json:"AllowFileDel,omitnil,omitempty" name:"AllowFileDel"` + + // 访问权限生效时间,如:"2021-09-22T00:00:00+00:00" + // 生效、失效时间不填则访问权限长期有效 + ValidateFrom *string `json:"ValidateFrom,omitnil,omitempty" name:"ValidateFrom"` + + // 访问权限失效时间,如:"2021-09-23T00:00:00+00:00" + // 生效、失效时间不填则访问权限长期有效 + ValidateTo *string `json:"ValidateTo,omitnil,omitempty" name:"ValidateTo"` + + // 访问权限所属部门的ID + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 是否允许使用访问串,默认允许 + AllowAccessCredential *bool `json:"AllowAccessCredential,omitnil,omitempty" name:"AllowAccessCredential"` + + // 是否允许键盘记录 + AllowKeyboardLogger *bool `json:"AllowKeyboardLogger,omitnil,omitempty" name:"AllowKeyboardLogger"` +} + +func (r *CreateAclRequest) 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 *CreateAclRequest) 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, "AllowDiskRedirect") + delete(f, "AllowAnyAccount") + delete(f, "AllowClipFileUp") + delete(f, "AllowClipFileDown") + delete(f, "AllowClipTextUp") + delete(f, "AllowClipTextDown") + delete(f, "AllowFileUp") + delete(f, "MaxFileUpSize") + delete(f, "AllowFileDown") + delete(f, "MaxFileDownSize") + delete(f, "UserIdSet") + delete(f, "UserGroupIdSet") + delete(f, "DeviceIdSet") + delete(f, "AppAssetIdSet") + delete(f, "DeviceGroupIdSet") + delete(f, "AccountSet") + delete(f, "CmdTemplateIdSet") + delete(f, "ACTemplateIdSet") + delete(f, "AllowDiskFileUp") + delete(f, "AllowDiskFileDown") + delete(f, "AllowShellFileUp") + delete(f, "AllowShellFileDown") + delete(f, "AllowFileDel") + delete(f, "ValidateFrom") + delete(f, "ValidateTo") + delete(f, "DepartmentId") + delete(f, "AllowAccessCredential") + delete(f, "AllowKeyboardLogger") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateAclRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateAclResponseParams struct { + // 新建成功的访问权限ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateAclResponse struct { + *tchttp.BaseResponse + Response *CreateAclResponseParams `json:"Response"` +} + +func (r *CreateAclResponse) 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 *CreateAclResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateAssetSyncJobRequestParams struct { + // 同步资产类别,1 - 主机资产, 2 - 数据库资产 + Category *uint64 `json:"Category,omitnil,omitempty" name:"Category"` +} + +type CreateAssetSyncJobRequest struct { + *tchttp.BaseRequest + + // 同步资产类别,1 - 主机资产, 2 - 数据库资产 + Category *uint64 `json:"Category,omitnil,omitempty" name:"Category"` +} + +func (r *CreateAssetSyncJobRequest) 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 *CreateAssetSyncJobRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Category") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateAssetSyncJobRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateAssetSyncJobResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateAssetSyncJobResponse struct { + *tchttp.BaseResponse + Response *CreateAssetSyncJobResponseParams `json:"Response"` +} + +func (r *CreateAssetSyncJobResponse) 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 *CreateAssetSyncJobResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateChangePwdTaskRequestParams struct { + // 任务名 + TaskName *string `json:"TaskName,omitnil,omitempty" name:"TaskName"` + + // 资产id数组 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 修改的账户数组 + AccountSet []*string `json:"AccountSet,omitnil,omitempty" name:"AccountSet"` + + // 改密方式。1:使用执行账号修改密码;2:修改自身密码 + ChangeMethod *int64 `json:"ChangeMethod,omitnil,omitempty" name:"ChangeMethod"` + + // 认证生成方式。 1:自动生成相同密码 2:自动生成不同密码 3:手动指定相同密码 + AuthGenerationStrategy *int64 `json:"AuthGenerationStrategy,omitnil,omitempty" name:"AuthGenerationStrategy"` + + // 执行账号 + RunAccount *string `json:"RunAccount,omitnil,omitempty" name:"RunAccount"` + + // 手动指定密码时必传 + Password *string `json:"Password,omitnil,omitempty" name:"Password"` + + // 密码限制长度,长度大于 12 位 + PasswordLength *int64 `json:"PasswordLength,omitnil,omitempty" name:"PasswordLength"` + + // 密码包含小写字母。0:否,1:是 + SmallLetter *int64 `json:"SmallLetter,omitnil,omitempty" name:"SmallLetter"` + + // 密码包含大写字母。0:否,1:是 + BigLetter *int64 `json:"BigLetter,omitnil,omitempty" name:"BigLetter"` + + // 密码包含数字。0:否,1:是 + Digit *int64 `json:"Digit,omitnil,omitempty" name:"Digit"` + + // 密码包含的特殊字符(base64编码),包含:^[-_#();%~!+=]*$ + Symbol *string `json:"Symbol,omitnil,omitempty" name:"Symbol"` + + // 改密完成通知。0:不通知 + // 1:通知 + CompleteNotify *int64 `json:"CompleteNotify,omitnil,omitempty" name:"CompleteNotify"` + + // 通知邮箱 + NotifyEmails []*string `json:"NotifyEmails,omitnil,omitempty" name:"NotifyEmails"` + + // 加密压缩文件密码 + FilePassword *string `json:"FilePassword,omitnil,omitempty" name:"FilePassword"` + + // 所属部门id。“1.2.3” + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 任务类型 4-手工执行 5-周期自动执行 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 执行周期,单位天(大于等于 1,小于等于 365) + Period *uint64 `json:"Period,omitnil,omitempty" name:"Period"` + + // 周期任务首次执行时间 + FirstTime *string `json:"FirstTime,omitnil,omitempty" name:"FirstTime"` +} + +type CreateChangePwdTaskRequest struct { + *tchttp.BaseRequest + + // 任务名 + TaskName *string `json:"TaskName,omitnil,omitempty" name:"TaskName"` + + // 资产id数组 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 修改的账户数组 + AccountSet []*string `json:"AccountSet,omitnil,omitempty" name:"AccountSet"` + + // 改密方式。1:使用执行账号修改密码;2:修改自身密码 + ChangeMethod *int64 `json:"ChangeMethod,omitnil,omitempty" name:"ChangeMethod"` + + // 认证生成方式。 1:自动生成相同密码 2:自动生成不同密码 3:手动指定相同密码 + AuthGenerationStrategy *int64 `json:"AuthGenerationStrategy,omitnil,omitempty" name:"AuthGenerationStrategy"` + + // 执行账号 + RunAccount *string `json:"RunAccount,omitnil,omitempty" name:"RunAccount"` + + // 手动指定密码时必传 + Password *string `json:"Password,omitnil,omitempty" name:"Password"` + + // 密码限制长度,长度大于 12 位 + PasswordLength *int64 `json:"PasswordLength,omitnil,omitempty" name:"PasswordLength"` + + // 密码包含小写字母。0:否,1:是 + SmallLetter *int64 `json:"SmallLetter,omitnil,omitempty" name:"SmallLetter"` + + // 密码包含大写字母。0:否,1:是 + BigLetter *int64 `json:"BigLetter,omitnil,omitempty" name:"BigLetter"` + + // 密码包含数字。0:否,1:是 + Digit *int64 `json:"Digit,omitnil,omitempty" name:"Digit"` + + // 密码包含的特殊字符(base64编码),包含:^[-_#();%~!+=]*$ + Symbol *string `json:"Symbol,omitnil,omitempty" name:"Symbol"` + + // 改密完成通知。0:不通知 + // 1:通知 + CompleteNotify *int64 `json:"CompleteNotify,omitnil,omitempty" name:"CompleteNotify"` + + // 通知邮箱 + NotifyEmails []*string `json:"NotifyEmails,omitnil,omitempty" name:"NotifyEmails"` + + // 加密压缩文件密码 + FilePassword *string `json:"FilePassword,omitnil,omitempty" name:"FilePassword"` + + // 所属部门id。“1.2.3” + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 任务类型 4-手工执行 5-周期自动执行 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 执行周期,单位天(大于等于 1,小于等于 365) + Period *uint64 `json:"Period,omitnil,omitempty" name:"Period"` + + // 周期任务首次执行时间 + FirstTime *string `json:"FirstTime,omitnil,omitempty" name:"FirstTime"` +} + +func (r *CreateChangePwdTaskRequest) 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 *CreateChangePwdTaskRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "TaskName") + delete(f, "DeviceIdSet") + delete(f, "AccountSet") + delete(f, "ChangeMethod") + delete(f, "AuthGenerationStrategy") + delete(f, "RunAccount") + delete(f, "Password") + delete(f, "PasswordLength") + delete(f, "SmallLetter") + delete(f, "BigLetter") + delete(f, "Digit") + delete(f, "Symbol") + delete(f, "CompleteNotify") + delete(f, "NotifyEmails") + delete(f, "FilePassword") + delete(f, "DepartmentId") + delete(f, "Type") + delete(f, "Period") + delete(f, "FirstTime") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateChangePwdTaskRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateChangePwdTaskResponseParams struct { + // 任务id + OperationId *string `json:"OperationId,omitnil,omitempty" name:"OperationId"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateChangePwdTaskResponse struct { + *tchttp.BaseResponse + Response *CreateChangePwdTaskResponseParams `json:"Response"` +} + +func (r *CreateChangePwdTaskResponse) 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 *CreateChangePwdTaskResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateCmdTemplateRequestParams struct { + // 模板名,最大长度32字符,不能包含空白字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 命令列表,\n分隔,最大长度32768字节 + CmdList *string `json:"CmdList,omitnil,omitempty" name:"CmdList"` + + // 标识CmdList字段前端是否为base64加密传值.0:表示非base64加密1:表示是base64加密 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` +} + +type CreateCmdTemplateRequest struct { + *tchttp.BaseRequest + + // 模板名,最大长度32字符,不能包含空白字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 命令列表,\n分隔,最大长度32768字节 + CmdList *string `json:"CmdList,omitnil,omitempty" name:"CmdList"` + + // 标识CmdList字段前端是否为base64加密传值.0:表示非base64加密1:表示是base64加密 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` +} + +func (r *CreateCmdTemplateRequest) 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 *CreateCmdTemplateRequest) 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, "CmdList") + delete(f, "Encoding") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateCmdTemplateRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateCmdTemplateResponseParams struct { + // 新建成功后返回的记录ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateCmdTemplateResponse struct { + *tchttp.BaseResponse + Response *CreateCmdTemplateResponseParams `json:"Response"` +} + +func (r *CreateCmdTemplateResponse) 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 *CreateCmdTemplateResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateDeviceAccountRequestParams struct { + // 主机记录ID + DeviceId *uint64 `json:"DeviceId,omitnil,omitempty" name:"DeviceId"` + + // 账号名 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` +} + +type CreateDeviceAccountRequest struct { + *tchttp.BaseRequest + + // 主机记录ID + DeviceId *uint64 `json:"DeviceId,omitnil,omitempty" name:"DeviceId"` + + // 账号名 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` +} + +func (r *CreateDeviceAccountRequest) 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 *CreateDeviceAccountRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DeviceId") + delete(f, "Account") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDeviceAccountRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateDeviceAccountResponseParams struct { + // 新建成功后返回的记录ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateDeviceAccountResponse struct { + *tchttp.BaseResponse + Response *CreateDeviceAccountResponseParams `json:"Response"` +} + +func (r *CreateDeviceAccountResponse) 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 *CreateDeviceAccountResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateDeviceGroupRequestParams struct { + // 资产组名,最大长度32字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 资产组所属部门ID,如:1.2.3 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +type CreateDeviceGroupRequest struct { + *tchttp.BaseRequest + + // 资产组名,最大长度32字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 资产组所属部门ID,如:1.2.3 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +func (r *CreateDeviceGroupRequest) 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 *CreateDeviceGroupRequest) 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, "DepartmentId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateDeviceGroupRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateDeviceGroupResponseParams struct { + // 新建成功的资产组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateDeviceGroupResponse struct { + *tchttp.BaseResponse + Response *CreateDeviceGroupResponseParams `json:"Response"` +} + +func (r *CreateDeviceGroupResponse) 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 *CreateDeviceGroupResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateOperationTaskRequestParams struct { + // 运维任务名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 运维任务类型,1 - 手工执行, 2 - 周期性自动执行 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 执行账号 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 超时时间,单位秒 + Timeout *uint64 `json:"Timeout,omitnil,omitempty" name:"Timeout"` + + // 执行脚本内容 + Script *string `json:"Script,omitnil,omitempty" name:"Script"` + + // 执行主机集合,满足条件以下三个条件:1. 资产绑定可用的专业版或国密版堡垒机服务;2、资产类型为linux资产;3、用户具有资产权限,且资产添加了指定执行账号 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 执行间隔,单位天. 手工执行时无需传入 + Period *uint64 `json:"Period,omitnil,omitempty" name:"Period"` + + // 首次执行日期 默认1970-01-01T08:00:01+08:00,手工执行时无需传入 + FirstTime *string `json:"FirstTime,omitnil,omitempty" name:"FirstTime"` + + // Script参数是否需要进行base64编码后传递,1-需要进行base64编码后传递,非1值-不需要进行base64编码后传递 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` +} + +type CreateOperationTaskRequest struct { + *tchttp.BaseRequest + + // 运维任务名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 运维任务类型,1 - 手工执行, 2 - 周期性自动执行 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 执行账号 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 超时时间,单位秒 + Timeout *uint64 `json:"Timeout,omitnil,omitempty" name:"Timeout"` + + // 执行脚本内容 + Script *string `json:"Script,omitnil,omitempty" name:"Script"` + + // 执行主机集合,满足条件以下三个条件:1. 资产绑定可用的专业版或国密版堡垒机服务;2、资产类型为linux资产;3、用户具有资产权限,且资产添加了指定执行账号 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 执行间隔,单位天. 手工执行时无需传入 + Period *uint64 `json:"Period,omitnil,omitempty" name:"Period"` + + // 首次执行日期 默认1970-01-01T08:00:01+08:00,手工执行时无需传入 + FirstTime *string `json:"FirstTime,omitnil,omitempty" name:"FirstTime"` + + // Script参数是否需要进行base64编码后传递,1-需要进行base64编码后传递,非1值-不需要进行base64编码后传递 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` +} + +func (r *CreateOperationTaskRequest) 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 *CreateOperationTaskRequest) 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, "Type") + delete(f, "Account") + delete(f, "Timeout") + delete(f, "Script") + delete(f, "DeviceIdSet") + delete(f, "Period") + delete(f, "FirstTime") + delete(f, "Encoding") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateOperationTaskRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateOperationTaskResponseParams struct { + // 运维任务ID + TaskId *uint64 `json:"TaskId,omitnil,omitempty" name:"TaskId"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateOperationTaskResponse struct { + *tchttp.BaseResponse + Response *CreateOperationTaskResponseParams `json:"Response"` +} + +func (r *CreateOperationTaskResponse) 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 *CreateOperationTaskResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateResourceRequestParams struct { + // 部署region + DeployRegion *string `json:"DeployRegion,omitnil,omitempty" name:"DeployRegion"` + + // 部署堡垒机的VpcId + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // 部署堡垒机的SubnetId + SubnetId *string `json:"SubnetId,omitnil,omitempty" name:"SubnetId"` + + // 资源类型。取值:standard/pro + ResourceEdition *string `json:"ResourceEdition,omitnil,omitempty" name:"ResourceEdition"` + + // 资源节点数 + ResourceNode *int64 `json:"ResourceNode,omitnil,omitempty" name:"ResourceNode"` + + // 计费周期 + TimeUnit *string `json:"TimeUnit,omitnil,omitempty" name:"TimeUnit"` + + // 计费时长 + TimeSpan *int64 `json:"TimeSpan,omitnil,omitempty" name:"TimeSpan"` + + // 计费模式 1预付费 + PayMode *int64 `json:"PayMode,omitnil,omitempty" name:"PayMode"` + + // 自动续费 + AutoRenewFlag *int64 `json:"AutoRenewFlag,omitnil,omitempty" name:"AutoRenewFlag"` + + // 部署zone + DeployZone *string `json:"DeployZone,omitnil,omitempty" name:"DeployZone"` + + // 0非试用版,1试用版 + Trial *uint64 `json:"Trial,omitnil,omitempty" name:"Trial"` + + // 是否共享clb,0:不共享,1:共享 + ShareClb *uint64 `json:"ShareClb,omitnil,omitempty" name:"ShareClb"` +} + +type CreateResourceRequest struct { + *tchttp.BaseRequest + + // 部署region + DeployRegion *string `json:"DeployRegion,omitnil,omitempty" name:"DeployRegion"` + + // 部署堡垒机的VpcId + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // 部署堡垒机的SubnetId + SubnetId *string `json:"SubnetId,omitnil,omitempty" name:"SubnetId"` + + // 资源类型。取值:standard/pro + ResourceEdition *string `json:"ResourceEdition,omitnil,omitempty" name:"ResourceEdition"` + + // 资源节点数 + ResourceNode *int64 `json:"ResourceNode,omitnil,omitempty" name:"ResourceNode"` + + // 计费周期 + TimeUnit *string `json:"TimeUnit,omitnil,omitempty" name:"TimeUnit"` + + // 计费时长 + TimeSpan *int64 `json:"TimeSpan,omitnil,omitempty" name:"TimeSpan"` + + // 计费模式 1预付费 + PayMode *int64 `json:"PayMode,omitnil,omitempty" name:"PayMode"` + + // 自动续费 + AutoRenewFlag *int64 `json:"AutoRenewFlag,omitnil,omitempty" name:"AutoRenewFlag"` + + // 部署zone + DeployZone *string `json:"DeployZone,omitnil,omitempty" name:"DeployZone"` + + // 0非试用版,1试用版 + Trial *uint64 `json:"Trial,omitnil,omitempty" name:"Trial"` + + // 是否共享clb,0:不共享,1:共享 + ShareClb *uint64 `json:"ShareClb,omitnil,omitempty" name:"ShareClb"` +} + +func (r *CreateResourceRequest) 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 *CreateResourceRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DeployRegion") + delete(f, "VpcId") + delete(f, "SubnetId") + delete(f, "ResourceEdition") + delete(f, "ResourceNode") + delete(f, "TimeUnit") + delete(f, "TimeSpan") + delete(f, "PayMode") + delete(f, "AutoRenewFlag") + delete(f, "DeployZone") + delete(f, "Trial") + delete(f, "ShareClb") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateResourceRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateResourceResponseParams struct { + // 实例Id + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateResourceResponse struct { + *tchttp.BaseResponse + Response *CreateResourceResponseParams `json:"Response"` +} + +func (r *CreateResourceResponse) 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 *CreateResourceResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateSyncUserTaskRequestParams struct { + // 同步用户类型, 1-同步ioa用户 + UserKind *uint64 `json:"UserKind,omitnil,omitempty" name:"UserKind"` +} + +type CreateSyncUserTaskRequest struct { + *tchttp.BaseRequest + + // 同步用户类型, 1-同步ioa用户 + UserKind *uint64 `json:"UserKind,omitnil,omitempty" name:"UserKind"` +} + +func (r *CreateSyncUserTaskRequest) 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 *CreateSyncUserTaskRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "UserKind") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateSyncUserTaskRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateSyncUserTaskResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateSyncUserTaskResponse struct { + *tchttp.BaseResponse + Response *CreateSyncUserTaskResponseParams `json:"Response"` +} + +func (r *CreateSyncUserTaskResponse) 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 *CreateSyncUserTaskResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateUserDirectoryRequestParams struct { + // 目录id + DirId *uint64 `json:"DirId,omitnil,omitempty" name:"DirId"` + + // 目录名称 + DirName *string `json:"DirName,omitnil,omitempty" name:"DirName"` + + // ioa分组信息 + UserOrgSet []*UserOrg `json:"UserOrgSet,omitnil,omitempty" name:"UserOrgSet"` + + // ioa关联用户源类型 + Source *uint64 `json:"Source,omitnil,omitempty" name:"Source"` + + // ioa关联用户源名称 + SourceName *string `json:"SourceName,omitnil,omitempty" name:"SourceName"` + + // 目录包含用户数 + UserCount *uint64 `json:"UserCount,omitnil,omitempty" name:"UserCount"` +} + +type CreateUserDirectoryRequest struct { + *tchttp.BaseRequest + + // 目录id + DirId *uint64 `json:"DirId,omitnil,omitempty" name:"DirId"` + + // 目录名称 + DirName *string `json:"DirName,omitnil,omitempty" name:"DirName"` + + // ioa分组信息 + UserOrgSet []*UserOrg `json:"UserOrgSet,omitnil,omitempty" name:"UserOrgSet"` + + // ioa关联用户源类型 + Source *uint64 `json:"Source,omitnil,omitempty" name:"Source"` + + // ioa关联用户源名称 + SourceName *string `json:"SourceName,omitnil,omitempty" name:"SourceName"` + + // 目录包含用户数 + UserCount *uint64 `json:"UserCount,omitnil,omitempty" name:"UserCount"` +} + +func (r *CreateUserDirectoryRequest) 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 *CreateUserDirectoryRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DirId") + delete(f, "DirName") + delete(f, "UserOrgSet") + delete(f, "Source") + delete(f, "SourceName") + delete(f, "UserCount") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateUserDirectoryRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateUserDirectoryResponseParams struct { + // 目录Id + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateUserDirectoryResponse struct { + *tchttp.BaseResponse + Response *CreateUserDirectoryResponseParams `json:"Response"` +} + +func (r *CreateUserDirectoryResponse) 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 *CreateUserDirectoryResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateUserGroupRequestParams struct { + // 用户组名,最大长度32字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 用户组所属部门的ID,如:1.2.3 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +type CreateUserGroupRequest struct { + *tchttp.BaseRequest + + // 用户组名,最大长度32字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 用户组所属部门的ID,如:1.2.3 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +func (r *CreateUserGroupRequest) 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 *CreateUserGroupRequest) 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, "DepartmentId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateUserGroupRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateUserGroupResponseParams struct { + // 新建成功的用户组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateUserGroupResponse struct { + *tchttp.BaseResponse + Response *CreateUserGroupResponseParams `json:"Response"` +} + +func (r *CreateUserGroupResponse) 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 *CreateUserGroupResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateUserRequestParams struct { + // 用户名, 3-20个字符, 必须以英文字母开头,且不能包含字母、数字、.、_、-以外的字符 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 用户姓名,最大长度20个字符,不能包含空白字符 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 按照"国家地区代码|手机号"的格式输入,如: "+86|xxxxxxxx"。手机号和邮箱参数至少传一项 + Phone *string `json:"Phone,omitnil,omitempty" name:"Phone"` + + // 电子邮件。手机号和邮箱参数至少传一项 + Email *string `json:"Email,omitnil,omitempty" name:"Email"` + + // 用户生效时间,如:"2021-09-22T00:00:00+00:00" + // 生效、失效时间不填则用户长期有效 + ValidateFrom *string `json:"ValidateFrom,omitnil,omitempty" name:"ValidateFrom"` + + // 用户失效时间,如:"2021-09-23T00:00:00+00:00" + // 生效、失效时间不填则用户长期有效 + ValidateTo *string `json:"ValidateTo,omitnil,omitempty" name:"ValidateTo"` + + // 所属用户组ID集合 + GroupIdSet []*uint64 `json:"GroupIdSet,omitnil,omitempty" name:"GroupIdSet"` + + // 认证方式,0 - 本地, 1 - LDAP, 2 - OAuth 不传则默认为0 + AuthType *uint64 `json:"AuthType,omitnil,omitempty" name:"AuthType"` + + // 访问时间段限制, 由0、1组成的字符串,长度168(7 × 24),代表该用户在一周中允许访问的时间段。字符串中第N个字符代表在一周中的第N个小时, 0 - 代表不允许访问,1 - 代表允许访问 + ValidateTime *string `json:"ValidateTime,omitnil,omitempty" name:"ValidateTime"` + + // 所属部门ID,如:“1.2.3” + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +type CreateUserRequest struct { + *tchttp.BaseRequest + + // 用户名, 3-20个字符, 必须以英文字母开头,且不能包含字母、数字、.、_、-以外的字符 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 用户姓名,最大长度20个字符,不能包含空白字符 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 按照"国家地区代码|手机号"的格式输入,如: "+86|xxxxxxxx"。手机号和邮箱参数至少传一项 + Phone *string `json:"Phone,omitnil,omitempty" name:"Phone"` + + // 电子邮件。手机号和邮箱参数至少传一项 + Email *string `json:"Email,omitnil,omitempty" name:"Email"` + + // 用户生效时间,如:"2021-09-22T00:00:00+00:00" + // 生效、失效时间不填则用户长期有效 + ValidateFrom *string `json:"ValidateFrom,omitnil,omitempty" name:"ValidateFrom"` + + // 用户失效时间,如:"2021-09-23T00:00:00+00:00" + // 生效、失效时间不填则用户长期有效 + ValidateTo *string `json:"ValidateTo,omitnil,omitempty" name:"ValidateTo"` + + // 所属用户组ID集合 + GroupIdSet []*uint64 `json:"GroupIdSet,omitnil,omitempty" name:"GroupIdSet"` + + // 认证方式,0 - 本地, 1 - LDAP, 2 - OAuth 不传则默认为0 + AuthType *uint64 `json:"AuthType,omitnil,omitempty" name:"AuthType"` + + // 访问时间段限制, 由0、1组成的字符串,长度168(7 × 24),代表该用户在一周中允许访问的时间段。字符串中第N个字符代表在一周中的第N个小时, 0 - 代表不允许访问,1 - 代表允许访问 + ValidateTime *string `json:"ValidateTime,omitnil,omitempty" name:"ValidateTime"` + + // 所属部门ID,如:“1.2.3” + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +func (r *CreateUserRequest) 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 *CreateUserRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "UserName") + delete(f, "RealName") + delete(f, "Phone") + delete(f, "Email") + delete(f, "ValidateFrom") + delete(f, "ValidateTo") + delete(f, "GroupIdSet") + delete(f, "AuthType") + delete(f, "ValidateTime") + delete(f, "DepartmentId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateUserRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type CreateUserResponseParams struct { + // 新建用户的ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type CreateUserResponse struct { + *tchttp.BaseResponse + Response *CreateUserResponseParams `json:"Response"` +} + +func (r *CreateUserResponse) 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 *CreateUserResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteAccessWhiteListRulesRequestParams struct { + // 待删除的ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type DeleteAccessWhiteListRulesRequest struct { + *tchttp.BaseRequest + + // 待删除的ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *DeleteAccessWhiteListRulesRequest) 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 *DeleteAccessWhiteListRulesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteAccessWhiteListRulesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteAccessWhiteListRulesResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteAccessWhiteListRulesResponse struct { + *tchttp.BaseResponse + Response *DeleteAccessWhiteListRulesResponseParams `json:"Response"` +} + +func (r *DeleteAccessWhiteListRulesResponse) 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 *DeleteAccessWhiteListRulesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteAclsRequestParams struct { + // 待删除的权限ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type DeleteAclsRequest struct { + *tchttp.BaseRequest + + // 待删除的权限ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *DeleteAclsRequest) 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 *DeleteAclsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteAclsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteAclsResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteAclsResponse struct { + *tchttp.BaseResponse + Response *DeleteAclsResponseParams `json:"Response"` +} + +func (r *DeleteAclsResponse) 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 *DeleteAclsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteChangePwdTaskRequestParams struct { + // 改密任务id列表 + IdSet []*int64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type DeleteChangePwdTaskRequest struct { + *tchttp.BaseRequest + + // 改密任务id列表 + IdSet []*int64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *DeleteChangePwdTaskRequest) 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 *DeleteChangePwdTaskRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteChangePwdTaskRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteChangePwdTaskResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteChangePwdTaskResponse struct { + *tchttp.BaseResponse + Response *DeleteChangePwdTaskResponseParams `json:"Response"` +} + +func (r *DeleteChangePwdTaskResponse) 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 *DeleteChangePwdTaskResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteCmdTemplatesRequestParams struct { + // 待删除的ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type DeleteCmdTemplatesRequest struct { + *tchttp.BaseRequest + + // 待删除的ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *DeleteCmdTemplatesRequest) 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 *DeleteCmdTemplatesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteCmdTemplatesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteCmdTemplatesResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteCmdTemplatesResponse struct { + *tchttp.BaseResponse + Response *DeleteCmdTemplatesResponseParams `json:"Response"` +} + +func (r *DeleteCmdTemplatesResponse) 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 *DeleteCmdTemplatesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteDeviceAccountsRequestParams struct { + // 待删除的ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type DeleteDeviceAccountsRequest struct { + *tchttp.BaseRequest + + // 待删除的ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *DeleteDeviceAccountsRequest) 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 *DeleteDeviceAccountsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDeviceAccountsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteDeviceAccountsResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteDeviceAccountsResponse struct { + *tchttp.BaseResponse + Response *DeleteDeviceAccountsResponseParams `json:"Response"` +} + +func (r *DeleteDeviceAccountsResponse) 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 *DeleteDeviceAccountsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteDeviceGroupMembersRequestParams struct { + // 资产组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 需要删除的资产ID集合 + MemberIdSet []*uint64 `json:"MemberIdSet,omitnil,omitempty" name:"MemberIdSet"` +} + +type DeleteDeviceGroupMembersRequest struct { + *tchttp.BaseRequest + + // 资产组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 需要删除的资产ID集合 + MemberIdSet []*uint64 `json:"MemberIdSet,omitnil,omitempty" name:"MemberIdSet"` +} + +func (r *DeleteDeviceGroupMembersRequest) 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 *DeleteDeviceGroupMembersRequest) 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, "MemberIdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDeviceGroupMembersRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteDeviceGroupMembersResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteDeviceGroupMembersResponse struct { + *tchttp.BaseResponse + Response *DeleteDeviceGroupMembersResponseParams `json:"Response"` +} + +func (r *DeleteDeviceGroupMembersResponse) 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 *DeleteDeviceGroupMembersResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteDeviceGroupsRequestParams struct { + // 待删除的资产组ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type DeleteDeviceGroupsRequest struct { + *tchttp.BaseRequest + + // 待删除的资产组ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *DeleteDeviceGroupsRequest) 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 *DeleteDeviceGroupsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDeviceGroupsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteDeviceGroupsResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteDeviceGroupsResponse struct { + *tchttp.BaseResponse + Response *DeleteDeviceGroupsResponseParams `json:"Response"` +} + +func (r *DeleteDeviceGroupsResponse) 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 *DeleteDeviceGroupsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteDevicesRequestParams struct { + // 待删除的ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type DeleteDevicesRequest struct { + *tchttp.BaseRequest + + // 待删除的ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *DeleteDevicesRequest) 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 *DeleteDevicesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteDevicesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteDevicesResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteDevicesResponse struct { + *tchttp.BaseResponse + Response *DeleteDevicesResponseParams `json:"Response"` +} + +func (r *DeleteDevicesResponse) 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 *DeleteDevicesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteOperationTasksRequestParams struct { + // 运维任务ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type DeleteOperationTasksRequest struct { + *tchttp.BaseRequest + + // 运维任务ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *DeleteOperationTasksRequest) 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 *DeleteOperationTasksRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteOperationTasksRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteOperationTasksResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteOperationTasksResponse struct { + *tchttp.BaseResponse + Response *DeleteOperationTasksResponseParams `json:"Response"` +} + +func (r *DeleteOperationTasksResponse) 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 *DeleteOperationTasksResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteUserDirectoryRequestParams struct { + // 目录id集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type DeleteUserDirectoryRequest struct { + *tchttp.BaseRequest + + // 目录id集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *DeleteUserDirectoryRequest) 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 *DeleteUserDirectoryRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteUserDirectoryRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteUserDirectoryResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteUserDirectoryResponse struct { + *tchttp.BaseResponse + Response *DeleteUserDirectoryResponseParams `json:"Response"` +} + +func (r *DeleteUserDirectoryResponse) 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 *DeleteUserDirectoryResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteUserGroupMembersRequestParams struct { + // 用户组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 需删除的成员用户ID集合 + MemberIdSet []*uint64 `json:"MemberIdSet,omitnil,omitempty" name:"MemberIdSet"` +} + +type DeleteUserGroupMembersRequest struct { + *tchttp.BaseRequest + + // 用户组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 需删除的成员用户ID集合 + MemberIdSet []*uint64 `json:"MemberIdSet,omitnil,omitempty" name:"MemberIdSet"` +} + +func (r *DeleteUserGroupMembersRequest) 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 *DeleteUserGroupMembersRequest) 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, "MemberIdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteUserGroupMembersRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteUserGroupMembersResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteUserGroupMembersResponse struct { + *tchttp.BaseResponse + Response *DeleteUserGroupMembersResponseParams `json:"Response"` +} + +func (r *DeleteUserGroupMembersResponse) 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 *DeleteUserGroupMembersResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteUserGroupsRequestParams struct { + // 待删除的用户组ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type DeleteUserGroupsRequest struct { + *tchttp.BaseRequest + + // 待删除的用户组ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *DeleteUserGroupsRequest) 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 *DeleteUserGroupsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteUserGroupsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteUserGroupsResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteUserGroupsResponse struct { + *tchttp.BaseResponse + Response *DeleteUserGroupsResponseParams `json:"Response"` +} + +func (r *DeleteUserGroupsResponse) 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 *DeleteUserGroupsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteUsersRequestParams struct { + // 待删除的用户ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type DeleteUsersRequest struct { + *tchttp.BaseRequest + + // 待删除的用户ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *DeleteUsersRequest) 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 *DeleteUsersRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeleteUsersRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeleteUsersResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeleteUsersResponse struct { + *tchttp.BaseResponse + Response *DeleteUsersResponseParams `json:"Response"` +} + +func (r *DeleteUsersResponse) 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 *DeleteUsersResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type Department struct { + // 部门ID + Id *string `json:"Id,omitnil,omitempty" name:"Id"` + + // 部门名称,1 - 256个字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 部门管理员账号ID + Managers []*string `json:"Managers,omitnil,omitempty" name:"Managers"` + + // 管理员用户 + ManagerUsers []*DepartmentManagerUser `json:"ManagerUsers,omitnil,omitempty" name:"ManagerUsers"` +} + +type DepartmentManagerUser struct { + // 管理员Id + ManagerId *string `json:"ManagerId,omitnil,omitempty" name:"ManagerId"` + + // 管理员姓名 + ManagerName *string `json:"ManagerName,omitnil,omitempty" name:"ManagerName"` +} + +// Predefined struct for user +type DeployResourceRequestParams struct { + // 需要开通服务的资源ID + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // 需要开通服务的地域 + ApCode *string `json:"ApCode,omitnil,omitempty" name:"ApCode"` + + // 子网所在可用区 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` + + // 需要开通服务的VPC + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // 需要开通服务的子网ID + SubnetId *string `json:"SubnetId,omitnil,omitempty" name:"SubnetId"` + + // 需要开通服务的子网网段 + CidrBlock *string `json:"CidrBlock,omitnil,omitempty" name:"CidrBlock"` + + // 需要开通服务的VPC名称 + VpcName *string `json:"VpcName,omitnil,omitempty" name:"VpcName"` + + // 需要开通服务的VPC对应的网段 + VpcCidrBlock *string `json:"VpcCidrBlock,omitnil,omitempty" name:"VpcCidrBlock"` + + // 需要开通服务的子网名称 + SubnetName *string `json:"SubnetName,omitnil,omitempty" name:"SubnetName"` + + // 需要开通实例所属的CDC集群ID + CdcClusterId *string `json:"CdcClusterId,omitnil,omitempty" name:"CdcClusterId"` + + // 开通堡垒机指定共享的clbId + ShareClbId *string `json:"ShareClbId,omitnil,omitempty" name:"ShareClbId"` + + // 0-关闭web访问堡垒机,1-开启web访问堡垒机 + WebAccess *uint64 `json:"WebAccess,omitnil,omitempty" name:"WebAccess"` + + // 0-关闭客户端访问堡垒机,1-开启客户端访问堡垒机 + ClientAccess *uint64 `json:"ClientAccess,omitnil,omitempty" name:"ClientAccess"` + + // 0-关闭内网访问堡垒机,1-开启内网访问堡垒机 + IntranetAccess *uint64 `json:"IntranetAccess,omitnil,omitempty" name:"IntranetAccess"` + + // 0-关闭公网访问堡垒机,1-开启公网访问堡垒机 + ExternalAccess *uint64 `json:"ExternalAccess,omitnil,omitempty" name:"ExternalAccess"` +} + +type DeployResourceRequest struct { + *tchttp.BaseRequest + + // 需要开通服务的资源ID + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // 需要开通服务的地域 + ApCode *string `json:"ApCode,omitnil,omitempty" name:"ApCode"` + + // 子网所在可用区 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` + + // 需要开通服务的VPC + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // 需要开通服务的子网ID + SubnetId *string `json:"SubnetId,omitnil,omitempty" name:"SubnetId"` + + // 需要开通服务的子网网段 + CidrBlock *string `json:"CidrBlock,omitnil,omitempty" name:"CidrBlock"` + + // 需要开通服务的VPC名称 + VpcName *string `json:"VpcName,omitnil,omitempty" name:"VpcName"` + + // 需要开通服务的VPC对应的网段 + VpcCidrBlock *string `json:"VpcCidrBlock,omitnil,omitempty" name:"VpcCidrBlock"` + + // 需要开通服务的子网名称 + SubnetName *string `json:"SubnetName,omitnil,omitempty" name:"SubnetName"` + + // 需要开通实例所属的CDC集群ID + CdcClusterId *string `json:"CdcClusterId,omitnil,omitempty" name:"CdcClusterId"` + + // 开通堡垒机指定共享的clbId + ShareClbId *string `json:"ShareClbId,omitnil,omitempty" name:"ShareClbId"` + + // 0-关闭web访问堡垒机,1-开启web访问堡垒机 + WebAccess *uint64 `json:"WebAccess,omitnil,omitempty" name:"WebAccess"` + + // 0-关闭客户端访问堡垒机,1-开启客户端访问堡垒机 + ClientAccess *uint64 `json:"ClientAccess,omitnil,omitempty" name:"ClientAccess"` + + // 0-关闭内网访问堡垒机,1-开启内网访问堡垒机 + IntranetAccess *uint64 `json:"IntranetAccess,omitnil,omitempty" name:"IntranetAccess"` + + // 0-关闭公网访问堡垒机,1-开启公网访问堡垒机 + ExternalAccess *uint64 `json:"ExternalAccess,omitnil,omitempty" name:"ExternalAccess"` +} + +func (r *DeployResourceRequest) 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 *DeployResourceRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ResourceId") + delete(f, "ApCode") + delete(f, "Zone") + delete(f, "VpcId") + delete(f, "SubnetId") + delete(f, "CidrBlock") + delete(f, "VpcName") + delete(f, "VpcCidrBlock") + delete(f, "SubnetName") + delete(f, "CdcClusterId") + delete(f, "ShareClbId") + delete(f, "WebAccess") + delete(f, "ClientAccess") + delete(f, "IntranetAccess") + delete(f, "ExternalAccess") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DeployResourceRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DeployResourceResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DeployResourceResponse struct { + *tchttp.BaseResponse + Response *DeployResourceResponseParams `json:"Response"` +} + +func (r *DeployResourceResponse) 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 *DeployResourceResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeAccessWhiteListRulesRequestParams struct { + // 用户ID集合,非必需,如果使用IdSet参数则忽略Name参数 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 来源IP或网段,模糊查询,最大长度64字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type DescribeAccessWhiteListRulesRequest struct { + *tchttp.BaseRequest + + // 用户ID集合,非必需,如果使用IdSet参数则忽略Name参数 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 来源IP或网段,模糊查询,最大长度64字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *DescribeAccessWhiteListRulesRequest) 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 *DescribeAccessWhiteListRulesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + delete(f, "Name") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAccessWhiteListRulesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeAccessWhiteListRulesResponseParams struct { + // 记录总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 访问白名单规则列表 + AccessWhiteListRuleSet []*AccessWhiteListRule `json:"AccessWhiteListRuleSet,omitnil,omitempty" name:"AccessWhiteListRuleSet"` + + // 是否放开全部来源IP,如果为true,TotalCount为0,AccessWhiteListRuleSet为空 + AllowAny *bool `json:"AllowAny,omitnil,omitempty" name:"AllowAny"` + + // 是否开启自动添加来源IP, 如果为true, 在开启访问白名单的情况下将自动添加来源IP + AllowAuto *bool `json:"AllowAuto,omitnil,omitempty" name:"AllowAuto"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeAccessWhiteListRulesResponse struct { + *tchttp.BaseResponse + Response *DescribeAccessWhiteListRulesResponseParams `json:"Response"` +} + +func (r *DescribeAccessWhiteListRulesResponse) 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 *DescribeAccessWhiteListRulesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeAccountGroupsRequestParams struct { + // 是否递归查询,0为不递归,1为递归 + DeepIn *int64 `json:"DeepIn,omitnil,omitempty" name:"DeepIn"` + + // 父账号组ID, 默认0,查询根账号组下所有分组 + ParentId *int64 `json:"ParentId,omitnil,omitempty" name:"ParentId"` + + // 账号组名称,模糊查询 + GroupName *string `json:"GroupName,omitnil,omitempty" name:"GroupName"` + + // 分页查询,每页条数 + PageSize *int64 `json:"PageSize,omitnil,omitempty" name:"PageSize"` + + // 获取第几页的数据 + PageNum *int64 `json:"PageNum,omitnil,omitempty" name:"PageNum"` +} + +type DescribeAccountGroupsRequest struct { + *tchttp.BaseRequest + + // 是否递归查询,0为不递归,1为递归 + DeepIn *int64 `json:"DeepIn,omitnil,omitempty" name:"DeepIn"` + + // 父账号组ID, 默认0,查询根账号组下所有分组 + ParentId *int64 `json:"ParentId,omitnil,omitempty" name:"ParentId"` + + // 账号组名称,模糊查询 + GroupName *string `json:"GroupName,omitnil,omitempty" name:"GroupName"` + + // 分页查询,每页条数 + PageSize *int64 `json:"PageSize,omitnil,omitempty" name:"PageSize"` + + // 获取第几页的数据 + PageNum *int64 `json:"PageNum,omitnil,omitempty" name:"PageNum"` +} + +func (r *DescribeAccountGroupsRequest) 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 *DescribeAccountGroupsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DeepIn") + delete(f, "ParentId") + delete(f, "GroupName") + delete(f, "PageSize") + delete(f, "PageNum") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAccountGroupsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeAccountGroupsResponseParams struct { + // 账号组总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 账号组信息 + AccountGroupSet []*AccountGroup `json:"AccountGroupSet,omitnil,omitempty" name:"AccountGroupSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeAccountGroupsResponse struct { + *tchttp.BaseResponse + Response *DescribeAccountGroupsResponseParams `json:"Response"` +} + +func (r *DescribeAccountGroupsResponse) 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 *DescribeAccountGroupsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeAclsRequestParams struct { + // 访问权限ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 访问权限名称,模糊查询,最长64字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20,最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 是否根据Name进行精确查询,默认值false + Exact *bool `json:"Exact,omitnil,omitempty" name:"Exact"` + + // 有访问权限的用户ID集合 + AuthorizedUserIdSet []*uint64 `json:"AuthorizedUserIdSet,omitnil,omitempty" name:"AuthorizedUserIdSet"` + + // 有访问权限的资产ID集合 + AuthorizedDeviceIdSet []*uint64 `json:"AuthorizedDeviceIdSet,omitnil,omitempty" name:"AuthorizedDeviceIdSet"` + + // 有访问权限的应用资产ID集合 + AuthorizedAppAssetIdSet []*uint64 `json:"AuthorizedAppAssetIdSet,omitnil,omitempty" name:"AuthorizedAppAssetIdSet"` + + // 访问权限状态,1 - 已生效,2 - 未生效,3 - 已过期 + Status *uint64 `json:"Status,omitnil,omitempty" name:"Status"` + + // 访问权限状态,1 - 已生效,2 - 未生效,3 - 已过期 + StatusSet []*uint64 `json:"StatusSet,omitnil,omitempty" name:"StatusSet"` + + // 部门ID,用于过滤属于某个部门的访问权限 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 是否根据AuthorizedDeviceIdSet,对资产账号进行精确匹配,默认false, 设置true时,确保AuthorizedDeviceIdSet只有一个元素 + ExactAccount *bool `json:"ExactAccount,omitnil,omitempty" name:"ExactAccount"` + + // 过滤数组 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` +} + +type DescribeAclsRequest struct { + *tchttp.BaseRequest + + // 访问权限ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 访问权限名称,模糊查询,最长64字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20,最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 是否根据Name进行精确查询,默认值false + Exact *bool `json:"Exact,omitnil,omitempty" name:"Exact"` + + // 有访问权限的用户ID集合 + AuthorizedUserIdSet []*uint64 `json:"AuthorizedUserIdSet,omitnil,omitempty" name:"AuthorizedUserIdSet"` + + // 有访问权限的资产ID集合 + AuthorizedDeviceIdSet []*uint64 `json:"AuthorizedDeviceIdSet,omitnil,omitempty" name:"AuthorizedDeviceIdSet"` + + // 有访问权限的应用资产ID集合 + AuthorizedAppAssetIdSet []*uint64 `json:"AuthorizedAppAssetIdSet,omitnil,omitempty" name:"AuthorizedAppAssetIdSet"` + + // 访问权限状态,1 - 已生效,2 - 未生效,3 - 已过期 + Status *uint64 `json:"Status,omitnil,omitempty" name:"Status"` + + // 访问权限状态,1 - 已生效,2 - 未生效,3 - 已过期 + StatusSet []*uint64 `json:"StatusSet,omitnil,omitempty" name:"StatusSet"` + + // 部门ID,用于过滤属于某个部门的访问权限 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 是否根据AuthorizedDeviceIdSet,对资产账号进行精确匹配,默认false, 设置true时,确保AuthorizedDeviceIdSet只有一个元素 + ExactAccount *bool `json:"ExactAccount,omitnil,omitempty" name:"ExactAccount"` + + // 过滤数组 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` +} + +func (r *DescribeAclsRequest) 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 *DescribeAclsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + delete(f, "Name") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "Exact") + delete(f, "AuthorizedUserIdSet") + delete(f, "AuthorizedDeviceIdSet") + delete(f, "AuthorizedAppAssetIdSet") + delete(f, "Status") + delete(f, "StatusSet") + delete(f, "DepartmentId") + delete(f, "ExactAccount") + delete(f, "Filters") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAclsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeAclsResponseParams struct { + // 访问权限总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 访问权限列表 + AclSet []*Acl `json:"AclSet,omitnil,omitempty" name:"AclSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeAclsResponse struct { + *tchttp.BaseResponse + Response *DescribeAclsResponseParams `json:"Response"` +} + +func (r *DescribeAclsResponse) 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 *DescribeAclsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeAssetSyncFlagRequestParams struct { + +} + +type DescribeAssetSyncFlagRequest struct { + *tchttp.BaseRequest + +} + +func (r *DescribeAssetSyncFlagRequest) 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 *DescribeAssetSyncFlagRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAssetSyncFlagRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeAssetSyncFlagResponseParams struct { + // 资产同步标志 + AssetSyncFlags *AssetSyncFlags `json:"AssetSyncFlags,omitnil,omitempty" name:"AssetSyncFlags"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeAssetSyncFlagResponse struct { + *tchttp.BaseResponse + Response *DescribeAssetSyncFlagResponseParams `json:"Response"` +} + +func (r *DescribeAssetSyncFlagResponse) 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 *DescribeAssetSyncFlagResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeAssetSyncStatusRequestParams struct { + // 查询的资产同步类型。1 -主机资产, 2 - 数据库资产 + Category *uint64 `json:"Category,omitnil,omitempty" name:"Category"` +} + +type DescribeAssetSyncStatusRequest struct { + *tchttp.BaseRequest + + // 查询的资产同步类型。1 -主机资产, 2 - 数据库资产 + Category *uint64 `json:"Category,omitnil,omitempty" name:"Category"` +} + +func (r *DescribeAssetSyncStatusRequest) 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 *DescribeAssetSyncStatusRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Category") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeAssetSyncStatusRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeAssetSyncStatusResponseParams struct { + // 资产同步结果 + Status *AssetSyncStatus `json:"Status,omitnil,omitempty" name:"Status"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeAssetSyncStatusResponse struct { + *tchttp.BaseResponse + Response *DescribeAssetSyncStatusResponseParams `json:"Response"` +} + +func (r *DescribeAssetSyncStatusResponse) 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 *DescribeAssetSyncStatusResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeChangePwdTaskDetailRequestParams struct { + // 改密任务Id + OperationId *string `json:"OperationId,omitnil,omitempty" name:"OperationId"` + + // 所属部门ID,如:“1.2.3” + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 过滤数组,支持:InstanceId 资产ID,DeviceName 资产名称,Ip 内外IP,Account 资产账号,LastChangeStatus 上次改密状态。 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` + + // 分页偏移位置,默认0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目。默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type DescribeChangePwdTaskDetailRequest struct { + *tchttp.BaseRequest + + // 改密任务Id + OperationId *string `json:"OperationId,omitnil,omitempty" name:"OperationId"` + + // 所属部门ID,如:“1.2.3” + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 过滤数组,支持:InstanceId 资产ID,DeviceName 资产名称,Ip 内外IP,Account 资产账号,LastChangeStatus 上次改密状态。 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` + + // 分页偏移位置,默认0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目。默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *DescribeChangePwdTaskDetailRequest) 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 *DescribeChangePwdTaskDetailRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "OperationId") + delete(f, "DepartmentId") + delete(f, "Filters") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeChangePwdTaskDetailRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeChangePwdTaskDetailResponseParams struct { + // 总数 + TotalCount *int64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 任务详情 + Details []*ChangePwdTaskDetail `json:"Details,omitnil,omitempty" name:"Details"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeChangePwdTaskDetailResponse struct { + *tchttp.BaseResponse + Response *DescribeChangePwdTaskDetailResponseParams `json:"Response"` +} + +func (r *DescribeChangePwdTaskDetailResponse) 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 *DescribeChangePwdTaskDetailResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeChangePwdTaskRequestParams struct { + // 过滤数组。过滤数组。Name支持以下值: OperationId 任务ID TaskName 任务名 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` + + // 所属部门ID + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 分页偏移量,默认0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type DescribeChangePwdTaskRequest struct { + *tchttp.BaseRequest + + // 过滤数组。过滤数组。Name支持以下值: OperationId 任务ID TaskName 任务名 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` + + // 所属部门ID + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 分页偏移量,默认0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *DescribeChangePwdTaskRequest) 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 *DescribeChangePwdTaskRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Filters") + delete(f, "DepartmentId") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeChangePwdTaskRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeChangePwdTaskResponseParams struct { + // 任务详情 + Tasks []*ChangePwdTaskInfo `json:"Tasks,omitnil,omitempty" name:"Tasks"` + + // 任务总数 + TotalCount *int64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeChangePwdTaskResponse struct { + *tchttp.BaseResponse + Response *DescribeChangePwdTaskResponseParams `json:"Response"` +} + +func (r *DescribeChangePwdTaskResponse) 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 *DescribeChangePwdTaskResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeCmdTemplatesRequestParams struct { + // 命令模板ID集合,非必需 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 命令模板名,模糊查询,最大长度64字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 命令模板类型 1-内置模板 2-自定义模板 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 命令模板类型 1-内置模板 2-自定义模板 + TypeSet []*uint64 `json:"TypeSet,omitnil,omitempty" name:"TypeSet"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type DescribeCmdTemplatesRequest struct { + *tchttp.BaseRequest + + // 命令模板ID集合,非必需 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 命令模板名,模糊查询,最大长度64字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 命令模板类型 1-内置模板 2-自定义模板 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 命令模板类型 1-内置模板 2-自定义模板 + TypeSet []*uint64 `json:"TypeSet,omitnil,omitempty" name:"TypeSet"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *DescribeCmdTemplatesRequest) 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 *DescribeCmdTemplatesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + delete(f, "Name") + delete(f, "Type") + delete(f, "TypeSet") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeCmdTemplatesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeCmdTemplatesResponseParams struct { + // 命令模板列表 + CmdTemplateSet []*CmdTemplate `json:"CmdTemplateSet,omitnil,omitempty" name:"CmdTemplateSet"` + + // 总记录数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeCmdTemplatesResponse struct { + *tchttp.BaseResponse + Response *DescribeCmdTemplatesResponseParams `json:"Response"` +} + +func (r *DescribeCmdTemplatesResponse) 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 *DescribeCmdTemplatesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDeviceAccountsRequestParams struct { + // 主机账号ID集合,非必需,如果使用IdSet则忽略其他过滤参数 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 主机账号名,模糊查询,不能单独出现,必须于DeviceId一起提交 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 主机ID,未使用IdSet时必须携带 + DeviceId *uint64 `json:"DeviceId,omitnil,omitempty" name:"DeviceId"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type DescribeDeviceAccountsRequest struct { + *tchttp.BaseRequest + + // 主机账号ID集合,非必需,如果使用IdSet则忽略其他过滤参数 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 主机账号名,模糊查询,不能单独出现,必须于DeviceId一起提交 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 主机ID,未使用IdSet时必须携带 + DeviceId *uint64 `json:"DeviceId,omitnil,omitempty" name:"DeviceId"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *DescribeDeviceAccountsRequest) 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 *DescribeDeviceAccountsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + delete(f, "Account") + delete(f, "DeviceId") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDeviceAccountsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDeviceAccountsResponseParams struct { + // 记录总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 账号信息列表 + DeviceAccountSet []*DeviceAccount `json:"DeviceAccountSet,omitnil,omitempty" name:"DeviceAccountSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDeviceAccountsResponse struct { + *tchttp.BaseResponse + Response *DescribeDeviceAccountsResponseParams `json:"Response"` +} + +func (r *DescribeDeviceAccountsResponse) 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 *DescribeDeviceAccountsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDeviceGroupMembersRequestParams struct { + // true - 查询已在该资产组的资产,false - 查询未在该资产组的资产 + Bound *bool `json:"Bound,omitnil,omitempty" name:"Bound"` + + // 资产组ID,Id和IdSet二选一 + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 资产组ID集合,传Id,IdSet不生效。 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 资产名或资产IP,模糊查询 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数,默认20, 最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 资产类型,1 - Linux,2 - Windows,3 - MySQL,4 - SQLServer + Kind *uint64 `json:"Kind,omitnil,omitempty" name:"Kind"` + + // 资产类型集合,1 - Linux,2 - Windows,3 - MySQL,4 - SQLServer + KindSet []*uint64 `json:"KindSet,omitnil,omitempty" name:"KindSet"` + + // 所属部门ID + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 过滤条件,可按照标签键、标签进行过滤。如果同时指定标签键和标签过滤条件,它们之间为“AND”的关系 + TagFilters []*TagFilter `json:"TagFilters,omitnil,omitempty" name:"TagFilters"` +} + +type DescribeDeviceGroupMembersRequest struct { + *tchttp.BaseRequest + + // true - 查询已在该资产组的资产,false - 查询未在该资产组的资产 + Bound *bool `json:"Bound,omitnil,omitempty" name:"Bound"` + + // 资产组ID,Id和IdSet二选一 + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 资产组ID集合,传Id,IdSet不生效。 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 资产名或资产IP,模糊查询 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数,默认20, 最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 资产类型,1 - Linux,2 - Windows,3 - MySQL,4 - SQLServer + Kind *uint64 `json:"Kind,omitnil,omitempty" name:"Kind"` + + // 资产类型集合,1 - Linux,2 - Windows,3 - MySQL,4 - SQLServer + KindSet []*uint64 `json:"KindSet,omitnil,omitempty" name:"KindSet"` + + // 所属部门ID + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 过滤条件,可按照标签键、标签进行过滤。如果同时指定标签键和标签过滤条件,它们之间为“AND”的关系 + TagFilters []*TagFilter `json:"TagFilters,omitnil,omitempty" name:"TagFilters"` +} + +func (r *DescribeDeviceGroupMembersRequest) 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 *DescribeDeviceGroupMembersRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Bound") + delete(f, "Id") + delete(f, "IdSet") + delete(f, "Name") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "Kind") + delete(f, "KindSet") + delete(f, "DepartmentId") + delete(f, "TagFilters") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDeviceGroupMembersRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDeviceGroupMembersResponseParams struct { + // 资产组成员总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 资产组成员列表 + DeviceSet []*Device `json:"DeviceSet,omitnil,omitempty" name:"DeviceSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDeviceGroupMembersResponse struct { + *tchttp.BaseResponse + Response *DescribeDeviceGroupMembersResponseParams `json:"Response"` +} + +func (r *DescribeDeviceGroupMembersResponse) 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 *DescribeDeviceGroupMembersResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDeviceGroupsRequestParams struct { + // 资产组ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 资产组名,最长64个字符,模糊查询 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,缺省20,最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 部门ID,用于过滤属于某个部门的资产组 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +type DescribeDeviceGroupsRequest struct { + *tchttp.BaseRequest + + // 资产组ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 资产组名,最长64个字符,模糊查询 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,缺省20,最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 部门ID,用于过滤属于某个部门的资产组 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +func (r *DescribeDeviceGroupsRequest) 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 *DescribeDeviceGroupsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + delete(f, "Name") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "DepartmentId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDeviceGroupsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDeviceGroupsResponseParams struct { + // 资产组总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 资产组列表 + GroupSet []*Group `json:"GroupSet,omitnil,omitempty" name:"GroupSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDeviceGroupsResponse struct { + *tchttp.BaseResponse + Response *DescribeDeviceGroupsResponseParams `json:"Response"` +} + +func (r *DescribeDeviceGroupsResponse) 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 *DescribeDeviceGroupsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDevicesRequestParams struct { + // 资产ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 资产名或资产IP,模糊查询 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 暂未使用 + Ip *string `json:"Ip,omitnil,omitempty" name:"Ip"` + + // 地域码集合 + ApCodeSet []*string `json:"ApCodeSet,omitnil,omitempty" name:"ApCodeSet"` + + // 操作系统类型, 1 - Linux, 2 - Windows, 3 - MySQL, 4 - SQLServer + Kind *uint64 `json:"Kind,omitnil,omitempty" name:"Kind"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 有该资产访问权限的用户ID集合 + AuthorizedUserIdSet []*uint64 `json:"AuthorizedUserIdSet,omitnil,omitempty" name:"AuthorizedUserIdSet"` + + // 过滤条件,资产绑定的堡垒机服务ID集合 + ResourceIdSet []*string `json:"ResourceIdSet,omitnil,omitempty" name:"ResourceIdSet"` + + // 可提供按照多种类型过滤, 1 - Linux, 2 - Windows, 3 - MySQL, 4 - SQLServer + KindSet []*uint64 `json:"KindSet,omitnil,omitempty" name:"KindSet"` + + // 资产是否包含托管账号。1,包含;0,不包含 + ManagedAccount *string `json:"ManagedAccount,omitnil,omitempty" name:"ManagedAccount"` + + // 过滤条件,可按照部门ID进行过滤 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 资产所属云账号id + AccountIdSet []*uint64 `json:"AccountIdSet,omitnil,omitempty" name:"AccountIdSet"` + + // 云厂商类型,1-腾讯云,2-阿里云 + ProviderTypeSet []*uint64 `json:"ProviderTypeSet,omitnil,omitempty" name:"ProviderTypeSet"` + + // 同步的云资产状态,标记同步的资产的状态情况,0-已删除,1-正常,2-已隔离,3-已过期 + CloudDeviceStatusSet []*uint64 `json:"CloudDeviceStatusSet,omitnil,omitempty" name:"CloudDeviceStatusSet"` + + // 过滤条件,可按照标签键、标签进行过滤。如果同时指定标签键和标签过滤条件,它们之间为“AND”的关系 + TagFilters []*TagFilter `json:"TagFilters,omitnil,omitempty" name:"TagFilters"` + + // 过滤数组。支持的Name: + // BindingStatus 绑定状态 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` +} + +type DescribeDevicesRequest struct { + *tchttp.BaseRequest + + // 资产ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 资产名或资产IP,模糊查询 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 暂未使用 + Ip *string `json:"Ip,omitnil,omitempty" name:"Ip"` + + // 地域码集合 + ApCodeSet []*string `json:"ApCodeSet,omitnil,omitempty" name:"ApCodeSet"` + + // 操作系统类型, 1 - Linux, 2 - Windows, 3 - MySQL, 4 - SQLServer + Kind *uint64 `json:"Kind,omitnil,omitempty" name:"Kind"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 有该资产访问权限的用户ID集合 + AuthorizedUserIdSet []*uint64 `json:"AuthorizedUserIdSet,omitnil,omitempty" name:"AuthorizedUserIdSet"` + + // 过滤条件,资产绑定的堡垒机服务ID集合 + ResourceIdSet []*string `json:"ResourceIdSet,omitnil,omitempty" name:"ResourceIdSet"` + + // 可提供按照多种类型过滤, 1 - Linux, 2 - Windows, 3 - MySQL, 4 - SQLServer + KindSet []*uint64 `json:"KindSet,omitnil,omitempty" name:"KindSet"` + + // 资产是否包含托管账号。1,包含;0,不包含 + ManagedAccount *string `json:"ManagedAccount,omitnil,omitempty" name:"ManagedAccount"` + + // 过滤条件,可按照部门ID进行过滤 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 资产所属云账号id + AccountIdSet []*uint64 `json:"AccountIdSet,omitnil,omitempty" name:"AccountIdSet"` + + // 云厂商类型,1-腾讯云,2-阿里云 + ProviderTypeSet []*uint64 `json:"ProviderTypeSet,omitnil,omitempty" name:"ProviderTypeSet"` + + // 同步的云资产状态,标记同步的资产的状态情况,0-已删除,1-正常,2-已隔离,3-已过期 + CloudDeviceStatusSet []*uint64 `json:"CloudDeviceStatusSet,omitnil,omitempty" name:"CloudDeviceStatusSet"` + + // 过滤条件,可按照标签键、标签进行过滤。如果同时指定标签键和标签过滤条件,它们之间为“AND”的关系 + TagFilters []*TagFilter `json:"TagFilters,omitnil,omitempty" name:"TagFilters"` + + // 过滤数组。支持的Name: + // BindingStatus 绑定状态 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` +} + +func (r *DescribeDevicesRequest) 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 *DescribeDevicesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + delete(f, "Name") + delete(f, "Ip") + delete(f, "ApCodeSet") + delete(f, "Kind") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "AuthorizedUserIdSet") + delete(f, "ResourceIdSet") + delete(f, "KindSet") + delete(f, "ManagedAccount") + delete(f, "DepartmentId") + delete(f, "AccountIdSet") + delete(f, "ProviderTypeSet") + delete(f, "CloudDeviceStatusSet") + delete(f, "TagFilters") + delete(f, "Filters") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDevicesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDevicesResponseParams struct { + // 资产总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 资产信息列表 + DeviceSet []*Device `json:"DeviceSet,omitnil,omitempty" name:"DeviceSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDevicesResponse struct { + *tchttp.BaseResponse + Response *DescribeDevicesResponseParams `json:"Response"` +} + +func (r *DescribeDevicesResponse) 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 *DescribeDevicesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDomainsRequestParams struct { + // 每页条目数量,默认20,最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 过滤数组 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` +} + +type DescribeDomainsRequest struct { + *tchttp.BaseRequest + + // 每页条目数量,默认20,最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 过滤数组 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` +} + +func (r *DescribeDomainsRequest) 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 *DescribeDomainsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Limit") + delete(f, "Filters") + delete(f, "Offset") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeDomainsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeDomainsResponseParams struct { + // 网络域总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 网络域列表 + DomainSet []*Domain `json:"DomainSet,omitnil,omitempty" name:"DomainSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeDomainsResponse struct { + *tchttp.BaseResponse + Response *DescribeDomainsResponseParams `json:"Response"` +} + +func (r *DescribeDomainsResponse) 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 *DescribeDomainsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeLDAPUnitSetRequestParams struct { + // 是否开启LDAP认证,true-开启 + Enable *bool `json:"Enable,omitnil,omitempty" name:"Enable"` + + // 服务器地址 + Ip *string `json:"Ip,omitnil,omitempty" name:"Ip"` + + // 服务端口 + Port *uint64 `json:"Port,omitnil,omitempty" name:"Port"` + + // 是否开启SSL,false-不开启,true-开启 + EnableSSL *bool `json:"EnableSSL,omitnil,omitempty" name:"EnableSSL"` + + // Base DN + BaseDN *string `json:"BaseDN,omitnil,omitempty" name:"BaseDN"` + + // 管理员账号 + AdminAccount *string `json:"AdminAccount,omitnil,omitempty" name:"AdminAccount"` + + // 管理员密码 + AdminPassword *string `json:"AdminPassword,omitnil,omitempty" name:"AdminPassword"` + + // 用户名映射属性 + AttributeUserName *string `json:"AttributeUserName,omitnil,omitempty" name:"AttributeUserName"` + + // 部门过滤 + AttributeUnit *string `json:"AttributeUnit,omitnil,omitempty" name:"AttributeUnit"` + + // 备用服务器地址 + IpBackup *string `json:"IpBackup,omitnil,omitempty" name:"IpBackup"` + + // 网络域Id + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` +} + +type DescribeLDAPUnitSetRequest struct { + *tchttp.BaseRequest + + // 是否开启LDAP认证,true-开启 + Enable *bool `json:"Enable,omitnil,omitempty" name:"Enable"` + + // 服务器地址 + Ip *string `json:"Ip,omitnil,omitempty" name:"Ip"` + + // 服务端口 + Port *uint64 `json:"Port,omitnil,omitempty" name:"Port"` + + // 是否开启SSL,false-不开启,true-开启 + EnableSSL *bool `json:"EnableSSL,omitnil,omitempty" name:"EnableSSL"` + + // Base DN + BaseDN *string `json:"BaseDN,omitnil,omitempty" name:"BaseDN"` + + // 管理员账号 + AdminAccount *string `json:"AdminAccount,omitnil,omitempty" name:"AdminAccount"` + + // 管理员密码 + AdminPassword *string `json:"AdminPassword,omitnil,omitempty" name:"AdminPassword"` + + // 用户名映射属性 + AttributeUserName *string `json:"AttributeUserName,omitnil,omitempty" name:"AttributeUserName"` + + // 部门过滤 + AttributeUnit *string `json:"AttributeUnit,omitnil,omitempty" name:"AttributeUnit"` + + // 备用服务器地址 + IpBackup *string `json:"IpBackup,omitnil,omitempty" name:"IpBackup"` + + // 网络域Id + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` +} + +func (r *DescribeLDAPUnitSetRequest) 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 *DescribeLDAPUnitSetRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Enable") + delete(f, "Ip") + delete(f, "Port") + delete(f, "EnableSSL") + delete(f, "BaseDN") + delete(f, "AdminAccount") + delete(f, "AdminPassword") + delete(f, "AttributeUserName") + delete(f, "AttributeUnit") + delete(f, "IpBackup") + delete(f, "DomainId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeLDAPUnitSetRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeLDAPUnitSetResponseParams struct { + // ou 列表 + UnitSet []*string `json:"UnitSet,omitnil,omitempty" name:"UnitSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeLDAPUnitSetResponse struct { + *tchttp.BaseResponse + Response *DescribeLDAPUnitSetResponseParams `json:"Response"` +} + +func (r *DescribeLDAPUnitSetResponse) 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 *DescribeLDAPUnitSetResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeLoginEventRequestParams struct { + // 用户名,如果不包含其他条件时对user_name or real_name两个字段模糊查询 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名,模糊查询 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 查询时间范围,起始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 查询时间范围,结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 来源IP,模糊查询 + SourceIp *string `json:"SourceIp,omitnil,omitempty" name:"SourceIp"` + + // 登录入口:1-字符界面,2-图形界面,3-web页面, 4-API + Entry *uint64 `json:"Entry,omitnil,omitempty" name:"Entry"` + + // 登录入口:1-字符界面,2-图形界面,3-web页面, 4-API + EntrySet []*uint64 `json:"EntrySet,omitnil,omitempty" name:"EntrySet"` + + // 操作结果,1-成功,2-失败 + Result *uint64 `json:"Result,omitnil,omitempty" name:"Result"` + + // 操作结果,1-成功,2-失败 + ResultSet []*uint64 `json:"ResultSet,omitnil,omitempty" name:"ResultSet"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 分页每页记录数,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type DescribeLoginEventRequest struct { + *tchttp.BaseRequest + + // 用户名,如果不包含其他条件时对user_name or real_name两个字段模糊查询 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名,模糊查询 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 查询时间范围,起始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 查询时间范围,结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 来源IP,模糊查询 + SourceIp *string `json:"SourceIp,omitnil,omitempty" name:"SourceIp"` + + // 登录入口:1-字符界面,2-图形界面,3-web页面, 4-API + Entry *uint64 `json:"Entry,omitnil,omitempty" name:"Entry"` + + // 登录入口:1-字符界面,2-图形界面,3-web页面, 4-API + EntrySet []*uint64 `json:"EntrySet,omitnil,omitempty" name:"EntrySet"` + + // 操作结果,1-成功,2-失败 + Result *uint64 `json:"Result,omitnil,omitempty" name:"Result"` + + // 操作结果,1-成功,2-失败 + ResultSet []*uint64 `json:"ResultSet,omitnil,omitempty" name:"ResultSet"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 分页每页记录数,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *DescribeLoginEventRequest) 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 *DescribeLoginEventRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "UserName") + delete(f, "RealName") + delete(f, "StartTime") + delete(f, "EndTime") + delete(f, "SourceIp") + delete(f, "Entry") + delete(f, "EntrySet") + delete(f, "Result") + delete(f, "ResultSet") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeLoginEventRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeLoginEventResponseParams struct { + // 登录日志列表 + LoginEventSet []*LoginEvent `json:"LoginEventSet,omitnil,omitempty" name:"LoginEventSet"` + + // 总记录数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeLoginEventResponse struct { + *tchttp.BaseResponse + Response *DescribeLoginEventResponseParams `json:"Response"` +} + +func (r *DescribeLoginEventResponse) 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 *DescribeLoginEventResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeOperationEventRequestParams struct { + // 用户名,如果不包含其他条件时对user_name or real_name两个字段模糊查询 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名,模糊查询 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 查询时间范围,起始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 查询时间范围,结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 来源IP,模糊查询 + SourceIp *string `json:"SourceIp,omitnil,omitempty" name:"SourceIp"` + + // 操作类型,参考DescribeOperationType返回结果 + Kind *uint64 `json:"Kind,omitnil,omitempty" name:"Kind"` + + // 操作类型,参考DescribeOperationType返回结果 + KindSet []*uint64 `json:"KindSet,omitnil,omitempty" name:"KindSet"` + + // 操作结果,1-成功,2-失败 + Result *uint64 `json:"Result,omitnil,omitempty" name:"Result"` + + // 操作结果,1-成功,2-失败 + ResultSet []*uint64 `json:"ResultSet,omitnil,omitempty" name:"ResultSet"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 分页每页记录数,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type DescribeOperationEventRequest struct { + *tchttp.BaseRequest + + // 用户名,如果不包含其他条件时对user_name or real_name两个字段模糊查询 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名,模糊查询 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 查询时间范围,起始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 查询时间范围,结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 来源IP,模糊查询 + SourceIp *string `json:"SourceIp,omitnil,omitempty" name:"SourceIp"` + + // 操作类型,参考DescribeOperationType返回结果 + Kind *uint64 `json:"Kind,omitnil,omitempty" name:"Kind"` + + // 操作类型,参考DescribeOperationType返回结果 + KindSet []*uint64 `json:"KindSet,omitnil,omitempty" name:"KindSet"` + + // 操作结果,1-成功,2-失败 + Result *uint64 `json:"Result,omitnil,omitempty" name:"Result"` + + // 操作结果,1-成功,2-失败 + ResultSet []*uint64 `json:"ResultSet,omitnil,omitempty" name:"ResultSet"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 分页每页记录数,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *DescribeOperationEventRequest) 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 *DescribeOperationEventRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "UserName") + delete(f, "RealName") + delete(f, "StartTime") + delete(f, "EndTime") + delete(f, "SourceIp") + delete(f, "Kind") + delete(f, "KindSet") + delete(f, "Result") + delete(f, "ResultSet") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeOperationEventRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeOperationEventResponseParams struct { + // 操作日志列表 + OperationEventSet []*OperationEvent `json:"OperationEventSet,omitnil,omitempty" name:"OperationEventSet"` + + // 总记录数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeOperationEventResponse struct { + *tchttp.BaseResponse + Response *DescribeOperationEventResponseParams `json:"Response"` +} + +func (r *DescribeOperationEventResponse) 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 *DescribeOperationEventResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeOperationTaskRequestParams struct { + // 运维任务名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 运维任务类型,1 - 手工执行任务, 2 - 周期性任务 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type DescribeOperationTaskRequest struct { + *tchttp.BaseRequest + + // 运维任务名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 运维任务类型,1 - 手工执行任务, 2 - 周期性任务 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数,默认20 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *DescribeOperationTaskRequest) 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 *DescribeOperationTaskRequest) 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, "Type") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeOperationTaskRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeOperationTaskResponseParams struct { + // 运维任务列表 + OperationTasks []*OperationTask `json:"OperationTasks,omitnil,omitempty" name:"OperationTasks"` + + // 任务总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeOperationTaskResponse struct { + *tchttp.BaseResponse + Response *DescribeOperationTaskResponseParams `json:"Response"` +} + +func (r *DescribeOperationTaskResponse) 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 *DescribeOperationTaskResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeResourcesRequestParams struct { + // 地域码, 如: ap-guangzhou + ApCode *string `json:"ApCode,omitnil,omitempty" name:"ApCode"` + + // 按照堡垒机开通的 VPC 实例ID查询 + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // 资源ID集合,当传入ID集合时忽略 ApCode 和 VpcId + ResourceIds []*string `json:"ResourceIds,omitnil,omitempty" name:"ResourceIds"` + + // 每页条目数量 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 分页偏移位置 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` +} + +type DescribeResourcesRequest struct { + *tchttp.BaseRequest + + // 地域码, 如: ap-guangzhou + ApCode *string `json:"ApCode,omitnil,omitempty" name:"ApCode"` + + // 按照堡垒机开通的 VPC 实例ID查询 + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // 资源ID集合,当传入ID集合时忽略 ApCode 和 VpcId + ResourceIds []*string `json:"ResourceIds,omitnil,omitempty" name:"ResourceIds"` + + // 每页条目数量 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 分页偏移位置 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` +} + +func (r *DescribeResourcesRequest) 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 *DescribeResourcesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ApCode") + delete(f, "VpcId") + delete(f, "ResourceIds") + delete(f, "Limit") + delete(f, "Offset") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeResourcesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeResourcesResponseParams struct { + // 堡垒机资源列表 + ResourceSet []*Resource `json:"ResourceSet,omitnil,omitempty" name:"ResourceSet"` + + // 堡垒机资源数量 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeResourcesResponse struct { + *tchttp.BaseResponse + Response *DescribeResourcesResponseParams `json:"Response"` +} + +func (r *DescribeResourcesResponse) 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 *DescribeResourcesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeSecuritySettingRequestParams struct { + +} + +type DescribeSecuritySettingRequest struct { + *tchttp.BaseRequest + +} + +func (r *DescribeSecuritySettingRequest) 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 *DescribeSecuritySettingRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSecuritySettingRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeSecuritySettingResponseParams struct { + // 无 + SecuritySetting *SecuritySetting `json:"SecuritySetting,omitnil,omitempty" name:"SecuritySetting"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeSecuritySettingResponse struct { + *tchttp.BaseResponse + Response *DescribeSecuritySettingResponseParams `json:"Response"` +} + +func (r *DescribeSecuritySettingResponse) 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 *DescribeSecuritySettingResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeSourceTypesRequestParams struct { + +} + +type DescribeSourceTypesRequest struct { + *tchttp.BaseRequest + +} + +func (r *DescribeSourceTypesRequest) 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 *DescribeSourceTypesRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeSourceTypesRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeSourceTypesResponseParams struct { + // 认证源总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 认证源信息 + SourceTypeSet []*SourceType `json:"SourceTypeSet,omitnil,omitempty" name:"SourceTypeSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeSourceTypesResponse struct { + *tchttp.BaseResponse + Response *DescribeSourceTypesResponseParams `json:"Response"` +} + +func (r *DescribeSourceTypesResponse) 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 *DescribeSourceTypesResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserDirectoryRequestParams struct { + // 分页大小 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 分页偏移 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` +} + +type DescribeUserDirectoryRequest struct { + *tchttp.BaseRequest + + // 分页大小 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 分页偏移 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` +} + +func (r *DescribeUserDirectoryRequest) 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 *DescribeUserDirectoryRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Limit") + delete(f, "Offset") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeUserDirectoryRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserDirectoryResponseParams struct { + // 用户目录集 + UserDirSet []*UserDirectory `json:"UserDirSet,omitnil,omitempty" name:"UserDirSet"` + + // 用户目录集总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeUserDirectoryResponse struct { + *tchttp.BaseResponse + Response *DescribeUserDirectoryResponseParams `json:"Response"` +} + +func (r *DescribeUserDirectoryResponse) 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 *DescribeUserDirectoryResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserGroupMembersRequestParams struct { + // 用户组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // true - 查询已添加到该用户组的用户,false - 查询未添加到该用户组的用户 + Bound *bool `json:"Bound,omitnil,omitempty" name:"Bound"` + + // 用户名或用户姓名,最长64个字符,模糊查询 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20, 最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 所属部门ID + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +type DescribeUserGroupMembersRequest struct { + *tchttp.BaseRequest + + // 用户组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // true - 查询已添加到该用户组的用户,false - 查询未添加到该用户组的用户 + Bound *bool `json:"Bound,omitnil,omitempty" name:"Bound"` + + // 用户名或用户姓名,最长64个字符,模糊查询 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20, 最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 所属部门ID + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +func (r *DescribeUserGroupMembersRequest) 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 *DescribeUserGroupMembersRequest) 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, "Bound") + delete(f, "Name") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "DepartmentId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeUserGroupMembersRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserGroupMembersResponseParams struct { + // 用户组成员总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 用户组成员列表 + UserSet []*User `json:"UserSet,omitnil,omitempty" name:"UserSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeUserGroupMembersResponse struct { + *tchttp.BaseResponse + Response *DescribeUserGroupMembersResponseParams `json:"Response"` +} + +func (r *DescribeUserGroupMembersResponse) 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 *DescribeUserGroupMembersResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserGroupsRequestParams struct { + // 用户组ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 用户组名,模糊查询,长度:0-64字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,缺省20,最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 部门ID,用于过滤属于某个部门的用户组 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +type DescribeUserGroupsRequest struct { + *tchttp.BaseRequest + + // 用户组ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 用户组名,模糊查询,长度:0-64字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,缺省20,最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 部门ID,用于过滤属于某个部门的用户组 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +func (r *DescribeUserGroupsRequest) 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 *DescribeUserGroupsRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + delete(f, "Name") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "DepartmentId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeUserGroupsRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserGroupsResponseParams struct { + // 用户组总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 用户组列表 + GroupSet []*Group `json:"GroupSet,omitnil,omitempty" name:"GroupSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeUserGroupsResponse struct { + *tchttp.BaseResponse + Response *DescribeUserGroupsResponseParams `json:"Response"` +} + +func (r *DescribeUserGroupsResponse) 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 *DescribeUserGroupsResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserSyncStatusRequestParams struct { + // 获取用户同步状态, 1-获取ioa用户同步状态 + UserKind *uint64 `json:"UserKind,omitnil,omitempty" name:"UserKind"` +} + +type DescribeUserSyncStatusRequest struct { + *tchttp.BaseRequest + + // 获取用户同步状态, 1-获取ioa用户同步状态 + UserKind *uint64 `json:"UserKind,omitnil,omitempty" name:"UserKind"` +} + +func (r *DescribeUserSyncStatusRequest) 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 *DescribeUserSyncStatusRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "UserKind") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeUserSyncStatusRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUserSyncStatusResponseParams struct { + // 用户同步状态 + Status *AssetSyncStatus `json:"Status,omitnil,omitempty" name:"Status"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeUserSyncStatusResponse struct { + *tchttp.BaseResponse + Response *DescribeUserSyncStatusResponseParams `json:"Response"` +} + +func (r *DescribeUserSyncStatusResponse) 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 *DescribeUserSyncStatusResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUsersRequestParams struct { + // 如果IdSet不为空,则忽略其他参数 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 模糊查询,IdSet、UserName、Phone为空时才生效,对用户名和姓名进行模糊查询 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20, 最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 精确查询,IdSet为空时才生效 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 精确查询,IdSet、UserName为空时才生效。 + // 大陆手机号直接填写,如果是其他国家、地区号码,按照"国家地区代码|手机号"的格式输入。如: "+852|xxxxxxxx" + Phone *string `json:"Phone,omitnil,omitempty" name:"Phone"` + + // 邮箱,精确查询 + Email *string `json:"Email,omitnil,omitempty" name:"Email"` + + // 查询具有指定资产ID访问权限的用户 + AuthorizedDeviceIdSet []*uint64 `json:"AuthorizedDeviceIdSet,omitnil,omitempty" name:"AuthorizedDeviceIdSet"` + + // 查询具有指定应用资产ID访问权限的用户 + AuthorizedAppAssetIdSet []*uint64 `json:"AuthorizedAppAssetIdSet,omitnil,omitempty" name:"AuthorizedAppAssetIdSet"` + + // 认证方式,0 - 本地, 1 - LDAP, 2 - OAuth, 3-ioa 不传为全部 + AuthTypeSet []*uint64 `json:"AuthTypeSet,omitnil,omitempty" name:"AuthTypeSet"` + + // 部门ID,用于过滤属于某个部门的用户 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 参数过滤数组 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` + + // 是否获取cam用户, 0-否,1-是 + IsCamUser *uint64 `json:"IsCamUser,omitnil,omitempty" name:"IsCamUser"` + + // 用户来源,0-bh,1-ioa,不传为全部 + UserFromSet []*uint64 `json:"UserFromSet,omitnil,omitempty" name:"UserFromSet"` +} + +type DescribeUsersRequest struct { + *tchttp.BaseRequest + + // 如果IdSet不为空,则忽略其他参数 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` + + // 模糊查询,IdSet、UserName、Phone为空时才生效,对用户名和姓名进行模糊查询 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页条目数量,默认20, 最大500 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 精确查询,IdSet为空时才生效 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 精确查询,IdSet、UserName为空时才生效。 + // 大陆手机号直接填写,如果是其他国家、地区号码,按照"国家地区代码|手机号"的格式输入。如: "+852|xxxxxxxx" + Phone *string `json:"Phone,omitnil,omitempty" name:"Phone"` + + // 邮箱,精确查询 + Email *string `json:"Email,omitnil,omitempty" name:"Email"` + + // 查询具有指定资产ID访问权限的用户 + AuthorizedDeviceIdSet []*uint64 `json:"AuthorizedDeviceIdSet,omitnil,omitempty" name:"AuthorizedDeviceIdSet"` + + // 查询具有指定应用资产ID访问权限的用户 + AuthorizedAppAssetIdSet []*uint64 `json:"AuthorizedAppAssetIdSet,omitnil,omitempty" name:"AuthorizedAppAssetIdSet"` + + // 认证方式,0 - 本地, 1 - LDAP, 2 - OAuth, 3-ioa 不传为全部 + AuthTypeSet []*uint64 `json:"AuthTypeSet,omitnil,omitempty" name:"AuthTypeSet"` + + // 部门ID,用于过滤属于某个部门的用户 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 参数过滤数组 + Filters []*Filter `json:"Filters,omitnil,omitempty" name:"Filters"` + + // 是否获取cam用户, 0-否,1-是 + IsCamUser *uint64 `json:"IsCamUser,omitnil,omitempty" name:"IsCamUser"` + + // 用户来源,0-bh,1-ioa,不传为全部 + UserFromSet []*uint64 `json:"UserFromSet,omitnil,omitempty" name:"UserFromSet"` +} + +func (r *DescribeUsersRequest) 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 *DescribeUsersRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + delete(f, "Name") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "UserName") + delete(f, "Phone") + delete(f, "Email") + delete(f, "AuthorizedDeviceIdSet") + delete(f, "AuthorizedAppAssetIdSet") + delete(f, "AuthTypeSet") + delete(f, "DepartmentId") + delete(f, "Filters") + delete(f, "IsCamUser") + delete(f, "UserFromSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeUsersRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DescribeUsersResponseParams struct { + // 用户总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 用户列表 + UserSet []*User `json:"UserSet,omitnil,omitempty" name:"UserSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DescribeUsersResponse struct { + *tchttp.BaseResponse + Response *DescribeUsersResponseParams `json:"Response"` +} + +func (r *DescribeUsersResponse) 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 *DescribeUsersResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type Device struct { + // 资产ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 实例ID,对应CVM、CDB等实例ID + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 资产名 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 公网IP + PublicIp *string `json:"PublicIp,omitnil,omitempty" name:"PublicIp"` + + // 内网IP + PrivateIp *string `json:"PrivateIp,omitnil,omitempty" name:"PrivateIp"` + + // 地域编码 + ApCode *string `json:"ApCode,omitnil,omitempty" name:"ApCode"` + + // 地域名称 + ApName *string `json:"ApName,omitnil,omitempty" name:"ApName"` + + // 操作系统名称 + OsName *string `json:"OsName,omitnil,omitempty" name:"OsName"` + + // 资产类型 1 - Linux, 2 - Windows, 3 - MySQL, 4 - SQLServer + Kind *uint64 `json:"Kind,omitnil,omitempty" name:"Kind"` + + // 管理端口 + Port *uint64 `json:"Port,omitnil,omitempty" name:"Port"` + + // 所属资产组列表 + GroupSet []*Group `json:"GroupSet,omitnil,omitempty" name:"GroupSet"` + + // 资产绑定的账号数 + AccountCount *uint64 `json:"AccountCount,omitnil,omitempty" name:"AccountCount"` + + // VPC ID + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // 子网ID + SubnetId *string `json:"SubnetId,omitnil,omitempty" name:"SubnetId"` + + // 堡垒机服务信息,注意没有绑定服务时为null + Resource *Resource `json:"Resource,omitnil,omitempty" name:"Resource"` + + // 资产所属部门 + Department *Department `json:"Department,omitnil,omitempty" name:"Department"` + + // 数据库资产的多节点 + IpPortSet []*string `json:"IpPortSet,omitnil,omitempty" name:"IpPortSet"` + + // 网络域Id + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` + + // 网络域名称 + DomainName *string `json:"DomainName,omitnil,omitempty" name:"DomainName"` + + // 是否启用SSL,仅支持Redis资产。0:禁用 1:启用 + EnableSSL *int64 `json:"EnableSSL,omitnil,omitempty" name:"EnableSSL"` + + // 已上传的SSL证书名称 + SSLCertName *string `json:"SSLCertName,omitnil,omitempty" name:"SSLCertName"` + + // IOA侧的资源ID + IOAId *int64 `json:"IOAId,omitnil,omitempty" name:"IOAId"` + + // K8S集群托管维度。1-集群,2-命名空间,3-工作负载 + ManageDimension *uint64 `json:"ManageDimension,omitnil,omitempty" name:"ManageDimension"` + + // K8S集群托管账号id + ManageAccountId *uint64 `json:"ManageAccountId,omitnil,omitempty" name:"ManageAccountId"` + + // K8S集群命名空间 + Namespace *string `json:"Namespace,omitnil,omitempty" name:"Namespace"` + + // K8S集群工作负载 + Workload *string `json:"Workload,omitnil,omitempty" name:"Workload"` + + // K8S集群pod已同步数量 + SyncPodCount *uint64 `json:"SyncPodCount,omitnil,omitempty" name:"SyncPodCount"` + + // K8S集群pod总数量 + TotalPodCount *uint64 `json:"TotalPodCount,omitnil,omitempty" name:"TotalPodCount"` + + // 云账号id + CloudAccountId *uint64 `json:"CloudAccountId,omitnil,omitempty" name:"CloudAccountId"` + + // 云账号名称 + CloudAccountName *string `json:"CloudAccountName,omitnil,omitempty" name:"CloudAccountName"` + + // 云厂商类型1-腾讯云,2-阿里云 + ProviderType *uint64 `json:"ProviderType,omitnil,omitempty" name:"ProviderType"` + + // 云厂商名称 + ProviderName *string `json:"ProviderName,omitnil,omitempty" name:"ProviderName"` + + // 同步的云资产状态,标记同步的资产的状态情况,0-已删除,1-正常,2-已隔离,3-已过期 + SyncCloudDeviceStatus *uint64 `json:"SyncCloudDeviceStatus,omitnil,omitempty" name:"SyncCloudDeviceStatus"` +} + +type DeviceAccount struct { + // 账号ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 主机ID + DeviceId *uint64 `json:"DeviceId,omitnil,omitempty" name:"DeviceId"` + + // 账号名 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // true-已托管密码,false-未托管密码 + BoundPassword *bool `json:"BoundPassword,omitnil,omitempty" name:"BoundPassword"` + + // true-已托管私钥,false-未托管私钥 + BoundPrivateKey *bool `json:"BoundPrivateKey,omitnil,omitempty" name:"BoundPrivateKey"` + + // 是否托管凭证, true-托管,false-未托管 + BoundKubeconfig *bool `json:"BoundKubeconfig,omitnil,omitempty" name:"BoundKubeconfig"` + + // 是否为k8s资产管理账号 + IsK8SManageAccount *bool `json:"IsK8SManageAccount,omitnil,omitempty" name:"IsK8SManageAccount"` +} + +// Predefined struct for user +type DisableExternalAccessRequestParams struct { + // 堡垒机id + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` +} + +type DisableExternalAccessRequest struct { + *tchttp.BaseRequest + + // 堡垒机id + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` +} + +func (r *DisableExternalAccessRequest) 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 *DisableExternalAccessRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ResourceId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableExternalAccessRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DisableExternalAccessResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DisableExternalAccessResponse struct { + *tchttp.BaseResponse + Response *DisableExternalAccessResponseParams `json:"Response"` +} + +func (r *DisableExternalAccessResponse) 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 *DisableExternalAccessResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DisableIntranetAccessRequestParams struct { + // 堡垒机id + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` +} + +type DisableIntranetAccessRequest struct { + *tchttp.BaseRequest + + // 堡垒机id + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` +} + +func (r *DisableIntranetAccessRequest) 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 *DisableIntranetAccessRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ResourceId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DisableIntranetAccessRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type DisableIntranetAccessResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type DisableIntranetAccessResponse struct { + *tchttp.BaseResponse + Response *DisableIntranetAccessResponseParams `json:"Response"` +} + +func (r *DisableIntranetAccessResponse) 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 *DisableIntranetAccessResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type Domain struct { + // 自增id + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 网络域id + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` + + // 网络域名称 + DomainName *string `json:"DomainName,omitnil,omitempty" name:"DomainName"` + + // 堡垒机id + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // ip,网段 + WhiteIpSet []*string `json:"WhiteIpSet,omitnil,omitempty" name:"WhiteIpSet"` + + // 是否启用 默认 1启用 0禁用 + Enabled *uint64 `json:"Enabled,omitnil,omitempty" name:"Enabled"` + + // 状态 0-已断开 1-已连接 + Status *uint64 `json:"Status,omitnil,omitempty" name:"Status"` + + // 网络域创建时间 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 是否资源默认网络域 1-资源默认网络域 0-用户添加网络域 + Default *uint64 `json:"Default,omitnil,omitempty" name:"Default"` +} + +// Predefined struct for user +type EnableExternalAccessRequestParams struct { + // 堡垒机id + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` +} + +type EnableExternalAccessRequest struct { + *tchttp.BaseRequest + + // 堡垒机id + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` +} + +func (r *EnableExternalAccessRequest) 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 *EnableExternalAccessRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ResourceId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableExternalAccessRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type EnableExternalAccessResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type EnableExternalAccessResponse struct { + *tchttp.BaseResponse + Response *EnableExternalAccessResponseParams `json:"Response"` +} + +func (r *EnableExternalAccessResponse) 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 *EnableExternalAccessResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type EnableIntranetAccessRequestParams struct { + // 堡垒机实例id + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // 开通内网访问的vpc id + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // vpc的网段 + VpcCidrBlock *string `json:"VpcCidrBlock,omitnil,omitempty" name:"VpcCidrBlock"` + + // 开通内网访问的subnet id + SubnetId *string `json:"SubnetId,omitnil,omitempty" name:"SubnetId"` + + // 内网ip的自定义域名,可为空 + DomainName *string `json:"DomainName,omitnil,omitempty" name:"DomainName"` +} + +type EnableIntranetAccessRequest struct { + *tchttp.BaseRequest + + // 堡垒机实例id + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // 开通内网访问的vpc id + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // vpc的网段 + VpcCidrBlock *string `json:"VpcCidrBlock,omitnil,omitempty" name:"VpcCidrBlock"` + + // 开通内网访问的subnet id + SubnetId *string `json:"SubnetId,omitnil,omitempty" name:"SubnetId"` + + // 内网ip的自定义域名,可为空 + DomainName *string `json:"DomainName,omitnil,omitempty" name:"DomainName"` +} + +func (r *EnableIntranetAccessRequest) 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 *EnableIntranetAccessRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ResourceId") + delete(f, "VpcId") + delete(f, "VpcCidrBlock") + delete(f, "SubnetId") + delete(f, "DomainName") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "EnableIntranetAccessRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type EnableIntranetAccessResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type EnableIntranetAccessResponse struct { + *tchttp.BaseResponse + Response *EnableIntranetAccessResponseParams `json:"Response"` +} + +func (r *EnableIntranetAccessResponse) 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 *EnableIntranetAccessResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type ExternalDevice struct { + // 操作系统名称,只能是Linux、Windows或MySQL + OsName *string `json:"OsName,omitnil,omitempty" name:"OsName"` + + // IP地址 + Ip *string `json:"Ip,omitnil,omitempty" name:"Ip"` + + // 管理端口 + Port *uint64 `json:"Port,omitnil,omitempty" name:"Port"` + + // 主机名,可为空 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 资产所属的部门ID + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 资产多节点:字段ip和端口 + IpPortSet []*string `json:"IpPortSet,omitnil,omitempty" name:"IpPortSet"` + + // 是否启用SSL,1:启用 0:禁用,仅支持Redis资产 + EnableSSL *int64 `json:"EnableSSL,omitnil,omitempty" name:"EnableSSL"` + + // SSL证书,EnableSSL时必填 + SSLCert *string `json:"SSLCert,omitnil,omitempty" name:"SSLCert"` + + // SSL证书名称,EnableSSL时必填 + SSLCertName *string `json:"SSLCertName,omitnil,omitempty" name:"SSLCertName"` + + // 资产实例id + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 资产所属地域 + ApCode *string `json:"ApCode,omitnil,omitempty" name:"ApCode"` + + // 地域名称 + ApName *string `json:"ApName,omitnil,omitempty" name:"ApName"` + + // 资产所属VPC + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // 资产所属子网 + SubnetId *string `json:"SubnetId,omitnil,omitempty" name:"SubnetId"` + + // 公网IP + PublicIp *string `json:"PublicIp,omitnil,omitempty" name:"PublicIp"` +} + +type Filter struct { + // 需要过滤的字段。 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 字段的过滤值。 + // 若存在多个Filter时,Filter间的关系为逻辑与(AND)关系。 + // 若同一个Filter存在多个Values,同一Filter下Values间的关系为逻辑或(OR)关系。 + Values []*string `json:"Values,omitnil,omitempty" name:"Values"` +} + +type Group struct { + // 组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 组名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 所属部门信息 + Department *Department `json:"Department,omitnil,omitempty" name:"Department"` + + // 个数 + Count *uint64 `json:"Count,omitnil,omitempty" name:"Count"` +} + +type IOAUserGroup struct { + // ioa用户组织id + OrgId *uint64 `json:"OrgId,omitnil,omitempty" name:"OrgId"` + + // ioa用户组织名称 + OrgName *string `json:"OrgName,omitnil,omitempty" name:"OrgName"` + + // ioa用户组织id路径 + OrgIdPath *string `json:"OrgIdPath,omitnil,omitempty" name:"OrgIdPath"` + + // ioa用户组织名称路径 + OrgNamePath *string `json:"OrgNamePath,omitnil,omitempty" name:"OrgNamePath"` + + // ioa关联用户源类型 + Source *uint64 `json:"Source,omitnil,omitempty" name:"Source"` +} + +// Predefined struct for user +type ImportExternalDeviceRequestParams struct { + // 资产参数列表 + DeviceSet []*ExternalDevice `json:"DeviceSet,omitnil,omitempty" name:"DeviceSet"` + + // 资产所属云账号id + AccountId *uint64 `json:"AccountId,omitnil,omitempty" name:"AccountId"` +} + +type ImportExternalDeviceRequest struct { + *tchttp.BaseRequest + + // 资产参数列表 + DeviceSet []*ExternalDevice `json:"DeviceSet,omitnil,omitempty" name:"DeviceSet"` + + // 资产所属云账号id + AccountId *uint64 `json:"AccountId,omitnil,omitempty" name:"AccountId"` +} + +func (r *ImportExternalDeviceRequest) 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 *ImportExternalDeviceRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DeviceSet") + delete(f, "AccountId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ImportExternalDeviceRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ImportExternalDeviceResponseParams struct { + // 资产ID列表 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ImportExternalDeviceResponse struct { + *tchttp.BaseResponse + Response *ImportExternalDeviceResponseParams `json:"Response"` +} + +func (r *ImportExternalDeviceResponse) 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 *ImportExternalDeviceResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type LoginEvent struct { + // 用户名 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 操作时间 + Time *string `json:"Time,omitnil,omitempty" name:"Time"` + + // 来源IP + SourceIp *string `json:"SourceIp,omitnil,omitempty" name:"SourceIp"` + + // 登录入口:1-字符界面,2-图形界面,3-web页面, 4-API + Entry *uint64 `json:"Entry,omitnil,omitempty" name:"Entry"` + + // 操作结果,1-成功,2-失败 + Result *uint64 `json:"Result,omitnil,omitempty" name:"Result"` +} + +// Predefined struct for user +type ModifyAccessWhiteListAutoStatusRequestParams struct { + // true:放开自动添加IP;false:不放开自动添加IP + AllowAuto *bool `json:"AllowAuto,omitnil,omitempty" name:"AllowAuto"` +} + +type ModifyAccessWhiteListAutoStatusRequest struct { + *tchttp.BaseRequest + + // true:放开自动添加IP;false:不放开自动添加IP + AllowAuto *bool `json:"AllowAuto,omitnil,omitempty" name:"AllowAuto"` +} + +func (r *ModifyAccessWhiteListAutoStatusRequest) 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 *ModifyAccessWhiteListAutoStatusRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "AllowAuto") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAccessWhiteListAutoStatusRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyAccessWhiteListAutoStatusResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyAccessWhiteListAutoStatusResponse struct { + *tchttp.BaseResponse + Response *ModifyAccessWhiteListAutoStatusResponseParams `json:"Response"` +} + +func (r *ModifyAccessWhiteListAutoStatusResponse) 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 *ModifyAccessWhiteListAutoStatusResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyAccessWhiteListRuleRequestParams struct { + // 白名单规则ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // ip或网段信息,如10.10.10.1或10.10.10.0/24,最大长度40字节 + Source *string `json:"Source,omitnil,omitempty" name:"Source"` + + // 备注信息,最大长度64字符。 + Remark *string `json:"Remark,omitnil,omitempty" name:"Remark"` +} + +type ModifyAccessWhiteListRuleRequest struct { + *tchttp.BaseRequest + + // 白名单规则ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // ip或网段信息,如10.10.10.1或10.10.10.0/24,最大长度40字节 + Source *string `json:"Source,omitnil,omitempty" name:"Source"` + + // 备注信息,最大长度64字符。 + Remark *string `json:"Remark,omitnil,omitempty" name:"Remark"` +} + +func (r *ModifyAccessWhiteListRuleRequest) 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 *ModifyAccessWhiteListRuleRequest) 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, "Source") + delete(f, "Remark") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAccessWhiteListRuleRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyAccessWhiteListRuleResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyAccessWhiteListRuleResponse struct { + *tchttp.BaseResponse + Response *ModifyAccessWhiteListRuleResponseParams `json:"Response"` +} + +func (r *ModifyAccessWhiteListRuleResponse) 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 *ModifyAccessWhiteListRuleResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyAccessWhiteListStatusRequestParams struct { + // true:放开全部来源IP;false:不放开全部来源IP + AllowAny *bool `json:"AllowAny,omitnil,omitempty" name:"AllowAny"` +} + +type ModifyAccessWhiteListStatusRequest struct { + *tchttp.BaseRequest + + // true:放开全部来源IP;false:不放开全部来源IP + AllowAny *bool `json:"AllowAny,omitnil,omitempty" name:"AllowAny"` +} + +func (r *ModifyAccessWhiteListStatusRequest) 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 *ModifyAccessWhiteListStatusRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "AllowAny") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAccessWhiteListStatusRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyAccessWhiteListStatusResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyAccessWhiteListStatusResponse struct { + *tchttp.BaseResponse + Response *ModifyAccessWhiteListStatusResponseParams `json:"Response"` +} + +func (r *ModifyAccessWhiteListStatusResponse) 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 *ModifyAccessWhiteListStatusResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyAclRequestParams struct { + // 访问权限名称,最大32字符,不能包含空白字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 是否开启磁盘映射 + AllowDiskRedirect *bool `json:"AllowDiskRedirect,omitnil,omitempty" name:"AllowDiskRedirect"` + + // 是否允许任意账号登录 + AllowAnyAccount *bool `json:"AllowAnyAccount,omitnil,omitempty" name:"AllowAnyAccount"` + + // 访问权限ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 是否开启剪贴板文件上行 + AllowClipFileUp *bool `json:"AllowClipFileUp,omitnil,omitempty" name:"AllowClipFileUp"` + + // 是否开启剪贴板文件下行 + AllowClipFileDown *bool `json:"AllowClipFileDown,omitnil,omitempty" name:"AllowClipFileDown"` + + // 是否开启剪贴板文本(含图片)上行 + AllowClipTextUp *bool `json:"AllowClipTextUp,omitnil,omitempty" name:"AllowClipTextUp"` + + // 是否开启剪贴板文本(含图片)下行 + AllowClipTextDown *bool `json:"AllowClipTextDown,omitnil,omitempty" name:"AllowClipTextDown"` + + // 是否开启文件传输上传 + AllowFileUp *bool `json:"AllowFileUp,omitnil,omitempty" name:"AllowFileUp"` + + // 文件传输上传大小限制(预留参数,目前暂未使用) + MaxFileUpSize *uint64 `json:"MaxFileUpSize,omitnil,omitempty" name:"MaxFileUpSize"` + + // 是否开启文件传输下载 + AllowFileDown *bool `json:"AllowFileDown,omitnil,omitempty" name:"AllowFileDown"` + + // 文件传输下载大小限制(预留参数,目前暂未使用) + MaxFileDownSize *uint64 `json:"MaxFileDownSize,omitnil,omitempty" name:"MaxFileDownSize"` + + // 关联的用户ID + UserIdSet []*uint64 `json:"UserIdSet,omitnil,omitempty" name:"UserIdSet"` + + // 关联的用户组ID + UserGroupIdSet []*uint64 `json:"UserGroupIdSet,omitnil,omitempty" name:"UserGroupIdSet"` + + // 关联的资产ID + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 关联的应用资产ID集合 + AppAssetIdSet []*uint64 `json:"AppAssetIdSet,omitnil,omitempty" name:"AppAssetIdSet"` + + // 关联的资产组ID + DeviceGroupIdSet []*uint64 `json:"DeviceGroupIdSet,omitnil,omitempty" name:"DeviceGroupIdSet"` + + // 关联的账号 + AccountSet []*string `json:"AccountSet,omitnil,omitempty" name:"AccountSet"` + + // 关联的高危命令模板ID + CmdTemplateIdSet []*uint64 `json:"CmdTemplateIdSet,omitnil,omitempty" name:"CmdTemplateIdSet"` + + // 关联高危DB模板ID + ACTemplateIdSet []*string `json:"ACTemplateIdSet,omitnil,omitempty" name:"ACTemplateIdSet"` + + // 是否开启 RDP 磁盘映射文件上传 + AllowDiskFileUp *bool `json:"AllowDiskFileUp,omitnil,omitempty" name:"AllowDiskFileUp"` + + // 是否开启 RDP 磁盘映射文件下载 + AllowDiskFileDown *bool `json:"AllowDiskFileDown,omitnil,omitempty" name:"AllowDiskFileDown"` + + // 是否开启rz sz文件上传 + AllowShellFileUp *bool `json:"AllowShellFileUp,omitnil,omitempty" name:"AllowShellFileUp"` + + // 是否开启rz sz文件下载 + AllowShellFileDown *bool `json:"AllowShellFileDown,omitnil,omitempty" name:"AllowShellFileDown"` + + // 是否开启 SFTP 文件删除 + AllowFileDel *bool `json:"AllowFileDel,omitnil,omitempty" name:"AllowFileDel"` + + // 访问权限生效时间,如:"2021-09-22T00:00:00+00:00" + // 生效、失效时间不填则访问权限长期有效 + ValidateFrom *string `json:"ValidateFrom,omitnil,omitempty" name:"ValidateFrom"` + + // 访问权限失效时间,如:"2021-09-23T00:00:00+00:00" + // 生效、失效时间不填则访问权限长期有效 + ValidateTo *string `json:"ValidateTo,omitnil,omitempty" name:"ValidateTo"` + + // 权限所属部门的ID,如:1.2.3 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 是否允许使用访问串 + AllowAccessCredential *bool `json:"AllowAccessCredential,omitnil,omitempty" name:"AllowAccessCredential"` + + // 是否允许键盘记录 + AllowKeyboardLogger *bool `json:"AllowKeyboardLogger,omitnil,omitempty" name:"AllowKeyboardLogger"` +} + +type ModifyAclRequest struct { + *tchttp.BaseRequest + + // 访问权限名称,最大32字符,不能包含空白字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 是否开启磁盘映射 + AllowDiskRedirect *bool `json:"AllowDiskRedirect,omitnil,omitempty" name:"AllowDiskRedirect"` + + // 是否允许任意账号登录 + AllowAnyAccount *bool `json:"AllowAnyAccount,omitnil,omitempty" name:"AllowAnyAccount"` + + // 访问权限ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 是否开启剪贴板文件上行 + AllowClipFileUp *bool `json:"AllowClipFileUp,omitnil,omitempty" name:"AllowClipFileUp"` + + // 是否开启剪贴板文件下行 + AllowClipFileDown *bool `json:"AllowClipFileDown,omitnil,omitempty" name:"AllowClipFileDown"` + + // 是否开启剪贴板文本(含图片)上行 + AllowClipTextUp *bool `json:"AllowClipTextUp,omitnil,omitempty" name:"AllowClipTextUp"` + + // 是否开启剪贴板文本(含图片)下行 + AllowClipTextDown *bool `json:"AllowClipTextDown,omitnil,omitempty" name:"AllowClipTextDown"` + + // 是否开启文件传输上传 + AllowFileUp *bool `json:"AllowFileUp,omitnil,omitempty" name:"AllowFileUp"` + + // 文件传输上传大小限制(预留参数,目前暂未使用) + MaxFileUpSize *uint64 `json:"MaxFileUpSize,omitnil,omitempty" name:"MaxFileUpSize"` + + // 是否开启文件传输下载 + AllowFileDown *bool `json:"AllowFileDown,omitnil,omitempty" name:"AllowFileDown"` + + // 文件传输下载大小限制(预留参数,目前暂未使用) + MaxFileDownSize *uint64 `json:"MaxFileDownSize,omitnil,omitempty" name:"MaxFileDownSize"` + + // 关联的用户ID + UserIdSet []*uint64 `json:"UserIdSet,omitnil,omitempty" name:"UserIdSet"` + + // 关联的用户组ID + UserGroupIdSet []*uint64 `json:"UserGroupIdSet,omitnil,omitempty" name:"UserGroupIdSet"` + + // 关联的资产ID + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 关联的应用资产ID集合 + AppAssetIdSet []*uint64 `json:"AppAssetIdSet,omitnil,omitempty" name:"AppAssetIdSet"` + + // 关联的资产组ID + DeviceGroupIdSet []*uint64 `json:"DeviceGroupIdSet,omitnil,omitempty" name:"DeviceGroupIdSet"` + + // 关联的账号 + AccountSet []*string `json:"AccountSet,omitnil,omitempty" name:"AccountSet"` + + // 关联的高危命令模板ID + CmdTemplateIdSet []*uint64 `json:"CmdTemplateIdSet,omitnil,omitempty" name:"CmdTemplateIdSet"` + + // 关联高危DB模板ID + ACTemplateIdSet []*string `json:"ACTemplateIdSet,omitnil,omitempty" name:"ACTemplateIdSet"` + + // 是否开启 RDP 磁盘映射文件上传 + AllowDiskFileUp *bool `json:"AllowDiskFileUp,omitnil,omitempty" name:"AllowDiskFileUp"` + + // 是否开启 RDP 磁盘映射文件下载 + AllowDiskFileDown *bool `json:"AllowDiskFileDown,omitnil,omitempty" name:"AllowDiskFileDown"` + + // 是否开启rz sz文件上传 + AllowShellFileUp *bool `json:"AllowShellFileUp,omitnil,omitempty" name:"AllowShellFileUp"` + + // 是否开启rz sz文件下载 + AllowShellFileDown *bool `json:"AllowShellFileDown,omitnil,omitempty" name:"AllowShellFileDown"` + + // 是否开启 SFTP 文件删除 + AllowFileDel *bool `json:"AllowFileDel,omitnil,omitempty" name:"AllowFileDel"` + + // 访问权限生效时间,如:"2021-09-22T00:00:00+00:00" + // 生效、失效时间不填则访问权限长期有效 + ValidateFrom *string `json:"ValidateFrom,omitnil,omitempty" name:"ValidateFrom"` + + // 访问权限失效时间,如:"2021-09-23T00:00:00+00:00" + // 生效、失效时间不填则访问权限长期有效 + ValidateTo *string `json:"ValidateTo,omitnil,omitempty" name:"ValidateTo"` + + // 权限所属部门的ID,如:1.2.3 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 是否允许使用访问串 + AllowAccessCredential *bool `json:"AllowAccessCredential,omitnil,omitempty" name:"AllowAccessCredential"` + + // 是否允许键盘记录 + AllowKeyboardLogger *bool `json:"AllowKeyboardLogger,omitnil,omitempty" name:"AllowKeyboardLogger"` +} + +func (r *ModifyAclRequest) 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 *ModifyAclRequest) 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, "AllowDiskRedirect") + delete(f, "AllowAnyAccount") + delete(f, "Id") + delete(f, "AllowClipFileUp") + delete(f, "AllowClipFileDown") + delete(f, "AllowClipTextUp") + delete(f, "AllowClipTextDown") + delete(f, "AllowFileUp") + delete(f, "MaxFileUpSize") + delete(f, "AllowFileDown") + delete(f, "MaxFileDownSize") + delete(f, "UserIdSet") + delete(f, "UserGroupIdSet") + delete(f, "DeviceIdSet") + delete(f, "AppAssetIdSet") + delete(f, "DeviceGroupIdSet") + delete(f, "AccountSet") + delete(f, "CmdTemplateIdSet") + delete(f, "ACTemplateIdSet") + delete(f, "AllowDiskFileUp") + delete(f, "AllowDiskFileDown") + delete(f, "AllowShellFileUp") + delete(f, "AllowShellFileDown") + delete(f, "AllowFileDel") + delete(f, "ValidateFrom") + delete(f, "ValidateTo") + delete(f, "DepartmentId") + delete(f, "AllowAccessCredential") + delete(f, "AllowKeyboardLogger") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAclRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyAclResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyAclResponse struct { + *tchttp.BaseResponse + Response *ModifyAclResponseParams `json:"Response"` +} + +func (r *ModifyAclResponse) 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 *ModifyAclResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyAssetSyncFlagRequestParams struct { + // 是否开启资产自动同步,false-不开启,true-开启 + AutoSync *bool `json:"AutoSync,omitnil,omitempty" name:"AutoSync"` +} + +type ModifyAssetSyncFlagRequest struct { + *tchttp.BaseRequest + + // 是否开启资产自动同步,false-不开启,true-开启 + AutoSync *bool `json:"AutoSync,omitnil,omitempty" name:"AutoSync"` +} + +func (r *ModifyAssetSyncFlagRequest) 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 *ModifyAssetSyncFlagRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "AutoSync") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAssetSyncFlagRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyAssetSyncFlagResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyAssetSyncFlagResponse struct { + *tchttp.BaseResponse + Response *ModifyAssetSyncFlagResponseParams `json:"Response"` +} + +func (r *ModifyAssetSyncFlagResponse) 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 *ModifyAssetSyncFlagResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyAuthModeSettingRequestParams struct { + // 双因子认证,0-不开启,1-OTP,2-短信,3-USB Key + AuthMode *uint64 `json:"AuthMode,omitnil,omitempty" name:"AuthMode"` + + // 资源类型,0:普通 1:国密 + ResourceType *int64 `json:"ResourceType,omitnil,omitempty" name:"ResourceType"` +} + +type ModifyAuthModeSettingRequest struct { + *tchttp.BaseRequest + + // 双因子认证,0-不开启,1-OTP,2-短信,3-USB Key + AuthMode *uint64 `json:"AuthMode,omitnil,omitempty" name:"AuthMode"` + + // 资源类型,0:普通 1:国密 + ResourceType *int64 `json:"ResourceType,omitnil,omitempty" name:"ResourceType"` +} + +func (r *ModifyAuthModeSettingRequest) 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 *ModifyAuthModeSettingRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "AuthMode") + delete(f, "ResourceType") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyAuthModeSettingRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyAuthModeSettingResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyAuthModeSettingResponse struct { + *tchttp.BaseResponse + Response *ModifyAuthModeSettingResponseParams `json:"Response"` +} + +func (r *ModifyAuthModeSettingResponse) 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 *ModifyAuthModeSettingResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyChangePwdTaskRequestParams struct { + // 改密任务id + OperationId *string `json:"OperationId,omitnil,omitempty" name:"OperationId"` + + // 改密资产id列表 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 改密资产的账号列表 + AccountSet []*string `json:"AccountSet,omitnil,omitempty" name:"AccountSet"` + + // 修改类型:1:修改任务信息 2:关联任务资产账号 + ModifyType *uint64 `json:"ModifyType,omitnil,omitempty" name:"ModifyType"` + + // 改密方式。1:使用执行账号修改密码;2:修改自身密码 + ChangeMethod *int64 `json:"ChangeMethod,omitnil,omitempty" name:"ChangeMethod"` + + // 密码生成方式。 1:自动生成相同密码 2:自动生成不同密码 3:手动指定相同密码 + AuthGenerationStrategy *int64 `json:"AuthGenerationStrategy,omitnil,omitempty" name:"AuthGenerationStrategy"` + + // 任务名称 + TaskName *string `json:"TaskName,omitnil,omitempty" name:"TaskName"` + + // 所属部门ID,"1,2,3" + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 任务的执行账号 + RunAccount *string `json:"RunAccount,omitnil,omitempty" name:"RunAccount"` + + // 密码,手动指定密码时必传。 + Password *string `json:"Password,omitnil,omitempty" name:"Password"` + + // 密码限制长度,自动生成密码必传。 + PasswordLength *int64 `json:"PasswordLength,omitnil,omitempty" name:"PasswordLength"` + + // 密码包含小写字母,0:否,1:是。 + SmallLetter *int64 `json:"SmallLetter,omitnil,omitempty" name:"SmallLetter"` + + // 密码包含大写字母,0:否,1:是。 + BigLetter *int64 `json:"BigLetter,omitnil,omitempty" name:"BigLetter"` + + // 密码包含数字,0:否,1:是。 + Digit *int64 `json:"Digit,omitnil,omitempty" name:"Digit"` + + // 密码包含的特殊字符(base64编码),包含:^[-_#();%~!+=]*$ + Symbol *string `json:"Symbol,omitnil,omitempty" name:"Symbol"` + + // 改密完成通知。0:不通知 1:通知 + CompleteNotify *int64 `json:"CompleteNotify,omitnil,omitempty" name:"CompleteNotify"` + + // 通知邮箱 + NotifyEmails []*string `json:"NotifyEmails,omitnil,omitempty" name:"NotifyEmails"` + + // 加密压缩文件密码 + FilePassword *string `json:"FilePassword,omitnil,omitempty" name:"FilePassword"` + + // 任务类型, 4:手工执行 5:周期自动执行 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 周期任务周期,单位天(大于等于 1,小于等于 365) + Period *uint64 `json:"Period,omitnil,omitempty" name:"Period"` + + // 周期任务首次执行时间 + FirstTime *string `json:"FirstTime,omitnil,omitempty" name:"FirstTime"` +} + +type ModifyChangePwdTaskRequest struct { + *tchttp.BaseRequest + + // 改密任务id + OperationId *string `json:"OperationId,omitnil,omitempty" name:"OperationId"` + + // 改密资产id列表 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 改密资产的账号列表 + AccountSet []*string `json:"AccountSet,omitnil,omitempty" name:"AccountSet"` + + // 修改类型:1:修改任务信息 2:关联任务资产账号 + ModifyType *uint64 `json:"ModifyType,omitnil,omitempty" name:"ModifyType"` + + // 改密方式。1:使用执行账号修改密码;2:修改自身密码 + ChangeMethod *int64 `json:"ChangeMethod,omitnil,omitempty" name:"ChangeMethod"` + + // 密码生成方式。 1:自动生成相同密码 2:自动生成不同密码 3:手动指定相同密码 + AuthGenerationStrategy *int64 `json:"AuthGenerationStrategy,omitnil,omitempty" name:"AuthGenerationStrategy"` + + // 任务名称 + TaskName *string `json:"TaskName,omitnil,omitempty" name:"TaskName"` + + // 所属部门ID,"1,2,3" + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 任务的执行账号 + RunAccount *string `json:"RunAccount,omitnil,omitempty" name:"RunAccount"` + + // 密码,手动指定密码时必传。 + Password *string `json:"Password,omitnil,omitempty" name:"Password"` + + // 密码限制长度,自动生成密码必传。 + PasswordLength *int64 `json:"PasswordLength,omitnil,omitempty" name:"PasswordLength"` + + // 密码包含小写字母,0:否,1:是。 + SmallLetter *int64 `json:"SmallLetter,omitnil,omitempty" name:"SmallLetter"` + + // 密码包含大写字母,0:否,1:是。 + BigLetter *int64 `json:"BigLetter,omitnil,omitempty" name:"BigLetter"` + + // 密码包含数字,0:否,1:是。 + Digit *int64 `json:"Digit,omitnil,omitempty" name:"Digit"` + + // 密码包含的特殊字符(base64编码),包含:^[-_#();%~!+=]*$ + Symbol *string `json:"Symbol,omitnil,omitempty" name:"Symbol"` + + // 改密完成通知。0:不通知 1:通知 + CompleteNotify *int64 `json:"CompleteNotify,omitnil,omitempty" name:"CompleteNotify"` + + // 通知邮箱 + NotifyEmails []*string `json:"NotifyEmails,omitnil,omitempty" name:"NotifyEmails"` + + // 加密压缩文件密码 + FilePassword *string `json:"FilePassword,omitnil,omitempty" name:"FilePassword"` + + // 任务类型, 4:手工执行 5:周期自动执行 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 周期任务周期,单位天(大于等于 1,小于等于 365) + Period *uint64 `json:"Period,omitnil,omitempty" name:"Period"` + + // 周期任务首次执行时间 + FirstTime *string `json:"FirstTime,omitnil,omitempty" name:"FirstTime"` +} + +func (r *ModifyChangePwdTaskRequest) 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 *ModifyChangePwdTaskRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "OperationId") + delete(f, "DeviceIdSet") + delete(f, "AccountSet") + delete(f, "ModifyType") + delete(f, "ChangeMethod") + delete(f, "AuthGenerationStrategy") + delete(f, "TaskName") + delete(f, "DepartmentId") + delete(f, "RunAccount") + delete(f, "Password") + delete(f, "PasswordLength") + delete(f, "SmallLetter") + delete(f, "BigLetter") + delete(f, "Digit") + delete(f, "Symbol") + delete(f, "CompleteNotify") + delete(f, "NotifyEmails") + delete(f, "FilePassword") + delete(f, "Type") + delete(f, "Period") + delete(f, "FirstTime") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyChangePwdTaskRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyChangePwdTaskResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyChangePwdTaskResponse struct { + *tchttp.BaseResponse + Response *ModifyChangePwdTaskResponseParams `json:"Response"` +} + +func (r *ModifyChangePwdTaskResponse) 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 *ModifyChangePwdTaskResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyCmdTemplateRequestParams struct { + // 模板名,最长32字符,不能包含空白字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 命令列表,\n分隔,最长32768字节 + CmdList *string `json:"CmdList,omitnil,omitempty" name:"CmdList"` + + // 命令模板ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // CmdList字段前端是否base64传值。 + // 0:否,1:是 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` + + // 命令模板类型 1-内置模板 2-自定义模板 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` +} + +type ModifyCmdTemplateRequest struct { + *tchttp.BaseRequest + + // 模板名,最长32字符,不能包含空白字符 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 命令列表,\n分隔,最长32768字节 + CmdList *string `json:"CmdList,omitnil,omitempty" name:"CmdList"` + + // 命令模板ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // CmdList字段前端是否base64传值。 + // 0:否,1:是 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` + + // 命令模板类型 1-内置模板 2-自定义模板 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` +} + +func (r *ModifyCmdTemplateRequest) 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 *ModifyCmdTemplateRequest) 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, "CmdList") + delete(f, "Id") + delete(f, "Encoding") + delete(f, "Type") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyCmdTemplateRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyCmdTemplateResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyCmdTemplateResponse struct { + *tchttp.BaseResponse + Response *ModifyCmdTemplateResponseParams `json:"Response"` +} + +func (r *ModifyCmdTemplateResponse) 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 *ModifyCmdTemplateResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyDeviceGroupRequestParams struct { + // 资产组名,最大长度32字符,不能为空 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 资产组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 资产组所属部门ID,如:1.2.3 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +type ModifyDeviceGroupRequest struct { + *tchttp.BaseRequest + + // 资产组名,最大长度32字符,不能为空 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 资产组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 资产组所属部门ID,如:1.2.3 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +func (r *ModifyDeviceGroupRequest) 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 *ModifyDeviceGroupRequest) 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, "Id") + delete(f, "DepartmentId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyDeviceGroupRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyDeviceGroupResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyDeviceGroupResponse struct { + *tchttp.BaseResponse + Response *ModifyDeviceGroupResponseParams `json:"Response"` +} + +func (r *ModifyDeviceGroupResponse) 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 *ModifyDeviceGroupResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyDeviceRequestParams struct { + // 资产记录ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 管理端口 + Port *uint64 `json:"Port,omitnil,omitempty" name:"Port"` + + // 资产所属组ID集合 + GroupIdSet []*uint64 `json:"GroupIdSet,omitnil,omitempty" name:"GroupIdSet"` + + // 资产所属部门ID + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 网络域Id + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` +} + +type ModifyDeviceRequest struct { + *tchttp.BaseRequest + + // 资产记录ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 管理端口 + Port *uint64 `json:"Port,omitnil,omitempty" name:"Port"` + + // 资产所属组ID集合 + GroupIdSet []*uint64 `json:"GroupIdSet,omitnil,omitempty" name:"GroupIdSet"` + + // 资产所属部门ID + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 网络域Id + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` +} + +func (r *ModifyDeviceRequest) 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 *ModifyDeviceRequest) 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, "Port") + delete(f, "GroupIdSet") + delete(f, "DepartmentId") + delete(f, "DomainId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyDeviceRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyDeviceResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyDeviceResponse struct { + *tchttp.BaseResponse + Response *ModifyDeviceResponseParams `json:"Response"` +} + +func (r *ModifyDeviceResponse) 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 *ModifyDeviceResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyLDAPSettingRequestParams struct { + // 是否开启LDAP认证,false-不开启,true-开启 + Enable *bool `json:"Enable,omitnil,omitempty" name:"Enable"` + + // 服务器地址 + Ip *string `json:"Ip,omitnil,omitempty" name:"Ip"` + + // 备用服务器地址 + IpBackup *string `json:"IpBackup,omitnil,omitempty" name:"IpBackup"` + + // 服务端口 + Port *uint64 `json:"Port,omitnil,omitempty" name:"Port"` + + // 是否开启SSL,false-不开启,true-开启 + EnableSSL *bool `json:"EnableSSL,omitnil,omitempty" name:"EnableSSL"` + + // Base DN + BaseDN *string `json:"BaseDN,omitnil,omitempty" name:"BaseDN"` + + // 管理员账号 + AdminAccount *string `json:"AdminAccount,omitnil,omitempty" name:"AdminAccount"` + + // 管理员密码 + AdminPassword *string `json:"AdminPassword,omitnil,omitempty" name:"AdminPassword"` + + // 用户属性 + AttributeUser *string `json:"AttributeUser,omitnil,omitempty" name:"AttributeUser"` + + // 用户名属性 + AttributeUserName *string `json:"AttributeUserName,omitnil,omitempty" name:"AttributeUserName"` + + // 自动同步,false-不开启,true-开启 + AutoSync *bool `json:"AutoSync,omitnil,omitempty" name:"AutoSync"` + + // 覆盖用户信息,false-不开启,true-开启 + Overwrite *bool `json:"Overwrite,omitnil,omitempty" name:"Overwrite"` + + // 同步周期,30~60000之间的整数 + SyncPeriod *uint64 `json:"SyncPeriod,omitnil,omitempty" name:"SyncPeriod"` + + // 是否同步全部,false-不开启,true-开启 + SyncAll *bool `json:"SyncAll,omitnil,omitempty" name:"SyncAll"` + + // 同步OU列表,SyncAll为false时必传 + SyncUnitSet []*string `json:"SyncUnitSet,omitnil,omitempty" name:"SyncUnitSet"` + + // 组织单元属性 + AttributeUnit *string `json:"AttributeUnit,omitnil,omitempty" name:"AttributeUnit"` + + // 用户姓名属性 + AttributeRealName *string `json:"AttributeRealName,omitnil,omitempty" name:"AttributeRealName"` + + // 手机号属性 + AttributePhone *string `json:"AttributePhone,omitnil,omitempty" name:"AttributePhone"` + + // 邮箱属性 + AttributeEmail *string `json:"AttributeEmail,omitnil,omitempty" name:"AttributeEmail"` + + // 网络域Id + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` +} + +type ModifyLDAPSettingRequest struct { + *tchttp.BaseRequest + + // 是否开启LDAP认证,false-不开启,true-开启 + Enable *bool `json:"Enable,omitnil,omitempty" name:"Enable"` + + // 服务器地址 + Ip *string `json:"Ip,omitnil,omitempty" name:"Ip"` + + // 备用服务器地址 + IpBackup *string `json:"IpBackup,omitnil,omitempty" name:"IpBackup"` + + // 服务端口 + Port *uint64 `json:"Port,omitnil,omitempty" name:"Port"` + + // 是否开启SSL,false-不开启,true-开启 + EnableSSL *bool `json:"EnableSSL,omitnil,omitempty" name:"EnableSSL"` + + // Base DN + BaseDN *string `json:"BaseDN,omitnil,omitempty" name:"BaseDN"` + + // 管理员账号 + AdminAccount *string `json:"AdminAccount,omitnil,omitempty" name:"AdminAccount"` + + // 管理员密码 + AdminPassword *string `json:"AdminPassword,omitnil,omitempty" name:"AdminPassword"` + + // 用户属性 + AttributeUser *string `json:"AttributeUser,omitnil,omitempty" name:"AttributeUser"` + + // 用户名属性 + AttributeUserName *string `json:"AttributeUserName,omitnil,omitempty" name:"AttributeUserName"` + + // 自动同步,false-不开启,true-开启 + AutoSync *bool `json:"AutoSync,omitnil,omitempty" name:"AutoSync"` + + // 覆盖用户信息,false-不开启,true-开启 + Overwrite *bool `json:"Overwrite,omitnil,omitempty" name:"Overwrite"` + + // 同步周期,30~60000之间的整数 + SyncPeriod *uint64 `json:"SyncPeriod,omitnil,omitempty" name:"SyncPeriod"` + + // 是否同步全部,false-不开启,true-开启 + SyncAll *bool `json:"SyncAll,omitnil,omitempty" name:"SyncAll"` + + // 同步OU列表,SyncAll为false时必传 + SyncUnitSet []*string `json:"SyncUnitSet,omitnil,omitempty" name:"SyncUnitSet"` + + // 组织单元属性 + AttributeUnit *string `json:"AttributeUnit,omitnil,omitempty" name:"AttributeUnit"` + + // 用户姓名属性 + AttributeRealName *string `json:"AttributeRealName,omitnil,omitempty" name:"AttributeRealName"` + + // 手机号属性 + AttributePhone *string `json:"AttributePhone,omitnil,omitempty" name:"AttributePhone"` + + // 邮箱属性 + AttributeEmail *string `json:"AttributeEmail,omitnil,omitempty" name:"AttributeEmail"` + + // 网络域Id + DomainId *string `json:"DomainId,omitnil,omitempty" name:"DomainId"` +} + +func (r *ModifyLDAPSettingRequest) 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 *ModifyLDAPSettingRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Enable") + delete(f, "Ip") + delete(f, "IpBackup") + delete(f, "Port") + delete(f, "EnableSSL") + delete(f, "BaseDN") + delete(f, "AdminAccount") + delete(f, "AdminPassword") + delete(f, "AttributeUser") + delete(f, "AttributeUserName") + delete(f, "AutoSync") + delete(f, "Overwrite") + delete(f, "SyncPeriod") + delete(f, "SyncAll") + delete(f, "SyncUnitSet") + delete(f, "AttributeUnit") + delete(f, "AttributeRealName") + delete(f, "AttributePhone") + delete(f, "AttributeEmail") + delete(f, "DomainId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyLDAPSettingRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyLDAPSettingResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyLDAPSettingResponse struct { + *tchttp.BaseResponse + Response *ModifyLDAPSettingResponseParams `json:"Response"` +} + +func (r *ModifyLDAPSettingResponse) 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 *ModifyLDAPSettingResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyOAuthSettingRequestParams struct { + // 是否开启OAuth认证,false-不开启,true-开启。 + Enable *bool `json:"Enable,omitnil,omitempty" name:"Enable"` + + // OAuth认证方式。 + AuthMethod *string `json:"AuthMethod,omitnil,omitempty" name:"AuthMethod"` + + // OAuth认证客户端Id + ClientId *string `json:"ClientId,omitnil,omitempty" name:"ClientId"` + + // OAuth认证客户端密钥 + ClientSecret *string `json:"ClientSecret,omitnil,omitempty" name:"ClientSecret"` + + // 获取OAuth认证授权码URL + CodeUrl *string `json:"CodeUrl,omitnil,omitempty" name:"CodeUrl"` + + // 获取OAuth令牌URL + TokenUrl *string `json:"TokenUrl,omitnil,omitempty" name:"TokenUrl"` + + // 获取OAuth用户信息URL + UserInfoUrl *string `json:"UserInfoUrl,omitnil,omitempty" name:"UserInfoUrl"` + + // 使用Okta认证时指定范围。为空时默认使用 openid、profile、email。 + Scopes []*string `json:"Scopes,omitnil,omitempty" name:"Scopes"` +} + +type ModifyOAuthSettingRequest struct { + *tchttp.BaseRequest + + // 是否开启OAuth认证,false-不开启,true-开启。 + Enable *bool `json:"Enable,omitnil,omitempty" name:"Enable"` + + // OAuth认证方式。 + AuthMethod *string `json:"AuthMethod,omitnil,omitempty" name:"AuthMethod"` + + // OAuth认证客户端Id + ClientId *string `json:"ClientId,omitnil,omitempty" name:"ClientId"` + + // OAuth认证客户端密钥 + ClientSecret *string `json:"ClientSecret,omitnil,omitempty" name:"ClientSecret"` + + // 获取OAuth认证授权码URL + CodeUrl *string `json:"CodeUrl,omitnil,omitempty" name:"CodeUrl"` + + // 获取OAuth令牌URL + TokenUrl *string `json:"TokenUrl,omitnil,omitempty" name:"TokenUrl"` + + // 获取OAuth用户信息URL + UserInfoUrl *string `json:"UserInfoUrl,omitnil,omitempty" name:"UserInfoUrl"` + + // 使用Okta认证时指定范围。为空时默认使用 openid、profile、email。 + Scopes []*string `json:"Scopes,omitnil,omitempty" name:"Scopes"` +} + +func (r *ModifyOAuthSettingRequest) 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 *ModifyOAuthSettingRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Enable") + delete(f, "AuthMethod") + delete(f, "ClientId") + delete(f, "ClientSecret") + delete(f, "CodeUrl") + delete(f, "TokenUrl") + delete(f, "UserInfoUrl") + delete(f, "Scopes") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyOAuthSettingRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyOAuthSettingResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyOAuthSettingResponse struct { + *tchttp.BaseResponse + Response *ModifyOAuthSettingResponseParams `json:"Response"` +} + +func (r *ModifyOAuthSettingResponse) 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 *ModifyOAuthSettingResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyOperationTaskRequestParams struct { + // 任务Id + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 任务名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 任务类型, 1 - 手工执行, 2 - 周期性自动执行 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 执行账号 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 超时时间,单位秒 + Timeout *uint64 `json:"Timeout,omitnil,omitempty" name:"Timeout"` + + // 执行脚本内容 + Script *string `json:"Script,omitnil,omitempty" name:"Script"` + + // 执行主机集合,满足条件以下三个条件:1. 资产绑定可用的专业版或国密版堡垒机服务;2、资产类型为linux资产;3、用户具有资产权限,且资产添加了指定执行账号 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 执行间隔,单位天. 手工执行时无需传入 + Period *uint64 `json:"Period,omitnil,omitempty" name:"Period"` + + // 首次执行日期,默认1970-01-01T08:00:01+08:00,手工执行时无需传入 + FirstTime *string `json:"FirstTime,omitnil,omitempty" name:"FirstTime"` + + // Script参数是否需要进行base64编码后传递,1-需要进行base64编码后传递,非1值-不需要进行base64编码后传递 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` +} + +type ModifyOperationTaskRequest struct { + *tchttp.BaseRequest + + // 任务Id + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 任务名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 任务类型, 1 - 手工执行, 2 - 周期性自动执行 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 执行账号 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 超时时间,单位秒 + Timeout *uint64 `json:"Timeout,omitnil,omitempty" name:"Timeout"` + + // 执行脚本内容 + Script *string `json:"Script,omitnil,omitempty" name:"Script"` + + // 执行主机集合,满足条件以下三个条件:1. 资产绑定可用的专业版或国密版堡垒机服务;2、资产类型为linux资产;3、用户具有资产权限,且资产添加了指定执行账号 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` + + // 执行间隔,单位天. 手工执行时无需传入 + Period *uint64 `json:"Period,omitnil,omitempty" name:"Period"` + + // 首次执行日期,默认1970-01-01T08:00:01+08:00,手工执行时无需传入 + FirstTime *string `json:"FirstTime,omitnil,omitempty" name:"FirstTime"` + + // Script参数是否需要进行base64编码后传递,1-需要进行base64编码后传递,非1值-不需要进行base64编码后传递 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` +} + +func (r *ModifyOperationTaskRequest) 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 *ModifyOperationTaskRequest) 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, "Type") + delete(f, "Account") + delete(f, "Timeout") + delete(f, "Script") + delete(f, "DeviceIdSet") + delete(f, "Period") + delete(f, "FirstTime") + delete(f, "Encoding") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyOperationTaskRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyOperationTaskResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyOperationTaskResponse struct { + *tchttp.BaseResponse + Response *ModifyOperationTaskResponseParams `json:"Response"` +} + +func (r *ModifyOperationTaskResponse) 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 *ModifyOperationTaskResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyReconnectionSettingRequestParams struct { + // 重试次数,取值范围:0-20 + ReconnectionMaxCount *uint64 `json:"ReconnectionMaxCount,omitnil,omitempty" name:"ReconnectionMaxCount"` + + // true:限制重连次数,false:不限制重连次数 + Enable *bool `json:"Enable,omitnil,omitempty" name:"Enable"` +} + +type ModifyReconnectionSettingRequest struct { + *tchttp.BaseRequest + + // 重试次数,取值范围:0-20 + ReconnectionMaxCount *uint64 `json:"ReconnectionMaxCount,omitnil,omitempty" name:"ReconnectionMaxCount"` + + // true:限制重连次数,false:不限制重连次数 + Enable *bool `json:"Enable,omitnil,omitempty" name:"Enable"` +} + +func (r *ModifyReconnectionSettingRequest) 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 *ModifyReconnectionSettingRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ReconnectionMaxCount") + delete(f, "Enable") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyReconnectionSettingRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyReconnectionSettingResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyReconnectionSettingResponse struct { + *tchttp.BaseResponse + Response *ModifyReconnectionSettingResponseParams `json:"Response"` +} + +func (r *ModifyReconnectionSettingResponse) 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 *ModifyReconnectionSettingResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyResourceRequestParams struct { + // 需要开通服务的资源ID + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // 状态 + // + // Deprecated: Status is deprecated. + Status *string `json:"Status,omitnil,omitempty" name:"Status"` + + // 实例版本 + ResourceEdition *string `json:"ResourceEdition,omitnil,omitempty" name:"ResourceEdition"` + + // 资源节点数 + ResourceNode *int64 `json:"ResourceNode,omitnil,omitempty" name:"ResourceNode"` + + // 自动续费 + AutoRenewFlag *int64 `json:"AutoRenewFlag,omitnil,omitempty" name:"AutoRenewFlag"` + + // 带宽扩展包个数(4M) + PackageBandwidth *int64 `json:"PackageBandwidth,omitnil,omitempty" name:"PackageBandwidth"` + + // 授权点数扩展包个数(50点) + PackageNode *int64 `json:"PackageNode,omitnil,omitempty" name:"PackageNode"` + + // 日志投递 + LogDelivery *int64 `json:"LogDelivery,omitnil,omitempty" name:"LogDelivery"` +} + +type ModifyResourceRequest struct { + *tchttp.BaseRequest + + // 需要开通服务的资源ID + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // 状态 + Status *string `json:"Status,omitnil,omitempty" name:"Status"` + + // 实例版本 + ResourceEdition *string `json:"ResourceEdition,omitnil,omitempty" name:"ResourceEdition"` + + // 资源节点数 + ResourceNode *int64 `json:"ResourceNode,omitnil,omitempty" name:"ResourceNode"` + + // 自动续费 + AutoRenewFlag *int64 `json:"AutoRenewFlag,omitnil,omitempty" name:"AutoRenewFlag"` + + // 带宽扩展包个数(4M) + PackageBandwidth *int64 `json:"PackageBandwidth,omitnil,omitempty" name:"PackageBandwidth"` + + // 授权点数扩展包个数(50点) + PackageNode *int64 `json:"PackageNode,omitnil,omitempty" name:"PackageNode"` + + // 日志投递 + LogDelivery *int64 `json:"LogDelivery,omitnil,omitempty" name:"LogDelivery"` +} + +func (r *ModifyResourceRequest) 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 *ModifyResourceRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "ResourceId") + delete(f, "Status") + delete(f, "ResourceEdition") + delete(f, "ResourceNode") + delete(f, "AutoRenewFlag") + delete(f, "PackageBandwidth") + delete(f, "PackageNode") + delete(f, "LogDelivery") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyResourceRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyResourceResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyResourceResponse struct { + *tchttp.BaseResponse + Response *ModifyResourceResponseParams `json:"Response"` +} + +func (r *ModifyResourceResponse) 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 *ModifyResourceResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyUserDirectoryRequestParams struct { + // 目录id + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // ioa分组信息 + UserOrgSet []*UserOrg `json:"UserOrgSet,omitnil,omitempty" name:"UserOrgSet"` +} + +type ModifyUserDirectoryRequest struct { + *tchttp.BaseRequest + + // 目录id + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // ioa分组信息 + UserOrgSet []*UserOrg `json:"UserOrgSet,omitnil,omitempty" name:"UserOrgSet"` +} + +func (r *ModifyUserDirectoryRequest) 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 *ModifyUserDirectoryRequest) 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, "UserOrgSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyUserDirectoryRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyUserDirectoryResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyUserDirectoryResponse struct { + *tchttp.BaseResponse + Response *ModifyUserDirectoryResponseParams `json:"Response"` +} + +func (r *ModifyUserDirectoryResponse) 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 *ModifyUserDirectoryResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyUserGroupRequestParams struct { + // 用户组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 用户组名 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 用户组所属的部门ID,如:1.2.3 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +type ModifyUserGroupRequest struct { + *tchttp.BaseRequest + + // 用户组ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 用户组名 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 用户组所属的部门ID,如:1.2.3 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +func (r *ModifyUserGroupRequest) 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 *ModifyUserGroupRequest) 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, "DepartmentId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyUserGroupRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyUserGroupResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyUserGroupResponse struct { + *tchttp.BaseResponse + Response *ModifyUserGroupResponseParams `json:"Response"` +} + +func (r *ModifyUserGroupResponse) 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 *ModifyUserGroupResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyUserRequestParams struct { + // 用户ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 用户姓名,最大长度20个字符,不能包含空格 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 按照"国家地区代码|手机号"的格式输入。如: "+86|xxxxxxxx" + Phone *string `json:"Phone,omitnil,omitempty" name:"Phone"` + + // 电子邮件 + Email *string `json:"Email,omitnil,omitempty" name:"Email"` + + // 用户生效时间,如:"2021-09-22T00:00:00+00:00" + // 生效、失效时间不填则用户长期有效 + ValidateFrom *string `json:"ValidateFrom,omitnil,omitempty" name:"ValidateFrom"` + + // 用户失效时间,如:"2021-09-23T00:00:00+00:00" + // 生效、失效时间不填则用户长期有效 + ValidateTo *string `json:"ValidateTo,omitnil,omitempty" name:"ValidateTo"` + + // 所属用户组ID集合 + GroupIdSet []*uint64 `json:"GroupIdSet,omitnil,omitempty" name:"GroupIdSet"` + + // 认证方式,0 - 本地,1 - LDAP,2 - OAuth 不传则默认为0 + AuthType *uint64 `json:"AuthType,omitnil,omitempty" name:"AuthType"` + + // 访问时间段限制, 由0、1组成的字符串,长度168(7 × 24),代表该用户在一周中允许访问的时间段。字符串中第N个字符代表在一周中的第N个小时, 0 - 代表不允许访问,1 - 代表允许访问 + ValidateTime *string `json:"ValidateTime,omitnil,omitempty" name:"ValidateTime"` + + // 用户所属部门的ID,如1.2.3 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +type ModifyUserRequest struct { + *tchttp.BaseRequest + + // 用户ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 用户姓名,最大长度20个字符,不能包含空格 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 按照"国家地区代码|手机号"的格式输入。如: "+86|xxxxxxxx" + Phone *string `json:"Phone,omitnil,omitempty" name:"Phone"` + + // 电子邮件 + Email *string `json:"Email,omitnil,omitempty" name:"Email"` + + // 用户生效时间,如:"2021-09-22T00:00:00+00:00" + // 生效、失效时间不填则用户长期有效 + ValidateFrom *string `json:"ValidateFrom,omitnil,omitempty" name:"ValidateFrom"` + + // 用户失效时间,如:"2021-09-23T00:00:00+00:00" + // 生效、失效时间不填则用户长期有效 + ValidateTo *string `json:"ValidateTo,omitnil,omitempty" name:"ValidateTo"` + + // 所属用户组ID集合 + GroupIdSet []*uint64 `json:"GroupIdSet,omitnil,omitempty" name:"GroupIdSet"` + + // 认证方式,0 - 本地,1 - LDAP,2 - OAuth 不传则默认为0 + AuthType *uint64 `json:"AuthType,omitnil,omitempty" name:"AuthType"` + + // 访问时间段限制, 由0、1组成的字符串,长度168(7 × 24),代表该用户在一周中允许访问的时间段。字符串中第N个字符代表在一周中的第N个小时, 0 - 代表不允许访问,1 - 代表允许访问 + ValidateTime *string `json:"ValidateTime,omitnil,omitempty" name:"ValidateTime"` + + // 用户所属部门的ID,如1.2.3 + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` +} + +func (r *ModifyUserRequest) 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 *ModifyUserRequest) 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, "RealName") + delete(f, "Phone") + delete(f, "Email") + delete(f, "ValidateFrom") + delete(f, "ValidateTo") + delete(f, "GroupIdSet") + delete(f, "AuthType") + delete(f, "ValidateTime") + delete(f, "DepartmentId") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ModifyUserRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ModifyUserResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ModifyUserResponse struct { + *tchttp.BaseResponse + Response *ModifyUserResponseParams `json:"Response"` +} + +func (r *ModifyUserResponse) 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 *ModifyUserResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type OperationEvent struct { + // 用户名 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 操作时间 + Time *string `json:"Time,omitnil,omitempty" name:"Time"` + + // 来源IP + SourceIp *string `json:"SourceIp,omitnil,omitempty" name:"SourceIp"` + + // 操作类型 + Kind *uint64 `json:"Kind,omitnil,omitempty" name:"Kind"` + + // 具体操作内容 + Operation *string `json:"Operation,omitnil,omitempty" name:"Operation"` + + // 操作结果,1-成功,2-失败 + Result *uint64 `json:"Result,omitnil,omitempty" name:"Result"` + + // 签名值 + SignValue *string `json:"SignValue,omitnil,omitempty" name:"SignValue"` +} + +type OperationTask struct { + // 运维任务主键ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 运维任务ID + OperationId *string `json:"OperationId,omitnil,omitempty" name:"OperationId"` + + // 运维任务名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 创建用户 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 运维人员姓名 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 任务类型,1 - 手工执行任务, 2 - 周期性任务 + Type *uint64 `json:"Type,omitnil,omitempty" name:"Type"` + + // 周期性任务执行间隔,单位天 + Period *uint64 `json:"Period,omitnil,omitempty" name:"Period"` + + // 执行账户 + NextTime *string `json:"NextTime,omitnil,omitempty" name:"NextTime"` + + // 下一次执行时间 + FirstTime *string `json:"FirstTime,omitnil,omitempty" name:"FirstTime"` +} + +type ReconnectionSetting struct { + // 重连次数 + ReconnectionMaxCount *uint64 `json:"ReconnectionMaxCount,omitnil,omitempty" name:"ReconnectionMaxCount"` + + // true:可以重连,false:不可以重连 + Enable *bool `json:"Enable,omitnil,omitempty" name:"Enable"` +} + +type ReplayInformation struct { + // 令牌 + Token *string `json:"Token,omitnil,omitempty" name:"Token"` + + // 会话开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 回放链接 + Address *string `json:"Address,omitnil,omitempty" name:"Address"` + + // 回放类型 ,默认0, 1-rfb 2-mp4 3-ssh + ReplayType *uint64 `json:"ReplayType,omitnil,omitempty" name:"ReplayType"` +} + +// Predefined struct for user +type ReplaySessionRequestParams struct { + // 会话Sid + Sid *string `json:"Sid,omitnil,omitempty" name:"Sid"` +} + +type ReplaySessionRequest struct { + *tchttp.BaseRequest + + // 会话Sid + Sid *string `json:"Sid,omitnil,omitempty" name:"Sid"` +} + +func (r *ReplaySessionRequest) 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 *ReplaySessionRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Sid") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ReplaySessionRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ReplaySessionResponseParams struct { + // 回放所需信息 + ReplayInfo *ReplayInformation `json:"ReplayInfo,omitnil,omitempty" name:"ReplayInfo"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ReplaySessionResponse struct { + *tchttp.BaseResponse + Response *ReplaySessionResponseParams `json:"Response"` +} + +func (r *ReplaySessionResponse) 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 *ReplaySessionResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ResetDeviceAccountPasswordRequestParams struct { + // ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type ResetDeviceAccountPasswordRequest struct { + *tchttp.BaseRequest + + // ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *ResetDeviceAccountPasswordRequest) 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 *ResetDeviceAccountPasswordRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResetDeviceAccountPasswordRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ResetDeviceAccountPasswordResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ResetDeviceAccountPasswordResponse struct { + *tchttp.BaseResponse + Response *ResetDeviceAccountPasswordResponseParams `json:"Response"` +} + +func (r *ResetDeviceAccountPasswordResponse) 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 *ResetDeviceAccountPasswordResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ResetDeviceAccountPrivateKeyRequestParams struct { + // ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type ResetDeviceAccountPrivateKeyRequest struct { + *tchttp.BaseRequest + + // ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *ResetDeviceAccountPrivateKeyRequest) 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 *ResetDeviceAccountPrivateKeyRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResetDeviceAccountPrivateKeyRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ResetDeviceAccountPrivateKeyResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ResetDeviceAccountPrivateKeyResponse struct { + *tchttp.BaseResponse + Response *ResetDeviceAccountPrivateKeyResponseParams `json:"Response"` +} + +func (r *ResetDeviceAccountPrivateKeyResponse) 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 *ResetDeviceAccountPrivateKeyResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ResetUserRequestParams struct { + // 用户ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type ResetUserRequest struct { + *tchttp.BaseRequest + + // 用户ID集合 + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *ResetUserRequest) 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 *ResetUserRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "ResetUserRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type ResetUserResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type ResetUserResponse struct { + *tchttp.BaseResponse + Response *ResetUserResponseParams `json:"Response"` +} + +func (r *ResetUserResponse) 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 *ResetUserResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type Resource struct { + // 服务实例ID,如bh-saas-s3ed4r5e + ResourceId *string `json:"ResourceId,omitnil,omitempty" name:"ResourceId"` + + // 地域编码 + ApCode *string `json:"ApCode,omitnil,omitempty" name:"ApCode"` + + // 服务实例规格信息 + SvArgs *string `json:"SvArgs,omitnil,omitempty" name:"SvArgs"` + + // VPC ID + VpcId *string `json:"VpcId,omitnil,omitempty" name:"VpcId"` + + // 服务规格对应的资产数 + Nodes *uint64 `json:"Nodes,omitnil,omitempty" name:"Nodes"` + + // 自动续费标记,0 - 表示默认状态,1 - 表示自动续费,2 - 表示明确不自动续费 + RenewFlag *uint64 `json:"RenewFlag,omitnil,omitempty" name:"RenewFlag"` + + // 过期时间 + ExpireTime *string `json:"ExpireTime,omitnil,omitempty" name:"ExpireTime"` + + // 资源状态,0 - 未初始化,1 - 正常,2 - 隔离,3 - 销毁,4 - 初始化失败,5 - 初始化中 + Status *uint64 `json:"Status,omitnil,omitempty" name:"Status"` + + // 服务实例名,如T-Sec-堡垒机(SaaS型) + ResourceName *string `json:"ResourceName,omitnil,omitempty" name:"ResourceName"` + + // 定价模型ID + Pid *uint64 `json:"Pid,omitnil,omitempty" name:"Pid"` + + // 资源创建时间 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 商品码, p_cds_dasb + ProductCode *string `json:"ProductCode,omitnil,omitempty" name:"ProductCode"` + + // 子商品码, sp_cds_dasb_bh_saas + SubProductCode *string `json:"SubProductCode,omitnil,omitempty" name:"SubProductCode"` + + // 可用区 + Zone *string `json:"Zone,omitnil,omitempty" name:"Zone"` + + // 是否过期,true-过期,false-未过期 + Expired *bool `json:"Expired,omitnil,omitempty" name:"Expired"` + + // 是否开通,true-开通,false-未开通 + Deployed *bool `json:"Deployed,omitnil,omitempty" name:"Deployed"` + + // 开通服务的 VPC 名称 + VpcName *string `json:"VpcName,omitnil,omitempty" name:"VpcName"` + + // 开通服务的 VPC 对应的网段 + VpcCidrBlock *string `json:"VpcCidrBlock,omitnil,omitempty" name:"VpcCidrBlock"` + + // 开通服务的子网ID + SubnetId *string `json:"SubnetId,omitnil,omitempty" name:"SubnetId"` + + // 开通服务的子网名称 + SubnetName *string `json:"SubnetName,omitnil,omitempty" name:"SubnetName"` + + // 开通服务的子网网段 + CidrBlock *string `json:"CidrBlock,omitnil,omitempty" name:"CidrBlock"` + + // 外部IP + PublicIpSet []*string `json:"PublicIpSet,omitnil,omitempty" name:"PublicIpSet"` + + // 内部IP + PrivateIpSet []*string `json:"PrivateIpSet,omitnil,omitempty" name:"PrivateIpSet"` + + // 服务开通的高级功能列表,如:[DB] + ModuleSet []*string `json:"ModuleSet,omitnil,omitempty" name:"ModuleSet"` + + // 已使用的授权点数 + UsedNodes *uint64 `json:"UsedNodes,omitnil,omitempty" name:"UsedNodes"` + + // 扩展点数 + ExtendPoints *uint64 `json:"ExtendPoints,omitnil,omitempty" name:"ExtendPoints"` + + // 带宽扩展包个数(4M) + PackageBandwidth *uint64 `json:"PackageBandwidth,omitnil,omitempty" name:"PackageBandwidth"` + + // 授权点数扩展包个数(50点) + PackageNode *uint64 `json:"PackageNode,omitnil,omitempty" name:"PackageNode"` + + // 日志投递规格信息 + LogDeliveryArgs *string `json:"LogDeliveryArgs,omitnil,omitempty" name:"LogDeliveryArgs"` + + // 堡垒机资源LB + ClbSet []*Clb `json:"ClbSet,omitnil,omitempty" name:"ClbSet"` + + // 网络域个数 + DomainCount *uint64 `json:"DomainCount,omitnil,omitempty" name:"DomainCount"` + + // 已经使用的网络域个数 + UsedDomainCount *uint64 `json:"UsedDomainCount,omitnil,omitempty" name:"UsedDomainCount"` + + // 0 非试用版,1 试用版 + Trial *uint64 `json:"Trial,omitnil,omitempty" name:"Trial"` + + // 日志投递规格信息 + LogDelivery *string `json:"LogDelivery,omitnil,omitempty" name:"LogDelivery"` + + // cdc集群id + CdcClusterId *string `json:"CdcClusterId,omitnil,omitempty" name:"CdcClusterId"` + + // 部署模式 默认0 0-cvm 1-tke + DeployModel *uint64 `json:"DeployModel,omitnil,omitempty" name:"DeployModel"` + + // 0 默认值,非内网访问,1 内网访问,2 内网访问开通中,3 内网访问关闭中 + IntranetAccess *uint64 `json:"IntranetAccess,omitnil,omitempty" name:"IntranetAccess"` + + // 内网访问的ip + IntranetPrivateIpSet []*string `json:"IntranetPrivateIpSet,omitnil,omitempty" name:"IntranetPrivateIpSet"` + + // 开通内网访问的vpc + IntranetVpcId *string `json:"IntranetVpcId,omitnil,omitempty" name:"IntranetVpcId"` + + // 开通内网访问vpc的网段 + IntranetVpcCidr *string `json:"IntranetVpcCidr,omitnil,omitempty" name:"IntranetVpcCidr"` + + // 堡垒机内网ip自定义域名 + DomainName *string `json:"DomainName,omitnil,omitempty" name:"DomainName"` + + // 是否共享clb,true-共享clb,false-独享clb + ShareClb *bool `json:"ShareClb,omitnil,omitempty" name:"ShareClb"` + + // 共享clb id + OpenClbId *string `json:"OpenClbId,omitnil,omitempty" name:"OpenClbId"` + + // 运营商信息 + LbVipIsp *string `json:"LbVipIsp,omitnil,omitempty" name:"LbVipIsp"` + + // linux资产命令行运维端口 + TUICmdPort *int64 `json:"TUICmdPort,omitnil,omitempty" name:"TUICmdPort"` + + // linux资产直连端口 + TUIDirectPort *int64 `json:"TUIDirectPort,omitnil,omitempty" name:"TUIDirectPort"` + + // 1 默认值,web访问开启,0 web访问关闭,2 web访问开通中,3 web访问关闭中 + WebAccess *uint64 `json:"WebAccess,omitnil,omitempty" name:"WebAccess"` + + // 1 默认值,客户单访问开启,0 客户端访问关闭,2 客户端访问开通中,3 客户端访问关闭中 + ClientAccess *uint64 `json:"ClientAccess,omitnil,omitempty" name:"ClientAccess"` + + // 1 默认值,外网访问开启,0 外网访问关闭,2 外网访问开通中,3 外网访问关闭中 + ExternalAccess *uint64 `json:"ExternalAccess,omitnil,omitempty" name:"ExternalAccess"` + + // 0默认值。0-免费版(试用版)ioa,1-付费版ioa + IOAResource *uint64 `json:"IOAResource,omitnil,omitempty" name:"IOAResource"` + + // 零信任堡垒机用户扩展包个数。1个扩展包对应20个用户数 + PackageIOAUserCount *uint64 `json:"PackageIOAUserCount,omitnil,omitempty" name:"PackageIOAUserCount"` + + // 零信任堡垒机带宽扩展包个数。一个扩展包表示4M带宽 + PackageIOABandwidth *uint64 `json:"PackageIOABandwidth,omitnil,omitempty" name:"PackageIOABandwidth"` + + // 堡垒机实例对应的零信任实例id + IOAResourceId *string `json:"IOAResourceId,omitnil,omitempty" name:"IOAResourceId"` +} + +type RunChangePwdTaskDetail struct { + // 资产id + DeviceId *uint64 `json:"DeviceId,omitnil,omitempty" name:"DeviceId"` + + // 资产账号 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` +} + +// Predefined struct for user +type RunChangePwdTaskRequestParams struct { + // 任务Id + OperationId *string `json:"OperationId,omitnil,omitempty" name:"OperationId"` + + // 部门id + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 改密任务详情 + Details []*RunChangePwdTaskDetail `json:"Details,omitnil,omitempty" name:"Details"` +} + +type RunChangePwdTaskRequest struct { + *tchttp.BaseRequest + + // 任务Id + OperationId *string `json:"OperationId,omitnil,omitempty" name:"OperationId"` + + // 部门id + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 改密任务详情 + Details []*RunChangePwdTaskDetail `json:"Details,omitnil,omitempty" name:"Details"` +} + +func (r *RunChangePwdTaskRequest) 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 *RunChangePwdTaskRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "OperationId") + delete(f, "DepartmentId") + delete(f, "Details") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RunChangePwdTaskRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type RunChangePwdTaskResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type RunChangePwdTaskResponse struct { + *tchttp.BaseResponse + Response *RunChangePwdTaskResponseParams `json:"Response"` +} + +func (r *RunChangePwdTaskResponse) 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 *RunChangePwdTaskResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type RunOperationTaskRequestParams struct { + // 运维任务ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` +} + +type RunOperationTaskRequest struct { + *tchttp.BaseRequest + + // 运维任务ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` +} + +func (r *RunOperationTaskRequest) 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 *RunOperationTaskRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Id") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "RunOperationTaskRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type RunOperationTaskResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type RunOperationTaskResponse struct { + *tchttp.BaseResponse + Response *RunOperationTaskResponseParams `json:"Response"` +} + +func (r *RunOperationTaskResponse) 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 *RunOperationTaskResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchAuditLogRequestParams struct { + // 开始时间,不得早于当前时间的180天前 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 偏移量 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页容量,默认为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type SearchAuditLogRequest struct { + *tchttp.BaseRequest + + // 开始时间,不得早于当前时间的180天前 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 偏移量 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页容量,默认为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *SearchAuditLogRequest) 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 *SearchAuditLogRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "StartTime") + delete(f, "EndTime") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SearchAuditLogRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchAuditLogResponseParams struct { + // 日志总数量 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SearchAuditLogResponse struct { + *tchttp.BaseResponse + Response *SearchAuditLogResponseParams `json:"Response"` +} + +func (r *SearchAuditLogResponse) 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 *SearchAuditLogResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchCommandBySidRequestParams struct { + // 会话Id + Sid *string `json:"Sid,omitnil,omitempty" name:"Sid"` + + // 命令,可模糊搜索 + Cmd *string `json:"Cmd,omitnil,omitempty" name:"Cmd"` + + // Cmd字段是前端传值是否进行base64. + // 0:否,1:是 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` + + // 偏移量 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页容量,默认20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 根据拦截状态进行过滤 + AuditAction []*uint64 `json:"AuditAction,omitnil,omitempty" name:"AuditAction"` +} + +type SearchCommandBySidRequest struct { + *tchttp.BaseRequest + + // 会话Id + Sid *string `json:"Sid,omitnil,omitempty" name:"Sid"` + + // 命令,可模糊搜索 + Cmd *string `json:"Cmd,omitnil,omitempty" name:"Cmd"` + + // Cmd字段是前端传值是否进行base64. + // 0:否,1:是 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` + + // 偏移量 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 每页容量,默认20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 根据拦截状态进行过滤 + AuditAction []*uint64 `json:"AuditAction,omitnil,omitempty" name:"AuditAction"` +} + +func (r *SearchCommandBySidRequest) 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 *SearchCommandBySidRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Sid") + delete(f, "Cmd") + delete(f, "Encoding") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "AuditAction") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SearchCommandBySidRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchCommandBySidResponseParams struct { + // 总记录数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 命令列表 + CommandSet []*Command `json:"CommandSet,omitnil,omitempty" name:"CommandSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SearchCommandBySidResponse struct { + *tchttp.BaseResponse + Response *SearchCommandBySidResponseParams `json:"Response"` +} + +func (r *SearchCommandBySidResponse) 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 *SearchCommandBySidResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchCommandRequestParams struct { + // 搜索区间的开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 搜索区间的结束时间,不填默认为开始时间到现在为止 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 用户名 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 资产实例ID + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 资产名称 + DeviceName *string `json:"DeviceName,omitnil,omitempty" name:"DeviceName"` + + // 资产的公网IP + PublicIp *string `json:"PublicIp,omitnil,omitempty" name:"PublicIp"` + + // 资产的内网IP + PrivateIp *string `json:"PrivateIp,omitnil,omitempty" name:"PrivateIp"` + + // 执行的命令 + Cmd *string `json:"Cmd,omitnil,omitempty" name:"Cmd"` + + // Cmd字段是前端传值是否进行base64. + // 0:否,1:是 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` + + // 根据拦截状态进行过滤:1 - 已执行,2 - 被阻断 + AuditAction []*uint64 `json:"AuditAction,omitnil,omitempty" name:"AuditAction"` + + // 每页容量,默认20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` +} + +type SearchCommandRequest struct { + *tchttp.BaseRequest + + // 搜索区间的开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 搜索区间的结束时间,不填默认为开始时间到现在为止 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 用户名 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 资产实例ID + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 资产名称 + DeviceName *string `json:"DeviceName,omitnil,omitempty" name:"DeviceName"` + + // 资产的公网IP + PublicIp *string `json:"PublicIp,omitnil,omitempty" name:"PublicIp"` + + // 资产的内网IP + PrivateIp *string `json:"PrivateIp,omitnil,omitempty" name:"PrivateIp"` + + // 执行的命令 + Cmd *string `json:"Cmd,omitnil,omitempty" name:"Cmd"` + + // Cmd字段是前端传值是否进行base64. + // 0:否,1:是 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` + + // 根据拦截状态进行过滤:1 - 已执行,2 - 被阻断 + AuditAction []*uint64 `json:"AuditAction,omitnil,omitempty" name:"AuditAction"` + + // 每页容量,默认20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` +} + +func (r *SearchCommandRequest) 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 *SearchCommandRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "StartTime") + delete(f, "EndTime") + delete(f, "UserName") + delete(f, "RealName") + delete(f, "InstanceId") + delete(f, "DeviceName") + delete(f, "PublicIp") + delete(f, "PrivateIp") + delete(f, "Cmd") + delete(f, "Encoding") + delete(f, "AuditAction") + delete(f, "Limit") + delete(f, "Offset") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SearchCommandRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchCommandResponseParams struct { + // 总记录数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 命令列表 + Commands []*SearchCommandResult `json:"Commands,omitnil,omitempty" name:"Commands"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SearchCommandResponse struct { + *tchttp.BaseResponse + Response *SearchCommandResponseParams `json:"Response"` +} + +func (r *SearchCommandResponse) 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 *SearchCommandResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type SearchCommandResult struct { + // 命令输入的时间 + Time *string `json:"Time,omitnil,omitempty" name:"Time"` + + // 用户名 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 资产ID + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 资产名称 + DeviceName *string `json:"DeviceName,omitnil,omitempty" name:"DeviceName"` + + // 资产公网IP + PublicIp *string `json:"PublicIp,omitnil,omitempty" name:"PublicIp"` + + // 资产内网IP + PrivateIp *string `json:"PrivateIp,omitnil,omitempty" name:"PrivateIp"` + + // 命令 + Cmd *string `json:"Cmd,omitnil,omitempty" name:"Cmd"` + + // 命令执行情况,1--允许,2--拒绝 + Action *uint64 `json:"Action,omitnil,omitempty" name:"Action"` + + // 命令所属的会话ID + Sid *string `json:"Sid,omitnil,omitempty" name:"Sid"` + + // 命令执行时间相对于所属会话开始时间的偏移量,单位ms + TimeOffset *uint64 `json:"TimeOffset,omitnil,omitempty" name:"TimeOffset"` + + // 账号 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // source ip + FromIp *string `json:"FromIp,omitnil,omitempty" name:"FromIp"` + + // 该命令所属会话的会话开始时间 + SessionTime *string `json:"SessionTime,omitnil,omitempty" name:"SessionTime"` + + // 该命令所属会话的会话开始时间(使用SessionTime) + SessTime *string `json:"SessTime,omitnil,omitempty" name:"SessTime"` + + // 复核时间 + ConfirmTime *string `json:"ConfirmTime,omitnil,omitempty" name:"ConfirmTime"` + + // 部门id + UserDepartmentId *string `json:"UserDepartmentId,omitnil,omitempty" name:"UserDepartmentId"` + + // 用户部门名称 + UserDepartmentName *string `json:"UserDepartmentName,omitnil,omitempty" name:"UserDepartmentName"` + + // 设备部门id + DeviceDepartmentId *string `json:"DeviceDepartmentId,omitnil,omitempty" name:"DeviceDepartmentId"` + + // 设备部门名称 + DeviceDepartmentName *string `json:"DeviceDepartmentName,omitnil,omitempty" name:"DeviceDepartmentName"` + + // 会话大小 + Size *uint64 `json:"Size,omitnil,omitempty" name:"Size"` + + // 签名值 + SignValue *string `json:"SignValue,omitnil,omitempty" name:"SignValue"` + + // 资产类型 + DeviceKind *string `json:"DeviceKind,omitnil,omitempty" name:"DeviceKind"` +} + +// Predefined struct for user +type SearchFileBySidRequestParams struct { + // 若入参为Id,则其他入参字段不作为搜索依据,仅按照Id来搜索会话 + Sid *string `json:"Sid,omitnil,omitempty" name:"Sid"` + + // 是否创建审计日志,通过查看按钮调用时为true,其他为false + AuditLog *bool `json:"AuditLog,omitnil,omitempty" name:"AuditLog"` + + // 分页的页内记录数,默认为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 可填写路径名或文件名 + FileName *string `json:"FileName,omitnil,omitempty" name:"FileName"` + + // 分页用偏移量 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 1-已执行, 2-被阻断 + AuditAction *int64 `json:"AuditAction,omitnil,omitempty" name:"AuditAction"` + + // 1-已执行, 2-被阻断 + AuditActionSet []*int64 `json:"AuditActionSet,omitnil,omitempty" name:"AuditActionSet"` + + // 以Protocol和Method为条件查询 + TypeFilters []*SearchFileTypeFilter `json:"TypeFilters,omitnil,omitempty" name:"TypeFilters"` +} + +type SearchFileBySidRequest struct { + *tchttp.BaseRequest + + // 若入参为Id,则其他入参字段不作为搜索依据,仅按照Id来搜索会话 + Sid *string `json:"Sid,omitnil,omitempty" name:"Sid"` + + // 是否创建审计日志,通过查看按钮调用时为true,其他为false + AuditLog *bool `json:"AuditLog,omitnil,omitempty" name:"AuditLog"` + + // 分页的页内记录数,默认为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 可填写路径名或文件名 + FileName *string `json:"FileName,omitnil,omitempty" name:"FileName"` + + // 分页用偏移量 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 1-已执行, 2-被阻断 + AuditAction *int64 `json:"AuditAction,omitnil,omitempty" name:"AuditAction"` + + // 1-已执行, 2-被阻断 + AuditActionSet []*int64 `json:"AuditActionSet,omitnil,omitempty" name:"AuditActionSet"` + + // 以Protocol和Method为条件查询 + TypeFilters []*SearchFileTypeFilter `json:"TypeFilters,omitnil,omitempty" name:"TypeFilters"` +} + +func (r *SearchFileBySidRequest) 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 *SearchFileBySidRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Sid") + delete(f, "AuditLog") + delete(f, "Limit") + delete(f, "FileName") + delete(f, "Offset") + delete(f, "AuditAction") + delete(f, "AuditActionSet") + delete(f, "TypeFilters") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SearchFileBySidRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchFileBySidResponseParams struct { + // 记录数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 某会话的文件操作列表 + SearchFileBySidResult []*SearchFileBySidResult `json:"SearchFileBySidResult,omitnil,omitempty" name:"SearchFileBySidResult"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SearchFileBySidResponse struct { + *tchttp.BaseResponse + Response *SearchFileBySidResponseParams `json:"Response"` +} + +func (r *SearchFileBySidResponse) 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 *SearchFileBySidResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type SearchFileBySidResult struct { + // 会话Id + Sid *string `json:"Sid,omitnil,omitempty" name:"Sid"` + + // 用户名 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 实例Id + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 资产账号 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 来源Ip + FromIp *string `json:"FromIp,omitnil,omitempty" name:"FromIp"` + + // 文件操作时间 + Time *string `json:"Time,omitnil,omitempty" name:"Time"` + + // 1-上传文件 2-下载文件 3-删除文件 4-移动文件 5-重命名文件 6-新建文件夹 7-移动文件夹 8-重命名文件夹 9-删除文件夹 + Method *int64 `json:"Method,omitnil,omitempty" name:"Method"` + + // 文件传输协议 + Protocol *string `json:"Protocol,omitnil,omitempty" name:"Protocol"` + + // method为上传、下载、删除时文件在服务器上的位置, 或重命名、移动文件前文件的位置 + FileCurr *string `json:"FileCurr,omitnil,omitempty" name:"FileCurr"` + + // method为重命名、移动文件时代表移动后的新位置.其他情况为null + FileNew *string `json:"FileNew,omitnil,omitempty" name:"FileNew"` + + // method为上传文件、下载文件、删除文件时显示文件大小。其他情况为null + Size *int64 `json:"Size,omitnil,omitempty" name:"Size"` + + // 堡垒机拦截情况, 1-已执行, 2-被阻断 + Action *int64 `json:"Action,omitnil,omitempty" name:"Action"` + + // 复核时间,当Action是3时,需有复核时间 + ConfirmTime *string `json:"ConfirmTime,omitnil,omitempty" name:"ConfirmTime"` + + // 用户部门Id + UserDepartmentId *string `json:"UserDepartmentId,omitnil,omitempty" name:"UserDepartmentId"` + + // 用户部门name + UserDepartmentName *string `json:"UserDepartmentName,omitnil,omitempty" name:"UserDepartmentName"` + + // 设备部门id + DeviceDepartmentId *string `json:"DeviceDepartmentId,omitnil,omitempty" name:"DeviceDepartmentId"` + + // 设备部门name + DeviceDepartmentName *string `json:"DeviceDepartmentName,omitnil,omitempty" name:"DeviceDepartmentName"` + + // 签名值 + SignValue *string `json:"SignValue,omitnil,omitempty" name:"SignValue"` +} + +// Predefined struct for user +type SearchFileRequestParams struct { + // 查询开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 查询结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 用户名 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 资产ID + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 资产名称 + DeviceName *string `json:"DeviceName,omitnil,omitempty" name:"DeviceName"` + + // 资产公网IP + PublicIp *string `json:"PublicIp,omitnil,omitempty" name:"PublicIp"` + + // 资产内网IP + PrivateIp *string `json:"PrivateIp,omitnil,omitempty" name:"PrivateIp"` + + // 操作类型:1 - 文件上传,2 - 文件下载,3 - 文件删除,4 - 文件(夹)移动,5 - 文件(夹)重命名,6 - 新建文件夹,9 - 删除文件夹 + Method []*uint64 `json:"Method,omitnil,omitempty" name:"Method"` + + // 可填写路径名或文件(夹)名 + FileName *string `json:"FileName,omitnil,omitempty" name:"FileName"` + + // 1-已执行, 2-被阻断 + AuditAction []*uint64 `json:"AuditAction,omitnil,omitempty" name:"AuditAction"` + + // 分页的页内记录数,默认为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` +} + +type SearchFileRequest struct { + *tchttp.BaseRequest + + // 查询开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 查询结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 用户名 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 资产ID + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 资产名称 + DeviceName *string `json:"DeviceName,omitnil,omitempty" name:"DeviceName"` + + // 资产公网IP + PublicIp *string `json:"PublicIp,omitnil,omitempty" name:"PublicIp"` + + // 资产内网IP + PrivateIp *string `json:"PrivateIp,omitnil,omitempty" name:"PrivateIp"` + + // 操作类型:1 - 文件上传,2 - 文件下载,3 - 文件删除,4 - 文件(夹)移动,5 - 文件(夹)重命名,6 - 新建文件夹,9 - 删除文件夹 + Method []*uint64 `json:"Method,omitnil,omitempty" name:"Method"` + + // 可填写路径名或文件(夹)名 + FileName *string `json:"FileName,omitnil,omitempty" name:"FileName"` + + // 1-已执行, 2-被阻断 + AuditAction []*uint64 `json:"AuditAction,omitnil,omitempty" name:"AuditAction"` + + // 分页的页内记录数,默认为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` +} + +func (r *SearchFileRequest) 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 *SearchFileRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "StartTime") + delete(f, "EndTime") + delete(f, "UserName") + delete(f, "RealName") + delete(f, "InstanceId") + delete(f, "DeviceName") + delete(f, "PublicIp") + delete(f, "PrivateIp") + delete(f, "Method") + delete(f, "FileName") + delete(f, "AuditAction") + delete(f, "Limit") + delete(f, "Offset") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SearchFileRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchFileResponseParams struct { + // 记录数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 文件操作列表 + Files []*SearchFileResult `json:"Files,omitnil,omitempty" name:"Files"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SearchFileResponse struct { + *tchttp.BaseResponse + Response *SearchFileResponseParams `json:"Response"` +} + +func (r *SearchFileResponse) 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 *SearchFileResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type SearchFileResult struct { + // 文件传输的时间 + Time *string `json:"Time,omitnil,omitempty" name:"Time"` + + // 用户名 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 资产ID + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 资产名称 + DeviceName *string `json:"DeviceName,omitnil,omitempty" name:"DeviceName"` + + // 资产公网IP + PublicIp *string `json:"PublicIp,omitnil,omitempty" name:"PublicIp"` + + // 资产内网IP + PrivateIp *string `json:"PrivateIp,omitnil,omitempty" name:"PrivateIp"` + + // 操作结果:1 - 已执行,2 - 已阻断 + Action *uint64 `json:"Action,omitnil,omitempty" name:"Action"` + + // 操作类型:1 - 文件上传,2 - 文件下载,3 - 文件删除,4 - 文件(夹)移动,5 - 文件(夹)重命名,6 - 新建文件夹,9 - 删除文件夹 + Method *uint64 `json:"Method,omitnil,omitempty" name:"Method"` + + // 下载的文件(夹)路径及名称 + FileCurr *string `json:"FileCurr,omitnil,omitempty" name:"FileCurr"` + + // 上传或新建文件(夹)路径及名称 + FileNew *string `json:"FileNew,omitnil,omitempty" name:"FileNew"` + + // 会话id + Sid *string `json:"Sid,omitnil,omitempty" name:"Sid"` + + // 账号 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 来源id + FromIp *string `json:"FromIp,omitnil,omitempty" name:"FromIp"` + + // 协议 + Protocol *string `json:"Protocol,omitnil,omitempty" name:"Protocol"` + + // 文件大小 + Size *uint64 `json:"Size,omitnil,omitempty" name:"Size"` + + // 复核时间 + ConfirmTime *string `json:"ConfirmTime,omitnil,omitempty" name:"ConfirmTime"` + + // 用户部门id + UserDepartmentId *string `json:"UserDepartmentId,omitnil,omitempty" name:"UserDepartmentId"` + + // 用户部门name + UserDepartmentName *string `json:"UserDepartmentName,omitnil,omitempty" name:"UserDepartmentName"` + + // 设备部门id + DeviceDepartmentId *string `json:"DeviceDepartmentId,omitnil,omitempty" name:"DeviceDepartmentId"` + + // 设备部门name + DeviceDepartmentName *string `json:"DeviceDepartmentName,omitnil,omitempty" name:"DeviceDepartmentName"` + + // 签名值 + SignValue *string `json:"SignValue,omitnil,omitempty" name:"SignValue"` +} + +type SearchFileTypeFilter struct { + // 需要查询的文件传输类型,如SFTP/CLIP/RDP/RZSZ + Protocol *string `json:"Protocol,omitnil,omitempty" name:"Protocol"` + + // 在当前指定的protocol下进一步过滤具体操作类型,如剪贴板文件上传,剪贴板文件下载等 + Method []*int64 `json:"Method,omitnil,omitempty" name:"Method"` +} + +// Predefined struct for user +type SearchSessionCommandRequestParams struct { + // 检索的目标命令,为模糊搜索 + Cmd *string `json:"Cmd,omitnil,omitempty" name:"Cmd"` + + // 开始时间,不得早于当前时间的180天前 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 默认值为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // Cmd字段前端是否做base64加密 + // 0:否,1:是 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` + + // 结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` +} + +type SearchSessionCommandRequest struct { + *tchttp.BaseRequest + + // 检索的目标命令,为模糊搜索 + Cmd *string `json:"Cmd,omitnil,omitempty" name:"Cmd"` + + // 开始时间,不得早于当前时间的180天前 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 分页偏移位置,默认值为0 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 默认值为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // Cmd字段前端是否做base64加密 + // 0:否,1:是 + Encoding *uint64 `json:"Encoding,omitnil,omitempty" name:"Encoding"` + + // 结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` +} + +func (r *SearchSessionCommandRequest) 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 *SearchSessionCommandRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "Cmd") + delete(f, "StartTime") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "Encoding") + delete(f, "EndTime") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SearchSessionCommandRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchSessionCommandResponseParams struct { + // 记录总数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SearchSessionCommandResponse struct { + *tchttp.BaseResponse + Response *SearchSessionCommandResponseParams `json:"Response"` +} + +func (r *SearchSessionCommandResponse) 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 *SearchSessionCommandResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchSessionRequestParams struct { + // 内部Ip + PrivateIp *string `json:"PrivateIp,omitnil,omitempty" name:"PrivateIp"` + + // 外部Ip + PublicIp *string `json:"PublicIp,omitnil,omitempty" name:"PublicIp"` + + // 用户名,长度不超过20 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 账号,长度不超过64 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 来源Ip + FromIp *string `json:"FromIp,omitnil,omitempty" name:"FromIp"` + + // 搜索区间的开始时间。若入参是Id,则非必传,否则为必传。 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 搜索区间的结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 会话协议类型,只能是1、2、3或4 对应关系为1-tui 2-gui 3-file 4-数据库。若入参是Id,则非必传,否则为必传。 + Kind *uint64 `json:"Kind,omitnil,omitempty" name:"Kind"` + + // 偏移量 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 分页的页内记录数,默认为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 姓名,长度不超过20 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 主机名,长度不超过64 + DeviceName *string `json:"DeviceName,omitnil,omitempty" name:"DeviceName"` + + // 状态,1为活跃,2为结束,3为强制离线,4为其他错误 + Status *uint64 `json:"Status,omitnil,omitempty" name:"Status"` + + // 状态,1为活跃,2为结束,3为强制离线 + StatusSet []*uint64 `json:"StatusSet,omitnil,omitempty" name:"StatusSet"` + + // 若入参为Id,则其他入参字段不作为搜索依据,仅按照Id来搜索会话 + Id *string `json:"Id,omitnil,omitempty" name:"Id"` + + // 应用资产类型, 1-web + AppAssetKindSet []*uint64 `json:"AppAssetKindSet,omitnil,omitempty" name:"AppAssetKindSet"` + + // 应用资产Url + AppAssetUrl *string `json:"AppAssetUrl,omitnil,omitempty" name:"AppAssetUrl"` + + // 资产类型 + DeviceKind *string `json:"DeviceKind,omitnil,omitempty" name:"DeviceKind"` + + // 资产类型 Linux, EKS,TKE + DeviceKindSet []*string `json:"DeviceKindSet,omitnil,omitempty" name:"DeviceKindSet"` +} + +type SearchSessionRequest struct { + *tchttp.BaseRequest + + // 内部Ip + PrivateIp *string `json:"PrivateIp,omitnil,omitempty" name:"PrivateIp"` + + // 外部Ip + PublicIp *string `json:"PublicIp,omitnil,omitempty" name:"PublicIp"` + + // 用户名,长度不超过20 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 账号,长度不超过64 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 来源Ip + FromIp *string `json:"FromIp,omitnil,omitempty" name:"FromIp"` + + // 搜索区间的开始时间。若入参是Id,则非必传,否则为必传。 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 搜索区间的结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 会话协议类型,只能是1、2、3或4 对应关系为1-tui 2-gui 3-file 4-数据库。若入参是Id,则非必传,否则为必传。 + Kind *uint64 `json:"Kind,omitnil,omitempty" name:"Kind"` + + // 偏移量 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 分页的页内记录数,默认为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 姓名,长度不超过20 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 主机名,长度不超过64 + DeviceName *string `json:"DeviceName,omitnil,omitempty" name:"DeviceName"` + + // 状态,1为活跃,2为结束,3为强制离线,4为其他错误 + Status *uint64 `json:"Status,omitnil,omitempty" name:"Status"` + + // 状态,1为活跃,2为结束,3为强制离线 + StatusSet []*uint64 `json:"StatusSet,omitnil,omitempty" name:"StatusSet"` + + // 若入参为Id,则其他入参字段不作为搜索依据,仅按照Id来搜索会话 + Id *string `json:"Id,omitnil,omitempty" name:"Id"` + + // 应用资产类型, 1-web + AppAssetKindSet []*uint64 `json:"AppAssetKindSet,omitnil,omitempty" name:"AppAssetKindSet"` + + // 应用资产Url + AppAssetUrl *string `json:"AppAssetUrl,omitnil,omitempty" name:"AppAssetUrl"` + + // 资产类型 + DeviceKind *string `json:"DeviceKind,omitnil,omitempty" name:"DeviceKind"` + + // 资产类型 Linux, EKS,TKE + DeviceKindSet []*string `json:"DeviceKindSet,omitnil,omitempty" name:"DeviceKindSet"` +} + +func (r *SearchSessionRequest) 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 *SearchSessionRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "PrivateIp") + delete(f, "PublicIp") + delete(f, "UserName") + delete(f, "Account") + delete(f, "FromIp") + delete(f, "StartTime") + delete(f, "EndTime") + delete(f, "Kind") + delete(f, "Offset") + delete(f, "Limit") + delete(f, "RealName") + delete(f, "DeviceName") + delete(f, "Status") + delete(f, "StatusSet") + delete(f, "Id") + delete(f, "AppAssetKindSet") + delete(f, "AppAssetUrl") + delete(f, "DeviceKind") + delete(f, "DeviceKindSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SearchSessionRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchSessionResponseParams struct { + // 记录数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 会话信息列表 + SessionSet []*SessionResult `json:"SessionSet,omitnil,omitempty" name:"SessionSet"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SearchSessionResponse struct { + *tchttp.BaseResponse + Response *SearchSessionResponseParams `json:"Response"` +} + +func (r *SearchSessionResponse) 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 *SearchSessionResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchSubtaskResultByIdRequestParams struct { + // 运维任务名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 查询偏移 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 分页的页内记录数,默认为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 运维父任务执行日志ID + Id *string `json:"Id,omitnil,omitempty" name:"Id"` + + // 运维父任务执行状态 + Status []*uint64 `json:"Status,omitnil,omitempty" name:"Status"` +} + +type SearchSubtaskResultByIdRequest struct { + *tchttp.BaseRequest + + // 运维任务名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 查询偏移 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 分页的页内记录数,默认为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` + + // 运维父任务执行日志ID + Id *string `json:"Id,omitnil,omitempty" name:"Id"` + + // 运维父任务执行状态 + Status []*uint64 `json:"Status,omitnil,omitempty" name:"Status"` +} + +func (r *SearchSubtaskResultByIdRequest) 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 *SearchSubtaskResultByIdRequest) 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, "Offset") + delete(f, "Limit") + delete(f, "Id") + delete(f, "Status") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SearchSubtaskResultByIdRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchSubtaskResultByIdResponseParams struct { + // 记录数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SearchSubtaskResultByIdResponse struct { + *tchttp.BaseResponse + Response *SearchSubtaskResultByIdResponseParams `json:"Response"` +} + +func (r *SearchSubtaskResultByIdResponse) 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 *SearchSubtaskResultByIdResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchTaskResultRequestParams struct { + // 搜索区间的开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 搜索区间的结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 运维任务ID + OperationId *string `json:"OperationId,omitnil,omitempty" name:"OperationId"` + + // 运维任务名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 用户名,长度不超过20 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名,长度不超过20 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 任务类型 + // 1 手工运维任务 + // 2 定时任务 + // 3 账号推送任务 + TaskType []*uint64 `json:"TaskType,omitnil,omitempty" name:"TaskType"` + + // 查询偏移 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 分页的页内记录数,默认为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +type SearchTaskResultRequest struct { + *tchttp.BaseRequest + + // 搜索区间的开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 搜索区间的结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 运维任务ID + OperationId *string `json:"OperationId,omitnil,omitempty" name:"OperationId"` + + // 运维任务名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 用户名,长度不超过20 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名,长度不超过20 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 任务类型 + // 1 手工运维任务 + // 2 定时任务 + // 3 账号推送任务 + TaskType []*uint64 `json:"TaskType,omitnil,omitempty" name:"TaskType"` + + // 查询偏移 + Offset *uint64 `json:"Offset,omitnil,omitempty" name:"Offset"` + + // 分页的页内记录数,默认为20,最大200 + Limit *uint64 `json:"Limit,omitnil,omitempty" name:"Limit"` +} + +func (r *SearchTaskResultRequest) 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 *SearchTaskResultRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "StartTime") + delete(f, "EndTime") + delete(f, "OperationId") + delete(f, "Name") + delete(f, "UserName") + delete(f, "RealName") + delete(f, "TaskType") + delete(f, "Offset") + delete(f, "Limit") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SearchTaskResultRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SearchTaskResultResponseParams struct { + // 记录数 + TotalCount *uint64 `json:"TotalCount,omitnil,omitempty" name:"TotalCount"` + + // 运维任务执行结果 + TaskResult []*TaskResult `json:"TaskResult,omitnil,omitempty" name:"TaskResult"` + + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SearchTaskResultResponse struct { + *tchttp.BaseResponse + Response *SearchTaskResultResponseParams `json:"Response"` +} + +func (r *SearchTaskResultResponse) 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 *SearchTaskResultResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type SecuritySetting struct { + // 国密认证方式设置 + AuthModeGM *AuthModeSetting `json:"AuthModeGM,omitnil,omitempty" name:"AuthModeGM"` + + // 资产重连次数 + Reconnection *ReconnectionSetting `json:"Reconnection,omitnil,omitempty" name:"Reconnection"` +} + +type SessionResult struct { + // 用户名 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 姓名 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 主机账号 + Account *string `json:"Account,omitnil,omitempty" name:"Account"` + + // 开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` + + // 会话大小 + Size *uint64 `json:"Size,omitnil,omitempty" name:"Size"` + + // 设备ID + InstanceId *string `json:"InstanceId,omitnil,omitempty" name:"InstanceId"` + + // 设备名 + DeviceName *string `json:"DeviceName,omitnil,omitempty" name:"DeviceName"` + + // 内部Ip + PrivateIp *string `json:"PrivateIp,omitnil,omitempty" name:"PrivateIp"` + + // 外部Ip + PublicIp *string `json:"PublicIp,omitnil,omitempty" name:"PublicIp"` + + // 来源Ip + FromIp *string `json:"FromIp,omitnil,omitempty" name:"FromIp"` + + // 会话持续时长 + Duration *float64 `json:"Duration,omitnil,omitempty" name:"Duration"` + + // 该会话内命令数量 ,搜索图形会话时该字段无意义 + Count *uint64 `json:"Count,omitnil,omitempty" name:"Count"` + + // 该会话内高危命令数,搜索图形时该字段无意义 + DangerCount *uint64 `json:"DangerCount,omitnil,omitempty" name:"DangerCount"` + + // 会话状态,如1会话活跃 2会话结束 3强制离线 4其他错误 + Status *uint64 `json:"Status,omitnil,omitempty" name:"Status"` + + // 会话Id + Id *string `json:"Id,omitnil,omitempty" name:"Id"` + + // 设备所属的地域 + ApCode *string `json:"ApCode,omitnil,omitempty" name:"ApCode"` + + // 会话协议 + Protocol *string `json:"Protocol,omitnil,omitempty" name:"Protocol"` + + // 应用资产类型:1-web + AppAssetKind *uint64 `json:"AppAssetKind,omitnil,omitempty" name:"AppAssetKind"` + + // 应用资产url + AppAssetUrl *string `json:"AppAssetUrl,omitnil,omitempty" name:"AppAssetUrl"` + + // 回放类型 默认0, 1-rfb 2-mp4 3-ssh + ReplayType *uint64 `json:"ReplayType,omitnil,omitempty" name:"ReplayType"` + + // 会话资产类型 + DeviceKind *string `json:"DeviceKind,omitnil,omitempty" name:"DeviceKind"` + + // K8S集群命名空间 + Namespace *string `json:"Namespace,omitnil,omitempty" name:"Namespace"` + + // K8S集群工作负载 + Workload *string `json:"Workload,omitnil,omitempty" name:"Workload"` + + // K8S集群容器名称 + PodName *string `json:"PodName,omitnil,omitempty" name:"PodName"` +} + +// Predefined struct for user +type SetLDAPSyncFlagRequestParams struct { + +} + +type SetLDAPSyncFlagRequest struct { + *tchttp.BaseRequest + +} + +func (r *SetLDAPSyncFlagRequest) 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 *SetLDAPSyncFlagRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SetLDAPSyncFlagRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SetLDAPSyncFlagResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SetLDAPSyncFlagResponse struct { + *tchttp.BaseResponse + Response *SetLDAPSyncFlagResponseParams `json:"Response"` +} + +func (r *SetLDAPSyncFlagResponse) 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 *SetLDAPSyncFlagResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type SourceType struct { + // 账号组来源 + Source *int64 `json:"Source,omitnil,omitempty" name:"Source"` + + // 账号组来源类型 + Type *string `json:"Type,omitnil,omitempty" name:"Type"` + + // 账号组来源名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 区分ioa原来和iam-mini + Target *string `json:"Target,omitnil,omitempty" name:"Target"` +} + +// Predefined struct for user +type SyncDevicesToIOARequestParams struct { + // 资产ID集合。资产必须已绑定支持IOA功能的堡垒机实例。每次最多同步200个资产。 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` +} + +type SyncDevicesToIOARequest struct { + *tchttp.BaseRequest + + // 资产ID集合。资产必须已绑定支持IOA功能的堡垒机实例。每次最多同步200个资产。 + DeviceIdSet []*uint64 `json:"DeviceIdSet,omitnil,omitempty" name:"DeviceIdSet"` +} + +func (r *SyncDevicesToIOARequest) 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 *SyncDevicesToIOARequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "DeviceIdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SyncDevicesToIOARequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SyncDevicesToIOAResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SyncDevicesToIOAResponse struct { + *tchttp.BaseResponse + Response *SyncDevicesToIOAResponseParams `json:"Response"` +} + +func (r *SyncDevicesToIOAResponse) 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 *SyncDevicesToIOAResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SyncUserToIOARequestParams struct { + // 需要同步到ioa的本地用户的id集合 + UserIdSet []*uint64 `json:"UserIdSet,omitnil,omitempty" name:"UserIdSet"` +} + +type SyncUserToIOARequest struct { + *tchttp.BaseRequest + + // 需要同步到ioa的本地用户的id集合 + UserIdSet []*uint64 `json:"UserIdSet,omitnil,omitempty" name:"UserIdSet"` +} + +func (r *SyncUserToIOARequest) 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 *SyncUserToIOARequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "UserIdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SyncUserToIOARequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type SyncUserToIOAResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type SyncUserToIOAResponse struct { + *tchttp.BaseResponse + Response *SyncUserToIOAResponseParams `json:"Response"` +} + +func (r *SyncUserToIOAResponse) 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 *SyncUserToIOAResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type TagFilter struct { + // 标签键 + TagKey *string `json:"TagKey,omitnil,omitempty" name:"TagKey"` + + // 标签值 + TagValue []*string `json:"TagValue,omitnil,omitempty" name:"TagValue"` +} + +type TaskResult struct { + // 运维任务结果日志ID + Id *string `json:"Id,omitnil,omitempty" name:"Id"` + + // 运维任务ID + OperationId *string `json:"OperationId,omitnil,omitempty" name:"OperationId"` + + // 运维任务名称 + Name *string `json:"Name,omitnil,omitempty" name:"Name"` + + // 执行任务来源IP + FromIp *string `json:"FromIp,omitnil,omitempty" name:"FromIp"` + + // 运维任务所属用户 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 运维任务所属用户的姓名 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 运维任务执行状态 1 - 执行中,2 - 成功,3 - 失败,4 - 部分失败 + Status *uint64 `json:"Status,omitnil,omitempty" name:"Status"` + + // 运维任务开始时间 + StartTime *string `json:"StartTime,omitnil,omitempty" name:"StartTime"` + + // 运维任务结束时间 + EndTime *string `json:"EndTime,omitnil,omitempty" name:"EndTime"` +} + +// Predefined struct for user +type UnlockUserRequestParams struct { + // 用户id + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +type UnlockUserRequest struct { + *tchttp.BaseRequest + + // 用户id + IdSet []*uint64 `json:"IdSet,omitnil,omitempty" name:"IdSet"` +} + +func (r *UnlockUserRequest) 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 *UnlockUserRequest) FromJsonString(s string) error { + f := make(map[string]interface{}) + if err := json.Unmarshal([]byte(s), &f); err != nil { + return err + } + delete(f, "IdSet") + if len(f) > 0 { + return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "UnlockUserRequest has unknown keys!", "") + } + return json.Unmarshal([]byte(s), &r) +} + +// Predefined struct for user +type UnlockUserResponseParams struct { + // 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 + RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"` +} + +type UnlockUserResponse struct { + *tchttp.BaseResponse + Response *UnlockUserResponseParams `json:"Response"` +} + +func (r *UnlockUserResponse) 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 *UnlockUserResponse) FromJsonString(s string) error { + return json.Unmarshal([]byte(s), &r) +} + +type User struct { + // 用户名,1 - 128个字符 必须以英文字母开头,只能由a-zA-Z0-9以及+=,.@_-组成,支持邮箱格式 + UserName *string `json:"UserName,omitnil,omitempty" name:"UserName"` + + // 用户姓名, 最大20个字符,不能包含空白字符 + RealName *string `json:"RealName,omitnil,omitempty" name:"RealName"` + + // 用户ID + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // 手机号码, 大陆手机号直接填写,如果是其他国家、地区号码,按照"国家地区代码|手机号"的格式输入。如: "+852|xxxxxxxx" + Phone *string `json:"Phone,omitnil,omitempty" name:"Phone"` + + // 电子邮件 + Email *string `json:"Email,omitnil,omitempty" name:"Email"` + + // 用户生效时间,如:"2021-09-22T00:00:00+00:00" + // 生效、失效时间不填则用户长期有效 + ValidateFrom *string `json:"ValidateFrom,omitnil,omitempty" name:"ValidateFrom"` + + // 用户失效时间,如:"2021-09-22T00:00:00+00:00" + // 生效、失效时间不填则用户长期有效 + ValidateTo *string `json:"ValidateTo,omitnil,omitempty" name:"ValidateTo"` + + // 所属用户组列表 + GroupSet []*Group `json:"GroupSet,omitnil,omitempty" name:"GroupSet"` + + // 认证方式,0 - 本地,1 - LDAP,2 - OAuth + AuthType *uint64 `json:"AuthType,omitnil,omitempty" name:"AuthType"` + + // 访问时间段限制, 由0、1组成的字符串,长度168(7 × 24),代表该用户在一周中允许访问的时间段。字符串中第N个字符代表在一周中的第N个小时, 0 - 代表不允许访问,1 - 代表允许访问 + ValidateTime *string `json:"ValidateTime,omitnil,omitempty" name:"ValidateTime"` + + // 用户所属部门(用于出参) + Department *Department `json:"Department,omitnil,omitempty" name:"Department"` + + // 用户所属部门(用于入参) + DepartmentId *string `json:"DepartmentId,omitnil,omitempty" name:"DepartmentId"` + + // 激活状态 0 - 未激活 1 - 激活 + ActiveStatus *uint64 `json:"ActiveStatus,omitnil,omitempty" name:"ActiveStatus"` + + // 锁定状态 0 - 未锁定 1 - 锁定 + LockStatus *uint64 `json:"LockStatus,omitnil,omitempty" name:"LockStatus"` + + // ukey绑定状态 0 - 未绑定 1 - 已绑定 + UKeyStatus *int64 `json:"UKeyStatus,omitnil,omitempty" name:"UKeyStatus"` + + // 状态 与Filter中一致 + Status *string `json:"Status,omitnil,omitempty" name:"Status"` + + // 权限版本 + AclVersion *uint64 `json:"AclVersion,omitnil,omitempty" name:"AclVersion"` + + // 用户来源,0-bh,1-ioa + UserFrom *uint64 `json:"UserFrom,omitnil,omitempty" name:"UserFrom"` + + // ioa同步过来的用户相关信息 + IOAUserGroup *IOAUserGroup `json:"IOAUserGroup,omitnil,omitempty" name:"IOAUserGroup"` + + // cam角色用户载体 + RoleArn *string `json:"RoleArn,omitnil,omitempty" name:"RoleArn"` +} + +type UserDirectory struct { + // 目录id + Id *uint64 `json:"Id,omitnil,omitempty" name:"Id"` + + // ioa目录id + DirId *uint64 `json:"DirId,omitnil,omitempty" name:"DirId"` + + // ioa目录名称 + DirName *string `json:"DirName,omitnil,omitempty" name:"DirName"` + + // ioa关联用户源类型 + Source *uint64 `json:"Source,omitnil,omitempty" name:"Source"` + + // ioa关联用户源名称 + SourceName *string `json:"SourceName,omitnil,omitempty" name:"SourceName"` + + // 目录包含用户数 + UserTotal *uint64 `json:"UserTotal,omitnil,omitempty" name:"UserTotal"` + + // 目录接入时间 + CreateTime *string `json:"CreateTime,omitnil,omitempty" name:"CreateTime"` + + // 目录下的组织细节信息 + UserOrgSet []*UserOrg `json:"UserOrgSet,omitnil,omitempty" name:"UserOrgSet"` +} + +type UserOrg struct { + // ioa用户组织id + OrgId *uint64 `json:"OrgId,omitnil,omitempty" name:"OrgId"` + + // ioa用户组织名称 + OrgName *string `json:"OrgName,omitnil,omitempty" name:"OrgName"` + + // ioa用户组织id路径 + OrgIdPath *string `json:"OrgIdPath,omitnil,omitempty" name:"OrgIdPath"` + + // ioa用户组织名称路径 + OrgNamePath *string `json:"OrgNamePath,omitnil,omitempty" name:"OrgNamePath"` + + // ioa用户组织id下的用户数 + UserTotal *uint64 `json:"UserTotal,omitnil,omitempty" name:"UserTotal"` +} \ No newline at end of file diff --git a/vendor/modules.txt b/vendor/modules.txt index 2a7cf40306..228e35be25 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1113,6 +1113,9 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/apm/v20210622 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as v1.3.4 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/as/v20180419 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh v1.3.7 +## explicit; go 1.14 +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bh/v20230418 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi v1.0.824 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/bi/v20220105 diff --git a/website/docs/d/bh_account_groups.html.markdown b/website/docs/d/bh_account_groups.html.markdown new file mode 100644 index 0000000000..4e281b185a --- /dev/null +++ b/website/docs/d/bh_account_groups.html.markdown @@ -0,0 +1,61 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_account_groups" +sidebar_current: "docs-tencentcloud-datasource-bh_account_groups" +description: |- + Use this data source to query detailed information of BH account groups +--- + +# tencentcloud_bh_account_groups + +Use this data source to query detailed information of BH account groups + +## Example Usage + +### Query all bh account groups + +```hcl +data "tencentcloud_bh_account_groups" "example" {} +``` + +### Query bh account groups by filter + +```hcl +data "tencentcloud_bh_account_groups" "example" { + deep_in = 1 + parent_id = 819729 + group_name = "tf-example" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `deep_in` - (Optional, Int) Whether to recursively query, 0 for non-recursive, 1 for recursive. +* `group_name` - (Optional, String) Account group name, fuzzy query. +* `page_num` - (Optional, Int) Get data from which page. +* `parent_id` - (Optional, Int) Parent account group ID, default 0, query all groups under the root account group. +* `result_output_file` - (Optional, String) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `account_group_set` - Account group information. + * `description` - Account group description. + * `id_path` - Account group ID path. + * `id` - Account group ID. + * `import_type` - Account group import type. + * `is_leaf` - Whether it is a leaf node. + * `name_path` - Account group name path. + * `name` - Account group name. + * `org_id` - Source account organization ID. When using third-party import user sources, record the group ID of this group in the source organization structure. + * `parent_id` - Parent account group ID. + * `parent_org_id` - Parent source account organization ID. When using third-party import user sources, record the group ID of this group in the source organization structure. + * `source` - Account group source. + * `status` - Whether the account group has been connected, 0 means not connected, 1 means connected. + * `user_total` - Total number of users under the account group. + + diff --git a/website/docs/d/bh_source_types.html.markdown b/website/docs/d/bh_source_types.html.markdown new file mode 100644 index 0000000000..3084b4c136 --- /dev/null +++ b/website/docs/d/bh_source_types.html.markdown @@ -0,0 +1,36 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_source_types" +sidebar_current: "docs-tencentcloud-datasource-bh_source_types" +description: |- + Use this data source to query detailed information of BH source types +--- + +# tencentcloud_bh_source_types + +Use this data source to query detailed information of BH source types + +## Example Usage + +```hcl +data "tencentcloud_bh_source_types" "example" {} +``` + +## Argument Reference + +The following arguments are supported: + +* `result_output_file` - (Optional, String) Used to save results. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `source_type_set` - Authentication source information. + * `name` - Account group source name. + * `source` - Account group source. + * `target` - Distinguish between ioa original and iam-mini. + * `type` - Account group source type. + + diff --git a/website/docs/r/bh_access_white_list_config.html.markdown b/website/docs/r/bh_access_white_list_config.html.markdown new file mode 100644 index 0000000000..658c066332 --- /dev/null +++ b/website/docs/r/bh_access_white_list_config.html.markdown @@ -0,0 +1,45 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_access_white_list_config" +sidebar_current: "docs-tencentcloud-resource-bh_access_white_list_config" +description: |- + Provides a resource to create a BH access white list config +--- + +# tencentcloud_bh_access_white_list_config + +Provides a resource to create a BH access white list config + +## Example Usage + +```hcl +resource "tencentcloud_bh_access_white_list_config" "example" { + allow_any = false + allow_auto = false +} +``` + +## Argument Reference + +The following arguments are supported: + +* `allow_any` - (Optional, Bool) true: allow all source IPs; false: do not allow all source IPs. +* `allow_auto` - (Optional, Bool) true: allow automatically added IPs; false: do not allow automatically added IPs. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +BH access white list config can be imported using the customId(like uuid or base64 string), e.g. + +``` +terraform import tencentcloud_bh_access_white_list_config.example zDxkr768TFYadnFdX1fusQ== +``` + diff --git a/website/docs/r/bh_access_white_list_rule.html.markdown b/website/docs/r/bh_access_white_list_rule.html.markdown new file mode 100644 index 0000000000..9d78716191 --- /dev/null +++ b/website/docs/r/bh_access_white_list_rule.html.markdown @@ -0,0 +1,45 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_access_white_list_rule" +sidebar_current: "docs-tencentcloud-resource-bh_access_white_list_rule" +description: |- + Provides a resource to create a BH access white list rule +--- + +# tencentcloud_bh_access_white_list_rule + +Provides a resource to create a BH access white list rule + +## Example Usage + +```hcl +resource "tencentcloud_bh_access_white_list_rule" "example" { + source = "1.1.1.1" + remark = "remark." +} +``` + +## Argument Reference + +The following arguments are supported: + +* `source` - (Required, String) IP address 10.10.10.1 or network segment 10.10.10.0/24, minimum length 4 bytes, maximum length 40 bytes. +* `remark` - (Optional, String) Remark information, minimum length 0 characters, maximum length 40 characters. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `rule_id` - ID of the access white list rule. + + +## Import + +BH access white list rule can be imported using the id, e.g. + +``` +terraform import tencentcloud_bh_access_white_list_rule.example 1235 +``` + diff --git a/website/docs/r/bh_asset_sync_flag_config.html.markdown b/website/docs/r/bh_asset_sync_flag_config.html.markdown new file mode 100644 index 0000000000..0991879d93 --- /dev/null +++ b/website/docs/r/bh_asset_sync_flag_config.html.markdown @@ -0,0 +1,43 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_asset_sync_flag_config" +sidebar_current: "docs-tencentcloud-resource-bh_asset_sync_flag_config" +description: |- + Provides a resource to create a BH asset sync flag config +--- + +# tencentcloud_bh_asset_sync_flag_config + +Provides a resource to create a BH asset sync flag config + +## Example Usage + +```hcl +resource "tencentcloud_bh_asset_sync_flag_config" "example" { + auto_sync = true +} +``` + +## Argument Reference + +The following arguments are supported: + +* `auto_sync` - (Required, Bool) Whether to enable asset auto-sync, false - disabled, true - enabled. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `role_granted` - Whether the role has been authorized, false - not authorized, true - authorized. + + +## Import + +BH asset sync flag config can be imported using the customId(like uuid or base64 string), e.g. + +``` +terraform import tencentcloud_bh_asset_sync_flag_config.example yci5a1o76a5HzCaqJM2bQA== +``` + diff --git a/website/docs/r/bh_asset_sync_job_operation.html.markdown b/website/docs/r/bh_asset_sync_job_operation.html.markdown new file mode 100644 index 0000000000..d1fbf53ffd --- /dev/null +++ b/website/docs/r/bh_asset_sync_job_operation.html.markdown @@ -0,0 +1,35 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_asset_sync_job_operation" +sidebar_current: "docs-tencentcloud-resource-bh_asset_sync_job_operation" +description: |- + Provides a resource to create a BH asset sync job operation +--- + +# tencentcloud_bh_asset_sync_job_operation + +Provides a resource to create a BH asset sync job operation + +## Example Usage + +```hcl +resource "tencentcloud_bh_asset_sync_job_operation" "example" { + category = 1 +} +``` + +## Argument Reference + +The following arguments are supported: + +* `category` - (Required, Int, ForceNew) Asset synchronization category, 1 - host assets, 2 - database assets. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/docs/r/bh_device.html.markdown b/website/docs/r/bh_device.html.markdown new file mode 100644 index 0000000000..b9f3782519 --- /dev/null +++ b/website/docs/r/bh_device.html.markdown @@ -0,0 +1,67 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_device" +sidebar_current: "docs-tencentcloud-resource-bh_device" +description: |- + Provides a resource to create a BH device +--- + +# tencentcloud_bh_device + +Provides a resource to create a BH device + +## Example Usage + +```hcl +resource "tencentcloud_bh_device" "example" { + device_set { + os_name = "Linux" + ip = "1.1.1.1" + port = 22 + name = "tf-example" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `device_set` - (Required, List) Asset parameter list. +* `account_id` - (Optional, Int, ForceNew) Cloud account ID to which the asset belongs. + +The `device_set` object supports the following: + +* `ip` - (Required, String, ForceNew) IP address. +* `os_name` - (Required, String, ForceNew) Operating system name, can only be Linux, Windows or MySQL. +* `port` - (Required, Int) Management port. +* `ap_code` - (Optional, String, ForceNew) Region to which the asset belongs. +* `ap_name` - (Optional, String, ForceNew) Region name. +* `department_id` - (Optional, String) Department ID to which the asset belongs. +* `enable_ssl` - (Optional, Int, ForceNew) Whether to enable SSL, 1: enable, 0: disable, only supports Redis assets. +* `instance_id` - (Optional, String, ForceNew) Asset instance ID. +* `ip_port_set` - (Optional, Set, ForceNew) Asset multi-node: IP and port fields. +* `name` - (Optional, String, ForceNew) Host name, can be empty. +* `public_ip` - (Optional, String, ForceNew) Public IP. +* `ssl_cert_name` - (Optional, String, ForceNew) SSL certificate name, required when EnableSSL is enabled. +* `ssl_cert` - (Optional, String, ForceNew) SSL certificate, required when EnableSSL is enabled. +* `subnet_id` - (Optional, String, ForceNew) Subnet to which the asset belongs. +* `vpc_id` - (Optional, String, ForceNew) VPC to which the asset belongs. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `device_id` - ID of the device. + + +## Import + +BH device can be imported using the id, e.g. + +``` +terraform import tencentcloud_bh_device.example 1875 +``` + diff --git a/website/docs/r/bh_reconnection_setting_config.html.markdown b/website/docs/r/bh_reconnection_setting_config.html.markdown new file mode 100644 index 0000000000..243ea5578b --- /dev/null +++ b/website/docs/r/bh_reconnection_setting_config.html.markdown @@ -0,0 +1,45 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_reconnection_setting_config" +sidebar_current: "docs-tencentcloud-resource-bh_reconnection_setting_config" +description: |- + Provides a resource to create a BH reconnection setting config +--- + +# tencentcloud_bh_reconnection_setting_config + +Provides a resource to create a BH reconnection setting config + +## Example Usage + +```hcl +resource "tencentcloud_bh_reconnection_setting_config" "example" { + reconnection_max_count = 5 + enable = true +} +``` + +## Argument Reference + +The following arguments are supported: + +* `enable` - (Required, Bool) true: limit reconnection count, false: do not limit reconnection count. +* `reconnection_max_count` - (Required, Int) Retry count, value range: 0-20. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +BH reconnection setting config can be imported using the customId(like uuid or base64 string), e.g. + +``` +terraform import tencentcloud_bh_reconnection_setting_config.example gO1Ew6OEgLcQun164XiWmw== +``` + diff --git a/website/docs/r/bh_resource.html.markdown b/website/docs/r/bh_resource.html.markdown new file mode 100644 index 0000000000..e091482165 --- /dev/null +++ b/website/docs/r/bh_resource.html.markdown @@ -0,0 +1,65 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_resource" +sidebar_current: "docs-tencentcloud-resource-bh_resource" +description: |- + Provides a resource to create a BH resource +--- + +# tencentcloud_bh_resource + +Provides a resource to create a BH resource + +## Example Usage + +```hcl +resource "tencentcloud_bh_resource" "example" { + deploy_region = "ap-guangzhou" + vpc_id = "vpc-q1of50wz" + subnet_id = "subnet-7uhvm46o" + resource_edition = "standard" + resource_node = 20 + time_unit = "m" + time_span = "1" + pay_mode = 1 + auto_renew_flag = 1 + deploy_zone = "ap-guangzhou-6" + cidr_block = "192.168.11.0/24" + vpc_cidr_block = "192.168.0.0/16" + intranet_access = 1 + external_access = 1 +} +``` + +## Argument Reference + +The following arguments are supported: + +* `auto_renew_flag` - (Required, Int) Auto-renewal. +* `cidr_block` - (Required, String, ForceNew) CIDR block of the bastion host. +* `deploy_region` - (Required, String, ForceNew) Deployment region. +* `deploy_zone` - (Required, String, ForceNew) Deployment zone. +* `pay_mode` - (Required, Int, ForceNew) Billing mode, 1 for prepaid. +* `resource_edition` - (Required, String) Resource type. Values: standard/pro. +* `resource_node` - (Required, Int) Number of resource nodes. +* `subnet_id` - (Required, String, ForceNew) Subnet ID for deploying the bastion host. +* `time_span` - (Required, Int, ForceNew) Billing duration. +* `time_unit` - (Required, String, ForceNew) Billing cycle. +* `vpc_cidr_block` - (Required, String, ForceNew) The network segment corresponding to the VPC that needs to activate the service. +* `vpc_id` - (Required, String, ForceNew) VPC ID for deploying the bastion host. +* `client_access` - (Optional, Int, ForceNew) 0 - Disable client access to the bastion host; 1 - Enable client access to the bastion host. +* `external_access` - (Optional, Int) 0 - Disable public network access to the bastion host; 1 - Enable public network access to the bastion host. +* `intranet_access` - (Optional, Int) 0 - Disable internal network access bastion host; 1 - Enable internal network access bastion host. +* `share_clb` - (Optional, Int, ForceNew) Whether to share CLB, 0: not shared, 1: shared. +* `trial` - (Optional, Int, ForceNew) 0 for non-trial version, 1 for trial version. +* `web_access` - (Optional, Int, ForceNew) 0 - Disable web access bastion host; 1 - Enable web access bastion host. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `resource_id` - Resource instance ID. + + diff --git a/website/docs/r/bh_sync_devices_to_ioa_operation.html.markdown b/website/docs/r/bh_sync_devices_to_ioa_operation.html.markdown new file mode 100644 index 0000000000..e9b8e3fd07 --- /dev/null +++ b/website/docs/r/bh_sync_devices_to_ioa_operation.html.markdown @@ -0,0 +1,39 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_sync_devices_to_ioa_operation" +sidebar_current: "docs-tencentcloud-resource-bh_sync_devices_to_ioa_operation" +description: |- + Provides a resource to create a BH sync devices to ioa operation +--- + +# tencentcloud_bh_sync_devices_to_ioa_operation + +Provides a resource to create a BH sync devices to ioa operation + +## Example Usage + +```hcl +resource "tencentcloud_bh_sync_devices_to_ioa_operation" "example" { + device_id_set = [ + 1934, + 1964, + 1895, + ] +} +``` + +## Argument Reference + +The following arguments are supported: + +* `device_id_set` - (Required, Set: [`Int`], ForceNew) Asset ID collection. Assets must be bound to bastion host instances that support IOA functionality. Maximum 200 assets can be synchronized at a time. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/docs/r/bh_user.html.markdown b/website/docs/r/bh_user.html.markdown new file mode 100644 index 0000000000..a3a6024884 --- /dev/null +++ b/website/docs/r/bh_user.html.markdown @@ -0,0 +1,56 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_user" +sidebar_current: "docs-tencentcloud-resource-bh_user" +description: |- + Provides a resource to create a BH user +--- + +# tencentcloud_bh_user + +Provides a resource to create a BH user + +## Example Usage + +```hcl +resource "tencentcloud_bh_user" "example" { + user_name = "tf-example" + real_name = "Terraform" + phone = "+86|18991162528" + email = "demo@tencent.com" + auth_type = 0 +} +``` + +## Argument Reference + +The following arguments are supported: + +* `real_name` - (Required, String) User's real name, maximum length 20 characters, cannot contain whitespace characters. +* `user_name` - (Required, String, ForceNew) Username, 3-20 characters, must start with an English letter and cannot contain characters other than `letters`, `numbers`, `.`, `_`, `-`. +* `auth_type` - (Optional, Int) Authentication method, 0 - local, 1 - LDAP, 2 - OAuth. Default is 0 if not provided. +* `department_id` - (Optional, String) Department ID to which the user belongs, e.g.: "1.2.3". +* `email` - (Optional, String) Email address. At least one of phone and email parameters must be provided. +* `group_id_set` - (Optional, Set: [`Int`]) User group ID set to which the user belongs. +* `phone` - (Optional, String) Input in the format of "country code|phone number", e.g.: "+86|xxxxxxxx". At least one of phone and email parameters must be provided. +* `validate_from` - (Optional, String) User effective time, e.g.: "2021-09-22T00:00:00+00:00". If effective and expiration times are not filled, the user will be valid permanently. +* `validate_time` - (Optional, String) Access time restriction, a string composed of 0 and 1 with length 168 (7 * 24), representing the time slots allowed for the user in a week. The Nth character in the string represents the Nth hour in the week, 0 - not allowed to access, 1 - allowed to access. +* `validate_to` - (Optional, String) User expiration time, e.g.: "2021-09-23T00:00:00+00:00". If effective and expiration times are not filled, the user will be valid permanently. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `user_id` - User ID. + + +## Import + +BH user can be imported using the id, e.g. + +``` +terraform import tencentcloud_bh_user.example 2322 +``` + diff --git a/website/docs/r/bh_user_directory.html.markdown b/website/docs/r/bh_user_directory.html.markdown new file mode 100644 index 0000000000..8885f35924 --- /dev/null +++ b/website/docs/r/bh_user_directory.html.markdown @@ -0,0 +1,75 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_user_directory" +sidebar_current: "docs-tencentcloud-resource-bh_user_directory" +description: |- + Provides a resource to create a BH user directory +--- + +# tencentcloud_bh_user_directory + +Provides a resource to create a BH user directory + +## Example Usage + +```hcl +resource "tencentcloud_bh_user_directory" "example" { + dir_id = 895784 + dir_name = "tf-example" + user_org_set { + org_id = 1576799 + org_name = "orgName1" + org_id_path = "819729.895784" + org_name_path = "Root.demo1" + user_total = 0 + } + + user_org_set { + org_id = 896536 + org_name = "orgName2" + org_id_path = "819729.895784.896536" + org_name_path = "Root.demo2.demo3" + user_total = 1 + } + source = 0 + source_name = "sourceName" + user_count = 3 +} +``` + +## Argument Reference + +The following arguments are supported: + +* `dir_id` - (Required, Int, ForceNew) Directory ID. +* `dir_name` - (Required, String, ForceNew) Directory name. +* `source_name` - (Required, String, ForceNew) IOA associated user source name. +* `source` - (Required, Int, ForceNew) IOA associated user source type. +* `user_count` - (Required, Int, ForceNew) Number of users included in the directory. +* `user_org_set` - (Required, List) IOA group information. + +The `user_org_set` object supports the following: + +* `org_id_path` - (Required, String) IOA user organization ID path. +* `org_id` - (Required, Int) IOA user organization ID. +* `org_name_path` - (Required, String) IOA user organization name path. +* `org_name` - (Required, String) IOA user organization name. +* `user_total` - (Optional, Int) Number of users under the IOA user organization ID. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `directory_id` - Directory ID. + + +## Import + +BH user directory can be imported using the id, e.g. + +``` +terraform import tencentcloud_bh_user_directory.example 32 +``` + diff --git a/website/docs/r/bh_user_group.html.markdown b/website/docs/r/bh_user_group.html.markdown new file mode 100644 index 0000000000..21df585bf1 --- /dev/null +++ b/website/docs/r/bh_user_group.html.markdown @@ -0,0 +1,44 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_user_group" +sidebar_current: "docs-tencentcloud-resource-bh_user_group" +description: |- + Provides a resource to create a BH user group +--- + +# tencentcloud_bh_user_group + +Provides a resource to create a BH user group + +## Example Usage + +```hcl +resource "tencentcloud_bh_user_group" "example" { + name = "tf-example" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required, String) User group name, maximum length 32 characters. +* `department_id` - (Optional, String) Department ID to which the user group belongs, e.g.: 1.2.3. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `user_group_id` - User group ID. + + +## Import + +BH user group can be imported using the id, e.g. + +``` +terraform import tencentcloud_bh_user_group.example 92 +``` + diff --git a/website/docs/r/bh_user_sync_task_operation.html.markdown b/website/docs/r/bh_user_sync_task_operation.html.markdown new file mode 100644 index 0000000000..ab615ec996 --- /dev/null +++ b/website/docs/r/bh_user_sync_task_operation.html.markdown @@ -0,0 +1,35 @@ +--- +subcategory: "Bastion Host(BH)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_bh_user_sync_task_operation" +sidebar_current: "docs-tencentcloud-resource-bh_user_sync_task_operation" +description: |- + Provides a resource to create a BH user sync task operation +--- + +# tencentcloud_bh_user_sync_task_operation + +Provides a resource to create a BH user sync task operation + +## Example Usage + +```hcl +resource "tencentcloud_bh_user_sync_task_operation" "example" { + user_kind = 1 +} +``` + +## Argument Reference + +The following arguments are supported: + +* `user_kind` - (Required, Int, ForceNew) Synchronized user type, 1-synchronize IOA users. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + diff --git a/website/docs/r/dasb_user.html.markdown b/website/docs/r/dasb_user.html.markdown index 4a06e2ad73..b4d28900cb 100644 --- a/website/docs/r/dasb_user.html.markdown +++ b/website/docs/r/dasb_user.html.markdown @@ -31,7 +31,7 @@ resource "tencentcloud_dasb_user" "example" { The following arguments are supported: * `real_name` - (Required, String) Real name, maximum length 20 characters, cannot contain blank characters. -* `user_name` - (Required, String) Username, 3-20 characters, must start with an English letter and cannot contain characters other than letters, numbers, '.', '_', '-'. +* `user_name` - (Required, String) Username, 3-20 characters, must start with an English letter and cannot contain characters other than `letters`, `numbers`, `.`, `_`, `-`. * `auth_type` - (Optional, Int) Authentication method, 0 - local, 1 - LDAP, 2 - OAuth. If not passed, the default is 0. * `department_id` - (Optional, String) Department ID, such as: 1.2.3. * `email` - (Optional, String) Email. Please provide at least one of `phone` or `email`. diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index 853d019fee..f48ef2567c 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -443,10 +443,56 @@